I’m having troubles with a php error and cannot find where it goes wrong. Every images that is showed on our website generates an error. Can you help me out with this?
The error says:
PHP Warning: Undefined array key “file” in *** /public/wp-includes/media.php on line 1680″ while reading upstream.
Here is the full block of code on line 1680:
1679 // Bail early if an image has been inserted and later edited.
1680 if ( preg_match( ‘/-e[0-9]{13}/’, $image_meta[‘file’], $img_edit_hash ) &&
1681 strpos( wp_basename( $image_src ), $img_edit_hash[0] ) === false ) {
1682
1683 return $image;
1684 }
*Note: after updating to wordpress 6.2 the code above is in line 1686