[geeklog-hg] geeklog: Add period to allowed characters in template variable n...

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Sun May 4 19:30:59 EDT 2014


changeset 9528:b156bcfa9233
url:  http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/b156bcfa9233
user: Tom
date: Sun May 04 19:30:52 2014 -0400
description:
Add period to allowed characters in template variable names (bug #0001751)

diffstat:

 system/classes/template.class.php |  18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diffs (53 lines):

diff -r 92e15562f5c3 -r b156bcfa9233 system/classes/template.class.php
--- a/system/classes/template.class.php	Sat Apr 26 14:31:46 2014 -0400
+++ b/system/classes/template.class.php	Sun May 04 19:30:52 2014 -0400
@@ -1487,8 +1487,8 @@
         if ($in_php) {
             $tmplt = preg_replace(
                       array(
-                            '/\{([-\w\d_\[\]]+)\}/',                              // matches {identifier}
-                            '/\{([-\w\d_\[\]]+)((:u|:s|:t\d+)+)\}/',              // matches {identifier} with optional :s, :u or :t### suffix
+                            '/\{([-\.\w\d_\[\]]+)\}/',                              // matches {identifier}
+                            '/\{([-\.\w\d_\[\]]+)((:u|:s|:t\d+)+)\}/',              // matches {identifier} with optional :s, :u or :t### suffix
                            ),
                       array(
                             '$this->get_var(\'\1\')',
@@ -1498,8 +1498,8 @@
         } else {
             $tmplt = preg_replace(
                       array(
-                            '/\{([-\w\d_\[\]]+)\}/',                              // matches {identifier}
-                            '/\{([-\w\d_\[\]]+)((:u|:s|:t\d+)+)\}/',              // matches {identifier} with optional :s, :u or :t### suffix
+                            '/\{([-\.\w\d_\[\]]+)\}/',                              // matches {identifier}
+                            '/\{([-\.\w\d_\[\]]+)((:u|:s|:t\d+)+)\}/',              // matches {identifier} with optional :s, :u or :t### suffix
                            ),
                       array(
                             '<?php echo $this->val_echo(\'\1\'); ?>',
@@ -1559,7 +1559,7 @@
         if (strpos($tmplt, '!}') !== false || strpos($tmplt, '$}') !== false) {
             $tmplt = preg_replace_callback(
                       array('/\{\!\!(if|elseif|while|echo|global|autotag) (([^\\\']|\\\\|\\\')+?) \!\!\}/',
-                            '/\{\!\!(set) ([-\w\d_\[\]]+) (([^\\\']|\\\\|\\\')+?) \!\!\}/',       // sets a variable
+                            '/\{\!\!(set) ([-\.\w\d_\[\]]+) (([^\\\']|\\\\|\\\')+?) \!\!\}/',       // sets a variable
                             '/\{(\$LANG[\w\d_]+)\[(\')?([\w\d_]+)(?(2)\')\] (([^\\\']|\\\\|\\\')+?) \$\}/',       // Substitutable language independence
                            ),
                       array($this, 'parse_extended_callback'),
@@ -1569,14 +1569,14 @@
         if (strpos($tmplt, '{!') !== false) {
             $tmplt = preg_replace(
                 array(
-                      '/\{!(if|elseif|while) ([-\w\d_\[\]]+)\}/',
+                      '/\{!(if|elseif|while) ([-\.\w\d_\[\]]+)\}/',
                       '/\{!else(|!| !)\}/',
                       '/\{!end(if|while|for)(|!| !)\}/',                    // for is not yet supported but here for future use
-                      '/\{!loop ([-\w\d_\[\]]+)(|!| !)\}/',
+                      '/\{!loop ([-\.\w\d_\[\]]+)(|!| !)\}/',
                       '/\{!endloop(|!| !)\}/',
-                      '/\{!(inc|dec)(\+(echo))? ([-\w\d_\[\]]+)(|!| !)\}/',
+                      '/\{!(inc|dec)(\+(echo))? ([-\.\w\d_\[\]]+)(|!| !)\}/',
                       '/\{!(break|continue)( \d+)?(|!| !)\}/',
-                      '/\{!unset ([-\w\d_\[\]]+)(|!| !)\}/',                // unsets a variable
+                      '/\{!unset ([-\.\w\d_\[\]]+)(|!| !)\}/',                // unsets a variable
                      ),
                 array(
                       '<?php \1 ($this->var_notempty(\'\2\')): ?>',         // if exists and is non-zero



More information about the geeklog-cvs mailing list