From c198390a49136cb180c16a6917b7e315f6a21793 Mon Sep 17 00:00:00 2001 From: Petr Skoda Date: Sat, 19 Nov 2011 11:23:28 +0100 Subject: [PATCH] MDL-30294 prevent notices and errors in theme files content Theme images, css and JS are broken by PHP error messages which creates major problems for production sites with enabled displaying of errors because the files are cached indefinitely. It is better to send the errors and notices to logs only, in any case all developers must learn to use error logs. --- theme/image.php | 4 ++++ theme/javascript.php | 4 ++++ theme/styles.php | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/theme/image.php b/theme/image.php index e00f5592f7f..a1a2e66b360 100644 --- a/theme/image.php +++ b/theme/image.php @@ -24,6 +24,10 @@ */ +// disable moodle specific debug messages and any errors in output, +// comment out when debugging or better look into error log! +define('NO_DEBUG_DISPLAY', true); + // we need just the values from config.php and minlib.php define('ABORT_AFTER_CONFIG', true); require('../config.php'); // this stops immediately at the beginning of lib/setup.php diff --git a/theme/javascript.php b/theme/javascript.php index 6e8a79d785b..afe5d013124 100644 --- a/theme/javascript.php +++ b/theme/javascript.php @@ -24,6 +24,10 @@ */ +// disable moodle specific debug messages and any errors in output, +// comment out when debugging or better look into error log! +define('NO_DEBUG_DISPLAY', true); + // we need just the values from config.php and minlib.php define('ABORT_AFTER_CONFIG', true); require('../config.php'); // this stops immediately at the beginning of lib/setup.php diff --git a/theme/styles.php b/theme/styles.php index 6fcde59e1b6..909bfb5468c 100644 --- a/theme/styles.php +++ b/theme/styles.php @@ -24,6 +24,10 @@ */ +// disable moodle specific debug messages and any errors in output, +// comment out when debugging or better look into error log! +define('NO_DEBUG_DISPLAY', true); + // we need just the values from config.php and minlib.php define('ABORT_AFTER_CONFIG', true); require('../config.php'); // this stops immediately at the beginning of lib/setup.php