From cf1c3635ff80910c88ccdbd096158a2881b7be40 Mon Sep 17 00:00:00 2001 From: Georg Ehrke Date: Fri, 8 Jun 2012 22:30:02 +0200 Subject: [PATCH 1/2] fix loading of OC::$REQUESTEDAPP if WTFE the app parameter is given but empty aka /?app --- lib/base.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/base.php b/lib/base.php index cfcfb94af80..3062c9b23dc 100644 --- a/lib/base.php +++ b/lib/base.php @@ -438,7 +438,7 @@ class OC{ register_shutdown_function(array('OC_Helper','cleanTmp')); //parse the given parameters - self::$REQUESTEDAPP = (isset($_GET['app'])?str_replace(array('\0', '/', '\\', '..'), '', strip_tags($_GET['app'])):OC_Config::getValue('defaultapp', 'files')); + self::$REQUESTEDAPP = (isset($_GET['app']) && trim($_GET['app']) != '' && !is_null($_GET['app'])?str_replace(array('\0', '/', '\\', '..'), '', strip_tags($_GET['app'])):OC_Config::getValue('defaultapp', 'files')); if(substr_count(self::$REQUESTEDAPP, '?') != 0){ $app = substr(self::$REQUESTEDAPP, 0, strpos(self::$REQUESTEDAPP, '?')); $param = substr(self::$REQUESTEDAPP, strpos(self::$REQUESTEDAPP, '?') + 1); From 6e1ca36207b3df6e895267848a3c3e04b9a971c1 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Sat, 9 Jun 2012 14:37:52 +0200 Subject: [PATCH 2/2] fix infinite redirect during setup for windows hosts --- lib/base.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/base.php b/lib/base.php index 3062c9b23dc..71e2ed63888 100644 --- a/lib/base.php +++ b/lib/base.php @@ -128,7 +128,7 @@ class OC{ // calculate the documentroot OC::$DOCUMENTROOT=realpath($_SERVER['DOCUMENT_ROOT']); OC::$SERVERROOT=str_replace("\\",'/',substr(__FILE__,0,-13)); - OC::$SUBURI=substr(realpath($_SERVER["SCRIPT_FILENAME"]),strlen(OC::$SERVERROOT)); + OC::$SUBURI= str_replace("\\","/",substr(realpath($_SERVER["SCRIPT_FILENAME"]),strlen(OC::$SERVERROOT))); $scriptName=$_SERVER["SCRIPT_NAME"]; if(substr($scriptName,-1)=='/'){ $scriptName.='index.php';