Merge "Use a more standard "Forgot your password?" in userlogin-resetpassword-link"
[lhc/web/wiklou.git] / includes / parser / Parser.php
index 5e86209..848a1a0 100644 (file)
@@ -115,6 +115,10 @@ class Parser {
        # Marker Suffix needs to be accessible staticly.
        const MARKER_SUFFIX = "-QINU\x7f";
 
+       # Markers used for wrapping the table of contents
+       const TOC_START = '<mw:toc>';
+       const TOC_END = '</mw:toc>';
+
        # Persistent:
        var $mTagHooks = array();
        var $mTransparentTagHooks = array();
@@ -1859,7 +1863,9 @@ class Parser {
                if ( $useLinkPrefixExtension ) {
                        # Match the end of a line for a word that's not followed by whitespace,
                        # e.g. in the case of 'The Arab al[[Razi]]', 'al' will be matched
-                       $e2 = wfMessage( 'linkprefix' )->inContentLanguage()->text();
+                       global $wgContLang;
+                       $charset = $wgContLang->linkPrefixCharset();
+                       $e2 = "/^((?>.*[^$charset]|))(.+)$/sDu";
                }
 
                if ( is_null( $this->mTitle ) ) {
@@ -2462,7 +2468,7 @@ class Parser {
                                $openmatch = preg_match( '/(?:<table|<h1|<h2|<h3|<h4|<h5|<h6|<pre|<tr|<p|<ul|<ol|<dl|<li|<\\/tr|<\\/td|<\\/th)/iS', $t );
                                $closematch = preg_match(
                                        '/(?:<\\/table|<\\/h1|<\\/h2|<\\/h3|<\\/h4|<\\/h5|<\\/h6|' .
-                                       '<td|<th|<\\/?blockquote|<\\/?div|<hr|<\\/pre|<\\/p|' . $this->mUniqPrefix . '-pre|<\\/li|<\\/ul|<\\/ol|<\\/dl|<\\/?center)/iS', $t );
+                                       '<td|<th|<\\/?blockquote|<\\/?div|<hr|<\\/pre|<\\/p|<\\/mw:|' . $this->mUniqPrefix . '-pre|<\\/li|<\\/ul|<\\/ol|<\\/dl|<\\/?center)/iS', $t );
                                if ( $openmatch or $closematch ) {
                                        $paragraphStack = false;
                                        # TODO bug 5718: paragraph closed
@@ -4516,6 +4522,7 @@ class Parser {
                        }
                        $toc = Linker::tocList( $toc, $this->mOptions->getUserLangObj() );
                        $this->mOutput->setTOCHTML( $toc );
+                       $toc = self::TOC_START . $toc . self::TOC_END;
                }
 
                if ( $isMain ) {
@@ -5755,8 +5762,9 @@ class Parser {
         * Get the revision object for $this->mRevisionId
         *
         * @return Revision|null either a Revision object or null
+        * @since 1.23 (public since 1.23)
         */
-       protected function getRevisionObject() {
+       public function getRevisionObject() {
                if ( !is_null( $this->mRevisionObject ) ) {
                        return $this->mRevisionObject;
                }