From: Jakub Vrana Date: Sat, 1 Dec 2018 08:55:29 +0000 (+0100) Subject: Fix regular expression X-Git-Tag: 1.34.0-rc.0~3219^2 X-Git-Url: http://git.cyclocoop.org//%22javascript:ModifierStyle%28%27%22.%24id.%22%27%29/%22?a=commitdiff_plain;h=48d894aefb06b09a963901ab527ee186f5111ef4;p=lhc%2Fweb%2Fwiklou.git Fix regular expression Found by PHPStan. Change-Id: I95813b0db9a3d6ca8c3894e5ccba00a9dc84b336 --- diff --git a/includes/libs/rdbms/field/SQLiteField.php b/includes/libs/rdbms/field/SQLiteField.php index 39f8f01182..fdf96fe8c9 100644 --- a/includes/libs/rdbms/field/SQLiteField.php +++ b/includes/libs/rdbms/field/SQLiteField.php @@ -21,8 +21,8 @@ class SQLiteField implements Field { function defaultValue() { if ( is_string( $this->info->dflt_value ) ) { // Typically quoted - if ( preg_match( '/^\'(.*)\'$', $this->info->dflt_value ) ) { - return str_replace( "''", "'", $this->info->dflt_value ); + if ( preg_match( '/^\'(.*)\'$/', $this->info->dflt_value, $matches ) ) { + return str_replace( "''", "'", $matches[1] ); } }