Fix all PHP 8 deprecated/removed function usage across the repository
Agent-Logs-Url: https://github.com/GameServerPanel/GSP/sessions/209fe796-9a38-47c1-a6b7-992ce11d038b Co-authored-by: iaretechnician <2749183+iaretechnician@users.noreply.github.com>
This commit is contained in:
parent
73319ffeed
commit
c0bd0a0bb5
30 changed files with 198 additions and 471 deletions
|
|
@ -262,11 +262,13 @@ class Smarty_Compiler extends Smarty {
|
|||
reset($this->_folded_blocks);
|
||||
|
||||
/* replace special blocks by "{php}" */
|
||||
$source_content = preg_replace_callback($search, create_function ('$matches', "return '"
|
||||
. $this->_quote_replace($this->left_delimiter) . 'php'
|
||||
. "' . str_repeat(\"\n\", substr_count('\$matches[1]', \"\n\")) .'"
|
||||
. $this->_quote_replace($this->right_delimiter)
|
||||
. "';")
|
||||
$left_quoted = $this->_quote_replace($this->left_delimiter);
|
||||
$right_quoted = $this->_quote_replace($this->right_delimiter);
|
||||
$source_content = preg_replace_callback($search, function($matches) use ($left_quoted, $right_quoted) {
|
||||
return $left_quoted . 'php'
|
||||
. str_repeat("\n", substr_count($matches[1], "\n"))
|
||||
. $right_quoted;
|
||||
}
|
||||
, $source_content);
|
||||
|
||||
/* Gather all template tags. */
|
||||
|
|
@ -556,7 +558,8 @@ class Smarty_Compiler extends Smarty {
|
|||
|
||||
case 'php':
|
||||
/* handle folded tags replaced by {php} */
|
||||
list(, $block) = each($this->_folded_blocks);
|
||||
list(, $block) = current($this->_folded_blocks);
|
||||
next($this->_folded_blocks);
|
||||
$this->_current_line_no += substr_count($block[0], "\n");
|
||||
/* the number of matched elements in the regexp in _compile_file()
|
||||
determins the type of folded tag that was found */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue