diff options
Diffstat (limited to 'www/functions/func_rewrite.php')
| -rwxr-xr-x | www/functions/func_rewrite.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/www/functions/func_rewrite.php b/www/functions/func_rewrite.php index 1d30982..8e8e45f 100755 --- a/www/functions/func_rewrite.php +++ b/www/functions/func_rewrite.php @@ -9,8 +9,14 @@ function rewrite($db){ /* if first argument wasn't valid, rewrite the URL to include the username */ + $folder = $_GET["folder"]; + + if(preg_match("/\/$/", $_GET["folder"])){ + $folder = substr($_GET["folder"], 0, -1); + } + if($_SESSION["login"]){ - header("Refresh: 0; /" . $_SESSION['username'] . "/" . $_GET["name"] . "/" . $_GET["folder"] . ""); + header("Refresh: 0; /" . $_SESSION['username'] . "/" . $_GET["name"] . "/" . $folder . ""); return false; } else { |
