util: use native PHP user agent

Signed-off-by: Varun Patil <radialapps@gmail.com>
pull/672/head
Varun Patil 2023-05-26 10:51:31 -07:00
parent f154e12804
commit 1a6f17fb54
1 changed files with 2 additions and 3 deletions

View File

@ -412,9 +412,8 @@ class Util
*/ */
public static function callerIsNative(): bool public static function callerIsNative(): bool
{ {
$userAgent = \OC::$server->get(\OCP\IRequest::class)->getHeader('User-Agent'); // Should not use IRequest here since this method is called during registration
return false !== strpos($_SERVER['HTTP_USER_AGENT'] ?? '', 'MemoriesNative');
return false !== strpos($userAgent, 'MemoriesNative');
} }
/** /**