Skip to content

Commit

Permalink
Merge pull request #12 from gpsietzema/development
Browse files Browse the repository at this point in the history
Fixed XSS vulnerability #11
  • Loading branch information
gpsietzema committed Mar 9, 2017
2 parents 7970f26 + 27d948d commit 855d956
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
5 changes: 2 additions & 3 deletions config.core.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<?php
define('MODX_CORE_PATH', dirname(dirname(__FILE__)).'/core/');
define('MODX_CONFIG_KEY', 'config');
?>
define('MODX_CORE_PATH', '/var/www/vhosts/modx2/corDvn78h87wvse/');
define('MODX_CONFIG_KEY', 'config');
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@

<thead>
<tr>
<th>{$_langs.sources}</th>
<th>{$_langs.sources|escape:"html"}</th>
<th>{$_langs.visits}</th>
<th>% {$_langs.new_visits}</th>
</tr>
Expand All @@ -64,7 +64,7 @@
{foreach from=$toptrafficsource.rows item=toptraffic}
{if $i == 5}{break}{/if}
<tr class="{cycle values=',odd'}">
<td>{$toptraffic.0}</td>
<td>{$toptraffic.0|escape:"html"}</td>
<td>{$toptraffic.1}</td>
<td>{$toptraffic.5|number_format:2:",":"."} %</td>
</tr>
Expand All @@ -79,7 +79,7 @@
<table class="classy" style="width: 48%; float:left; margin-right:2%;">
<thead>
<tr>
<th>{$_langs.keywords}</th>
<th>{$_langs.keywords|escape:"html"}</th>
<th>{$_langs.visits}</th>
<th>% {$_langs.new_visits}</th>
</tr>
Expand All @@ -91,7 +91,7 @@
{if $keyword.keyword != '(not set)'}
{if $i == 5}{break}{/if}
<tr class="{cycle values=',odd'}">
<td>{$keyword.0}</td>
<td>{$keyword.0|escape:"html"}</td>
<td>{$keyword.1}</td>
<td>{$keyword.3|number_format:2:",":"."} %</td>
</tr>
Expand All @@ -110,7 +110,7 @@

<thead>
<tr>
<th>{$_langs.sources}</th>
<th>{$_langs.sources|escape:"html"}</th>
<th>{$_langs.visits}</th>
<th>{$_langs.pages_visits}</th>
<th>{$_langs.average_site_time}</th>
Expand All @@ -125,7 +125,7 @@
{if $i == 10}{break}{/if}

<tr class="{cycle values=',odd'}">
<td>{$trafficreffered.0}</td>
<td>{$trafficreffered.0|escape:"html"}</td>
<td>{$trafficreffered.1}</td>
<td>{$trafficreffered.3|number_format:2:",":"."} %</td>
<td>{$trafficreffered.4|number_format:2}</td>
Expand All @@ -150,7 +150,7 @@
<table class="classy" style="width: 100%;">
<thead>
<tr>
<th style="width: 40%;">{$_langs.page}</th>
<th style="width: 40%;">{$_langs.page|escape:"html"}</th>
<th style="width: 20%;">{$_langs.entrances}</th>
<th style="width: 20%;">{$_langs.bounces}</th>
<th style="width: 20%;">{$_langs.bounce_rate}</th>
Expand All @@ -161,7 +161,7 @@
{foreach from=$toplandingspages.rows item=toppage}
{if $i == 10}{break}{/if}
<tr class="{cycle values=',odd'}">
<td>{$toppage.0}</td>
<td>{$toppage.0|escape:"html"}</td>
<td>{$toppage.1}</td>
<td>{$toppage.2}</td>
<td>{$toppage.3|number_format:2:",":"."} %</td>
Expand Down Expand Up @@ -232,7 +232,7 @@
<table class="classy" style="width: 100%;">
<thead>
<tr>
<th>{$_langs.keywords}</th>
<th>{$_langs.keywords|escape:"html"}</th>
<th>{$_langs.visits}</th>
<th>{$_langs.pages_visits}</th>
<th>{$_langs.average_site_time}</th>
Expand All @@ -246,7 +246,7 @@
{if $keyword.keyword != '(not set)'}
{if $i == 20}{break}{/if}
<tr class="{cycle values=',odd'}">
<td>{$keyword.0}</td>
<td>{$keyword.0|escape:"html"}</td>
<td>{$keyword.1}</td>
<td>{$keyword.2|number_format:2:",":"."} %</td>
<td>{$keyword.3|number_format:2}</td>
Expand All @@ -268,7 +268,7 @@
<table class="classy" style="width: 100%;">
<thead>
<tr>
<th>{$_langs.search_keyword}</th>
<th>{$_langs.search_keyword|escape:"html"}</th>
<th>{$_langs.search_uniques}</th>
<th>{$_langs.search_result_views}</th>
<th>% {$_langs.search_exits}</th>
Expand All @@ -281,7 +281,7 @@
{foreach from=$sitesearches.rows item=sitesearch}
{if $i == 20}{break}{/if}
<tr class="{cycle values=',odd'}">
<td>{$sitesearch.0}</td>
<td>{$sitesearch.0|escape:"html"}</td>
<td>{$sitesearch.1}</td>
<td>{$sitesearch.2}</td>
<td>{$sitesearch.3|number_format:2:",":"."} %</td>
Expand Down
3 changes: 2 additions & 1 deletion core/components/analyticsdashboardwidget/processors/data.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
if(isset($analytics)){
if($format == 'json'){
if(in_array($data, array('trafficsourceschararr', 'mobile', 'goalstable', 'profiles'))){
print(json_encode($analytics[$data]));
$data = $analytics[$data];
print(json_encode($data));
}else{
print(json_encode($analytics[$data]['rows']));
}
Expand Down

0 comments on commit 855d956

Please sign in to comment.