You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
forkey,valinstr:gmatch(string.format('([^%q=]+)(=*[^%q=]*)', sep, sep)) do
In this line string.format formats separator (which is & by default) using %q. %q specifier formats string such as it can be read by Lua interpreter. The final pattern will be ([^"&"=]+)(=*[^"&"=]*). gmatch is not a Lua interpreter and double quote in [] pattern will match any character but & or " (See the description). This is crucial because now " is also a valid separator.
neturl/lib/net/url.lua
Line 210 in de6e3dc
In this line
string.format
formats separator (which is&
by default) using%q
.%q
specifier formats string such as it can be read by Lua interpreter. The final pattern will be([^"&"=]+)(=*[^"&"=]*)
.gmatch
is not a Lua interpreter and double quote in[]
pattern will match any character but&
or"
(See the description). This is crucial because now"
is also a valid separator.This code parses URL as this:
But it's definitely wrong.
The text was updated successfully, but these errors were encountered: