X-Git-Url: https://git.cyclocoop.org/admin/?a=blobdiff_plain;f=includes%2Fcontent%2FContentHandler.php;h=9fbb72cd1b2ff8b8a4c084238c23c15ced97626a;hb=ecc63fb7fe1134d064772fa71493575235b809ca;hp=48dfc70090c88479f40e64be17514edbbb7c9f71;hpb=835a1c38f00b601fbcc81a2aad8639160ccb1bc1;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/content/ContentHandler.php b/includes/content/ContentHandler.php index 48dfc70090..9fbb72cd1b 100644 --- a/includes/content/ContentHandler.php +++ b/includes/content/ContentHandler.php @@ -280,8 +280,10 @@ abstract class ContentHandler { } if ( !( $handler instanceof ContentHandler ) ) { - throw new MWException( "$classOrCallback from \$wgContentHandlers is not " . - "compatible with ContentHandler" ); + throw new MWException( + var_export( $classOrCallback, true ) . " from \$wgContentHandlers is not " . + "compatible with ContentHandler" + ); } } @@ -1077,7 +1079,8 @@ abstract class ContentHandler { } // Max content length = max comment length - length of the comment (excl. $1) - $text = $content ? $content->getTextForSummary( 255 - ( strlen( $reason ) - 2 ) ) : ''; + $maxLength = CommentStore::COMMENT_CHARACTER_LIMIT - ( strlen( $reason ) - 2 ); + $text = $content ? $content->getTextForSummary( $maxLength ) : ''; // Now replace the '$1' placeholder $reason = str_replace( '$1', $text, $reason ); @@ -1099,7 +1102,7 @@ abstract class ContentHandler { * @param Revision|Content $undoafter Must be from an earlier revision than $undo * @param bool $undoIsLatest Set true if $undo is from the current revision (since 1.32) * - * @return mixed Content on success, false on failure + * @return Content|false Content on success, false on failure */ public function getUndoContent( $current, $undo, $undoafter, $undoIsLatest = false ) { Assert::parameterType( Revision::class . '|' . Content::class, $current, '$current' ); @@ -1257,6 +1260,7 @@ abstract class ContentHandler { * @since 1.28 */ public function getFieldsForSearchIndex( SearchEngine $engine ) { + $fields = []; $fields['category'] = $engine->makeSearchFieldMapping( 'category', SearchIndexField::INDEX_TYPE_TEXT