From bb698d22288b5543cbeaeecee2833ab0e194cb84 Mon Sep 17 00:00:00 2001
From: Rupert Germann <rupi@gmx.li>
Date: Tue, 17 Nov 2009 19:02:55 +0000
Subject: [PATCH] Fixed bug #11937: Do not show E_DEPRECATED messages on
 productive systems

git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@6460 709f56b5-9817-0410-a4d7-c38de5d9e867
---
 ChangeLog                                          | 1 +
 index.php                                          | 6 +++++-
 misc/phpcheck/incfile.php                          | 6 +++++-
 t3lib/class.t3lib_superadmin.php                   | 7 ++++++-
 t3lib/thumbs.php                                   | 6 +++++-
 typo3/init.php                                     | 6 +++++-
 typo3/install/index.php                            | 7 ++++++-
 typo3/sysext/cms/tslib/index_ts.php                | 6 +++++-
 typo3/sysext/cms/tslib/showpic.php                 | 6 +++++-
 typo3/sysext/install/mod/class.tx_install_ajax.php | 6 +++++-
 typo3/thumbs.php                                   | 7 +++++--
 11 files changed, 53 insertions(+), 11 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index bc3a3ab35d35..3493d8bed2f0 100755
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,7 @@
 	* Fixed bug #12054: PHP5.3-Warning about strcmp() parameters in view_help.php (thanks to Stefan Geith)
 	* Fixed bug #12195: Renaming write protected file issues a php warning
 	* Fixed bug #12099: Replace "Warning: filemtime(): stat failed" with a nice error message (thanks to Steffen Gebert)
+	* Fixed bug #11937: Do not show E_DEPRECATED messages on productive systems
 
 2009-11-17  Oliver Hader  <oliver@typo3.org>
 
diff --git a/index.php b/index.php
index e63af22cec4c..be634e559e65 100644
--- a/index.php
+++ b/index.php
@@ -39,7 +39,11 @@
 // Set error reporting
 // *******************************
 
-error_reporting (E_ALL ^ E_NOTICE);
+if (defined('E_DEPRECATED')) {
+	error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED);
+} else {
+	error_reporting(E_ALL ^ E_NOTICE);
+}
 
 
 // ******************
diff --git a/misc/phpcheck/incfile.php b/misc/phpcheck/incfile.php
index 1d406f0d6849..6e0489fe4fef 100755
--- a/misc/phpcheck/incfile.php
+++ b/misc/phpcheck/incfile.php
@@ -8,7 +8,11 @@ include('../../t3lib/class.t3lib_div.php');
 
 SetCookie('test_script_cookie', 'Cookie Value!', 0, t3lib_div::getIndpEnv('TYPO3_SITE_PATH'));
 
