From 87e5fc82f859623dba2768a50628b55c9f5ad953 Mon Sep 17 00:00:00 2001 From: Daniel Friesen Date: Mon, 5 Sep 2011 08:31:51 +0000 Subject: [PATCH] Followup r96180, I can't believe I did't notice I accidentally killed the hook name. While I'm at it, add missing $variant parameters to every 'Get*URL' hook in Title. --- docs/hooks.txt | 7 +++++-- includes/Title.php | 6 +++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/docs/hooks.txt b/docs/hooks.txt index 44a01b5286..98779501fa 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -898,6 +898,7 @@ $out: OutputPage object $title: Title object of page $url: string value as output (out parameter, can modify) $query: query options passed to Title::getCanonicalURL() +$variant: variant passed to Title::getCanonicalURL() 'GetDefaultSortkey': Override the default sortkey for a page. $title: Title object that we need to get a sortkey for @@ -907,11 +908,13 @@ $title: Title object that we need to get a sortkey for $title: Title object of page $url: string value as output (out parameter, can modify) $query: query options passed to Title::getFullURL() +$variant: variant passed to Title::getFullURL() 'GetInternalURL': modify fully-qualified URLs used for squid cache purging $title: Title object of page $url: string value as output (out parameter, can modify) $query: query options passed to Title::getInternalURL() +$variant: variant passed to Title::getFullURL() 'GetIP': modify the ip of the current user (called only once) &$ip: string holding the ip as determined so far @@ -930,13 +933,13 @@ $linkcolour_ids: array of prefixed DB keys of the pages linked to, $title: Title object of page &$url: string value as output (out parameter, can modify) $query: query options passed to Title::getLocalURL() -$variant: variant options passed to Title::getLocalURL() +$variant: variant passed to Title::getLocalURL() 'GetLocalURL::Internal': modify local URLs to internal pages. $title: Title object of page &$url: string value as output (out parameter, can modify) $query: query options passed to Title::getLocalURL() -$variant: variant options passed to Title::getLocalURL() +$variant: variant passed to Title::getLocalURL() 'GetLocalURL::Article': modify local URLs specifically pointing to article paths without any fancy queries or variants. diff --git a/includes/Title.php b/includes/Title.php index 274bd2556b..8d1119c112 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -860,7 +860,7 @@ class Title { # Finally, add the fragment. $url .= $this->getFragmentForURL(); - wfRunHooks( 'GetFullURL', array( &$this, &$url, $query ) ); + wfRunHooks( 'GetFullURL', array( &$this, &$url, $query, $variant ) ); return $url; } @@ -1028,7 +1028,7 @@ class Title { $server = $wgInternalServer !== false ? $wgInternalServer : $wgServer; } $url = wfExpandUrl( $server . $this->getLocalURL( $query, $variant ), PROTO_HTTP ); - wfRunHooks( 'GetInternalURL', array( &$this, &$url, $query ) ); + wfRunHooks( 'GetInternalURL', array( &$this, &$url, $query, $variant ) ); return $url; } @@ -1046,7 +1046,7 @@ class Title { public function getCanonicalURL( $query = '', $variant = false ) { global $wgCanonicalServer; $url = wfExpandUrl( $this->getLocalURL( $query, $variant ) . $this->getFragmentForURL(), PROTO_CANONICAL ); - wfRunHooks( '', array( &$this, &$url, $query ) ); + wfRunHooks( 'GetCanonicalURL', array( &$this, &$url, $query, $variant ) ); return $url; } -- 2.20.1