X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=blobdiff_plain;f=includes%2Fcontent%2FContentHandler.php;h=100fa834dc40110bb7db8ded2a0972610552ed6a;hb=7f7efbe026b01be36019c26571224a6e8a178677;hp=b62737d5bb8246de3b0d232f2e29dc3b2292070f;hpb=35aa8d9405f038ab6644f5f90d4626490b303880;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/content/ContentHandler.php b/includes/content/ContentHandler.php index b62737d5bb..100fa834dc 100644 --- a/includes/content/ContentHandler.php +++ b/includes/content/ContentHandler.php @@ -26,6 +26,7 @@ * @author Daniel Kinzler */ +use MediaWiki\Storage\RevisionRecord; use Wikimedia\Assert\Assert; use MediaWiki\Logger\LoggerFactory; use MediaWiki\MediaWikiServices; @@ -279,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" + ); } } @@ -646,9 +649,6 @@ abstract class ContentHandler { $slotDiffRenderer->setStatsdDataFactory( $statsdDataFactory ); // XXX using the page language would be better, but it's unclear how that should be injected $slotDiffRenderer->setLanguage( $contentLanguage ); - $slotDiffRenderer->setWikiDiff2MovedParagraphDetectionCutoff( - $context->getConfig()->get( 'WikiDiff2MovedParagraphDetectionCutoff' ) - ); $engine = DifferenceEngine::getEngine(); if ( $engine === false ) { @@ -1028,7 +1028,7 @@ abstract class ContentHandler { [ 'rev_user_text' => $revQuery['fields']['rev_user_text'] ], [ 'rev_page' => $title->getArticleID(), - $dbr->bitAnd( 'rev_deleted', Revision::DELETED_USER ) . ' = 0' + $dbr->bitAnd( 'rev_deleted', RevisionRecord::DELETED_USER ) . ' = 0' ], __METHOD__, [ 'LIMIT' => 20 ], @@ -1079,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 );