1
1
Fork 0

polling horked on certain relationships

This commit is contained in:
Mike Macgirvin 2010-09-20 20:26:55 -07:00
parent 3ad52463f6
commit cd61b46009

View file

@ -9,11 +9,11 @@ function dfrn_poll_init(&$a) {
$dfrn_id = ''; $dfrn_id = '';
if(x($_GET,'dfrn_id')) if(x($_GET,'dfrn_id'))
$dfrn_id = $a->config['dfrn_poll_dfrn_id'] = $_GET['dfrn_id']; $dfrn_id = $_GET['dfrn_id'];
if(x($_GET,'type')) if(x($_GET,'type'))
$type = $a->config['dfrn_poll_type'] = $_GET['type']; $type = $_GET['type'];
if(x($_GET,'last_update')) if(x($_GET,'last_update'))
$last_update = $a->config['dfrn_poll_last_update'] = $_GET['last_update']; $last_update = $_GET['last_update'];
$dfrn_version = ((x($_GET,'dfrn_version')) ? $_GET['dfrn_version'] : '1.0'); $dfrn_version = ((x($_GET,'dfrn_version')) ? $_GET['dfrn_version'] : '1.0');
$destination_url = ((x($_GET,'destination_url')) ? $_GET['destination_url'] : ''); $destination_url = ((x($_GET,'destination_url')) ? $_GET['destination_url'] : '');
@ -115,8 +115,8 @@ function dfrn_poll_init(&$a) {
function dfrn_poll_post(&$a) { function dfrn_poll_post(&$a) {
$dfrn_id = notags(trim($_POST['dfrn_id'])); $dfrn_id = $_POST['dfrn_id'];
$challenge = notags(trim($_POST['challenge'])); $challenge = $_POST['challenge'];
$url = $_POST['url']; $url = $_POST['url'];
$direction = (-1); $direction = (-1);
@ -125,10 +125,12 @@ function dfrn_poll_post(&$a) {
$dfrn_id = substr($dfrn_id,2); $dfrn_id = substr($dfrn_id,2);
} }
$r = q("SELECT * FROM `challenge` WHERE `dfrn-id` = '%s' AND `challenge` = '%s' LIMIT 1", $r = q("SELECT * FROM `challenge` WHERE `dfrn-id` = '%s' AND `challenge` = '%s' LIMIT 1",
dbesc($dfrn_id), dbesc($dfrn_id),
dbesc($challenge) dbesc($challenge)
); );
if(! count($r)) if(! count($r))
killme(); killme();
@ -200,7 +202,6 @@ function dfrn_poll_post(&$a) {
return; // NOTREACHED return; // NOTREACHED
} }
else { else {
$o = get_feed_for($a,$dfrn_id, $a->argv[1], $last_update, $direction); $o = get_feed_for($a,$dfrn_id, $a->argv[1], $last_update, $direction);
echo $o; echo $o;
killme(); killme();
@ -215,11 +216,11 @@ function dfrn_poll_content(&$a) {
$type = 'data'; $type = 'data';
if(x($_GET,'dfrn_id')) if(x($_GET,'dfrn_id'))
$dfrn_id = $a->config['dfrn_poll_dfrn_id'] = $_GET['dfrn_id']; $dfrn_id = $_GET['dfrn_id'];
if(x($_GET,'type')) if(x($_GET,'type'))
$type = $a->config['dfrn_poll_type'] = $_GET['type']; $type = $_GET['type'];
if(x($_GET,'last_update')) if(x($_GET,'last_update'))
$last_update = $a->config['dfrn_poll_last_update'] = $_GET['last_update']; $last_update = $_GET['last_update'];
$direction = (-1); $direction = (-1);
if(strpos($dfrn_id,':') == 1) { if(strpos($dfrn_id,':') == 1) {
@ -239,7 +240,7 @@ function dfrn_poll_content(&$a) {
$r = q("INSERT INTO `challenge` ( `challenge`, `dfrn-id`, `expire` , `type`, `last_update` ) $r = q("INSERT INTO `challenge` ( `challenge`, `dfrn-id`, `expire` , `type`, `last_update` )
VALUES( '%s', '%s', '%s', '%s', '%s' ) ", VALUES( '%s', '%s', '%s', '%s', '%s' ) ",
dbesc($hash), dbesc($hash),
dbesc(notags(trim($_GET['dfrn_id']))), dbesc($dfrn_id),
intval(time() + 60 ), intval(time() + 60 ),
dbesc($type), dbesc($type),
dbesc($last_update) dbesc($last_update)