From: Mikael Nordfeldth Date: Sat, 6 May 2017 10:25:27 +0000 (+0200) Subject: Return false immediately if $url is empty for common_valid_http_url X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=709f1bbd754006b5630f006c70ae4ee5ab709b99;p=quix0rs-gnu-social.git Return false immediately if $url is empty for common_valid_http_url --- diff --git a/lib/util.php b/lib/util.php index aa0d5bfe76..e5cc780688 100644 --- a/lib/util.php +++ b/lib/util.php @@ -1906,6 +1906,10 @@ function common_log_objstring(&$object) function common_valid_http_url($url, $secure=false) { + if (empty($url)) { + return false; + } + // If $secure is true, only allow https URLs to pass // (if false, we use '?' in 'https?' to say the 's' is optional) $regex = $secure ? '/^https$/' : '/^https?$/';