From 1f98c2cfc4f58e6adf02ac05f2ba19677a5141b1 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 9 Jul 2012 10:24:33 +0200 Subject: [PATCH] Fix: add possibility to use strict mode for debugging --- htdocs/filefunc.inc.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index 2256aaea066..ffa61de2c9c 100755 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -53,10 +53,6 @@ if (! defined('LOG_DEBUG')) } } -// Force PHP error_reporting setup (Dolibarr may report warning without this) -error_reporting(E_ALL & ~(E_STRICT|E_NOTICE|E_DEPRECATED)); -//error_reporting(E_ALL | E_STRICT); - // End of common declaration part if (defined('DOL_INC_FOR_VERSION_ERROR')) return; @@ -78,6 +74,17 @@ if (! $result && ! empty($_SERVER["GATEWAY_INTERFACE"])) // If install not do header("Location: install/index.php"); exit; } + +// Force PHP error_reporting setup (Dolibarr may report warning without this) +if (! empty($dolibarr_strict_mode)) +{ + error_reporting(E_ALL | E_STRICT); +} +else +{ + error_reporting(E_ALL & ~(E_STRICT|E_NOTICE|E_DEPRECATED)); +} + // Disable php display errors if (! empty($dolibarr_main_prod)) ini_set('display_errors','Off');