mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
Coding Standards: Fix all WordPress.DB.PreparedSQLPlaceholders issues.
See #47632. git-svn-id: https://develop.svn.wordpress.org/trunk@45603 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1612,6 +1612,7 @@ class Tests_DB extends WP_UnitTestCase {
|
||||
|
||||
$part = $wpdb->prepare( ' AND meta_value = %s', ' %s ' );
|
||||
$this->assertNotContains( '%s', $part );
|
||||
// phpcs:ignore WordPress.DB.PreparedSQLPlaceholders.ReplacementsWrongNumber
|
||||
$query = $wpdb->prepare( 'SELECT * FROM {$wpdb->postmeta} WHERE meta_key = %s $part', array( 'foo', 'bar' ) );
|
||||
$this->assertNull( $query );
|
||||
}
|
||||
@@ -1620,6 +1621,7 @@ class Tests_DB extends WP_UnitTestCase {
|
||||
global $wpdb;
|
||||
|
||||
$actual = $wpdb->prepare(
|
||||
// phpcs:ignore WordPress.DB.PreparedSQLPlaceholders.UnquotedComplexPlaceholder
|
||||
'WHERE second=%2$f AND first=%1$f',
|
||||
1.1,
|
||||
2.2
|
||||
@@ -1634,6 +1636,7 @@ class Tests_DB extends WP_UnitTestCase {
|
||||
global $wpdb;
|
||||
|
||||
$actual = $wpdb->prepare(
|
||||
// phpcs:ignore WordPress.DB.PreparedSQLPlaceholders.UnquotedComplexPlaceholder
|
||||
'WHERE second=%2$f AND first=%1$f',
|
||||
array( 1.1, 2.2 )
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user