X-Git-Url: https://git.cweiske.de/shpub.git/blobdiff_plain/0544c4a70de190459d4c2b90d264cacdec22adb7..6f2bbd991fb885228702b960b17000fe2fc40567:/src/shpub/Validator.php?ds=inline diff --git a/src/shpub/Validator.php b/src/shpub/Validator.php index f7f3605..1da91cb 100644 --- a/src/shpub/Validator.php +++ b/src/shpub/Validator.php @@ -16,8 +16,14 @@ class Validator } if (!isset($parts['host'])) { - Log::err('Invalid URL: No host in ' . $helpName); - return false; + if (count($parts) == 1 && isset($parts['path'])) { + //parse_url('example.org') puts 'example.org' in the path + // but this is common, so we fix it. + $url = 'http://' . $parts['path']; + } else { + Log::err('Invalid URL: No host in ' . $helpName); + return false; + } } return $url;