From dff5ed97a101403eff7187ea440d15174a00c76e Mon Sep 17 00:00:00 2001 From: ghost Date: Thu, 1 Feb 2024 20:53:45 +0200 Subject: [PATCH] add path exist validation --- src/Dokuwiki/Filesystem.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Dokuwiki/Filesystem.php b/src/Dokuwiki/Filesystem.php index dbd30f7..de6db98 100644 --- a/src/Dokuwiki/Filesystem.php +++ b/src/Dokuwiki/Filesystem.php @@ -58,6 +58,11 @@ class Filesystem public function getPageUriByPath(string $path): ?string { + if (!in_array($path, $this->_list) || !is_file($path) || !is_readable($path)) + { + return null; + } + $path = str_replace( sprintf( '%s/pages/',