From 8d228a08dd4912d87e3655028f718e81fdecdb06 Mon Sep 17 00:00:00 2001 From: Cameron Date: Tue, 3 May 2016 15:52:02 -0700 Subject: [PATCH] Issue #1597 - Legacy Batch Shortcode fix. --- e107_handlers/shortcode_handler.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/e107_handlers/shortcode_handler.php b/e107_handlers/shortcode_handler.php index e28d859b7..1e683ae76 100644 --- a/e107_handlers/shortcode_handler.php +++ b/e107_handlers/shortcode_handler.php @@ -91,6 +91,7 @@ class e_parse_shortcode protected $ignoreCodes = array(); // Shortcodes to be ignored and remain unchanged. (ie. {THEME}, {e_PLUGIN} etc. ) protected $addonOverride = array(); // Overrides coming from e_shortcode.php private $legacyBatch = array(); // List of legacy batch file codes. eg. using SC_BEGIN etc. + private $legacyBatchFile = null; private $debug_legacy = array(); protected $eVars = null; protected $wrappers = array(); // Wrappers array for the current parsing cycle, see contact_template.php and $CONTACT_WRAPPER variable @@ -829,7 +830,7 @@ class e_parse_shortcode $this->addedCodes = $saveCodes; $this->eVars = $saveVars; // restore eVars $this->debug_legacy = null; - $this->legacyBatch = array(); + // $this->sc_style = array(); //XXX Adding this will also fix #2 above. @@ -967,18 +968,19 @@ class e_parse_shortcode //$this->legacyBatch if(in_array($code,$this->legacyBatch)) { + $_type = 'legacy batch'; + $_path = $this->legacyBatchFile; $scCode = $this->addedCodes[$code]; } else { + $_type = 'array'; + $_path = "(direct to parser)"; $ret = $this->addedCodes[$code]; + } - // $_class = "n/a"; - // $_function = "n/a"; - $_type = 'array'; - $_path = "(direct to parser)"; } elseif (array_key_exists($code, $this->scList)) // Check to see if we've already loaded the .sc file contents @@ -1378,6 +1380,7 @@ class e_parse_shortcode $this->legacyBatch = array_keys($cur_shortcodes); + $this->legacyBatchFile = str_replace(e_ROOT, '', $fname); return $cur_shortcodes; }