summaryrefslogtreecommitdiff
path: root/includes/specials/SpecialDoubleRedirects.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/specials/SpecialDoubleRedirects.php')
-rw-r--r--includes/specials/SpecialDoubleRedirects.php31
1 files changed, 22 insertions, 9 deletions
diff --git a/includes/specials/SpecialDoubleRedirects.php b/includes/specials/SpecialDoubleRedirects.php
index 5a5d749c..c364f70f 100644
--- a/includes/specials/SpecialDoubleRedirects.php
+++ b/includes/specials/SpecialDoubleRedirects.php
@@ -28,7 +28,6 @@
* @ingroup SpecialPage
*/
class DoubleRedirectsPage extends QueryPage {
-
function __construct( $name = 'DoubleRedirects' ) {
parent::__construct( $name );
}
@@ -52,8 +51,8 @@ class DoubleRedirectsPage extends QueryPage {
function reallyGetQueryInfo( $namespace = null, $title = null ) {
$limitToTitle = !( $namespace === null && $title === null );
$dbr = wfGetDB( DB_SLAVE );
- $retval = array (
- 'tables' => array (
+ $retval = array(
+ 'tables' => array(
'ra' => 'redirect',
'rb' => 'redirect',
'pa' => 'page',
@@ -91,10 +90,12 @@ class DoubleRedirectsPage extends QueryPage {
'rb.rd_from = pb.page_id',
)
);
+
if ( $limitToTitle ) {
$retval['conds']['pa.page_namespace'] = $namespace;
$retval['conds']['pa.page_title'] = $title;
}
+
return $retval;
}
@@ -103,9 +104,14 @@ class DoubleRedirectsPage extends QueryPage {
}
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 );
@@ -116,10 +122,17 @@ class DoubleRedirectsPage extends QueryPage {
// 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 );
}
@@ -160,7 +173,7 @@ class DoubleRedirectsPage extends QueryPage {
$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() {