Merge "Fixed use of long memcached keys in AllPages."
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Fri, 1 Feb 2013 18:16:09 +0000 (18:16 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 1 Feb 2013 18:16:09 +0000 (18:16 +0000)
1  2 
includes/specials/SpecialAllpages.php

@@@ -188,13 -188,13 +188,13 @@@ class SpecialAllpages extends Includabl
                $from = ( $from && $from->isLocal() ) ? $from->getDBkey() : null;
                $to = ( $to && $to->isLocal() ) ? $to->getDBkey() : null;
  
 -              if( isset($from) )
 -                      $where[] = 'page_title >= '.$dbr->addQuotes( $from );
 -              if( isset($to) )
 -                      $where[] = 'page_title <= '.$dbr->addQuotes( $to );
 +              if( isset( $from ) )
 +                      $where[] = 'page_title >= ' . $dbr->addQuotes( $from );
 +              if( isset( $to ) )
 +                      $where[] = 'page_title <= ' . $dbr->addQuotes( $to );
  
                global $wgMemc;
-               $key = wfMemcKey( 'allpages', 'ns', $namespace, $from, $to );
+               $key = wfMemcKey( 'allpages', 'ns', $namespace, sha1( $from ), sha1( $to ) );
                $lines = $wgMemc->get( $key );
  
                $count = $dbr->estimateRowCount( 'page', '*', $where, __METHOD__ );