Skip to content
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 handling of + in image names, added some functional tests #1391

Merged
merged 1 commit into from Oct 6, 2021

Conversation

dbu
Copy link
Member

@dbu dbu commented Oct 5, 2021

Q A
Branch? 2.0
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets fix #1382
License MIT
Doc PR -

Added some functional tests for handling of special characters, and fixing to not break for +.

return implode('/', array_map('rawurlencode', explode('/', $path)));
}

public static function urlPathToFilePath(string $url): string
{
// used urldecode instead of rawurlencode for BC safety to support "+" in URL
Copy link
Member Author

@dbu dbu Oct 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this did the opposite of what was intended: if there is a + in the filename, we would end up with instead.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dbu thanks for this fix. I've missed this fact in #1162

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no worries, it is quite confusing what is going on, and the encoding the the symfony route generator does is ... surprising.

i added some unit and functional tests to help us better understand what is happening.

@dbu dbu mentioned this pull request Oct 5, 2021
@dbu dbu closed this Oct 5, 2021
@dbu dbu reopened this Oct 5, 2021
@dbu dbu force-pushed the fix-special-character-handling branch from 00dff13 to 749b712 Compare October 5, 2021 15:13
@coveralls
Copy link

coveralls commented Oct 5, 2021

Coverage Status

Coverage remained the same at 84.08% when pulling b91e217 on fix-special-character-handling into 7f9d50b on 2.x.

@dbu dbu closed this Oct 5, 2021
@dbu dbu reopened this Oct 5, 2021
@dbu dbu force-pushed the fix-special-character-handling branch from 749b712 to b91e217 Compare October 6, 2021 05:56
@dbu dbu merged commit 8efc7f9 into 2.x Oct 6, 2021
@dbu dbu deleted the fix-special-character-handling branch October 6, 2021 06:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants