[wp-trac] [WordPress Trac] #16330: media_sideload_image() broken with URLs containing spaces

WordPress Trac wp-trac at lists.automattic.com
Sat May 7 22:09:17 UTC 2011


#16330: media_sideload_image() broken with URLs containing spaces
--------------------------+------------------------------
 Reporter:  Coolkevman    |       Owner:
     Type:  defect (bug)  |      Status:  reopened
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  HTTP          |     Version:  3.1
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |
--------------------------+------------------------------
Changes (by kawauso):

 * keywords:  close => has-patch


Comment:

 I just ran into this and traced the issue back to the base filename passed
 by `media_sideload_image()` to `media_handle_sideload()`, which is still
 URL encoded. As such, you get the final image filename with URL encoding
 (`%20`) in it which is then double-encoded by the attachment functions,
 breaking things rather badly.

 To reproduce, try loading a image URL with a correctly encoded space
 through Press This.

 Following patch may not address the fundamental issue, but it appears to
 work at least.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/16330#comment:10>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list