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