Home > Backend Development > PHP Tutorial > ecshop-php页面报错:preg_replace_callback()不知道怎么解决?

ecshop-php页面报错:preg_replace_callback()不知道怎么解决?

WBOY
Release: 2016-06-02 11:27:51
Original
1741 people have browsed it

ecshopphp源码callback

<code>   我的我的ecshop进入index页后就一直报错:Warning: preg_replace_callback(): Requires argument 2, 'Array', to be a valid callback in C:\AppServ\www\ecshop\includes\cls_template.php on line 1152        cls_template.php源码如下:        $pattern = array(        '/<!--[^>|\n]*?({.+?})[^<|{|\n]*?-->/', // 替换smarty注释        '/<!--[^<|>|{|\n]*?-->/',               // 替换不换行的html注释        '/(href=["|\'])\.\.\/(.*?)(["|\'])/i',  // 替换相对链接        '/((?:background|src)\s*=\s*["|\'])(?:\.\/|\.\.\/)?(images\/.*?["|\'])/is', // 在images前加上 $tmp_dir        '/((?:background|background-image):\s*?url\()(?:\.\/|\.\.\/)?(images\/)/is', // 在images前加上 $tmp_dir        '/([\'|"])\.\.\//is', // 以../开头的路径全部修正为空        );    $replace = array(        '\1',        '',        '\1\2\3',        '\1' . $tmp_dir . '\2',        '\1' . $tmp_dir . '\2',        '\1'        );    //return preg_replace($pattern, $replace, $source);    return preg_replace_callback($pattern, $replace, $source);</code>
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template