- Ported a missing Drupal 6.1 security fix.

merge-requests/26/head
Dries Buytaert 2008-03-23 14:55:26 +00:00
parent eafa931272
commit a01deb1b1a
1 changed files with 2 additions and 1 deletions

View File

@ -51,7 +51,8 @@ Drupal.checkPlain = function(str) {
str = String(str);
var replace = { '&': '&amp;', '"': '&quot;', '<': '&lt;', '>': '&gt;' };
for (var character in replace) {
str = str.replace(character, replace[character]);
var regex = new RegExp(character, 'g');
str = str.replace(regex, replace[character]);
}
return str;
};