Skip to content

Instantly share code, notes, and snippets.

@derekschrock
Created December 23, 2017 02:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save derekschrock/211ac4a32673321b7a8fb8bca6476f93 to your computer and use it in GitHub Desktop.
Save derekschrock/211ac4a32673321b7a8fb8bca6476f93 to your computer and use it in GitHub Desktop.
--- /usr/jails/apache/usr/local/www/phpvirtualbox/endpoints/lib/vboxconnector.php 2017-09-10 05:57:43.000000000 -0400
+++ vboxconnector.php 2017-12-22 21:57:11.691738000 -0500
@@ -1593,7 +1593,7 @@
// Network properties
$eprops = $n->getProperties(null);
$eprops = array_combine($eprops[1],$eprops[0]);
- $iprops = array_map(create_function('$a','$b=explode("=",$a); return array($b[0]=>$b[1]);'),preg_split('/[\r|\n]+/',$args['networkAdapters'][$i]['properties']));
+ $iprops = array_map(function ($a) { $b=explode("=",$a); return array($b[0]=>$b[1]); },preg_split('/[\r|\n]+/',$args['networkAdapters'][$i]['properties']));
$inprops = array();
foreach($iprops as $a) {
foreach($a as $k=>$v)
@@ -2113,7 +2113,7 @@
// Network properties
$eprops = $n->getProperties(null);
$eprops = array_combine($eprops[1],$eprops[0]);
- $iprops = array_map(create_function('$a','$b=explode("=",$a); return array($b[0]=>$b[1]);'),preg_split('/[\r|\n]+/',$args['networkAdapters'][$i]['properties']));
+ $iprops = array_map(function ($a) { $b=explode("=",$a); return array($b[0]=>$b[1]); } ,preg_split('/[\r|\n]+/',$args['networkAdapters'][$i]['properties']));
$inprops = array();
foreach($iprops as $a) {
foreach($a as $k=>$v)
@@ -3942,7 +3942,7 @@
else $nd = null;
$props = $n->getProperties(null);
- $props = implode("\n",array_map(create_function('$a,$b','return "$a=$b";'),$props[1],$props[0]));
+ $props = implode("\n",array_map(function ($a,$b) { return "$a=$b"; },$props[1],$props[0]));
$adapters[] = array(
'adapterType' => (string)$n->adapterType,
@@ -4498,7 +4498,7 @@
}
// sort by port then device
- usort($return,create_function('$a,$b', 'if($a["port"] == $b["port"]) { if($a["device"] < $b["device"]) { return -1; } if($a["device"] > $b["device"]) { return 1; } return 0; } if($a["port"] < $b["port"]) { return -1; } return 1;'));
+ usort($return,function ($a,$b) { if($a["port"] == $b["port"]) { if($a["device"] < $b["device"]) { return -1; } if($a["device"] > $b["device"]) { return 1; } return 0; } if($a["port"] < $b["port"]) { return -1; } return 1; });
return $return;
}
@zoon01
Copy link

zoon01 commented Dec 23, 2017

confirm correct working

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment