Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

fix double encoding in frontend editor for icon_src of plugins inserted into wymeditor #1204

Closed
wants to merge 1 commit into from

3 participants

Herbert Poul Daniele Procida Benjamin Wohlwend
Herbert Poul

[claimed by @evildmp]
admin/cms/page/plugin_forms_ok.html already has javascript escaping for all context variables:

opener.dismissEditPluginPopup(window, {% javascript_string %}{{ plugin_id }}{% end_javascript_string %}, {% javascript_string %}{{ icon }}{% end_javascript_string %}, {% javascript_string %}{{ alt }}{% end_javascript_string %}

this leads to double escaped characters and invalid icon URLs

Daniele Procida
Owner

This works nicely, and solves the problem. Consider this a fix!

Collaborator

Cherry-picked this into develop. Thanks @hpoul for the patch and @evildmp for the review!

Daniele Procida
Owner

This works nicely; better than the suggestions at #1159 that only tackle the problem when it gets to the template. Consider this tested and fixed.

Benjamin Wohlwend piquadrat closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 23, 2012
  1. Herbert Poul

    fixed double encoding.

    hpoul authored
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 2 deletions.
  1. +2 −2 cms/admin/pageadmin.py
4 cms/admin/pageadmin.py
View
@@ -1279,8 +1279,8 @@ def edit_plugin(self, request, plugin_id):
'name': unicode(saved_object),
"type": saved_object.get_plugin_name(),
'plugin_id': plugin_id,
- 'icon': force_escape(escapejs(saved_object.get_instance_icon_src())),
- 'alt': force_escape(escapejs(saved_object.get_instance_icon_alt())),
+ 'icon': force_escape(saved_object.get_instance_icon_src()),
+ 'alt': force_escape(saved_object.get_instance_icon_alt()),
}
return render_to_response('admin/cms/page/plugin_forms_ok.html', context, RequestContext(request))
Something went wrong with that request. Please try again.