Making WordPress.org


Ignore:
Timestamp:
12/16/2020 07:35:27 AM (4 years ago)
Author:
dd32
Message:

Theme Preview: Fix the IE/invalid link fallback to refer to the correct array indicy, and add support for mailto links.

Amends [10520].

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wp-themes.com/public_html/wp-content/mu-plugins/pub/open-links-in-new-window.php

    r10520 r10521  
    2424            // Internet Explorer and invalid links, fall back to regex.
    2525            if ( hostname = link.href.match( /^\s*(?:(?:https?:)?\/\/)([^/]+)(\/|$)/ ) ) {
    26                 hostname = hostname[0];
     26                hostname = hostname[1];
     27            } else if ( "mailto" === link.href.substr( 0, 6 ) {
     28                hostname = "mailto"; // not whitelisted hostname to fall through.
    2729            }
    2830        }
Note: See TracChangeset for help on using the changeset viewer.