Mistři v programování na #hovnokod

Jiné #4471

Neřešte co to dělá, rozjímejte nad komentářem..

If it was hard to write, it should be hard to read, but I'll add a small hint
about what it does anyway, to spoil the challenge.

So, take the provided restrict option. If it is not there, fall back to guessing
from the current URI of the script. However, take only the protocol and host
part and convert it into a pattern (without anchors, they are added during
the match).

local restrict = extra.restrict or script_uri:match('^[^:]+:/*[^/]+'):gsub('[%^%$%(%)%%%.%[%]%*%+%-%?]', '%%%0') .. "/.*"