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

git-svn-id: http://svn.automattic.com/wordpress/trunk@19275 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
azaozz 2011-11-14 19:35:32 +00:00
parent 4691284eb1
commit e09e8f465c
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]';