Merge pull request #2941 from HRavalomanana/PHRAS-2437_Prod_Overlay_title__the_text_is_repeated_if_more_than_102_caracters_

PHRAS-2437 Prod_Overlay_title__the_text_is_repeated_if_more_than_102_…
This commit is contained in:
Nicolas Maillat
2019-03-12 15:47:02 +01:00
committed by GitHub

View File

@@ -88,7 +88,7 @@ class PhraseanetExtension extends \Twig_Extension
$highlightValue = $highlights[$field]; $highlightValue = $highlights[$field];
// if field is multivalued, merge highlighted values with captions ones // if field is multivalued, merge highlighted values with captions ones
if (is_array($value)) { if (is_array($value) && count($value) > 1) {
$highlightValue = array_merge($highlightValue, array_diff($value, array_map(function($value) { $highlightValue = array_merge($highlightValue, array_diff($value, array_map(function($value) {
return str_replace(array('[[em]]', '[[/em]]'), array('', ''), $value); return str_replace(array('[[em]]', '[[/em]]'), array('', ''), $value);
}, $highlightValue))); }, $highlightValue)));