Skip to content
Snippets Groups Projects
Commit b6b6bfcd authored by Jaime Perez's avatar Jaime Perez
Browse files

Remove extra URL validation as normalizeURL() will have done that already....

Remove extra URL validation as normalizeURL() will have done that already. Return an empty string if the input URL is empty (disregarding its type). This should make the checkURLAllowed() function transparent and avoid it returning the current URL (normalized) when input is empty. Fixes #99.
parent 02642b49
No related branches found
No related tags found
No related merge requests found
......@@ -309,12 +309,10 @@ class SimpleSAML_Utilities {
* 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) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment