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
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." );
}