$_SERVER['HTTP_USER_AGENT'] is sometimes empty

If no user agent was specified on the request, this index will be empty
and cause a notice to be raised.