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