aboutsummaryrefslogtreecommitdiffstats
path: root/include/smarty/libs/sysplugins
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2015-12-15 15:24:01 +0100
committerplegall <plg@piwigo.org>2015-12-15 15:24:01 +0100
commit3282ddbe2ea305edbb0b3ae84b6860c0d90ab072 (patch)
tree6ba00ec1ae9242e4784fd37eae776ad34de183a3 /include/smarty/libs/sysplugins
parentacbdd756cd2a8772b4d0ebfc3ede86e71c6a495a (diff)
update Smarty to official version 3.1.28
Diffstat (limited to 'include/smarty/libs/sysplugins')
-rw-r--r--include/smarty/libs/sysplugins/smarty_internal_compile_private_foreachsection.php13
-rw-r--r--include/smarty/libs/sysplugins/smarty_internal_compile_private_php.php2
-rw-r--r--include/smarty/libs/sysplugins/smarty_internal_debug.php18
-rw-r--r--include/smarty/libs/sysplugins/smarty_internal_template.php6
4 files changed, 17 insertions, 22 deletions
diff --git a/include/smarty/libs/sysplugins/smarty_internal_compile_private_foreachsection.php b/include/smarty/libs/sysplugins/smarty_internal_compile_private_foreachsection.php
index 25b35e861..50c25bdb6 100644
--- a/include/smarty/libs/sysplugins/smarty_internal_compile_private_foreachsection.php
+++ b/include/smarty/libs/sysplugins/smarty_internal_compile_private_foreachsection.php
@@ -206,16 +206,15 @@ class Smarty_Internal_Compile_Private_ForeachSection extends Smarty_Internal_Com
*/
public static function compileSpecialVariable($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter)
{
- // make all lower case
- $parameter = array_map('strtolower', $parameter);
- $tag = trim($parameter[0], '"\'');
- if (!isset($parameter[1]) || false === $name = $compiler->getId($parameter[1])) {
+ $tag = strtolower(trim($parameter[ 0 ], '"\''));
+ $name = isset($parameter[ 1 ]) ? $compiler->getId($parameter[ 1 ]) : false;
+ if (!$name) {
$compiler->trigger_template_error("missing or illegal \$smarty.{$tag} name attribute", null, true);
}
+ /* @var Smarty_Internal_Compile_Foreach|Smarty_Internal_Compile_Section $className */
$className = 'Smarty_Internal_Compile_' . ucfirst($tag);
- if ((!isset($parameter[2]) || false === $property = $compiler->getId($parameter[2])) ||
- !in_array($property, $className::$nameProperties)
- ) {
+ $property = isset($parameter[ 2 ]) ? strtolower($compiler->getId($parameter[ 2 ])) : false;
+ if (!$property || !in_array($property, $className::$nameProperties)) {
$compiler->trigger_template_error("missing or illegal \$smarty.{$tag} property attribute", null, true);
}
$tagVar = "'__smarty_{$tag}_{$name}'";
diff --git a/include/smarty/libs/sysplugins/smarty_internal_compile_private_php.php b/include/smarty/libs/sysplugins/smarty_internal_compile_private_php.php
index 584f70b0e..3ca63a548 100644
--- a/include/smarty/libs/sysplugins/smarty_internal_compile_private_php.php
+++ b/include/smarty/libs/sysplugins/smarty_internal_compile_private_php.php
@@ -79,7 +79,7 @@ class Smarty_Internal_Compile_Private_Php extends Smarty_Internal_CompileBase
} else {
$compiler->has_code = true;
if (!($compiler->smarty instanceof SmartyBC)) {
- $compiler->trigger_template_error('{php}[/php} tags not allowed. Use SmartyBC to enable them', null, true);
+ $compiler->trigger_template_error('{php}{/php} tags not allowed. Use SmartyBC to enable them', null, true);
}
$ldel = preg_quote($compiler->smarty->left_delimiter, '#');
$rdel = preg_quote($compiler->smarty->right_delimiter, '#');
diff --git a/include/smarty/libs/sysplugins/smarty_internal_debug.php b/include/smarty/libs/sysplugins/smarty_internal_debug.php
index e330a35c1..0cbd54955 100644
--- a/include/smarty/libs/sysplugins/smarty_internal_debug.php
+++ b/include/smarty/libs/sysplugins/smarty_internal_debug.php
@@ -399,31 +399,31 @@ class Smarty_Internal_Debug extends Smarty_Internal_Data
/**
* handle 'URL' debugging mode
*
- * @param Smarty_Internal_Template $_template
+ * @param Smarty $smarty
*/
- public function debugUrl(Smarty_Internal_Template $_template)
+ public function debugUrl(Smarty $smarty)
{
if (isset($_SERVER['QUERY_STRING'])) {
$_query_string = $_SERVER['QUERY_STRING'];
} else {
$_query_string = '';
}
- if (false !== strpos($_query_string, $_template->smarty->smarty_debug_id)) {
- if (false !== strpos($_query_string, $_template->smarty->smarty_debug_id . '=on')) {
+ if (false !== strpos($_query_string, $smarty->smarty_debug_id)) {
+ if (false !== strpos($_query_string, $smarty->smarty_debug_id . '=on')) {
// enable debugging for this browser session
setcookie('SMARTY_DEBUG', true);
- $_template->smarty->debugging = true;
- } elseif (false !== strpos($_query_string, $_template->smarty->smarty_debug_id . '=off')) {
+ $smarty->debugging = true;
+ } elseif (false !== strpos($_query_string, $smarty->smarty_debug_id . '=off')) {
// disable debugging for this browser session
setcookie('SMARTY_DEBUG', false);
- $_template->smarty->debugging = false;
+ $smarty->debugging = false;
} else {
// enable debugging for this page
- $_template->smarty->debugging = true;
+ $smarty->debugging = true;
}
} else {
if (isset($_COOKIE['SMARTY_DEBUG'])) {
- $_template->smarty->debugging = true;
+ $smarty->debugging = true;
}
}
}
diff --git a/include/smarty/libs/sysplugins/smarty_internal_template.php b/include/smarty/libs/sysplugins/smarty_internal_template.php
index 52c7391b1..7c16a53db 100644
--- a/include/smarty/libs/sysplugins/smarty_internal_template.php
+++ b/include/smarty/libs/sysplugins/smarty_internal_template.php
@@ -138,10 +138,6 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase
}
throw new SmartyException("Unable to load template {$this->source->type} '{$this->source->name}'{$parent_resource}");
}
- // check URL debugging control
- if (!$this->smarty->debugging && $this->smarty->debugging_ctrl == 'URL') {
- $this->smarty->_debug->debugUrl($this);
- }
// disable caching for evaluated code
if ($this->source->handler->recompiled) {
$this->caching = false;
@@ -188,7 +184,7 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase
} else {
if ($this->smarty->debugging) {
$this->smarty->_debug->end_template($this);
- if ($this->smarty->debugging == 2 and !$display) {
+ if ($this->smarty->debugging === 2 && $display === false) {
$this->smarty->_debug->display_debug($this, true);
}
}