|
|
|
@ -49,7 +49,7 @@ try { |
|
|
|
|
$pathInfo = trim($pathInfo, '/'); |
|
|
|
|
list($service) = explode('/', $pathInfo); |
|
|
|
|
} |
|
|
|
|
$file = OCP\CONFIG::getAppValue('core', 'public_' . strip_tags($service)); |
|
|
|
|
$file = OCP\Config::getAppValue('core', 'public_' . strip_tags($service)); |
|
|
|
|
if (is_null($file)) { |
|
|
|
|
header('HTTP/1.0 404 Not Found'); |
|
|
|
|
exit; |
|
|
|
@ -73,14 +73,18 @@ try { |
|
|
|
|
|
|
|
|
|
require_once OC_App::getAppPath($app) . '/' . $parts[1]; |
|
|
|
|
|
|
|
|
|
} catch (\OC\ServiceUnavailableException $ex) { |
|
|
|
|
} catch (Exception $ex) { |
|
|
|
|
if ($ex instanceof \OC\ServiceUnavailableException) { |
|
|
|
|
OC_Response::setStatus(OC_Response::STATUS_SERVICE_UNAVAILABLE); |
|
|
|
|
} else { |
|
|
|
|
OC_Response::setStatus(OC_Response::STATUS_INTERNAL_SERVER_ERROR); |
|
|
|
|
} |
|
|
|
|
//show the user a detailed error page |
|
|
|
|
OC_Response::setStatus(OC_Response::STATUS_SERVICE_UNAVAILABLE); |
|
|
|
|
\OCP\Util::writeLog('remote', $ex->getMessage(), \OCP\Util::FATAL); |
|
|
|
|
\OC::$server->getLogger()->logException($ex, ['app' => 'public']); |
|
|
|
|
OC_Template::printExceptionErrorPage($ex); |
|
|
|
|
} catch (Exception $ex) { |
|
|
|
|
} catch (Error $ex) { |
|
|
|
|
//show the user a detailed error page |
|
|
|
|
OC_Response::setStatus(OC_Response::STATUS_INTERNAL_SERVER_ERROR); |
|
|
|
|
\OCP\Util::writeLog('remote', $ex->getMessage(), \OCP\Util::FATAL); |
|
|
|
|
\OC::$server->getLogger()->logException($ex, ['app' => 'public']); |
|
|
|
|
OC_Template::printExceptionErrorPage($ex); |
|
|
|
|
} |
|
|
|
|