]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Don't access HTTP_USER_AGENT if it doesn't exist
authorMikael Nordfeldth <mmn@hethane.se>
Tue, 15 Jul 2014 18:38:58 +0000 (20:38 +0200)
committerMikael Nordfeldth <mmn@hethane.se>
Tue, 15 Jul 2014 18:38:58 +0000 (20:38 +0200)
plugins/MobileProfile/MobileProfilePlugin.php

index bf16cd9f56690fe6c06042b4d123d420f63f8a2b..98fcb472fae2214967f944ce3a2a1722693e300b 100644 (file)
@@ -72,7 +72,7 @@ class MobileProfilePlugin extends WAP20Plugin
         } else if (isset($_COOKIE['MobileOverride'])) {
             // Cookie override is controlled by link at bottom.
             $this->serveMobile = (bool)$_COOKIE['MobileOverride'];
-        } else {
+        } elseif (array_key_exists('HTTP_USER_AGENT', $_SERVER)) {
             // If they like the WAP 2.0 mimetype, serve them MP
             // @fixme $type is undefined, making this if case useless and spewing errors.
             // What's the intent?