Permalink
Browse files

Merge branch 'phorum_5_2' of github.com:Phorum/Core into phorum_5_2

  • Loading branch information...
2 parents 41d50cd + f512a99 commit ea500094d1eacfe29965c875ec3e51d58f717dfc @mysnip mysnip committed Dec 19, 2011
Showing with 6 additions and 2 deletions.
  1. +6 −2 include/phorum_get_url.php
@@ -237,7 +237,7 @@ function phorum_get_url_no_uri_auth()
$uri_auth = NULL;
if (isset($PHORUM['DATA']['GET_VARS'][PHORUM_SESSION_LONG_TERM])) {
$uri_auth = $PHORUM['DATA']['GET_VARS'][PHORUM_SESSION_LONG_TERM];
- unset($PHORUM['DATA']['GET_VARS'][PHORUM_SESSION_LONG_TERM]);
+ unset($PHORUM['DATA']['GET_VARS'][PHORUM_SESSION_LONG_TERM]);
}
$argv = func_get_args();
@@ -276,7 +276,7 @@ function phorum_get_current_url($include_query_string=true) {
// the SCRIPT_URI. Otherwise, we use the SCRIPT_URI as the current URL.
if (isset($_SERVER["SCRIPT_URI"]) &&
(!isset($_SERVER['HTTP_HOST']) ||
- strpos($_SERVER['SCRIPT_URI'], $_SERVER['HTTP_HOST']) !== FALSE)) {
+ stripos($_SERVER['SCRIPT_URI'], "//$_SERVER[HTTP_HOST]/") !== FALSE)) {
$url = $_SERVER["SCRIPT_URI"];
@@ -296,6 +296,10 @@ function phorum_get_current_url($include_query_string=true) {
$url = $protocol.'://'.$host.$port.$_SERVER['PHP_SELF'];
}
+ if(!empty($_SERVER["PATH_INFO"]) && strpos($url, $_SERVER["PATH_INFO"]) !== false){
+ $url = substr($url, 0, strlen($url) - strlen($_SERVER["PATH_INFO"]));
+ }
+
if($include_query_string && !empty($_SERVER["QUERY_STRING"])){
$url .= "?".$_SERVER["QUERY_STRING"];
}

0 comments on commit ea50009

Please sign in to comment.