diff options
author | Renato Botelho <renato@netgate.com> | 2015-10-09 11:10:19 -0300 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2015-10-09 11:11:31 -0300 |
commit | 8822be67ce3085c30a1127960d6c8ae1d7eb1876 (patch) | |
tree | 2d8095a1a8869c21e6ebd5cec39c967b159bf7e2 /src/usr/local/www/widgets/include | |
parent | 3928c6f1bcf911097366f075994dc9a61716e6e3 (diff) | |
download | pfsense-8822be67ce3085c30a1127960d6c8ae1d7eb1876.zip pfsense-8822be67ce3085c30a1127960d6c8ae1d7eb1876.tar.gz |
Ignore possible erroneously negative temperatures
It's based on 2 pull requests (#1800 and #1801) by nagyrobi
Diffstat (limited to 'src/usr/local/www/widgets/include')
-rw-r--r-- | src/usr/local/www/widgets/include/thermal_sensors.inc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/usr/local/www/widgets/include/thermal_sensors.inc b/src/usr/local/www/widgets/include/thermal_sensors.inc index a6e727a..e6ddb58 100644 --- a/src/usr/local/www/widgets/include/thermal_sensors.inc +++ b/src/usr/local/www/widgets/include/thermal_sensors.inc @@ -20,8 +20,10 @@ $thermal_sensors_widget_title = "Thermal Sensors"; function getThermalSensorsData() { $_gb = exec("/sbin/sysctl -a | grep temperature", $dfout); - $thermalSensorsData = join("|", $dfout); - return $thermalSensorsData; + $dfout_filtered = array_filter($dfout, function($v) { + return strpos($negsign, ' -') === false; + }); + return join("|", $dfout_filtered); } ?> |