revert gerrit change 29597 for TextContent constructor
authoraude <aude.wiki@gmail.com>
Wed, 24 Oct 2012 15:35:02 +0000 (15:35 +0000)
committeraude <aude.wiki@gmail.com>
Wed, 24 Oct 2012 21:30:14 +0000 (21:30 +0000)
https://gerrit.wikimedia.org/r/#/c/29597/

use cases that pass non-strings to TextContent need to be handled differently
and handle the exceptions

Change-Id: Id3f88b0fb867fff0d16abcf570178cbbe86e89a1

includes/content/TextContent.php

index 048ac39..74c5a88 100644 (file)
@@ -32,10 +32,6 @@ class TextContent extends AbstractContent {
        public function __construct( $text, $model_id = CONTENT_MODEL_TEXT ) {
                parent::__construct( $model_id );
 
-               if ( $text === null || $text === false ) {
-                       $text = '';
-               }
-
                if ( !is_string( $text ) ) {
                        throw new MWException( "TextContent expects a string in the constructor." );
                }