diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html
index c6143196c2..35b6d45e8d 100644
--- a/phpBB/docs/CHANGELOG.html
+++ b/phpBB/docs/CHANGELOG.html
@@ -90,6 +90,7 @@
[Fix] Made the compress_tar class tolerate archives that do not properly have their archived contents listed (Bug #14429 / thanks to JRSweets for his patch)
[Fix] Moved topics should not count towards the number of topics in a forum (Bug #14648 / thanks to Schumi for his patch)
[Fix] Properly check for invalid characters in MySQL DB prefixes during install (Bug #18775)
+ [Change] Generalize load check (Bug #21255 / thanks to Xipher)
1.ii. Changes since 3.0.0
diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php
index da54a6c512..08f6512424 100644
--- a/phpBB/includes/session.php
+++ b/phpBB/includes/session.php
@@ -217,9 +217,9 @@ class session
// Load limit check (if applicable)
if ($config['limit_load'] || $config['limit_search_load'])
{
- if ($load = @file_get_contents('/proc/loadavg'))
+ if ((function_exists('sys_getloadavg') && $load = sys_getloadavg()) || ($load = explode(' ', @file_get_contents('/proc/loadavg'))))
{
- $this->load = array_slice(explode(' ', $load), 0, 1);
+ $this->load = array_slice($load, 0, 1);
$this->load = floatval($this->load[0]);
}
else