diff options
author | Vjacheslav Trushkin <cyberalien@gmail.com> | 2013-04-10 20:12:03 +0300 |
---|---|---|
committer | Vjacheslav Trushkin <cyberalien@gmail.com> | 2013-04-10 20:12:03 +0300 |
commit | 8567aaed324eb87856ee6274f8330c52beecd0a3 (patch) | |
tree | 7cccd42f2da87f8b272d238a5dcef93855a2bd46 | |
parent | 5e8d92b0a84cf6ffbaefe1af5f2efd947e25aa1a (diff) | |
download | forums-8567aaed324eb87856ee6274f8330c52beecd0a3.tar forums-8567aaed324eb87856ee6274f8330c52beecd0a3.tar.gz forums-8567aaed324eb87856ee6274f8330c52beecd0a3.tar.bz2 forums-8567aaed324eb87856ee6274f8330c52beecd0a3.tar.xz forums-8567aaed324eb87856ee6274f8330c52beecd0a3.zip |
[ticket/11482] Use double quotes for code
Use double quotes for code to avoid excessive escaping
PHPBB3-11482
-rw-r--r-- | phpBB/includes/template/filter.php | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/phpBB/includes/template/filter.php b/phpBB/includes/template/filter.php index a3894905e5..5b0957280d 100644 --- a/phpBB/includes/template/filter.php +++ b/phpBB/includes/template/filter.php @@ -840,10 +840,10 @@ class phpbb_template_filter extends php_user_filter if (!empty($match[2]) && !isset($match[3]) && $op) { // DEFINE tag with ENDDEFINE - $array = '$_tpldata[\'DEFINE\'][\'.vars\']'; + $array = "\$_tpldata['DEFINE']['.vars']"; $code = 'ob_start(); '; - $code .= 'if (!isset(' . $array . ')) { ' . $array . ' = array(); } '; - $code .= $array . '[] = \'' . $match[2] . '\''; + $code .= "if (!isset($array)) { $array = array(); } "; + $code .= "{$array}[] = '{$match[2]}'"; return $code; } @@ -880,10 +880,10 @@ class phpbb_template_filter extends php_user_filter */ private function compile_tag_enddefine() { - $array = '$_tpldata[\'DEFINE\'][\'.vars\']'; - $code = 'if (!isset(' . $array . ') || !sizeof(' . $array . ')) { trigger_error(\'ENDDEFINE tag without DEFINE in \' . basename(__FILE__), E_USER_ERROR); }'; - $code .= '$define_var = array_pop(' . $array . '); '; - $code .= '$_tpldata[\'DEFINE\'][\'.\'][$define_var] = ob_get_clean();'; + $array = "\$_tpldata['DEFINE']['.vars']"; + $code = "if (!isset($array) || !sizeof($array)) { trigger_error('ENDDEFINE tag without DEFINE in ' . basename(__FILE__), E_USER_ERROR); }"; + $code .= "\$define_var = array_pop($array); "; + $code .= "\$_tpldata['DEFINE']['.'][\$define_var] = ob_get_clean();"; return $code; } |