parser for sherlock plugins misreads 'value' quite badly



19 years ago
10 years ago


(Reporter: puetzk, Assigned: mozilla)


Firefox Tracking Flags

(Not tracked)



(1 attachment)



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

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.

Comment 1

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

Comment 2

19 years ago
adding rjc on leaf's recommendation.

Comment 3

19 years ago
reassign to rjc
Assignee: matt → rjc

Comment 4

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

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

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).

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:

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

Comment 7

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

Comment 8

19 years ago, does this work for you now?

Comment 9

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