X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialDoubleRedirects.php;h=c364f70fa934025d2eeb1a9a4e2f72cc36314edf;hb=cd73babf22a135f63ef3403283e4243f2b9c1323;hp=512fd8569d699a76fac406f70177e71230691268;hpb=490780c68a082d44a5648ba1de400331c75f0b33;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialDoubleRedirects.php b/includes/specials/SpecialDoubleRedirects.php index 512fd8569d..c364f70fa9 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,6 +173,10 @@ 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() { + return 'maintenance'; } }