Ticket #19992: 19992.4.diff
File 19992.4.diff, 943 bytes (added by , 11 years ago) |
---|
-
src/wp-includes/js/wplink.js
270 270 setDefaultValues: function() { 271 271 var selection = editor && editor.selection.getContent(), 272 272 emailRegexp = /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i, 273 urlRegexp = /^(https?|ftp):\/\/[A-Z0-9.-]+\.[A-Z]{2,4} $/i;273 urlRegexp = /^(https?|ftp):\/\/[A-Z0-9.-]+\.[A-Z]{2,4}[^ "]*$/i; 274 274 275 275 if ( selection && emailRegexp.test( selection ) ) { 276 276 // Selection is email address … … 277 277 inputs.url.val( 'mailto:' + selection ); 278 278 } else if ( selection && urlRegexp.test( selection ) ) { 279 279 // Selection is URL 280 inputs.url.val( selection );280 inputs.url.val( selection.replace( /&|�?38;/gi, '&' ) ); 281 281 } else { 282 282 // Set URL to default. 283 283 inputs.url.val( 'http://' );