* Add 'GetInternalURL' hook to match the GetFullURL and GetLocalURL ones

This commit is contained in:
Brion Vibber 2005-12-26 07:14:42 +00:00
parent 5cc74d6426
commit 2ec5f7958b
5 changed files with 23 additions and 5 deletions

View 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 ===

View 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

View 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 = "" ;

View 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 ) {

View 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;
}
/**