doudaifu6083 2019-06-10 19:17
浏览 134

PHP警告:preg_replace_callback():需要参数2 [重复]

I've been getting 503 errors on my Wordpress website. I turned on debug mode and this is what showed up:

PHP Warning: preg_replace_callback(): Requires argument 2, 'stripslashes(strstr("\2\5","rel=\class=") ? "\1" : "<a\2href=\"\3\4\"\5 rel=\"colorbox\" class=\"colorbox\"><img")', to be a valid callback

Here is the code it's referring to:

function ace_colorbox_replace($string) { 
$pattern = '/(<a(.*?)href="([^"]*.)'.IMAGE_FILETYPE.'"(.*?)><img)/i';
$replacement = 'stripslashes(strstr("\2\5","rel=\class=") ? "\1" : "
<a\2href=\"\3\4\"\5 rel=\"colorbox\" class=\"colorbox\"><img")';
return preg_replace_callback($pattern, $replacement, $string);
}

I know there's some outdated code that I did update a while back... But now it's having this error. I'm not too familiar with simple PHP, but I have some experience. This is out of my comfort zone... Any help is appreciated.

</div>
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥20 有关区间dp的问题求解
    • ¥15 多电路系统共用电源的串扰问题
    • ¥15 slam rangenet++配置
    • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
    • ¥15 对于相关问题的求解与代码
    • ¥15 ubuntu子系统密码忘记
    • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
    • ¥15 保护模式-系统加载-段寄存器
    • ¥15 电脑桌面设定一个区域禁止鼠标操作
    • ¥15 求NPF226060磁芯的详细资料