Skip to content
This repository
Browse code

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

  • Loading branch information...
commit ea500094d1eacfe29965c875ec3e51d58f717dfc 2 parents 41d50cd + f512a99
Thomas Seifert authored December 19, 2011

Showing 1 changed file with 6 additions and 2 deletions. Show diff stats Hide diff stats

  1. 8  include/phorum_get_url.php
8  include/phorum_get_url.php
@@ -237,7 +237,7 @@ function phorum_get_url_no_uri_auth()
237 237
     $uri_auth = NULL;
238 238
     if (isset($PHORUM['DATA']['GET_VARS'][PHORUM_SESSION_LONG_TERM])) {
239 239
         $uri_auth = $PHORUM['DATA']['GET_VARS'][PHORUM_SESSION_LONG_TERM];
240  
-        unset($PHORUM['DATA']['GET_VARS'][PHORUM_SESSION_LONG_TERM]);       
  240
+        unset($PHORUM['DATA']['GET_VARS'][PHORUM_SESSION_LONG_TERM]);
241 241
     }
242 242
 
243 243
     $argv = func_get_args();
@@ -276,7 +276,7 @@ function phorum_get_current_url($include_query_string=true) {
276 276
     // the SCRIPT_URI. Otherwise, we use the SCRIPT_URI as the current URL.
277 277
     if (isset($_SERVER["SCRIPT_URI"]) &&
278 278
         (!isset($_SERVER['HTTP_HOST']) ||
279  
-         strpos($_SERVER['SCRIPT_URI'], $_SERVER['HTTP_HOST']) !== FALSE)) {
  279
+         stripos($_SERVER['SCRIPT_URI'], "//$_SERVER[HTTP_HOST]/") !== FALSE)) {
280 280
 
281 281
         $url = $_SERVER["SCRIPT_URI"];
282 282
 
@@ -296,6 +296,10 @@ function phorum_get_current_url($include_query_string=true) {
296 296
         $url = $protocol.'://'.$host.$port.$_SERVER['PHP_SELF'];
297 297
     }
298 298
 
  299
+    if(!empty($_SERVER["PATH_INFO"]) && strpos($url, $_SERVER["PATH_INFO"]) !== false){
  300
+        $url = substr($url, 0, strlen($url) - strlen($_SERVER["PATH_INFO"]));
  301
+    }
  302
+
299 303
     if($include_query_string && !empty($_SERVER["QUERY_STRING"])){
300 304
         $url .= "?".$_SERVER["QUERY_STRING"];
301 305
     }

0 notes on commit ea50009

Please sign in to comment.
Something went wrong with that request. Please try again.