X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FTitle.php;h=829be448b2e94a9907a95bc0f1fdd165f8cb42f8;hb=b72c4df18b00b3948f0319fa5b01f969e1b92dbd;hp=8cfeb882a0f67e181dfc890a45d30ec772f8559d;hpb=fdf83070cdddd7650891e2dd8d4648849874517f;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Title.php b/includes/Title.php index 8cfeb882a0..829be448b2 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -776,6 +776,7 @@ class Title implements LinkTarget { * @return string Escaped string */ static function escapeFragmentForURL( $fragment ) { + wfDeprecated( __METHOD__, '1.30' ); # Note that we don't urlencode the fragment. urlencoded Unicode # fragments appear not to work in IE (at least up to 7) or in at least # one version of Opera 9.x. The W3C validator, for one, doesn't seem @@ -1797,7 +1798,7 @@ class Title implements LinkTarget { * @see self::getLocalURL for the arguments. * @param array|string $query * @param string $proto Protocol type to use in URL - * @return String. A url suitable to use in an HTTP location header. + * @return string A url suitable to use in an HTTP location header. */ public function getFullUrlForRedirect( $query = '', $proto = PROTO_CURRENT ) { $target = $this; @@ -1975,6 +1976,8 @@ class Title implements LinkTarget { * NOTE: Unlike getInternalURL(), the canonical URL includes the fragment * * @see self::getLocalURL for the arguments. + * @param string $query + * @param string|bool $query2 * @return string The URL * @since 1.18 */ @@ -3625,19 +3628,20 @@ class Title implements LinkTarget { $blNamespace = "{$prefix}_namespace"; $blTitle = "{$prefix}_title"; + $pageQuery = WikiPage::getQueryInfo(); $res = $db->select( - [ $table, 'page' ], + [ $table, 'nestpage' => $pageQuery['tables'] ], array_merge( [ $blNamespace, $blTitle ], - WikiPage::selectFields() + $pageQuery['fields'] ), [ "{$prefix}_from" => $id ], __METHOD__, $options, - [ 'page' => [ + [ 'nestpage' => [ 'LEFT JOIN', [ "page_namespace=$blNamespace", "page_title=$blTitle" ] - ] ] + ] ] + $pageQuery['joins'] ); $retVal = []; @@ -4190,13 +4194,15 @@ class Title implements LinkTarget { $pageId = $this->getArticleID( $flags ); if ( $pageId ) { $db = ( $flags & self::GAID_FOR_UPDATE ) ? wfGetDB( DB_MASTER ) : wfGetDB( DB_REPLICA ); - $row = $db->selectRow( 'revision', Revision::selectFields(), + $revQuery = Revision::getQueryInfo(); + $row = $db->selectRow( $revQuery['tables'], $revQuery['fields'], [ 'rev_page' => $pageId ], __METHOD__, [ 'ORDER BY' => 'rev_timestamp ASC, rev_id ASC', - 'IGNORE INDEX' => 'rev_timestamp', // See T159319 - ] + 'IGNORE INDEX' => [ 'revision' => 'rev_timestamp' ], // See T159319 + ], + $revQuery['joins'] ); if ( $row ) { return new Revision( $row ); @@ -4616,9 +4622,11 @@ class Title implements LinkTarget { * on the number of links. Typically called on create and delete. */ public function touchLinks() { - DeferredUpdates::addUpdate( new HTMLCacheUpdate( $this, 'pagelinks' ) ); + DeferredUpdates::addUpdate( new HTMLCacheUpdate( $this, 'pagelinks', 'page-touch' ) ); if ( $this->getNamespace() == NS_CATEGORY ) { - DeferredUpdates::addUpdate( new HTMLCacheUpdate( $this, 'categorylinks' ) ); + DeferredUpdates::addUpdate( + new HTMLCacheUpdate( $this, 'categorylinks', 'category-touch' ) + ); } }