mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/ReplaceText
synced 2024-11-23 22:33:48 +00:00
Remove support for MediaWiki 1.30
The extension already requires MediaWiki >= 1.32 in extension.json. Change-Id: I80f624057609e6e2bbe6ac44ece4d4085a12c3d4
This commit is contained in:
parent
438c0eb69c
commit
97aa6a9efe
|
@ -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 ) );
|
||||
|
|
Loading…
Reference in a new issue