Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Bugfix for project issue #926 #13

Merged
merged 1 commit into from about 2 years ago

3 participants

Ángel Guzmán Maeso Walter Secco Danny Terweij
Ángel Guzmán Maeso
Collaborator
Danny Terweij dterweij merged commit f13d8a5 into from March 03, 2012
Danny Terweij dterweij closed this March 03, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
15  kloxo/httpdocs/htmllib/lib/linuxlib.php
@@ -199,10 +199,17 @@ function getIPs_from_ifcfg()
199 199
 		$list = Ipaddress__Redhat::getCurrentIps();
200 200
 	}
201 201
 
202  
-	foreach($list as $k => $v) {
203  
-		if ($v['ipaddr'] === '127.0.0.1') { continue; };
204  
-
205  
-		$iplist[] = $v['ipaddr'];
  202
+	$iplist = array(); // Initialize return value
  203
+	if(!empty($list)) {
  204
+		foreach($list as $k => $v) {
  205
+			// Check ipaddr index
  206
+			$ip_address = isset($v['ipaddr']) ? $v['ipaddr'] : NULL;
  207
+			
  208
+			// Skip localhost IP or empty values
  209
+			if ($ip_address !== '127.0.0.1' && !empty($ip_address)) { 
  210
+				$iplist[] = $ip_address;
  211
+			}
  212
+		}
206 213
 	}
207 214
 
208 215
 	return $iplist;
2  kloxo/httpdocs/htmllib/lib/pserver/driver/ipaddress__redhatlib.php
@@ -208,7 +208,7 @@ static function getCurrentIps()
208 208
 		}
209 209
 	}
210 210
 
211  
-	$result = "";
  211
+	$result = array(); // Initialize as array (expected return result)
212 212
 
213 213
 	foreach($result1 as $res) {
214 214
 
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.