PHP7 warning when uploading a user picture

Created on 3 August 2017, almost 7 years ago
Updated 24 January 2024, 5 months ago

Tested with PHP 7.1.6, when uploading a picture against a user the following warning appears:
Warning: A non-numeric value encountered in _exif_orientation_validate_user_picture() (line 34 of exif_orientation.module).

A typecast should resolve this:

  function _exif_orientation_validate_user_picture(&$form, &$form_state) {
    // If required, validate the uploaded picture.
    $validators = array(
      'file_validate_is_image' => array(),
      '_exif_orientation_validate_image_callback' => array(),
      'file_validate_image_resolution' => array(variable_get('user_picture_dimensions', '85x85')),
-     'file_validate_size' => array(variable_get('user_picture_file_size', '30') * 1024),
+     'file_validate_size' => array((int)variable_get('user_picture_file_size', '30') * 1024),
    );
    ...
  }
πŸ› Bug report
Status

RTBC

Version

1.0

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom MustangGB Coventry, United Kingdom

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024