X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialDoubleRedirects.php;h=d73ac19875c0879733b5ef993f984a658bd0144b;hb=0bbe51d765939354e487f5c6c9fcf38fc7cba6e8;hp=ba14c664ced457dca3c49583172df05fe3285713;hpb=70f51388a6d4f1e50af884e37ea33681880b72d8;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialDoubleRedirects.php b/includes/specials/SpecialDoubleRedirects.php index ba14c664ce..d73ac19875 100644 --- a/includes/specials/SpecialDoubleRedirects.php +++ b/includes/specials/SpecialDoubleRedirects.php @@ -122,28 +122,33 @@ class DoubleRedirectsPage extends QueryPage { // That does save the bulk of the query cost, but now we need to // get a little more detail about each individual entry quickly // using the filter of reallyGetQueryInfo. - if ( $result && !isset( $result->b_namespace ) ) { - $dbr = wfGetDB( DB_REPLICA ); - $qi = $this->reallyGetQueryInfo( - $result->namespace, - $result->title - ); - $res = $dbr->select( - $qi['tables'], - $qi['fields'], - $qi['conds'], - __METHOD__ - ); - - if ( $res ) { - $result = $dbr->fetchObject( $res ); + $deep = false; + if ( $result ) { + if ( isset( $result->b_namespace ) ) { + $deep = $result; + } else { + $dbr = wfGetDB( DB_REPLICA ); + $qi = $this->reallyGetQueryInfo( + $result->namespace, + $result->title + ); + $res = $dbr->select( + $qi['tables'], + $qi['fields'], + $qi['conds'], + __METHOD__ + ); + + if ( $res ) { + $deep = $dbr->fetchObject( $res ) ?: false; + } } } $titleA = Title::makeTitle( $result->namespace, $result->title ); $linkRenderer = $this->getLinkRenderer(); - if ( !$result ) { + if ( !$deep ) { return '' . $linkRenderer->makeLink( $titleA, null, [], [ 'redirect' => 'no' ] ) . ''; } @@ -171,7 +176,7 @@ class DoubleRedirectsPage extends QueryPage { [ 'redirect' => 'no' ] ); - $titleB = Title::makeTitle( $result->b_namespace, $result->b_title ); + $titleB = Title::makeTitle( $deep->b_namespace, $deep->b_title ); $linkB = $linkRenderer->makeKnownLink( $titleB, null, @@ -180,10 +185,10 @@ class DoubleRedirectsPage extends QueryPage { ); $titleC = Title::makeTitle( - $result->c_namespace, - $result->c_title, - $result->c_fragment, - $result->c_interwiki + $deep->c_namespace, + $deep->c_title, + $deep->c_fragment, + $deep->c_interwiki ); $linkC = $linkRenderer->makeKnownLink( $titleC, $titleC->getFullText() );