From 21568fd37d9fd6506ee5f24589f7577406aafba9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Sun, 9 Oct 2005 06:03:48 +0000 Subject: [PATCH] * Added a hook to allow extensions to modify the redirect behaviour --- includes/Article.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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 ) ) { -- 2.20.1