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=1ccb934541c490a534027760ffb07da6027d4ddc;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 a177c92a25..62db64d828 100644 --- a/lib/util.php +++ b/lib/util.php @@ -1885,6 +1885,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?$/';