Permalink
Browse files

Version 0.7.2

Fixed PHP5.5 preg_replace /e modifier is deprecated
Patch from kode68
  • Loading branch information...
hugokernel committed Nov 7, 2014
1 parent 788fbdb commit af6ab50f2556dce9fc9935386d64b1b07c38ba34
Showing with 16 additions and 4 deletions.
  1. +4 −0 CHANGELOG
  2. +12 −4 hyla_tpl.class.php
View
@@ -1,4 +1,8 @@
0.7.2
2014-11-07 kode68
* Fixed PHP5.5 preg_replace /e modifier is deprecated
0.7.1
2011-07-07 erichard <https://github.com/hugokernel/Hyla_Tpl/pull/1>
* FIX a bug when a default value is set to 0
View
@@ -21,7 +21,7 @@
/**
* Refer to http://www.digitalspirit.org/ or http://www.hyla-project.org/ for update
* Standalone version 0.7.1
* Standalone version 0.7.2
*/
class Hyla_Tpl {
@@ -238,9 +238,17 @@ public function render($block_name = null, $render = true) {
// Run function on var
// First, run set var function (&xxx)
$data = preg_replace('/{&([a-zA-Z_\-0-9]*)\:((\\\\}|\\\\|[^}])*)}/e', "\$this->setVar('$1', self::_skipQuote(stripslashes('$2')))", $data);
$data = preg_replace('/{([$|!|_|#])(([a-zA-Z_\-0-9]*)\:?((\\\\}|\\\\|[^}])*))}/e', "\$this->_parseFuncVar('$2', '$1')", $data);
$data = preg_replace_callback(
'/{&([a-zA-Z_\-0-9]*)\:((\\\\}|\\\\|[^}])*)}/',
function($m) { return $this->setVar($m[1], self::_skipQuote(stripslashes($m[2]))); },
$data
);
$data = preg_replace_callback(
'/{([$|!|_|#])(([a-zA-Z_\-0-9]*)\:?((\\\\}|\\\\|[^}])*))}/',
function($m) { return $this->_parseFuncVar($m[2], $m[1]); },
$data
);
}
// Get content and add it !

0 comments on commit af6ab50

Please sign in to comment.