Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the CGI CPAN distribution.

Report information
The Basics
Id: 75120
Status: resolved
Priority: 0/
Queue: CGI

Owner: Nobody in particular
Requestors: dynot [...] JUNKMAIL.ATH.CX

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: (no value)

Subject: '+' converted to space in POST/GET
Download (untitled) / with headers
text/plain 429b
For a simple program like this (named #!/usr/bin/perl -w use strict; use CGI; my $cgi = new CGI; print $cgi->param('a'); All plus characters are converted to spaces: ./ 'a=1+2' 1 2 Same happens if I try it with a POST or GET request. The 9 year old bug returned: (perl v5.12.4 built for i486-linux-gnu-thread-multi-64int) Tried in CGI v3.43 and v3.49
Subject: Re: [ #75120] '+' converted to space in POST/GET
Date: Mon, 20 Feb 2012 10:25:32 -0500
To: [...]
From: Mark Stosberg <mark [...]>
Download (untitled) / with headers
text/plain 820b
Show quoted text
> Same happens if I try it with a POST or GET request. The 9 year old bug > returned: > >
This is spec-compliant. You'll find that even more modern tools do this: # Also translates plus to space use Plack::Request; my $r = Plack::Request->new({ QUERY_STRING => 'a=1+2' }); print $r->param('a'); There was a discussion about this in the PHP bug tracker: You'll see that ultimately points back to a spec: On these docs on, you'll also laid out in a table that "Plus indicates a space": You used a reserved character improperly and should encode it to achieve your expected result. Mark

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to