Skip to content

Commit 0e6ee4f

Browse files
committed
Add an extra filter to the url to be used on redirection
1 parent 6ab8488 commit 0e6ee4f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/Saml2/Utils.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ public static function redirect($url, $parameters = array(), $stay = false)
253253
}
254254

255255
/* Verify that the URL is to a http or https site. */
256-
if (!preg_match('@^https?://@i', $url)) {
256+
if (!preg_match('@^https?://@i', $url) || empty($url = filter_var($url, FILTER_VALIDATE_URL))) {
257257
throw new OneLogin_Saml2_Error(
258258
'Redirect to invalid URL: ' . $url,
259259
OneLogin_Saml2_Error::REDIRECT_INVALID_URL

0 commit comments

Comments
 (0)