error when HTTP_USER_AGENT variable is not set
varunvnair - June 14, 2005 - 16:11
| Project: | Statistics filtering |
| Version: | 4.6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | minor |
| Assigned: | mikeryan |
| Status: | closed |
Jump to:
Description
HI,
Another minor bug for you to squash. Seems like there are people or bots out there who do not supply any user agent string. In that case the module throws the following error:
Type php
Date Tuesday, June 14, 2005 - 5:11pm
User Anonymous
Location /
Message get_browser(): HTTP_USER_AGENT variable is not set, cannot determine user agent name in /homepages/1/d118711144/htdocs/blog/modules/statistics_filter/statistics_filter.module on line 145.
Severity error
Hostname 194.146.225.35
Looks like you will have to use an isset() in the appropriate place.
Thanks.

#1
That's being thrown by PHP's get_browser() function - in those cases, the browser name ends up in the log as a blank. Not much I can do to identify the browser in that case - an @ in front of the get_browser() function ought to suppress the message so it doesn't clutter up your log.
I'm rewriting the module to not use get_browser(), so this will go away...
#2
Thanks.
Am looking forward to the rewritten module.
#3
OK, I've created a new module (browscap) and committed a new version of statistics_filter that uses the new module's services instead of PHP's get_browser() function - this should address your issue.
#4
Addressed by the replacement of PHP's get_browser() with the browscap module.