1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-04 21:57:51 +02:00

Fixes #3726 - legacy shortcode wrapper conflict with email template.

This commit is contained in:
Cameron
2020-06-01 17:37:49 -07:00
parent da7e6ee774
commit 1c8e755edf
6 changed files with 101 additions and 14 deletions

View File

@@ -744,6 +744,25 @@ class e_parse_shortcode
return in_array($name, $this->scBatchOverride);
}
/**
* Backward Compatibility for $sc_style wrapper
* @param mixed $extraCodes
*/
private function mergeLegacyWrappers($extraCodes=null)
{
global $sc_style; //legacy, will be removed soon, use the non-global $SC_STYLE instead
if(is_array($extraCodes) && isset($extraCodes['_WRAPPER_'])) // v2.x array wrapper.
{
return null;
}
if(isset($sc_style) && is_array($sc_style)/* && !isset($extraCodes['_WRAPPER_'])*/)
{
$this->sc_style = array_merge($sc_style, $this->sc_style);
}
}
/**
* Parse the shortcodes in some text
*
@@ -758,8 +777,6 @@ class e_parse_shortcode
*/
function parseCodes($text, $useSCFiles = true, $extraCodes = null, $eVars = null)
{
global $sc_style; //legacy, will be removed soon, use the non-global $SC_STYLE instead
$saveParseSCFiles = $this->parseSCFiles; // In case of nested call
$this->parseSCFiles = $useSCFiles;
$saveVars = $this->eVars; // In case of nested call
@@ -788,10 +805,7 @@ class e_parse_shortcode
*
*/
if(isset($sc_style) && is_array($sc_style))
{
$this->sc_style = array_merge($sc_style, $this->sc_style); // XXX Commenting this out will fix #2 above.
}
$this->mergeLegacyWrappers($extraCodes); // XXX Commenting this out will fix #2 above.
//object support