test for undefined
This commit is contained in:
parent
65c070d6b6
commit
5086c5da90
1 changed files with 2 additions and 1 deletions
|
@ -243,7 +243,8 @@ Ox.encodeHTML <f> HTML-encodes a string
|
|||
'äbçdê'
|
||||
@*/
|
||||
Ox.encodeHTML = function(string) {
|
||||
return Ox.map(string.toString(), function(char) {
|
||||
string = Ox.isUndefined(string) ? '' : string.toString();
|
||||
return Ox.map(string, function(char) {
|
||||
var code = char.charCodeAt(0);
|
||||
return code < 128
|
||||
? (char in Ox.HTML_ENTITIES ? Ox.HTML_ENTITIES[char] : char)
|
||||
|
|
Loading…
Reference in a new issue