]> git.mxchange.org Git - friendica.git/blobdiff - src/Console/ServerBlock.php
Replace $_GET references with $request in Update classes
[friendica.git] / src / Console / ServerBlock.php
index 9ef6777db73d3cf307514922775522c5084ec26c..46e7b89eb99deb8f48a280768f27c376811f39ad 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2022, the Friendica project
+ * @copyright Copyright (C) 2010-2023, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -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) {