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

Removing wrong encodeURI for thumbnail URLs in the admin interface #161

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pkamps
Copy link
Member

@pkamps pkamps commented Aug 29, 2019

The encodeURI is only working by accident. The image URLs in ezp do not contain any characters that need encoding. So the output with or without encodeURI is always the same. It's causing an issue with the image server, because we allow other characters like Umlaute etc. The extra encodeURI is breaking the URL to the image.
eZ is using eZURI::transformURI( $thumbUrl, true, null, false ); to build the thumbnail URL. I don't see why we'd need encodeURI before we set an image src tag.

The encodeURI is only working by accident. The image URLs in ezp do not contain any characters that need encoding. So the output with or without encodeURI is always the same. It's causing an issue with the image server, because we allow other characters like Umlaute etc. The extra encodeURI is breaking the URL to the image.
eZ is using `eZURI::transformURI( $thumbUrl, true, null, false );` to build the thumbnail URL. I don't see why we'd need encodeURI before we set an image src tag.
@peterkeung
Copy link
Member

What about spaces? I saw some discussion about the new stack having issues with spaces in file names.

Also, why does the image server need to support more characters than eZ does?

@pkamps
Copy link
Member Author

pkamps commented Aug 29, 2019

The URLs are coming from an ezjscore ajax service. I don't see how the service would return a list of URLs that are not valid and that need a javascript encodeURI. It's not like we'd add a query parameter and need to escape/encode the URL. The javascript is setting the 'src' tag value.

It's less work to support all chars you can use in file names on a file system. I don't need to write extra code to filter out specific chars.

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.

2 participants