Filter the link href when inserting external image in the editor, props DrewAPicture, fixes #18445

git-svn-id: https://develop.svn.wordpress.org/trunk@19275 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2011-11-14 19:35:32 +00:00
parent 1cbf9eb415
commit 9cc4fac7fa
1 changed files with 4 additions and 2 deletions

View File

@ -1497,8 +1497,10 @@ var addExtImage = {
html = '<img alt="'+alt+'" src="'+f.src.value+'"'+title+cls+' width="'+t.width+'" height="'+t.height+'" />';
if ( f.url.value )
html = '<a href="'+f.url.value+'">'+html+'</a>';
if ( f.url.value ) {
url = f.url.value.replace(/'/g, '&#039;').replace(/"/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
html = '<a href="'+url+'">'+html+'</a>';
}
if ( caption )
html = '[caption id="" align="'+t.align+'" width="'+t.width+'" caption="'+caption+'"]'+html+'[/caption]';