* (bug 8567) Added hook RawPageViewBeforeOutput just before the text is blown out...
authorLeon Weber <leon@users.mediawiki.org>
Thu, 11 Jan 2007 14:50:34 +0000 (14:50 +0000)
committerLeon Weber <leon@users.mediawiki.org>
Thu, 11 Jan 2007 14:50:34 +0000 (14:50 +0000)
             so extensions might influence the output.

RELEASE-NOTES
docs/hooks.txt
includes/RawPage.php

index 5d0e00d..54e9069 100644 (file)
@@ -47,6 +47,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   now be customized via the $wgNamespaceProtection array.  By default,
   editing pages in the MediaWiki namespace requires "editinterface"
   permissions, just as before.
+* (bug 8567) Added hook RawPageViewBeforeOutput just before the text is blown out in action=raw,
+             so extensions might influence the output.
 
 == Languages updated ==
 
index fdae500..c2356a6 100644 (file)
@@ -427,6 +427,10 @@ the built-in rate limiting checks are used, if enabled.
 $form : PreferencesForm object
 &$html : HTML to append to
 
+'RawPageViewBeforeOutput': Right before the text is blown out in action=raw
+&$obj: RawPage object
+&$text: The text that's going to be the output
+
 'SiteNoticeBefore': Before the sitenotice/anonnotice is composed
 &$siteNotice: HTML returned as the sitenotice
 Return true to allow the normal method of notice selection/rendering to work,
index a0b7688..b2c8c94 100644 (file)
@@ -137,7 +137,13 @@ class RawPage {
                # allow the client to cache this for 24 hours
                $mode = $this->mPrivateCache ? 'private' : 'public';
                header( 'Cache-Control: '.$mode.', s-maxage='.$this->mSmaxage.', max-age='.$this->mMaxage );
-               echo $this->getRawText();
+               $text = $this->getRawText();
+
+               if( !wfRunHooks( 'RawPageViewBeforeOutput', array( &$this, &$text ) ) ) {
+                       wfDebug( __METHOD__ . ': RawPageViewBeforeOutput hook broke raw page output.' );
+               }
+
+               echo $text;
                $wgOut->disable();
        }