mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-02 17:34:26 +02:00
replace functions deprecated in PHP 7.2
This commit is contained in:
@@ -1,3 +1,8 @@
|
|||||||
|
===== 2.6.31 ===
|
||||||
|
2017-11-03
|
||||||
|
* replace functions deprecated in PHP 7.2
|
||||||
|
|
||||||
|
|
||||||
2016-09-11 Uwe Tews
|
2016-09-11 Uwe Tews
|
||||||
* {math} fix parameter checking order to avoid misleading message
|
* {math} fix parameter checking order to avoid misleading message
|
||||||
* {math} replace wrong versiom
|
* {math} replace wrong versiom
|
||||||
|
@@ -27,7 +27,7 @@
|
|||||||
* @author Monte Ohrt <monte at ohrt dot com>
|
* @author Monte Ohrt <monte at ohrt dot com>
|
||||||
* @author Andrei Zmievski <andrei@php.net>
|
* @author Andrei Zmievski <andrei@php.net>
|
||||||
* @package Smarty
|
* @package Smarty
|
||||||
* @version 2.6.30
|
* @version 2.6.31-dev
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id$ */
|
/* $Id$ */
|
||||||
@@ -465,7 +465,7 @@ class Smarty
|
|||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
var $_version = '2.6.30';
|
var $_version = '2.6.31';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* current template inclusion depth
|
* current template inclusion depth
|
||||||
|
@@ -259,14 +259,9 @@ class Smarty_Compiler extends Smarty {
|
|||||||
|
|
||||||
preg_match_all($search, $source_content, $match, PREG_SET_ORDER);
|
preg_match_all($search, $source_content, $match, PREG_SET_ORDER);
|
||||||
$this->_folded_blocks = $match;
|
$this->_folded_blocks = $match;
|
||||||
reset($this->_folded_blocks);
|
|
||||||
|
|
||||||
/* replace special blocks by "{php}" */
|
/* replace special blocks by "{php}" */
|
||||||
$source_content = preg_replace_callback($search, create_function ('$matches', "return '"
|
$source_content = preg_replace_callback($search, array($this,'_preg_callback')
|
||||||
. $this->_quote_replace($this->left_delimiter) . 'php'
|
|
||||||
. "' . str_repeat(\"\n\", substr_count('\$matches[1]', \"\n\")) .'"
|
|
||||||
. $this->_quote_replace($this->right_delimiter)
|
|
||||||
. "';")
|
|
||||||
, $source_content);
|
, $source_content);
|
||||||
|
|
||||||
/* Gather all template tags. */
|
/* Gather all template tags. */
|
||||||
@@ -556,7 +551,7 @@ class Smarty_Compiler extends Smarty {
|
|||||||
|
|
||||||
case 'php':
|
case 'php':
|
||||||
/* handle folded tags replaced by {php} */
|
/* handle folded tags replaced by {php} */
|
||||||
list(, $block) = each($this->_folded_blocks);
|
$block = array_shift($this->_folded_blocks);
|
||||||
$this->_current_line_no += substr_count($block[0], "\n");
|
$this->_current_line_no += substr_count($block[0], "\n");
|
||||||
/* the number of matched elements in the regexp in _compile_file()
|
/* the number of matched elements in the regexp in _compile_file()
|
||||||
determins the type of folded tag that was found */
|
determins the type of folded tag that was found */
|
||||||
@@ -754,7 +749,12 @@ class Smarty_Compiler extends Smarty {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function _preg_callback ($matches) {
|
||||||
|
return $this->_quote_replace($this->left_delimiter)
|
||||||
|
. 'php'
|
||||||
|
. str_repeat("\n", substr_count($matches[1], "\n"))
|
||||||
|
. $this->_quote_replace($this->right_delimiter);
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* compile custom function tag
|
* compile custom function tag
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user