diff options
author | Bart Visscher <bartv@thisnet.nl> | 2012-06-09 14:32:02 +0200 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2012-06-09 14:39:41 +0200 |
commit | 014895aeab547ce30b91c291b3d517d2dcc1c047 (patch) | |
tree | d16f1be8399640501474ff917e6894784e33d451 /remote.php | |
parent | 76de92477f42a9c52ce5f55fc8e91e19d4b3513d (diff) | |
download | nextcloud-server-014895aeab547ce30b91c291b3d517d2dcc1c047.tar.gz nextcloud-server-014895aeab547ce30b91c291b3d517d2dcc1c047.zip |
Check for missing path_info, also use OC_Response for 404 error
Diffstat (limited to 'remote.php')
-rw-r--r-- | remote.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/remote.php b/remote.php index 7131dfc9407..b1be50f36a7 100644 --- a/remote.php +++ b/remote.php @@ -7,13 +7,17 @@ if (array_key_exists('PATH_INFO', $_SERVER)){ }else{ $path_info = substr($_SERVER['PHP_SELF'], strpos($_SERVER['PHP_SELF'], basename(__FILE__)) + strlen(basename(__FILE__))); } +if ($path_info === false) { + OC_Response::setStatus(OC_Response::STATUS_NOT_FOUND); + exit; +} if (!$pos = strpos($path_info, '/', 1)) { $pos = strlen($path_info); } $service=substr($path_info, 1, $pos-1); $file = OC_AppConfig::getValue('core', 'remote_' . $service); if(is_null($file)){ - header('HTTP/1.0 404 Not Found'); + OC_Response::setStatus(OC_Response::STATUS_NOT_FOUND); exit; } @@ -22,4 +26,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); |