added quoting for blizzard name queries

This commit is contained in:
Manuel Simon Hirsig
2016-08-02 08:00:06 +02:00
parent f04723bc33
commit 7b3aedd206
2 changed files with 11 additions and 3 deletions
+6 -2
View File
@@ -757,7 +757,7 @@ function private.get_form()
query_string = query_string == '' and part or query_string..'/'..part
end
add(m.name_input:GetText())
add('"'..m.name_input:GetText()..'"')
if m.exact_checkbox:GetChecked() then
add('exact')
@@ -807,7 +807,11 @@ function private.set_form(components)
for _, filter in components.blizzard do
if filter[1] == 'name' then
m.name_input:SetText(filter[2])
local name = filter[2]
if name and strsub(name, 1, 1) == '"' and strsub(name, -1, -1) == '"' then
name = strsub(name, 2, -2)
end
m.name_input:SetText(name)
elseif filter[1] == 'exact' then
m.exact_checkbox:SetChecked(true)
elseif filter[1] == 'min_level' then
+5 -1
View File
@@ -628,7 +628,11 @@ function private.blizzard_query(components)
filters[filter[1]] = filter[2] or true
end
local query = { name=filters.name }
local name = filters.name
if name and strsub(name, 1, 1) == '"' and strsub(name, -1, -1) == '"' then
name = strsub(name, 2, -2)
end
local query = { name=name }
local item_info, class_index, subclass_index, slot_index
if filters.exact then