From 1fb519c053ba24fa76a2a527b4d2c74b0f198e66 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Fri, 28 Aug 2020 14:17:45 +0300 Subject: DocumentWidget: Fixed submission of user input --- src/ui/documentwidget.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c index 77733f88..1c8a51c9 100644 --- a/src/ui/documentwidget.c +++ b/src/ui/documentwidget.c @@ -1102,18 +1102,16 @@ static iBool handleCommand_DocumentWidget_(iDocumentWidget *d, const char *cmd) return iTrue; } else if (equal_Command(cmd, "document.input.submit")) { - if (arg_Command(cmd)) { - iString *value = collect_String(suffix_Command(cmd, "value")); - urlEncode_String(value); - iString *url = collect_String(copy_String(d->mod.url)); - const size_t qPos = indexOfCStr_String(url, "?"); - if (qPos != iInvalidPos) { - remove_Block(&url->chars, qPos, iInvalidSize); - } - appendCStr_String(url, "?"); - append_String(url, value); - postCommandf_App("open url:%s", cstr_String(url)); + iString *value = collect_String(suffix_Command(cmd, "value")); + urlEncode_String(value); + iString *url = collect_String(copy_String(d->mod.url)); + const size_t qPos = indexOfCStr_String(url, "?"); + if (qPos != iInvalidPos) { + remove_Block(&url->chars, qPos, iInvalidSize); } + appendCStr_String(url, "?"); + append_String(url, value); + postCommandf_App("open url:%s", cstr_String(url)); return iTrue; } else if (equal_Command(cmd, "valueinput.cancelled") && -- cgit v1.2.3