]> git.mxchange.org Git - friendica.git/commitdiff
API: Only allow repeating of public items
authorMichael Vogel <icarus@dabo.de>
Mon, 25 Jan 2016 21:35:18 +0000 (22:35 +0100)
committerMichael Vogel <icarus@dabo.de>
Mon, 25 Jan 2016 21:35:18 +0000 (22:35 +0100)
include/api.php

index 3bc7c8bab90db41ff9e4401c8763747abd0a112b..4d206da28e771d2de71a16df9e9d1a010b99ed30 100644 (file)
                        WHERE `item`.`visible` = 1 and `item`.`moderated` = 0 AND `item`.`deleted` = 0
                        AND `contact`.`id` = `item`.`contact-id`
                        AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
+                       AND NOT `item`.`private` AND `item`.`allow_cid` = '' AND `item`.`allow`.`gid` = ''
+                       AND `item`.`deny_cid` = '' AND `item`.`deny_gid` = ''
                        $sql_extra
                        AND `item`.`id`=%d",
                        intval($id)
                                $_REQUEST["source"] = api_source();
 
                        item_post($a);
-               }
+               } else
+                       throw new ForbiddenException();
 
                // this should output the last post (the one we just posted).
                $called_api = null;