Avoid notice in /keys request if no User-Agent

This commit is contained in:
Dan Stillman
2017-07-02 03:31:21 -04:00
parent 9b5e5e114f
commit a6c7801795

View File

@@ -35,7 +35,8 @@ class KeysController extends ApiController {
if ($key == 'current') {
$key = $this->apiKey;
if (strpos($_SERVER['HTTP_USER_AGENT'], 'Zotero/') !== false) {
if (!empty($_SERVER['HTTP_USER_AGENT'])
&& strpos($_SERVER['HTTP_USER_AGENT'], 'Zotero/') !== false) {
$syncStart = true;
}
}