summaryrefslogtreecommitdiffstats
path: root/lib/base.php
diff options
context:
space:
mode:
authorGeorg Ehrke <dev@georgswebsite.de>2012-04-23 17:09:28 +0200
committerGeorg Ehrke <dev@georgswebsite.de>2012-04-23 17:09:28 +0200
commit6d92ebca454ab2e6533d0b7a08bfe30d20005820 (patch)
tree4cfcb797863dcf63d1f06cdcbfe48e0d712201e8 /lib/base.php
parent9226cb7a6a029ef1257eee46cd22044a294b0d5f (diff)
downloadnextcloud-server-6d92ebca454ab2e6533d0b7a08bfe30d20005820.tar.gz
nextcloud-server-6d92ebca454ab2e6533d0b7a08bfe30d20005820.zip
use native functions of php to parse the string into the Var
Diffstat (limited to 'lib/base.php')
-rw-r--r--lib/base.php13
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/base.php b/lib/base.php
index 4800a426217..559d49ca997 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -284,7 +284,7 @@ class OC{
if(file_exists(OC::$APPSROOT . '/apps/' . OC::$REQUESTEDAPP . '/' . OC::$REQUESTEDFILE)){
require_once(OC::$APPSROOT . '/apps/' . OC::$REQUESTEDAPP . '/' . OC::$REQUESTEDFILE);
}else{
- header('404 Not found');
+ echo "WTF";
}
}
@@ -401,12 +401,11 @@ class OC{
self::$REQUESTEDAPP = (isset($_GET['app'])?strip_tags($_GET['app']):'files');
self::$REQUESTEDFILE = $_GET['getfile'];
if(substr_count(self::$REQUESTEDFILE, '?') != 0){
- $pos_questionmark = strpos(self::$REQUESTEDFILE, '?');
- $pos_equal = strpos(self::$REQUESTEDFILE, '=');
- $pos_and = strpos(self::$REQUESTEDFILE, '?');
- $_GET[substr(self::$REQUESTEDFILE, $pos_questionmark + 1, $pos_equal - $pos_questionmark - 1)] = substr(self::$REQUESTEDFILE, $pos_equal + 1, $pos_and);
- self::$REQUESTEDFILE = substr(self::$REQUESTEDFILE, 0, $pos_questionmark);
- $_GET['getfile'] = OC::$REQUESTEDFILE;
+ $file = substr(self::$REQUESTEDFILE, 0, strpos(self::$REQUESTEDFILE, '?'));
+ $param = substr(self::$REQUESTEDFILE, strpos(self::$REQUESTEDFILE, '?') + 1);
+ parse_str($param, $_GET);
+ self::$REQUESTEDFILE = $file;
+ $_GET['getfile'] = $file;
}
self::$REQUESTEDFILE = (isset($_GET['getfile'])?(OC_Helper::issubdirectory(OC::$APPSROOT . '/' . self::$REQUESTEDAPP . '/' . self::$REQUESTEDFILE, OC::$APPSROOT . '/' . self::$REQUESTEDAPP)?self::$REQUESTEDFILE:null):null);
}