diff options
| author | Horus3 | 2014-03-16 22:52:03 +0100 |
|---|---|---|
| committer | Horus3 | 2014-03-16 22:52:03 +0100 |
| commit | 7f91eee42bf1e48021fc1901c46c2c614adbab7d (patch) | |
| tree | 98dbb495570baa70a5757a7d9cdcb49dbff4741f | |
| parent | 7a3dc37a2316e920299f2d56a04da619e8c6433a (diff) | |
| download | files.iamfabulous.de-7f91eee42bf1e48021fc1901c46c2c614adbab7d.tar.gz | |
Changed rewrite() to cut a trailing slash.
| -rwxr-xr-x | www/functions/func_interface.php | 5 | ||||
| -rwxr-xr-x | www/functions/func_rewrite.php | 8 |
2 files changed, 11 insertions, 2 deletions
diff --git a/www/functions/func_interface.php b/www/functions/func_interface.php index 0964470..2a8ef34 100755 --- a/www/functions/func_interface.php +++ b/www/functions/func_interface.php @@ -16,5 +16,8 @@ function collect_content($db){ } return $content; - //var_dump($content); +} + +function print_browser($content){ + var_dump($content); } 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 { |
