From 262fc0bf62ff89f2c9be8f39be8e96adb90b2948 Mon Sep 17 00:00:00 2001 From: Koni Weber Date: Tue, 25 Sep 2007 15:31:20 +0000 Subject: Q() does not fail on quoting undefined values (same behaviour as php) --- itjs/it.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'itjs/it.js') diff --git a/itjs/it.js b/itjs/it.js index 4daf2c0..a43ba3a 100644 --- a/itjs/it.js +++ b/itjs/it.js @@ -58,7 +58,7 @@ function ED() */ function Q(value) { - return value.toString().replace(/&/g, '&').replace(/"/g, '"').replace(//g, '>'); + return typeof value == "undefined" ? "" : value.toString().replace(/&/g, '&').replace(/"/g, '"').replace(//g, '>'); } /** -- cgit v1.2.3