From 40b8be065bb809a3d6113d371af27a4c475beb45 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Sat, 25 Jul 2015 18:24:03 +0200 Subject: [PATCH] LSsession : Catch initialization exceptions --- .../includes/class/class.LSsession.php | 29 +++++++++++-------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/public_html/includes/class/class.LSsession.php b/public_html/includes/class/class.LSsession.php index 4703a2d8..44f646e1 100644 --- a/public_html/includes/class/class.LSsession.php +++ b/public_html/includes/class/class.LSsession.php @@ -444,19 +444,24 @@ class LSsession { * @retval boolean True si l'initialisation à réussi, false sinon. */ public static function initialize() { - if (!self :: startLSconfig()) { - return; + try { + if (!self :: startLSconfig()) { + return; + } + + self :: startLSerror(); + self :: startLStemplate(); + + session_start(); + + self :: setLocale(); + + self :: loadLSaddons(); + self :: loadLSauth(); + } + catch (Exception $e) { + die('LSsession : fail to initialize session. Error : '.$e->getMessage()); } - - self :: startLSerror(); - self :: startLStemplate(); - - session_start(); - - self :: setLocale(); - - self :: loadLSaddons(); - self :: loadLSauth(); return true; }