parser for sherlock plugins misreads 'value' quite badly

VERIFIED FIXED

Status

P3
normal
VERIFIED FIXED
19 years ago
10 years ago

People

(Reporter: puetzk, Assigned: mozilla)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

19 years ago
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux 2.2.14 ppc; en-US; m15)
BuildID:

I came across this when trying to write a sherlock plugin for bugzilla (which
sends fields like showbugs.cgi?...&value0-0-0=word&...

Reproducible: Always
Steps to Reproduce:
The following lines exhibit a fairly severe parser error.

<INPUT NAME="string" user> works fine
<INPUT NAME="field0-0-0" VALUE="short_desc"> does too
<INPUT NAME="value" user> fails, no matter what quoting is used, and does not
put itself in the search query

the problem is causd by a shortcut taken to parsing on line 3597 of
mozilla/xpfe/components/search/src/nsInternetSearchService, which looks like

PRInt32	valueOffset = line.Find("value", PR_TRUE);

this is not an acceptable way to look for a value="" property, as it trips badly
on the beforementioned case where a field is named value, has a property avalue,
and many others. This needs to be using a real XML parser I think, as much as a
nuisance as that might be to do.
(Reporter)

Comment 1

19 years ago
Created attachment 7980 [details]
beginnings of a bugzilla sherlock plugin, exhibits this behavior
(Reporter)

Comment 2

19 years ago
adding rjc on leaf's recommendation.

Comment 3

19 years ago
reassign to rjc
Assignee: matt → rjc
(Assignee)

Comment 4

19 years ago
>  This needs to be using a real XML parser...


Ah, if only Sherlock files were XML.  :^)
(Reporter)

Comment 5

19 years ago
hmm... I guess you're right, they're not quite XML just similar - darn. I was
thinking they were. Well then, this is probably going to suck to fix :-(

a hack-solution that would help a lot might be to look for whitespace followed
by "value" followed by only whitespace followed by '='. That would be far less
likely to fail... it would at least make it possible for me to write a bugzilla
plugin (which is when I found this).
(Assignee)

Comment 6

19 years ago
No cause for concern, this is easy to fix.  :^)

However, if you want a Sherlock file for Bugzilla, I've already created one... 
just go to:

    http://tinderbox.mozilla.org/showbuilds.cgi?tree=SeaMonkey&nocrap=1

and click on the "Bugzilla" link in the "News" section to install it.
(Assignee)

Comment 7

19 years ago
Fix checked in.
Status: NEW → RESOLVED
Last Resolved: 19 years ago
Resolution: --- → FIXED

Comment 8

19 years ago
puetzk@iastate.edu, does this work for you now?
(Reporter)

Comment 9

19 years ago
verified, thanks rjc!
Status: RESOLVED → VERIFIED
Product: Core → SeaMonkey
You need to log in before you can comment on or make changes to this bug.