]> git.mxchange.org Git - friendica.git/blobdiff - mod/dfrn_poll.php
Merge pull request #7095 from annando/ap-connect
[friendica.git] / mod / dfrn_poll.php
index 928690060f4819c3904eaee8159808d11a15ed1d..6c849cb807fa6b28059991e51e6207cb9a85aa84 100644 (file)
@@ -28,7 +28,6 @@ function dfrn_poll_init(App $a)
        $challenge       = defaults($_GET, 'challenge'      , '');
        $sec             = defaults($_GET, 'sec'            , '');
        $dfrn_version    = (float) defaults($_GET, 'dfrn_version'   , 2.0);
-       $perm            = defaults($_GET, 'perm'           , 'r');
        $quiet                   = !empty($_GET['quiet']);
 
        // Possibly it is an OStatus compatible server that requests a user feed
@@ -51,7 +50,7 @@ function dfrn_poll_init(App $a)
 
        if (($dfrn_id === '') && empty($_POST['dfrn_id'])) {
                if (Config::get('system', 'block_public') && !local_user() && !remote_user()) {
-                       System::httpExit(403);
+                       throw new \Friendica\Network\HTTPException\ForbiddenException();
                }
 
                $user = '';
@@ -60,7 +59,7 @@ function dfrn_poll_init(App $a)
                                DBA::escape($a->argv[1])
                        );
                        if (!$r) {
-                               System::httpExit(404);
+                               throw new \Friendica\Network\HTTPException\NotFoundException();
                        }
 
                        $hidewall = ($r[0]['hidewall'] && !local_user());
@@ -319,15 +318,12 @@ function dfrn_poll_post(App $a)
        switch ($direction) {
                case -1:
                        $sql_extra = sprintf(" AND `issued-id` = '%s' ", DBA::escape($dfrn_id));
-                       $my_id = $dfrn_id;
                        break;
                case 0:
                        $sql_extra = sprintf(" AND `issued-id` = '%s' AND `duplex` = 1 ", DBA::escape($dfrn_id));
-                       $my_id = '1:' . $dfrn_id;
                        break;
                case 1:
                        $sql_extra = sprintf(" AND `dfrn-id` = '%s' AND `duplex` = 1 ", DBA::escape($dfrn_id));
-                       $my_id = '0:' . $dfrn_id;
                        break;
                default:
                        $a->internalRedirect();
@@ -420,7 +416,7 @@ function dfrn_poll_content(App $a)
                DBA::delete('challenge', ["`expire` < ?", time()]);
 
                if ($type !== 'profile') {
-                       $r = q("INSERT INTO `challenge` ( `challenge`, `dfrn-id`, `expire` , `type`, `last_update` )
+                       q("INSERT INTO `challenge` ( `challenge`, `dfrn-id`, `expire` , `type`, `last_update` )
                                VALUES( '%s', '%s', '%s', '%s', '%s' ) ",
                                DBA::escape($hash),
                                DBA::escape($dfrn_id),
@@ -487,7 +483,7 @@ function dfrn_poll_content(App $a)
                        // 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.')]);
+                               throw new \Friendica\Network\HTTPException\NotFoundException();
                        }
 
                        // URL reply