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 EZP-23086: image thumbnail with special chars and urlalias_iri #1011

Closed

Conversation

joaoinacio
Copy link

JIRA: https://jira.ez.no/browse/EZP-23086

When using urlalias_iri transformation group urls may contain some special chars (eg /folder"with"quotes/)
In this situation, the thumbnail preview on admin ui fails.

Problem: ajax / ezjscore request filters uris with htmlentities, which won't work for applying in css styles.

Fix: Revert htmlentities and re-encode uri in afftected js.

This looks hackish, but:

  • It is impractical/unpretictable to modify eZURI::transformURI()
  • Problems with using different transformation ( f.e. transformUrl will not take root/indexdir into account)

@dpobel
Copy link
Contributor

dpobel commented Jul 1, 2014

hum this feels more like a workaround than an actual fix ;-)
The encodeURI call is indeed needed but the rest is there to do the opposite of htmlspecialchars done by eZURI::transformURI.

As far as I can see, the eZURI::transformURI (used in ezjscAjaxContent::simplify() around line 316) calls htmlspecialchars because it is supposed to be used in an html context but in the ezjscore context, we should just get the URI without any character escaping and should let ezjscore escape it correctly according to requested type. So, I suggest to add a new method in eZURI (and do some refactoring) that does exactly the same thing as transformURI but without the htmlspecialchars call and to use it to build the URI of images.

@joaoinacio
Copy link
Author

Indeed it does.
Thanks for the feedback, I will look into that course of action.

@yannickroger
Copy link
Contributor

Make sure to rebase against master (if using the same branch) since this part of the code has been modified #1015

@joaoinacio
Copy link
Author

Closing in favor of #1019

@joaoinacio joaoinacio closed this Jul 9, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants