Menu

#11 PR field not separated properly

default
closed-fixed
rpcme
None
1
2014-08-15
2007-09-13
Jim Quinlan
No

When a PR contains a string like this (I've indented the string by four spaces please ignore this):

>Comments: our customer freaked out
blah blah blah and then he said
> I won't take this any longer!

The ">Comments:" is a legal field, but the "> I wont" will be used in a split.

An even worse example:

>From: dan.draper@madmen.com
>To: all@madmen.com
I really like this jingle!

When these strings are parsed by Gnats::PR::setFromString(), it gets confused as it splits on /^>/m. A better approach would be to split on
/^>([^:\s\r\t]):/, and then iterate through the resulting array using alternating entries as the field keys.

An even better solution would first probe the PR for the list of legal fields and use that to form a the splitting regexp.

JimQ

Discussion

  • rpcme

    rpcme - 2014-08-15

    Verified this is issue and test has been added: t/regress_11.t.

    Note the problem is far worse than noted in the filing - whole multiline blocks can be disregarded.

     
  • rpcme

    rpcme - 2014-08-15
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,4 +1,3 @@
    -
     When a PR contains a string like this \(I've indented the string by four spaces please ignore this\):
    
     >Comments: our customer freaked out
    
    • assigned_to: thacker
    • Group: --> default
    • Priority: 5 --> 1
     
  • rpcme

    rpcme - 2014-08-15

    I have fixed this issue by rewriting the parse routine. There were several oversights in both Net::Gnats::PR and gnatsweb where the code was originally derived.

     
  • rpcme

    rpcme - 2014-08-15
    • status: open --> closed-fixed
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.