Fix case where str is not present

This commit is contained in:
bfederle 2012-03-14 11:51:04 -07:00
parent 2e1726cb5f
commit 8e4ed4bfaf
1 changed files with 2 additions and 0 deletions

View File

@ -61,6 +61,8 @@
* Strip unwanted characters from user-based input
*/
cloudStack.sanitize = window._s = function(str) {
if (!str) return '';
var sanitized = str
.replace(/&/g, "&")
.replace(/</g, "&lt;")