スクリプトのクリーン パスを返す次の関数があります。
function cleanPath($path) {
$path = (string) $path;
$path = preg_replace(
array(
'#[\n\r\t\0]*#im',
'#/(\.){1,}/#i',
'#(\.){2,}#i',
'#(\.){2,}#i',
'#('.DIRECTORY_SEPARATOR.'){2,}#i'
),
array(
'',
'',
'',
'/'
),
$path
)
;
return rtrim($path,DIRECTORY_SEPARATOR);
}
PHP は次のエラーを返します。
警告: preg_replace() [function.preg-replace]: コンパイルに失敗しました: C:\wamp\www\extlogin\app\ni\inc\classes\cfiletree.phpの18行 目のオフセット 7 に ) がありません
何が問題で、どのように修正するかについてのアイデアはありますか?
ありがとうございました。