lat9 / news_box_manager_v3

News Box Manager v3 for Zen Cart 1.5.8a and later
GNU General Public License v2.0
1 stars 0 forks source link

PHP 8 : Warning Log on new article preview #29

Closed webchills closed 9 months ago

webchills commented 2 years ago

Zen Cart 1.5.7d PHP 8.0.19

When creating a new article a warning log is produced: `Request URI: /admin/index.php?cmd=news_box_manager4&action=newpreview&nType=4

1 require(/admin/news_box_manager.php) called at [/admin/news_box_manager4.php:19]

2 require(/admin/news_box_manager4.php) called at [/admin/index.php:18]

--> PHP Warning: Undefined array key "nID" in /manager/news_box_manager.php on line 428.`

To get rid of this warning change around line 428 from $nID = (int)$_POST['nID']; to $nID = (!empty($_POST['nID'])) ? (int)$_POST['nID'] : 0;