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

git-svn-id: https://develop.svn.wordpress.org/trunk@27071 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2014-02-02 21:11:24 +00:00
parent d58d7e8158
commit bb49691c63
1 changed files with 3 additions and 2 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 + '"';