Skip to content

Commit

Permalink
Merge pull request #497 from nextcloud/debug/mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
juliusknorr authored Dec 7, 2023
2 parents ec72510 + a4501e6 commit 0ac2069
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 0ac2069

Please sign in to comment.