mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 16:24:05 +00:00
Utils: fix some implicit casts to boolean on result of preg_match_all()
This commit is contained in:
parent
42a08e7e4a
commit
ae76e8f08f
@ -188,7 +188,7 @@ class Utils{
|
||||
if($os === "win"){
|
||||
@exec("ipconfig /ALL", $mac);
|
||||
$mac = implode("\n", $mac);
|
||||
if(preg_match_all("#Physical Address[. ]{1,}: ([0-9A-F\\-]{17})#", $mac, $matches)){
|
||||
if(preg_match_all("#Physical Address[. ]{1,}: ([0-9A-F\\-]{17})#", $mac, $matches) > 0){
|
||||
foreach($matches[1] as $i => $v){
|
||||
if($v == "00-00-00-00-00-00"){
|
||||
unset($matches[1][$i]);
|
||||
@ -202,7 +202,7 @@ class Utils{
|
||||
}else{
|
||||
@exec("ifconfig 2>/dev/null", $mac);
|
||||
$mac = implode("\n", $mac);
|
||||
if(preg_match_all("#HWaddr[ \t]{1,}([0-9a-f:]{17})#", $mac, $matches)){
|
||||
if(preg_match_all("#HWaddr[ \t]{1,}([0-9a-f:]{17})#", $mac, $matches) > 0){
|
||||
foreach($matches[1] as $i => $v){
|
||||
if($v == "00:00:00:00:00:00"){
|
||||
unset($matches[1][$i]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user