Skip to content

Commit 00d2fc7

Browse files
committed
Array fix
1 parent 2a5c428 commit 00d2fc7

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/Search_Replace_Command.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -824,14 +824,14 @@ private function php_handle_col( $col, $primary_keys, $table, $old, $new, $addit
824824

825825
if ( ! $this->regex ) {
826826
$old_json = self::json_encode_strip_quotes( $old );
827-
$base_key_condition = "$col_sql" . $wpdb->prepare( ' LIKE BINARY %s', '%' . self::esc_like( $old ) . '%' );
827+
$condition = "$col_sql" . $wpdb->prepare( ' LIKE BINARY %s', '%' . self::esc_like( $old ) . '%' );
828828
if ( $old_json !== $old ) {
829-
$base_key_condition = "( $base_key_condition OR $col_sql" . $wpdb->prepare( ' LIKE BINARY %s', '%' . self::esc_like( $old_json ) . '%' ) . ' )';
829+
$condition = "( $condition OR $col_sql" . $wpdb->prepare( ' LIKE BINARY %s', '%' . self::esc_like( $old_json ) . '%' ) . ' )';
830830
}
831-
832-
$where_key = $base_key_condition ? ' WHERE ' . implode( ' AND ', $base_key_condition ) : '';
831+
$base_key_condition[] = $condition;
833832
}
834833

834+
$where_key = $base_key_condition ? ' WHERE ' . implode( ' AND ', $base_key_condition ) : '';
835835
$escaped_primary_keys = self::esc_sql_ident( $primary_keys );
836836
$primary_keys_sql = implode( ',', $escaped_primary_keys );
837837
$order_by_keys = array_map(

0 commit comments

Comments
 (0)