Remove some lightly used or unused dbFacile functions (#15418)

* Remove some lightly used or unused dbFacile functions
['NULL'] legacy behavior seems unsupported, replace with actual nulls

* Fix refactor mishap

* another

* update baseline

* these were very wrong... what happened?
This commit is contained in:
Tony Murray
2023-10-12 07:15:03 -07:00
committed by GitHub
parent 0540c56d0f
commit a5198d7d57
29 changed files with 50 additions and 195 deletions

View File

@@ -22,7 +22,7 @@ Debug::set($_REQUEST['debug']);
if (is_numeric($_GET['device_id'])) {
// use php to sort since we need call cleanPort
$interface_map = [];
foreach (dbFetch('SELECT * FROM ports WHERE device_id = ?', [$_GET['device_id']]) as $interface) {
foreach (dbFetchRows('SELECT * FROM ports WHERE device_id = ?', [$_GET['device_id']]) as $interface) {
$interface = cleanPort($interface);
$interface_map[$interface['label']] = $interface;
}

View File

@@ -55,9 +55,9 @@ if (isset($_GET['format']) && preg_match('/^[a-z]*$/', $_GET['format'])) {
} else {
$locations = getlocations();
$loc_count = 1;
foreach (dbFetch('SELECT *, locations.location FROM devices LEFT JOIN locations ON devices.location_id = locations.id WHERE 1 ' . $where, $param) as $device) {
foreach (dbFetchRows('SELECT *, locations.location FROM devices LEFT JOIN locations ON devices.location_id = locations.id WHERE 1 ' . $where, $param) as $device) {
if ($device) {
$links = dbFetch('SELECT * from ports AS I, links AS L WHERE I.device_id = ? AND L.local_port_id = I.port_id ORDER BY L.remote_hostname', [$device['device_id']]);
$links = dbFetchRows('SELECT * from ports AS I, links AS L WHERE I.device_id = ? AND L.local_port_id = I.port_id ORDER BY L.remote_hostname', [$device['device_id']]);
if (count($links)) {
if ($anon) {
$device['hostname'] = md5($device['hostname']);