removed use of strip_tags and using String library instead

This commit is contained in:
Julian Lam
2013-12-26 21:10:26 -05:00
parent 2c6bf93eb5
commit b52782deb8
9 changed files with 15 additions and 31 deletions

View File

@@ -123,18 +123,6 @@
isPasswordValid: function(password) {
return password && password.indexOf(' ') === -1;
},
// Blatently stolen from: http://phpjs.org/functions/strip_tags/
'strip_tags': function(input, allowed) {
allowed = (((allowed || "") + "").toLowerCase().match(/<[a-z][a-z0-9]*>/g) || []).join(''); // making sure the allowed arg is a string containing only tags in lowercase (<a><b><c>)
var tags = /<\/?([a-z][a-z0-9]*)\b[^>]*>/gi,
commentsAndPhpTags = /<!--[\s\S]*?-->|<\?(?:php)?[\s\S]*?\?>/gi;
return input.replace(commentsAndPhpTags, '').replace(tags, function($0, $1) {
return allowed.indexOf('<' + $1.toLowerCase() + '>') > -1 ? $0 : '';
});
},
buildMetaTags: function(tagsArr) {
var tags = '',
tag;