- 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
+1 -4
View File
@@ -3087,10 +3087,7 @@ function ent2ncr( $text ) {
* @return string The formatted text after filter is applied.
*/
function format_for_editor( $text, $default_editor = null ) {
// Back-compat: check if any characters need encoding.
if ( ! empty( $text ) && ( false !== strpos( $text, '<' ) || false !== strpos( $text, '>' ) ||
preg_match( '/&(?!#(?:\d+|x[a-f0-9]+);|[a-z1-4]{1,8};)/i', $text ) ) ) {
if ( $text ) {
$text = htmlspecialchars( $text, ENT_NOQUOTES, get_option( 'blog_charset' ) );
}