]> git.mxchange.org Git - friendica.git/blobdiff - include/api.php
Merge pull request #9780 from annando/alternate-9775
[friendica.git] / include / api.php
index 5969ccd5f1a87974606ab44edbe3dd015d51218b..5131c9574189e5d622b155fc3979e363505873cc 100644 (file)
@@ -67,7 +67,6 @@ use Friendica\Util\Proxy as ProxyUtils;
 use Friendica\Util\Strings;
 use Friendica\Util\XML;
 
-require_once __DIR__ . '/../mod/share.php';
 require_once __DIR__ . '/../mod/item.php';
 require_once __DIR__ . '/../mod/wall_upload.php';
 
@@ -2164,10 +2163,10 @@ function api_statuses_mentions($type)
        // get last network messages
 
        // params
-       $since_id = $_REQUEST['since_id'] ?? 0;
-       $max_id   = $_REQUEST['max_id']   ?? 0;
-       $count    = $_REQUEST['count']    ?? 20;
-       $page     = $_REQUEST['page']     ?? 1;
+       $since_id = intval($_REQUEST['since_id'] ?? 0);
+       $max_id   = intval($_REQUEST['max_id']   ?? 0);
+       $count    = intval($_REQUEST['count']    ?? 20);
+       $page     = intval($_REQUEST['page']     ?? 1);
 
        $start = max(0, ($page - 1) * $count);
 
@@ -4220,7 +4219,7 @@ function api_fr_photo_create_update($type)
        $deny_cid  = $_REQUEST['deny_cid' ] ?? null;
        $allow_gid = $_REQUEST['allow_gid'] ?? null;
        $deny_gid  = $_REQUEST['deny_gid' ] ?? null;
-       $visibility = !empty($_REQUEST['visibility']) && $_REQUEST['visibility'] !== "false";
+       $visibility = !$allow_cid && !$deny_cid && !$allow_gid && !$deny_gid;
 
        // do several checks on input parameters
        // we do not allow calls without album string