summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoas Schilling <213943+nickvergessen@users.noreply.github.com>2023-02-09 22:42:58 +0100
committerGitHub <noreply@github.com>2023-02-09 22:42:58 +0100
commitf0b6a6f3079cb5c8f1d907a4c96a35b626bc2a7a (patch)
tree2257e6f8283e98e942280819f5b2d9615e628186
parent6d77a53dfdd356111cc65627979defe0a973b75f (diff)
parent4ef2b27a47f3669d35ae2e9271c7f9c79cca972d (diff)
downloadnextcloud-server-f0b6a6f3079cb5c8f1d907a4c96a35b626bc2a7a.tar.gz
nextcloud-server-f0b6a6f3079cb5c8f1d907a4c96a35b626bc2a7a.zip
Merge pull request #36637 from nextcloud/fix/noid/file-ref-provider-safer-match
-rw-r--r--lib/private/Collaboration/Reference/File/FileReferenceProvider.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/private/Collaboration/Reference/File/FileReferenceProvider.php b/lib/private/Collaboration/Reference/File/FileReferenceProvider.php
index 4e6c7ea623f..95e49cdf860 100644
--- a/lib/private/Collaboration/Reference/File/FileReferenceProvider.php
+++ b/lib/private/Collaboration/Reference/File/FileReferenceProvider.php
@@ -62,21 +62,21 @@ class FileReferenceProvider implements IReferenceProvider {
}
private function getFilesAppLinkId(string $referenceText): ?int {
- $start = $this->urlGenerator->getAbsoluteURL('/apps/files');
- $startIndex = $this->urlGenerator->getAbsoluteURL('/index.php/apps/files');
+ $start = $this->urlGenerator->getAbsoluteURL('/apps/files/');
+ $startIndex = $this->urlGenerator->getAbsoluteURL('/index.php/apps/files/');
$fileId = null;
if (mb_strpos($referenceText, $start) === 0) {
$parts = parse_url($referenceText);
- parse_str($parts['query'], $query);
+ parse_str($parts['query'] ?? '', $query);
$fileId = isset($query['fileid']) ? (int)$query['fileid'] : $fileId;
$fileId = isset($query['openfile']) ? (int)$query['openfile'] : $fileId;
}
if (mb_strpos($referenceText, $startIndex) === 0) {
$parts = parse_url($referenceText);
- parse_str($parts['query'], $query);
+ parse_str($parts['query'] ?? '', $query);
$fileId = isset($query['fileid']) ? (int)$query['fileid'] : $fileId;
$fileId = isset($query['openfile']) ? (int)$query['openfile'] : $fileId;
}