From 661aca0f88897d759579dba3b1502355c0b41068 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Mon, 27 May 2019 11:01:13 -0400 Subject: [PATCH 1/2] [API] Ensures user_show includes a status the user actually authored --- include/api.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/api.php b/include/api.php index 0ca0bf838..dcd8335e1 100644 --- a/include/api.php +++ b/include/api.php @@ -1271,7 +1271,7 @@ function api_status_show($type, $item_id) function api_get_last_status($ownerId, $uid) { $condition = [ - 'owner-id' => $ownerId, + 'author-id'=> $ownerId, 'uid' => $uid, 'gravity' => [GRAVITY_PARENT, GRAVITY_COMMENT], 'private' => false From 0e5b9514ef22c3d7c008316bc2597f4c6d871739 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Mon, 27 May 2019 11:58:02 -0400 Subject: [PATCH 2/2] [API] Convert user description to plain text --- include/api.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/api.php b/include/api.php index dcd8335e1..0fab1f47c 100644 --- a/include/api.php +++ b/include/api.php @@ -611,7 +611,7 @@ function api_get_user(App $a, $contact_id = null) 'name' => $contact["name"], 'screen_name' => (($contact['nick']) ? $contact['nick'] : $contact['name']), 'location' => ($contact["location"] != "") ? $contact["location"] : ContactSelector::networkToName($contact['network'], $contact['url']), - 'description' => $contact["about"], + 'description' => HTML::toPlaintext(BBCode::toPlaintext($contact["about"])), 'profile_image_url' => $contact["micro"], 'profile_image_url_https' => $contact["micro"], 'profile_image_url_profile_size' => $contact["thumb"], @@ -690,7 +690,7 @@ function api_get_user(App $a, $contact_id = null) 'name' => (($uinfo[0]['name']) ? $uinfo[0]['name'] : $uinfo[0]['nick']), 'screen_name' => (($uinfo[0]['nick']) ? $uinfo[0]['nick'] : $uinfo[0]['name']), 'location' => $location, - 'description' => $description, + 'description' => HTML::toPlaintext(BBCode::toPlaintext($description)), 'profile_image_url' => $uinfo[0]['micro'], 'profile_image_url_https' => $uinfo[0]['micro'], 'profile_image_url_profile_size' => $uinfo[0]["thumb"],