X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fapi.php;h=052d32b17b1f8d788db0d7c65559febeb6cd3aa1;hb=33b491f2a6ce9f7030851fcdd55394c575e4322f;hp=329b49f609c474554701e87c9a359bd67aafb79a;hpb=c5cb976b62b336c0ce9edb3b03cfd2b5c9af3450;p=friendica.git diff --git a/include/api.php b/include/api.php index 329b49f609..052d32b17b 100644 --- a/include/api.php +++ b/include/api.php @@ -528,7 +528,7 @@ function api_unique_id_to_nurl($id) * * @param App $a App * @param int|string $contact_id Contact ID or URL - * @return array + * @return array|bool * @throws BadRequestException * @throws ImagickException * @throws InternalServerErrorException @@ -1320,12 +1320,6 @@ function api_status_show($type, $item_id = 0) Logger::log('api_status_show: user_info: '.print_r($user_info, true), Logger::DEBUG); - if ($type == "raw") { - $privacy_sql = "AND NOT `private`"; - } else { - $privacy_sql = ""; - } - if (!empty($item_id)) { // Get the item with the given id $condition = ['id' => $item_id]; @@ -1334,6 +1328,11 @@ function api_status_show($type, $item_id = 0) $condition = ['owner-id' => $user_info['pid'], 'uid' => api_user(), 'gravity' => [GRAVITY_PARENT, GRAVITY_COMMENT]]; } + + if ($type == "raw") { + $condition['private'] = false; + } + $lastwall = Item::selectFirst(Item::ITEM_FIELDLIST, $condition, ['order' => ['id' => true]]); if (DBA::isResult($lastwall)) { @@ -2834,7 +2833,7 @@ function api_get_entitities(&$text, $bbcode) $entities["media"][] = [ "id" => $start+1, - "id_str" => (string)$start+1, + "id_str" => (string) ($start + 1), "indices" => [$start, $start+strlen($url)], "media_url" => Strings::normaliseLink($media_url), "media_url_https" => $media_url, @@ -3558,7 +3557,7 @@ function api_statusnet_config($type) $server = $a->getHostName(); $logo = System::baseUrl() . '/images/friendica-64.png'; $email = Config::get('config', 'admin_email'); - $closed = intval(Config::get('config', 'register_policy')) === REGISTER_CLOSED ? 'true' : 'false'; + $closed = intval(Config::get('config', 'register_policy')) === \Friendica\Module\Register::CLOSED ? 'true' : 'false'; $private = Config::get('system', 'block_public') ? 'true' : 'false'; $textlimit = (string) Config::get('config', 'api_import_size', Config::get('config', 'max_import_size', 200000)); $ssl = Config::get('system', 'have_ssl') ? 'true' : 'false'; @@ -3735,7 +3734,6 @@ function api_direct_messages_new($type) } $replyto = ''; - $sub = ''; if (!empty($_REQUEST['replyto'])) { $r = q( 'SELECT `parent-uri`, `title` FROM `mail` WHERE `uid`=%d AND `id`=%d', @@ -4598,8 +4596,8 @@ function api_account_update_profile_image($type) $condition = ["`profile` AND `resource-id` != ? AND `uid` = ?", $data['photo']['id'], api_user()]; Photo::update(['profile' => false], $condition); } else { - $fields = ['photo' => System::baseUrl() . '/photo/' . $data['photo']['id'] . '-4.' . $filetype, - 'thumb' => System::baseUrl() . '/photo/' . $data['photo']['id'] . '-5.' . $filetype]; + $fields = ['photo' => System::baseUrl() . '/photo/' . $data['photo']['id'] . '-4.' . $fileext, + 'thumb' => System::baseUrl() . '/photo/' . $data['photo']['id'] . '-5.' . $fileext]; DBA::update('profile', $fields, ['id' => $_REQUEST['profile'], 'uid' => api_user()]); }