ParserOptions: Include wrapping class in options hash
authorBrad Jorsch <bjorsch@wikimedia.org>
Fri, 12 May 2017 16:28:22 +0000 (12:28 -0400)
committerTim Starling <tstarling@wikimedia.org>
Mon, 15 May 2017 05:55:51 +0000 (05:55 +0000)
Avoids polluting the cache when things take advantage of the option.

Bug: T165115
Bug: T165161
Change-Id: I5be25c6de68012df58b6a0cbf92e2f972be2b68a

includes/parser/ParserOptions.php

index d4d1042..d097414 100644 (file)
@@ -493,6 +493,7 @@ class ParserOptions {
         * @return string|bool
         */
        public function getWrapOutputClass() {
+               $this->optionUsed( 'wrapclass' );
                return $this->wrapOutputClass;
        }
 
@@ -943,6 +944,10 @@ class ParserOptions {
                        $confstr .= '!printable=1';
                }
 
+               if ( $this->wrapOutputClass !== 'mw-parser-output' && in_array( 'wrapclass', $forOptions ) ) {
+                       $confstr .= '!wrapclass=' . $this->wrapOutputClass;
+               }
+
                if ( $this->mExtraKey != '' ) {
                        $confstr .= $this->mExtraKey;
                }