Verot上传类(class.upload.php v3.2)在上传和MIME检查时会出现错误。警告:preg_match错误(class.upload.php)
if (preg_match("/^([\.-\w]+)\/([\.-\w]+)(.*)$/i", $this->file_src_mime)) {
$this->file_src_mime = preg_replace("/^([\.-\w]+)\/([\.-\w]+)(.*)$/i", '$1/$2', $this->file_src_mime);
$this->log .= '- MIME validated as ' . $this->file_src_mime . '<br />';
} else {
$this->file_src_mime = null;
}
这发生的错误:
Warning: preg_match() [function.preg-match]: Compilation failed: invalid range in character class at offset 7 in class.upload.php on line 2616
感谢您的建议。
'-'应该进行转义(这里的类的创建者)太 - '\ - '或者放到底块'[\。\ w-]' – 2014-11-23 18:06:16