diff --git a/tests/WP_SQLite_Translator_Tests.php b/tests/WP_SQLite_Translator_Tests.php index 21118fb..f989972 100644 --- a/tests/WP_SQLite_Translator_Tests.php +++ b/tests/WP_SQLite_Translator_Tests.php @@ -129,15 +129,15 @@ public function testRegexpReplace() { $this->assertQuery( "SELECT * FROM _options WHERE REGEXP_REPLACE(option_name, '(-ignore|-remove)', '') = 'test'" ); $this->assertCount( 2, $this->engine->get_query_results() ); - $this->assertQuery( 'SELECT REGEXP_REPLACE( null, 'a', 'x') as result' ); + $this->assertQuery( "SELECT REGEXP_REPLACE( null, 'a', 'x') as result" ); $results = $this->engine->get_query_results(); $this->assertEquals( null, $results[0]->result ); - $this->assertQuery( 'SELECT REGEXP_REPLACE( 'abc', null, 'x') as result' ); + $this->assertQuery( "SELECT REGEXP_REPLACE( 'abc', null, 'x') as result" ); $results = $this->engine->get_query_results(); $this->assertEquals( null, $results[0]->result ); - $this->assertQuery( 'SELECT REGEXP_REPLACE( 'abc', 'a', null) as result' ); + $this->assertQuery( "SELECT REGEXP_REPLACE( 'abc', 'a', null) as result" ); $results = $this->engine->get_query_results(); $this->assertEquals( null, $results[0]->result ); } diff --git a/wp-includes/sqlite/class-wp-sqlite-pdo-user-defined-functions.php b/wp-includes/sqlite/class-wp-sqlite-pdo-user-defined-functions.php index 9030d81..e8c00a0 100644 --- a/wp-includes/sqlite/class-wp-sqlite-pdo-user-defined-functions.php +++ b/wp-includes/sqlite/class-wp-sqlite-pdo-user-defined-functions.php @@ -518,7 +518,7 @@ public function regexp_replace( $field, $pattern, $replacement ) { * be reasonably safe since PHP does not allow null bytes in * regular expressions anyway. */ - + /* Return null if one of the required parameter is null */ if ( is_null( $field ) || is_null( $pattern ) || is_null( $replacement ) ) { return null;