Skip to content

Commit 1718800

Browse files
committed
Add check for relative filepath.
1 parent 420d7c4 commit 1718800

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/Server.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -869,12 +869,18 @@ private function parseLinkedMetadata(string $path)
869869
$value = array_pop($linkMetaValue);
870870
$url = $value['value'] ?? null;
871871

872+
if (strpos($foundPath, './') === 0) {
873+
// Filepath is relative to the meta file
874+
$path = $foundPath;
875+
}
876+
872877
if ($path !== $foundPath) {
873878
// Change the path from the request to the redirect (or not found) path
874879
$url = substr_replace($path,
875880
$url,
876881
strpos($path, $foundPath),
877-
strlen($foundPath));
882+
strlen($foundPath))
883+
;
878884
}
879885

880886
$linkMeta = [

0 commit comments

Comments
 (0)