-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 4535 - support file uploads with filenames containing single quote #4538
Conversation
Looks good. It's also possible to just change \\\\ to be \\. Can you add/modify a test to PodIT.uploadFile? - there's one there already with a bunch of special chars, but not a single quote. |
I tried that but didn't get the results I expected. |
The code smells look to be A, not caused by my changes and B, fairly simple to fix. (Change throwable to exception.) I'm happy to go ahead and commit that assuming tests still pass to keep it happy but am I alright to do so under this issue? Don't know your policy on lumping technically different issues together under the same number. :) |
Sonar isn't perfect so it can find stuff that is out of scope or false positives. It won't hold up this pr to have code check failing, @manusa will merge it regardless. If you'd like to address these, I don't have a problem with that.
As long as they are this straight-forward, it's fine to have them under the same PR. As separate commits would be best. |
Single quotes in folder or file names were causing corruption of the shell command. The fix changes the ' character to '"'"' For example a folder called te'st would now get shellQuoted to 'te'"'"'st' 1. ' ends the first quote, 2. " starts second quote, 3. ' is valid character in double quotes 4. " ends the second quote 5. ' starts the third quote 6. The end result when fed into the shell, is as we desired: te'st fabric8io#4535 iss-4535 Changed to be much shorter as pointed out, manual still passes tests. New test added Changelog moved. iss-4535 Fixed test brackets that mvn spotless:apply unfortunately didn't. fabric8io#4535 iss-4535 Altered some catch statements to catch exceptions rather than throwables for sonar fabric8io#4535
SonarCloud Quality Gate failed. |
Description
Fix #4535
Single quotes in folder or file names were causing corruption of the shell command. The fix changes the ' character to '"'"'
For example a folder called te'st would now get shellQuoted to 'te'"'"'st'
#4535
Type of change
test, version modification, documentation, etc.)
Checklist