summaryrefslogtreecommitdiff
path: root/app/Template
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-08-14 17:25:25 -0400
committerFrederic Guillot <fred@kanboard.net>2015-08-14 17:25:25 -0400
commit357102dc6e05bba22a65fd690f8611b131bbae8d (patch)
treeb70a88bca438432ed2eff66da9a3c18172e4c33f /app/Template
parent17a3781bd8c03e6b653104dbcb996a1ff1213959 (diff)
Fix potential issue with json_encode() in templates
Diffstat (limited to 'app/Template')
-rw-r--r--app/Template/analytic/avg_time_columns.php2
-rw-r--r--app/Template/analytic/burndown.php2
-rw-r--r--app/Template/analytic/cfd.php2
-rw-r--r--app/Template/analytic/lead_cycle_time.php2
-rw-r--r--app/Template/analytic/tasks.php2
-rw-r--r--app/Template/analytic/users.php2
-rw-r--r--app/Template/budget/index.php4
-rw-r--r--app/Template/gantt/project.php2
-rw-r--r--app/Template/task/analytics.php2
9 files changed, 10 insertions, 10 deletions
diff --git a/app/Template/analytic/avg_time_columns.php b/app/Template/analytic/avg_time_columns.php
index e74e7950..7b9d7cf9 100644
--- a/app/Template/analytic/avg_time_columns.php
+++ b/app/Template/analytic/avg_time_columns.php
@@ -7,7 +7,7 @@
<?php else: ?>
<section id="analytic-avg-time-column">
- <div id="chart" data-metrics='<?= json_encode($metrics) ?>' data-label="<?= t('Average time spent') ?>"></div>
+ <div id="chart" data-metrics='<?= json_encode($metrics, JSON_HEX_APOS) ?>' data-label="<?= t('Average time spent') ?>"></div>
<table class="table-stripped">
<tr>
diff --git a/app/Template/analytic/burndown.php b/app/Template/analytic/burndown.php
index 59f15223..3dfb6ee8 100644
--- a/app/Template/analytic/burndown.php
+++ b/app/Template/analytic/burndown.php
@@ -6,7 +6,7 @@
<p class="alert"><?= t('You need at least 2 days of data to show the chart.') ?></p>
<?php else: ?>
<section id="analytic-burndown">
- <div id="chart" data-metrics='<?= json_encode($metrics) ?>' data-date-format="<?= e('%%Y-%%m-%%d') ?>" data-label-total="<?= t('Total for all columns') ?>"></div>
+ <div id="chart" data-metrics='<?= json_encode($metrics, JSON_HEX_APOS) ?>' data-date-format="<?= e('%%Y-%%m-%%d') ?>" data-label-total="<?= t('Total for all columns') ?>"></div>
</section>
<?php endif ?>
diff --git a/app/Template/analytic/cfd.php b/app/Template/analytic/cfd.php
index ab706d56..45f53e0f 100644
--- a/app/Template/analytic/cfd.php
+++ b/app/Template/analytic/cfd.php
@@ -6,7 +6,7 @@
<p class="alert"><?= t('You need at least 2 days of data to show the chart.') ?></p>
<?php else: ?>
<section id="analytic-cfd">
- <div id="chart" data-metrics='<?= json_encode($metrics) ?>' data-date-format="<?= e('%%Y-%%m-%%d') ?>"></div>
+ <div id="chart" data-metrics='<?= json_encode($metrics, JSON_HEX_APOS) ?>' data-date-format="<?= e('%%Y-%%m-%%d') ?>"></div>
</section>
<?php endif ?>
diff --git a/app/Template/analytic/lead_cycle_time.php b/app/Template/analytic/lead_cycle_time.php
index d96bdcb8..8e04bd6d 100644
--- a/app/Template/analytic/lead_cycle_time.php
+++ b/app/Template/analytic/lead_cycle_time.php
@@ -14,7 +14,7 @@
<?php else: ?>
<section id="analytic-lead-cycle-time">
- <div id="chart" data-metrics='<?= json_encode($metrics) ?>' data-label-cycle="<?= t('Cycle Time') ?>" data-label-lead="<?= t('Lead Time') ?>"></div>
+ <div id="chart" data-metrics='<?= json_encode($metrics, JSON_HEX_APOS) ?>' data-label-cycle="<?= t('Cycle Time') ?>" data-label-lead="<?= t('Lead Time') ?>"></div>
<form method="post" class="form-inline" action="<?= $this->url->href('analytic', 'leadAndCycleTime', array('project_id' => $project['id'])) ?>" autocomplete="off">
diff --git a/app/Template/analytic/tasks.php b/app/Template/analytic/tasks.php
index 36f36a23..7392ee56 100644
--- a/app/Template/analytic/tasks.php
+++ b/app/Template/analytic/tasks.php
@@ -7,7 +7,7 @@
<?php else: ?>
<section id="analytic-task-repartition">
- <div id="chart" data-metrics='<?= json_encode($metrics) ?>'></div>
+ <div id="chart" data-metrics='<?= json_encode($metrics, JSON_HEX_APOS) ?>'></div>
<table>
<tr>
diff --git a/app/Template/analytic/users.php b/app/Template/analytic/users.php
index 263ea0ef..514d7133 100644
--- a/app/Template/analytic/users.php
+++ b/app/Template/analytic/users.php
@@ -7,7 +7,7 @@
<?php else: ?>
<section id="analytic-user-repartition">
- <div id="chart" data-metrics='<?= json_encode($metrics) ?>'></div>
+ <div id="chart" data-metrics='<?= json_encode($metrics, JSON_HEX_APOS) ?>'></div>
<table>
<tr>
diff --git a/app/Template/budget/index.php b/app/Template/budget/index.php
index 80153bbd..51ef3d87 100644
--- a/app/Template/budget/index.php
+++ b/app/Template/budget/index.php
@@ -6,8 +6,8 @@
<div id="budget-chart">
<div id="chart"
data-date-format="<?= e('%%Y-%%m-%%d') ?>"
- data-metrics='<?= json_encode($daily_budget) ?>'
- data-labels='<?= json_encode(array('in' => t('Budget line'), 'out' => t('Expenses'), 'left' => t('Remaining'), 'value' => t('Amount'), 'date' => t('Date'), 'type' => t('Type'))) ?>'></div>
+ data-metrics='<?= json_encode($daily_budget, JSON_HEX_APOS) ?>'
+ data-labels='<?= json_encode(array('in' => t('Budget line'), 'out' => t('Expenses'), 'left' => t('Remaining'), 'value' => t('Amount'), 'date' => t('Date'), 'type' => t('Type')), JSON_HEX_APOS) ?>'></div>
</div>
<hr/>
<table class="table-fixed table-stripped">
diff --git a/app/Template/gantt/project.php b/app/Template/gantt/project.php
index 0c545be8..ec45f7f6 100644
--- a/app/Template/gantt/project.php
+++ b/app/Template/gantt/project.php
@@ -35,7 +35,7 @@
<?php if (! empty($tasks)): ?>
<div
id="gantt-chart"
- data-tasks='<?= json_encode($tasks) ?>'
+ data-tasks='<?= json_encode($tasks, JSON_HEX_APOS) ?>'
data-save-url="<?= $this->url->href('gantt', 'saveDate', array('project_id' => $project['id'])) ?>"
data-label-start-date="<?= t('Start date:') ?>"
data-label-end-date="<?= t('Due date:') ?>"
diff --git a/app/Template/task/analytics.php b/app/Template/task/analytics.php
index 3b1d2855..306dd021 100644
--- a/app/Template/task/analytics.php
+++ b/app/Template/task/analytics.php
@@ -10,7 +10,7 @@
</div>
<h3 id="analytic-task-time-column"><?= t('Time spent into each column') ?></h3>
-<div id="chart" data-metrics='<?= json_encode($time_spent_columns) ?>' data-label="<?= t('Time spent') ?>"></div>
+<div id="chart" data-metrics='<?= json_encode($time_spent_columns, JSON_HEX_APOS) ?>' data-label="<?= t('Time spent') ?>"></div>
<table class="table-stripped">
<tr>
<th><?= t('Column') ?></th>