Index: trunk/phpwiki/fpw/wikiPage.php |
— | — | @@ -1004,8 +1004,9 @@ |
1005 | 1005 | if(count($wikiEncodingNames) > 1) { # Shortcut for switching character encodings |
1006 | 1006 | global $THESCRIPT; |
1007 | 1007 | $u = $THESCRIPT . "?" . getenv("QUERY_STRING"); |
| 1008 | + $u = getenv ( "REQUEST_URI" ) ; |
1008 | 1009 | $u = preg_replace("/[\?\&]encoding=[0-9]+/", "", $u); |
1009 | | - $u .= (strchr($u, "?") ? "&" : "?"); |
| 1010 | + $u .= ((!strchr($u, "?") && strstr($THESCRIPT,$u)) ? "?" : "&"); |
1010 | 1011 | foreach ( $wikiEncodingNames as $i => $enc ) { |
1011 | 1012 | if($i > 0) $ret .= " | "; |
1012 | 1013 | if($i == $user->options["encoding"]) $ret .= "<b>"; |