-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix to reassign original_filename on store #2710
Conversation
Still thinking about what original_filename is expected to be Also, diff --git a/lib/carrierwave/uploader/cache.rb b/lib/carrierwave/uploader/cache.rb
index 28f2f77..91e59c5 100644
--- a/lib/carrierwave/uploader/cache.rb
+++ b/lib/carrierwave/uploader/cache.rb
@@ -132,8 +132,8 @@ module CarrierWave
@identifier = nil
@staged = true
+ self.original_filename = new_file.original_filename
@filename = new_file.filename
- self.original_filename = new_file.filename
this might be better? |
Simply put, That's why it's safeguarded not to contain unsafe characters. Cache files need to be stored in the filesystem safely. So you just can't use |
Thanks, I think I've might have started to understand some part of original_filename from your explanation. |
reference a2e8a58 |
After examining the history of
After store! these can be same. I think assigning carrierwave/lib/carrierwave/uploader/cache.rb Lines 78 to 80 in b1dbd7c
|
@mshibuya Hi - I was curious if you intend on approving/merging this "fix", or not as it was not the intended behavior. I'm just wondering if I need to adapt my code to this new behavior (currently pinned to 3.0.3 despite CVE), or if this update will be available soon. Thank you! |
@ryan-mcneil Thanks for the comment. Then could you answer this question? |
@mshibuya I suppose I don't have a better reason than what has been presented by some of the other engineers on these threads. I'll dig in further while I try to adapt to the new version, and respond again if I come up with something more convincing. I will side with the sentiment argued by others though. Whether or not the behavior was intended/per the specification, the update did in fact introduce breaking changes for some (many?) users facing a CVE, and likely deserved more than a patch version. Perhaps a 3.0.6 could satisfy these requests, and a 4.X could re-introduce these changes to better align with your intended use case? Either way, thanks for any consideration, and thanks for doing what you're doing! |
@ryan-mcneil You should have told me that your project is open source. I've opened a draft PR which fixes the specs, at least locally. Please take a look. |
Closing as #2718 will alleviate this. |
Trying to fix #2708