mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-12-06 12:51:58 +00:00
Better image extension regexes, so we don't just grab the "jpe" from "jpeg" files in media_sideload_image(). props sivel. fixes #16693
git-svn-id: https://develop.svn.wordpress.org/trunk@21219 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -599,7 +599,7 @@ function media_sideload_image($file, $post_id, $desc = null) {
|
||||
|
||||
// Set variables for storage
|
||||
// fix file filename for query strings
|
||||
preg_match('/[^\?]+\.(jpg|JPG|jpe|JPE|jpeg|JPEG|gif|GIF|png|PNG)/', $file, $matches);
|
||||
preg_match( '/[^\?]+\.(jpe?g|jpe|gif|png)\b/i', $file, $matches );
|
||||
$file_array['name'] = basename($matches[0]);
|
||||
$file_array['tmp_name'] = $tmp;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user