WP_Link: convert < > and " to HTML entities when setting link title for the Text editor. Fixes #25704.

Built from https://develop.svn.wordpress.org/trunk@27071


git-svn-id: http://core.svn.wordpress.org/trunk@26944 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Ozz 2014-02-02 21:12:12 +00:00
parent a4e5457ee1
commit 28cd7371c4
2 changed files with 4 additions and 3 deletions

View File

@ -165,7 +165,7 @@ var wpLink;
},
htmlUpdate: function() {
var attrs, html, begin, end, cursor,
var attrs, html, begin, end, cursor, title,
textarea = wpLink.textarea;
if ( ! textarea )
@ -181,7 +181,8 @@ var wpLink;
html = '<a href="' + attrs.href + '"';
if ( attrs.title )
html += ' title="' + attrs.title + '"';
title = attrs.title.replace( /</g, '&lt;' ).replace( />/g, '&gt;' ).replace( /"/g, '&quot;' );
html += ' title="' + title + '"';
if ( attrs.target )
html += ' target="' + attrs.target + '"';

File diff suppressed because one or more lines are too long