mirror of
https://github.com/pi-hole/web.git
synced 2026-04-28 04:33:58 +01:00
More codacy fixes (#256)
* single quotes to double * Avoid variables with short names like $a. Configured minimum length is 3. * list_type > listType https://www.codacy.com/app/Pi-hole/AdminLTE/file/4753758893/issues/source?bid=3919163&fileBranchId=3919163#l30 * define `refresh` before it is used * single to double quotes * EsLint expects `{}` after `if` * singlequotes to doublequotes * https://www.codacy.com/app/Pi-hole/AdminLTE/file/4753758894/issues/source?bid=3919163&fileBranchId=3919163#l49 * Copy filterArray Function from api.php * missed a single-quote * single>double * `===`, `==` * single to double * Usages come AFTER declarations * missing semi * function delcaration order change * more codacy complaints
This commit is contained in:
14
api.php
14
api.php
@@ -80,16 +80,16 @@
|
||||
$data = array_merge($data, getGravityDomains($gravity));
|
||||
}
|
||||
|
||||
function filterArray(&$a) {
|
||||
$sanArray = array();
|
||||
foreach ($a as $k=>$v) {
|
||||
if (is_array($v)) {
|
||||
$sanArray[htmlspecialchars($k)] = filterArray($v);
|
||||
function filterArray(&$inArray) {
|
||||
$outArray = array();
|
||||
foreach ($inArray as $key=>$value) {
|
||||
if (is_array($value)) {
|
||||
$outArray[htmlspecialchars($key)] = filterArray($value);
|
||||
} else {
|
||||
$sanArray[htmlspecialchars($k)] = htmlspecialchars($v);
|
||||
$outArray[htmlspecialchars($key)] = htmlspecialchars($value);
|
||||
}
|
||||
}
|
||||
return $sanArray;
|
||||
return $outArray;
|
||||
}
|
||||
|
||||
$data = filterArray($data);
|
||||
|
||||
Reference in New Issue
Block a user