Merge "Implement OOUI version of tag filter in ChangeTags"
[lhc/web/wiklou.git] / includes / content / TextContent.php
index d292880..baea812 100644 (file)
@@ -37,6 +37,7 @@ class TextContent extends AbstractContent {
        /**
         * @param string $text
         * @param string $model_id
+        * @throws MWException
         */
        public function __construct( $text, $model_id = CONTENT_MODEL_TEXT ) {
                parent::__construct( $model_id );
@@ -160,7 +161,7 @@ class TextContent extends AbstractContent {
                $text = $this->getNativeData();
                $pst = rtrim( $text );
 
-               return ( $text === $pst ) ? $this : new static( $pst );
+               return ( $text === $pst ) ? $this : new static( $pst, $this->getModel() );
        }
 
        /**