mirror of
https://github.com/friendica/friendica
synced 2025-05-20 05:04:12 +02:00
Fix code style
This commit is contained in:
parent
b2bbcc4965
commit
02fae146e6
17 changed files with 134 additions and 118 deletions
|
@ -76,12 +76,12 @@ class StorageManager
|
|||
*/
|
||||
public function __construct(Database $dba, IManageConfigValues $config, LoggerInterface $logger, EventDispatcherInterface $eventDispatcher, L10n $l10n, bool $includeAddon = true)
|
||||
{
|
||||
$this->dba = $dba;
|
||||
$this->config = $config;
|
||||
$this->logger = $logger;
|
||||
$this->dba = $dba;
|
||||
$this->config = $config;
|
||||
$this->logger = $logger;
|
||||
$this->eventDispatcher = $eventDispatcher;
|
||||
$this->l10n = $l10n;
|
||||
$this->validBackends = $config->get('storage', 'backends', self::DEFAULT_BACKENDS);
|
||||
$this->l10n = $l10n;
|
||||
$this->validBackends = $config->get('storage', 'backends', self::DEFAULT_BACKENDS);
|
||||
|
||||
$currentName = $this->config->get('storage', 'name');
|
||||
|
||||
|
|
|
@ -3051,7 +3051,7 @@ class Item
|
|||
$hook_data = [
|
||||
'rendered-html' => $item['rendered-html'],
|
||||
'rendered-hash' => $item['rendered-hash'],
|
||||
'item' => $item,
|
||||
'item' => $item,
|
||||
];
|
||||
|
||||
$eventDispatcher = DI::eventDispatcher();
|
||||
|
|
|
@ -480,7 +480,7 @@ class Profile
|
|||
|
||||
$hook_data = [
|
||||
'profile' => &$profile,
|
||||
'entry' => &$o,
|
||||
'entry' => &$o,
|
||||
];
|
||||
|
||||
$hook_data = $eventDispatcher->dispatch(
|
||||
|
@ -488,7 +488,7 @@ class Profile
|
|||
)->getArray();
|
||||
|
||||
$profile = $hook_data['profile'] ?? $profile;
|
||||
$o = $hook_data['entry'] ?? $o;
|
||||
$o = $hook_data['entry'] ?? $o;
|
||||
|
||||
return $o;
|
||||
}
|
||||
|
|
|
@ -265,7 +265,7 @@ class Profile extends BaseModule
|
|||
$this->baseUrl->redirect('contact/' . $contact['id']);
|
||||
}
|
||||
|
||||
$vcard_widget = Widget\VCard::getHTML($contact);
|
||||
$vcard_widget = Widget\VCard::getHTML($contact);
|
||||
$circles_widget = '';
|
||||
|
||||
if (!in_array($localRelationship->rel, [ContactModel::NOTHING, ContactModel::SELF])) {
|
||||
|
@ -283,9 +283,15 @@ class Profile extends BaseModule
|
|||
]);
|
||||
|
||||
switch ($localRelationship->rel) {
|
||||
case ContactModel::FRIEND: $relation_text = $this->t('You are mutual friends with %s', $contact['name']); break;
|
||||
case ContactModel::FOLLOWER: $relation_text = $this->t('You are sharing with %s', $contact['name']); break;
|
||||
case ContactModel::SHARING: $relation_text = $this->t('%s is sharing with you', $contact['name']); break;
|
||||
case ContactModel::FRIEND:
|
||||
$relation_text = $this->t('You are mutual friends with %s', $contact['name']);
|
||||
break;
|
||||
case ContactModel::FOLLOWER:
|
||||
$relation_text = $this->t('You are sharing with %s', $contact['name']);
|
||||
break;
|
||||
case ContactModel::SHARING:
|
||||
$relation_text = $this->t('%s is sharing with you', $contact['name']);
|
||||
break;
|
||||
default:
|
||||
$relation_text = '';
|
||||
}
|
||||
|
@ -308,8 +314,7 @@ class Profile extends BaseModule
|
|||
$this->logger->notice('Empty gsid for contact', ['contact' => $contact]);
|
||||
}
|
||||
|
||||
$serverIgnored =
|
||||
$contact['gsid'] &&
|
||||
$serverIgnored = $contact['gsid'] &&
|
||||
$this->userGServer->isIgnoredByUser($this->session->getLocalUserId(), $contact['gsid']) ?
|
||||
$this->t('This contact is on a server you ignored.')
|
||||
: '';
|
||||
|
@ -475,7 +480,7 @@ class Profile extends BaseModule
|
|||
|
||||
$hook_data = [
|
||||
'contact' => $contact,
|
||||
'output' => $o,
|
||||
'output' => $o,
|
||||
];
|
||||
|
||||
$hook_data = $this->eventDispatcher->dispatch(
|
||||
|
|
|
@ -31,7 +31,6 @@ use Friendica\Content\Widget\TrendingTags;
|
|||
use Friendica\Core\ACL;
|
||||
use Friendica\Core\Cache\Capability\ICanCache;
|
||||
use Friendica\Core\Config\Capability\IManageConfigValues;
|
||||
use Friendica\Core\Hook;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues;
|
||||
use Friendica\Core\Renderer;
|
||||
|
|
|
@ -11,7 +11,6 @@ use Friendica\BaseModule;
|
|||
use Friendica\Content\Nav;
|
||||
use Friendica\Content\Pager;
|
||||
use Friendica\Content\Widget;
|
||||
use Friendica\Core\Hook;
|
||||
use Friendica\Core\Renderer;
|
||||
use Friendica\Core\Search;
|
||||
use Friendica\DI;
|
||||
|
@ -40,7 +39,7 @@ class Directory extends BaseModule
|
|||
DI::page()['aside'] .= Widget::follow();
|
||||
}
|
||||
|
||||
$output = '';
|
||||
$output = '';
|
||||
$entries = [];
|
||||
|
||||
Nav::setSelected('directory');
|
||||
|
@ -48,7 +47,7 @@ class Directory extends BaseModule
|
|||
$search = trim(rawurldecode($_REQUEST['search'] ?? ''));
|
||||
|
||||
$gDirPath = '';
|
||||
$dirURL = Search::getGlobalDirectory();
|
||||
$dirURL = Search::getGlobalDirectory();
|
||||
if (strlen($dirURL)) {
|
||||
$gDirPath = OpenWebAuth::getZrlUrl($dirURL, true);
|
||||
}
|
||||
|
@ -166,7 +165,7 @@ class Directory extends BaseModule
|
|||
|
||||
$hook_data = [
|
||||
'contact' => $contact,
|
||||
'entry' => $entry,
|
||||
'entry' => $entry,
|
||||
];
|
||||
|
||||
$hook_data = $eventDispatcher->dispatch(
|
||||
|
|
|
@ -58,11 +58,11 @@ class Friendica extends BaseModule
|
|||
) {
|
||||
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||
|
||||
$this->config = $config;
|
||||
$this->keyValue = $keyValue;
|
||||
$this->session = $session;
|
||||
$this->config = $config;
|
||||
$this->keyValue = $keyValue;
|
||||
$this->session = $session;
|
||||
$this->eventDispatcher = $eventDispatcher;
|
||||
$this->addonHelper = $addonHelper;
|
||||
$this->addonHelper = $addonHelper;
|
||||
}
|
||||
|
||||
protected function content(array $request = []): string
|
||||
|
|
|
@ -52,7 +52,7 @@ abstract class BaseUsers extends BaseModeration
|
|||
) {
|
||||
parent::__construct($page, $appHelper, $systemMessages, $session, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||
|
||||
$this->database = $database;
|
||||
$this->database = $database;
|
||||
$this->eventDispatcher = $eventDispatcher;
|
||||
}
|
||||
|
||||
|
@ -115,7 +115,7 @@ abstract class BaseUsers extends BaseModeration
|
|||
];
|
||||
|
||||
$hook_data = [
|
||||
'tabs' => $tabs,
|
||||
'tabs' => $tabs,
|
||||
'selectedTab' => $selectedTab,
|
||||
];
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ class ParseUrl extends BaseModule
|
|||
{
|
||||
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||
|
||||
$this->userSession = $userSession;
|
||||
$this->userSession = $userSession;
|
||||
$this->eventDispatcher = $eventDispatcher;
|
||||
}
|
||||
|
||||
|
@ -41,10 +41,10 @@ class ParseUrl extends BaseModule
|
|||
throw new \Friendica\Network\HTTPException\ForbiddenException();
|
||||
}
|
||||
|
||||
$format = '';
|
||||
$title = '';
|
||||
$format = '';
|
||||
$title = '';
|
||||
$description = '';
|
||||
$ret = ['success' => false, 'contentType' => ''];
|
||||
$ret = ['success' => false, 'contentType' => ''];
|
||||
|
||||
if (!empty($_GET['binurl']) && Util\Strings::isHex($_GET['binurl'])) {
|
||||
$url = trim(hex2bin($_GET['binurl']));
|
||||
|
@ -85,9 +85,9 @@ class ParseUrl extends BaseModule
|
|||
}
|
||||
|
||||
$hook_data = [
|
||||
'url' => $url,
|
||||
'url' => $url,
|
||||
'format' => $format,
|
||||
'text' => null,
|
||||
'text' => null,
|
||||
];
|
||||
|
||||
$hook_data = $this->eventDispatcher->dispatch(
|
||||
|
@ -119,14 +119,14 @@ class ParseUrl extends BaseModule
|
|||
}
|
||||
|
||||
$ret['contentType'] = $content_type;
|
||||
$ret['data'] = ['url' => $url];
|
||||
$ret['success'] = true;
|
||||
$ret['data'] = ['url' => $url];
|
||||
$ret['success'] = true;
|
||||
} else {
|
||||
unset($siteinfo['keywords']);
|
||||
|
||||
$ret['data'] = $siteinfo;
|
||||
$ret['data'] = $siteinfo;
|
||||
$ret['contentType'] = 'attachment';
|
||||
$ret['success'] = true;
|
||||
$ret['success'] = true;
|
||||
}
|
||||
|
||||
$this->jsonExit($ret);
|
||||
|
|
|
@ -58,17 +58,17 @@ class PermissionTooltip extends BaseModule
|
|||
) {
|
||||
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||
|
||||
$this->dba = $dba;
|
||||
$this->aclFormatter = $aclFormatter;
|
||||
$this->session = $session;
|
||||
$this->config = $config;
|
||||
$this->permissionSet = $permissionSet;
|
||||
$this->dba = $dba;
|
||||
$this->aclFormatter = $aclFormatter;
|
||||
$this->session = $session;
|
||||
$this->config = $config;
|
||||
$this->permissionSet = $permissionSet;
|
||||
$this->eventDispatcher = $eventDispatcher;
|
||||
}
|
||||
|
||||
protected function rawContent(array $request = [])
|
||||
{
|
||||
$type = $this->parameters['type'];
|
||||
$type = $this->parameters['type'];
|
||||
$referenceId = $this->parameters['id'];
|
||||
|
||||
$expectedTypes = ['item', 'photo', 'event'];
|
||||
|
@ -79,10 +79,10 @@ class PermissionTooltip extends BaseModule
|
|||
$condition = ['id' => $referenceId, 'uid' => [0, $this->session->getLocalUserId()]];
|
||||
if ($type == 'item') {
|
||||
$fields = ['uid', 'psid', 'private', 'uri-id', 'origin', 'network'];
|
||||
$model = Model\Post::selectFirst($fields, $condition, ['order' => ['uid' => true]]);
|
||||
$model = Model\Post::selectFirst($fields, $condition, ['order' => ['uid' => true]]);
|
||||
|
||||
if ($model['origin'] || ($model['network'] != Protocol::ACTIVITYPUB)) {
|
||||
$permissionSet = $this->permissionSet->selectOneById($model['psid'], $model['uid']);
|
||||
$permissionSet = $this->permissionSet->selectOneById($model['psid'], $model['uid']);
|
||||
$model['allow_cid'] = $permissionSet->allow_cid;
|
||||
$model['allow_gid'] = $permissionSet->allow_gid;
|
||||
$model['deny_cid'] = $permissionSet->deny_cid;
|
||||
|
@ -94,8 +94,8 @@ class PermissionTooltip extends BaseModule
|
|||
$model['deny_gid'] = [];
|
||||
}
|
||||
} else {
|
||||
$fields = ['uid', 'allow_cid', 'allow_gid', 'deny_cid', 'deny_gid'];
|
||||
$model = $this->dba->selectFirst($type, $fields, $condition);
|
||||
$fields = ['uid', 'allow_cid', 'allow_gid', 'deny_cid', 'deny_gid'];
|
||||
$model = $this->dba->selectFirst($type, $fields, $condition);
|
||||
$model['allow_cid'] = $this->aclFormatter->expand($model['allow_cid']);
|
||||
$model['allow_gid'] = $this->aclFormatter->expand($model['allow_gid']);
|
||||
$model['deny_cid'] = $this->aclFormatter->expand($model['deny_cid']);
|
||||
|
@ -116,7 +116,7 @@ class PermissionTooltip extends BaseModule
|
|||
|
||||
$model = $hook_data['model'] ?? $model;
|
||||
|
||||
$aclReceivers = new Entity\AclReceivers();
|
||||
$aclReceivers = new Entity\AclReceivers();
|
||||
$addressedReceivers = new Entity\AddressedReceivers();
|
||||
if (!empty($model['allow_cid']) || !empty($model['allow_gid']) || !empty($model['deny_cid']) || !empty($model['deny_gid'])) {
|
||||
$aclReceivers = $this->fetchReceiversFromACL($model);
|
||||
|
@ -126,30 +126,35 @@ class PermissionTooltip extends BaseModule
|
|||
|
||||
$privacy = '';
|
||||
switch ($model['private'] ?? null) {
|
||||
case Model\Item::PUBLIC: $privacy = $this->t('Public'); break;
|
||||
case Model\Item::UNLISTED: $privacy = $this->t('Unlisted'); break;
|
||||
case Model\Item::PRIVATE: $privacy = $this->t('Limited/Private'); break;
|
||||
case Model\Item::PUBLIC:
|
||||
$privacy = $this->t('Public');
|
||||
break;
|
||||
case Model\Item::UNLISTED:
|
||||
$privacy = $this->t('Unlisted');
|
||||
break;
|
||||
case Model\Item::PRIVATE:
|
||||
$privacy = $this->t('Limited/Private');
|
||||
break;
|
||||
}
|
||||
|
||||
if ($aclReceivers->isEmpty() && $addressedReceivers->isEmpty() && empty($privacy))
|
||||
{
|
||||
if ($aclReceivers->isEmpty() && $addressedReceivers->isEmpty() && empty($privacy)) {
|
||||
echo $this->t('Remote privacy information not available.');
|
||||
exit;
|
||||
}
|
||||
|
||||
$tpl = Renderer::getMarkupTemplate('privacy/permission_tooltip.tpl');
|
||||
$tpl = Renderer::getMarkupTemplate('privacy/permission_tooltip.tpl');
|
||||
$output = Renderer::replaceMacros($tpl, [
|
||||
'$l10n' => [
|
||||
'visible_to' => $this->t('Visible to:'),
|
||||
'to' => $this->t('To:'),
|
||||
'cc' => $this->t('CC:'),
|
||||
'bcc' => $this->t('BCC:'),
|
||||
'audience' => $this->t('Audience:'),
|
||||
'to' => $this->t('To:'),
|
||||
'cc' => $this->t('CC:'),
|
||||
'bcc' => $this->t('BCC:'),
|
||||
'audience' => $this->t('Audience:'),
|
||||
'attributed' => $this->t('Attributed To:'),
|
||||
],
|
||||
'$aclReceivers' => $aclReceivers,
|
||||
'$aclReceivers' => $aclReceivers,
|
||||
'$addressedReceivers' => $addressedReceivers,
|
||||
'$privacy' => $privacy,
|
||||
'$privacy' => $privacy,
|
||||
]);
|
||||
|
||||
$this->httpExit($output);
|
||||
|
@ -223,7 +228,7 @@ class PermissionTooltip extends BaseModule
|
|||
private function fetchAddressedReceivers(int $uriId): Entity\AddressedReceivers
|
||||
{
|
||||
$own_url = '';
|
||||
$uid = $this->session->getLocalUserId();
|
||||
$uid = $this->session->getLocalUserId();
|
||||
if ($uid) {
|
||||
$owner = Model\User::getOwnerDataById($uid);
|
||||
if (!empty($owner['url'])) {
|
||||
|
@ -246,11 +251,11 @@ class PermissionTooltip extends BaseModule
|
|||
$receivers[$receiver['type']][] = $this->t('Collection (%s)', $receiver['name']);
|
||||
break;
|
||||
case Model\Tag::FOLLOWER_COLLECTION:
|
||||
$apcontact = $this->dba->selectFirst('apcontact', ['name'], ['followers' => $receiver['url']]);
|
||||
$apcontact = $this->dba->selectFirst('apcontact', ['name'], ['followers' => $receiver['url']]);
|
||||
$receivers[$receiver['type']][] = $this->t('Followers (%s)', $apcontact['name'] ?? $receiver['name']);
|
||||
break;
|
||||
case Model\Tag::ACCOUNT:
|
||||
$apcontact = Model\APContact::getByURL($receiver['url'], false);
|
||||
$apcontact = Model\APContact::getByURL($receiver['url'], false);
|
||||
$receivers[$receiver['type']][] = $apcontact['name'] ?? $receiver['name'];
|
||||
break;
|
||||
default:
|
||||
|
@ -260,19 +265,19 @@ class PermissionTooltip extends BaseModule
|
|||
}
|
||||
|
||||
foreach ($receivers as $type => $receiver) {
|
||||
$max = $this->config->get('system', 'max_receivers');
|
||||
$max = $this->config->get('system', 'max_receivers');
|
||||
$total = count($receiver);
|
||||
if ($total > $max) {
|
||||
$receivers[$type] = array_slice($receiver, 0, $max);
|
||||
$receivers[$type] = array_slice($receiver, 0, $max);
|
||||
$receivers[$type][] = $this->t('%d more', $total - $max);
|
||||
}
|
||||
}
|
||||
|
||||
return new Entity\AddressedReceivers(
|
||||
$receivers[Model\Tag::TO] ?? [],
|
||||
$receivers[Model\Tag::CC] ?? [],
|
||||
$receivers[Model\Tag::BCC] ?? [],
|
||||
$receivers[Model\Tag::AUDIENCE] ?? [],
|
||||
$receivers[Model\Tag::TO] ?? [],
|
||||
$receivers[Model\Tag::CC] ?? [],
|
||||
$receivers[Model\Tag::BCC] ?? [],
|
||||
$receivers[Model\Tag::AUDIENCE] ?? [],
|
||||
$receivers[Model\Tag::ATTRIBUTED] ?? [],
|
||||
);
|
||||
}
|
||||
|
|
|
@ -77,13 +77,13 @@ class Photos extends \Friendica\Module\BaseProfile
|
|||
) {
|
||||
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||
|
||||
$this->session = $session;
|
||||
$this->page = $page;
|
||||
$this->config = $config;
|
||||
$this->appHelper = $appHelper;
|
||||
$this->database = $database;
|
||||
$this->systemMessages = $systemMessages;
|
||||
$this->aclFormatter = $aclFormatter;
|
||||
$this->session = $session;
|
||||
$this->page = $page;
|
||||
$this->config = $config;
|
||||
$this->appHelper = $appHelper;
|
||||
$this->database = $database;
|
||||
$this->systemMessages = $systemMessages;
|
||||
$this->aclFormatter = $aclFormatter;
|
||||
$this->eventDispatcher = $eventDispatcher;
|
||||
|
||||
$owner = Profile::load($this->appHelper, $this->parameters['nickname'] ?? '', false);
|
||||
|
@ -109,7 +109,7 @@ class Photos extends \Friendica\Module\BaseProfile
|
|||
if ($visibility === 'public') {
|
||||
// The ACL selector introduced in version 2019.12 sends ACL input data even when the Public visibility is selected
|
||||
$str_contact_allow = $str_circle_allow = $str_contact_deny = $str_circle_deny = '';
|
||||
} else if ($visibility === 'custom') {
|
||||
} elseif ($visibility === 'custom') {
|
||||
// Since we know from the visibility parameter the item should be private, we have to prevent the empty ACL
|
||||
// case that would make it public. So we always append the author's contact id to the allowed contacts.
|
||||
// See https://github.com/friendica/friendica/issues/9672
|
||||
|
@ -155,10 +155,10 @@ class Photos extends \Friendica\Module\BaseProfile
|
|||
}
|
||||
|
||||
$hook_data = [
|
||||
'src' => '',
|
||||
'src' => '',
|
||||
'filename' => '',
|
||||
'filesize' => 0,
|
||||
'type' => '',
|
||||
'type' => '',
|
||||
];
|
||||
|
||||
$hook_data = $this->eventDispatcher->dispatch(
|
||||
|
@ -183,7 +183,7 @@ class Photos extends \Friendica\Module\BaseProfile
|
|||
$type = $_FILES['userfile']['type'];
|
||||
$error = $_FILES['userfile']['error'];
|
||||
} else {
|
||||
$error = UPLOAD_ERR_NO_FILE;
|
||||
$error = UPLOAD_ERR_NO_FILE;
|
||||
}
|
||||
|
||||
if ($error !== UPLOAD_ERR_OK) {
|
||||
|
@ -314,7 +314,7 @@ class Photos extends \Friendica\Module\BaseProfile
|
|||
$arr['visible'] = $visible;
|
||||
$arr['origin'] = 1;
|
||||
|
||||
$arr['body'] = Images::getBBCodeByResource($resource_id, $this->owner['nickname'], $preview, $image->getExt());
|
||||
$arr['body'] = Images::getBBCodeByResource($resource_id, $this->owner['nickname'], $preview, $image->getExt());
|
||||
|
||||
$item_id = Item::insert($arr);
|
||||
// Update the photo albums cache
|
||||
|
@ -383,7 +383,7 @@ class Photos extends \Friendica\Module\BaseProfile
|
|||
$pager->getItemsPerPage()
|
||||
));
|
||||
|
||||
$photos = array_map(function ($photo){
|
||||
$photos = array_map(function ($photo) {
|
||||
return [
|
||||
'id' => $photo['id'],
|
||||
'link' => 'photos/' . $this->owner['nickname'] . '/image/' . $photo['resource-id'],
|
||||
|
|
|
@ -78,12 +78,12 @@ class Profile extends BaseProfile
|
|||
) {
|
||||
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||
|
||||
$this->database = $database;
|
||||
$this->appHelper = $appHelper;
|
||||
$this->session = $session;
|
||||
$this->config = $config;
|
||||
$this->page = $page;
|
||||
$this->profileField = $profileField;
|
||||
$this->database = $database;
|
||||
$this->appHelper = $appHelper;
|
||||
$this->session = $session;
|
||||
$this->config = $config;
|
||||
$this->page = $page;
|
||||
$this->profileField = $profileField;
|
||||
$this->eventDispatcher = $eventDispatcher;
|
||||
}
|
||||
|
||||
|
@ -273,7 +273,7 @@ class Profile extends BaseProfile
|
|||
}
|
||||
|
||||
$tpl = Renderer::getMarkupTemplate('profile/profile.tpl');
|
||||
$o .= Renderer::replaceMacros($tpl, [
|
||||
$o .= Renderer::replaceMacros($tpl, [
|
||||
'$title' => $this->t('Profile'),
|
||||
'$yourself' => $this->t('Yourself'),
|
||||
'$view_as_contacts' => $view_as_contacts,
|
||||
|
@ -293,7 +293,7 @@ class Profile extends BaseProfile
|
|||
'title' => '',
|
||||
'label' => $this->t('Edit profile')
|
||||
],
|
||||
'$viewas_link' => [
|
||||
'$viewas_link' => [
|
||||
'url' => $this->args->getQueryString() . '#viewas',
|
||||
'title' => '',
|
||||
'label' => $this->t('View as')
|
||||
|
@ -362,7 +362,7 @@ class Profile extends BaseProfile
|
|||
$htmlhead .= '<link rel="alternate" type="application/atom+xml" href="' . $this->baseUrl . '/feed/' . $nickname . '/" title="' . $this->t('%s\'s posts', htmlspecialchars($profile['name'], ENT_COMPAT, 'UTF-8', true)) . '"/>' . "\n";
|
||||
$htmlhead .= '<link rel="alternate" type="application/atom+xml" href="' . $this->baseUrl . '/feed/' . $nickname . '/comments" title="' . $this->t('%s\'s comments', htmlspecialchars($profile['name'], ENT_COMPAT, 'UTF-8', true)) . '"/>' . "\n";
|
||||
$htmlhead .= '<link rel="alternate" type="application/atom+xml" href="' . $this->baseUrl . '/feed/' . $nickname . '/activity" title="' . $this->t('%s\'s timeline', htmlspecialchars($profile['name'], ENT_COMPAT, 'UTF-8', true)) . '"/>' . "\n";
|
||||
$uri = urlencode('acct:' . $profile['nickname'] . '@' . $this->baseUrl->getHost() . ($this->baseUrl->getPath() ? '/' . $this->baseUrl->getPath() : ''));
|
||||
$uri = urlencode('acct:' . $profile['nickname'] . '@' . $this->baseUrl->getHost() . ($this->baseUrl->getPath() ? '/' . $this->baseUrl->getPath() : ''));
|
||||
$htmlhead .= '<link rel="lrdd" type="application/xrd+xml" href="' . $this->baseUrl . '/xrd/?uri=' . $uri . '" />' . "\n";
|
||||
header('Link: <' . $this->baseUrl . '/xrd/?uri=' . $uri . '>; rel="lrdd"; type="application/xrd+xml"', false);
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ class Register extends BaseModule
|
|||
|
||||
$this->tos = new Tos($l10n, $baseUrl, $args, $logger, $profiler, $response, $config, $server, $parameters);
|
||||
|
||||
$this->session = $session;
|
||||
$this->session = $session;
|
||||
$this->eventDispatcher = $eventDispatcher;
|
||||
}
|
||||
|
||||
|
|
|
@ -62,8 +62,8 @@ class Acl extends BaseModule
|
|||
) {
|
||||
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||
|
||||
$this->session = $session;
|
||||
$this->database = $database;
|
||||
$this->session = $session;
|
||||
$this->database = $database;
|
||||
$this->eventDispatcher = $eventDispatcher;
|
||||
}
|
||||
|
||||
|
@ -118,9 +118,9 @@ class Acl extends BaseModule
|
|||
|
||||
private function regularContactSearch(array $request, string $type): array
|
||||
{
|
||||
$start = $request['start'] ?? 0;
|
||||
$count = $request['count'] ?? 100;
|
||||
$search = $request['search'] ?? '';
|
||||
$start = $request['start'] ?? 0;
|
||||
$count = $request['count'] ?? 100;
|
||||
$search = $request['search'] ?? '';
|
||||
$conv_id = $request['conversation'] ?? null;
|
||||
|
||||
// For use with jquery.textcomplete for private mail completion
|
||||
|
@ -138,9 +138,9 @@ class Acl extends BaseModule
|
|||
$condition_circle = ["`uid` = ? AND NOT `deleted`", $this->session->getLocalUserId()];
|
||||
|
||||
if ($search != '') {
|
||||
$sql_extra = "AND `name` LIKE '%%" . $this->database->escape($search) . "%%'";
|
||||
$condition = DBA::mergeConditions($condition, ["(`attag` LIKE ? OR `name` LIKE ? OR `nick` LIKE ?)",
|
||||
'%' . $search . '%', '%' . $search . '%', '%' . $search . '%']);
|
||||
$sql_extra = "AND `name` LIKE '%%" . $this->database->escape($search) . "%%'";
|
||||
$condition = DBA::mergeConditions($condition, ["(`attag` LIKE ? OR `name` LIKE ? OR `nick` LIKE ?)",
|
||||
'%' . $search . '%', '%' . $search . '%', '%' . $search . '%']);
|
||||
$condition_circle = DBA::mergeConditions($condition_circle, ["`name` LIKE ?", '%' . $search . '%']);
|
||||
}
|
||||
|
||||
|
@ -156,21 +156,27 @@ class Acl extends BaseModule
|
|||
switch ($type) {
|
||||
case self::TYPE_MENTION_CONTACT_CIRCLE:
|
||||
case self::TYPE_MENTION_CONTACT:
|
||||
$condition = DBA::mergeConditions($condition,
|
||||
$condition = DBA::mergeConditions(
|
||||
$condition,
|
||||
["NOT `self` AND NOT `blocked`",
|
||||
]);
|
||||
]
|
||||
);
|
||||
break;
|
||||
|
||||
case self::TYPE_MENTION_GROUP:
|
||||
$condition = DBA::mergeConditions($condition,
|
||||
$condition = DBA::mergeConditions(
|
||||
$condition,
|
||||
["NOT `self` AND NOT `blocked` AND (NOT `ap-posting-restricted` OR `ap-posting-restricted` IS NULL) AND `contact-type` = ?", Contact::TYPE_COMMUNITY
|
||||
]);
|
||||
]
|
||||
);
|
||||
break;
|
||||
|
||||
case self::TYPE_PRIVATE_MESSAGE:
|
||||
$condition = DBA::mergeConditions($condition,
|
||||
$condition = DBA::mergeConditions(
|
||||
$condition,
|
||||
["NOT `self` AND NOT `blocked` AND `network` IN (?, ?, ?)", Protocol::ACTIVITYPUB, Protocol::DFRN, Protocol::DIASPORA
|
||||
]);
|
||||
]
|
||||
);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -184,7 +190,8 @@ class Acl extends BaseModule
|
|||
if ($type == self::TYPE_MENTION_CONTACT_CIRCLE || $type == self::TYPE_MENTION_CIRCLE) {
|
||||
/// @todo We should cache this query.
|
||||
// This can be done when we can delete cache entries via wildcard
|
||||
$circles = $this->database->toArray($this->database->p("SELECT `circle`.`id`, `circle`.`name`, GROUP_CONCAT(DISTINCT `circle_member`.`contact-id` SEPARATOR ',') AS uids
|
||||
$circles = $this->database->toArray($this->database->p(
|
||||
"SELECT `circle`.`id`, `circle`.`name`, GROUP_CONCAT(DISTINCT `circle_member`.`contact-id` SEPARATOR ',') AS uids
|
||||
FROM `group` AS `circle`
|
||||
INNER JOIN `group_member` AS `circle_member` ON `circle_member`.`gid` = `circle`.`id`
|
||||
WHERE NOT `circle`.`deleted` AND `circle`.`uid` = ?
|
||||
|
|
|
@ -111,7 +111,7 @@ class Index extends BaseSettings
|
|||
|
||||
if (strpos($dob, '0000-') === 0 || strpos($dob, '0001-') === 0) {
|
||||
$ignore_year = true;
|
||||
$dob = substr($dob, 5);
|
||||
$dob = substr($dob, 5);
|
||||
}
|
||||
|
||||
if ($ignore_year) {
|
||||
|
@ -245,7 +245,7 @@ class Index extends BaseSettings
|
|||
$this->session->getLocalUserId(),
|
||||
false,
|
||||
['allow_cid' => []],
|
||||
['network' => Protocol::DFRN],
|
||||
['network' => Protocol::DFRN],
|
||||
'profile_field[new]'
|
||||
),
|
||||
],
|
||||
|
@ -278,7 +278,8 @@ class Index extends BaseSettings
|
|||
'miscellaneous_section' => $this->t('Miscellaneous'),
|
||||
'custom_fields_section' => $this->t('Custom Profile Fields'),
|
||||
'profile_photo' => $this->t('Upload Profile Photo'),
|
||||
'custom_fields_description' => $this->t('<p>Custom fields appear on <a href="%s">your profile page</a>.</p>
|
||||
'custom_fields_description' => $this->t(
|
||||
'<p>Custom fields appear on <a href="%s">your profile page</a>.</p>
|
||||
<p>You can use BBCodes in the field values.</p>
|
||||
<p>Reorder by dragging the field title.</p>
|
||||
<p>Empty the label field to remove a custom field.</p>
|
||||
|
@ -314,7 +315,7 @@ class Index extends BaseSettings
|
|||
|
||||
$hook_data = [
|
||||
'profile' => $owner,
|
||||
'entry' => $o,
|
||||
'entry' => $o,
|
||||
];
|
||||
|
||||
$hook_data = $this->eventDispatcher->dispatch(
|
||||
|
|
|
@ -74,12 +74,12 @@ class Notify extends BaseRepository
|
|||
EventDispatcherInterface $eventDispatcher,
|
||||
Factory\Notify $factory = null
|
||||
) {
|
||||
$this->l10n = $l10n;
|
||||
$this->baseUrl = $baseUrl;
|
||||
$this->config = $config;
|
||||
$this->pConfig = $pConfig;
|
||||
$this->emailer = $emailer;
|
||||
$this->notification = $notification;
|
||||
$this->l10n = $l10n;
|
||||
$this->baseUrl = $baseUrl;
|
||||
$this->config = $config;
|
||||
$this->pConfig = $pConfig;
|
||||
$this->emailer = $emailer;
|
||||
$this->notification = $notification;
|
||||
$this->eventDispatcher = $eventDispatcher;
|
||||
|
||||
parent::__construct($database, $logger, $factory ?? new Factory\Notify($logger));
|
||||
|
|
|
@ -376,7 +376,7 @@ class StorageManagerTest extends DatabaseTestCase
|
|||
$this->l10n,
|
||||
false
|
||||
);
|
||||
$storage = $storageManager->getWritableStorageByName($name);
|
||||
$storage = $storageManager->getWritableStorageByName($name);
|
||||
$storageManager->move($storage);
|
||||
|
||||
$photos = $this->database->select('photo', ['backend-ref', 'backend-class', 'id', 'data']);
|
||||
|
@ -407,7 +407,7 @@ class StorageManagerTest extends DatabaseTestCase
|
|||
$this->l10n,
|
||||
false
|
||||
);
|
||||
$storage = $storageManager->getWritableStorageByName(SystemResource::getName());
|
||||
$storage = $storageManager->getWritableStorageByName(SystemResource::getName());
|
||||
$storageManager->move($storage);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue