【发布时间】:2015-07-06 06:16:49
【问题描述】:
我使用class.upload 0.32 版,它在我的本地主机服务器上正常工作,但在我的网络服务器上却不工作。
Web 服务器日志文件显示此错误:
PHP Warning: preg_match(): Compilation failed: invalid range in character class at offset 7 in.
网络服务器上的 PHP 版本: 5.4.39
本地主机上的 PHP 版本: 5.5.15
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;
}
【问题讨论】:
标签: php regex preg-match