Description
The upload of a file containg spaces in his name is not added to the Gform entry at the end of the submit process.
I can see the file in the upload/gravity_forms1-xxx/tmp but then the gravity-form code fails to move it to the entry.
Steps to reproduce
1 - Create a form with an upload file field with option Enable Multi-File Upload active
2 - Create a local file with one or multiple spaces in the name
3 - Use the submitGfForm mutation to send the file
4 - The file is not associated to the entry at the end.
Additional context
I think the issue comes from the initialize_files function in the EntryObjectMutation class.
If we compare the creation of the $target_file to the one gravityForm uses it is missing the use of sanitize_file_name :
wp-graphql-gravity-forms: wp_basename( $temp_filename )
vs
set_uploaded_files function in GFFormsModel class.
gravity-forms: sanitize_file_name( wp_basename( $upload['temp_filename'] ) )
This leads to the call of file_exists returning a missing file.
Plugin Version
0.13.0.1
Gravity Forms Version
2.8.15
WordPress Version
6.4.3
WPGraphQL Version
1.28.0
Additional enviornmental details
No response
Please confirm that you have searched existing issues in the repo.
Please confirm that you have disabled ALL plugins except for Gravity Forms, WPGraphQL, and WPGraphQL for Gravity Forms
Description
The upload of a file containg spaces in his name is not added to the Gform entry at the end of the submit process.
I can see the file in the
upload/gravity_forms1-xxx/tmpbut then the gravity-form code fails to move it to the entry.Steps to reproduce
1 - Create a form with an
upload file fieldwith optionEnable Multi-File Uploadactive2 - Create a local file with one or multiple spaces in the name
3 - Use the
submitGfForm mutationto send the file4 - The file is not associated to the entry at the end.
Additional context
I think the issue comes from the
initialize_filesfunction in theEntryObjectMutationclass.If we compare the creation of the
$target_fileto the one gravityForm uses it is missing the use ofsanitize_file_name:wp-graphql-gravity-forms:
wp_basename( $temp_filename )vs
set_uploaded_filesfunction inGFFormsModelclass.gravity-forms:
sanitize_file_name( wp_basename( $upload['temp_filename'] ) )This leads to the call of
file_existsreturning a missing file.Plugin Version
0.13.0.1
Gravity Forms Version
2.8.15
WordPress Version
6.4.3
WPGraphQL Version
1.28.0
Additional enviornmental details
No response
Please confirm that you have searched existing issues in the repo.
Please confirm that you have disabled ALL plugins except for Gravity Forms, WPGraphQL, and WPGraphQL for Gravity Forms