[fix] PCRE choice if no %. in url regex

This commit is contained in:
ljf (zamentur) 2018-12-13 23:23:10 +01:00 committed by GitHub
parent b90153a5ca
commit c3a9380361
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -191,7 +191,11 @@ end
-- A match function to support PCRE and lua pattern
-- lua pattern will be deprecated in YunoHost
function match(s, regex)
if rex.match(s, regex) or string.match(s,regex) then
if not string.find(regex, '%%%.') then
if rex.match(s, regex) then
return true
end
elseif string.match(s,regex) then
return true
end
return false