aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikael Nordfeldth <mmn@hethane.se>2017-05-06 12:25:27 +0200
committerMikael Nordfeldth <mmn@hethane.se>2017-05-06 14:38:43 +0200
commit1ccb934541c490a534027760ffb07da6027d4ddc (patch)
treef7a0ccc1e136f1862612b94c5e23433c1fc540cf
parent434956fc75d8b9dc4e8ae6547adea5f65796dae4 (diff)
downloadgnu-social-1ccb934541c490a534027760ffb07da6027d4ddc.tar
gnu-social-1ccb934541c490a534027760ffb07da6027d4ddc.zip
Return false immediately if $url is empty for common_valid_http_url
-rw-r--r--lib/util.php4
1 files changed, 4 insertions, 0 deletions
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?$/';