Support ⇒ Upgrades :: Archives ⇒ PHP Notice received in error logs, referring to cmsinit.inc :: Archived ⇒ Community Forums ⇒ CPG Dragonfly™ CMS
Forum IndexUpgrades

Archived ⇒ PHP Notice received in error logs, referring to cmsinit.inc


After moving server and a new install with an existing db, the error logs show this error:

PHP Notice: Undefined index: HTTP_USER_AGENT in /var/www/vhosts/*********/httpdocs/includes/cmsinit.inc on line 17

any idea on how to solve it?

Kokkieblanda
web: www.kokkieblanda.nl

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
linux 2.2.6 (fedora)/MySQL 5.0.51/PHP 5.2.5/Dragonfly 9.0.6.1


Get the IP and ban him/her?

HTTP_USER_AGENT is a HTTP header send by the client (browser).
Many browsers gimmick Mozilla (IE, Mozilla, Firefox, etc.)

The client sends an (optional) User-agent header like: Mozilla/4.0

If this string is empty, the system has no way to detect which browser is used and actually bans the client (optional, see admin security system).

We need the user-agent detection because there are big differences between a real browser and IE. The identification is mostly needed to workaround the many present IE bugs.

If a firewall, router, proxy or other software prevents the client from sending this header (it's optional anyway) then some guru decided to hide it, or else it is some malicious bot to spam/scam your website.

In either case the visitor is pretty useless to us and has no need to visit/harvest the website.
We could prevent the notice in the Apache logs but, it is pretty usefull to backtrace the nature of the client IP.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Fedora 25 / Apache 2.4.27 / MariaDB 10.1.26 / PHP 7.1.10 / Mercurial


I agree. No legit browser will submit a blank user-agent. If I see blanks I immediately treat the request as hostile.

J.
j e r u v y a t y a h o o d o t c o m

Need help? Look here: www.dragonflycms.org/W...d=112.html
Need to chat? Look for me on irc.freenode.net

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Ubuntu7.10/Debian3.1 - 2.2.3/1.3.37 - 5.0.38/4.0.27 - 5.2.1/4.4.7 - CVS/9.1.2}

All times are UTC