Merge "Fix field names and behavior in SlotRecord."
[lhc/web/wiklou.git] / includes / parser / Parser.php
index f6526ac..9458728 100644 (file)
@@ -358,7 +358,7 @@ class Parser {
                $this->mLangLinkLanguages = [];
                $this->currentRevisionCache = null;
 
-               $this->mStripState = new StripState;
+               $this->mStripState = new StripState( $this );
 
                # Clear these on every parse, T6549
                $this->mTplRedirCache = $this->mTplDomCache = [];
@@ -543,6 +543,11 @@ class Parser {
                $this->mOutput->setLimitReportData( 'limitreport-expensivefunctioncount',
                        [ $this->mExpensiveFunctionCount, $this->mOptions->getExpensiveParserFunctionLimit() ]
                );
+
+               foreach ( $this->mStripState->getLimitReport() as list( $key, $value ) ) {
+                       $this->mOutput->setLimitReportData( $key, $value );
+               }
+
                Hooks::run( 'ParserLimitReportPrepare', [ $this, $this->mOutput ] );
 
                $limitReport = "NewPP limit report\n";
@@ -1863,8 +1868,8 @@ class Parser {
 
                        $dtrail = '';
 
-                       # Set linktype for CSS - if URL==text, link is essentially free
-                       $linktype = ( $text === $url ) ? 'free' : 'text';
+                       # Set linktype for CSS
+                       $linktype = 'text';
 
                        # No link text, e.g. [http://domain.tld/some.link]
                        if ( $text == '' ) {
@@ -5993,11 +5998,13 @@ class Parser {
         * unserializeHalfParsedText(). The text can then be safely incorporated into
         * the return value of a parser hook.
         *
+        * @deprecated since 1.31
         * @param string $text
         *
         * @return array
         */
        public function serializeHalfParsedText( $text ) {
+               wfDeprecated( __METHOD__, '1.31' );
                $data = [
                        'text' => $text,
                        'version' => self::HALF_PARSED_VERSION,
@@ -6018,11 +6025,13 @@ class Parser {
         * If the $data array has been stored persistently, the caller should first
         * check whether it is still valid, by calling isValidHalfParsedText().
         *
+        * @deprecated since 1.31
         * @param array $data Serialized data
         * @throws MWException
         * @return string
         */
        public function unserializeHalfParsedText( $data ) {
+               wfDeprecated( __METHOD__, '1.31' );
                if ( !isset( $data['version'] ) || $data['version'] != self::HALF_PARSED_VERSION ) {
                        throw new MWException( __METHOD__ . ': invalid version' );
                }
@@ -6043,11 +6052,13 @@ class Parser {
         * serializeHalfParsedText(), is compatible with the current version of the
         * parser.
         *
+        * @deprecated since 1.31
         * @param array $data
         *
         * @return bool
         */
        public function isValidHalfParsedText( $data ) {
+               wfDeprecated( __METHOD__, '1.31' );
                return isset( $data['version'] ) && $data['version'] == self::HALF_PARSED_VERSION;
        }