Skip to content
Extraits de code Groupes Projets
Valider 41b9edb9 rédigé par Benaka Moorthi's avatar Benaka Moorthi
Parcourir les fichiers

Fix '% Visit' datatable column header bug by using |raw and make sure goal...

Fix '% Visit' datatable column header bug by using |raw and make sure goal names are escaped in HtmlTable::setShowGoalsColumnsProperties.
parent ee2d113e
Branches
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -292,7 +292,7 @@ class Metrics ...@@ -292,7 +292,7 @@ class Metrics
public static function getPercentVisitColumn() public static function getPercentVisitColumn()
{ {
$percentVisitsLabel = str_replace(' ', html_entity_decode(' '), Piwik_Translate('General_ColumnPercentageVisits')); $percentVisitsLabel = str_replace(' ', ' ', Piwik_Translate('General_ColumnPercentageVisits'));
return $percentVisitsLabel; return $percentVisitsLabel;
} }
} }
\ No newline at end of file
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
{{ properties.metrics_documentation[column] }} {{ properties.metrics_documentation[column] }}
</div> </div>
{% endif %} {% endif %}
<div id="thDIV">{{ properties.translations[column]|default(column) }}</div> <div id="thDIV">{{ properties.translations[column]|default(column)|raw }}</div>
</th> </th>
{% endfor %} {% endfor %}
</tr> </tr>
......
...@@ -376,6 +376,7 @@ class HtmlTable extends DataTableVisualization ...@@ -376,6 +376,7 @@ class HtmlTable extends DataTableVisualization
// get all goals to display info for // get all goals to display info for
$allGoals = array(); $allGoals = array();
// add the ecommerce goal if ecommerce is enabled for the site
if (Site::isEcommerceEnabledFor($idSite)) { if (Site::isEcommerceEnabledFor($idSite)) {
$ecommerceGoal = array( $ecommerceGoal = array(
'idgoal' => Piwik::LABEL_ID_GOAL_IS_ECOMMERCE_ORDER, 'idgoal' => Piwik::LABEL_ID_GOAL_IS_ECOMMERCE_ORDER,
...@@ -385,8 +386,11 @@ class HtmlTable extends DataTableVisualization ...@@ -385,8 +386,11 @@ class HtmlTable extends DataTableVisualization
$allGoals[$ecommerceGoal['idgoal']] = $ecommerceGoal; $allGoals[$ecommerceGoal['idgoal']] = $ecommerceGoal;
} }
// add the site's goals (and escape all goal names)
$siteGoals = Goals_API::getInstance()->getGoals($idSite); $siteGoals = Goals_API::getInstance()->getGoals($idSite);
foreach ($siteGoals as &$goal) { foreach ($siteGoals as &$goal) {
$goal['name'] = Common::sanitizeInputValue($goal['name']);
$goal['quoted_name'] = '"' . $goal['name'] . '"'; $goal['quoted_name'] = '"' . $goal['name'] . '"';
$allGoals[$goal['idgoal']] = $goal; $allGoals[$goal['idgoal']] = $goal;
} }
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter