Version 1.0.2 escaping attr in rendered code
This commit is contained in:
parent
db6109e748
commit
0d727f3aee
3 changed files with 10 additions and 9 deletions
|
@ -4,7 +4,7 @@ Tags: web analytics, tracking, web traffic, analytics
|
|||
Requires at least: 5.2
|
||||
Tested up to: 5.8.2
|
||||
Requires PHP: 7.2
|
||||
Stable tag: 1.0.1
|
||||
Stable tag: 1.0.2
|
||||
License: GPLv2
|
||||
|
||||
Easily add Wide Angle Analytics tracker script to your WordPress site. You can quickly configure your web analytics tracker script.
|
||||
|
|
|
@ -26,11 +26,12 @@ EOD;
|
|||
function generateFooterScript() {
|
||||
$pathExlusionsAttribute = $this->generateExclusionsAttribute();
|
||||
$includeParamsAttribute = $this->generateIncludeParamsAttribute();
|
||||
|
||||
$trackerUrlAttribute = esc_attr("https://{$this->trackerDomain}/script/{$this->siteId}.js");
|
||||
$ignoreHashAttribute = esc_attr($this->ignoreHash);
|
||||
$script = <<<EOD
|
||||
<script async defer
|
||||
src="https://{$this->trackerDomain}/script/{$this->siteId}.js"
|
||||
data-waa-ignore-hash="{$this->ignoreHash}"
|
||||
src="{$trackerUrlAttribute}"
|
||||
data-waa-ignore-hash="{$ignoreHashAttribute}"
|
||||
$includeParamsAttribute
|
||||
$pathExlusionsAttribute></script>
|
||||
EOD;
|
||||
|
@ -40,7 +41,7 @@ EOD;
|
|||
private function generateIncludeParamsAttribute() {
|
||||
$params = $this->helpers->parseIncludeParamsSetting($this->includeParamsString);
|
||||
if(sizeof($params) > 0) {
|
||||
return "data-waa-inc-params=\"" . implode(",", $params) . "\"";
|
||||
return "data-waa-inc-params=\"" . esc_attr(implode(",", $params)) . "\"";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
@ -54,7 +55,7 @@ EOD;
|
|||
|
||||
$pathExlusionsAttributeWithKey = "";
|
||||
if(trim($pathExlusionsAttribute) != "") {
|
||||
$pathExlusionsAttributeWithKey = "data-waa-exc-paths=\"" . $pathExlusionsAttribute ."\"";
|
||||
$pathExlusionsAttributeWithKey = "data-waa-exc-paths=\"" . esc_attr($pathExlusionsAttribute) ."\"";
|
||||
}
|
||||
return $pathExlusionsAttributeWithKey;
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
Description: Easily enable and configure Wide Angle Analytics on your Wordpress site
|
||||
Author: Wide Angle Analytics by Input Objects GmbH
|
||||
Author URI: https://wideangle.co
|
||||
Version: 1.0.1
|
||||
Version: 1.0.2
|
||||
Requires at least: 5.2
|
||||
Requires PHP: 7.2
|
||||
License: GPL v2
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue