From 26984f34753dc4c192dffa04c513997b54e89a95 Mon Sep 17 00:00:00 2001 From: Robert Peake Date: Thu, 16 Jul 2015 22:44:58 +0100 Subject: [PATCH] Displays XML error messages on production website In the current configuration FoundationPress is displaying error messages on production websites that have WP_DEBUG set to false. This corrects the issue, and only outputs to the page if WP_DEBUG_DISPLAY is set to true. --- library/cleanup.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/library/cleanup.php b/library/cleanup.php index 98f414306..73f98f2e3 100644 --- a/library/cleanup.php +++ b/library/cleanup.php @@ -190,8 +190,10 @@ public function recreate_img_tag( $tag ) { } catch ( Exception $e ) { - if (defined('WP_DEBUG') && WP_DEBUG) { - echo 'Caught exception: ', $e->getMessage(), "\n"; + if ( defined('WP_DEBUG') && WP_DEBUG ) { + if ( defined('WP_DEBUG_DISPLAY') && WP_DEBUG_DISPLAY ) { + echo 'Caught exception: ', $e->getMessage(), "\n"; + } } }