0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Smartyを利用する際PHP7以降では Smarty_Compiler.class.php を修正が必要。

Posted at

Smartyを利用する際PHP7以降では Smarty_Compiler.class.php を下記の様に修正してください。
preg_replace()でのエラーが出ます。

        ここからコメントアウト
        /* replace special blocks by "{php}" */
        /*$source_content = preg_replace_callback($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
                   , create_function ('$matches', "return '"
                       . $this->_quote_replace($this->left_delimiter) . 'php'
                       . "' . str_repeat(\"\n\", substr_count(\$matches[0], \"\n\")) .'"
                       . $this->_quote_replace($this->right_delimiter)
                       . "';")
                   , $source_content);
        追加ここまで

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?