Revert "Merge branch 'khanchi-designs-patch2' into 'master'"
What does this MR do?
This MR reverts !44136 (merged).
Spaces in a filename are considered an "invalid" character and are replaced with underscores, so the fix in !44136 (merged) prevents filenames with spaces from being uploaded. Design filenames with spaces are reasonably common, including files from MacOS screen captures.
The MR was attempting to address a specific edge case that could lead to an error when uploading designs with characters that are replaced by underscores #219113 (comment 360806168). However, the effect of the fix is to prevent people from uploading common design file names, so we should revert and reconsider how to best address the edge case.
path = "/Users/luke/Desktop/Screenshot\ 2020-12-11\ at\ 3.04.17\ PM.png"
# => "/Users/luke/Desktop/Screenshot 2020-12-11 at 3.04.17 PM.png"
file = UploadedFile.new(path)
file.original_filename
# => "Screenshot_2020-12-11_at_3.04.17_PM.png"
file.filename_sanitized?
#=> true
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team