(bug 41146) DatabaseOracle no more rely on mbstring

DatabaseOracle class has been using mb_check_encoding which might not
always be available.  We now rely on the StringUtils::isUtf8() method
implemented by I4cf4dfe2.

Change-Id: I5a9ffa23e3e738e4886d61e85974b0af25058308
This commit is contained in:
lupo 2012-11-16 13:52:55 +01:00 committed by Gerrit Code Review
parent 750db30d9b
commit 2071bf880e

View file

@ -318,7 +318,7 @@ class DatabaseOracle extends DatabaseBase {
protected function doQuery( $sql ) {
wfDebug( "SQL: [$sql]\n" );
if ( !mb_check_encoding( $sql ) ) {
if ( !StringUtils::isUtf8( $sql ) ) {
throw new MWException( "SQL encoding is invalid\n$sql" );
}
@ -1116,7 +1116,7 @@ class DatabaseOracle extends DatabaseBase {
if ( $col_type == 'CLOB' ) {
$col = 'TO_CHAR(' . $col . ')';
$val = $wgContLang->checkTitleEncoding( $val );
} elseif ( $col_type == 'VARCHAR2' && !mb_check_encoding( $val ) ) {
} elseif ( $col_type == 'VARCHAR2' ) {
$val = $wgContLang->checkTitleEncoding( $val );
}
}