r26142 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r26141‎ | r26142 | r26143 >
Date:05:23, 26 September 2007
Author:amidaniel
Status:old
Tags:
Comment:
(bug 11353) Add ability to retrieve raw section content via 'action=raw' by specifying a 'section' parameter in the URL.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/RawPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/RawPage.php
@@ -15,7 +15,7 @@
1616 */
1717 class RawPage {
1818 var $mArticle, $mTitle, $mRequest;
19 - var $mOldId, $mGen, $mCharset;
 19+ var $mOldId, $mGen, $mCharset, $mSection;
2020 var $mSmaxage, $mMaxage;
2121 var $mContentType, $mExpandTemplates;
2222
@@ -38,7 +38,10 @@
3939 $this->mExpandTemplates = $this->mRequest->getVal( 'templates' ) === 'expand';
4040 $this->mUseMessageCache = $this->mRequest->getBool( 'usemsgcache' );
4141
 42+ $this->mSection = $this->mRequest->getIntOrNull( 'section' );
 43+
4244 $oldid = $this->mRequest->getInt( 'oldid' );
 45+
4346 switch ( $wgRequest->getText( 'direction' ) ) {
4447 case 'next':
4548 # output next revision, or nothing if there isn't one
@@ -177,7 +180,12 @@
178181 if ( $rev ) {
179182 $lastmod = wfTimestamp( TS_RFC2822, $rev->getTimestamp() );
180183 header( "Last-modified: $lastmod" );
181 - $text = $rev->getText();
 184+
 185+ if ( !is_null($this->mSection) && $this->mSection != '' ) {
 186+ global $wgParser;
 187+ return $wgParser->getSection ( $rev->getText(), $this->mSection );
 188+ } else
 189+ $text = $rev->getText();
182190 $found = true;
183191 }
184192 }
Index: trunk/phase3/RELEASE-NOTES
@@ -28,6 +28,7 @@
2929 not set to 'mediawiki', allowing multiple mediawiki instances per user.
3030 * (bug 11151) Add descriptive <title> to revision history page
3131 * (bug 5412) Add feed links for the site to all pages
 32+* (bug 11353) Add ability to retrieve raw section content via action=raw
3233
3334 === Bug fixes in 1.12 ===
3435

Follow-up revisions

RevisionCommit summaryAuthorDate
r26257Merged revisions 26134-26247 via svnmerge from...david19:06, 30 September 2007

Status & tagging log