mirror of
https://github.com/friendica/friendica
synced 2025-04-26 13:50:11 +00:00
Make server domain pattern block reason mandatory
This commit is contained in:
parent
e35651c44a
commit
97ccb4d2c4
3 changed files with 25 additions and 45 deletions
|
@ -155,12 +155,12 @@ HELP;
|
|||
*/
|
||||
private function addBlockedServer(): int
|
||||
{
|
||||
if (count($this->args) < 2 || count($this->args) > 3) {
|
||||
throw new CommandArgsException('Add needs a domain pattern and optionally a reason.');
|
||||
if (count($this->args) != 3) {
|
||||
throw new CommandArgsException('Add needs a domain pattern and a reason.');
|
||||
}
|
||||
|
||||
$pattern = $this->getArgument(1);
|
||||
$reason = (count($this->args) === 3) ? $this->getArgument(2) : DomainPatternBlocklist::DEFAULT_REASON;
|
||||
$reason = $this->getArgument(2);
|
||||
|
||||
$result = $this->blocklist->addPattern($pattern, $reason);
|
||||
if ($result) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue