Commit 6ce55e34 authored by Mike Hibler's avatar Mike Hibler

Take care of some unchecked arguments.

parent 45e15aae
<?php
#
# Copyright (c) 2003-2013 University of Utah and the Flux Group.
# Copyright (c) 2003-2014 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -66,14 +66,33 @@ foreach ($_GET as $key => $value) {
}
$interfaces[$ifacenum]["card"] = $ifacenum;
} else {
echo "Bad interface name $value!";
echo "Bad interface name ". CleanString($value). ", ignored!";
$interfaces[$ifacenum]["bad"] = 1;
continue;
}
} else if ($vartype == "driver") {
$interfaces[$ifacenum]["type"] = $value;
if (preg_match("/^([a-z]+)$/i",$value,$matches)) {
$interfaces[$ifacenum]["type"] = $matches[1];
} else {
$interfaces[$ifacenum]["mac"] = $value;
echo "Bad interface type ". CleanString($value). ", ignored!";
$interfaces[$ifacenum]["bad"] = 1;
continue;
}
} else {
if (preg_match("/^([0-9a-f]+)$/i",$value,$matches)) {
$interfaces[$ifacenum]["mac"] = $matches[1];
} else {
echo "Bad interface MAC ". CleanString($value). ", ignored!";
$interfaces[$ifacenum]["bad"] = 1;
continue;
}
}
}
}
# weed out bad ones
foreach ($interfaces as $i => $interface) {
if (isset($interface["bad"])) {
unset($interfaces[$i]);
}
}
......
Markdown is supported
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