Remove Wikimedia-specific hack in ParserOutput
authorMatmaRex <matma.rex@gmail.com>
Fri, 26 Apr 2013 21:42:31 +0000 (23:42 +0200)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 7 Jun 2013 09:51:11 +0000 (09:51 +0000)
Cleanup after I6a6c12a9. To be merged after appropriate caches are purged.

Change-Id: I849c4bd1fe59e582f9f16789e8b511719e2a5d06

includes/parser/ParserOutput.php

index 29b3500..c5e42a4 100644 (file)
@@ -67,22 +67,8 @@ class ParserOutput extends CacheTime {
 
        function getText() {
                if ( $this->mEditSectionTokens ) {
-                       $text = $this->mText;
-
-                       // If there's old output with misplaced editsections links cached, mangle it to put them in
-                       // the right position. We can assume that there is no '</hN>' inside header tags, making this
-                       // possible to do with a regex.
-                       $text = preg_replace(
-                               //            [ this part is like EDITSECTION_REGEX, but with non-capturing groups                           ]
-                               //                                                                                  note the space here ------v
-                               '#(<[hH](\d)>)(<(?:mw:)?editsection page="(?:.*?)" section="(?:.*?)"(?:/>|>(?:.*?)(?:</(?:mw:)?editsection>))) ([\s\S]*?)(</[hH]\2>)#',
-                               // swap the order of content and editsection link - $2 is ignored since it's the number in hN's tag name
-                               '$1$4 $3$5',
-                               $text
-                       );
-
                        return preg_replace_callback( ParserOutput::EDITSECTION_REGEX,
-                               array( &$this, 'replaceEditSectionLinksCallback' ), $text );
+                               array( &$this, 'replaceEditSectionLinksCallback' ), $this->mText );
                }
                return preg_replace( ParserOutput::EDITSECTION_REGEX, '', $this->mText );
        }