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

Many of the Scripts are not properly escaped #584

Closed
dpp opened this issue Jul 14, 2010 · 2 comments
Closed

Many of the Scripts are not properly escaped #584

dpp opened this issue Jul 14, 2010 · 2 comments
Assignees
Milestone

Comments

@dpp
Copy link
Member

dpp commented Jul 14, 2010

Many of the Widgets have improperly escaped script tags such as:

<script type="text/javascript" charset="utf-8">{ Unparsed("\nvar itemClick = " + (itemClick openOr JsRaw("function(param){}")).toJsCmd) ++ Unparsed("\nvar calendars = " + CalendarUtils.toJSON(calendars filter (c => c.start.after(cal) && c.start.before(lastCal))).toJsCmd) ++ Unparsed(""" jQuery(document).ready(function() { CalendarWeekView.buildWeekViewCalendars(); }) """) } </script>

Note that if there are XML characters in any of the Strings they will either cause XML parsing problems or they will cause improperly generated JavaScript.

All JavaScript should look like:
Script(...)
or
Script(JsRaw(...))

In no event should we do Unparsed or manually create the <script> tags.

@dpp
Copy link
Member Author

dpp commented Jul 30, 2010

(In [[r:6fdea86bab22711d02940e6d4f0f92d6655cf4c8]]) Closes #584. Properly encode/escape scripts

Branch: master

@github-importer
Copy link

Imported from Assembla: http://www.assembla.com/spaces/liftweb/tickets/584

@ghost ghost assigned dpp Mar 1, 2012
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants