diff --git a/lib/SimpleSAML/Utilities.php b/lib/SimpleSAML/Utilities.php index 18925686a0..f272a135d5 100644 --- a/lib/SimpleSAML/Utilities.php +++ b/lib/SimpleSAML/Utilities.php @@ -310,13 +310,12 @@ public static function addURLparameter($url, $parameter) { * allowed by configuration. */ public static function checkURLAllowed($url, array $trustedSites = NULL) { - $url = self::normalizeURL($url); - - // verify that the URL points to an http or https site - if (!preg_match('@^https?://@i', $url)) { - throw new SimpleSAML_Error_Exception('Invalid URL: '.$url); + if (empty($url)) { + return ''; } + $url = self::normalizeURL($url); + // get the white list of domains if ($trustedSites === NULL) { $trustedSites = SimpleSAML_Configuration::getInstance()->getArray('trusted.url.domains', NULL);