Basic 1.5.8a with no specific mods and PHP 8.0
This cropped up in an earlier thread but got drowned out by the larger problem at the time.
Code:
[22-Dec-2023 17:20:14 UTC] Request URI: /index.php?main_page=gv_redeem, IP address: 158.91.17.198, Language id 1
#1 require(/includes/modules/pages/gv_redeem/header_php.php) called at [/index.php:35]
--> PHP Warning: Undefined array key "gv_no" in /includes/modules/pages/gv_redeem/header_php.php on line 13.
The decision was made to add GCs and Discounts to a site.
I'm not sure what triggers the setting of gv_no but it appears that it is trying to sanitize the gv_no
Line 13 is
Code:
require(DIR_WS_MODULES . zen_get_module_directory('require_languages.php'));$_GET['gv_no'] = zen_sanitize_string(trim($_GET['gv_no']));
The quick fix was to use
Code:
if (isset($_GET['gv_no'])) { $_GET['gv_no'] = zen_sanitize_string(trim($_GET['gv_no']));
} else {
// Handle the case when 'gv_no' is not set, perhaps provide a default value or perform some other action
// For example, you can set it to an empty string:
$_GET['gv_no'] = '';
}
This seems to avoid the warning, I just wanted to see if there was a better way to stop the warning.
THANX
Bookmarks