Opened 14 years ago
Closed 12 years ago
#16693 closed defect (bug) (fixed)
media_sideload_image() fails on jpeg names
Reported by: | numediaweb | Owned by: | markjaquith |
---|---|---|---|
Milestone: | 3.5 | Priority: | normal |
Severity: | major | Version: | 3.1 |
Component: | General | Keywords: | has-patch 3.2-early commit |
Focuses: | Cc: |
Description
if you give an image file name with jpeg as extension, media_sideload_image() returns .jpe file name extension.
the problem is in the function at file: wp-admin/includes/media.php,line 565
preg_match('/[^\?]+\.(jpg|JPG|jpe|JPE|jpeg|JPEG|gif|GIF|png|PNG)/', 'test.jpeg', $matches); echo basename($matches[0]); // returns : test.jpe
this bugs image uploading process; it doesn't allow post thumbnail generation.
Attachments (5)
Change History (12)
#2
@
14 years ago
Thanx ncin,
I copied the same function from media.php to my custom functions and added a prefix to its name, then, just deleted the jpe|JPE|
waiting for the official fix in the next release.
Note: See
TracTickets for help on using
tickets.
Sounds like the ordering could be better. Try this for the regular expression instead:
/[^\?]+\.(jpg|jpeg|jpe|gif|png)/i