From 04299f9253dc7ee9b92bf4600e7017c53bd66da6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Sz=C3=A9pe?= Date: Wed, 12 Aug 2020 14:06:07 +0200 Subject: [PATCH] fix(ComponentLogServer): check if WP_ENV is defined Make sure we have WP_ENV (#247) --- inc/componentLogServer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/componentLogServer.php b/inc/componentLogServer.php index 8a4a4b2a7..f5a04438b 100644 --- a/inc/componentLogServer.php +++ b/inc/componentLogServer.php @@ -12,7 +12,7 @@ define(__NAMESPACE__ . '\NS', __NAMESPACE__ . '\\'); add_action('Flynt/afterRegisterComponents', function () { - if ((WP_ENV === 'development' || current_user_can('editor') || current_user_can('administrator')) && isset($_GET['log'])) { + if (((defined('WP_ENV') && WP_ENV === 'development') || current_user_can('editor') || current_user_can('administrator')) && isset($_GET['log'])) { if (isset($_GET['component']) && !empty($_GET['component'])) { define(__NAMESPACE__ . '\COMPONENT_WHITELIST', explode(',', $_GET['component'])); }