Invalid order IDs passed to the order payment screen cause a fatal error because WCS_Initial_Cart_Stock_Manager::has_handled_stock() attempts to use $order when the value of the parameter as passed in from ::get_order_from_query_vars() is false
How to test this PR
Attempt to go to a pay-for-order page for a non-existing order ID, e.g. /checkout/order-pay/123456789/?pay_for_order=true&key=wc_order_123456789
Product impact
[x] Added changelog entry (or does not apply)
[ ] Will this PR affect WooCommerce Subscriptions? yes/no/tbc, add issue ref
[ ] Will this PR affect WooCommerce Payments? yes/no/tbc, add issue ref
[ ] Added deprecated functions, hooks or classes to the spreadsheet
Fixes #
Description
Invalid order IDs passed to the order payment screen cause a fatal error because
WCS_Initial_Cart_Stock_Manager::has_handled_stock()
attempts to use$order
when the value of the parameter as passed in from::get_order_from_query_vars()
isfalse
How to test this PR
/checkout/order-pay/123456789/?pay_for_order=true&key=wc_order_123456789
Product impact