summaryrefslogtreecommitdiffstats
path: root/modules-available/statistics/api.inc.php
diff options
context:
space:
mode:
authorSimon Rettberg2025-07-07 13:37:19 +0200
committerSimon Rettberg2025-07-07 13:37:19 +0200
commit9a5106c288519b008e0dfe5e85371701af32c0f3 (patch)
treefcfdc6efaf16d2ecefb2bc5822324e9324d6f29f /modules-available/statistics/api.inc.php
parent[locations] Copy permissions to children when deleting location (diff)
downloadslx-admin-9a5106c288519b008e0dfe5e85371701af32c0f3.tar.gz
slx-admin-9a5106c288519b008e0dfe5e85371701af32c0f3.tar.xz
slx-admin-9a5106c288519b008e0dfe5e85371701af32c0f3.zip
[locations] Cleanup Location class
There was a mess of functions which mostly, but not quite, did the same things. Get rid of a couple of them and fix call sites to use alternative ones that also fit the job. While at it, add phpdoc and comments to the remaining functions, trying to clarify what they were designed for. Lastly, the return type of functions that retrieve a location id has been changed from false|int to ?int (nullable types are just nicer).
Diffstat (limited to 'modules-available/statistics/api.inc.php')
-rw-r--r--modules-available/statistics/api.inc.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules-available/statistics/api.inc.php b/modules-available/statistics/api.inc.php
index 8bc2c5ef..8f0f0810 100644
--- a/modules-available/statistics/api.inc.php
+++ b/modules-available/statistics/api.inc.php
@@ -171,7 +171,7 @@ if ($type[0] === '~') {
if (($old === false || $old['clientip'] !== $ip) && Module::isAvailable('locations')) {
// New, or ip changed (dynamic pool?), update subnetlicationid
$loc = Location::updateMapIpToLocation($uuid, $ip);
- $new['locationid'] = $loc; // For Filter Event
+ $new['locationid'] = $loc ?? 0; // For Filter Event
}
if ($json !== false) {