When a URL parameter with value 0 is passed into getScriptUrl, it is incorrectly removed.
The following diff corrects this, but 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 ) {
I do not have a 5.x installation to be able to validate the correctness of this fix, but it works on 4.3.1.
--
TWiki:Main/ThomasWeigert
- 2011-03-09
Thanks Thomas, confirmed.
I fixed it with slightly different syntax for trunk and TWiki-5.0 branch:
--- TWiki.pm (revision 21881)
+++ TWiki.pm (working copy)
@@ -1163,7 +1163,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 ) {
--
TWiki:Main.PeterThoeny
- 2011-08-05