summaryrefslogtreecommitdiffstats
path: root/modules-available/statistics/install.inc.php
diff options
context:
space:
mode:
authorSimon Rettberg2021-05-06 10:26:09 +0200
committerSimon Rettberg2021-05-11 14:51:13 +0200
commit8dc2b92d667f1401ab9f1315a36add61658f899c (patch)
tree452c5fe040055884cf9d9ee834415db84999a9a1 /modules-available/statistics/install.inc.php
parent[session] Add simple session overview table (diff)
downloadslx-admin-8dc2b92d667f1401ab9f1315a36add61658f899c.tar.gz
slx-admin-8dc2b92d667f1401ab9f1315a36add61658f899c.tar.xz
slx-admin-8dc2b92d667f1401ab9f1315a36add61658f899c.zip
Moderize Database handling
* Auto-convert to utf8mb4_unicode_520_ci * Use foreach instead of while to loop over results * Drop useless statement caching * Keep emulated prepares, as we sometimes loop over nested queries
Diffstat (limited to 'modules-available/statistics/install.inc.php')
-rw-r--r--modules-available/statistics/install.inc.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules-available/statistics/install.inc.php b/modules-available/statistics/install.inc.php
index 3becce8f..15d0d633 100644
--- a/modules-available/statistics/install.inc.php
+++ b/modules-available/statistics/install.inc.php
@@ -248,7 +248,7 @@ if (!tableHasColumn('machine', 'live_tmpsize')) {
// 2019-02-20: Convert bogus UUIDs
$res2 = Database::simpleQuery("SELECT machineuuid, macaddr FROM machine WHERE machineuuid LIKE '00000000000000_-%'");
-while ($row = $res2->fetch(PDO::FETCH_ASSOC)) {
+foreach ($res2 as $row) {
$new = strtoupper('baad1d00-9491-4716-b98b-' . preg_replace('/[^0-9a-f]/i', '', $row['macaddr']));
error_log('Replacing ' . $row['machineuuid'] . ' with ' . $new);
if (strlen($new) === 36) {