PHP8.1, zc 1.58a, OPC 2.5.3
I received the following intermittent warning.
PHP Code:
[22-Oct-2024 16:11:52 America/New_York] Request URI: /ajax.php?act=ajaxOnePageCheckout&method=validateAddressValues, IP address: xxxx, Language id 1
#0 [internal function]: zen_debug_error_handler()
#1 /includes/classes/OnePageCheckout.php(1644): ctype_digit()
#2 /includes/classes/OnePageCheckout.php(1456): OnePageCheckout->validateUpdatedAddress()
#3 /includes/classes/ajax/zcAjaxOnePageCheckout.php(227): OnePageCheckout->validateAndSaveAjaxPostedAddress()
#4 /ajax.php(85): zcAjaxOnePageCheckout->validateAddressValues()
--> PHP Deprecated: ctype_digit(): Argument of type null will be interpreted as string in the future in /includes/classes/OnePageCheckout.php on line 1644.
Line 1644 is the following
if (!ctype_digit($country)) {
PHP Code:
[22-Oct-2024 16:11:52 America/New_York] Request URI: /ajax.php?act=ajaxOnePageCheckout&method=validateAddressValues, IP address: xxxx, Language id 1
#0 /includes/classes/OnePageCheckout.php(1643): zen_debug_error_handler()
#1 /includes/classes/OnePageCheckout.php(1456): OnePageCheckout->validateUpdatedAddress()
#2 /includes/classes/ajax/zcAjaxOnePageCheckout.php(227): OnePageCheckout->validateAndSaveAjaxPostedAddress()
#3 /ajax.php(85): zcAjaxOnePageCheckout->validateAddressValues()
--> PHP Warning: Undefined array key "zone_country_id" in /includes/classes/OnePageCheckout.php on line 1643.
Line 1643 is the following
$country = zen_db_prepare_input($address_values['zone_country_id']);
A few days back, I received the following warning (not from OPC). Not sure if it is related.
PHP Code:
[24-Sep-2024 08:57:51 America/New_York] Request URI: /index.php?main_page=checkout_shipping_address, IP address: xxxx, Language id 1
#0 /includes/modules/checkout_new_address.php(47): zen_debug_error_handler()
#1 /includes/modules/pages/checkout_shipping_address/header_php.php(45): require('/home/...')
#2 /index.php(35): require('/home/...')
--> PHP Warning: Undefined array key "zone_country_id" in /includes/modules/checkout_new_address.php on line 47.
I changed the following code
$country = zen_db_prepare_input($_POST['zone_country_id']);
To
$country = zen_db_prepare_input($_POST['zone_country_id'] ?? '');
Bookmarks