Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorMatthieu Napoli <matthieu@mnapoli.fr>2014-10-16 04:17:06 +0400
committerMatthieu Napoli <matthieu@mnapoli.fr>2014-10-16 04:17:06 +0400
commita1e70f90bde3692fc153f9c395baf1bed214c2b1 (patch)
treea63bbcf90e0da606f5d6f3cfff27357898e1fa80 /core
parentb97df3c84dd41c9149682c19b8d30b8dcfd4adf3 (diff)
parenta8bf225b405fa5be58f1622cf6c2bbcb5ee91a4c (diff)
Merge branch 'master' into bugfix/6156
Diffstat (limited to 'core')
-rw-r--r--core/Common.php16
1 files changed, 13 insertions, 3 deletions
diff --git a/core/Common.php b/core/Common.php
index a11b3f977b..76c9777605 100644
--- a/core/Common.php
+++ b/core/Common.php
@@ -314,6 +314,8 @@ class Common
// note: before php 5.2.7, htmlspecialchars() double encodes &#x hex items
$value = html_entity_decode($value, self::HTML_ENCODING_QUOTE_STYLE, 'UTF-8');
+ $value = self::sanitizeNullBytes($value);
+
// escape
$tmp = @htmlspecialchars($value, self::HTML_ENCODING_QUOTE_STYLE, 'UTF-8');
@@ -383,13 +385,21 @@ class Common
}
/**
- *
- * @param string
+ * @param string $value
* @return string Line breaks and line carriage removed
*/
public static function sanitizeLineBreaks($value)
{
- return str_replace(array("\n", "\r", "\0"), '', $value);
+ return str_replace(array("\n", "\r"), '', $value);
+ }
+
+ /**
+ * @param string $value
+ * @return string Null bytes removed
+ */
+ public static function sanitizeNullBytes($value)
+ {
+ return str_replace(array("\0"), '', $value);
}
/**