Ticket #3287: 3287.diff

File 3287.diff, 0.7 kB (added by mdawaffe, 2 years ago)
  • wp-admin/upload-functions.php

    old new  
    1313         
    1414        $class = 'text'; 
    1515        $innerHTML = get_attachment_innerHTML( $id, false, $dims ); 
    16         if ( $image_src = strstr($innerHTML, 'src="') ) { 
    17                 $image_src = explode('"', $image_src); 
    18                 $image_src = $image_src[1]; 
     16        if ( $image_src = strstr($innerHTML, 'src=') ) { 
     17                preg_match("/src=(\"|')(.+?)\\1/", $image_src, $matches); 
     18                $image_src = $matches[2]; 
    1919                $image_rel = wp_make_link_relative($image_src); 
    2020                $class = 'image'; 
    2121                $innerHTML = ' ' . str_replace($image_src, $image_rel, $innerHTML);