Skip to content

Commit

Permalink
Merge pull request smarty-php#64 from think-ahead/ticket-#5313-upgrad…
Browse files Browse the repository at this point in the history
…e-php5-to-php7

Redmine-#5313:[レスポンス改善] サーバーサイドをPHP5→PHP7にアップグレードする
  • Loading branch information
think-seron authored Aug 26, 2021
2 parents cb1342b + 927432f commit 66b854f
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions vendors/smarty/Smarty_Compiler.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -262,12 +262,13 @@ function _compile_file($resource_name, $source_content, &$compiled_content)
reset($this->_folded_blocks);

/* replace special blocks by "{php}" */
$source_content = preg_replace($search.'e', "'"
. $this->_quote_replace($this->left_delimiter) . 'php'
. "' . str_repeat(\"\n\", substr_count('\\0', \"\n\")) .'"
. $this->_quote_replace($this->right_delimiter)
. "'"
, $source_content);
$source_content = preg_replace_callback(
$search,
function ($match) {
return $this->_quote_replace($this->left_delimiter) . "php" . str_repeat("\n", substr_count($match[0], "\n")) . $this->_quote_replace($this->right_delimiter);
},
$source_content
);

/* Gather all template tags. */
preg_match_all("~{$ldq}\s*(.*?)\s*{$rdq}~s", $source_content, $_match);
Expand Down

0 comments on commit 66b854f

Please sign in to comment.