Work-around for PHP 5.3.3 randomly failing in uasort()
authorAlexander Ebert <ebert@woltlab.com>
Mon, 15 Dec 2014 15:53:48 +0000 (16:53 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Mon, 15 Dec 2014 15:53:48 +0000 (16:53 +0100)
wcfsetup/install/files/lib/acp/form/UserOptionListForm.class.php

index d304f6347acde0e48106e84b93e2c1e454c25cc0..96b8f07f2db17dfa4c8e3668e622ab8a7eead9e2 100644 (file)
@@ -32,6 +32,11 @@ abstract class UserOptionListForm extends AbstractOptionListForm {
        protected function getAvailableGroups() {
                $userGroups = UserGroup::getAccessibleGroups(array(), array(UserGroup::GUESTS, UserGroup::EVERYONE, UserGroup::USERS));
                
+               // work-around for PHP 5.3.3 randomly failing in uasort()
+               foreach ($userGroups as $userGroup) {
+                       $userGroup->getName();
+               }
+               
                uasort($userGroups, function(UserGroup $groupA, UserGroup $groupB) {
                        return strcmp($groupA->getName(), $groupB->getName());
                });