Module: tools Branch: master Commit: 0044e4eda7fdbc8fdba23f341d8a79b7a5b12535 URL: https://source.winehq.org/git/tools.git/?a=commit;h=0044e4eda7fdbc8fdba23f34...
Author: Francois Gouget fgouget@codeweavers.com Date: Tue Mar 29 17:57:39 2022 +0200
testbot/cgi: Fix handling of '0' in text fields.
'0' should be set as the field's initial value even though it evaluates to false.
Signed-off-by: Francois Gouget fgouget@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
testbot/lib/ObjectModel/CGI/FormPage.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/testbot/lib/ObjectModel/CGI/FormPage.pm b/testbot/lib/ObjectModel/CGI/FormPage.pm index 83b078b..f47d628 100644 --- a/testbot/lib/ObjectModel/CGI/FormPage.pm +++ b/testbot/lib/ObjectModel/CGI/FormPage.pm @@ -300,7 +300,7 @@ sub GenerateField($$$) print "50' rows='", int(($MaxLength + 49) / 50); } print "'>"; - if ($Value) + if (defined $Value) { print $self->CGI->escapeHTML($Value), "'"; } @@ -313,7 +313,7 @@ sub GenerateField($$$) $Size=45 if ($Size > 45); print "<input type='$InputType' name='", $PropertyDescriptor->GetName(), "' maxlength='", $PropertyDescriptor->GetMaxLength(), "' size='$Size'"; - if ($Value && $InputType ne "password") + if (defined $Value && $InputType ne "password") { print " value='", $self->CGI->escapeHTML($Value), "'"; }