From: Matthias Schmidt Date: Sat, 14 Mar 2015 09:55:18 +0000 (+0100) Subject: Fix UserLanguageCondition::showContent() for guests X-Git-Tag: 2.1.2~45 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=907c080e151f4b6609761935dd3dd3af823c7d12;p=GitHub%2FWoltLab%2FWCF.git Fix UserLanguageCondition::showContent() for guests --- diff --git a/wcfsetup/install/files/lib/system/condition/UserLanguageCondition.class.php b/wcfsetup/install/files/lib/system/condition/UserLanguageCondition.class.php index 894f9449d5..9bf72984ff 100644 --- a/wcfsetup/install/files/lib/system/condition/UserLanguageCondition.class.php +++ b/wcfsetup/install/files/lib/system/condition/UserLanguageCondition.class.php @@ -113,6 +113,14 @@ class UserLanguageCondition extends AbstractSingleFieldCondition implements ICon * @see \wcf\system\condition\IContentCondition::showContent() */ public function showContent(Condition $condition) { - return $this->checkUser($condition, WCF::getUser()); + if (WCF::getUser()->userID) { + return $this->checkUser($condition, WCF::getUser()); + } + + if (!empty($condition->conditionData['languageIDs']) && !in_array(WCF::getLanguage()->languageID, $condition->languageIDs)) { + return false; + } + + return true; } }