trim_db fix config pull
This commit is contained in:
@@ -65,7 +65,6 @@ function pull_db(): array {
|
|||||||
usort($pbdb, function ($a, $b) {
|
usort($pbdb, function ($a, $b) {
|
||||||
return strcasecmp($a['name'], $b['name']);
|
return strcasecmp($a['name'], $b['name']);
|
||||||
});
|
});
|
||||||
|
|
||||||
return $pbdb;
|
return $pbdb;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -82,16 +81,14 @@ function trim_db($pbdb): array {
|
|||||||
|
|
||||||
array_unshift($pbdb, ...$pbdb_prepend);
|
array_unshift($pbdb, ...$pbdb_prepend);
|
||||||
|
|
||||||
$remove_names = read_config_ini($BLACKLISTED_TERMS);
|
$filtered = array_filter($pbdb, function ($item) use ($BLACKLISTED_TERMS) {
|
||||||
|
|
||||||
$filtered = array_filter($pbdb, function ($item) use ($remove_names) {
|
|
||||||
if (!is_array($item) || !isset($item['name'])) {
|
if (!is_array($item) || !isset($item['name'])) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
$name = ltrim($item['name']);
|
$name = ltrim($item['name']);
|
||||||
|
|
||||||
foreach ($remove_names as $remove_name) {
|
foreach ($BLACKLISTED_TERMS as $BLACKLISTED_TERM) {
|
||||||
if (stripos($name, $remove_name) === 0) {
|
if (stripos($name, $BLACKLISTED_TERM) === 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user