* @ingroup SpecialPage
*/
class DoubleRedirectsPage extends QueryPage {
-
function __construct( $name = 'DoubleRedirects' ) {
parent::__construct( $name );
}
function reallyGetQueryInfo( $namespace = null, $title = null ) {
$limitToTitle = !( $namespace === null && $title === null );
- $retval = array (
- 'tables' => array (
+ $dbr = wfGetDB( DB_SLAVE );
+ $retval = array(
+ 'tables' => array(
'ra' => 'redirect',
'rb' => 'redirect',
'pa' => 'page',
// Need to check both NULL and "" for some reason,
// apparently either can be stored for non-iw entries.
- '(ra.rd_interwiki IS NULL OR ra.rd_interwiki = "")',
+ 'ra.rd_interwiki IS NULL OR ra.rd_interwiki = ' . $dbr->addQuotes( '' ),
'pb.page_namespace = ra.rd_namespace',
'pb.page_title = ra.rd_title',
'rb.rd_from = pb.page_id',
)
);
+
if ( $limitToTitle ) {
$retval['conds']['pa.page_namespace'] = $namespace;
$retval['conds']['pa.page_title'] = $title;
}
+
return $retval;
}
}
function getOrderFields() {
- return array ( 'ra.rd_namespace', 'ra.rd_title' );
+ return array( 'ra.rd_namespace', 'ra.rd_title' );
}
+ /**
+ * @param Skin $skin
+ * @param object $result Result row
+ * @return string
+ */
function formatResult( $skin, $result ) {
$titleA = Title::makeTitle( $result->namespace, $result->title );
// using the filter of reallyGetQueryInfo.
if ( $result && !isset( $result->nsb ) ) {
$dbr = wfGetDB( DB_SLAVE );
- $qi = $this->reallyGetQueryInfo( $result->namespace,
- $result->title );
- $res = $dbr->select($qi['tables'], $qi['fields'],
- $qi['conds'], __METHOD__ );
+ $qi = $this->reallyGetQueryInfo(
+ $result->namespace,
+ $result->title
+ );
+ $res = $dbr->select(
+ $qi['tables'],
+ $qi['fields'],
+ $qi['conds'],
+ __METHOD__
+ );
+
if ( $res ) {
$result = $dbr->fetchObject( $res );
}
}
$titleB = Title::makeTitle( $result->nsb, $result->tb );
- $titleC = Title::makeTitle( $result->nsc, $result->tc, '', $result->iwc );
+ $titleC = Title::makeTitle( $result->nsc, $result->tc, '', $result->iwc );
$linkA = Linker::linkKnown(
$titleA,
$lang = $this->getLanguage();
$arr = $lang->getArrow() . $lang->getDirMark();
- return( "{$linkA} {$edit} {$arr} {$linkB} {$arr} {$linkC}" );
+ return ( "{$linkA} {$edit} {$arr} {$linkB} {$arr} {$linkC}" );
+ }
+
+ protected function getGroupName() {
+ return 'maintenance';
}
}