mirror of
https://github.com/friendica/friendica
synced 2025-04-23 11:50:12 +00:00
Avoid problems with an empty domain in the blocklist (#13919)
* Avoid problems with an empty domain in the blocklist * Test code removed
This commit is contained in:
parent
9ad452a19b
commit
cb294cf411
2 changed files with 3 additions and 3 deletions
|
@ -57,11 +57,11 @@ class Index extends BaseModeration
|
|||
|
||||
// Edit the entries from blocklist
|
||||
$blocklist = [];
|
||||
foreach ($request['domain'] as $id => $domain) {
|
||||
foreach ((array)$request['domain'] as $id => $domain) {
|
||||
// Trimming whitespaces as well as any lingering slashes
|
||||
$domain = trim($domain);
|
||||
$reason = trim($request['reason'][$id]);
|
||||
if (empty($request['delete'][$id])) {
|
||||
if (empty($request['delete'][$id]) && !empty($domain)) {
|
||||
$blocklist[] = [
|
||||
'domain' => $domain,
|
||||
'reason' => $reason
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue