|
17 | 17 | import com.liferay.fragment.entry.processor.helper.FragmentEntryProcessorHelper;
|
18 | 18 | import com.liferay.fragment.processor.FragmentEntryProcessorContext;
|
19 | 19 | import com.liferay.info.exception.NoSuchInfoItemException;
|
| 20 | +import com.liferay.info.field.InfoField; |
20 | 21 | import com.liferay.info.field.InfoFieldValue;
|
| 22 | +import com.liferay.info.field.type.TextInfoFieldType; |
21 | 23 | import com.liferay.info.formatter.InfoCollectionTextFormatter;
|
22 | 24 | import com.liferay.info.formatter.InfoTextFormatter;
|
23 | 25 | import com.liferay.info.item.ClassPKInfoItemIdentifier;
|
|
41 | 43 | import com.liferay.portal.kernel.repository.model.FileEntry;
|
42 | 44 | import com.liferay.portal.kernel.trash.TrashHandler;
|
43 | 45 | import com.liferay.portal.kernel.trash.TrashHandlerRegistryUtil;
|
| 46 | +import com.liferay.portal.kernel.util.Html; |
44 | 47 | import com.liferay.portal.kernel.util.LocaleUtil;
|
45 | 48 | import com.liferay.portal.kernel.util.Portal;
|
46 | 49 | import com.liferay.portal.kernel.util.Validator;
|
@@ -494,6 +497,17 @@ private Object _getMappedInfoItemFieldValue(
|
494 | 497 | }
|
495 | 498 |
|
496 | 499 | if (value instanceof String) {
|
| 500 | + InfoField infoField = infoFieldValue.getInfoField(); |
| 501 | + |
| 502 | + if (infoField.getInfoFieldType() instanceof TextInfoFieldType) { |
| 503 | + Optional<Boolean> htmlOptional = infoField.getAttributeOptional( |
| 504 | + TextInfoFieldType.HTML); |
| 505 | + |
| 506 | + if (htmlOptional.orElse(false)) { |
| 507 | + return _html.escape((String)value); |
| 508 | + } |
| 509 | + } |
| 510 | + |
497 | 511 | return (String)value;
|
498 | 512 | }
|
499 | 513 |
|
@@ -533,6 +547,9 @@ private Object _getMappedInfoItemFieldValue(
|
533 | 547 | private static final Log _log = LogFactoryUtil.getLog(
|
534 | 548 | FragmentEntryProcessorHelperImpl.class);
|
535 | 549 |
|
| 550 | + @Reference |
| 551 | + private Html _html; |
| 552 | + |
536 | 553 | @Reference
|
537 | 554 | private InfoItemServiceRegistry _infoItemServiceRegistry;
|
538 | 555 |
|
|
0 commit comments