* Add 'GetInternalURL' hook to match the GetFullURL and GetLocalURL ones
authorBrion Vibber <brion@users.mediawiki.org>
Mon, 26 Dec 2005 07:14:42 +0000 (07:14 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Mon, 26 Dec 2005 07:14:42 +0000 (07:14 +0000)
RELEASE-NOTES
docs/hooks.txt
includes/EditPage.php
includes/ImagePage.php
includes/Title.php

index 4b53622..d323676 100644 (file)
@@ -358,6 +358,7 @@ fully support the editing toolbar, but was found to be too confusing.
   list via Special:Undelete. Default is off, replicating the 1.5 behavior,
   but it can be turned back on for random users to replicate the previous
   1.6 dev behavior.
+* Add 'GetInternalURL' hook to match the GetFullURL and GetLocalURL ones
 
 
 === Caveats ===
index 85c479c..028d8fa 100644 (file)
@@ -308,6 +308,21 @@ $from: address of sending user
 $subject: subject of the mail
 $text: text of the mail
 
+'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()
+
+'GetLocalURL': modify local URLs as output into page links
+$title: Title object of page
+$url: string value as output (out parameter, can modify)
+$query: query options passed to Title::getLocalURL()
+
+'GetFullURL': modify fully-qualified URLs used in redirects/export/offsite data
+$title: Title object of page
+$url: string value as output (out parameter, can modify)
+$query: query options passed to Title::getFullURL()
+
 'LogPageValidTypes': action being logged.
 $type: array of strings
 
index 570641c..54f1366 100644 (file)
@@ -840,7 +840,7 @@ class EditPage {
                        $metadata = $this->mMetaData ;
                        $metadata = htmlspecialchars( $wgContLang->recodeForEdit( $metadata ) ) ;
                        $helppage = Title::newFromText( wfMsg( "metadata_page" ) ) ;
-                       $top = wfMsg( 'metadata', $helppage->getInternalURL() );
+                       $top = wfMsg( 'metadata', $helppage->getLocalURL() );
                        $metadata = $top . "<textarea name='metadata' rows='3' cols='{$cols}'{$ew}>{$metadata}</textarea>" ;
                }
                else $metadata = "" ;
index 5d4274d..d5b4cb0 100644 (file)
@@ -494,9 +494,9 @@ END
 
                        # Squid purging
                        if ( $wgUseSquid ) {
-                               $urlArr = Array(
+                               $urlArr = array(
                                        $wgInternalServer.wfImageArchiveUrl( $oldimage ),
-                                       $wgInternalServer.$this->mTitle->getFullURL()
+                                       $this->mTitle->getInternalURL()
                                );
                                wfPurgeSquidServers($urlArr);
                        }
@@ -589,7 +589,7 @@ END
        }
 
        function revert() {
-               global $wgOut, $wgRequest, $wgUser, $wgUseSquid, $wgInternalServer;
+               global $wgOut, $wgRequest, $wgUser;
 
                $oldimage = $wgRequest->getText( 'oldimage' );
                if ( strlen( $oldimage ) < 16 ) {
index ed8e7f6..e93805c 100644 (file)
@@ -769,7 +769,9 @@ class Title {
         */
        function getInternalURL( $query = '' ) {
                global $wgInternalServer;
-               return $wgInternalServer . $this->getLocalURL( $query );
+               $url = $wgInternalServer . $this->getLocalURL( $query );
+               wfRunHooks( 'GetInternalURL', array( &$this, &$url, $query ) );
+               return $url;
        }
 
        /**