All of lore.kernel.org
 help / color / mirror / Atom feed
* [review-request][PATCH] bitbake: toaster: project use escapejs filter to avoid tag interpretation
@ 2014-11-06 16:11 Michael Wood
  2014-11-07 16:52 ` Damian, Alexandru
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Wood @ 2014-11-06 16:11 UTC (permalink / raw)
  To: toaster

When passing the data from the jinja2 template to javascript make sure
we escape and parse the JSON to avoid any invalid values being interpreted.

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
---
 bitbake/lib/toaster/toastergui/templates/project.html | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/bitbake/lib/toaster/toastergui/templates/project.html b/bitbake/lib/toaster/toastergui/templates/project.html
index 6a81283..00fb2b4 100644
--- a/bitbake/lib/toaster/toastergui/templates/project.html
+++ b/bitbake/lib/toaster/toastergui/templates/project.html
@@ -335,13 +335,13 @@ angular.element(document).ready(function() {
   scope.urls.layers = "{% url 'layers' %}";
   scope.urls.targets = "{% url 'targets' %}";
   scope.urls.importlayer = "{% url 'importlayer'%}"
-  scope.project = {{prj|safe}};
-  scope.builds = {{builds|safe}};
-  scope.layers = {{layers|safe}};
-  scope.targets = {{targets|safe}};
-  scope.frequenttargets = {{freqtargets|safe}};
-  scope.machine = {{machine|safe}};
-  scope.releases = {{releases|safe}};
+  scope.project = JSON.parse ("{{prj|escapejs}}");
+  scope.builds = JSON.parse ("{{builds|escapejs}}");
+  scope.layers = JSON.parse ("{{layers|escapejs}}");
+  scope.targets = JSON.parse ("{{targets|escapejs}}");
+  scope.frequenttargets = JSON.parse ("{{freqtargets|escapejs}}");
+  scope.machine = JSON.parse ("{{machine|escapejs}}");
+  scope.releases = JSON.parse ("{{releases|escapejs}}");
 
   scope.zone1alerts = [];
   scope.zone2alerts = [];
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-11-12 16:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-06 16:11 [review-request][PATCH] bitbake: toaster: project use escapejs filter to avoid tag interpretation Michael Wood
2014-11-07 16:52 ` Damian, Alexandru
2014-11-11 11:31   ` Michael Wood
2014-11-11 17:17     ` Damian, Alexandru
2014-11-12 16:54       ` Michael Wood

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.