diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2018-08-08 13:32:03 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2018-08-08 13:32:03 +0200 |
commit | c74a5250e5b2a34ee8e070cfc6ee7fac8c06891b (patch) | |
tree | da6bc9e0a9ce0d857cee1862b564f83a3b9e7219 /lib/private/legacy | |
parent | bee65f8053f3c5915c83931740b00ce8e458e44d (diff) | |
download | nextcloud-server-c74a5250e5b2a34ee8e070cfc6ee7fac8c06891b.tar.gz nextcloud-server-c74a5250e5b2a34ee8e070cfc6ee7fac8c06891b.zip |
Check if HTTP_USER_AGENT is set before using it
Sentry reported some errors regarding this. Apparently not everybody
sets a user agent. If it is not set we assume this is not IE ;)
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib/private/legacy')
-rw-r--r-- | lib/private/legacy/util.php | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/private/legacy/util.php b/lib/private/legacy/util.php index a581397212a..1b9f52008fd 100644 --- a/lib/private/legacy/util.php +++ b/lib/private/legacy/util.php @@ -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; } |