Index: oscommerce2/trunk/catalog/checkout_shipping.php =================================================================== diff -u -r477 -r1699 --- oscommerce2/trunk/catalog/checkout_shipping.php (.../checkout_shipping.php) (revision 477) +++ oscommerce2/trunk/catalog/checkout_shipping.php (.../checkout_shipping.php) (revision 1699) @@ -30,12 +30,14 @@ $sendto = $customer_default_address_id; } else { // verify the selected shipping address - $check_address_query = tep_db_query("select count(*) as total from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "' and address_book_id = '" . (int)$sendto . "'"); - $check_address = tep_db_fetch_array($check_address_query); + if ( (is_array($sendto) && empty($sendto)) || is_numeric($sendto) ) { + $check_address_query = tep_db_query("select count(*) as total from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "' and address_book_id = '" . (int)$sendto . "'"); + $check_address = tep_db_fetch_array($check_address_query); - if ($check_address['total'] != '1') { - $sendto = $customer_default_address_id; - if (tep_session_is_registered('shipping')) tep_session_unregister('shipping'); + if ($check_address['total'] != '1') { + $sendto = $customer_default_address_id; + if (tep_session_is_registered('shipping')) tep_session_unregister('shipping'); + } } }