@@ -47,7 +47,6 @@ local string_GetExtensionFromFilename = string.GetExtensionFromFilename
4747local string_Explode = string .Explode
4848local table_insert = table.insert
4949local table_concat = table.concat
50- local PrintTable = PrintTable
5150module (" url" )
5251
5352---- -------------------------------------------------------------------------
584583-- Returns: table with parsed URL components or nil if security validation fails
585584--
586585-- Security features applied automatically:
587- -- • Protocol validation (only allows http, https, ftp )
586+ -- • Protocol validation (only allows http, https)
588587-- • Parameter sanitization (removes script injection patterns)
589588-- • XSS prevention (escapes dangerous HTML characters)
590589-- • Directory traversal protection (blocks ../ path attacks)
@@ -619,7 +618,7 @@ function parse2(url, default)
619618 if not parsed then return end
620619
621620 -- Validate URL protocol against whitelist
622- -- Only http, https, and ftp are allowed to prevent code injection
621+ -- Only http and https are allowed to prevent code injection
623622 if parsed .scheme and not isAllowedProtocol (parsed .scheme ) then
624623 return nil -- Dangerous protocol detected
625624 end
@@ -756,7 +755,6 @@ function parse2(url, default)
756755 end
757756 end
758757
759- PrintTable (parsed )
760758 return parsed
761759end
762760
0 commit comments