-error_reporting (E_ALL ^ E_NOTICE);
+if (defined('E_DEPRECATED')) {
+	error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED);
+} else {
+	error_reporting(E_ALL ^ E_NOTICE);
+}
 
 define("TYPO3_OS", stristr(PHP_OS,"win")&&!stristr(PHP_OS,"darwin")?"WIN":"");
 /*
diff --git a/t3lib/class.t3lib_superadmin.php b/t3lib/class.t3lib_superadmin.php
index 54e0decb5e9d..23f36a673a9d 100644
--- a/t3lib/class.t3lib_superadmin.php
+++ b/t3lib/class.t3lib_superadmin.php
@@ -99,7 +99,12 @@
 // *******************************
 // Set error reporting
 // *******************************
-error_reporting (E_ALL ^ E_NOTICE);
+if (defined('E_DEPRECATED')) {
+	error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED);
+} else {
+	error_reporting(E_ALL ^ E_NOTICE);
+}
+
 define('TYPO3_mainDir', 'typo3/');		// This is the directory of the backend administration for the sites of this TYPO3 installation.
 
 
diff --git a/t3lib/thumbs.php b/t3lib/thumbs.php
index 500c1210eba0..348cf595cc04 100644
--- a/t3lib/thumbs.php
+++ b/t3lib/thumbs.php
@@ -55,7 +55,11 @@
 // *******************************
 // Set error reporting
 // *******************************
-error_reporting (E_ALL ^ E_NOTICE);
+if (defined('E_DEPRECATED')) {
+	error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED);
+} else {
+	error_reporting(E_ALL ^ E_NOTICE);
+}
 
 
 
diff --git a/typo3/init.php b/typo3/init.php
index 54356f8229d1..7a94cd8acd65 100644
--- a/typo3/init.php
+++ b/typo3/init.php
@@ -66,7 +66,11 @@ if (version_compare(phpversion(), '5.2', '<'))	die ('TYPO3 requires PHP 5.2.0 or
 // *******************************
 // Set error reporting
 // *******************************
-error_reporting (E_ALL ^ E_NOTICE);
+if (defined('E_DEPRECATED')) {
+	error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED);
+} else {
+	error_reporting(E_ALL ^ E_NOTICE);
+}
 
 // *******************************
 // Prevent any unwanted output that may corrupt AJAX/compression. Note: this does
diff --git a/typo3/install/index.php b/typo3/install/index.php
index 520f495fe821..c6f48959ad7e 100755
--- a/typo3/install/index.php
+++ b/typo3/install/index.php
@@ -40,7 +40,12 @@
 // Insert some security here, if you don't trust the Install Tool Password:
 // **************************************************************************
 
-error_reporting (E_ALL ^ E_NOTICE);
+if (defined('E_DEPRECATED')) {
+	error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED);
+} else {
+	error_reporting(E_ALL ^ E_NOTICE);
+}
+
 $PATH_thisScript = str_replace('//','/', str_replace('\\','/', (PHP_SAPI=='cgi'||PHP_SAPI=='isapi' ||PHP_SAPI=='cgi-fcgi')&&($_SERVER['ORIG_PATH_TRANSLATED']?$_SERVER['ORIG_PATH_TRANSLATED']:$_SERVER['PATH_TRANSLATED'])? ($_SERVER['ORIG_PATH_TRANSLATED']?$_SERVER['ORIG_PATH_TRANSLATED']:$_SERVER['PATH_TRANSLATED']):($_SERVER['ORIG_SCRIPT_FILENAME']?$_SERVER['ORIG_SCRIPT_FILENAME']:$_SERVER['SCRIPT_FILENAME'])));
 
 	// Only allow Install Tool access if the file "typo3conf/ENABLE_INSTALL_TOOL" is found
diff --git a/typo3/sysext/cms/tslib/index_ts.php b/typo3/sysext/cms/tslib/index_ts.php
index f2e7704425d9..7bf838272f69 100644
--- a/typo3/sysext/cms/tslib/index_ts.php
+++ b/typo3/sysext/cms/tslib/index_ts.php
@@ -46,7 +46,11 @@ if (version_compare(phpversion(), '5.2', '<'))	die ('TYPO3 requires PHP 5.2.0 or
 // *******************************
 // Set error reporting
 // *******************************
-error_reporting (E_ALL ^ E_NOTICE);
+if (defined('E_DEPRECATED')) {
+	error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED);
+} else {
+	error_reporting(E_ALL ^ E_NOTICE);
+}
 
 
 // ******************
diff --git a/typo3/sysext/cms/tslib/showpic.php b/typo3/sysext/cms/tslib/showpic.php
index c4d5a68da0f2..ba906962b373 100644
--- a/typo3/sysext/cms/tslib/showpic.php
+++ b/typo3/sysext/cms/tslib/showpic.php
@@ -54,7 +54,11 @@
 // *******************************
 // Set error reporting
 // *******************************
-error_reporting (E_ALL ^ E_NOTICE);
+if (defined('E_DEPRECATED')) {
+	error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED);
+} else {
+	error_reporting(E_ALL ^ E_NOTICE);
+}
 
 
 // ***********************
diff --git a/typo3/sysext/install/mod/class.tx_install_ajax.php b/typo3/sysext/install/mod/class.tx_install_ajax.php
index 64454d2473e6..063a088d5ee1 100644
--- a/typo3/sysext/install/mod/class.tx_install_ajax.php
+++ b/typo3/sysext/install/mod/class.tx_install_ajax.php
@@ -30,7 +30,11 @@
 // *******************************
 // Set error reporting
 // *******************************
-error_reporting (E_ALL ^ E_NOTICE);
+if (defined('E_DEPRECATED')) {
+	error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED);
+} else {
+	error_reporting(E_ALL ^ E_NOTICE);
+}
 
 
 // ***********************
diff --git a/typo3/thumbs.php b/typo3/thumbs.php
index d04eb1b16b3b..869f6aea9efa 100644
--- a/typo3/thumbs.php
+++ b/typo3/thumbs.php
@@ -35,8 +35,11 @@
 // *******************************
 // Set error reporting
 // *******************************
-
-error_reporting (E_ALL ^ E_NOTICE);
+if (defined('E_DEPRECATED')) {
+	error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED);
+} else {
+	error_reporting(E_ALL ^ E_NOTICE);
+}
 
 
 define('PATH_thisScript',str_replace('//','/', str_replace('\\','/', (PHP_SAPI=='cgi'||PHP_SAPI=='isapi' ||PHP_SAPI=='cgi-fcgi')&&($_SERVER['ORIG_PATH_TRANSLATED']?$_SERVER['ORIG_PATH_TRANSLATED']:$_SERVER['PATH_TRANSLATED'])? ($_SERVER['ORIG_PATH_TRANSLATED']?$_SERVER['ORIG_PATH_TRANSLATED']:$_SERVER['PATH_TRANSLATED']):($_SERVER['ORIG_SCRIPT_FILENAME']?$_SERVER['ORIG_SCRIPT_FILENAME']:$_SERVER['SCRIPT_FILENAME']))));
-- 
GitLab