Skip to content
Permalink
Browse files

修复PHP7.3下filter_var废弃FILTER_FLAG_HOST_REQUIRED造成的错误 (#175)

修复查询字段错误造成的文件夹创建500错误
  • Loading branch information...
nxuem authored and HFO4 committed Jul 11, 2019
1 parent 5e369a9 commit 076b9c436475821219e5856755add63acc92c5f1
Showing with 2 additions and 2 deletions.
  1. +1 −1 application/index/model/FileManage.php
  2. +1 −1 extend/PHPMailer/PHPMailer/PHPMailer.php
@@ -752,7 +752,7 @@ static function createFolder($dirName,$dirPosition,$uid){
if(empty($dirName)){
return ["result"=>["success"=>false,"error"=>"目录名不能为空"]];
}
if(Db::name('folders')->where('position_absolute',$dirPosition)->where('owner',$uid)->find() ==null || Db::name('folders')->where('owner',$uid)->where('position',$dirPosition)->where('folder_name',$dirName)->find() !=null || Db::name('files')->where('upload_date',$uid)->where('dir',$dirPosition)->where('pre_name',$dirName)->find() !=null){
if(Db::name('folders')->where('position_absolute',$dirPosition)->where('owner',$uid)->find() ==null || Db::name('folders')->where('owner',$uid)->where('position',$dirPosition)->where('folder_name',$dirName)->find() !=null || Db::name('files')->where('upload_user',$uid)->where('dir',$dirPosition)->where('pre_name',$dirName)->find() !=null){
return ["result"=>["success"=>false,"error"=>"路径不存在或文件已存在"]];
}
$sqlData = [
@@ -3594,7 +3594,7 @@ public static function isValidHost($host)
//Is it a valid IPv4 address?
return (bool) filter_var($host, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4);
}
if (filter_var('http://' . $host, FILTER_VALIDATE_URL, FILTER_FLAG_HOST_REQUIRED)) {
if (filter_var('http://' . $host, FILTER_VALIDATE_URL)) {
//Is it a syntactically valid hostname?
return true;
}

0 comments on commit 076b9c4

Please sign in to comment.
You can’t perform that action at this time.