Extra protection for empty order key orders.

Some order can have order key set to empty string. This commit disallows fetching those orders via key at DB level (its already disallowed from interface).
This commit is contained in:
Vedanshu Jain 2023-04-06 21:06:38 +05:30
parent ebb43378a1
commit 322639bb7e
1 changed files with 1 additions and 1 deletions

View File

@ -847,7 +847,7 @@ WHERE
$wpdb->prepare( $wpdb->prepare(
"SELECT {$orders_table}.id FROM {$orders_table} "SELECT {$orders_table}.id FROM {$orders_table}
INNER JOIN {$op_table} ON {$op_table}.order_id = {$orders_table}.id INNER JOIN {$op_table} ON {$op_table}.order_id = {$orders_table}.id
WHERE {$op_table}.order_key = %s", WHERE {$op_table}.order_key = %s AND {$op_table}.order_key != ''",
$order_key $order_key
) )
); );