Fixes User::getLanguageIDs()
authorMatthias Schmidt <gravatronics@live.com>
Sat, 21 Jul 2012 10:51:09 +0000 (12:51 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Sat, 21 Jul 2012 10:51:09 +0000 (12:51 +0200)
Currently, if there are no entries in wcfN_user_to_language for a registered user (like when a user was created via ACP), the stored value is NULL instead of an empty array.

wcfsetup/install/files/lib/data/user/User.class.php

index 0a56052dab0c287c386c8cd691888376bcdcd312..ffcaa962aafc07e878993c000c19867ac692ecbf 100644 (file)
@@ -150,10 +150,9 @@ final class User extends DatabaseObject implements IRouteController {
         */
        public function getLanguageIDs() {
                if ($this->languageIDs === null) {
-                       if (!$this->userID) {
-                               $this->languageIDs = array();
-                       }
-                       else {
+                       $this->languageIDs = array();
+                       
+                       if ($this->userID) {
                                // load storage data
                                UserStorageHandler::getInstance()->loadStorage(array($this->userID));