From 200c8600d08b403e3e6cb38b9eb9cc8852221bab Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Thu, 18 Jul 2013 15:42:09 +0200 Subject: [PATCH] Replaces exec('uptime') with sys_getloadavg() --- wcfsetup/install/files/lib/acp/page/IndexPage.class.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/wcfsetup/install/files/lib/acp/page/IndexPage.class.php b/wcfsetup/install/files/lib/acp/page/IndexPage.class.php index 3a1fae946f..0c279ad7e6 100755 --- a/wcfsetup/install/files/lib/acp/page/IndexPage.class.php +++ b/wcfsetup/install/files/lib/acp/page/IndexPage.class.php @@ -41,10 +41,9 @@ class IndexPage extends AbstractPage { ); // get load - if ($uptime = @exec("uptime")) { - if (preg_match("/averages?: ([0-9\.]+,?[\s]+[0-9\.]+,?[\s]+[0-9\.]+)/", $uptime, $match)) { - $this->server['load'] = $match[1]; - } + if (function_exists('sys_getloadavg')) { + $load = sys_getloadavg(); + $this->server['load'] = implode(', ', $load); } } -- 2.20.1