Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions lib/SimpleSAML/Utilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down