Opened 16 years ago
Closed 14 years ago
#16693 closed defect (bug) (fixed)
media_sideload_image() fails on jpeg names
| Reported by: | numediaweb | Owned by: | markjaquith |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.5 |
| Component: | General | Version: | 3.1 |
| Severity: | major | Keywords: | has-patch 3.2-early commit |
| Cc: | Focuses: |
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
@
16 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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Sounds like the ordering could be better. Try this for the regular expression instead:
/[^\?]+\.(jpg|jpeg|jpe|gif|png)/i