File Editor
Directories:
.. (Back)
codemirror
crop
dist
imgareaselect
jcrop
jquery
js
mediaelement
plupload
swfupload
thickbox
tinymce
Files:
admin-bar.js
admin-bar.min.js
api-request.js
api-request.min.js
autosave.js
autosave.min.js
backbone.js
backbone.min.js
clipboard.js
clipboard.min.js
colorpicker.js
colorpicker.min.js
comment-reply.js
comment-reply.min.js
customize-base.js
customize-base.min.js
customize-loader.js
customize-loader.min.js
customize-models.js
customize-models.min.js
customize-preview-nav-menus.js
customize-preview-nav-menus.min.js
customize-preview-widgets.js
customize-preview-widgets.min.js
customize-preview.js
customize-preview.min.js
customize-selective-refresh.js
customize-selective-refresh.min.js
customize-views.js
customize-views.min.js
heartbeat.js
heartbeat.min.js
hoverIntent.js
hoverIntent.min.js
hoverintent-js.min.js
imagesloaded.min.js
json2.js
json2.min.js
masonry.min.js
mce-view.js
mce-view.min.js
media-audiovideo.js
media-audiovideo.min.js
media-editor.js
media-editor.min.js
media-grid.js
media-grid.min.js
media-models.js
media-models.min.js
media-views.js
media-views.min.js
quicktags.js
quicktags.min.js
shortcode.js
shortcode.min.js
swfobject.js
tw-sack.js
tw-sack.min.js
twemoji.js
twemoji.min.js
underscore.js
underscore.min.js
utils.js
utils.min.js
wp-ajax-response.js
wp-ajax-response.min.js
wp-api.js
wp-api.min.js
wp-auth-check.js
wp-auth-check.min.js
wp-backbone.js
wp-backbone.min.js
wp-custom-header.js
wp-custom-header.min.js
wp-embed-template.js
wp-embed-template.min.js
wp-embed.js
wp-embed.min.js
wp-emoji-loader.js
wp-emoji-loader.min.js
wp-emoji-release.min.js
wp-emoji.js
wp-emoji.min.js
wp-list-revisions.js
wp-list-revisions.min.js
wp-lists.js
wp-lists.min.js
wp-pointer.js
wp-pointer.min.js
wp-sanitize.js
wp-sanitize.min.js
wp-util.js
wp-util.min.js
wpdialog.js
wpdialog.min.js
wplink.js
wplink.min.js
zxcvbn-async.js
zxcvbn-async.min.js
zxcvbn.min.js
Create New File
Create
Edit File: wp-sanitize.js
/** * @output wp-includes/js/wp-sanitize.js */ ( function () { window.wp = window.wp || {}; /** * wp.sanitize * * Helper functions to sanitize strings. */ wp.sanitize = { /** * Strip HTML tags. * * @param {string} text Text to have the HTML tags striped out of. * * @return Stripped text. */ stripTags: function( text ) { text = text || ''; // 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; }, /** * Strip HTML tags and convert HTML entities. * * @param {string} text Text to strip tags and convert HTML entities. * * @return Sanitized text. False on failure. */ stripTagsAndEncodeText: function( text ) { var _text = wp.sanitize.stripTags( text ), textarea = document.createElement( 'textarea' ); try { textarea.textContent = _text; _text = wp.sanitize.stripTags( textarea.value ); } catch ( er ) {} return _text; } }; }() );
Save Changes
Rename File
Rename