mirror of
https://github.com/WordPress/WordPress.git
synced 2024-09-10 14:48:07 +02:00
Props iandunn, adamsilverstein, sstoqnov, peterwilsoncc Built from https://develop.svn.wordpress.org/trunk@45979 git-svn-id: http://core.svn.wordpress.org/trunk@45790 1a063a9b-81f0-0310-95a4-ce76da25c4cd
1 line
438 B
JavaScript
1 line
438 B
JavaScript
!function(){window.wp=window.wp||{},wp.sanitize={stripTags:function(a){a=a||"";var b=a.replace(/<!--[\s\S]*?(-->|$)/g,"").replace(/<(script|style)[^>]*>[\s\S]*?(<\/\1>|$)/gi,"").replace(/<\/?[a-z][\s\S]*?(>|$)/gi,"");return b!==a?wp.sanitize.stripTags(b):b},stripTagsAndEncodeText:function(a){var b=wp.sanitize.stripTags(a),c=document.createElement("textarea");try{c.textContent=b,b=wp.sanitize.stripTags(c.value)}catch(d){}return b}}}(); |