url.lua:remove_dot_components(): avoid overconsuming dot segments
This commit is contained in:
parent
c570a32c21
commit
7ccea58776
2 changed files with 7 additions and 2 deletions
|
@ -85,11 +85,11 @@ end
|
|||
local function remove_dot_components(path)
|
||||
repeat
|
||||
local was = path
|
||||
path = path:gsub('/%./', '/')
|
||||
path = path:gsub('/%./', '/', 1)
|
||||
until path == was
|
||||
repeat
|
||||
local was = path
|
||||
path = path:gsub('[^/]+/%.%./([^/]+)', '%1')
|
||||
path = path:gsub('[^/]+/%.%./([^/]+)', '%1', 1)
|
||||
until path == was
|
||||
path = path:gsub('[^/]+/%.%./*$', '')
|
||||
path = path:gsub('/%.%.$', '/')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue