Tags:
create new tag
, view all tags

Feature Proposal: URL parameters with 0 value are not passed properly by getScriptUrl

Motivation

When a URL parameter with value 0 is passed into getScriptUrl, it is incorrectly removed.

Description and Documentation

A parameter with value 0 must be passed on to the selected script.

Examples

Impact

Implementation

This diff is against 4.3.1:

--- lib/TWiki.pm        (revision 146)
+++ lib/TWiki.pm        (working copy)
@@ -1096,7 +1096,9 @@
     if( $p eq '#' ) {
       $anchor .= '#' . shift( @args );
     } else {
-      $ps .= ';' . $p.'='.urlEncode(shift( @args )||'');
+      my $arg = shift( @args );
+      $arg = '' unless defined $arg;
+      $ps .= ';' . $p.'='.urlEncode($arg);
     }
   }
   if( $ps ) {

-- Contributors: ThomasWeigert - 2011-03-07

Discussion

I consider this a bug fix. Could you file a bug report and check it into trunk and 5.0 branch?

-- PeterThoeny - 2011-03-07

Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r2 - 2011-03-07 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.