X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fcontent%2FTextContentHandler.php;h=e3dc187ffe6831199680c1a01e811faa596d8d9d;hb=1bd43b1bffffc3720e1ef743d802e88fdf849b0f;hp=09cdcee143813fb6e648a790fbac9a7a2eb36844;hpb=a303296f2730d6279a249bde77f3e0b9b42e494f;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/content/TextContentHandler.php b/includes/content/TextContentHandler.php index 09cdcee143..e3dc187ffe 100644 --- a/includes/content/TextContentHandler.php +++ b/includes/content/TextContentHandler.php @@ -30,24 +30,22 @@ */ class TextContentHandler extends ContentHandler { - // @codingStandardsIgnoreStart bug 57585 public function __construct( $modelId = CONTENT_MODEL_TEXT, $formats = [ CONTENT_FORMAT_TEXT ] ) { parent::__construct( $modelId, $formats ); } - // @codingStandardsIgnoreEnd /** * Returns the content's text as-is. * * @param Content $content - * @param string $format The serialization format to check + * @param string|null $format The serialization format to check * * @return mixed */ public function serializeContent( Content $content, $format = null ) { $this->checkFormat( $format ); - return $content->getNativeData(); + return $content->getText(); } /** @@ -110,7 +108,7 @@ class TextContentHandler extends ContentHandler { * @since 1.21 * * @param string $text Serialized form of the content - * @param string $format The format used for serialization + * @param string|null $format The format used for serialization * * @return Content The TextContent object wrapping $text */ @@ -150,8 +148,11 @@ class TextContentHandler extends ContentHandler { return $fields; } - public function getDataForSearchIndex( WikiPage $page, ParserOutput $output, - SearchEngine $engine ) { + public function getDataForSearchIndex( + WikiPage $page, + ParserOutput $output, + SearchEngine $engine + ) { $fields = parent::getDataForSearchIndex( $page, $output, $engine ); $fields['language'] = $this->getPageLanguage( $page->getTitle(), $page->getContent() )->getCode();