Skip to content

Commit

Permalink
Check value of $image_meta in dimensions checker
Browse files Browse the repository at this point in the history
  • Loading branch information
roborourke committed Apr 3, 2024
1 parent 326e3f5 commit 517290b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion inc/cropper/namespace.php
Original file line number Diff line number Diff line change
Expand Up @@ -960,7 +960,11 @@ function img_tag_add_attr( bool $value, string $image ) : bool {
* @param array $image_meta The attachment meta data.
* @return false|array Returns an array of [width, height] on success, false on failure.
*/
function get_img_src_dimensions( string $image_src, array $image_meta ) {
function get_img_src_dimensions( $image_src, $image_meta ) {
if ( empty( $image_meta ) ) {
return $image_src;
}

// Bail early if an image has been inserted and later edited.
list( $image_path ) = explode( '?', $image_src );
if ( preg_match( '/-e[0-9]{13}/', $image_meta['file'], $img_edit_hash ) &&
Expand Down
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 517290b

Please sign in to comment.