From ba3eedf4a7d3fc73574fe015e947c043b30f27dd Mon Sep 17 00:00:00 2001 From: Martin Kamerbeek Date: Fri, 30 Mar 2007 10:51:27 +0000 Subject: [PATCH] Fixed a bug where WG::Sess:Form->param would return duplicate params --- docs/changelog/7.x.x.txt | 2 ++ lib/WebGUI/Session/Form.pm | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 885d5cb63..dfea0627d 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -20,6 +20,8 @@ http://www.plainblack.com/bugs/tracker/clear-login-history-period-is-calculated-24-times-longer-if-it-is-set-in-months#VomZpVCroSN6WoQ-UYo7Xw - fix: SQLForm - cannot add new asset (revisited) (thanks to Joek Hondius) http://www.plainblack.com/bugs/tracker/sqlform---cannot-add-new-asset-revisited#barqLwFe3LPODb4Mksc6ZA + - fix: Fixed a bug where $session->form->param() would return params twice. + (Martin Kamerbeek / Oqapi) 7.3.13 - fix: Stale pages after user login diff --git a/lib/WebGUI/Session/Form.pm b/lib/WebGUI/Session/Form.pm index b5c2b085e..808f54dfb 100644 --- a/lib/WebGUI/Session/Form.pm +++ b/lib/WebGUI/Session/Form.pm @@ -143,14 +143,14 @@ sub param { } } else { if ($self->session->request) { - my @params = (); + my %params = (); foreach ($self->session->request->param) { - push(@params, $_); + $params{$_} = 1; } foreach ($self->session->request->body) { - push(@params, $_); + $params{$_} = 1; } - return @params; + return keys %params; } else { return undef; }