~canonical-sysadmins/wordpress/4.8.2

« back to all changes in this revision

Viewing changes to wp-includes/js/customize-preview.js

  • Committer: axino
  • Date: 2017-03-07 07:21:12 UTC
  • mfrom: (1.1.23 upstream)
  • Revision ID: axino@canonical.com-20170307072112-9g3xb2f6bb0skh02
Merge WP4.7.3 from upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
145
145
                                return;
146
146
                        }
147
147
 
 
148
                        // Allow internal jump links and JS links to behave normally without preventing default.
148
149
                        isInternalJumpLink = ( '#' === link.attr( 'href' ).substr( 0, 1 ) );
149
 
 
150
 
                        // Allow internal jump links to behave normally without preventing default.
151
 
                        if ( isInternalJumpLink ) {
 
150
                        if ( isInternalJumpLink || ! /^https?:$/.test( link.prop( 'protocol' ) ) ) {
152
151
                                return;
153
152
                        }
154
153
 
334
333
                        return;
335
334
                }
336
335
 
337
 
                // Ignore links with href="#" or href="#id".
338
 
                if ( '#' === $( element ).attr( 'href' ).substr( 0, 1 ) ) {
 
336
                // Ignore links with href="#", href="#id", or non-HTTP protocols (e.g. javascript: and mailto:).
 
337
                if ( '#' === $( element ).attr( 'href' ).substr( 0, 1 ) || ! /^https?:$/.test( element.protocol ) ) {
339
338
                        return;
340
339
                }
341
340