@@ -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 )) {
257257 throw new OneLogin_Saml2_Error (
258258 'Redirect to invalid URL: ' . $ url ,
259259 OneLogin_Saml2_Error::REDIRECT_INVALID_URL
@@ -306,7 +306,7 @@ public static function setBaseURL($baseurl)
306306 {
307307 if (!empty ($ baseurl )) {
308308 $ baseurlpath = '/ ' ;
309- if (preg_match ('#^https?:\/\ /([^\ /]*)\ /?(.*)#i ' , $ baseurl , $ matches )) {
309+ if (preg_match ('#^https?:/ /([^/]*)/?(.*)#i ' , $ baseurl , $ matches )) {
310310 if (strpos ($ baseurl , 'https:// ' ) === false ) {
311311 self ::setSelfProtocol ('http ' );
312312 $ port = '80 ' ;
@@ -587,7 +587,7 @@ public static function getSelfURL()
587587 if (!empty ($ _SERVER ['REQUEST_URI ' ])) {
588588 $ requestURI = $ _SERVER ['REQUEST_URI ' ];
589589 if ($ requestURI [0 ] !== '/ ' ) {
590- if (preg_match ('#^https?:\/\ /[^\ /]*(\ /.*)#i ' , $ requestURI , $ matches )) {
590+ if (preg_match ('#^https?:/ /[^/]*(/.*)#i ' , $ requestURI , $ matches )) {
591591 $ requestURI = $ matches [1 ];
592592 }
593593 }
0 commit comments