我剛剛遇到了有關Colin Verot's upload script上載類的此問題。警告:preg_match()[function.preg-match]:編譯失敗:偏移量爲7的字符類中的無效範圍
/^([\.-\w]+)\/([\.-\w]+)(.*)$/i
我有如下逃脫,但我的preg_match/preg_replace函數的知識是有限的一點,只是想確認正確的「修復」。
/^([\.\-\w]+)\/([\.\-\w]+)(.*)$/i
行號拋出的問題是2899和3012之間
您的輸入和預期輸出是什麼? – 2014-09-29 15:42:45
代碼是: if(preg_match(「/ ^([\ .- \ w] +)\ /([\ .- \ w] +)(。*)$/i」,$ this-> ($ */$($)/ $($)/ $($))。 $ 2',$ this-> file_src_mime); $ this-> log。=' - 驗證爲''的MIME。 $ this-> file_src_mime。 '
';其他{ } else {this-> file_src_mime = null; } 看起來像它檢查MIME類型? – 2014-09-29 15:50:11