diff options
author | Julius Härtl <jus@bitgrid.net> | 2018-06-20 09:22:28 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-20 09:22:28 +0300 |
commit | 5f3c796947dad8eaa9e299f5b24f24caf0563169 (patch) | |
tree | 1efae15b6a6cfe505fb74b082366131bd61bb97f | |
parent | 9f152737c48edd4f780a8893402f522b1912d317 (diff) | |
parent | f33165146b5482a2c3a2bd6339c4513e3e1b0309 (diff) |
Merge pull request #44 from tessus/master
fix error messages `Undefined index`
-rw-r--r-- | lib/Sections/ClientSection.php | 4 | ||||
-rw-r--r-- | lib/Sections/ServerSection.php | 6 |
2 files changed, 7 insertions, 3 deletions
diff --git a/lib/Sections/ClientSection.php b/lib/Sections/ClientSection.php index 7463096..57c78d1 100644 --- a/lib/Sections/ClientSection.php +++ b/lib/Sections/ClientSection.php @@ -61,10 +61,10 @@ class ClientSection extends Section { $browserString .= $browser['plattform'] . ' '; } } - if(empty($browserString)) { + if(isset($_SERVER['HTTP_USER_AGENT']) && empty($browserString)) { return $_SERVER['HTTP_USER_AGENT']; } return $browserString; } -}
\ No newline at end of file +} diff --git a/lib/Sections/ServerSection.php b/lib/Sections/ServerSection.php index 53d7978..354cdb8 100644 --- a/lib/Sections/ServerSection.php +++ b/lib/Sections/ServerSection.php @@ -83,7 +83,11 @@ SELECT * FROM `oc_appconfig` WHERE `appid` = \'user_ldap\'; Eventually replace sensitive data as the name/IP-address of your LDAP server or groups.', IDetail::TYPE_COLLAPSIBLE_PREFORMAT); } private function getWebserver() { - return $_SERVER['SERVER_SOFTWARE'] . ' (' . PHP_SAPI . ')'; + if (isset($_SERVER['SERVER_SOFTWARE']) && !empty($_SERVER['SERVER_SOFTWARE'])) { + return $_SERVER['SERVER_SOFTWARE'] . ' (' . PHP_SAPI . ')'; + } else { + return 'Unknown' . ' (' . PHP_SAPI . ')'; + } } private function getNextcloudVersion() { |