Merge pull request #9696 from MrPetovan/bug/9306-poke-privacy

Use correct request parameter type for poke privacy
pull/9700/head
Michael Vogel 2020-12-22 17:11:37 +01:00 zatwierdzone przez GitHub
commit ae386a78a4
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
4 zmienionych plików z 6 dodań i 6 usunięć

Wyświetl plik

@ -762,7 +762,7 @@ function conversation_fetch_comments($thread_items, bool $pinned, array $activit
}
if (($row['gravity'] == GRAVITY_PARENT) && !empty($row['causer-id'])) {
$row['reshared'] = DI::l10n()->t('%s reshared this.', '<a href="'. htmlentities(Contact::magicLinkbyId($row['causer-id'])) .'">' . htmlentities($name) . '</a>');
$row['reshared'] = DI::l10n()->t('%s reshared this.', '<a href="'. htmlentities(Contact::magicLinkById($row['causer-id'])) .'">' . htmlentities($name) . '</a>');
}
$row['direction'] = ['direction' => 3, 'title' => (empty($row['causer-id']) ? DI::l10n()->t('Reshared') : DI::l10n()->t('Reshared by %s', $name))];
break;

Wyświetl plik

@ -1454,7 +1454,7 @@ function photos_content(App $a)
continue;
}
$profile_url = Contact::magicLinkbyId($item['author-id']);
$profile_url = Contact::magicLinkById($item['author-id']);
if (strpos($profile_url, 'redir/') === 0) {
$sparkle = ' sparkle';
} else {

Wyświetl plik

@ -2658,7 +2658,7 @@ class Contact
* @throws HTTPException\InternalServerErrorException
* @throws \ImagickException
*/
public static function magicLinkbyId($cid, $url = '')
public static function magicLinkById($cid, $url = '')
{
$contact = DBA::selectFirst('contact', ['id', 'network', 'url', 'uid'], ['id' => $cid]);

Wyświetl plik

@ -44,14 +44,14 @@ class Poke extends BaseModule
Logger::info('verb ' . $verb . ' contact ' . $contact_id);
$contact = DBA::selectFirst('contact', ['id', 'name'], ['id' => $parameters['id'], 'uid' => local_user()]);
$contact = DBA::selectFirst('contact', ['id', 'name', 'url'], ['id' => $parameters['id'], 'uid' => local_user()]);
if (!DBA::isResult($contact)) {
return self::postReturn(false);
}
$a = DI::app();
$private = (!empty($_GET['private']) ? intval($_GET['private']) : Model\Item::PUBLIC);
$private = !empty($_POST['private']) ? Model\Item::PRIVATE : Model\Item::PUBLIC;
$allow_cid = ($private ? '<' . $contact['id']. '>' : $a->user['allow_cid']);
$allow_gid = ($private ? '' : $a->user['allow_gid']);
@ -86,7 +86,7 @@ class Poke extends BaseModule
$arr['object-type'] = Activity\ObjectType::PERSON;
$arr['origin'] = 1;
$arr['body'] = '[url=' . $actor['url'] . ']' . $actor['name'] . '[/url]' . ' ' . $verbs[$verb][2] . ' ' . '[url=' . $contact['url'] . ']' . $contact['name'] . '[/url]';
$arr['body'] = '@[url=' . $actor['url'] . ']' . $actor['name'] . '[/url]' . ' ' . $verbs[$verb][2] . ' ' . '@[url=' . $contact['url'] . ']' . $contact['name'] . '[/url]';
$arr['object'] = '<object><type>' . Activity\ObjectType::PERSON . '</type><title>' . XML::escape($contact['name']) . '</title><id>' . XML::escape($contact['url']) . '</id>';
$arr['object'] .= '<link>' . XML::escape('<link rel="alternate" type="text/html" href="' . $contact['url'] . '" />') . "\n";