Issue #1557756 by tobiasb: Fixed PHP warnings by checking to ensure that HTTP_USER_AGENT is available before attempting to use it.