diff options
Diffstat (limited to 'modules-available/statistics/api.inc.php')
-rw-r--r-- | modules-available/statistics/api.inc.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/modules-available/statistics/api.inc.php b/modules-available/statistics/api.inc.php index 30d1fda9..974432c6 100644 --- a/modules-available/statistics/api.inc.php +++ b/modules-available/statistics/api.inc.php @@ -11,17 +11,17 @@ if (substr($ip, 0, 7) === '::ffff:') $ip = substr($ip, 7); * Power/hw/usage stats */ -if ($type{0} === '~') { +if ($type[0] === '~') { // UUID is mandatory $uuid = Request::post('uuid', '', 'string'); $macaddr = Request::post('macaddr', false, 'string'); if ($macaddr !== false) { $macaddr = strtolower(str_replace(':', '-', $macaddr)); - if (strlen($macaddr) !== 17 || $macaddr{2} !== '-') { + if (strlen($macaddr) !== 17 || $macaddr[2] !== '-') { $macaddr = false; } } - if ($macaddr !== false && $uuid{8} !== '-' && substr($uuid, 0, 16) === '000000000000001-') { + if ($macaddr !== false && $uuid[8] !== '-' && substr($uuid, 0, 16) === '000000000000001-') { $uuid = 'baad1d00-9491-4716-b98b-' . str_replace('-', '', $macaddr); } if (strlen($uuid) !== 36 || !preg_match('/^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i', $uuid)) { @@ -427,7 +427,7 @@ function writeClientLog($type, $description) // For backwards compat, we require the . prefix -if ($type{0} === '.') { +if ($type[0] === '.') { if ($type === '.vmchooser-session') { $user = Util::cleanUtf8(Request::post('user', 'unknown', 'string')); $loguser = Request::post('loguser', 0, 'int') !== 0; |