From 730c034ff7b2623d7f934ebec043243d0d54d920 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Thu, 10 Jan 2019 18:32:47 +0100 Subject: [PATCH] Fix undefined constants breaking installation See #2787 Close #2828 See 597f120ca832d1a865282e2ea50085444e1d4814 --- .../files/lib/data/language/Language.class.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/wcfsetup/install/files/lib/data/language/Language.class.php b/wcfsetup/install/files/lib/data/language/Language.class.php index d2f42c1e7b..d5f508a947 100644 --- a/wcfsetup/install/files/lib/data/language/Language.class.php +++ b/wcfsetup/install/files/lib/data/language/Language.class.php @@ -80,7 +80,14 @@ class Language extends DatabaseObject { * @return string */ public function get($item, $optional = false) { - if (ENABLE_DEBUG_MODE && ENABLE_DEVELOPER_TOOLS && is_array($optional) && !empty($optional)) { + if ( + defined('ENABLE_DEBUG_MODE') && + ENABLE_DEBUG_MODE && + defined('ENABLE_DEVELOPER_TOOLS') && + ENABLE_DEVELOPER_TOOLS && + is_array($optional) && + !empty($optional) + ) { throw new \InvalidArgumentException("The second parameter of Language::get() does not support non-empty arrays. Did you mean to use Language::getDynamicVariable()?"); } @@ -111,6 +118,7 @@ class Language extends DatabaseObject { if ( defined('ENABLE_DEVELOPER_TOOLS') && ENABLE_DEVELOPER_TOOLS && + defined('LOG_MISSING_LANGUAGE_ITEMS') && LOG_MISSING_LANGUAGE_ITEMS && preg_match('~^([a-zA-Z0-9-_]+\.)+[a-zA-Z0-9-_]+$~', $item) ) { @@ -147,6 +155,7 @@ class Language extends DatabaseObject { if ( defined('ENABLE_DEVELOPER_TOOLS') && ENABLE_DEVELOPER_TOOLS && + defined('LOG_MISSING_LANGUAGE_ITEMS') && LOG_MISSING_LANGUAGE_ITEMS && $staticItem === $item && preg_match('~^([a-zA-Z0-9-_]+\.)+[a-zA-Z0-9-_]+$~', $item) -- 2.20.1