summaryrefslogtreecommitdiff
path: root/www/crm/wp-includes/js/wp-sanitize.js
diff options
context:
space:
mode:
authorYaco <franco@reevo.org>2019-10-04 16:03:20 -0300
committerYaco <franco@reevo.org>2019-10-04 16:03:20 -0300
commitac6bedd68a70d744a927494351100e6bfabfe14e (patch)
tree7a9a7967a6244008edbc27055b205d936cb45b02 /www/crm/wp-includes/js/wp-sanitize.js
parentb25b94b8b0aacab5a5a38bb107201c7f92c083ab (diff)
Actualiza WP a 5.2.3
Diffstat (limited to 'www/crm/wp-includes/js/wp-sanitize.js')
-rw-r--r--www/crm/wp-includes/js/wp-sanitize.js20
1 files changed, 15 insertions, 5 deletions
diff --git a/www/crm/wp-includes/js/wp-sanitize.js b/www/crm/wp-includes/js/wp-sanitize.js
index 76b587ba..6082b191 100644
--- a/www/crm/wp-includes/js/wp-sanitize.js
+++ b/www/crm/wp-includes/js/wp-sanitize.js
@@ -23,10 +23,20 @@
stripTags: function( text ) {
text = text || '';
- return text
- .replace( /<!--[\s\S]*?(-->|$)/g, '' )
- .replace( /<(script|style)[^>]*>[\s\S]*?(<\/\1>|$)/ig, '' )
- .replace( /<\/?[a-z][\s\S]*?(>|$)/ig, '' );
+ // Do the replacement.
+ var _text = text
+ .replace( /<!--[\s\S]*?(-->|$)/g, '' )
+ .replace( /<(script|style)[^>]*>[\s\S]*?(<\/\1>|$)/ig, '' )
+ .replace( /<\/?[a-z][\s\S]*?(>|$)/ig, '' );
+
+ // If the initial text is not equal to the modified text,
+ // do the search-replace again, until there is nothing to be replaced.
+ if ( _text !== text ) {
+ return wp.sanitize.stripTags( _text );
+ }
+
+ // Return the text with stripped tags.
+ return _text;
},
/**
@@ -41,7 +51,7 @@
textarea = document.createElement( 'textarea' );
try {
- textarea.innerHTML = _text;
+ textarea.textContent = _text;
_text = wp.sanitize.stripTags( textarea.value );
} catch ( er ) {}