ecshop手機端錯誤修改

1.Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in uploads\include\library\EcsTemplate.class.php on line 248

        解決:

                 return preg_replace("/{([^\}\{\n]*)}/e", "\$this->select('\\1');", $source);
                 改爲:    return preg_replace_callback("/{([^\}\{\n]*)}/", function($r) { return $this->select($r[1]); }, $source);

2.E:\work\server\ECTouch\uploads\include\library\EcsTemplate.class.php on line 912

      解決:

                       $pattern='/<!--\s#BeginLibraryItem\s\"\/(.*?)\"\s-->.*?<!--\s#EndLibraryItem\s-->/se';

                       $replacement = "'{include file='.strtolower('\\1'). '}'";

                       $source = preg_replace($pattern, $replacement, $source);

                       改爲:

                      $pattern='/<!--\s#BeginLibraryItem\s\"\/(.*?)\"\s-->.*?<!--\s#EndLibraryItem\s-->/s';

                      $source = preg_replace_callback($pattern, function($ro){return '{include file='.strtolower($ro[1]). '}';}, $source);

 

 

 

     

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章