diff --git a/lib/Util.php b/lib/Util.php index 2f403c0a..f34f876d 100644 --- a/lib/Util.php +++ b/lib/Util.php @@ -413,6 +413,10 @@ class Util public static function callerIsNative(): bool { // Should not use IRequest here since this method is called during registration + if (array_key_exists('HTTP_X_REQUESTED_WITH', $_SERVER)) { + return 'gallery.memories' === $_SERVER['HTTP_X_REQUESTED_WITH']; + } + return false !== strpos($_SERVER['HTTP_USER_AGENT'] ?? '', 'MemoriesNative'); }