Merge pull request #10586 from nextcloud/fix/noid/check_if_ua_is_set

Check if HTTP_USER_AGENT is set before using it
This commit is contained in:
Roeland Jago Douma 2018-08-08 13:59:31 +02:00 committed by GitHub
commit e7e30ac25f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -1535,6 +1535,10 @@ class OC_Util {
* @return boolean
*/
public static function isIe() {
if (!isset($_SERVER['HTTP_USER_AGENT'])) {
return false;
}
return preg_match(Request::USER_AGENT_IE, $_SERVER['HTTP_USER_AGENT']) === 1;
}