$titleWhere = array();
foreach ( $this->redirTitles as $t ) {
$titleWhere[] = "{$this->bl_title} = " . $db->addQuotes( $t->getDBkey() ) .
- ( $this->hasNS ? " AND {$this->bl_ns} = '{$t->getNamespace()}'" : '' );
+ ( $this->hasNS ? " AND {$this->bl_ns} = {$t->getNamespace()}" : '' );
}
$this->addWhere( $db->makeList( $titleWhere, LIST_OR ) );
$this->addWhereFld( 'page_namespace', $this->params['namespace'] );
if ( !is_null( $this->redirID ) ) {
$first = $this->redirTitles[0];
- $title = $db->strencode( $first->getDBkey() );
+ $title = $db->addQuotes( $first->getDBkey() );
$ns = $first->getNamespace();
$from = $this->redirID;
if ( $this->hasNS ) {
$this->addWhere( "{$this->bl_ns} > $ns OR " .
"({$this->bl_ns} = $ns AND " .
- "({$this->bl_title} > '$title' OR " .
- "({$this->bl_title} = '$title' AND " .
+ "({$this->bl_title} > $title OR " .
+ "({$this->bl_title} = $title AND " .
"{$this->bl_from} >= $from)))" );
} else {
- $this->addWhere( "{$this->bl_title} > '$title' OR " .
- "({$this->bl_title} = '$title' AND " .
+ $this->addWhere( "{$this->bl_title} > $title OR " .
+ "({$this->bl_title} = $title AND " .
"{$this->bl_from} >= $from)" );
}
}
if ( !is_null( $this->params['continue'] ) ) {
$this->parseContinueParam();
} else {
- $this->rootTitle = $this->getTitleOrPageId( $this->params );
+ $this->rootTitle = $this->getTitleOrPageId( $this->params )->getTitle();
}
// only image titles are allowed for the root in imageinfo mode