From ea84147f45f11b81d187300611a36bce75559930 Mon Sep 17 00:00:00 2001 From: "Uwe.Tews" Date: Fri, 30 Apr 2010 14:00:26 +0000 Subject: [PATCH] - work around of a substr_compare bug in older PHP5 versions --- change_log.txt | 1 + .../smarty_internal_compile_private_block_plugin.php | 4 ++-- .../smarty_internal_compile_private_registered_block.php | 2 +- libs/sysplugins/smarty_internal_templatecompilerbase.php | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/change_log.txt b/change_log.txt index ea1612a6..047435ad 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,5 +1,6 @@ 30/04/2010 - bugfix when comparing timestamps in sysplugins/smarty_internal_config.php +- work around of a substr_compare bug in older PHP5 versions ===== RC1 ===== diff --git a/libs/sysplugins/smarty_internal_compile_private_block_plugin.php b/libs/sysplugins/smarty_internal_compile_private_block_plugin.php index 436ba247..5a9b1140 100644 --- a/libs/sysplugins/smarty_internal_compile_private_block_plugin.php +++ b/libs/sysplugins/smarty_internal_compile_private_block_plugin.php @@ -23,7 +23,7 @@ class Smarty_Internal_Compile_Private_Block_Plugin extends Smarty_Internal_Compi public function compile($args, $compiler, $tag, $function) { $this->compiler = $compiler; - if (strlen($tag) < 6 || substr_compare($tag, 'close', -5, 5) != 0) { + if (strlen($tag) < 6 || substr($tag, -5) != 'close') { // opening tag of block plugin $this->required_attributes = array(); $this->optional_attributes = array('_any'); @@ -69,4 +69,4 @@ class Smarty_Internal_Compile_Private_Block_Plugin extends Smarty_Internal_Compi } } -?> +?> \ No newline at end of file diff --git a/libs/sysplugins/smarty_internal_compile_private_registered_block.php b/libs/sysplugins/smarty_internal_compile_private_registered_block.php index 3ad4d2fa..e0e7d87f 100644 --- a/libs/sysplugins/smarty_internal_compile_private_registered_block.php +++ b/libs/sysplugins/smarty_internal_compile_private_registered_block.php @@ -23,7 +23,7 @@ class Smarty_Internal_Compile_Private_Registered_Block extends Smarty_Internal_C public function compile($args, $compiler, $tag) { $this->compiler = $compiler; - if (strlen($tag) < 6 || substr_compare($tag, 'close', -5, 5) != 0) { + if (strlen($tag) < 6 || substr($tag,-5) != 'close') { // opening tag of block plugin $this->required_attributes = array(); $this->optional_attributes = array('_any'); diff --git a/libs/sysplugins/smarty_internal_templatecompilerbase.php b/libs/sysplugins/smarty_internal_templatecompilerbase.php index c41d7750..36054ef1 100644 --- a/libs/sysplugins/smarty_internal_templatecompilerbase.php +++ b/libs/sysplugins/smarty_internal_templatecompilerbase.php @@ -133,7 +133,7 @@ class Smarty_Internal_TemplateCompilerBase { return ''; } else { // not an internal compiler tag - if (strlen($tag) < 6 || substr_compare($tag, 'close', -5, 5) != 0) { + if (strlen($tag) < 6 || substr($tag, -5) != 'close') { // check if tag is a registered object if (isset($this->smarty->registered_objects[$tag]) && isset($args['object_methode'])) { $methode = $args['object_methode'];