summaryrefslogtreecommitdiffstats
path: root/lib/private/Collaboration
diff options
context:
space:
mode:
authorJulien Veyssier <julien-nc@posteo.net>2023-02-09 14:33:19 +0100
committerJulien Veyssier <julien-nc@posteo.net>2023-02-09 14:33:19 +0100
commit4ef2b27a47f3669d35ae2e9271c7f9c79cca972d (patch)
tree3a7f5f92bb464df22fb3c06997daead733f880a4 /lib/private/Collaboration
parent2c05c2479e7254054ac4a7601db778a7714c41ad (diff)
downloadnextcloud-server-4ef2b27a47f3669d35ae2e9271c7f9c79cca972d.tar.gz
nextcloud-server-4ef2b27a47f3669d35ae2e9271c7f9c79cca972d.zip
safer URL match in FileReferenceProvider
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
Diffstat (limited to 'lib/private/Collaboration')
-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;
}