osCommerce / oscommerce2

osCommerce Online Merchant v2.x
http://www.oscommerce.com
MIT License
281 stars 222 forks source link

undefined variable in specials page when no specials exists #578

Open divinity76 opened 7 years ago

divinity76 commented 7 years ago

this was tested on commit de0e97d15d43ac6a9a6cfb2847134a82a0148f2b from Nov 24, 2016 - commit #3000

when you delete all special deals, and go to the specials admin page, you'll get an error similar to this:

[28-Apr-2017 17:04:21 Europe/Oslo] PHP Notice: Undefined variable: sInfo in /srv/http/honningas/butikk.honningas.no/catalog/admin/specials.php on line 268

i guess a quick-fix would be to replace if (is_object($sInfo)) { in line 268 of https://github.com/osCommerce/oscommerce2/blob/de0e97d15d43ac6a9a6cfb2847134a82a0148f2b/catalog/admin/specials.php#L268 with if (isset($sInfo) && is_object($sInfo)) { (haven't actually tested it, thus "just a guess")

Gergely commented 7 years ago

Thank @divinity76 ,

until specials.php will be rewrited to native codebase your fix is a perfect solution