cvs: smarty / NEWS /libs Smarty.class.php Smarty_Compiler.class.php
| From: | Messju Mohr | Date: | Sun, 27 Apr 2003 18:04:33 +0000 |
| Subject: | cvs: smarty / NEWS /libs Smarty.class.php Smarty_Compiler.class.php | ||
| Groups: | php.smarty.cvs | ||
| Request: | Send a blank email to php-smarty-cvs+get-564@lists.php.net to get a copy of this message | ||
messju Sun Apr 27 14:04:33 2003 EDT
Modified files:
/smarty NEWS
/smarty/libs Smarty.class.php Smarty_Compiler.class.php
Log:
made plugin-names case-insensitive. this affects
compiler/block/custom-functions and modifers.
Index: smarty/NEWS
diff -u smarty/NEWS:1.352 smarty/NEWS:1.353
--- smarty/NEWS:1.352 Sat Apr 26 11:56:11 2003
+++ smarty/NEWS Sun Apr 27 14:04:33 2003
@@ -1,3 +1,5 @@
+ - made plugin-names case-insensitive. this affects compiler/block/custom-
+ functions and modifers. (messju)
- remove unnecessary close/open tags from compiled templates
(Monte)
- fixed errornous creation of '//' in image_path in html_image (messju)
Index: smarty/libs/Smarty.class.php
diff -u smarty/libs/Smarty.class.php:1.382 smarty/libs/Smarty.class.php:1.383
--- smarty/libs/Smarty.class.php:1.382 Mon Apr 21 15:04:47 2003
+++ smarty/libs/Smarty.class.php Sun Apr 27 14:04:33 2003
@@ -42,7 +42,7 @@
* @version 2.5.0
*/
-/* $Id: Smarty.class.php,v 1.382 2003/04/21 19:04:47 cellog Exp $ */
+/* $Id: Smarty.class.php,v 1.383 2003/04/27 18:04:33 messju Exp $ */
/**
* set SMARTY_DIR to absolute path to Smarty library files.
@@ -683,7 +683,7 @@
*/
function register_function($function, $function_impl)
{
- $this->_plugins['function'][$function] =
+ $this->_plugins['function'][strtolower($function)] =
array($function_impl, null, null, false);
}
@@ -694,7 +694,7 @@
*/
function unregister_function($function)
{
- unset($this->_plugins['function'][$function]);
+ unset($this->_plugins['function'][strtolower($function)]);
}
/**
@@ -732,7 +732,7 @@
*/
function register_block($block, $block_impl)
{
- $this->_plugins['block'][$block] =
+ $this->_plugins['block'][strtolower($block)] =
array($block_impl, null, null, false);
}
@@ -743,7 +743,7 @@
*/
function unregister_block($block)
{
- unset($this->_plugins['block'][$block]);
+ unset($this->_plugins['block'][strtolower($block)]);
}
/**
@@ -754,7 +754,7 @@
*/
function register_compiler_function($function, $function_impl)
{
- $this->_plugins['compiler'][$function] =
+ $this->_plugins['compiler'][strtolower($function)] =
array($function_impl, null, null, false);
}
@@ -765,7 +765,7 @@
*/
function unregister_compiler_function($function)
{
- unset($this->_plugins['compiler'][$function]);
+ unset($this->_plugins['compiler'][strtolower($function)]);
}
/**
@@ -776,7 +776,7 @@
*/
function register_modifier($modifier, $modifier_impl)
{
- $this->_plugins['modifier'][$modifier] =
+ $this->_plugins['modifier'][strtolower($modifier)] =
array($modifier_impl, null, null, false);
}
@@ -787,7 +787,7 @@
*/
function unregister_modifier($modifier)
{
- unset($this->_plugins['modifier'][$modifier]);
+ unset($this->_plugins['modifier'][strtolower($modifier)]);
}
/**
Index: smarty/libs/Smarty_Compiler.class.php
diff -u smarty/libs/Smarty_Compiler.class.php:1.217 smarty/libs/Smarty_Compiler.class.php:1.218
--- smarty/libs/Smarty_Compiler.class.php:1.217 Sat Apr 26 11:56:18 2003
+++ smarty/libs/Smarty_Compiler.class.php Sun Apr 27 14:04:33 2003
@@ -39,7 +39,7 @@
* @package Smarty
*/
-/* $Id: Smarty_Compiler.class.php,v 1.217 2003/04/26 15:56:18 mohrt Exp $ */
+/* $Id: Smarty_Compiler.class.php,v 1.218 2003/04/27 18:04:33 messju Exp $ */
/**
* Template compiling class
* @package Smarty
@@ -402,6 +402,7 @@
return $this->_compile_registered_object_tag($tag_command, $this->_parse_attrs($tag_args),
$tag_modifier);
}
+ $tag_command = strtolower($tag_command);
switch ($tag_command) {
case 'include':
return $this->_compile_include_tag($tag_args);
@@ -1598,7 +1599,7 @@
list(, $_modifiers, $modifier_arg_strings) = $_match;
for ($_i = 0, $_for_max = count($_modifiers); $_i < $_for_max; $_i++) {
- $_modifier_name = $_modifiers[$_i];
+ $_modifier_name = strtolower($_modifiers[$_i]);
if($_modifier_name == 'smarty') {
// skip smarty modifier