Skip to content

Commit

Permalink
fix: enforce view mode on mobile
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <jus@bitgrid.net>
  • Loading branch information
juliusknorr committed Nov 27, 2023
1 parent 9498d5f commit a4501e6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/WOPI/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,11 @@ public function getUrlSrcForFile(File $file, bool $edit): string {
'internal-' . $fallbackProtocol,
];

$userAgent = $_SERVER["HTTP_USER_AGENT"];
if (preg_match("/(android|mobile)/i", $userAgent)) {
$edit = false;
}

$actions = [
$edit && $file->getSize() === 0 ? self::ACTION_EDITNEW : null,
$edit ? self::ACTION_EDIT : null,
Expand Down

0 comments on commit a4501e6

Please sign in to comment.