From c704e8077f40c41c02f0a1644ca84b9b0605dc11 Mon Sep 17 00:00:00 2001 From: BlackEagle Date: Fri, 25 May 2012 21:08:04 +0200 Subject: remote.php :: use non apache-only env vars - fixes following error when using nginx + php-fpm [error] *6568 FastCGI sent in stderr: "PHP message: PHP Warning: strpos(): Offset not contained in string in /some-path/owncloud/remote.php on line 10" Signed-off-by: BlackEagle --- remote.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/remote.php b/remote.php index 44b85f762f5..63a45321eb0 100644 --- a/remote.php +++ b/remote.php @@ -5,7 +5,7 @@ require_once('lib/base.php'); if (array_key_exists('PATH_INFO', $_SERVER)){ $path_info = $_SERVER['PATH_INFO']; }else{ - $path_info = substr($_SERVER['PHP_SELF'], strpos($_SERVER['PHP_SELF'], basename(__FILE__)) + strlen(basename(__FILE__))); + $path_info = substr($_SERVER['REQUEST_URI'], strlen($_SERVER['SCRIPT_NAME'])); } if (!$pos = strpos($path_info, '/', 1)) { $pos = strlen($path_info); @@ -22,4 +22,4 @@ $app=$parts[2]; OC_App::loadApp($app); $baseuri = OC::$WEBROOT . '/remote.php/'.$service.'/'; -require_once(OC::$APPSROOT . $file); \ No newline at end of file +require_once(OC::$APPSROOT . $file); -- cgit v1.2.3 From 6d3ae575b6ed9934e37a884ea152008a29cbfc7b Mon Sep 17 00:00:00 2001 From: Bart Visscher Date: Fri, 15 Jun 2012 22:35:09 +0200 Subject: Remove $DOCUMENTROOT, not used --- apps/user_webfinger/webfinger.php | 7 ------- lib/base.php | 6 +----- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/apps/user_webfinger/webfinger.php b/apps/user_webfinger/webfinger.php index e75c546c2cb..39ab4ba6ba5 100644 --- a/apps/user_webfinger/webfinger.php +++ b/apps/user_webfinger/webfinger.php @@ -17,13 +17,6 @@ header("Content-Type: application/xrd+json"); * '* but can also use complex database queries to generate the webfinger result **/ -// calculate the documentroot -// modified version of the one in lib/base.php that takes the .well-known symlink into account -/*$DOCUMENTROOT=realpath($_SERVER['DOCUMENT_ROOT']); -$SERVERROOT=str_replace("\\",'/',dirname(dirname(dirname(dirname(__FILE__))))); -$SUBURI=substr(realpath($_SERVER["SCRIPT_FILENAME"]),strlen($SERVERROOT)); -$WEBROOT=substr($SUBURI,0,-34); -*/ $userName = ''; $hostName = ''; diff --git a/lib/base.php b/lib/base.php index f85710ddfcf..fedc1238851 100644 --- a/lib/base.php +++ b/lib/base.php @@ -121,8 +121,7 @@ class OC{ } public static function initPaths(){ - // calculate the documentroot - $DOCUMENTROOT=realpath($_SERVER['DOCUMENT_ROOT']); + // calculate the root directories OC::$SERVERROOT=str_replace("\\",'/',substr(__FILE__,0,-13)); OC::$SUBURI= str_replace("\\","/",substr(realpath($_SERVER["SCRIPT_FILENAME"]),strlen(OC::$SERVERROOT))); $scriptName=$_SERVER["SCRIPT_NAME"]; @@ -137,9 +136,6 @@ class OC{ } } OC::$WEBROOT=substr($scriptName,0,strlen($scriptName)-strlen(OC::$SUBURI)); - // try a new way to detect the WEBROOT which is simpler and also works with the app directory outside the owncloud folder. let´s see if this works for everybody -// OC::$WEBROOT=substr(OC::$SERVERROOT,strlen($DOCUMENTROOT)); - if(OC::$WEBROOT!='' and OC::$WEBROOT[0]!=='/'){ OC::$WEBROOT='/'.OC::$WEBROOT; -- cgit v1.2.3 From 4268fe61bad04a873a8f161937128dbae1eae741 Mon Sep 17 00:00:00 2001 From: Bart Visscher Date: Sat, 16 Jun 2012 00:44:23 +0200 Subject: Calendar: Write-close session to enable parallel events.php requests --- apps/calendar/ajax/events.php | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/calendar/ajax/events.php b/apps/calendar/ajax/events.php index 3f29f1e5eff..39130a6a983 100644 --- a/apps/calendar/ajax/events.php +++ b/apps/calendar/ajax/events.php @@ -11,6 +11,7 @@ require_once('when/When.php'); OCP\JSON::checkLoggedIn(); OCP\JSON::checkAppEnabled('calendar'); +session_write_close(); // Look for the calendar id $calendar_id = null; -- cgit v1.2.3