Fix up r43673: reindex the rights array after removing duplicates
authorRoan Kattouw <catrope@users.mediawiki.org>
Thu, 20 Nov 2008 15:15:00 +0000 (15:15 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Thu, 20 Nov 2008 15:15:00 +0000 (15:15 +0000)
includes/api/ApiQueryUserInfo.php

index 1bc30ae..6a02f6c 100644 (file)
@@ -77,7 +77,7 @@ class ApiQueryUserInfo extends ApiQueryBase {
                }
                if (isset($this->prop['rights'])) {
                        // User::getRights() may return duplicate values, strip them
-                       $vals['rights'] = array_unique($wgUser->getRights());
+                       $vals['rights'] = array_values(array_unique($wgUser->getRights()));
                        $result->setIndexedTagName($vals['rights'], 'r');       // even if empty
                }
                if (isset($this->prop['options'])) {