Make WordPress Core


Ignore:
Timestamp:
02/21/2023 01:47:57 AM (20 months ago)
Author:
peterwilsoncc
Message:

HTTP API: Add fragment support to WP_Http::make_absolute_url().

Modifies WP_Http::make_absolute_url() to prevent it from dropping URL fragments, this in turn fixes the same issue for links_add_base_url().

Props costdev, sergeybiryukov, dshanske, schlessera, jrf, desrosj, dd32.
Fixes #56231.

File:
1 edited

Legend:

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

    r55063 r55370  
    10141014        }
    10151015
     1016        // Add the fragment.
     1017        if ( ! empty( $relative_url_parts['fragment'] ) ) {
     1018            $path .= '#' . $relative_url_parts['fragment'];
     1019        }
     1020
    10161021        return $absolute_path . '/' . ltrim( $path, '/' );
    10171022    }
Note: See TracChangeset for help on using the changeset viewer.