[wp-trac] [WordPress Trac] #49841: wp_get_attachment_url does not return a url
WordPress Trac
noreply at wordpress.org
Tue Apr 7 17:29:44 UTC 2020
#49841: wp_get_attachment_url does not return a url
----------------------------------------+-----------------------------
Reporter: hughie.molloy | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: 5.4
Severity: normal | Keywords:
Focuses: template, coding-standards |
----------------------------------------+-----------------------------
wp_get_attachment_url returns the base url to the uploads directory suffix
with the file path.
The file path is not always a valid url. 'fun image.png' is a valid file
name. It's url path is 'fun%20image.png'
I suggest adding the below straight after line 5859 in wp-
includes/post.php
{{{
// Convert the file path into a valid URL path
$file = implode('/', array_map('rawurlencode',
explode(DIRECTORY_SEPARATOR, $file)));
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/49841>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list