summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--modules/luci-base/htdocs/luci-static/resources/cbi.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/modules/luci-base/htdocs/luci-static/resources/cbi.js b/modules/luci-base/htdocs/luci-static/resources/cbi.js
index 9200954d1e..324a91403f 100644
--- a/modules/luci-base/htdocs/luci-static/resources/cbi.js
+++ b/modules/luci-base/htdocs/luci-static/resources/cbi.js
@@ -521,9 +521,14 @@ String.prototype.format = function()
var quot_esc = [/"/g, '"', /'/g, '''];
function esc(s, r) {
- if (typeof(s) !== 'string' && !(s instanceof String))
+ var t = typeof(s);
+
+ if (s == null || t === 'object' || t === 'function')
return '';
+ if (t !== 'string')
+ s = String(s);
+
for (var i = 0; i < r.length; i += 2)
s = s.replace(r[i], r[i+1]);