diff options
author | Dave Lawrence <dlawrence@mozilla.com> | 2013-06-05 17:03:10 +0200 |
---|---|---|
committer | Dave Lawrence <dlawrence@mozilla.com> | 2013-06-05 17:03:10 +0200 |
commit | 3919b2854739739f947f05a7c1b67aa111cc24d1 (patch) | |
tree | 04a14e7dac8899bb6d3c2c39c97566f860bf6a43 /extensions | |
parent | 73673a0950726b6dba4574a57f22353e1586d939 (diff) | |
download | bugzilla-3919b2854739739f947f05a7c1b67aa111cc24d1.tar.gz bugzilla-3919b2854739739f947f05a7c1b67aa111cc24d1.tar.xz |
Bug 879713 - product dashboard links does not urlencode ampersands
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/ProductDashboard/web/js/components.js | 39 |
1 files changed, 27 insertions, 12 deletions
diff --git a/extensions/ProductDashboard/web/js/components.js b/extensions/ProductDashboard/web/js/components.js index 538b15457..8b0d28587 100644 --- a/extensions/ProductDashboard/web/js/components.js +++ b/extensions/ProductDashboard/web/js/components.js @@ -3,13 +3,13 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. * * This Source Code Form is "Incompatible With Secondary Licenses", as - * defined by the Mozilla Public License, v. 2.0. + * defined by the Mozilla Public License, v. 2.0. */ YUI({ - base: 'js/yui3/', + base: 'js/yui3/', combine: false -}).use("datatable", "datatable-sort", function(Y) { +}).use("datatable", "datatable-sort", "escape", function(Y) { if (typeof PD.updated_recently != 'undefined') { var columns = [ { key:"id", label:"ID", sortable:true, allowHTML: true, @@ -37,16 +37,21 @@ YUI({ } if (typeof PD.component_counts != 'undefined') { - var summary_url = '<a href="page.cgi?id=productdashboard.html&product=' + - encodeURIComponent(PD.product_name) + '&bug_status=' + + var summary_url = '<a href="page.cgi?id=productdashboard.html&product=' + + encodeURIComponent(PD.product_name) + '&bug_status=' + encodeURIComponent(PD.bug_status) + '&tab=components'; - + var columns = [ - { key:"name", label:"Name", sortable:true, allowHTML: true, - formatter: summary_url + '&component={value}">{value}</a>' }, + { key:"name", label:"Name", sortable:true, allowHTML: true, + formatter: function (o) { + return summary_url + '&component=' + + encodeURIComponent(o.value) + '">' + + Y.Escape.html(o.value) + '</a>' + } + }, { key:"count", label:"Count", sortable:true }, { key:"percentage", label:"Percentage", sortable:false, allowHTML: true, - formatter: '<div class="percentage"><div class="bar" style="width:{value}%"></div><div class="percent">{value}%</div></div>' }, + formatter: '<div class="percentage"><div class="bar" style="width:{value}%"></div><div class="percent">{value}%</div></div>' }, { key:"link", label:"Link", sortable:false, allowHTML: true } ]; @@ -55,8 +60,13 @@ YUI({ data: PD.component_counts }); componentsDataTable.render("#component_counts"); - - columns[0].formatter = summary_url + '&version={value}">{value}</a>'; + + columns[0].formatter = function (o) { + return summary_url + '&version=' + + encodeURIComponent(o.value) + '">' + + Y.Escape.html(o.value) + '</a>'; + }; + var versionsDataTable = new Y.DataTable({ columns: columns, data: PD.version_counts @@ -64,7 +74,12 @@ YUI({ versionsDataTable.render('#version_counts'); if (typeof PD.milestone_counts != 'undefined') { - columns[0].formatter = summary_url + '&target_milestone={value}">{value}</a>'; + columns[0].formatter = function (o) { + return summary_url + '&target_milestone=' + + encodeURIComponent(o.value) + '">' + + Y.Escape.html(o.value) + '</a>'; + }; + var milestonesDataTable = new Y.DataTable({ columns: columns, data: PD.milestone_counts |