diff --git a/Makefile b/Makefile
index 6d2dd1b3..a3ab48a0 100644
--- a/Makefile
+++ b/Makefile
@@ -30,7 +30,7 @@ PHPCBF = phpcbf
##########################################################
# Gweb version
-GWEB_VERSION = 3.7.5
+GWEB_VERSION = 3.7.7
DIST_NAME = ganglia-web
DIST_DIR = $(DIST_NAME)-$(GWEB_VERSION)
diff --git a/cluster_view.php b/cluster_view.php
index 998ad659..fed4ed89 100644
--- a/cluster_view.php
+++ b/cluster_view.php
@@ -372,7 +372,7 @@ function get_cluster_overview($showhosts,
$overview["cluster_load"] = join(", ", $cluster_load);
$avg_cpu_num = find_avg($clustername, "", "cpu_num");
- if ($avg_cpu_num == 0)
+ if ((float)$avg_cpu_num == 0)
$avg_cpu_num = 1;
$cluster_util =
sprintf("%.0f%%",
diff --git a/dwoo/Dwoo/Core.php b/dwoo/Dwoo/Core.php
index 8ec104bf..24440e3a 100644
--- a/dwoo/Dwoo/Core.php
+++ b/dwoo/Dwoo/Core.php
@@ -1250,7 +1250,7 @@ public function readVarInto($varstr, $data, $safeRead = false)
}
unset($varstr);
- while (list($k, $sep) = each($m[1])) {
+ foreach ($m[1] as $k => $sep) {
if ($sep === '.' || $sep === '[' || $sep === '') {
// strip enclosing quotes if present
$m[2][$k] = preg_replace('#^(["\']?)(.*?)\1$#', '$2', $m[2][$k]);
@@ -1425,7 +1425,7 @@ public function readVar($varstr)
$cur = $this->scope;
}
- while (list($k, $sep) = each($m[1])) {
+ foreach ($m[1] as $k => $sep) {
if ($sep === '.' || $sep === '[' || $sep === '') {
if ((is_array($cur) || $cur instanceof ArrayAccess) && isset($cur[$m[2][$k]])) {
$cur = $cur[$m[2][$k]];
@@ -1470,7 +1470,7 @@ public function assignInScope($value, $scope)
$cur =& $this->scope;
$last = array(array_pop($m[1]), array_pop($m[2]));
- while (list($k, $sep) = each($m[1])) {
+ foreach ($m[1] as $k => $sep) {
if ($sep === '.' || $sep === '[' || $sep === '') {
if (is_array($cur) === false) {
$cur = array();
diff --git a/dwoo/Dwoo/Data.php b/dwoo/Dwoo/Data.php
index c5f292ec..2772f15d 100644
--- a/dwoo/Dwoo/Data.php
+++ b/dwoo/Dwoo/Data.php
@@ -71,7 +71,7 @@ public function setData(array $data)
public function mergeData(array $data)
{
$args = func_get_args();
- while (list(,$v) = each($args)) {
+ foreach ($args as $v) {
if (is_array($v)) {
$this->data = array_merge($this->data, $v);
}
@@ -90,8 +90,9 @@ public function assign($name, $val = null)
{
if (is_array($name)) {
reset($name);
- while (list($k,$v) = each($name))
+ foreach ($name as $k => $v) {
$this->data[$k] = $v;
+ }
} else {
$this->data[$name] = $val;
}
diff --git a/dwoo/plugins/builtin/blocks/textformat.php b/dwoo/plugins/builtin/blocks/textformat.php
index fb0f4229..c018f1eb 100644
--- a/dwoo/plugins/builtin/blocks/textformat.php
+++ b/dwoo/plugins/builtin/blocks/textformat.php
@@ -67,7 +67,7 @@ public function process()
// gets paragraphs
$pgs = explode("\n", str_replace(array("\r\n", "\r"), "\n", $this->buffer));
- while (list($i,) = each($pgs)) {
+ foreach ($pgs as $i => $values) {
if (empty($pgs[$i])) {
continue;
}
diff --git a/dwoo/plugins/builtin/functions/capitalize.php b/dwoo/plugins/builtin/functions/capitalize.php
index d04f39ba..59cf4fe1 100644
--- a/dwoo/plugins/builtin/functions/capitalize.php
+++ b/dwoo/plugins/builtin/functions/capitalize.php
@@ -25,7 +25,7 @@ function Dwoo_Plugin_capitalize(Dwoo_Core $dwoo, $value, $numwords=false)
} else {
$bits = explode(' ', (string) $value);
$out = '';
- while (list(,$v) = each($bits)) {
+ foreach ($bits as $v) {
if (preg_match('#^[^0-9]+$#', $v)) {
$out .= ' '.mb_convert_case($v, MB_CASE_TITLE, $dwoo->getCharset());
} else {
diff --git a/ganglia.php b/ganglia.php
index 262b88e8..3d1b3252 100644
--- a/ganglia.php
+++ b/ganglia.php
@@ -350,7 +350,7 @@ function Gmetad () {
}
if ($debug) print "
DEBUG: Creating parser\n";
- if ( isset($context) && is_array($context) && isset($SKIP_GMETAD_CONTEXTS) && is_array($SKIP_GMETAD_CONTEXTS) && in_array($context, $SKIP_GMETAD_CONTEXTS) ) {
+ if ( is_array($SKIP_GMETAD_CONTEXTS) && in_array($context, $SKIP_GMETAD_CONTEXTS) ) {
return TRUE;
}
$parser = xml_parser_create();
diff --git a/get_ganglia.php b/get_ganglia.php
index 50e5fe81..d9c4f2ea 100644
--- a/get_ganglia.php
+++ b/get_ganglia.php
@@ -7,7 +7,7 @@
# If we are in compare_hosts, views and decompose_graph context we shouldn't attempt
# any connections to the gmetad
-if (! in_array($context, $SKIP_GMETAD_CONTEXTS) ) {
+if (! ( is_array($SKIP_GMETAD_CONTEXTS) && in_array($context, $SKIP_GMETAD_CONTEXTS) ) ) {
if (! Gmetad($conf['ganglia_ip'], $conf['ganglia_port']) )
{
print "