Skip to content
Snippets Groups Projects
Commit b5f43214 authored by Olav Morken's avatar Olav Morken
Browse files

Utilities: Fix getRequestURI() for absolute URIs.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1472 44740490-163a-0410-bde0-09ae8108e29a
parent 8f59fcf9
Branches
Tags
No related merge requests found
......@@ -132,9 +132,14 @@ class SimpleSAML_Utilities {
public static function getRequestURI() {
$requesturi = $_SERVER['REQUEST_URI'];
if (preg_match('|^/.*?(/.*)$|', $_SERVER['REQUEST_URI'], $matches)) {
#$requesturi = $matches[1];
if ($requesturi[0] !== '/') {
/* We probably have an url on the form: http://server/. */
if (preg_match('#^https?://[^/]*(/.*)#i', $requesturi, $matches)) {
$requesturi = $matches[1];
}
}
return $requesturi;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment