X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialPrefixindex.php;h=5e3e430a2a07b429e299b29ff2519ebde93f49db;hb=e3f6c10d87732c0c8a9bbd7bb57b6c964b92e29a;hp=6db4f2cbfcebb8f8e9a278ef538d5fbc749265d2;hpb=b746001c6659413c70b12651075872532de6130c;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialPrefixindex.php b/includes/specials/SpecialPrefixindex.php index 6db4f2cbfc..5e3e430a2a 100644 --- a/includes/specials/SpecialPrefixindex.php +++ b/includes/specials/SpecialPrefixindex.php @@ -166,6 +166,8 @@ class SpecialPrefixindex extends SpecialAllPages { $prefixList = $this->getNamespaceKeyAndText( $namespace, $prefix ); $namespaces = $wgContLang->getNamespaces(); $res = null; + $n = 0; + $nextRow = null; if ( !$prefixList || !$fromList ) { $out = $this->msg( 'allpagesbadtitle' )->parseAsBlock(); @@ -179,7 +181,7 @@ class SpecialPrefixindex extends SpecialAllPages { # ## @todo FIXME: Should complain if $fromNs != $namespace - $dbr = wfGetDB( DB_SLAVE ); + $dbr = wfGetDB( DB_REPLICA ); $conds = [ 'page_namespace' => $namespace, @@ -207,7 +209,6 @@ class SpecialPrefixindex extends SpecialAllPages { // @todo FIXME: Side link to previous - $n = 0; if ( $res->numRows() > 0 ) { $out = Html::openElement( 'ul', [ 'class' => 'mw-prefixindex-list' ] ); $linkCache = MediaWikiServices::getInstance()->getLinkCache(); @@ -215,6 +216,7 @@ class SpecialPrefixindex extends SpecialAllPages { $prefixLength = strlen( $prefix ); foreach ( $res as $row ) { if ( $n >= $this->maxPerPage ) { + $nextRow = $row; break; } $title = Title::newFromRow( $row ); @@ -259,9 +261,9 @@ class SpecialPrefixindex extends SpecialAllPages { $topOut = $this->namespacePrefixForm( $namespace, $prefix ); - if ( $res && ( $n == $this->maxPerPage ) && ( $s = $res->fetchObject() ) ) { + if ( $res && ( $n == $this->maxPerPage ) && $nextRow ) { $query = [ - 'from' => $s->page_title, + 'from' => $nextRow->page_title, 'prefix' => $prefix, 'hideredirects' => $this->hideRedirects, 'stripprefix' => $this->stripPrefix, @@ -275,7 +277,7 @@ class SpecialPrefixindex extends SpecialAllPages { $nextLink = Linker::linkKnown( $this->getPageTitle(), - $this->msg( 'nextpage', str_replace( '_', ' ', $s->page_title ) )->escaped(), + $this->msg( 'nextpage', str_replace( '_', ' ', $nextRow->page_title ) )->escaped(), [], $query );