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

People
Owner: MARKSTOS [...] cpan.org
Requestors: heiko [...] wecos.de
Cc:
AdminCc:

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



Subject: undefined user_agent cause warning message
Download (untitled) / with headers
text/plain 222b
Normally I expect that the user_agent is always set, but last weeks I often see warnings about an undefined value in pattern match with user_agent. So I changed the small function to ensure user_agent is set. Cheers Heiko
Subject: user_agent_patch.txt
*** /usr/local/lib/perl5/site_perl/5.8.8/CGI.pm.orig Thu Aug 30 15:37:38 2007 --- /usr/local/lib/perl5/site_perl/5.8.8/CGI.pm Thu Aug 30 15:46:59 2007 *************** *** 2970,2977 **** 'user_agent' => <<'END_OF_FUNC', sub user_agent { my($self,$match)=self_or_CGI(@_); ! return $self->http('user_agent') unless $match; ! return $self->http('user_agent') =~ /$match/i; } END_OF_FUNC --- 2970,2978 ---- 'user_agent' => <<'END_OF_FUNC', sub user_agent { my($self,$match)=self_or_CGI(@_); ! my $user_agent = $self->http('user_agent'); ! return $user_agent unless $match && $user_agent; ! return $user_agent =~ /$match/i; } END_OF_FUNC
Download (untitled) / with headers
text/plain 441b
On Thu Aug 30 09:55:08 2007, http://wecos.pip.verisignlabs.com/ wrote: Show quoted text
> Normally I expect that the user_agent is always set, but last weeks I > often see warnings about an undefined value in pattern match with > user_agent. So I changed the small function to ensure user_agent is set.
Heiko, Thanks for the patch. I see that it has not been applied as of the 3.43 release. I recommend that your patch be accepted and released. Mark
Download (untitled) / with headers
text/plain 115b
Thanks for the patch. I've added some related automated tests for it and committed the result to our new git repo.
Subject: released, thanks.
I believe this change was released today as part of CGI.pm 3.45. Thanks for the contribution.


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

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.