From: Aryeh Gregor Date: Fri, 23 Jul 2010 20:01:53 +0000 (+0000) Subject: Use modern coding constructs and a better var name X-Git-Tag: 1.31.0-rc.0~35986 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dcompta/operations/modifier.php?a=commitdiff_plain;h=190af3f507911c4988e084ff7a9fb9b941bbdcde;p=lhc%2Fweb%2Fwiklou.git Use modern coding constructs and a better var name foreach ( $res as $row ), Title::newFromRow(), $row instead of $x. --- diff --git a/includes/CategoryPage.php b/includes/CategoryPage.php index e07ae775a6..16e6ed2ebf 100644 --- a/includes/CategoryPage.php +++ b/includes/CategoryPage.php @@ -262,23 +262,23 @@ class CategoryViewer { $count = 0; $this->nextPage = null; - while ( $x = $dbr->fetchObject ( $res ) ) { + foreach ( $res as $row ) { if ( ++$count > $this->limit ) { // We've reached the one extra which shows that there are // additional pages to be had. Stop here... - $this->nextPage = $x->cl_sortkey; + $this->nextPage = $row->cl_sortkey; break; } - $title = Title::makeTitle( $x->page_namespace, $x->page_title ); + $title = Title::newFromRow( $row ); if ( $title->getNamespace() == NS_CATEGORY ) { - $cat = Category::newFromRow( $x, $title ); - $this->addSubcategoryObject( $cat, $x->cl_sortkey, $x->page_len ); + $cat = Category::newFromRow( $row, $title ); + $this->addSubcategoryObject( $cat, $row->cl_sortkey, $row->page_len ); } elseif ( $this->showGallery && $title->getNamespace() == NS_FILE ) { - $this->addImage( $title, $x->cl_sortkey, $x->page_len, $x->page_is_redirect ); + $this->addImage( $title, $row->cl_sortkey, $row->page_len, $row->page_is_redirect ); } else { - $this->addPage( $title, $x->cl_sortkey, $x->page_len, $x->page_is_redirect ); + $this->addPage( $title, $row->cl_sortkey, $row->page_len, $row->page_is_redirect ); } }