Per http://www.mediawiki.org/wiki/Special:Code/MediaWiki/66168#c7252 switch while...
[lhc/web/wiklou.git] / includes / api / ApiQueryAllCategories.php
index be2d9cf..11c843a 100644 (file)
@@ -86,7 +86,7 @@ class ApiQueryAllCategories extends ApiQueryGeneratorBase {
                $categories = array();
                $result = $this->getResult();
                $count = 0;
-               while ( $row = $db->fetchObject( $res ) ) {
+               foreach ( $res as $row ) {
                        if ( ++ $count > $params['limit'] ) {
                                // We've reached the one extra which shows that there are additional cats to be had. Stop here...
                                // TODO: Security issue - if the user has no right to view next title, it will still be shown