• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic Item7851 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

Item6890: Multi-value parameters lost during login redirect

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Engine   Normal Closed   patch 5.1.2

Edit Form Data

Summary:
Reported By:
Codebase:
Applies To:
Component:
Priority:
Current State:
Waiting For:
Target Release:
Released In:
 

Detail

If you have a form that submits to the save script, and the form has multi-value parameters such as checkboxes or multi-select, only the first value is passed in case there is a redirect to the login screen, e.g. unauthenticated user.

Cause: The login form has hidden values that pass along all URL parameters. This is done with the help of QUERYPARAMS variable. That variable only took the first value.

Patch:

--- TWiki.pm   (revision 23005)
+++ TWiki.pm   (working copy)
@@ -4120,14 +4120,16 @@
         # clean parameter names of illegal characters
         $name =~ s/['"<>].*//;
         # Issues multi-valued parameters as separate hiddens
-        my $value = $this->{request}->param( $name );
-        if ($encoding) {
-            $value = _encode($encoding, $value);
+        if( $name ) {
+            foreach my $value ( $this->{request}->param( $name ) ) {
+                $value = '' unless defined $value;
+                $value = _encode( $encoding, $value ) if( $encoding );
+                my $entry = $format;
+                $entry =~ s/\$name/$name/g;
+                $entry =~ s/\$value/$value/;
+                push( @list, $entry );
+            }
         }
-        my $entry = $format;
-        $entry =~ s/\$name/$name/g;
-        $entry =~ s/\$value/$value/;
-        push(@list, $entry);
     }
     return expandStandardEscapes(join($separator, @list));
 }

-- TWiki:Main/PeterThoeny - 2012-06-21

ItemTemplate
Summary Multi-value parameters lost during login redirect
ReportedBy TWiki:Main.PeterThoeny
Codebase ~twiki4, 5.1.1
SVN Range TWiki-5.1.1-trunk, Fri, 15 Jun 2012, build 22996
AppliesTo Engine
Component

Priority Normal
CurrentState Closed
WaitingFor

Checkins TWikirev:23006 TWikirev:23007
TargetRelease patch
ReleasedIn 5.1.2
Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r5 - 2012-10-07 - PeterThoeny
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback