summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHorus32014-03-16 22:52:03 +0100
committerHorus32014-03-16 22:52:03 +0100
commit7f91eee42bf1e48021fc1901c46c2c614adbab7d (patch)
tree98dbb495570baa70a5757a7d9cdcb49dbff4741f
parent7a3dc37a2316e920299f2d56a04da619e8c6433a (diff)
downloadfiles.iamfabulous.de-7f91eee42bf1e48021fc1901c46c2c614adbab7d.tar.gz
Changed rewrite() to cut a trailing slash.
-rwxr-xr-xwww/functions/func_interface.php5
-rwxr-xr-xwww/functions/func_rewrite.php8
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 {