$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__ );