X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fdfrn_poll.php;h=d6bc1727e70f6d04b020e1e6c38f6e9907ce7650;hb=3e797547a37f8c8f22e88965b4a4d278bcc192e0;hp=7d5418c364533b4f27c073b9e3dfe0822453bca7;hpb=d53e53cceb2823cceec36f91f39f8b1e6459a648;p=friendica.git diff --git a/mod/dfrn_poll.php b/mod/dfrn_poll.php index 7d5418c364..d6bc1727e7 100644 --- a/mod/dfrn_poll.php +++ b/mod/dfrn_poll.php @@ -119,6 +119,7 @@ function dfrn_poll_init(App $a) $_SESSION['visitor_home'] = $r[0]['url']; $_SESSION['visitor_handle'] = $r[0]['addr']; $_SESSION['visitor_visiting'] = $r[0]['uid']; + $_SESSION['my_url'] = $r[0]['url']; if (!$quiet) { info(L10n::t('%1$s welcomes %2$s', $r[0]['username'], $r[0]['name']) . EOL); } @@ -140,7 +141,7 @@ function dfrn_poll_init(App $a) if ($type === 'profile-check' && $dfrn_version < 2.2) { if ((strlen($challenge)) && (strlen($sec))) { - q("DELETE FROM `profile_check` WHERE `expire` < " . intval(time())); + dba::delete('profile_check', ["`expire` < ?", time()]); $r = q("SELECT * FROM `profile_check` WHERE `sec` = '%s' ORDER BY `expire` DESC LIMIT 1", dbesc($sec) ); @@ -205,7 +206,7 @@ function dfrn_poll_init(App $a) break; } - q("DELETE FROM `profile_check` WHERE `expire` < " . intval(time())); + dba::delete('profile_check', ["`expire` < ?", time()]); $r = q("SELECT * FROM `profile_check` WHERE `dfrn_id` = '%s' ORDER BY `expire` DESC", dbesc($dfrn_id)); if (DBM::is_result($r)) { @@ -232,7 +233,7 @@ function dfrn_poll_post(App $a) if (strlen($challenge) && strlen($sec)) { logger('dfrn_poll: POST: profile-check'); - q("DELETE FROM `profile_check` WHERE `expire` < " . intval(time())); + dba::delete('profile_check', ["`expire` < ?", time()]); $r = q("SELECT * FROM `profile_check` WHERE `sec` = '%s' ORDER BY `expire` DESC LIMIT 1", dbesc($sec) ); @@ -305,11 +306,7 @@ function dfrn_poll_post(App $a) $type = $r[0]['type']; $last_update = $r[0]['last_update']; - $r = q("DELETE FROM `challenge` WHERE `dfrn-id` = '%s' AND `challenge` = '%s'", - dbesc($dfrn_id), - dbesc($challenge) - ); - + dba::delete('challenge', ['dfrn-id' => $dfrn_id, 'challenge' => $challenge]); $sql_extra = ''; switch ($direction) { @@ -414,7 +411,7 @@ function dfrn_poll_content(App $a) $status = 0; - $r = q("DELETE FROM `challenge` WHERE `expire` < " . intval(time())); + dba::delete('challenge', ["`expire` < ?", time()]); if ($type !== 'profile') { $r = q("INSERT INTO `challenge` ( `challenge`, `dfrn-id`, `expire` , `type`, `last_update` ) @@ -539,6 +536,7 @@ function dfrn_poll_content(App $a) $_SESSION['visitor_id'] = $r[0]['id']; $_SESSION['visitor_home'] = $r[0]['url']; $_SESSION['visitor_visiting'] = $r[0]['uid']; + $_SESSION['my_url'] = $r[0]['url']; if (!$quiet) { info(L10n::t('%1$s welcomes %2$s', $r[0]['username'], $r[0]['name']) . EOL); }