diff options
| author | s-ol <s+removethis@s-ol.nu> | 2023-09-03 21:43:36 +0000 |
|---|---|---|
| committer | s-ol <s+removethis@s-ol.nu> | 2023-09-03 21:43:36 +0000 |
| commit | d82327aec15838b4c1aa44a3dfbdb04891691ab1 (patch) | |
| tree | 6ce8db7049de12d3aa6a356827210ea13b8a41a1 | |
| parent | fix logging, 404 handling (diff) | |
| download | mmm-d82327aec15838b4c1aa44a3dfbdb04891691ab1.tar.gz mmm-d82327aec15838b4c1aa44a3dfbdb04891691ab1.zip | |
mmmfs.util: fix relative paths ending with a ".." segment
| -rw-r--r-- | mmm/mmmfs/util.moon | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mmm/mmmfs/util.moon b/mmm/mmmfs/util.moon index 2a72023..1206bb7 100644 --- a/mmm/mmmfs/util.moon +++ b/mmm/mmmfs/util.moon @@ -26,8 +26,8 @@ tourl = (path, facet) -> assert origin, "cannot resolve relative path '#{path}' without origin!" path = "#{origin.path}/#{path}" - while path\match '/([^/]-)/%.%./' - path = path\gsub '/([^/]-)/%.%./', '/' + while path\match '/([^/]-)/%.%.(%f[/\0])' + path = path\gsub '/([^/]-)/%.%.(%f[/\0])', '%2' if origin.path == path\sub 1, #origin.path assert (origin\walk path), "couldn't resolve path '#{path}' from #{origin}" |
