]> git.mxchange.org Git - friendica.git/commitdiff
polling horked on certain relationships
authorMike Macgirvin <mike@macgirvin.com>
Tue, 21 Sep 2010 03:26:55 +0000 (20:26 -0700)
committerMike Macgirvin <mike@macgirvin.com>
Tue, 21 Sep 2010 03:26:55 +0000 (20:26 -0700)
mod/dfrn_poll.php

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