- Go back to encoding the editor content only when TinyMCE is used.
- Add check and encode `</textarea>` if present.
See #32425.

git-svn-id: https://develop.svn.wordpress.org/trunk@33187 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz
2015-07-13 03:18:47 +00:00
parent 9f3cf9026d
commit 698faf3b17
3 changed files with 10 additions and 7 deletions

View File

@@ -251,6 +251,11 @@ final class _WP_Editors {
'<textarea' . $editor_class . $height . $tabindex . $autocomplete . ' cols="40" name="' . esc_attr( $set['textarea_name'] ) . '" ' .
'id="' . $editor_id_attr . '">%s</textarea></div>' );
// Prepare the content for the Visual or Text editor
if ( self::$this_tinymce ) {
add_filter( 'the_editor_content', 'format_for_editor', 10, 2 );
}
/**
* Filter the default editor content.
*
@@ -270,6 +275,10 @@ final class _WP_Editors {
$content = apply_filters( 'richedit_pre', $content );
}
if ( false !== stripos( $content, 'textarea' ) ) {
$content = preg_replace( '%</textarea%i', '&lt;/textarea', $content );
}
printf( $the_editor, $content );
echo "\n</div>\n\n";