From 24f0ab9bad24d553d03c04d5e61d7f9cfa94e2aa Mon Sep 17 00:00:00 2001 From: Yaron Koren Date: Thu, 3 May 2018 21:23:47 +0000 Subject: [PATCH] Standardized DB type checking Change-Id: I374c0f9ce0e79181842f53fe9e5778e3fcdc1dcb (cherry picked from commit 43b753b86dbd42e9024e34043feb358ffe6c3ebb) --- src/ReplaceTextSearch.php | 3 +-- src/SpecialReplaceText.php | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/ReplaceTextSearch.php b/src/ReplaceTextSearch.php index c59bdd54..ac18e54e 100644 --- a/src/ReplaceTextSearch.php +++ b/src/ReplaceTextSearch.php @@ -1,7 +1,6 @@ getType() == 'postgres' ) { $op = '~'; } else { $op = 'REGEXP'; diff --git a/src/SpecialReplaceText.php b/src/SpecialReplaceText.php index b502f7df..273872d0 100644 --- a/src/SpecialReplaceText.php +++ b/src/SpecialReplaceText.php @@ -427,7 +427,7 @@ class SpecialReplaceText extends SpecialPage { // SQLite unfortunately lacks a REGEXP function or operator by // default, so disable regex(p) searches for SQLite. $dbr = wfGetDB( DB_REPLICA ); - if ( ! $dbr instanceof Wikimedia\Rdbms\DatabaseSqlite ) { + if ( $dbr->getType() != 'sqlite' ) { $out->addHTML( Xml::tags( 'p', null, Xml::checkLabel( $this->msg( 'replacetext_useregex' )->text(),