Index: branches/conrad/phase3/includes/Defines.php |
— | — | @@ -209,6 +209,8 @@ |
210 | 210 | define( 'OT_WIKI', 2 ); |
211 | 211 | define( 'OT_PREPROCESS', 3 ); |
212 | 212 | define( 'OT_MSG' , 3 ); // b/c alias for OT_PREPROCESS |
| 213 | +define( 'OT_INCLUDES', 4); |
| 214 | +define( 'OT_EXTRACT', 5); |
213 | 215 | |
214 | 216 | # Flags for Parser::setFunctionHook |
215 | 217 | define( 'SFH_NO_HASH', 1 ); |
Index: branches/conrad/phase3/includes/parser/Parser.php |
— | — | @@ -80,12 +80,14 @@ |
81 | 81 | |
82 | 82 | // Allowed values for $this->mOutputType |
83 | 83 | // Parameter to startExternalParse(). |
84 | | - const OT_HTML = 1; |
85 | | - const OT_WIKI = 2; |
86 | | - const OT_PREPROCESS = 3; |
| 84 | + const OT_HTML = 1; // like parse() |
| 85 | + const OT_WIKI = 2; // like preSaveTransform() |
| 86 | + const OT_PREPROCESS = 3; // like preprocess() |
87 | 87 | const OT_MSG = 3; |
88 | | - const OT_INCLUDES = 4; |
89 | 88 | |
| 89 | + const OT_INCLUDES = 4; // like getTransclusionText() - actually a NO-OP all features use the preprocessor flags |
| 90 | + const OT_EXTRACT = 5; // like extractSections() - should behaviour be needed later on, these flags will then work. |
| 91 | + |
90 | 92 | // Marker Suffix needs to be accessible staticly. |
91 | 93 | const MARKER_SUFFIX = "-QINU\x7f"; |
92 | 94 | |
— | — | @@ -4804,11 +4806,10 @@ |
4805 | 4807 | * for "replace", the whole page with the section replaced. |
4806 | 4808 | */ |
4807 | 4809 | private function extractSections( $text, $section, $mode, $newText='' ) { |
4808 | | - global $wgTitle; |
4809 | 4810 | $this->clearState(); |
4810 | | - $this->setTitle( $wgTitle ); // not generally used but removes an ugly failure mode |
| 4811 | + $this->setTitle( new FakeTitle ); |
4811 | 4812 | $this->mOptions = new ParserOptions; |
4812 | | - $this->setOutputType( self::OT_WIKI ); |
| 4813 | + $this->setOutputType( self::OT_EXTRACT ); |
4813 | 4814 | $outText = ''; |
4814 | 4815 | $frame = $this->getPreprocessor()->newFrame(); |
4815 | 4816 | |