mirror of
https://github.com/lunarmodules/luasocket.git
synced 2025-07-13 14:14:30 +02:00
url.lua:remove_dot_components(): avoid overconsuming dot segments
This commit is contained in:
@ -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('/%.%.$', '/')
|
||||
|
Reference in New Issue
Block a user