Wrong parsing of email_in emails if some @field has no data

RESOLVED FIXED in Bugzilla 3.6

Status

()

Bugzilla
Incoming Email
--
minor
RESOLVED FIXED
8 years ago
8 years ago

People

(Reporter: Frédéric Buclin, Assigned: Frédéric Buclin)

Tracking

({regression})

Bugzilla 3.6
regression
Bug Flags:
approval +
approval4.0 +
approval3.6 +

Details

Attachments

(1 attachment)

696 bytes, patch
Max Kanat-Alexander
: review+
Details | Diff | Splinter Review
(Assignee)

Description

8 years ago
If you leave @groups empty (to skip default groups) as below...

@product Test1
@component comp1
@version 1.3
@groups

...  email_in.pl complains that:
"There is no version named '1.3 @groups' in the 'Test1' product."

If I type |@groups =| (I added "="), then the parsing is fine. As "=" is optional since bug 526158, we should parse such cases correctly.
(Assignee)

Comment 1

8 years ago
The problem comes from line 110:

if ($line =~ /^\@(\S+)\s*(?:=|\s)\s*(.*)\s*/)

If you simply pass @foo, it's appended to the previous field, because it doesn't match the regexp.

Comment 2

8 years ago
Ahh, probably putting a * after the = stuff and a +? on the \S would fix it.
(Assignee)

Comment 3

8 years ago
Created attachment 461921 [details] [diff] [review]
patch, v1

Also catch ^\@\S+\s*$
Assignee: incoming.email → LpSolit
Status: NEW → ASSIGNED
Attachment #461921 - Flags: review?(mkanat)

Updated

8 years ago
Summary: Wrong parsing if @foo has no data → Wrong parsing of email_in emails if some @field has no data

Comment 4

8 years ago
Comment on attachment 461921 [details] [diff] [review]
patch, v1

Ah yeah, that's a simple, clever solution. :-)
Attachment #461921 - Flags: review?(mkanat) → review+

Updated

8 years ago
Flags: approval4.0+
Flags: approval3.6+
Flags: approval+
(Assignee)

Comment 5

8 years ago
Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/trunk/
modified email_in.pl
Committed revision 7410.

Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/4.0/
modified email_in.pl
Committed revision 7354.

Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/3.6/
modified email_in.pl
Committed revision 7149.
Status: ASSIGNED → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.