More warnings and fixes:
Request URI: /ipn_main_handler.php?type=ec&token=EC-xxxx&PayerID=xxxx, IP address: xxxx, Language id 1
#0 /includes/classes/OnePageCheckout.php(2379): zen_debug_error_handler()
#1 /includes/classes/observers/class.checkout_one_observer.php(625): OnePageCheckout->setPayPalAddressCreationBypass()
#2 /includes/classes/traits/NotifierManager.php(87): checkout_one_observer->update()
#3 /includes/modules/payment/paypalwpp.php(2165): base->notify()
#4 /includes/modules/payment/paypalwpp.php(2012): paypalwpp->ec_step2_finish()
#5 /ipn_main_handler.php(85): paypalwpp->ec_step2()
--> PHP Warning: Undefined array key "address_format_id" in /includes/classes/OnePageCheckout.php on line 2379.
Change from
Code:
$this->tempAddressValues['ship']['format_id'] = $country_info['address_format_id'];
to
Code:
$this->tempAddressValues['ship']['format_id'] = ($country_info['address_format_id'] ?? '');
PHP Warning: Undefined array key "languages_id" in /includes/extra_configures/enable_error_logging.php on line 84
Change from
Code:
$language_info = ', Language id ' . $_SESSION['languages_id'];
to
Code:
$language_info = ', Language id ' . ($_SESSION['languages_id'] ?? '');
Request URI: /ipn_main_handler.php, IP address: xxxx, Language id
#0 /includes/modules/payment/paypal/paypal_functions.php(48): zen_debug_error_handler()
#1 /includes/init_includes/init_paypal_ipn_sessions.php(34): ipn_get_stored_session()
#2 /includes/autoload_func.php(40): require_once('/...')
#3 /includes/application_top.php(237): require('/...')
#4 /ipn_main_handler.php(141): require('/...')
--> PHP Warning: Undefined array key 1 in /includes/modules/payment/paypal/paypal_functions.php on line 48.
and
--> PHP Warning: Undefined array key 1 in /includes/modules/payment/paypal/paypal_functions.php on line 55.
Change from (based on version 1.5.8a, only one spot needs to be changed)
Code:
if (!is_array($session_stuff)) {
to (referring to version 2.0.0rc-1)
Code:
if (!is_array($session_stuff) || !isset($session_stuff[1])) {
Request URI: /ipn_main_handler.php, IP address: xxxx, Language id
#0 [internal function]: zen_debug_error_handler()
#1 /includes/classes/db/mysql/query_factory.php(177): mysqli_real_escape_string()
#2 /includes/classes/db/mysql/query_factory.php(562): queryFactory->prepare_input()
#3 /includes/classes/db/mysql/query_factory.php(513): queryFactory->getBindVarValue()
#4 /includes/modules/payment/paypal/paypal_functions.php(48): queryFactory->bindVars()
#5 /includes/init_includes/init_paypal_ipn_sessions.php(34): ipn_get_stored_session()
#6 /includes/autoload_func.php(40): require_once('/...')
#7 /includes/application_top.php(237): require('/...')
#8 /ipn_main_handler.php(141): require('/...')
--> PHP Deprecated: mysqli_real_escape_string(): Passing null to parameter #2 ($string) of type string is deprecated in /includes/classes/db/mysql/query_factory.php on line 177.
Change from
Code:
return mysqli_real_escape_string($this->link, $string);
To
Code:
return mysqli_real_escape_string($this->link, ($string ?? ''));
Request URI: /index.php?main_page=checkout_process, IP address: xxxx, Language id 1
#0 /includes/modules/payment/paypaldp.php(1989): zen_debug_error_handler()
#1 /includes/modules/payment/paypaldp.php(966): paypaldp->_errorHandler()
#2 /includes/classes/payment.php(288): paypaldp->before_process()
#3 /includes/modules/checkout_process.php(98): payment->before_process()
#4 /includes/modules/pages/checkout_process/header_php.php(13): require('/...')
#5 /index.php(35): require('/...')
--> PHP Warning: Undefined variable $error_occurred in /includes/modules/payment/paypaldp.php on line 1989.
Referring link: https://github.com/zencart/zencart/pull/1089/files
Change from:
Code:
$this->_doDebug('PayPal Error Log - before_process() - DP', "In function: before_process() - Direct Payment \r\nDid first contact attempt return error? " . ($error_occurred ? "Yes" : "No") . " \r\n\r\nValue List:\r\n" . str_replace('&',"\r\n", urldecode($doPayPal->_sanitizeLog($doPayPal->_parseNameValueList($doPayPal->lastParamList)))) . "\r\n\r\nResponse:\r\n" . urldecode(print_r($response, true)));
To:
Code:
$this->_doDebug('PayPal Error Log - before_process() - DP', "In function: before_process() - Direct Payment \r\n\r\nValue List:\r\n" . str_replace('&',"\r\n", urldecode($doPayPal->_sanitizeLog($doPayPal->_parseNameValueList($doPayPal->lastParamList)))) . "\r\n\r\nResponse:\r\n" . urldecode(print_r($response, true)));
Request URI: /admin/index.php?cmd=specials&search=xxxx&sID=xxxx, IP address: xxxx, Language id 1
#0 /admin/specials.php(452): zen_debug_error_handler()
#1 /admin/index.php(11): require('/...')
--> PHP Warning: Undefined array key "page" in /admin/specials.php on line 452.
Request URI: /admin/index.php?cmd=salemaker&action=insert, IP address: xxxx, Language id 1
#0 /admin/salemaker.php(97): zen_debug_error_handler()
#1 /admin/index.php(11): require('/...')
--> PHP Warning: Undefined array key "page" in /admin/salemaker.php on line 97.
Similar fix. Change from
Code:
zen_redirect(zen_href_link(FILENAME_SALEMAKER, 'page=' . $_GET['page'] . '&sID=' . $_POST['sID']));
to
Code:
zen_redirect(zen_href_link(FILENAME_SALEMAKER, 'page=' . ($_GET['page'] ?? '') . '&sID=' . $_POST['sID']));
Bookmarks