From: Ævar Arnfjörð Bjarmason Date: Sun, 9 Oct 2005 06:03:48 +0000 (+0000) Subject: * Added a hook to allow extensions to modify the redirect behaviour X-Git-Tag: 1.6.0~1492 X-Git-Url: http://git.cyclocoop.org/geomaker.php?a=commitdiff_plain;h=21568fd37d9fd6506ee5f24589f7577406aafba9;p=lhc%2Fweb%2Fwiklou.git * Added a hook to allow extensions to modify the redirect behaviour --- diff --git a/includes/Article.php b/includes/Article.php index f4de39eb06..a0a0f8d787 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -760,14 +760,14 @@ class Article { $wgOut->setRobotpolicy( 'noindex,follow' ); } if ( '' != $this->mRedirectedFrom ) { - $sk = $wgUser->getSkin(); - $redir = $sk->makeKnownLink( $this->mRedirectedFrom, '', - 'redirect=no' ); - $s = wfMsg( 'redirectedfrom', $redir ); - $wgOut->setSubtitle( $s ); - - # Can't cache redirects - $pcache = false; + if ( wfRunHooks( 'ArticleViewRedirect', array( &$this ) ) ) { + $sk = $wgUser->getSkin(); + $redir = $sk->makeKnownLink( $this->mRedirectedFrom, '', 'redirect=no' ); + $s = wfMsg( 'redirectedfrom', $redir ); + $wgOut->setSubtitle( $s ); + # Can't cache redirects + $pcache = false; + } } elseif ( !empty( $rdfrom ) ) { global $wgRedirectSources; if( $wgRedirectSources && preg_match( $wgRedirectSources, $rdfrom ) ) {