Make WordPress Core

Ticket #18149: 18149.2.patch

File 18149.2.patch, 782 bytes (added by iseulde, 10 years ago)
  • src/wp-includes/js/wplink.js

     
    187187                },
    188188
    189189                getAttrs: function() {
     190                        var href = inputs.url.val();
     191
     192                        if ( ! /^(?:[a-z]+:|#|\?|\.|\/)/.test( href ) ) {
     193                                href = 'http://' + href;
     194                        }
     195
    190196                        return {
    191                                 href: inputs.url.val(),
     197                                href: href,
    192198                                title: inputs.title.val(),
    193199                                target: inputs.openInNewTab.prop( 'checked' ) ? '_blank' : ''
    194200                        };
     
    309315                                inputs.url.val( selection.replace( /&|&#0?38;/gi, '&' ) );
    310316                        } else {
    311317                                // Set URL to default.
    312                                 inputs.url.val( 'http://' );
     318                                inputs.url.val( '' );
    313319                        }
    314320
    315321                        // Set description to default.