Remove support for MediaWiki 1.30

The extension already requires MediaWiki >= 1.32 in extension.json.

Change-Id: I80f624057609e6e2bbe6ac44ece4d4085a12c3d4
This commit is contained in:
Fomafix 2021-07-03 09:08:21 +00:00
parent 438c0eb69c
commit 97aa6a9efe

View file

@ -749,21 +749,9 @@ class SpecialReplaceText extends SpecialPage {
list( $index, $len, ) = $_;
$contextBefore = substr( $text, 0, $index );
$contextAfter = substr( $text, $index + $len );
if ( !is_callable( [ $wgLang, 'truncateForDatabase' ] ) ) {
// Backwards compatibility code; remove once MW 1.30 is
// no longer supported.
$contextBefore =
// @phan-suppress-next-line PhanUndeclaredMethod
$wgLang->truncate( $contextBefore, -$cw, '...', false );
$contextAfter =
// @phan-suppress-next-line PhanUndeclaredMethod
$wgLang->truncate( $contextAfter, $cw, '...', false );
} else {
$contextBefore =
$wgLang->truncateForDatabase( $contextBefore, -$cw, '...', false );
$contextAfter =
$wgLang->truncateForDatabase( $contextAfter, $cw, '...', false );
}
$contextBefore = $wgLang->truncateForDatabase( $contextBefore, -$cw, '...', false );
$contextAfter = $wgLang->truncateForDatabase( $contextAfter, $cw, '...', false );
$context .= $this->convertWhiteSpaceToHTML( $contextBefore );
$snippet = $this->convertWhiteSpaceToHTML( substr( $text, $index, $len ) );