Fix PHP8 warning if $_SERVER['HTTP_USER_AGENT'] is not set

This commit is contained in:
Aleksander Machniak 2023-12-13 15:50:16 +01:00
parent 337ac3c5d9
commit f4accec37c

View file

@ -812,7 +812,9 @@ class kolab_dav_client
$request->setConfig($http_config);
// proxy User-Agent string
$request->setHeader('user-agent', $_SERVER['HTTP_USER_AGENT']);
if (isset($_SERVER['HTTP_USER_AGENT'])) {
$request->setHeader('user-agent', $_SERVER['HTTP_USER_AGENT']);
}
// cleanup
$request->setBody('');