Skip to content

Commit

Permalink
[bug] Template strings passed to javascript were not escaped.
Browse files Browse the repository at this point in the history
Fixed by escaping them with escape_cstr filter.
  • Loading branch information
ikedas committed Oct 3, 2018
1 parent 441761e commit de3c739
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
24 changes: 12 additions & 12 deletions default/web_tt2/head_javascript.tt2
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@
<!--
[%# A few configuration settings and miscellaneous vars. ~%]
var sympa = {
backText: "[%|loc%]Back[%END%]",
calendarButtonText: "[%|loc%]Calendar[%END%]",
backText: '[%"Back"|loc|escape_cstr%]',
calendarButtonText: '[%"Calendar"|loc|escape_cstr%]',
calendarFirstDay: 0,
closeText: "[%|loc%]Close[%END%]",
dayNames: "[%|loc%]Sunday:Monday:Tuesday:Wednesday:Thursday:Friday:Saturday[%END%]".split(":"),
dayNamesMin: "[%|loc%]Su:Mo:Tu:We:Th:Fr:Sa[%END%]".split(":"),
home_url: '[% path_cgi %]/',
icons_url: '[% icons_url %]',
lang: '[% lang %]',
loadingText: "[%|loc%]Please Wait...[%END%]",
monthNamesShort: "[%|loc%]Jan:Feb:Mar:Apr:May:Jun:Jul:Aug:Sep:Oct:Nov:Dec[%END%]".split(":"),
openInNewWinText: "[%|loc%]Open in a new window[%END%]",
resetText: "[%|loc%]Reset[%END%]"
closeText: '[%"Close"|loc|escape_cstr%]',
dayNames: '[%"Sunday:Monday:Tuesday:Wednesday:Thursday:Friday:Saturday"|loc|escape_cstr%]'.split(":"),
dayNamesMin: '[%"Su:Mo:Tu:We:Th:Fr:Sa"|loc|escape_cstr%]'.split(":"),
home_url: '[% path_cgi | escape_cstr %]/',
icons_url: '[% icons_url | escape_cstr %]',
lang: '[% lang | escape_cstr %]',
loadingText: '[%"Please Wait..."|loc|escape_cstr%]',
monthNamesShort: '[%"Jan:Feb:Mar:Apr:May:Jun:Jul:Aug:Sep:Oct:Nov:Dec"|loc|escape_cstr%]'.split(":"),
openInNewWinText: '[%"Open in a new window"|loc|escape_cstr%]',
resetText: '[%"Reset"|loc|escape_cstr%]'
};
[%# Variable for backward compatibility. ~%]
var lang = '[% lang %]';
Expand Down
2 changes: 1 addition & 1 deletion default/web_tt2/stats.tt2
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<!--
var line = [% o.stats_values %];
$.jqplot('[% chartid %]', [line], {
title: '[% o.title.replace('([\\\\\'])', '\\\\$1') %]',
title: '[% o.title | escape_cstr %]',
axesDefaults: {
min: 0,
tickRenderer: $.jqplot.CanvasAxisTickRenderer,
Expand Down

0 comments on commit de3c739

Please sign in to comment.