aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2024-08-21 11:54:47 +0200
committerFerdinand Thiessen <opensource@fthiessen.de>2024-08-21 13:01:23 +0200
commitc82b17d0a332fa5116cde86820d4994795d02db5 (patch)
treee796d8bd23e177f83baf54be6c122a38ab99efb5 /lib
parentec00367f3006dfe0389854a5340bf4effcc8452c (diff)
downloadnextcloud-server-c82b17d0a332fa5116cde86820d4994795d02db5.tar.gz
nextcloud-server-c82b17d0a332fa5116cde86820d4994795d02db5.zip
fix: Support Safari mobile
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/AppFramework/Http/Request.php1
-rw-r--r--lib/private/TemplateLayout.php2
2 files changed, 2 insertions, 1 deletions
diff --git a/lib/private/AppFramework/Http/Request.php b/lib/private/AppFramework/Http/Request.php
index f790dae226c..c877304c929 100644
--- a/lib/private/AppFramework/Http/Request.php
+++ b/lib/private/AppFramework/Http/Request.php
@@ -38,6 +38,7 @@ class Request implements \ArrayAccess, \Countable, IRequest {
public const USER_AGENT_CHROME = '/^Mozilla\/5\.0 \([^)]+\) AppleWebKit\/[0-9.]+ \(KHTML, like Gecko\)( Ubuntu Chromium\/[0-9.]+|) Chrome\/[0-9.]+ (Mobile Safari|Safari)\/[0-9.]+( (Vivaldi|Brave|OPR)\/[0-9.]+|)$/';
// Safari User Agent from http://www.useragentstring.com/pages/Safari/
public const USER_AGENT_SAFARI = '/^Mozilla\/5\.0 \([^)]+\) AppleWebKit\/[0-9.]+ \(KHTML, like Gecko\) Version\/[0-9.]+ Safari\/[0-9.A-Z]+$/';
+ public const USER_AGENT_SAFARI_MOBILE = '/^Mozilla\/5\.0 \([^)]+\) AppleWebKit\/[0-9.]+ \(KHTML, like Gecko\) Version\/[0-9.]+ (Mobile\/[0-9.A-Z]+) Safari\/[0-9.A-Z]+$/';
// Android Chrome user agent: https://developers.google.com/chrome/mobile/docs/user-agent
public const USER_AGENT_ANDROID_MOBILE_CHROME = '#Android.*Chrome/[.0-9]*#';
public const USER_AGENT_FREEBOX = '#^Mozilla/5\.0$#';
diff --git a/lib/private/TemplateLayout.php b/lib/private/TemplateLayout.php
index 272557f5177..fd6b7b27a97 100644
--- a/lib/private/TemplateLayout.php
+++ b/lib/private/TemplateLayout.php
@@ -289,7 +289,7 @@ class TemplateLayout extends \OC_Template {
}
$request = \OCP\Server::get(IRequest::class);
- if ($request->isUserAgent([Request::USER_AGENT_CLIENT_IOS, Request::USER_AGENT_SAFARI])) {
+ if ($request->isUserAgent([Request::USER_AGENT_CLIENT_IOS, Request::USER_AGENT_SAFARI, Request::USER_AGENT_SAFARI_MOBILE])) {
// Prevent auto zoom with iOS but still allow user zoom
// On chrome (and others) this does not work (will also disable user zoom)
$this->assign('viewport_maximum_scale', '1.0');