diff options
Diffstat (limited to 'lib/base.php')
-rw-r--r-- | lib/base.php | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/base.php b/lib/base.php index cf9230c367e..865d174d212 100644 --- a/lib/base.php +++ b/lib/base.php @@ -308,14 +308,9 @@ class OC { self::$session = new \OC\Session\Internal(OC_Util::getInstanceId()); // if session cant be started break with http 500 error } catch (Exception $e) { - OC_Log::write('core', 'Session could not be initialized. Exception message: '.$e->getMessage(), - OC_Log::ERROR); - header('HTTP/1.1 500 Internal Server Error'); - OC_Util::addStyle("styles"); - $error = 'Session could not be initialized. Please contact your '; - $error .= 'system administrator.'; - - OC_Template::printErrorPage($error); + //show the user a detailed error page + OC_Response::setStatus(OC_Response::STATUS_INTERNAL_SERVER_ERROR); + OC_Template::printExceptionErrorPage($e); } $sessionLifeTime = self::getSessionLifeTime(); @@ -618,6 +613,8 @@ class OC { public static function registerPreviewHooks() { OC_Hook::connect('OC_Filesystem', 'post_write', 'OC\Preview', 'post_write'); OC_Hook::connect('OC_Filesystem', 'delete', 'OC\Preview', 'post_delete'); + OC_Hook::connect('\OCP\Versions', 'delete', 'OC\Preview', 'post_delete'); + OC_Hook::connect('\OCP\Trashbin', 'delete', 'OC\Preview', 'post_delete'); } /** |