summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHorus32014-03-11 23:58:51 +0100
committerHorus32014-03-11 23:58:51 +0100
commit3bb704a521afdd999a7b48b8cff71adfc05c565d (patch)
tree84bbebd3c42b03f9f8a761ac5de05f93afd56a77
parentca3d504428d053e3c344cafdefc7f7836f39dd1c (diff)
downloadfiles.iamfabulous.de-3bb704a521afdd999a7b48b8cff71adfc05c565d.tar.gz
Forward arguments for the httperror site
-rw-r--r--www/functions.php11
-rw-r--r--www/index.php2
-rw-r--r--www/select_function.php9
3 files changed, 15 insertions, 7 deletions
diff --git a/www/functions.php b/www/functions.php
index f301cea..34e1a53 100644
--- a/www/functions.php
+++ b/www/functions.php
@@ -258,9 +258,7 @@ function register($db){
/* --PAGE NOT FOUND - 404 -- */
-function get_404(){
-// echo "Sorry, page not found. <br>";
-// select($db);
+function get_404($working_path, $wrong_folder){
include("404.php");
exit;
}
@@ -296,7 +294,11 @@ function rewrite($db){
header("Refresh: 0; /" . $_SESSION[username] . "/" . $_GET["name"] . "/" . $_GET["folder"] . "");
exit;
} else {
- get_404();
+
+ $wrong_folder = $_GET["name"];
+ $working_path = $_GET["name"];
+
+ get_404($working_path, $wrong_folder);
}
return false;
}
@@ -320,5 +322,4 @@ function user($db){
echo "<br><br>";
echo "You have currently $invite invites. <br>";
-// exit;
}
diff --git a/www/index.php b/www/index.php
index 3cc5377..178e66d 100644
--- a/www/index.php
+++ b/www/index.php
@@ -44,7 +44,7 @@ if(empty($_GET)){
user($db);
break;
default:
- get_404();
+ get_404($_GET["task"], $_GET["task"]);
break;
}
} else {
diff --git a/www/select_function.php b/www/select_function.php
index 0421b58..c4f563b 100644
--- a/www/select_function.php
+++ b/www/select_function.php
@@ -41,8 +41,15 @@ function select($db){
}
$prim_id = $parentdir_db->fetchArray(SQLITE3_NUM);
if($parentdir != $prim_id[1]){
+
$wrong_folder = $folder_array_unsafe[$i];
- failure("This folder doesn't exist. Folder: " . $wrong_folder);
+ $working_path[0] = $wrong_folder;
+
+ for($j=0; $j<$i; $j++){
+ $working_path[$j] = $folder_array_unsafe[$j];
+ }
+
+ get_404($working_path, $wrong_folder);
}
$parentdir = $prim_id[0];