diff --git a/script/utils.js b/script/utils.js index f5bff40..fff03c0 100644 --- a/script/utils.js +++ b/script/utils.js @@ -1,6 +1,9 @@ function gEncodeToHTML(str) { + if (typeof str !== 'string') + return str; + return str.replace(/&/g, '&') .replace(//g, '>') @@ -10,6 +13,9 @@ function gEncodeToHTML(str) function gDecodeFromHTML(str) { + if (typeof str !== 'string') + return str; + return str.replace(/'/g, "'") .replace(/"/g, '"') .replace(/>/g, '>') diff --git a/tpl/home.php b/tpl/home.php index cf34569..db3d541 100755 --- a/tpl/home.php +++ b/tpl/home.php @@ -10,7 +10,7 @@ - +