From: Matthias Schmidt Date: Thu, 10 Jan 2019 17:32:47 +0000 (+0100) Subject: Fix undefined constants breaking installation X-Git-Tag: 5.2.0_Alpha_1~365^2~17 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=730c034ff7b2623d7f934ebec043243d0d54d920;p=GitHub%2FWoltLab%2FWCF.git Fix undefined constants breaking installation See #2787 Close #2828 See 597f120ca832d1a865282e2ea50085444e1d4814 --- 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)