[wp-trac] [WordPress Trac] #47889: uploading image contains special characters will return a wrong image url

WordPress Trac noreply at wordpress.org
Sun Aug 18 03:46:56 UTC 2019


#47889: uploading image contains special characters will return a wrong image url
--------------------------+------------------------------
 Reporter:  sockscap64    |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Media         |     Version:  5.2.2
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+------------------------------

Comment (by sockscap64):

 Thank you so much. at donmhico

 Replying to [comment:2 donmhico]:
 > Hello @sockscap64,
 >
 > Welcome to our trac. Thank you for your bug report. I confirmed the bug
 on my side as well and I attached a patch that fixes it.
 >
 > In my attached patch,
 [https://core.trac.wordpress.org/attachment/ticket/47889/47889.diff
 47889.diff], you'll see that I removed the wrapping `esc_url()`. I think
 it's safe to do this since the image url comes from
 `wp_get_attachment_image_src()` which is expected to return an array with
 a url as the first element if the image exist.
 >
 > Reference:
 >
 https://developer.wordpress.org/reference/functions/wp_get_attachment_image_src/

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/47889#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list