r96273 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96272‎ | r96273 | r96274 >
Date:08:31, 5 September 2011
Author:dantman
Status:ok
Tags:
Comment:
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.
Modified paths:
  • /trunk/phase3/docs/hooks.txt (modified) (history)
  • /trunk/phase3/includes/Title.php (modified) (history)

Diff [purge]

Index: trunk/phase3/docs/hooks.txt
@@ -898,6 +898,7 @@
899899 $title: Title object of page
900900 $url: string value as output (out parameter, can modify)
901901 $query: query options passed to Title::getCanonicalURL()
 902+$variant: variant passed to Title::getCanonicalURL()
902903
903904 'GetDefaultSortkey': Override the default sortkey for a page.
904905 $title: Title object that we need to get a sortkey for
@@ -907,11 +908,13 @@
908909 $title: Title object of page
909910 $url: string value as output (out parameter, can modify)
910911 $query: query options passed to Title::getFullURL()
 912+$variant: variant passed to Title::getFullURL()
911913
912914 'GetInternalURL': modify fully-qualified URLs used for squid cache purging
913915 $title: Title object of page
914916 $url: string value as output (out parameter, can modify)
915917 $query: query options passed to Title::getInternalURL()
 918+$variant: variant passed to Title::getFullURL()
916919
917920 'GetIP': modify the ip of the current user (called only once)
918921 &$ip: string holding the ip as determined so far
@@ -930,13 +933,13 @@
931934 $title: Title object of page
932935 &$url: string value as output (out parameter, can modify)
933936 $query: query options passed to Title::getLocalURL()
934 -$variant: variant options passed to Title::getLocalURL()
 937+$variant: variant passed to Title::getLocalURL()
935938
936939 'GetLocalURL::Internal': modify local URLs to internal pages.
937940 $title: Title object of page
938941 &$url: string value as output (out parameter, can modify)
939942 $query: query options passed to Title::getLocalURL()
940 -$variant: variant options passed to Title::getLocalURL()
 943+$variant: variant passed to Title::getLocalURL()
941944
942945 'GetLocalURL::Article': modify local URLs specifically pointing to article paths
943946 without any fancy queries or variants.
Index: trunk/phase3/includes/Title.php
@@ -860,7 +860,7 @@
861861 # Finally, add the fragment.
862862 $url .= $this->getFragmentForURL();
863863
864 - wfRunHooks( 'GetFullURL', array( &$this, &$url, $query ) );
 864+ wfRunHooks( 'GetFullURL', array( &$this, &$url, $query, $variant ) );
865865 return $url;
866866 }
867867
@@ -1028,7 +1028,7 @@
10291029 $server = $wgInternalServer !== false ? $wgInternalServer : $wgServer;
10301030 }
10311031 $url = wfExpandUrl( $server . $this->getLocalURL( $query, $variant ), PROTO_HTTP );
1032 - wfRunHooks( 'GetInternalURL', array( &$this, &$url, $query ) );
 1032+ wfRunHooks( 'GetInternalURL', array( &$this, &$url, $query, $variant ) );
10331033 return $url;
10341034 }
10351035
@@ -1046,7 +1046,7 @@
10471047 public function getCanonicalURL( $query = '', $variant = false ) {
10481048 global $wgCanonicalServer;
10491049 $url = wfExpandUrl( $this->getLocalURL( $query, $variant ) . $this->getFragmentForURL(), PROTO_CANONICAL );
1050 - wfRunHooks( '', array( &$this, &$url, $query ) );
 1050+ wfRunHooks( 'GetCanonicalURL', array( &$this, &$url, $query, $variant ) );
10511051 return $url;
10521052 }
10531053

Follow-up revisions

RevisionCommit summaryAuthorDate
r963601.17wmf1: MFT r96180, r96228, r96273, r96286catrope19:11, 6 September 2011
r965111.18: MFT r96163, r96174, r96212, r96217, r96218, r96271, r96273, r96306, r96...catrope22:07, 7 September 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r96180Use wfExpandUrl+PROTO_CANONICAL inside of getCanonicalURL instead of just pre...dantman13:17, 3 September 2011

Status & tagging log