From 7f91eee42bf1e48021fc1901c46c2c614adbab7d Mon Sep 17 00:00:00 2001 From: Horus3 Date: Sun, 16 Mar 2014 22:52:03 +0100 Subject: Changed rewrite() to cut a trailing slash. --- www/functions/func_rewrite.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'www/functions/func_rewrite.php') 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 { -- cgit v1.2.3