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: 43587
Status: resolved
Priority: 0/
Queue: CGI

People
Owner: MARKSTOS [...] cpan.org
Requestors: bkerin [...] fastmail.fm
Cc:
AdminCc:

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



Subject: url_param() can return true even when no url parameters (unlike param())
Date: Tue, 24 Feb 2009 12:26:16 -0900
To: bug-CGI.pm [...] rt.cpan.org
From: "Britton Kerin" <bkerin [...] fastmail.fm>
The standard idiom that even shows up in the synopsis example tells you to use if ( param() ) { ... to find out if you have parameters. The section that describes url_param() says: To retrieve URL parameters, call the url_param() method. Use it in the same way as param(). The main difference is that it allows you to read the parameters, but not set them. But it seems that url_param() will return true even when there are not ?foo=bar style thingies given in the URL. Even if its expected for some reason that it returns true I think it deserves a doc mention. Britton
I'm in favor of updating this to follow the documentation and be consistent with the behavior of param(). Please submit a test and patch to that effect. Mark On Tue Feb 24 16:28:48 2009, bkerin@fastmail.fm wrote: Show quoted text
> > The standard idiom that even shows up in the synopsis example tells > you to use > > if ( param() ) { ... > > to find out if you have parameters. The section that describes > url_param() says: > > To retrieve URL parameters, call the url_param() method. Use it in > the > same way as param(). The main difference is that it allows you to > read > the parameters, but not set them. > > But it seems that url_param() will return true even when there are not > ?foo=bar style thingies given in the URL. Even if its expected for some > reason that it returns true I think it deserves a doc mention. > > Britton > >
Subject: Re: [rt.cpan.org #43587] url_param() can return true even when no url parameters (unlike param())
Date: Mon, 20 Jul 2009 10:29:22 -0800
To: "MARKSTOS via RT" <bug-CGI.pm [...] rt.cpan.org>
From: "Britton Kerin" <bkerin [...] fastmail.fm>
I'll try to get a patch together for this and my other reports. It probably won't happen right away though. Britton On Sun, 19 Jul 2009 21:28 -0400, "MARKSTOS via RT" <bug-CGI.pm@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=43587 > > > I'm in favor of updating this to follow the documentation and be > consistent with the behavior of param(). Please submit a test and patch > to that effect. > > Mark > > > On Tue Feb 24 16:28:48 2009, bkerin@fastmail.fm wrote:
> > > > The standard idiom that even shows up in the synopsis example tells > > you to use > > > > if ( param() ) { ... > > > > to find out if you have parameters. The section that describes > > url_param() says: > > > > To retrieve URL parameters, call the url_param() method. Use it in > > the > > same way as param(). The main difference is that it allows you to > > read > > the parameters, but not set them. > > > > But it seems that url_param() will return true even when there are not > > ?foo=bar style thingies given in the URL. Even if its expected for some > > reason that it returns true I think it deserves a doc mention. > > > > Britton > > > >
> > >
Thanks, This has been patched in my github repo now, and should appear in the next release with credit to you.
Subject: Thanks, released
The patch for this ticket has now been released in CGI.pm 3.47, and this ticket is considered resolved. Thanks again for you help to improve CGI.pm! Mark