Fix invalid SQL, per bug #15836
[lhc/web/wiklou.git] / includes / specials / SpecialAllpages.php
index afe6738..1dc9be1 100644 (file)
@@ -153,10 +153,9 @@ class SpecialAllpages extends IncludableSpecialPage {
                        $done = false;
                        while( !$done ) {
                                // Fetch the last title of this chunk and the first of the next
-                               $chunk = is_null( $lastTitle )
-                                       ? ''
-                                       : 'page_title >= ' . $dbr->addQuotes( $lastTitle );
-                               $chunk = array($chunk);
+                               $chunk = ( $lastTitle === false )
+                                       ? array()
+                                       : array( 'page_title >= ' . $dbr->addQuotes( $lastTitle ) );
                                $res = $dbr->select( 'page', /* FROM */
                                        'page_title', /* WHAT */
                                        array_merge($where,$chunk),
@@ -227,8 +226,9 @@ class SpecialAllpages extends IncludableSpecialPage {
        }
 
        /**
-        * @todo Document
-        * @param string $from
+        * Show a line of "ABC to DEF" ranges of articles
+        * @param string $inpoint Lower limit of pagenames
+        * @param string $outpout Upper limit of pagenames
         * @param integer $namespace (Default NS_MAIN)
         */
        function showline( $inpoint, $outpoint, $namespace = NS_MAIN ) {
@@ -328,8 +328,6 @@ class SpecialAllpages extends IncludableSpecialPage {
                        }
                }
 
-               $separator = wfMsgExt( 'pipe-separator' , 'escapenoentities' );
-
                if ( $this->including() ) {
                        $out2 = '';
                } else {
@@ -384,7 +382,7 @@ class SpecialAllpages extends IncludableSpecialPage {
                                        . ( $namespace ? '&namespace=' . $namespace : '' );
                                $prevLink = $sk->makeKnownLinkObj( $self,
                                        wfMsgHTML( 'prevpage', htmlspecialchars( $pt ) ), $q );
-                               $out2 .= $separator . $prevLink;
+                               $out2 .= ' | ' . $prevLink;
                        }
 
                        if( $n == $this->maxPerPage && $s = $res->fetchObject() ) {
@@ -394,7 +392,7 @@ class SpecialAllpages extends IncludableSpecialPage {
                                        . ( $namespace ? '&namespace=' . $namespace : '' );
                                $nextLink = $sk->makeKnownLinkObj( $self,
                                        wfMsgHtml( 'nextpage', htmlspecialchars( $t->getText() ) ), $q );
-                               $out2 .= $separator . $nextLink;
+                               $out2 .= ' | ' . $nextLink;
                        }
                        $out2 .= "</td></tr></table><hr />";
                }
@@ -406,7 +404,7 @@ class SpecialAllpages extends IncludableSpecialPage {
                                $wgOut->addHTML( $prevLink );
                        }
                        if( isset( $prevLink ) && isset( $nextLink ) ) {
-                               $wgOut->addHTML( $separator );
+                               $wgOut->addHTML( ' | ' );
                        }
                        if( isset( $nextLink ) ) {
                                $wgOut->addHTML( $nextLink );