diff --git a/class.photon.php b/class.photon.php index 9e1740453a324..9a7443c54fb1b 100644 --- a/class.photon.php +++ b/class.photon.php @@ -336,11 +336,11 @@ public static function filter_the_content( $content ) { $width = $height = false; // First, check the image tag - if ( preg_match( '#width=["|\']?([\d%]+)["|\']?#i', $images['img_tag'][ $index ], $width_string ) ) { + if ( preg_match( '#[\s|"|\']width=["|\']?([\d%]+)["|\']?#i', $images['img_tag'][ $index ], $width_string ) ) { $width = $width_string[1]; } - if ( preg_match( '#height=["|\']?([\d%]+)["|\']?#i', $images['img_tag'][ $index ], $height_string ) ) { + if ( preg_match( '#[\s|"|\']height=["|\']?([\d%]+)["|\']?#i', $images['img_tag'][ $index ], $height_string ) ) { $height = $height_string[1]; }