You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This piece validates is param is set, but in some cases images size is being set with an empty value which this function wouldn't validate. Empty values caused AMP validator to fail
// Try to extract dimensions for the image, if not set.
if ( ! isset( $new_attributes['width'] ) || ! isset( $new_attributes['height'] ) ) {
$dimensions = AMP_Image_Dimension_Extractor::extract( $new_attributes['src'] );
if ( is_array( $dimensions ) ) {
$new_attributes['width'] = $dimensions[0];
$new_attributes['height'] = $dimensions[1];
}
}
The text was updated successfully, but these errors were encountered:
rcstr
changed the title
Image sanitizer only verifies is size (width/height) is not set, but doesn't validate empty values
Image sanitizer only verifies if size (width/height) is not set, but doesn't validate empty values
Nov 3, 2016
This piece validates is param is set, but in some cases images size is being set with an empty value which this function wouldn't validate. Empty values caused AMP validator to fail
The text was updated successfully, but these errors were encountered: