throw new \Friendica\Network\HTTPException\InternalServerErrorException();
}
$this->dispatchPrivate($user, $postdata);
- } elseif (!$this->dispatchPublic($postdata)) {
- (new Salmon(
- $this->database,
- $this->l10n,
- $this->baseUrl,
- $this->args,
- $this->logger,
- $this->profiler,
- $this->response,
- $this->server,
- $this->parameters
- ))->rawContent($request);
+ } else {
+ $this->dispatchPublic($postdata);
}
}
{
$xml = Network::postdata();
- $this->logger->debug('New Salmon', ['nickname' => $this->parameters['nickname'], 'xml' => $xml]);
-
- // Despite having a route with a mandatory nickname parameter, this method can also be called from
- // \Friendica\Module\DFRN\Notify->post where the same parameter is optional 🤷
$nickname = $this->parameters['nickname'] ?? '';
+ if (empty($nickname)) {
+ throw new HTTPException\BadRequestException('nickname parameter is mandatory');
+ }
+
+ $this->logger->debug('New Salmon', ['nickname' => $nickname, 'xml' => $xml]);
$importer = $this->database->selectFirst('user', [], ['nickname' => $nickname, 'account_expired' => false, 'account_removed' => false]);
if (!$this->database->isResult($importer)) {