You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$results = $wpdb->get_results( "SELECT {$primary_key_sql}{$column} FROM {$table}" );
891
+
$results = $wpdb->get_results( "SELECT {$primary_key_sql}{$column_sql} FROM {$table_sql}" );
890
892
} else {
891
-
$results = $wpdb->get_results( $wpdb->prepare( "SELECT {$primary_key_sql}{$column} FROM {$table} WHERE {$column} LIKE %s;", $esc_like_search ) );
893
+
$results = $wpdb->get_results( $wpdb->prepare( "SELECT {$primary_key_sql}{$column_sql} FROM {$table_sql} WHERE {$column_sql} LIKE %s;", $esc_like_search ) );
892
894
}
893
895
if ( $results ) {
894
896
$row_count += count( $results );
@@ -953,12 +955,12 @@ public function search( $args, $assoc_args ) {
* Escapes (backticks) MySQL identifiers (aka schema object names) - i.e. column names, table names, and database/index/alias/view etc names.
1053
+
* See https://dev.mysql.com/doc/refman/5.5/en/identifiers.html
1054
+
*
1055
+
* @param string|array $idents A single identifier or an array of identifiers.
1056
+
* @return string|array An escaped string if given a string, or an array of escaped strings if given an array of strings.
1057
+
*/
1058
+
privatestaticfunctionesc_sql_ident( $idents ) {
1059
+
$backtick = function ( $v ) {
1060
+
// Escape any backticks in the identifier by doubling.
1061
+
return'`' . str_replace( '`', '``', $v ) . '`';
1062
+
};
1063
+
if ( is_string( $idents ) ) {
1064
+
return$backtick( $idents );
1065
+
}
1066
+
returnarray_map( $backtick, $idents );
1067
+
}
1068
+
1048
1069
/**
1049
1070
* Gets the color codes from the options if any, and returns the passed in array colorized with 2 elements per entry, a color code (or '') and a reset (or '').
0 commit comments