@trigger_error('file_munge_filename() is deprecated in drupal:9.2.0 and is removed from drupal:10.0.0. Dispatch a \Drupal\Core\File\Event\FileUploadSanitizeNameEvent event instead. See https://www.drupal.org/node/3032541',E_USER_DEPRECATED);
$original=$filename;
// Allow potentially insecure uploads for very savvy users and admin
* @deprecated in drupal:9.2.0 and is removed from drupal:10.0.0. Use
* str_replace() instead.
*
* @see https://www.drupal.org/node/3032541
*/
functionfile_unmunge_filename($filename){
@trigger_error('file_unmunge_filename() is deprecated in drupal:9.2.0 and is removed from drupal:10.0.0. Use str_replace() instead. See https://www.drupal.org/node/3032541',E_USER_DEPRECATED);
@trigger_error('\Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesserInterface is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Implement \Symfony\Component\Mime\MimeTypeGuesserInterface instead. See https://www.drupal.org/node/3133341',E_USER_DEPRECATED);
@trigger_error('\Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesserInterface is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Implement \Symfony\Component\Mime\MimeTypeGuesserInterface instead. See https://www.drupal.org/node/3133341',E_USER_DEPRECATED);
}
$file->source=$form_field_name;
// If the destination is FALSE then $replace === FILE_EXISTS_ERROR and
// there's an existing file, so we need to bail.
if($file->destination===FALSE){
\Drupal::messenger()->addError(t('The file %source could not be uploaded because a file by that name already exists in the destination %directory.',['%source'=>$form_field_name,'%directory'=>$destination]));
returnFALSE;
@@ -1086,6 +1075,21 @@ function _file_save_upload_single(\SplFileInfo $file_info, $form_field_name, $va
returnFALSE;
}
// Update the filename with any changes as a result of the renaming due to an