mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/ReplaceText
synced 2024-12-23 03:23:23 +00:00
Disable regex option for SQLite
Change-Id: I83c8b38a47fc571077fef1fccabb31f5db0ac2e5
(cherry picked from commit d7db166e4f
)
This commit is contained in:
parent
94058ed6f2
commit
42748d0d6d
|
@ -423,17 +423,23 @@ class SpecialReplaceText extends SpecialPage {
|
||||||
Xml::textarea( 'replacement', $this->replacement, 100, 5, [ 'style' => 'width: auto;' ] )
|
Xml::textarea( 'replacement', $this->replacement, 100, 5, [ 'style' => 'width: auto;' ] )
|
||||||
);
|
);
|
||||||
$out->addHTML( '</td></tr></table>' );
|
$out->addHTML( '</td></tr></table>' );
|
||||||
$out->addHTML( Xml::tags( 'p', null,
|
|
||||||
Xml::checkLabel(
|
// SQLite unfortunately lacks a REGEXP function or operator by
|
||||||
$this->msg( 'replacetext_useregex' )->text(),
|
// default, so disable regex(p) searches for SQLite.
|
||||||
'use_regex', 'use_regex'
|
$dbr = wfGetDB( DB_REPLICA );
|
||||||
|
if ( ! $dbr instanceof Wikimedia\Rdbms\DatabaseSqlite ) {
|
||||||
|
$out->addHTML( Xml::tags( 'p', null,
|
||||||
|
Xml::checkLabel(
|
||||||
|
$this->msg( 'replacetext_useregex' )->text(),
|
||||||
|
'use_regex', 'use_regex'
|
||||||
|
)
|
||||||
|
) . "\n" .
|
||||||
|
Xml::element( 'p',
|
||||||
|
[ 'style' => 'font-style: italic' ],
|
||||||
|
$this->msg( 'replacetext_regexdocu' )->text()
|
||||||
)
|
)
|
||||||
) . "\n" .
|
);
|
||||||
Xml::element( 'p',
|
}
|
||||||
[ 'style' => 'font-style: italic' ],
|
|
||||||
$this->msg( 'replacetext_regexdocu' )->text()
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
// The interface is heavily based on the one in Special:Search.
|
// The interface is heavily based on the one in Special:Search.
|
||||||
$namespaces = SearchEngine::searchableNamespaces();
|
$namespaces = SearchEngine::searchableNamespaces();
|
||||||
|
|
Loading…
Reference in a new issue