Fix handling of accents when filtering contacts

Fixes #2656
pull/30/head
Francis Lachapelle 2014-03-20 15:29:32 -04:00
parent 893d75bd5f
commit 27ffcf240f
3 changed files with 15 additions and 16 deletions

1
NEWS
View File

@ -17,6 +17,7 @@ Bug fixes
- disabled ActiveSync provisioning for now (#2663) - disabled ActiveSync provisioning for now (#2663)
- fixed messages move in Outlook which would create duplicates (#2650) - fixed messages move in Outlook which would create duplicates (#2650)
- fixed translations for OtherUsersFolderName and SharedFoldersName folders (#2657) - fixed translations for OtherUsersFolderName and SharedFoldersName folders (#2657)
- fixed handling of accentuated characters when filtering contacts (#2656)
2.2.1 (2014-03-07) 2.2.1 (2014-03-07)
------------------ ------------------

View File

@ -146,7 +146,7 @@
{ {
currentInfo = [currentContactDictionary objectForKey: key]; currentInfo = [currentContactDictionary objectForKey: key];
if ([currentInfo respondsToSelector: @selector (stringByEscapingHTMLString)]) if ([currentInfo respondsToSelector: @selector (stringByEscapingHTMLString)])
[currentContactDictionary setObject: [currentInfo stringByEscapingHTMLString] forKey: key]; [currentContactDictionary setObject: currentInfo forKey: key];
} }
[newContactsList addObject: currentContactDictionary]; [newContactsList addObject: currentContactDictionary];
} }

View File

@ -76,14 +76,14 @@ function contactsListCallback(http) {
row.setAttribute("categories", contact["c_categories"]); row.setAttribute("categories", contact["c_categories"]);
row.setAttribute("contactname", contact["c_cn"]); row.setAttribute("contactname", contact["c_cn"]);
var cells = row.getElementsByTagName("TD"); var cells = row.getElementsByTagName("TD");
$(cells[0]).update(contact["c_cn"]); $(cells[0]).update(contact["c_cn"].escapeHTML());
cells[0].title = contact["c_cn"]; cells[0].title = contact["c_cn"];
$(cells[1]).update(contact["c_mail"]); $(cells[1]).update(contact["c_mail"].escapeHTML());
cells[1].title = contact["c_mail"]; cells[1].title = contact["c_mail"];
if (fullView) { if (fullView) {
$(cells[2]).update(contact["c_screenname"]); $(cells[2]).update(contact["c_screenname"].escapeHTML());
$(cells[3]).update(contact["c_o"]); $(cells[3]).update(contact["c_o"].escapeHTML());
$(cells[4]).update(contact["c_telephonenumber"]); $(cells[4]).update(contact["c_telephonenumber"].escapeHTML());
} }
} }
@ -103,13 +103,13 @@ function contactsListCallback(http) {
null, null,
null, null,
row); row);
cell.update(contact["c_cn"]); cell.update(contact["c_cn"].escapeHTML());
cell.title = contact["c_cn"]; cell.title = contact["c_cn"];
cell = document.createElement("td"); cell = document.createElement("td");
row.appendChild(cell); row.appendChild(cell);
if (contact["c_mail"]) { if (contact["c_mail"]) {
cell.update(contact["c_mail"]); cell.update(contact["c_mail"].escapeHTML());
cell.title = contact["c_mail"]; cell.title = contact["c_mail"];
} }
@ -117,17 +117,17 @@ function contactsListCallback(http) {
cell = document.createElement("td"); cell = document.createElement("td");
row.appendChild(cell); row.appendChild(cell);
if (contact["c_screenname"]) if (contact["c_screenname"])
cell.update(contact["c_screenname"]); cell.update(contact["c_screenname"].escapeHTML());
cell = document.createElement("td"); cell = document.createElement("td");
row.appendChild(cell); row.appendChild(cell);
if (contact["c_o"]) if (contact["c_o"])
cell.update(contact["c_o"]); cell.update(contact["c_o"].escapeHTML());
cell = document.createElement("td"); cell = document.createElement("td");
row.appendChild(cell); row.appendChild(cell);
if (contact["c_telephonenumber"]) if (contact["c_telephonenumber"])
cell.update(contact["c_telephonenumber"]); cell.update(contact["c_telephonenumber"].escapeHTML());
} }
} }
} }
@ -642,15 +642,13 @@ function onConfirmContactSelection(event) {
var rows = contactsList.getSelectedRows(); var rows = contactsList.getSelectedRows();
for (i = 0; i < rows.length; i++) { for (i = 0; i < rows.length; i++) {
var cid = rows[i].getAttribute("id"); var cid = rows[i].getAttribute("id");
if (cid.endsWith (".vlf")) { if (cid.endsWith(".vlf")) {
addListToOpener (tag, Contact.currentAddressBook, addListToOpener(tag, Contact.currentAddressBook, currentAddressBookName, cid);
currentAddressBookName, cid);
} }
else { else {
var cname = '' + rows[i].readAttribute("contactname"); var cname = '' + rows[i].readAttribute("contactname");
var email = '' + rows[i].cells[1].innerHTML; var email = '' + rows[i].cells[1].innerHTML;
addContact(tag, currentAddressBookName + '/' + cname, addContact(tag, currentAddressBookName + '/' + cname, cid, cname, email);
cid, cname, email);
} }
} }