CustomSearch-1.0

CustomSearch-1.0

1.1k Downloads

Error when searching for "[": malformed pattern (missing ']')

Blazeflack opened this issue ยท 3 comments

commented

When calling "Lib:Matches(link, search)" the following error will trigger if search contains the character "[":
malformed pattern (missing ']')

Proposed fix:
Disable pattern matching for the :find method used on lines 109 and 136:
if value:find(tag, nil, true) then
if text and self:Clean(text):find(search, nil, true) then

The same should be done in LibItemSearch-1.2 (sorry for including it here, but there is no issue tracker for LibItemSearch), on line 109:
if name:find(search, nil, true) then

commented

I'll look into it. Disabling features is not a solution though.

commented

I guess that's true. I guess I never really thought anyone needed to be able to include patterns in their search string.

commented

I only just now realized that pattern matching is used when using searches like "s:SetName" and stuff like that. I feel silly suggesting to remove that, sorry :P