summaryrefslogtreecommitdiffstats
path: root/modules-available/statistics
diff options
context:
space:
mode:
authorSimon Rettberg2022-05-17 14:33:15 +0200
committerSimon Rettberg2022-05-17 14:33:15 +0200
commit60bec31a9aabf43d8a6f13d1d7d1f4d0eccf5de4 (patch)
tree036a5e7f2cf3b465d1081000081374b550c0608a /modules-available/statistics
parent[statistics] Add missing !== false check to query result (diff)
downloadslx-admin-60bec31a9aabf43d8a6f13d1d7d1f4d0eccf5de4.tar.gz
slx-admin-60bec31a9aabf43d8a6f13d1d7d1f4d0eccf5de4.tar.xz
slx-admin-60bec31a9aabf43d8a6f13d1d7d1f4d0eccf5de4.zip
[statistics] Make sure hwname and devpath get valid ASCII only
Diffstat (limited to 'modules-available/statistics')
-rw-r--r--modules-available/statistics/api.inc.php4
-rw-r--r--modules-available/statistics/inc/hardwareparser.inc.php1
2 files changed, 3 insertions, 2 deletions
diff --git a/modules-available/statistics/api.inc.php b/modules-available/statistics/api.inc.php
index aa441b06..88b27d86 100644
--- a/modules-available/statistics/api.inc.php
+++ b/modules-available/statistics/api.inc.php
@@ -330,8 +330,8 @@ if ($type[0] === '~') {
if (!array_key_exists('name', $screen))
continue;
// Filter bogus data
- $screen['name'] = Util::cleanUtf8($screen['name']);
- $port = Util::cleanUtf8($port);
+ $screen['name'] = iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $screen['name']);
+ $port = iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $port);
if (empty($screen['name']))
continue;
if (array_key_exists($screen['name'], $hwids)) {
diff --git a/modules-available/statistics/inc/hardwareparser.inc.php b/modules-available/statistics/inc/hardwareparser.inc.php
index 95b8e31e..b9d1c13b 100644
--- a/modules-available/statistics/inc/hardwareparser.inc.php
+++ b/modules-available/statistics/inc/hardwareparser.inc.php
@@ -163,6 +163,7 @@ class HardwareParser
private static function writeLocalHardwareData(string $uuid, int $hwid, string $pathId, array $props): int
{
// Add mapping between hw entity and machine
+ $pathId = iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $pathId);
$mappingId = Database::insertIgnore('machine_x_hw', 'machinehwid',
['hwid' => $hwid, 'machineuuid' => $uuid, 'devpath' => $pathId],
['disconnecttime' => 0]);