]> git.mxchange.org Git - friendica.git/blobdiff - include/api.php
Remove confusing comment
[friendica.git] / include / api.php
index ccb8608738e947486d454f76e160dfd36730c3b9..806e953e9141b3270f6c5b1c5f703bf9c95b3b28 100644 (file)
@@ -1702,7 +1702,7 @@ function api_statuses_home_timeline($type)
        unset($_GET["screen_name"]);
 
        $user_info = api_get_user($a);
-       // get last newtork messages
+       // get last network messages
 
        // params
        $count = (x($_REQUEST, 'count') ? $_REQUEST['count'] : 20);
@@ -1798,7 +1798,7 @@ function api_statuses_public_timeline($type)
        }
 
        $user_info = api_get_user($a);
-       // get last newtork messages
+       // get last network messages
 
        // params
        $count = (x($_REQUEST, 'count') ? $_REQUEST['count'] : 20);
@@ -2270,7 +2270,7 @@ function api_statuses_mentions($type)
        unset($_GET["screen_name"]);
 
        $user_info = api_get_user($a);
-       // get last newtork messages
+       // get last network messages
 
 
        // params
@@ -3354,7 +3354,9 @@ function api_lists_statuses($type)
        unset($_GET["screen_name"]);
 
        $user_info = api_get_user($a);
-       // get last newtork messages
+       if (!x($_REQUEST, 'list_id')) {
+               throw new BadRequestException('list_id not specified');
+       }
 
        // params
        $count = (x($_REQUEST, 'count') ? $_REQUEST['count'] : 20);
@@ -3364,7 +3366,6 @@ function api_lists_statuses($type)
        }
        $since_id = (x($_REQUEST, 'since_id') ? $_REQUEST['since_id'] : 0);
        $max_id = (x($_REQUEST, 'max_id') ? $_REQUEST['max_id'] : 0);
-       //$since_id = 0;//$since_id = (x($_REQUEST, 'since_id')?$_REQUEST['since_id'] : 0);
        $exclude_replies = (x($_REQUEST, 'exclude_replies') ? 1 : 0);
        $conversation_id = (x($_REQUEST, 'conversation_id') ? $_REQUEST['conversation_id'] : 0);
 
@@ -3381,7 +3382,7 @@ function api_lists_statuses($type)
                $sql_extra .= ' AND `item`.`parent` = ' . intval($conversation_id);
        }
 
-       $statuses = q(
+       $statuses = dba::p(
                "SELECT `item`.*, `item`.`id` AS `item_id`, `item`.`network` AS `item_network`,
                `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`,
                `contact`.`network`, `contact`.`thumb`, `contact`.`dfrn-id`, `contact`.`self`,
@@ -3390,18 +3391,15 @@ function api_lists_statuses($type)
                STRAIGHT_JOIN `contact` ON `contact`.`id` = `item`.`contact-id` AND `contact`.`uid` = `item`.`uid`
                        AND (NOT `contact`.`blocked` OR `contact`.`pending`)
                STRAIGHT_JOIN `group_member` ON `group_member`.`contact-id` = `item`.`contact-id`
-               WHERE `item`.`uid` = %d AND `verb` = '%s'
+               WHERE `item`.`uid` = ? AND `verb` = ?
                AND `item`.`visible` AND NOT `item`.`moderated` AND NOT `item`.`deleted`
-               $sql_extra
-               AND `item`.`id`>%d
-               AND `group_member`.`gid` = %d
-               ORDER BY `item`.`id` DESC LIMIT %d ,%d ",
-               intval(api_user()),
-               dbesc(ACTIVITY_POST),
-               intval($since_id),
-               intval($_REQUEST['list_id']),
-               intval($start),
-               intval($count)
+               AND `item`.`id`>?
+               AND `group_member`.`gid` = ?
+               ORDER BY `item`.`id` DESC LIMIT ".intval($start)." ,".intval($count),
+               api_user(),
+               ACTIVITY_POST,
+               $since_id,
+               $_REQUEST['list_id']
        );
 
        $items = api_format_items($statuses, $user_info, false, $type);