Bug 217363: bookmark keywords ending in space or containing spaces aren't recognized when used with search terms (smart keywords), patch by Adam Guthrie <ispiked@gmail.com>, r=mconnor

git-svn-id: svn://10.0.0.236/trunk@200207 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
gavin%gavinsharp.com 2006-06-17 21:33:26 +00:00
parent a919f5f05b
commit 5609ce459f

View File

@ -179,9 +179,12 @@ function Commit()
if (oldValue)
oldValue = oldValue.QueryInterface(Components.interfaces.nsIRDFLiteral);
if (newValue && gFields[i] == "shortcut")
if (newValue && gFields[i] == "shortcut") {
// shortcuts are always lowercased internally
newValue = newValue.toLowerCase();
// strip trailing and leading whitespace
newValue = newValue.replace(/(^\s+|\s+$)/g, '');
}
else if (newValue && gFields[i] == "url") {
if (newValue.indexOf(":") < 0)
// we're dealing with the URL attribute;