[Rt-commit] r6255 - rt/branches/3.7-EXPERIMENTAL/html/Elements

ruz at bestpractical.com ruz at bestpractical.com
Tue Oct 24 17:45:40 EDT 2006


Author: ruz
Date: Tue Oct 24 17:45:39 2006
New Revision: 6255

Modified:
   rt/branches/3.7-EXPERIMENTAL/html/Elements/QueryString

Log:
* key part MUST be escaped too
* drop useless code branch
* style

Modified: rt/branches/3.7-EXPERIMENTAL/html/Elements/QueryString
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/Elements/QueryString	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/Elements/QueryString	Tue Oct 24 17:45:39 2006
@@ -43,20 +43,18 @@
 %# those contributions and any derivatives thereof.
 %# 
 %# END BPS TAGGED BLOCK }}}
-<%init>
+<%INIT>
 my @params;
-while ( my ($key, $value) = each %ARGS ){
+while ( my ($key, $value) = each %ARGS ) {
     next unless defined $value;
+    $key = $m->interp->apply_escapes( $key, 'u' );
     if( UNIVERSAL::isa( $value, 'ARRAY' ) ) {
-	push @params, map $key."=".$m->interp->apply_escapes($_,'u'), @$value;
+        push @params,
+            map $key ."=". $m->interp->apply_escapes( $_, 'u' ),
+                @$value;
     } else {
-  if (ref $value eq "ARRAY") {
-    push @params, $key."=".$m->interp->apply_escapes($_, 'u')
-      for @{$value};
-  } else {
-    push @params, $key."=".$m->interp->apply_escapes($value,'u');
-  }
+        push @params, $key ."=". $m->interp->apply_escapes($value, 'u');
     }
 }
-return(join('&', at params));
-</%init>
+return join '&', @params;
+</%INIT>


More information about the Rt-commit mailing list