Closed Bug 815221 Opened 12 years ago Closed 11 years ago

Invalid defaultenginename breaks keyword search

Categories

(Firefox :: Search, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: mkaply, Unassigned)

Details

(Whiteboard: [fixed in bug 738818])

Attachments

(1 file)

If browser.search.defaultenginename is set to an invalid engine, and you do a keyword search, you get

"The address isn't valid"

We should protect against an incorrect engine in defaultenginename.
Attached file First pass at a patch
Pressed enter too soon.

This patch changes getOriginalDefaultEngine to do what it's supposed to do - get the original default engine from the default branch.

It changes getDefaultEngine to use the user version of the pref or if that engine doesn't exist (bad engine name), use the default engine.

It changes keywordURIFixup to call getDefaultEngine, not getOriginalDefaultEngine.

It also changes the keyword fixup code to use getDefaultEngine.

The reason the keyword fixup code doesn't use getOriginalDefaultEngine is because when it resets keyword.URL, it will fallback to the current value in defauleenginename, not the original value.

Looking through the code, it appears that there are places where people think originalDefaultSearchEngine should work the way I've coded it in this patch.

http://mxr.mozilla.org/mozilla-central/source/browser/modules/AboutHomeUtils.jsm#21
http://mxr.mozilla.org/mozilla-central/source/mobile/android/chrome/content/browser.js#6530

Although I would argue that about:home should be using getDefaultEngine, so that the page changes to the user's selected engine.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Whiteboard: [fixed in bug 738818]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: