mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-12 12:50:28 +00:00
TinyMCE:
- 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:
@@ -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' ) );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user