forked from your-land-mirror/yl_speak_up
ignore leading/tailing whitespaces when checking password
This commit is contained in:
parent
827020d167
commit
cea602230f
@ -565,8 +565,9 @@ yl_speak_up.input_fs_action_text_input = function(player, formname, fields)
|
|||||||
end
|
end
|
||||||
if(fields.finished_action and fields.quest_answer and fields.quest_answer ~= "") then
|
if(fields.finished_action and fields.quest_answer and fields.quest_answer ~= "") then
|
||||||
-- is the answer correct?
|
-- is the answer correct?
|
||||||
-- TODO: strip leading and tailing blanks?
|
-- strip leading and tailing blanks
|
||||||
local success = not(not(fields.quest_answer and fields.quest_answer == a.a_value))
|
local success = not(not(fields.quest_answer and a.a_value
|
||||||
|
and fields.quest_answer:trim() == a.a_value:trim()))
|
||||||
-- the action was a either a success or failure
|
-- the action was a either a success or failure
|
||||||
yl_speak_up.execute_next_action(player, a_id, success)
|
yl_speak_up.execute_next_action(player, a_id, success)
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user