Index: trunk/phase3/includes/parser/Tidy.php |
— | — | @@ -26,9 +26,11 @@ |
27 | 27 | |
28 | 28 | public function getWrapped( $text ) { |
29 | 29 | $this->mTokens = new ReplacementArray; |
30 | | - $this->mUniqPrefix = "\x7fUNIQ" . dechex( mt_rand( 0, 0x7fffffff ) ) . dechex( mt_rand( 0, 0x7fffffff ) ); |
| 30 | + $this->mUniqPrefix = "\x7fUNIQ" . |
| 31 | + dechex( mt_rand( 0, 0x7fffffff ) ) . dechex( mt_rand( 0, 0x7fffffff ) ); |
31 | 32 | $this->mMarkerIndex = 0; |
32 | | - $wrappedtext = preg_replace_callback( '#<(?:mw:)?editsection page="(.*?)" section="(.*?)"(?:/>|>(.*?)(</(?:mw:)?editsection>))#', array( &$this, 'replaceEditSectionLinksCallback' ), $text ); |
| 33 | + $wrappedtext = preg_replace_callback( ParserOutput::EDITSECTION_REGEX, |
| 34 | + array( &$this, 'replaceEditSectionLinksCallback' ), $text ); |
33 | 35 | |
34 | 36 | $wrappedtext = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"'. |
35 | 37 | ' "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html>'. |
Index: trunk/phase3/includes/parser/ParserOutput.php |
— | — | @@ -125,6 +125,8 @@ |
126 | 126 | private $mIndexPolicy = ''; # 'index' or 'noindex'? Any other value will result in no change. |
127 | 127 | private $mAccessedOptions = null; # List of ParserOptions (stored in the keys) |
128 | 128 | |
| 129 | + const EDITSECTION_REGEX = '#<(?:mw:)?editsection page="(.*?)" section="(.*?)"(?:/>|>(.*?)(</(?:mw:)?editsection>))#'; |
| 130 | + |
129 | 131 | function __construct( $text = '', $languageLinks = array(), $categoryLinks = array(), |
130 | 132 | $containsOldMagic = false, $titletext = '' ) |
131 | 133 | { |
— | — | @@ -137,7 +139,8 @@ |
138 | 140 | |
139 | 141 | function getText() { |
140 | 142 | if ( $this->mEditSectionTokens ) { |
141 | | - return preg_replace_callback( '#<(?:mw:)?editsection page="(.*?)" section="(.*?)"(?:/>|>(.*?)(</(?:mw:)?editsection>))#', array( &$this, 'replaceEditSectionLinksCallback' ), $this->mText ); |
| 143 | + return preg_replace_callback( ParserOutput::EDITSECTION_REGEX, |
| 144 | + array( &$this, 'replaceEditSectionLinksCallback' ), $this->mText ); |
142 | 145 | } |
143 | 146 | return $this->mText; |
144 | 147 | } |