You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 :
I'm having trouble replicating locally. Do you perhaps have a minimal frontend replication I can try?
Also can you:
please confirm you have disabled all plugins (including GF extensions and custom code) besides WPGraphQL, Gravity Forms, and WPGraphQL for Gravity Forms
Share any additional environment details (OS version, etc).
Also, just curious but if you change the line in EntryObjectMutation::initialize_files() locally as you propose, does the issue go away?
( GFFormsModel::set_uploaded_files() is actually used within our lifecycle, and EntryObjectMutation::initialize_files() just primes the variables that method looks for, so my gut tells me double-sanitizing there won't help, but I need to be able to replicate to know for sure).
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 optionEnable Multi-File Upload
active2 - Create a local file with one or multiple spaces in the name
3 - Use the
submitGfForm mutation
to send the file4 - The file is not associated to the entry at the end.
Additional context
I think the issue comes from the
initialize_files
function in theEntryObjectMutation
class.If we compare the creation of the
$target_file
to the one gravityForm uses it is missing the use ofsanitize_file_name
:wp-graphql-gravity-forms:
wp_basename( $temp_filename )
vs
set_uploaded_files
function inGFFormsModel
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
The text was updated successfully, but these errors were encountered: