Fix UserLanguageCondition::showContent() for guests
authorMatthias Schmidt <gravatronics@live.com>
Sat, 14 Mar 2015 09:55:18 +0000 (10:55 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Sat, 14 Mar 2015 09:55:18 +0000 (10:55 +0100)
wcfsetup/install/files/lib/system/condition/UserLanguageCondition.class.php

index 894f9449d59c4925ee43e6d61f1fb097c104a013..9bf72984ff18420c37fdc2f108d56267b6f1e419 100644 (file)
@@ -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;
        }
 }