osclass / Osclass

With Osclass, get your own classifieds site for free. Build your own Osclass installation and start advertising real estate, jobs or whatever you want- in minutes!
http://osclass.org/
648 stars 343 forks source link

Send Friend bot abuse -- non-existent item id PHP notices #2239

Open dev-101 opened 6 years ago

dev-101 commented 6 years ago

Hi, I was hit by some stupid bot checking constantly my send-friend pages with item IDs which were either removed or disabled, and this was constantly filling my log with notices in hDefines:

Osclass 3.7.4

https: // www . url .com/item/send-friend/ 123

PHP Notice:  Undefined index: fk_i_category_id in oc-includes/osclass/helpers/hDefines.php on line 491
PHP Notice:  Undefined index: pk_i_id in oc-includes/osclass/helpers/hDefines.php on line 497
PHP Notice:  Undefined index: s_city in oc-includes/osclass/helpers/hDefines.php on line 498
PHP Notice:  Undefined index: s_title in oc-includes/osclass/helpers/hDefines.php on line 499

Now, I've dealt with the bot all right, but these notices actually helped me track and discover "the pest", otherwise it would slip my radar.

And, that's why I am undecided if we should fix this or not. I mean, it's easy to fix, but it may be actually useful, assuming we know where to look. Less experienced users will probably fail to identify the problem and may think something is wrong with their setup. A compromise would be to throw custom error in the logs, so we get better insight where/why the notice originated from, so admins don't instantly panic :)