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: http://core.svn.wordpress.org/trunk@21219 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -172,7 +172,7 @@ if ( !empty($_REQUEST['ajax']) ) {
|
||||
*/
|
||||
function get_images_from_uri($uri) {
|
||||
$uri = preg_replace('/\/#.+?$/','', $uri);
|
||||
if ( preg_match('/\.(jpg|jpe|jpeg|png|gif)$/', $uri) && !strpos($uri,'blogger.com') )
|
||||
if ( preg_match( '/\.(jpe?g|jpe|gif|png)\b/i', $uri ) && !strpos( $uri, 'blogger.com' ) )
|
||||
return "'" . esc_attr( html_entity_decode($uri) ) . "'";
|
||||
$content = wp_remote_fopen($uri);
|
||||
if ( false === $content )
|
||||
|
||||
Reference in New Issue
Block a user