X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=mod%2Fdfrn_poll.php;h=54539ee03d7bd4cc580bb7845b9fa34b59734488;hb=684dfd5bbd5c6bea1fee22d121e558cee16ec120;hp=943ddddecc53623fe1b10c23f3e8f28fbd55c7f9;hpb=413424064c30c3b799f03ed728ab0a3f8f5eb424;p=friendica.git diff --git a/mod/dfrn_poll.php b/mod/dfrn_poll.php index 943ddddecc..54539ee03d 100644 --- a/mod/dfrn_poll.php +++ b/mod/dfrn_poll.php @@ -32,7 +32,8 @@ function dfrn_poll_init(App $a) $quiet = x($_GET, 'quiet'); // Possibly it is an OStatus compatible server that requests a user feed - if (($a->argc > 1) && ($dfrn_id == '') && !strstr($_SERVER["HTTP_USER_AGENT"], 'Friendica')) { + $user_agent = defaults($_SERVER, 'HTTP_USER_AGENT', ''); + if (($a->argc > 1) && ($dfrn_id == '') && !strstr($user_agent, 'Friendica')) { $nickname = $a->argv[1]; header("Content-type: application/atom+xml"); echo OStatus::feed($nickname, $last_update, 10); @@ -479,6 +480,12 @@ function dfrn_poll_content(App $a) } if (($type === 'profile') && (strlen($sec))) { + // heluecht: I don't know why we don't fail immediately when the user or contact hadn't been found. + // Since it doesn't make sense to continue from this point on, we now fail here. This should be safe. + if (!DBA::isResult($r)) { + System::httpExit(404, ["title" => L10n::t('Page not found.')]); + } + // URL reply if ($dfrn_version < 2.2) { $s = Network::fetchUrl($r[0]['poll']