Loading modules/user/user.module +5 −0 Changes for modules/user/user.module: 5 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -694,6 +694,11 @@ function user_validate_picture(&$form, &$form_state) { 'file_validate_is_image' => array(), 'file_validate_image_resolution' => array(variable_get('user_picture_dimensions', '85x85')), 'file_validate_size' => array((int) variable_get('user_picture_file_size', '30') * 1024), // file_validate_is_image() uses the image toolkit to validate whether the // file is a valid image type, so set file_validate_extensions to an empty // array in order to signal to file_save_upload() that there is no need to // validate the upload against a default list of file extensions. 'file_validate_extensions' => array(), ); // Save the file as a temporary file. Loading modules/user/user.test +3 −2 Changes for modules/user/user.test: 3 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -1313,9 +1313,10 @@ class UserPictureTestCase extends DrupalWebTestCase { $this->drupalLogin($this->user); // Try to upload a file that is not an image for the user picture. $not_an_image = current($this->drupalGetTestFiles('html')); $this->saveUserPicture($not_an_image); $not_an_image = $this->drupalGetTestFiles('html'); $this->saveUserPicture($not_an_image[1]); $this->assertRaw(t('Only JPEG, PNG and GIF images are allowed.'), 'Non-image files are not accepted.'); $this->assertNoRaw(t('Only files with the following extensions are allowed:'), 'Additional error message not displayed.'); } /** Loading Loading
modules/user/user.module +5 −0 Changes for modules/user/user.module: 5 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -694,6 +694,11 @@ function user_validate_picture(&$form, &$form_state) { 'file_validate_is_image' => array(), 'file_validate_image_resolution' => array(variable_get('user_picture_dimensions', '85x85')), 'file_validate_size' => array((int) variable_get('user_picture_file_size', '30') * 1024), // file_validate_is_image() uses the image toolkit to validate whether the // file is a valid image type, so set file_validate_extensions to an empty // array in order to signal to file_save_upload() that there is no need to // validate the upload against a default list of file extensions. 'file_validate_extensions' => array(), ); // Save the file as a temporary file. Loading
modules/user/user.test +3 −2 Changes for modules/user/user.test: 3 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -1313,9 +1313,10 @@ class UserPictureTestCase extends DrupalWebTestCase { $this->drupalLogin($this->user); // Try to upload a file that is not an image for the user picture. $not_an_image = current($this->drupalGetTestFiles('html')); $this->saveUserPicture($not_an_image); $not_an_image = $this->drupalGetTestFiles('html'); $this->saveUserPicture($not_an_image[1]); $this->assertRaw(t('Only JPEG, PNG and GIF images are allowed.'), 'Non-image files are not accepted.'); $this->assertNoRaw(t('Only files with the following extensions are allowed:'), 'Additional error message not displayed.'); } /** Loading