Revert "Use a fixed regex for StripState"
[lhc/web/wiklou.git] / includes / parser / Parser.php
index bcef8bc..e6478a4 100644 (file)
@@ -112,20 +112,8 @@ class Parser {
        const OT_MSG = 3;
        const OT_PLAIN = 4; # like extractSections() - portions of the original are returned unchanged.
 
-       /**
-        * Prefix for temporary replacement strings generated by the preprocessor
-        * ("strip markers"). Using \x7f at the front gives us a little extra
-        * robustness since it shouldn't match when butted up against
-        * identifier-like string constructs.
-        *
-        * Must not consist of all title characters, or else it will change
-        * the behavior of <nowiki> in a link.
-        */
-       const MARKER_PREFIX = "\x7fUNIQ";
-       /** Suffix for strip markers */
+       # Marker Suffix needs to be accessible staticly.
        const MARKER_SUFFIX = "-QINU\x7f";
-       /** Regex which matches the state ID part of strip markers */
-       const MARKER_STATE_ID_REGEX = '[0-9a-f]{16}';
 
        # Markers used for wrapping the table of contents
        const TOC_START = '<mw:toc>';
@@ -342,9 +330,18 @@ class Parser {
                $this->mLangLinkLanguages = array();
                $this->currentRevisionCache = null;
 
-               $stripId = self::getRandomString();
-               $this->mUniqPrefix = self::MARKER_PREFIX . $stripId;
-               $this->mStripState = new StripState( $stripId );
+               /**
+                * Prefix for temporary replacement strings for the multipass parser.
+                * \x07 should never appear in input as it's disallowed in XML.
+                * Using it at the front also gives us a little extra robustness
+                * since it shouldn't match when butted up against identifier-like
+                * string constructs.
+                *
+                * Must not consist of all title characters, or else it will change
+                * the behavior of <nowiki> in a link.
+                */
+               $this->mUniqPrefix = "\x7fUNIQ" . self::getRandomString();
+               $this->mStripState = new StripState( $this->mUniqPrefix );
 
                # Clear these on every parse, bug 4549
                $this->mTplRedirCache = $this->mTplDomCache = array();
@@ -3158,10 +3155,6 @@ class Parser {
                        case 'numberofedits':
                                $value = $pageLang->formatNum( SiteStats::edits() );
                                break;
-                       case 'numberofviews':
-                               global $wgDisableCounters;
-                               $value = !$wgDisableCounters ? $pageLang->formatNum( SiteStats::views() ) : '';
-                               break;
                        case 'currenttimestamp':
                                $value = wfTimestamp( TS_MW, $ts );
                                break;