Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 335499

Summary: [Webapp] Search result title from search processor escaped incorrectly
Product: [Eclipse Project] Platform Reporter: Chris Goldthorpe <cgold>
Component: User AssistanceAssignee: Chris Goldthorpe <cgold>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.7   
Target Milestone: 3.7 M6   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Search client java class illustrating the problem
none
Patch none

Description Chris Goldthorpe CLA 2011-01-26 14:25:26 EST
I20110118-0800

If the searchClient extension point is used and the title of a search hit returns a double quote ( Search bugzilla "plugin" ) that title displays correctly in the help view but in the webapp it appears as 	Search bugzilla forquot;plugin"
Comment 1 Chris Goldthorpe CLA 2011-01-26 14:26:59 EST
Created attachment 187672 [details]
Search client java class illustrating the problem
Comment 2 Chris Goldthorpe CLA 2011-02-10 13:45:38 EST
I think this bug is unrelated to the searchClient extension and has always existed for titles containing characters that require escaping. I will look into it.
Comment 3 Chris Goldthorpe CLA 2011-02-10 14:51:31 EST
The problem only exists for potential results, and is caused by code in ServletResources which is stripping the first ampersand from the result string, this is apparently to remove keyboard accelerators although I'm not sure why those accelerators are in WebappResources.properties. For example 

SearchLabel=&Search:

Since the translations of the property files probably also contain the accelerators the best fix would be to strip the ampersands from the string that come from resources before variable substitution.
Comment 4 Chris Goldthorpe CLA 2011-02-10 15:06:44 EST
Created attachment 188721 [details]
Patch

I can see how the accelerators are intended to work. The only resources containing accelerators have no substitution parameters so the fix is to remove the code that strips out the first ampersand from the methods that return a resource which has parameter substitution.
Comment 5 Chris Goldthorpe CLA 2011-02-10 15:08:34 EST
Patch applied to HEAD, Fixed