Skip Menu |
 

This queue is for tickets about the Search-QueryParser CPAN distribution.

Report information
The Basics
Id: 52814
Status: new
Priority: 0/
Queue: Search-QueryParser

People
Owner: Nobody in particular
Requestors: larryl [...] cpan.org
Cc:
AdminCc:

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

Attachments


Subject: parse does not fail on query with mismatched close paren
MIME-Version: 1.0
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Charset: utf8
X-RT-Original-Encoding: utf-8
Content-Type: multipart/mixed; boundary="----------=_1260925230-13597-185"
Content-Length: 0
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: binary
Content-Length: 392
Download (untitled) / with headers
text/plain 392b
Using Search::QueryParser 0.94 and Perl 5.8.8. The "parse" method does not fail when given a query that has an unmatched closing parenthesis. The closing parenthesis and anything after it are silently ignored. E.g. this query: foo bar) this is ignored will unparse into: :foo :bar The attached patch will sets the error string and returns undef if this error condition occurs.
Subject: QueryParser.pm.0.94-patch.txt
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="----------=_1260925230-13597-184"
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Charset: utf8
Content-Length: 0
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: iso-8859-1
Content-Length: 0
Content-Type: text/plain; charset="utf-8"; name="QueryParser.pm.0.94-patch.txt"
Content-Disposition: inline; filename="QueryParser.pm.0.94-patch.txt"
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: ascii
Content-Length: 716
*** QueryParser.pm.0.94 2009-12-15 17:38:36.000000000 -0700 --- QueryParser.pm 2009-12-15 17:47:10.000000000 -0700 *************** *** 343,349 **** ! sub parse { return (_parse(@_))[0]; } # just return 1st result from _parse sub _parse{ # returns ($parsedQuery, $restOfString) my $self = shift; --- 343,360 ---- ! sub parse { ! my $s_orig = $_[1]; ! my ($parsedQuery, $restOfString) = _parse(@_); ! if ($restOfString) { ! $self->{err} = "[$s_orig] : unable to parse entire query:" ! . " [$restOfString]"; ! return undef; ! } ! else { ! return $parsedQuery; ! } ! } sub _parse{ # returns ($parsedQuery, $restOfString) my $self = shift;


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.