From 7ccea58776b8084f29a48610cb44b17ca604e4b5 Mon Sep 17 00:00:00 2001 From: "E. Westbrook" Date: Tue, 21 Aug 2018 09:59:45 -0600 Subject: url.lua:remove_dot_components(): avoid overconsuming dot segments --- src/url.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/url.lua b/src/url.lua index 0d88adb..e1fa2bc 100644 --- a/src/url.lua +++ b/src/url.lua @@ -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('/%.%.$', '/') -- cgit v1.2.3-55-g6feb