$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)" );
}
}
) );
}
+ public function getResultProperties() {
+ return array(
+ '' => array(
+ 'pageid' => 'integer',
+ 'ns' => 'namespace',
+ 'title' => 'string',
+ 'redirect' => 'boolean'
+ )
+ );
+ }
+
public function getDescription() {
switch ( $this->getModuleName() ) {
case 'backlinks':