mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@55370 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1013,6 +1013,11 @@ class WP_Http {
|
||||
$path .= '?' . $relative_url_parts['query'];
|
||||
}
|
||||
|
||||
// Add the fragment.
|
||||
if ( ! empty( $relative_url_parts['fragment'] ) ) {
|
||||
$path .= '#' . $relative_url_parts['fragment'];
|
||||
}
|
||||
|
||||
return $absolute_path . '/' . ltrim( $path, '/' );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user