Commit 2fc824fe authored by Till Brehm's avatar Till Brehm
Browse files

Changed PHP syntax in monitor_tools.inc.php for PHP 5.3 compatibility.

parent 7d41f01a
Pipeline #1688 passed with stage
in 2 minutes and 45 seconds
...@@ -254,7 +254,7 @@ class monitor_tools { ...@@ -254,7 +254,7 @@ class monitor_tools {
preg_match_all('/NAME=\"([\w ]+)\"/m', $content, $name); preg_match_all('/NAME=\"([\w ]+)\"/m', $content, $name);
preg_match_all('/VERSION_ID=\"([0-9]{1,2})\.?([0-9]{0,2})\.?([0-9]*).$/m', $content, $version); preg_match_all('/VERSION_ID=\"([0-9]{1,2})\.?([0-9]{0,2})\.?([0-9]*).$/m', $content, $version);
$distname = is_array($name) ? $name[1][0] : 'openSUSE'; $distname = is_array($name) ? $name[1][0] : 'openSUSE';
$distver = is_array($version) ? implode('.', array_filter([$version[1][0],$version[2][0],$version[3][0]],'strlen')) : 'Unknown'; $distver = is_array($version) ? implode('.', array_filter(array($version[1][0],$version[2][0],$version[3][0]),'strlen')) : 'Unknown';
$distid = 'opensuse112'; $distid = 'opensuse112';
$distbaseid = 'opensuse'; $distbaseid = 'opensuse';
} else { } else {
...@@ -309,7 +309,7 @@ class monitor_tools { ...@@ -309,7 +309,7 @@ class monitor_tools {
} elseif(stristr($content, 'CentOS Linux release 7')) { } elseif(stristr($content, 'CentOS Linux release 7')) {
preg_match_all('/([0-9]{1,2})\.?([0-9]{0,2})\.?([0-9]*)/', $content, $version); preg_match_all('/([0-9]{1,2})\.?([0-9]{0,2})\.?([0-9]*)/', $content, $version);
$distname = 'CentOS'; $distname = 'CentOS';
$distver = is_array($version)? implode('.', array_filter([$version[1][0],$version[2][0],$version[3][0]],'strlen')) :'Unknown'; $distver = is_array($version)? implode('.', array_filter(array($version[1][0],$version[2][0],$version[3][0]),'strlen')) :'Unknown';
$distbaseid = 'fedora'; $distbaseid = 'fedora';
$var=explode(" ", $content); $var=explode(" ", $content);
$var=explode(".", $var[3]); $var=explode(".", $var[3]);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment