[Freeipa-devel] [PATCH] 280 Fixed problem displaying special characters.

Petr Vobornik pvoborni at redhat.com
Fri Sep 23 11:51:15 UTC 2011


On 09/20/2011 08:35 PM, Endi Sukma Dewata wrote:
> Some jQuery objects in various locations have been modified to use
> text() to show values obtained from the server (except messages).
> The text() will automatically encode special characters.
>
> Ticket #1798


I don't like the change in entity.js. Adding element simply because of 
encoding string is wrong.

IMO this would be better:
that.path.append(IPA.html_encode(value));

IPA.html_encode = function(value) {
     if(value) {
         return $('<div/>').text(value).html();
     } else {
         return '';
     }
}

IPA.html_decode = function (value) {
     if(value) {
         return $('<div/>').html(value).text();
     } else {
         return '';
     }
}

-- 
Petr Vobornik




More information about the Freeipa-devel mailing list