Skip to content

Commit 52e2fde

Browse files
committed
.
1 parent 0e6ee4f commit 52e2fde

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

lib/Saml2/Utils.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,9 @@ 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) || empty($url = filter_var($url, FILTER_VALIDATE_URL))) {
256+
$wrongProtocol = !preg_match('@^https?://@i', $url);
257+
$url = filter_var($url, FILTER_VALIDATE_URL);
258+
if ($wrongProtocol || empty($url)) {
257259
throw new OneLogin_Saml2_Error(
258260
'Redirect to invalid URL: ' . $url,
259261
OneLogin_Saml2_Error::REDIRECT_INVALID_URL

0 commit comments

Comments
 (0)