cubecart / v6

CubeCart Version 6
https://cubecart.com
72 stars 59 forks source link

Undefined Array Key #3436

Closed bhsmither closed 9 months ago

bhsmither commented 9 months ago

PHP 8 is complaining about an array key near line 2037 in catalogue.class.php:

if ($page == 1 && count($this->_category_products)==1 && ctype_digit($this->_category_products[0]['product_id']) && $_SERVER['HTTP_X_REQUESTED_WITH']!=='XMLHttpRequest') {

Suggest:

if ($page == 1 && count($this->_category_products)==1 && ctype_digit($this->_category_products[0]['product_id']) && (!isset($_SERVER['HTTP_X_REQUESTED_WITH']) || $_SERVER['HTTP_X_REQUESTED_WITH']!=='XMLHttpRequest')) {
abrookbanks commented 9 months ago

Thanks!! There are two instances too. :)