Fix some newsletter shortcodes not being interpreted

The issue was happening because array_unique keeps original keys and $processedShortcodes after refactoring contains different keys.
Application of array_intersect_key removed some processed short codes. After reseting keys in extracted shortcodes array_intersect is no longer needed.
[MAILPOET-3312]
This commit is contained in:
Rostislav Wolny
2020-11-19 12:57:34 +01:00
committed by Veljko V
parent bcd606ac1b
commit 46322825d5

View File

@@ -76,7 +76,7 @@ class Shortcodes {
preg_match_all($regex, $content, $shortcodes);
$shortcodes = $shortcodes[0];
return (count($shortcodes)) ?
array_unique($shortcodes) :
array_values(array_unique($shortcodes)) :
false;
}
@@ -149,7 +149,6 @@ class Shortcodes {
$shortcodes,
($contentSource) ? $contentSource : $content
);
$shortcodes = array_intersect_key($shortcodes, $processedShortcodes);
return str_replace($shortcodes, $processedShortcodes, $content);
}