2
这是我的代码。替换preg_replace_callback的preg_replace给我一个警告
private function _checkMatch($modFilePath, $checkFilePath) {
$modFilePath = str_replace('\\', '/', $modFilePath);
$checkFilePath = str_replace('\\', '/', $checkFilePath);
$modFilePath = preg_replace('/([^*]+)/e', 'preg_quote("$1", "~")', $modFilePath);
$modFilePath = str_replace('*', '[^/]*', $modFilePath);
$return = (bool) preg_match('~^' . $modFilePath . '$~', $checkFilePath);
return $return;
}
我将preg_replace改为preg_replace_callback,但它给了我下面的错误。
Warning: preg_replace_callback(): Requires argument 2, 'preg_quote("$1", "~")', to be a valid callback
我目前使用Opencart的版本1.x.x
任何一个可以帮助我吗?
三江源这么多! –