WordPress.org

Make WordPress Core


Ignore:
Timestamp:
11/03/2015 09:35:17 PM (6 years ago)
Author:
SergeyBiryukov
Message:

Formatting: wp_make_link_relative() should return an empty string if no path is present in the link.

Props bcworkz, MikeHansenMe, chriscct7, SergeyBiryukov.
Fixes #26819.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/formatting.php

    r35479 r35497  
    36223622 */
    36233623function wp_make_link_relative( $link ) {
    3624     return preg_replace( '|^(https?:)?//[^/]+(/.*)|i', '$2', $link );
     3624    return preg_replace( '|^(https?:)?//[^/]+(/?.*)|i', '$2', $link );
    36253625}
    36263626
Note: See TracChangeset for help on using the changeset viewer.