Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 295277

PHP7 warning when uploading a user picture

$
0
0

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

A typecast should resolve this:

  function user_validate_picture(&$form, &$form_state) {
    // If required, validate the uploaded picture.
    $validators = array('file_validate_is_image' => 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),
    );
    ...
  }

Viewing all articles
Browse latest Browse all 295277

Trending Articles