1
0
Fork 0

Merge remote-tracking branch 'upstream/2023.03-rc' into npf2

This commit is contained in:
Michael 2023-03-27 06:42:24 +00:00
commit c4c80ed3cc
266 changed files with 691 additions and 643 deletions

View file

@ -391,7 +391,7 @@ class App
}
/**
* Returns the current theme name. May be overriden by the mobile theme name.
* Returns the current theme name. May be overridden by the mobile theme name.
*
* @return string Current theme name or empty string in installation phase
* @throws Exception
@ -532,7 +532,7 @@ class App
/**
* Provide a sane default if nothing is chosen or the specified theme does not exist.
*
* @return string Current theme's stylsheet path
* @return string Current theme's stylesheet path
* @throws Exception
*/
public function getCurrentThemeStylesheetPath(): string

View file

@ -253,9 +253,9 @@ class Page implements ArrayAccess
'$touch_icon' => $touch_icon,
'$block_public' => intval($config->get('system', 'block_public')),
'$stylesheets' => $this->stylesheets,
'$likeError' => $l10n->t('Like not successfull'),
'$dislikeError' => $l10n->t('Dislike not successfull'),
'$announceError' => $l10n->t('Sharing not successfull'),
'$likeError' => $l10n->t('Like not successful'),
'$dislikeError' => $l10n->t('Dislike not successful'),
'$announceError' => $l10n->t('Sharing not successful'),
'$attendError' => $l10n->t('Attendance unsuccessful'),
'$srvError' => $l10n->t('Backend error'),
'$netError' => $l10n->t('Network error'),
@ -291,7 +291,7 @@ class Page implements ArrayAccess
* Initializes Page->page['footer'].
*
* Includes:
* - Javascript homebase
* - JavaScript homebase
* - Mobile toggle link
* - Registered footer scripts (through App->registerFooterScript())
* - footer.tpl template
@ -503,7 +503,7 @@ class Page implements ArrayAccess
$content = mb_convert_encoding($this->page["content"], 'HTML-ENTITIES', "UTF-8");
/// @TODO one day, kill those error-surpressing @ stuff, or PHP should ban it
/// @TODO one day, kill those error-suppressing @ stuff, or PHP should ban it
@$doc->loadHTML($content);
$xpath = new DOMXPath($doc);

View file

@ -412,7 +412,7 @@ class Router
}
if (!$this->lock->acquire('getCachedDispatchData', 0)) {
// Immediately return uncached data when we can't aquire a lock
// Immediately return uncached data when we can't acquire a lock
return $this->getDispatchData();
}

View file

@ -24,7 +24,7 @@ namespace Friendica;
use Psr\Log\LoggerInterface;
/**
* Factories act as an intermediary to avoid direct Entitiy instanciation.
* Factories act as an intermediary to avoid direct Entity instantiation.
*
* @see BaseModel
* @see BaseCollection

View file

@ -94,7 +94,7 @@ abstract class BaseModel extends BaseDataTransferObject
}
/**
* Magic isset method. Returns true if the field exists, either in the data prperty array or in any of the local properties.
* Magic isset method. Returns true if the field exists, either in the data property array or in any of the local properties.
* Used by array_column() on an array of objects.
*
* @param $name

View file

@ -90,9 +90,9 @@ abstract class BaseModule implements ICanHandleRequests
*
* @see L10n::tt()
*/
protected function tt(string $singular, string $plurarl, int $count): string
protected function tt(string $singular, string $plural, int $count): string
{
return $this->l10n->tt($singular, $plurarl, $count);
return $this->l10n->tt($singular, $plural, $count);
}
/**

View file

@ -95,7 +95,7 @@ Examples
bin/console autoinstall --savedb
Installs Friendica with environment variables and saves them to the 'config/local.config.php' file
bin/console autoinstall -H localhost -p 3365 -u user -P passwort1234 -d friendica -U https://friendica.fqdn
bin/console autoinstall -H localhost -p 3365 -u user -P password1234 -d friendica -U https://friendica.fqdn
Installs Friendica with a local mysql database with credentials
HELP;
}

View file

@ -30,7 +30,7 @@ use Friendica\App;
*
* Basically, docblox takes a list of files to build documentation from. This script assumes there is a file or set of files
* breaking the build when it is included in that list. It tries to calculate the smallest list containing these files.
* Unfortunatly, the original problem is NP-complete, so what the script does is a best guess only.
* Unfortunately, the original problem is NP-complete, so what the script does is a best guess only.
*
* So it starts with a list of all files in the project.
* If that list can't be build, it cuts it in two parts and tries both parts independently. If only one of them breaks,

View file

@ -129,7 +129,7 @@ HELP;
if (!$parameters) {
$this->errored++;
if ($this->getOption('v')) {
$this->out('Unabled to parse parameter JSON of the row with id ' . $workerqueueItem['id']);
$this->out('Unable to parse parameter JSON of the row with id ' . $workerqueueItem['id']);
$this->out('JSON: ' . var_export($workerqueueItem['parameter'], true));
}
}
@ -155,7 +155,7 @@ HELP;
} else {
$this->errored++;
if ($this->getOption('v')) {
$this->out('Unabled to update the row with id ' . $workerqueueItem['id']);
$this->out('Unable to update the row with id ' . $workerqueueItem['id']);
$this->out('Fields: ' . var_export($fields, true));
}
}

View file

@ -231,7 +231,7 @@ HELP;
}
/**
* Get a string and retun a message.po ready text
* Get a string and return a message.po ready text
* - replace " with \"
* - replace tab char with \t
* - manage multiline strings

View file

@ -270,7 +270,7 @@ HELP;
}
/**
* Allows or denys a user based on it's nickname
* Allows or denies a user based on it's nickname
*
* @param bool $allow True, if the pending user is allowed, false if denies
*

View file

@ -94,7 +94,7 @@ class BoundariesPager extends Pager
* $params = ['order' => ['sort_field' => true], 'limit' => $itemsPerPage];
* $items = DBA::toArray(DBA::select($table, $fields, $condition, $params));
*
* $pager = new BoundariesPager($a->query_string, $items[0]['sort_field'], $items[coutn($items) - 1]['sort_field'], $itemsPerPage);
* $pager = new BoundariesPager($a->query_string, $items[0]['sort_field'], $items[count($items) - 1]['sort_field'], $itemsPerPage);
*
* $html = $pager->renderMinimal(count($items));
*

View file

@ -1362,7 +1362,7 @@ class Conversation
}
}
/// @TODO: Stop recusrsively adding all children back to the top level (!!!)
/// @TODO: Stop recursively adding all children back to the top level (!!!)
/// However, this apparently ensures responses (likes, attendance) display (?!)
foreach ($parents as $parent) {
if (count($parent['children'])) {

View file

@ -79,7 +79,7 @@ class Feature
* Get a list of all available features
*
* The array includes the setting group, the setting name,
* explainations for the setting and if it's enabled or disabled
* explanations for the setting and if it's enabled or disabled
* by default
*
* @param bool $filtered True removes any locked features

View file

@ -38,7 +38,7 @@ class ForumManager
*
* @param int $uid of the profile owner
* @param boolean $lastitem Sort by lastitem
* @param boolean $showhidden Show frorums which are not hidden
* @param boolean $showhidden Show forums which are not hidden
* @param boolean $showprivate Show private groups
*
* @return array
@ -102,7 +102,7 @@ class ForumManager
/**
* Forumlist widget
*
* Sidebar widget to show subcribed friendica forums. If activated
* Sidebar widget to show subscribed friendica forums. If activated
* in the settings, it appears at the notwork page sidebar
*
* @param string $baseurl Base module path

View file

@ -338,7 +338,7 @@ class Item
} else {
$post_type = $this->l10n->t('status');
}
// Let's break everthing ... ;-)
// Let's break everything ... ;-)
break;
}
$plink = '[url=' . $obj['plink'] . ']' . $post_type . '[/url]';
@ -548,7 +548,7 @@ class Item
$item['allow_cid'] = '';
$item['allow_gid'] = '';
}
} elseif ($setPermissions && ($item['gravity'] == ItemModel::GRAVITY_PARENT)) {
} elseif ($setPermissions) {
if (empty($receivers)) {
// For security reasons direct posts without any receiver will be posts to yourself
$self = Contact::selectFirst(['id'], ['uid' => $item['uid'], 'self' => true]);
@ -685,11 +685,11 @@ class Item
// If it is a reshared post then reformat it to avoid display problems with two share elements
if (!empty($shared)) {
if (!empty($shared['guid']) && ($encaspulated_share = $this->createSharedPostByGuid($shared['guid'], true))) {
if (!empty($shared['guid']) && ($encapsulated_share = $this->createSharedPostByGuid($shared['guid'], true))) {
if (!empty(BBCode::fetchShareAttributes($item['body']))) {
$item['body'] = preg_replace("/\[share.*?\](.*)\[\/share\]/ism", $encaspulated_share, $item['body']);
$item['body'] = preg_replace("/\[share.*?\](.*)\[\/share\]/ism", $encapsulated_share, $item['body']);
} else {
$item['body'] .= $encaspulated_share;
$item['body'] .= $encapsulated_share;
}
}
$item['body'] = HTML::toBBCode(BBCode::convertForUriId($item['uri-id'], $item['body'], BBCode::ACTIVITYPUB));

View file

@ -385,7 +385,7 @@ class OEmbed
}
/**
* Returns a formmated HTML code from given URL and sets optional title
* Returns a formatted HTML code from given URL and sets optional title
*
* @param string $url URL to fetch
* @param string $title Optional title (default: what comes from OEmbed object)
@ -447,7 +447,7 @@ class OEmbed
* Generates an XPath query to select elements whose provided attribute contains
* the provided value in a space-separated list.
*
* @param string $attr Name of the attribute to seach
* @param string $attr Name of the attribute to search
* @param string $value Value to search in a space-separated list
* @return string
*/

View file

@ -141,7 +141,7 @@ class PageInfo
$data['text'] = '';
}
// Only embedd a picture link when it seems to be a valid picture ("width" is set)
// Only embed a picture link when it seems to be a valid picture ("width" is set)
if (!empty($data['images']) && !empty($data['images'][0]['width'])) {
$preview = str_replace(['[', ']'], ['[', ']'], htmlentities($data['images'][0]['src'], ENT_QUOTES, 'UTF-8', false));
// if the preview picture is larger than 500 pixels then show it in a larger mode

View file

@ -133,7 +133,7 @@ class Smilies
'<img class="smiley" src="' . $baseUrl . '/images/smiley-cry.gif" alt=":\'(" title=":\'("/>',
'<img class="smiley" src="' . $baseUrl . '/images/smiley-foot-in-mouth.gif" alt=":-!" title=":-!" />',
'<img class="smiley" src="' . $baseUrl . '/images/smiley-undecided.gif" alt=":-/" title=":-/" />',
'<img class="smiley" src="' . $baseUrl . '/images/smiley-embarassed.gif" alt=":-[" title=":-[" />',
'<img class="smiley" src="' . $baseUrl . '/images/smiley-embarrassed.gif" alt=":-[" title=":-[" />',
'<img class="smiley" src="' . $baseUrl . '/images/smiley-cool.gif" alt="8-)" title="8-)" />',
'<img class="smiley" src="' . $baseUrl . '/images/beer_mug.gif" alt=":beer" title=":beer" />',
'<img class="smiley" src="' . $baseUrl . '/images/beer_mug.gif" alt=":homebrew" title=":homebrew" />',

View file

@ -548,7 +548,7 @@ class BBCode
/*
* The previously spacefied [noparse][ i ]italic[ /i ][/noparse],
* now turns back and the [noparse] tags are trimed
* now turns back and the [noparse] tags are trimmed
* returning [i]italic[/i]
*
* @param array $match
@ -1373,7 +1373,7 @@ class BBCode
});
}
// leave open the posibility of [map=something]
// leave open the possibility of [map=something]
// this is replaced in Item::prepareBody() which has knowledge of the item location
if (strpos($text, '[/map]') !== false) {
$text = preg_replace_callback(

View file

@ -842,7 +842,7 @@ class HTML
*
* @param string $s Search query.
* @param string $id HTML id
* @param bool $aside Display the search widgit aside.
* @param bool $aside Display the search widget aside.
*
* @return string Formatted HTML.
* @throws \Exception

View file

@ -180,7 +180,7 @@ class Plaintext
$msg = trim($post['description']);
}
// If the link is already contained in the post, then it neeedn't to be added again
// If the link is already contained in the post, then it needn't to be added again
// But: if the link is beyond the limit, then it has to be added.
if (($link != '') && strstr($msg, $link)) {
$pos = strpos($msg, $link);

View file

@ -59,7 +59,7 @@ class Widget
/**
* Return Find People widget
*
* @return string HTML code respresenting "People Widget"
* @return string HTML code representing "People Widget"
*/
public static function findPeople(): string
{

View file

@ -47,7 +47,7 @@ class ACL
/**
* Returns a select input tag for private message recipient
*
* @param int $selected Existing recipien contact ID
* @param int $selected Existing recipient contact ID
* @return string
* @throws \Exception
*/

View file

@ -98,17 +98,17 @@ class Installer
* Checks the current installation environment. There are optional and mandatory checks.
*
* @param string $baseurl The baseurl of Friendica
* @param string $phpath Optional path to the PHP binary
* @param string $phppath Optional path to the PHP binary
*
* @return bool if the check succeed
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
public function checkEnvironment($baseurl, $phpath = null)
public function checkEnvironment($baseurl, $phppath = null)
{
$returnVal = true;
if (isset($phpath)) {
if (!$this->checkPHP($phpath)) {
if (isset($phppath)) {
if (!$this->checkPHP($phppath)) {
$returnVal = false;
}
}
@ -165,7 +165,7 @@ class Installer
'$dbpass' => $configCache->get('database', 'password'),
'$dbdata' => $configCache->get('database', 'database'),
'$phpath' => $configCache->get('config', 'php_path'),
'$phppath' => $configCache->get('config', 'php_path'),
'$adminmail' => $configCache->get('config', 'admin_email'),
'$system_url' => $configCache->get('system', 'url'),
@ -590,8 +590,8 @@ class Installer
* TLS Check
*
* Tries to determine whether the connection to the server is secured
* by TLS or not. If not the user will be warned that it is higly
* encuraged to use TLS.
* by TLS or not. If not the user will be warned that it is highly
* encouraged to use TLS.
*
* @return bool (true) as TLS is not mandatory
*/

View file

@ -334,7 +334,7 @@ class L10n
// for some languages there is only a single array item
$s = $t[0];
}
// if $t is empty, skip it, because empty strings array are indended
// if $t is empty, skip it, because empty strings array are intended
// to make string file smaller when there's no translation
} else {
$s = $t;

View file

@ -36,7 +36,7 @@ class Logger
*/
const TYPE_LOGGER = LoggerInterface::class;
/**
* @var WorkerLogger A specific worker logger type, which can be anabled
* @var WorkerLogger A specific worker logger type, which can be enabled
*/
const TYPE_WORKER = WorkerLogger::class;
/**
@ -206,7 +206,7 @@ class Logger
* An alternative logger for development.
*
* Works largely as log() but allows developers
* to isolate particular elements they are targetting
* to isolate particular elements they are targeting
* personally without background noise
*
* @param string $message Message to log

View file

@ -27,7 +27,7 @@ use Friendica\Core\Storage\Exception\StorageException;
/**
* Interface for writable storage backends
*
* Used for storages with CRUD functionality, mainly used for user data (e.g. photos, attachements).
* Used for storages with CRUD functionality, mainly used for user data (e.g. photos, attachments).
* There's only one active writable storage possible. This type of storage is selectable by the current administrator.
*/
interface ICanWriteToStorage extends ICanReadFromStorage

View file

@ -35,7 +35,7 @@ use Friendica\Util\Strings;
* Best would be for storage folder to be outside webserver folder, we are using a
* folder relative to code tree root as default to ease things for users in shared hostings.
* Each new resource gets a value as reference and is saved in a
* folder tree stucture created from that value.
* folder tree structure created from that value.
*/
class Filesystem implements ICanWriteToStorage
{

View file

@ -321,7 +321,7 @@ class System
}
/**
* This function adds the content and a content-teype HTTP header to the output.
* This function adds the content and a content-type HTTP header to the output.
* After finishing the process is getting killed.
*
* @param string $content

View file

@ -362,7 +362,7 @@ class Worker
return false;
}
// Check for existance and validity of the include file
// Check for existence and validity of the include file
$include = $argv[0];
if (method_exists(sprintf('Friendica\Worker\%s', $include), 'execute')) {
@ -590,7 +590,7 @@ class Worker
/* With these values we can analyze how effective the worker is.
* The database and rest time should be low since this is the unproductive time.
* The execution time is the productive time.
* By changing parameters like the maximum number of workers we can check the effectivness.
* By changing parameters like the maximum number of workers we can check the effectiveness.
*/
$dbtotal = round(self::$db_duration, 2);
$dbread = round(self::$db_duration - (self::$db_duration_count + self::$db_duration_write + self::$db_duration_stat), 2);
@ -885,7 +885,7 @@ class Worker
/**
* Returns waiting jobs for the current process id
*
* @return array|bool waiting workerqueue jobs or FALSE on failture
* @return array|bool waiting workerqueue jobs or FALSE on failure
* @throws \Exception
*/
private static function getWaitingJobForPID()
@ -1422,7 +1422,7 @@ class Worker
*/
public static function isInMaintenanceWindow(bool $check_last_execution = false): bool
{
// Calculate the seconds of the start end end of the maintenance window
// Calculate the seconds of the start and end of the maintenance window
$start = strtotime(DI::config()->get('system', 'maintenance_start')) % 86400;
$end = strtotime(DI::config()->get('system', 'maintenance_end')) % 86400;

View file

@ -69,7 +69,7 @@ abstract class DI
/**
* Returns a clone of the current dice instance
* This usefull for overloading the current instance with mocked methods during tests
* This useful for overloading the current instance with mocked methods during tests
*
* @return Dice
*/

View file

@ -205,7 +205,7 @@ class DBA
* Please use DBA::delete, DBA::insert, DBA::update, ... instead
*
* @param string $sql SQL statement
* @return boolean Was the query successfull? False is returned only if an error occurred
* @return boolean Was the query successful? False is returned only if an error occurred
* @throws \Exception
*/
public static function e(string $sql): bool
@ -420,7 +420,7 @@ class DBA
* @param array|boolean $old_fields array with the old field values that are about to be replaced (true = update on duplicate, false = don't update identical fields)
* @param array $params Parameters: "ignore" If set to "true" then the update is done with the ignore parameter
*
* @return boolean was the update successfull?
* @return boolean was the update successful?
* @throws \Exception
*/
public static function update(string $table, array $fields, array $condition, $old_fields = [], array $params = []): bool

View file

@ -102,7 +102,7 @@ class Database
*
* @return void
*
* @todo Make this method obsolet - use a clean pattern instead ...
* @todo Make this method obsolete - use a clean pattern instead ...
*/
public function setDependency(IManageConfigValues $config, Profiler $profiler, LoggerInterface $logger)
{
@ -767,7 +767,7 @@ class Database
*
* @param string $sql SQL statement
*
* @return boolean Was the query successfull? False is returned only if an error occurred
* @return boolean Was the query successful? False is returned only if an error occurred
* @throws \Exception
*/
public function e(string $sql): bool
@ -1321,7 +1321,7 @@ class Database
* @param array|boolean $old_fields array with the old field values that are about to be replaced (true = update on duplicate, false = don't update identical fields)
* @param array $params Parameters: "ignore" If set to "true" then the update is done with the ignore parameter
*
* @return boolean was the update successfull?
* @return boolean was the update successful?
* @throws \Exception
* @todo Implement "bool $update_on_duplicate" to avoid mixed type for $old_fields
*/

View file

@ -82,7 +82,7 @@ class DbaDefinition
// Assign all field that are present in the table
foreach ($fieldNames as $field) {
if (isset($data[$field])) {
// Limit the length of varchar, varbinary, char and binrary fields
// Limit the length of varchar, varbinary, char and binary fields
if (is_string($data[$field]) && preg_match("/char\((\d*)\)/", $definition[$table]['fields'][$field]['type'], $result)) {
$data[$field] = mb_substr($data[$field], 0, $result[1]);
} elseif (is_string($data[$field]) && preg_match("/binary\((\d*)\)/", $definition[$table]['fields'][$field]['type'], $result)) {

View file

@ -55,7 +55,7 @@ class Status extends BaseFactory
/** @var Card */
private $mstdnCardFactory;
/** @var Attachment */
private $mstdnAttachementFactory;
private $mstdnAttachmentFactory;
/** @var Error */
private $mstdnErrorFactory;
/** @var Poll */
@ -70,21 +70,21 @@ class Status extends BaseFactory
Mention $mstdnMentionFactory,
Tag $mstdnTagFactory,
Card $mstdnCardFactory,
Attachment $mstdnAttachementFactory,
Attachment $mstdnAttachmentFactory,
Error $mstdnErrorFactory,
Poll $mstdnPollFactory,
ContentItem $contentItem
) {
parent::__construct($logger);
$this->dba = $dba;
$this->mstdnAccountFactory = $mstdnAccountFactory;
$this->mstdnMentionFactory = $mstdnMentionFactory;
$this->mstdnTagFactory = $mstdnTagFactory;
$this->mstdnCardFactory = $mstdnCardFactory;
$this->mstdnAttachementFactory = $mstdnAttachementFactory;
$this->mstdnErrorFactory = $mstdnErrorFactory;
$this->mstdnPollFactory = $mstdnPollFactory;
$this->contentItem = $contentItem;
$this->dba = $dba;
$this->mstdnAccountFactory = $mstdnAccountFactory;
$this->mstdnMentionFactory = $mstdnMentionFactory;
$this->mstdnTagFactory = $mstdnTagFactory;
$this->mstdnCardFactory = $mstdnCardFactory;
$this->mstdnAttachmentFactory = $mstdnAttachmentFactory;
$this->mstdnErrorFactory = $mstdnErrorFactory;
$this->mstdnPollFactory = $mstdnPollFactory;
$this->contentItem = $contentItem;
}
/**
@ -175,7 +175,15 @@ class Status extends BaseFactory
'origin' => true,
'gravity' => Item::GRAVITY_ACTIVITY,
'vid' => Verb::getID(Activity::LIKE),
'deleted' => false
'deleted' => false
]);
$origin_dislike = ($count_dislike == 0) ? false : Post::exists([
'thr-parent-id' => $uriId,
'uid' => $uid,
'origin' => true,
'gravity' => Item::GRAVITY_ACTIVITY,
'vid' => Verb::getID(Activity::DISLIKE),
'deleted' => false
]);
$origin_announce = ($count_announce == 0) ? false : Post::exists([
'thr-parent-id' => $uriId,
@ -206,7 +214,7 @@ class Status extends BaseFactory
$tags = $this->mstdnTagFactory->createFromUriId($uriId);
if ($item['has-media']) {
$card = $this->mstdnCardFactory->createFromUriId($uriId);
$attachments = $this->mstdnAttachementFactory->createFromUriId($uriId);
$attachments = $this->mstdnAttachmentFactory->createFromUriId($uriId);
} else {
$card = new \Friendica\Object\Api\Mastodon\Card([]);
$attachments = [];
@ -250,7 +258,7 @@ class Status extends BaseFactory
}
}
foreach ($this->mstdnAttachementFactory->createFromUriId($shared_uri_id) as $attachment) {
foreach ($this->mstdnAttachmentFactory->createFromUriId($shared_uri_id) as $attachment) {
if (!in_array($attachment, $attachments)) {
$attachments[] = $attachment;
}
@ -295,7 +303,7 @@ class Status extends BaseFactory
$aclFormatter = DI::aclFormatter();
$delivery_data = $uid != $item['uid'] ? null : new FriendicaDeliveryData($item['delivery_queue_count'], $item['delivery_queue_done'], $item['delivery_queue_failed']);
$visibility_data = $uid != $item['uid'] ? null : new FriendicaVisibility($aclFormatter->expand($item['allow_cid']), $aclFormatter->expand($item['deny_cid']), $aclFormatter->expand($item['allow_gid']), $aclFormatter->expand($item['deny_gid']));
$friendica = new FriendicaExtension($item['title'], $item['changed'], $item['commented'], $item['received'], $counts->dislikes, $delivery_data, $visibility_data);
$friendica = new FriendicaExtension($item['title'], $item['changed'], $item['commented'], $item['received'], $counts->dislikes, $origin_dislike, $delivery_data, $visibility_data);
return new \Friendica\Object\Api\Mastodon\Status($item, $account, $counts, $userAttributes, $sensitive, $application, $mentions, $tags, $card, $attachments, $in_reply, $reshare, $friendica, $quote, $poll);
}
@ -361,7 +369,7 @@ class Status extends BaseFactory
$attachments = [];
$in_reply = [];
$reshare = [];
$friendica = new FriendicaExtension('', null, null, null, 0, null, null);
$friendica = new FriendicaExtension('', null, null, null, 0, false, null, null);
return new \Friendica\Object\Api\Mastodon\Status($item, $account, $counts, $userAttributes, $sensitive, $application, $mentions, $tags, $card, $attachments, $in_reply, $reshare, $friendica);
}

View file

@ -32,7 +32,7 @@ use Friendica\Util\Mimetype;
use Friendica\Security\Security;
/**
* Class to handle attach dabatase table
* Class to handle attach database table
*/
class Attach
{
@ -107,7 +107,7 @@ class Attach
}
/**
* Retrive a single record given the ID
* Retrieve a single record given the ID
*
* @param int $id Row id of the record
*
@ -122,7 +122,7 @@ class Attach
}
/**
* Retrive a single record given the ID
* Retrieve a single record given the ID
*
* @param int $id Row id of the record
*
@ -192,7 +192,7 @@ class Attach
* @param string $allow_cid Permissions, allowed contacts. optional, default = ''
* @param string $allow_gid Permissions, allowed groups. optional, default = ''
* @param string $deny_cid Permissions, denied contacts.optional, default = ''
* @param string $deny_gid Permissions, denied greoup.optional, default = ''
* @param string $deny_gid Permissions, denied group.optional, default = ''
*
* @return boolean|integer Row id on success, False on errors
* @throws \Friendica\Network\HTTPException\InternalServerErrorException

View file

@ -239,7 +239,7 @@ class Contact
* @param array $condition condition array with the key values
* @param array|boolean $old_fields array with the old field values that are about to be replaced (true = update on duplicate, false = don't update identical fields)
*
* @return boolean was the update successfull?
* @return boolean was the update successful?
* @throws \Exception
* @todo Let's get rid of boolean type of $old_fields
*/
@ -1686,7 +1686,7 @@ class Contact
* Unblocks a contact
*
* @param int $cid Contact id to unblock
* @return bool Whether it was successfull
* @return bool Whether it was successful
*/
public static function unblock(int $cid): bool
{
@ -1733,7 +1733,7 @@ class Contact
*
* @param array $contact contact array
* @param string $size Size of the avatar picture
* @param bool $no_update Don't perfom an update if no cached avatar was found
* @param bool $no_update Don't perform an update if no cached avatar was found
* @return string photo path
*/
private static function getAvatarPath(array $contact, string $size, bool $no_update = false): string
@ -1767,7 +1767,7 @@ class Contact
* Return the photo path for a given contact array
*
* @param array $contact Contact array
* @param bool $no_update Don't perfom an update if no cached avatar was found
* @param bool $no_update Don't perform an update if no cached avatar was found
* @return string photo path
*/
public static function getPhoto(array $contact, bool $no_update = false): string
@ -1779,7 +1779,7 @@ class Contact
* Return the photo path (thumb size) for a given contact array
*
* @param array $contact Contact array
* @param bool $no_update Don't perfom an update if no cached avatar was found
* @param bool $no_update Don't perform an update if no cached avatar was found
* @return string photo path
*/
public static function getThumb(array $contact, bool $no_update = false): string
@ -1791,7 +1791,7 @@ class Contact
* Return the photo path (micro size) for a given contact array
*
* @param array $contact Contact array
* @param bool $no_update Don't perfom an update if no cached avatar was found
* @param bool $no_update Don't perform an update if no cached avatar was found
* @return string photo path
*/
public static function getMicro(array $contact, bool $no_update = false): string
@ -1803,7 +1803,7 @@ class Contact
* Check the given contact array for avatar cache fields
*
* @param array $contact
* @param bool $no_update Don't perfom an update if no cached avatar was found
* @param bool $no_update Don't perform an update if no cached avatar was found
* @return array contact array with avatar cache fields
*/
private static function checkAvatarCacheByArray(array $contact, bool $no_update = false): array

View file

@ -49,7 +49,7 @@ class Conversation
*/
const UNKNOWN = 0;
/**
* The message had been pushed to this sytem
* The message had been pushed to this system
*/
const PUSH = 1;
/**

View file

@ -656,7 +656,7 @@ class Event
}
// Show edit and drop actions only if the user is the owner of the event and the event
// is a real event (no bithdays).
// is a real event (no birthdays).
$edit = null;
$copy = null;
$drop = null;

View file

@ -92,7 +92,7 @@ class GServer
const DETECT_NODEINFO_210 = 103;
/**
* Check for the existance of a server and adds it in the background if not existant
* Check for the existence of a server and adds it in the background if not existant
*
* @param string $url
* @param boolean $only_nodeinfo
@ -327,7 +327,7 @@ class GServer
return DateTimeFormat::utc('now +1 month');
}
// The system hadn't been successul contacted for more than a month, so try again in three months
// The system hadn't been successful contacted for more than a month, so try again in three months
return DateTimeFormat::utc('now +3 month');
}
@ -557,7 +557,7 @@ class GServer
return false;
}
// If the URL missmatches, then we mark the old entry as failure
// If the URL mismatches, then we mark the old entry as failure
if (!Strings::compareLink($url, $original_url)) {
self::setFailureByUrl($original_url);
if (!self::getID($url, true) && !Network::isUrlBlocked($url)) {
@ -675,7 +675,7 @@ class GServer
}
// All following checks are done for systems that always have got a "host-meta" endpoint.
// With this check we don't have to waste time and ressources for dead systems.
// With this check we don't have to waste time and resources for dead systems.
// Also this hopefully prevents us from receiving abuse messages.
if (($serverdata['network'] == Protocol::PHANTOM) || in_array($serverdata['detection-method'], self::DETECT_UNSPECIFIC)) {
$validHostMeta = self::validHostMeta($url);
@ -2437,7 +2437,7 @@ class GServer
}
}
// Disvover Mastodon servers
// Discover Mastodon servers
$accesstoken = DI::config()->get('system', 'instances_social_key');
if (!empty($accesstoken)) {

View file

@ -60,7 +60,7 @@ class Group
/**
* Checks whether given group id is found in database
*
* @param int $group_id Groupd it
* @param int $group_id Group id
* @param int $uid Optional user id
* @return bool
* @throws \Exception

View file

@ -233,7 +233,7 @@ class Item
Post\Media::insertFromAttachment($item['uri-id'], $fields['attach']);
}
// We only need to notfiy others when it is an original entry from us.
// We only need to notify others when it is an original entry from us.
// Only call the notifier when the item had been edited and records had been changed.
if ($item['origin'] && !empty($fields['edited']) && ($previous['edited'] != $fields['edited'])) {
$notify_items[] = $item['id'];
@ -875,7 +875,7 @@ class Item
/*
* Do we already have this item?
* We have to check several networks since Friendica posts could be repeated
* via OStatus (maybe Diasporsa as well)
* via OStatus (maybe Diaspora as well)
*/
$duplicate = self::getDuplicateID($item);
if ($duplicate) {
@ -892,6 +892,8 @@ class Item
$item['post-type'] = empty($item['title']) ? self::PT_NOTE : self::PT_ARTICLE;
}
$defined_permissions = isset($item['allow_cid']) && isset($item['allow_gid']) && isset($item['deny_cid']) && isset($item['deny_gid']) && isset($item['private']);
$item['wall'] = intval($item['wall'] ?? 0);
$item['extid'] = trim($item['extid'] ?? '');
$item['author-name'] = trim($item['author-name'] ?? '');
@ -931,7 +933,7 @@ class Item
$item['inform'] = trim($item['inform'] ?? '');
$item['file'] = trim($item['file'] ?? '');
// Communities aren't working with the Diaspora protoccol
// Communities aren't working with the Diaspora protocol
if (($uid != 0) && ($item['network'] == Protocol::DIASPORA)) {
$user = User::getById($uid, ['account-type']);
if ($user['account-type'] == Contact::TYPE_COMMUNITY) {
@ -993,7 +995,7 @@ class Item
$item['wall'] = $toplevel_parent['wall'];
// Reshares have to keep their permissions to allow forums to work
if (!$item['origin'] || ($item['verb'] != Activity::ANNOUNCE)) {
if (!$defined_permissions && (!$item['origin'] || ($item['verb'] != Activity::ANNOUNCE))) {
$item['allow_cid'] = $toplevel_parent['allow_cid'];
$item['allow_gid'] = $toplevel_parent['allow_gid'];
$item['deny_cid'] = $toplevel_parent['deny_cid'];
@ -1016,7 +1018,7 @@ class Item
* This differs from the above settings as it subtly allows comments from
* email correspondents to be private even if the overall thread is not.
*/
if ($toplevel_parent['private']) {
if (!$defined_permissions && $toplevel_parent['private']) {
$item['private'] = $toplevel_parent['private'];
}
@ -1063,7 +1065,7 @@ class Item
}
// ACL settings
if (!empty($item['allow_cid'] . $item['allow_gid'] . $item['deny_cid'] . $item['deny_gid'])) {
if (!$defined_permissions && !empty($item['allow_cid'] . $item['allow_gid'] . $item['deny_cid'] . $item['deny_gid'])) {
$item['private'] = self::PRIVATE;
}
@ -1497,7 +1499,7 @@ class Item
$users = [];
/// @todo add a field "pcid" in the contact table that referrs to the public contact id.
/// @todo add a field "pcid" in the contact table that refers to the public contact id.
$owner = DBA::selectFirst('contact', ['url', 'nurl', 'alias'], ['id' => $parent['owner-id']]);
if (!DBA::isResult($owner)) {
return;
@ -2499,12 +2501,12 @@ class Item
*/
public static function enumeratePermissions(array $obj, bool $check_dead = false): array
{
$aclFormater = DI::aclFormatter();
$aclFormatter = DI::aclFormatter();
$allow_people = $aclFormater->expand($obj['allow_cid']);
$allow_groups = Group::expand($obj['uid'], $aclFormater->expand($obj['allow_gid']), $check_dead);
$deny_people = $aclFormater->expand($obj['deny_cid']);
$deny_groups = Group::expand($obj['uid'], $aclFormater->expand($obj['deny_gid']), $check_dead);
$allow_people = $aclFormatter->expand($obj['allow_cid']);
$allow_groups = Group::expand($obj['uid'], $aclFormatter->expand($obj['allow_gid']), $check_dead);
$deny_people = $aclFormatter->expand($obj['deny_cid']);
$deny_groups = Group::expand($obj['uid'], $aclFormatter->expand($obj['deny_gid']), $check_dead);
$recipients = array_unique(array_merge($allow_people, $allow_groups));
$deny = array_unique(array_merge($deny_people, $deny_groups));
$recipients = array_diff($recipients, $deny);
@ -2613,7 +2615,7 @@ class Item
* Activity verb. One of
* like, unlike, dislike, undislike, attendyes, unattendyes,
* attendno, unattendno, attendmaybe, unattendmaybe,
* announce, unannouce
* announce, unannounce
* @param int $uid
* @param string $allow_cid
* @param string $allow_gid

View file

@ -25,7 +25,7 @@ use Friendica\Util\ReversedFileReader;
use Friendica\Object\Log\ParsedLogLine;
/**
* An iterator which returns `\Friendica\Objec\Log\ParsedLogLine` instances
* An iterator which returns `\Friendica\Object\Log\ParsedLogLine` instances
*
* Uses `\Friendica\Util\ReversedFileReader` to fetch log lines
* from newest to oldest.

View file

@ -67,7 +67,7 @@ class Nodeinfo
DI::keyValue()->set('nodeinfo_local_posts', $posts);
DI::keyValue()->set('nodeinfo_local_comments', $comments);
$logger->info('User actitivy', ['posts' => $posts, 'comments' => $comments]);
$logger->info('User activity', ['posts' => $posts, 'comments' => $comments]);
}
/**

View file

@ -58,7 +58,7 @@ class OpenWebAuthToken
* @param int $uid The user ID.
* @param string $token
*
* @return string|boolean The meta enry or false if not found.
* @return string|boolean The meta entry or false if not found.
* @throws \Exception
*/
public static function getMeta(string $type, int $uid, string $token)

View file

@ -41,7 +41,7 @@ use Friendica\Util\Proxy;
use Friendica\Util\Strings;
/**
* Class to handle photo dabatase table
* Class to handle photo database table
*/
class Photo
{
@ -101,7 +101,7 @@ class Photo
* Get photos for user id
*
* @param integer $uid User id
* @param string $resourceid Rescource ID of the photo
* @param string $resourceid Resource ID of the photo
* @param array $conditions Array of fields for conditions
* @param array $params Array of several parameters
*
@ -122,7 +122,7 @@ class Photo
* Get a photo for user id
*
* @param integer $uid User id
* @param string $resourceid Rescource ID of the photo
* @param string $resourceid Resource ID of the photo
* @param integer $scale Scale of the photo. Defaults to 0
* @param array $conditions Array of fields for conditions
* @param array $params Array of several parameters
@ -148,7 +148,7 @@ class Photo
* on success, "no sign" image info, if user has no permission,
* false if photo does not exists
*
* @param string $resourceid Rescource ID of the photo
* @param string $resourceid Resource ID of the photo
* @param integer $scale Scale of the photo. Defaults to 0
* @param integer $visitor_uid UID of the visitor
*
@ -416,7 +416,7 @@ class Photo
* @param string $allow_cid Permissions, allowed contacts. optional, default = ""
* @param string $allow_gid Permissions, allowed groups. optional, default = ""
* @param string $deny_cid Permissions, denied contacts.optional, default = ""
* @param string $deny_gid Permissions, denied greoup.optional, default = ""
* @param string $deny_gid Permissions, denied group.optional, default = ""
* @param string $desc Photo caption. optional, default = ""
*
* @return boolean True on success
@ -536,7 +536,7 @@ class Photo
* @param Image $image Image to update. Optional, default null.
* @param array $old_fields Array with the old field values that are about to be replaced (true = update on duplicate)
*
* @return boolean Was the update successfull?
* @return boolean Was the update successful?
*
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
* @see \Friendica\Database\DBA::update
@ -881,14 +881,14 @@ class Photo
* Then set the permissions to public.
*/
self::setPermissionForRessource($image_rid, $uid, $str_contact_allow, $str_group_allow, $str_contact_deny, $str_group_deny);
self::setPermissionForResource($image_rid, $uid, $str_contact_allow, $str_group_allow, $str_contact_deny, $str_group_deny);
}
return true;
}
/**
* Add permissions to photo ressource
* Add permissions to photo resource
* @todo mix with previous photo permissions
*
* @param string $image_rid
@ -899,7 +899,7 @@ class Photo
* @param string $str_group_deny
* @return void
*/
public static function setPermissionForRessource(string $image_rid, int $uid, string $str_contact_allow, string $str_group_allow, string $str_contact_deny, string $str_group_deny)
public static function setPermissionForResource(string $image_rid, int $uid, string $str_contact_allow, string $str_group_allow, string $str_contact_deny, string $str_group_deny)
{
$fields = ['allow_cid' => $str_contact_allow, 'allow_gid' => $str_group_allow,
'deny_cid' => $str_contact_deny, 'deny_gid' => $str_group_deny,

View file

@ -58,7 +58,7 @@ class Link
* @param int $uriId
* @param string $url
* @param string $size
* @return string Found link URL + id on success, $url on failture
* @return string Found link URL + id on success, $url on failure
*/
public static function getByLink(int $uriId, string $url, string $size = ''): string
{

View file

@ -455,7 +455,7 @@ class Media
}
/**
* Tests for path patterns that are usef for picture links in Friendica
* Tests for path patterns that are used for picture links in Friendica
*
* @param string $page Link to the image page
* @param string $preview Preview picture
@ -467,7 +467,7 @@ class Media
}
/**
* Tests for path patterns that are usef for picture links in Friendica
* Tests for path patterns that are used for picture links in Friendica
*
* @param string $page Link to the image page
* @param string $preview Preview picture

View file

@ -529,7 +529,7 @@ class User
// Addons can create users, and since this 'catch' branch should only
// execute if getAuthenticationInfo can't find an existing user, that's
// exactly what will happen here. Creating a numeric username would create
// abiguity with user IDs, possibly opening up an attack vector.
// ambiguity with user IDs, possibly opening up an attack vector.
// So let's be very careful about that.
if (empty($username) || is_numeric($username)) {
throw $e;
@ -684,7 +684,7 @@ class User
if ($user['last-activity'] != $current_day) {
User::update(['last-activity' => $current_day], $uid);
// Set the last actitivy for all identities of the user
// Set the last activity for all identities of the user
DBA::update('user', ['last-activity' => $current_day], ['parent-uid' => $uid, 'account_removed' => false]);
}
}
@ -816,14 +816,14 @@ class User
* Empties the password reset token field just in case.
*
* @param int $uid
* @param string $pasword_hashed
* @param string $password_hashed
* @return bool
* @throws Exception
*/
private static function updatePasswordHashed(int $uid, string $pasword_hashed): bool
private static function updatePasswordHashed(int $uid, string $password_hashed): bool
{
$fields = [
'password' => $pasword_hashed,
'password' => $password_hashed,
'pwdreset' => null,
'pwdreset_time' => null,
'legacy_password' => false
@ -851,7 +851,7 @@ class User
* Checks if a nickname is in the list of the forbidden nicknames
*
* Check if a nickname is forbidden from registration on the node by the
* admin. Forbidden nicknames (e.g. role namess) can be configured in the
* admin. Forbidden nicknames (e.g. role names) can be configured in the
* admin panel.
*
* @param string $nickname The nickname that should be checked
@ -1232,7 +1232,7 @@ class User
$resource_id = Photo::newResource();
// Not using Photo::PROFILE_PHOTOS here, so that it is discovered as translateble string
// Not using Photo::PROFILE_PHOTOS here, so that it is discovered as translatable string
$profile_album = DI::l10n()->t('Profile Photos');
$r = Photo::store($image, $uid, 0, $resource_id, $filename, $profile_album, 4);
@ -1377,7 +1377,7 @@ class User
* permanently against re-registration, as the person was not yet
* allowed to have friends on this system
*
* @return bool True, if the deny was successfull
* @return bool True, if the deny was successful
* @throws Exception
*/
public static function deny(string $hash): bool
@ -1792,7 +1792,7 @@ class User
*
* @param int $start Start count (Default is 0)
* @param int $count Count of the items per page (Default is @see Pager::ITEMS_PER_PAGE)
* @param string $type The type of users, which should get (all, bocked, removed)
* @param string $type The type of users, which should get (all, blocked, removed)
* @param string $order Order of the user list (Default is 'contact.name')
* @param bool $descending Order direction (Default is ascending)
* @return array|bool The list of the users

View file

@ -391,7 +391,7 @@ class Federation extends BaseAdmin
//
// clean up version numbers
//
// some platforms do not provide version information, add a unkown there
// some platforms do not provide version information, add a unknown there
// to the version string for the displayed list.
foreach ($versionCounts as $key => $value) {
if ($versionCounts[$key]['version'] == '') {

View file

@ -110,7 +110,7 @@ class Storage extends BaseAdmin
foreach ($storageConfig->getOptions() as $option => $info) {
$type = $info[0];
// Backward compatibilty with yesno field description
// Backward compatibility with yesno field description
if ($type == 'yesno') {
$type = 'checkbox';
// Remove translated labels Yes No from field info

View file

@ -70,7 +70,7 @@ class Update extends BaseApi
throw new HTTPException\BadRequestException('no albumname specified');
}
// check if photo is existing in databasei
// check if photo is existing in database
if (!Photo::exists(['resource-id' => $photo_id, 'uid' => $uid, 'album' => $album])) {
throw new HTTPException\BadRequestException('photo not available');
}

View file

@ -51,12 +51,12 @@ class Relationships extends BaseApi
$request['id'] = [$request['id']];
}
$relationsships = [];
$relationships = [];
foreach ($request['id'] as $id) {
$relationsships[] = DI::mstdnRelationship()->createFromContactId($id, $uid);
$relationships[] = DI::mstdnRelationship()->createFromContactId($id, $uid);
}
System::jsonExit($relationsships);
System::jsonExit($relationships);
}
}

View file

@ -181,7 +181,7 @@ class Statuses extends BaseApi
'sensitive' => false, // Mark status and attached media as sensitive?
'spoiler_text' => '', // Text to be shown as a warning or subject before the actual content. Statuses are generally collapsed behind this field.
'visibility' => '', // Visibility of the posted status. One of: "public", "unlisted", "private" or "direct".
'scheduled_at' => '', // ISO 8601 Datetime at which to schedule a status. Providing this paramter will cause ScheduledStatus to be returned instead of Status. Must be at least 5 minutes in the future.
'scheduled_at' => '', // ISO 8601 Datetime at which to schedule a status. Providing this parameter will cause ScheduledStatus to be returned instead of Status. Must be at least 5 minutes in the future.
'language' => '', // ISO 639 language code for this status.
'friendica' => [], // Friendica extensions to the standard Mastodon API spec
], $request);
@ -266,15 +266,14 @@ class Statuses extends BaseApi
}
if ($request['in_reply_to_id']) {
$parent = Post::selectFirst(['uri', 'private'], ['uri-id' => $request['in_reply_to_id'], 'uid' => [0, $uid]]);
$parent = Post::selectFirst(['uri'], ['uri-id' => $request['in_reply_to_id'], 'uid' => [0, $uid]]);
if (empty($parent)) {
throw new HTTPException\NotFoundException('Item with URI ID ' . $request['in_reply_to_id'] . ' not found for user ' . $uid . '.');
}
$item['thr-parent'] = $parent['uri'];
$item['gravity'] = Item::GRAVITY_COMMENT;
$item['object-type'] = Activity\ObjectType::COMMENT;
if (in_array($parent['private'], [Item::UNLISTED, Item::PUBLIC]) && ($item['private'] == Item::PRIVATE)) {
throw new HTTPException\NotImplementedException('Private replies for public posts are not implemented.');
}
} else {
self::checkThrottleLimit();
@ -392,9 +391,8 @@ class Statuses extends BaseApi
continue;
}
Photo::setPermissionForRessource($media[0]['resource-id'], $item['uid'], $item['allow_cid'], $item['allow_gid'], $item['deny_cid'], $item['deny_gid']);
Photo::setPermissionForResource($media[0]['resource-id'], $item['uid'], $item['allow_cid'], $item['allow_gid'], $item['deny_cid'], $item['deny_gid']);
$ressources[] = $media[0]['resource-id'];
$phototypes = Images::supportedTypes();
$ext = $phototypes[$media[0]['type']];

View file

@ -153,11 +153,10 @@ class Update extends BaseApi
continue;
}
Photo::setPermissionForRessource($media[0]['resource-id'], $uid, $item['allow_cid'], $item['allow_gid'], $item['deny_cid'], $item['deny_gid']);
Photo::setPermissionForResource($media[0]['resource-id'], $uid, $item['allow_cid'], $item['allow_gid'], $item['deny_cid'], $item['deny_gid']);
$ressources[] = $media[0]['resource-id'];
$phototypes = Images::supportedTypes();
$ext = $phototypes[$media[0]['type']];
$phototypes = Images::supportedTypes();
$ext = $phototypes[$media[0]['type']];
$attachment = [
'type' => Post\Media::IMAGE,

View file

@ -49,7 +49,7 @@ class Attach extends BaseModule
throw new \Friendica\Network\HTTPException\NotFoundException(DI::l10n()->t('Item was not found.'));
}
// Now we'll fetch the item, if we have enough permisson
// Now we'll fetch the item, if we have enough permission
$item = MAttach::getByIdWithPermission($item_id);
if ($item === false) {
throw new \Friendica\Network\HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));

View file

@ -158,7 +158,7 @@ abstract class BaseNotifications extends BaseModule
/**
* List of pages for the Notifications TabBar
*
* @return array with with notifications TabBar data
* @return array with notifications TabBar data
* @throws Exception
*/
private function getTabs()

View file

@ -171,7 +171,7 @@ class Redir extends \Friendica\BaseModule
// On a local instance we have to check if the local user has already authenticated
// with the local contact. Otherwise, the local user would ask the local contact
// for authentification everytime he/she is visiting a profile page of the local
// for authentication everytime he/she is visiting a profile page of the local
// contact.
if (($host == $remotehost) && ($this->session->getRemoteContactID($this->session->get('visitor_visiting')) == $this->session->get('visitor_id'))) {
// Remote user is already authenticated.

View file

@ -302,7 +302,7 @@ class Community extends BaseModule
}
/**
* Database query for the comunity page
* Database query for the community page
*
* @param $min_id
* @param $max_id

View file

@ -120,7 +120,7 @@ class Network extends BaseModule
$content = '';
if (self::$forumContactId) {
// If self::$forumContactId belongs to a communitity forum or a privat goup,.add a mention to the status editor
// If self::$forumContactId belongs to a community forum or a private group, add a mention to the status editor
$condition = ["`id` = ? AND `contact-type` = ?", self::$forumContactId, Contact::TYPE_COMMUNITY];
$contact = DBA::selectFirst('contact', ['addr'], $condition);
if (!empty($contact['addr'])) {

View file

@ -120,7 +120,7 @@ class Delegation extends BaseModule
$identities = User::identities(DI::userSession()->getSubManagedUserId() ?: DI::userSession()->getLocalUserId());
//getting additinal information for each identity
//getting additional information for each identity
foreach ($identities as $key => $identity) {
$identities[$key]['thumb'] = User::getAvatarUrl($identity, Proxy::SIZE_THUMB);

View file

@ -101,7 +101,7 @@ class Receive extends BaseModule
}
if ($importer['account-type'] == User::ACCOUNT_TYPE_COMMUNITY) {
// Communities aren't working with the Diaspora protoccol
// Communities aren't working with the Diaspora protocol
// We throw an "accepted" here, so that the sender doesn't repeat the delivery
throw new HTTPException\AcceptedException();
}

View file

@ -61,7 +61,7 @@ class PageNotFound extends BaseModule
* Otherwise we are going to emit a 404 not found.
*/
$queryString = $this->server['QUERY_STRING'];
// Stupid browser tried to pre-fetch our Javascript img template. Don't log the event or return anything - just quietly exit.
// Stupid browser tried to pre-fetch our JavaScript img template. Don't log the event or return anything - just quietly exit.
if (!empty($queryString) && preg_match('/{[0-9]}/', $queryString) !== 0) {
System::exit();
}

View file

@ -38,7 +38,7 @@ use Psr\Log\LoggerInterface;
/**
* Asynchronous attachment upload module
*
* Only used as the target action of the AjaxUpload Javascript library
* Only used as the target action of the AjaxUpload JavaScript library
*/
class Upload extends \Friendica\BaseModule
{

View file

@ -40,7 +40,7 @@ use Psr\Log\LoggerInterface;
/**
* Asynchronous photo upload module
*
* Only used as the target action of the AjaxUpload Javascript library
* Only used as the target action of the AjaxUpload JavaScript library
*/
class Upload extends \Friendica\BaseModule
{

View file

@ -80,12 +80,12 @@ class Owa extends BaseModule
$ret['success'] = true;
$token = Strings::getRandomHex(32);
// Store the generated token in the databe.
// Store the generated token in the database.
OpenWebAuthToken::create('owt', 0, $token, $contact['addr']);
$result = '';
// Encrypt the token with the public contacts publik key.
// Encrypt the token with the public contacts public key.
// Only the specific public contact will be able to encrypt it.
// At a later time, we will compare weather the token we're getting
// is really the same token we have stored in the database.

View file

@ -79,7 +79,7 @@ class PermissionTooltip extends \Friendica\BaseModule
throw new HttpException\NotFoundException(DI::l10n()->t('Model not found'));
}
// Kept for backwards compatiblity
// Kept for backwards compatibility
Hook::callAll('lockview_content', $model);
if ($type == 'item') {

View file

@ -118,10 +118,10 @@ EOT;
</object>
EOT;
$tagger_link = '[url=' . $contact['url'] . ']' . $contact['name'] . '[/url]';
$aauthor_link = '[url=' . $item['author-link'] . ']' . $item['author-name'] . '[/url]';
$post_link = '[url=' . $item['plink'] . ']' . ($item['resource-id'] ? $this->t('photo') : $this->t('post')) . '[/url]';
$term_link = '#[url=' . $tagid . ']' . $term . '[/url]';
$tagger_link = '[url=' . $contact['url'] . ']' . $contact['name'] . '[/url]';
$author_link = '[url=' . $item['author-link'] . ']' . $item['author-name'] . '[/url]';
$post_link = '[url=' . $item['plink'] . ']' . ($item['resource-id'] ? $this->t('photo') : $this->t('post')) . '[/url]';
$term_link = '#[url=' . $tagid . ']' . $term . '[/url]';
$post = [
'guid' => System::createUUID(),
@ -138,7 +138,7 @@ EOT;
'author-name' => $contact['name'],
'author-link' => $contact['url'],
'author-avatar' => $contact['thumb'],
'body' => $this->t('%1$s tagged %2$s\'s %3$s with %4$s', $tagger_link, $aauthor_link, $post_link, $term_link),
'body' => $this->t('%1$s tagged %2$s\'s %3$s with %4$s', $tagger_link, $author_link, $post_link, $term_link),
'verb' => Activity::TAG,
'target-type' => $targettype,
'target' => $target,

View file

@ -254,7 +254,7 @@ class Profile extends BaseProfile
);
}
//show subcribed forum if it is enabled in the usersettings
//show subscribed forum if it is enabled in the usersettings
if (Feature::isEnabled($profile['uid'], 'forumlist_profile')) {
$custom_fields += self::buildField(
'forumlist',

View file

@ -31,7 +31,7 @@ class RobotsTxt extends BaseModule
{
protected function rawContent(array $request = [])
{
$allDisalloweds = [
$allDisallowed = [
'/settings/',
'/admin/',
'/message/',
@ -42,7 +42,7 @@ class RobotsTxt extends BaseModule
header('Content-Type: text/plain');
echo 'User-agent: *' . PHP_EOL;
foreach ($allDisalloweds as $disallowed) {
foreach ($allDisallowed as $disallowed) {
echo 'Disallow: ' . $disallowed . PHP_EOL;
}
System::exit();

View file

@ -106,7 +106,7 @@ class Index extends BaseSearch
$search = '#' . trim(rawurldecode($_GET['tag']));
}
// contruct a wrapper for the search header
// construct a wrapper for the search header
$o = Renderer::replaceMacros(Renderer::getMarkupTemplate('content_wrapper.tpl'), [
'name' => 'search-header',
'$title' => DI::l10n()->t('Search'),

View file

@ -60,7 +60,7 @@ class Trust extends BaseModule
/** @var TwoFactor\Repository\TrustedBrowser */
protected $trustedBrowserRepository;
public function __construct(App $app, Authentication $auth, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, IHandleUserSessions $session, Cookie $cookie, TwoFactor\Factory\TrustedBrowser $trustedBrowserFactory, TwoFactor\Repository\TrustedBrowser $trustedBrowserRepositoy, Response $response, array $server, array $parameters = [])
public function __construct(App $app, Authentication $auth, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, IHandleUserSessions $session, Cookie $cookie, TwoFactor\Factory\TrustedBrowser $trustedBrowserFactory, TwoFactor\Repository\TrustedBrowser $trustedBrowserRepository, Response $response, array $server, array $parameters = [])
{
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
@ -69,7 +69,7 @@ class Trust extends BaseModule
$this->session = $session;
$this->cookie = $cookie;
$this->trustedBrowserFactory = $trustedBrowserFactory;
$this->trustedBrowserRepository = $trustedBrowserRepositoy;
$this->trustedBrowserRepository = $trustedBrowserRepository;
}
protected function post(array $request = [])

View file

@ -181,7 +181,7 @@ class Crop extends BaseSettings
$havescale = $havescale || $photo['scale'] == 5;
}
// set an already uloaded photo as profile photo
// set an already uploaded photo as profile photo
// if photo is in 'Profile Photos', change it in db
if ($photos[0]['photo-type'] == Photo::USER_AVATAR && $havescale) {
Photo::update(['profile' => false], ['uid' => DI::userSession()->getLocalUserId()]);

View file

@ -28,7 +28,7 @@ use Friendica\Model\Search;
use Friendica\Protocol\Relay;
/**
* Node subscription preferences for social realy systems
* Node subscription preferences for social relay systems
* @see https://git.feneas.org/jaywink/social-relay/blob/master/docs/relays.md
*/
class XSocialRelay extends BaseModule

View file

@ -363,7 +363,7 @@ class FormattedNotify extends BaseFactory
{
$item['seen'] = !($item['unseen'] > 0);
// For feed items we use the user's contact, since the avatar is mostly self choosen.
// For feed items we use the user's contact, since the avatar is mostly self chosen.
if (!empty($item['network']) && $item['network'] == Protocol::FEED) {
$item['author-avatar'] = $item['contact-avatar'];
}

View file

@ -100,11 +100,11 @@ class Introduction extends BaseFactory
try {
$stmtNotifications = $this->dba->p(
"SELECT `intro`.`id` AS `intro_id`, `intro`.*, `contact`.*,
`sugggest-contact`.`name` AS `fname`, `sugggest-contact`.`url` AS `furl`, `sugggest-contact`.`addr` AS `faddr`,
`sugggest-contact`.`photo` AS `fphoto`, `sugggest-contact`.`request` AS `frequest`
`suggest-contact`.`name` AS `fname`, `suggest-contact`.`url` AS `furl`, `suggest-contact`.`addr` AS `faddr`,
`suggest-contact`.`photo` AS `fphoto`, `suggest-contact`.`request` AS `frequest`
FROM `intro`
LEFT JOIN `contact` ON `contact`.`id` = `intro`.`contact-id`
LEFT JOIN `contact` AS `sugggest-contact` ON `intro`.`suggest-cid` = `sugggest-contact`.`id`
LEFT JOIN `contact` AS `suggest-contact` ON `intro`.`suggest-cid` = `suggest-contact`.`id`
WHERE `intro`.`uid` = ? $sql_extra
LIMIT ?, ?",
$this->session->getLocalUserId(),

View file

@ -53,7 +53,7 @@ class FormattedNavNotification extends BaseEntity
*/
public function __construct(string $contact_name, string $contact_url, string $contact_photo, string $timestamp, string $plaintext, string $html, string $href, bool $seen)
{
// Properties differ from constructor because this structure is used in the "nav-update" Javascript event listener
// Properties differ from constructor because this structure is used in the "nav-update" JavaScript event listener
$this->contact = [
'name' => $contact_name,
'url' => $contact_url,

View file

@ -60,7 +60,7 @@ class HttpClient extends BaseFactory
/**
* Creates a IHTTPClient for communications with HTTP endpoints
*
* @param HandlerStack|null $handlerStack (optional) A handler replacement (just usefull at test environments)
* @param HandlerStack|null $handlerStack (optional) A handler replacement (just useful at test environments)
*
* @return ICanSendHttpRequests
*/

View file

@ -216,7 +216,7 @@ class CurlResult implements ICanHandleHttpResponses
$parts = [];
}
/// @todo Checking the corresponding RFC which parts of a redirect can be ommitted.
/// @todo Checking the corresponding RFC which parts of a redirect can be omitted.
$components = ['scheme', 'host', 'path', 'query', 'fragment'];
foreach ($components as $component) {
if (empty($redirect_parts[$component]) && !empty($parts[$component])) {

View file

@ -23,7 +23,7 @@ namespace Friendica\Network\HTTPException;
use Friendica\Network\HTTPException;
class LenghtRequiredException extends HTTPException
class LengthRequiredException extends HTTPException
{
protected $code = 411;
protected $httpdesc = 'Length Required';

View file

@ -63,7 +63,7 @@ class Probe
private static $baseurl;
/**
* @var boolean Whether a timeout has occured
* @var boolean Whether a timeout has occurred
*/
private static $isTimeout;
@ -769,7 +769,7 @@ class Probe
if (empty($result['network']) && empty($ap_profile['network']) || ($network == Protocol::FEED)) {
$result = self::feed($uri);
} else {
// We overwrite the detected nick with our try if the previois routines hadn't detected it.
// We overwrite the detected nick with our try if the previous routines hadn't detected it.
// Additionally, it is overwritten when the nickname doesn't make sense (contains spaces).
if ((empty($result['nick']) || (strstr($result['nick'], ' '))) && ($nick != '')) {
$result['nick'] = $nick;
@ -1623,7 +1623,7 @@ class Probe
if (!empty($feed_data['header']['author-about'])) {
$data['about'] = $feed_data['header']['author-about'];
}
// OStatus has serious issues when the the url doesn't fit (ssl vs. non ssl)
// OStatus has serious issues when the url doesn't fit (ssl vs. non ssl)
// So we take the value that we just fetched, although the other one worked as well
if (!empty($feed_data['header']['author-link'])) {
$data['url'] = $feed_data['header']['author-link'];
@ -2280,7 +2280,7 @@ class Probe
]
];
} catch (Exception $e) {
// Default values for non existing targets
// Default values for nonexistent targets
$data = [
'name' => $url, 'nick' => $url, 'url' => $url, 'network' => Protocol::PHANTOM,
'photo' => DI::baseUrl() . Contact::DEFAULT_AVATAR_PHOTO

View file

@ -47,14 +47,18 @@ class FriendicaExtension extends BaseDataTransferObject
/** @var FriendicaDeliveryData|null */
protected $delivery_data;
/** @var int */
protected $dislikes_count;
/** @var bool */
protected $disliked = false;
/**
* @var FriendicaVisibility|null
*/
protected $visibility;
/**
* Creates a FriendicaExtension object
*
@ -64,6 +68,7 @@ class FriendicaExtension extends BaseDataTransferObject
* @param string|null $edited_at
* @param string|null $received_at
* @param int $dislikes_count
* @param bool $disliked
* @param FriendicaDeliveryData|null $delivery_data
* @param FriendicaVisibility|null $visibility
*/
@ -73,6 +78,7 @@ class FriendicaExtension extends BaseDataTransferObject
?string $commented_at,
?string $received_at,
int $dislikes_count,
bool $disliked,
?FriendicaDeliveryData $delivery_data,
?FriendicaVisibility $visibility
) {
@ -82,6 +88,7 @@ class FriendicaExtension extends BaseDataTransferObject
$this->received_at = $received_at ? DateTimeFormat::utc($received_at, DateTimeFormat::JSON) : null;
$this->delivery_data = $delivery_data;
$this->dislikes_count = $dislikes_count;
$this->disliked = $disliked;
$this->visibility = $visibility;
}

View file

@ -600,7 +600,7 @@ class Image
do {
$this->image->cropImage($w, $h, $x, $y);
/*
* We need to remove the canva,
* We need to remove the canvas,
* or the image is not resized to the crop:
* http://php.net/manual/en/imagick.cropimage.php#97232
*/

View file

@ -192,7 +192,7 @@ class ProfileField extends BaseRepository
}
/**
* Delets a whole collection of ProfileFields
* Deletes a whole collection of ProfileFields
*
* @param Collection\ProfileFields $profileFields
*

View file

@ -208,7 +208,7 @@ class Delivery
}
/**
* mark or unmark the given receivers for archival upon succoess
* mark or unmark the given receivers for archival upon success
*
* @param array $receivers
* @param boolean $success

View file

@ -946,7 +946,7 @@ class Processor
return true;
}
if (in_array($activity['completion-mode'] ?? Receiver::COMPLETION_NONE, [Receiver::COMPLETION_MANUAL, Receiver::COMPLETION_ANNOUCE])) {
if (in_array($activity['completion-mode'] ?? Receiver::COMPLETION_NONE, [Receiver::COMPLETION_MANUAL, Receiver::COMPLETION_ANNOUNCE])) {
// Manual completions and completions caused by reshares are allowed without any further checks.
Logger::debug('Message is in completion mode - accepted', ['mode' => $activity['completion-mode'], 'uri-id' => $item['uri-id'], 'guid' => $item['guid'], 'url' => $item['uri']]);
return true;

View file

@ -252,7 +252,7 @@ class Queue
{
$entries = DBA::select('inbox-entry', ['id', 'type', 'object-type', 'object-id', 'in-reply-to-id'], ["`trust` AND `wid` IS NULL"], ['order' => ['id' => true]]);
while ($entry = DBA::fetch($entries)) {
// Don't process entries of items that are answer to non existing posts
// Don't process entries of items that are answer to nonexistent posts
if (!empty($entry['in-reply-to-id']) && !Post::exists(['uri' => $entry['in-reply-to-id']])) {
continue;
}

View file

@ -74,11 +74,11 @@ class Receiver
const TARGET_ANSWER = 6;
const TARGET_GLOBAL = 7;
const COMPLETION_NONE = 0;
const COMPLETION_ANNOUCE = 1;
const COMPLETION_RELAY = 2;
const COMPLETION_MANUAL = 3;
const COMPLETION_AUTO = 4;
const COMPLETION_NONE = 0;
const COMPLETION_ANNOUNCE = 1;
const COMPLETION_RELAY = 2;
const COMPLETION_MANUAL = 3;
const COMPLETION_AUTO = 4;
/**
* Checks incoming message from the inbox
@ -248,7 +248,7 @@ class Receiver
* Fetches the object type for a given object id
*
* @param array $activity
* @param string $object_id Object ID of the the provided object
* @param string $object_id Object ID of the provided object
* @param integer $uid User ID
*
* @return string with object type or NULL
@ -643,7 +643,7 @@ class Receiver
}
}
$decouple = DI::config()->get('system', 'decoupled_receiver') && !in_array($completion, [self::COMPLETION_MANUAL, self::COMPLETION_ANNOUCE]);
$decouple = DI::config()->get('system', 'decoupled_receiver') && !in_array($completion, [self::COMPLETION_MANUAL, self::COMPLETION_ANNOUNCE]);
if ($decouple && ($trust_source || DI::config()->get('debug', 'ap_inbox_store_untrusted'))) {
$object_data = Queue::add($object_data, $type, $uid, $http_signer, $push, $trust_source);
@ -731,7 +731,7 @@ class Receiver
case 'as:Announce':
if (in_array($object_data['object_type'], self::CONTENT_TYPES)) {
if (!Item::searchByLink($object_data['object_id'], $uid)) {
if (ActivityPub\Processor::fetchMissingActivity($object_data['object_id'], [], $object_data['actor'], self::COMPLETION_ANNOUCE, $uid)) {
if (ActivityPub\Processor::fetchMissingActivity($object_data['object_id'], [], $object_data['actor'], self::COMPLETION_ANNOUNCE, $uid)) {
Logger::debug('Created announced id', ['uid' => $uid, 'id' => $object_data['object_id']]);
Queue::remove($object_data);
} else {
@ -1067,7 +1067,7 @@ class Receiver
{
$reply = $receivers = $profile = [];
// When it is an answer, we inherite the receivers from the parent
// When it is an answer, we inherit the receivers from the parent
$replyto = JsonLD::fetchElement($activity, 'as:inReplyTo', '@id');
if (!empty($replyto)) {
$reply = [$replyto];
@ -1181,7 +1181,7 @@ class Receiver
self::switchContacts($receivers, $actor);
// "birdsitelive" is a service that mirrors tweets into the fediverse
// These posts can be fetched without authentification, but are not marked as public
// These posts can be fetched without authentication, but are not marked as public
// We treat them as unlisted posts to be able to handle them.
if (empty($receivers) && $fetch_unlisted && Contact::isPlatform($actor, 'birdsitelive')) {
$receivers[0] = ['uid' => 0, 'type' => self::TARGET_GLOBAL];
@ -1370,9 +1370,9 @@ class Receiver
}
/**
* Fetches the object data from external ressources if needed
* Fetches the object data from external resources if needed
*
* @param string $object_id Object ID of the the provided object
* @param string $object_id Object ID of the provided object
* @param array $object The provided object array
* @param boolean $trust_source Do we trust the provided object?
* @param integer $uid User ID for the signature that we use to fetch data

View file

@ -444,7 +444,7 @@ class Transmitter
}
/**
* Get a minimal actror array for the C2S API
* Get a minimal actor array for the C2S API
*
* @param integer $cid
* @return array
@ -1830,7 +1830,7 @@ class Transmitter
$item['body'] = $announce['comment'] . "\n" . $announce['object']['plink'];
$activity['object'] = self::createNote($item, $api_mode);
/// @todo Finally descide how to implement this in AP. This is a possible way:
/// @todo Finally decide how to implement this in AP. This is a possible way:
$activity['object']['attachment'][] = self::createNote($announce['object']);
$activity['object']['source']['content'] = $orig_body;
@ -1838,7 +1838,7 @@ class Transmitter
}
/**
* Return announce related data if the item is an annunce
* Return announce related data if the item is an announce
*
* @param array $item
* @return array Announcement array

View file

@ -608,7 +608,7 @@ class DFRN
/// @Todo
/// - Check real image type and image size
/// - Check which of these boths elements we should use
/// - Check which of these elements we should use
$attributes = [
'rel' => 'photo',
'type' => 'image/jpeg',
@ -878,7 +878,7 @@ class DFRN
XML::addElement($doc, $entry, 'dfrn:diaspora_guid', $item['guid']);
// The signed text contains the content in Markdown, the sender handle and the signatur for the content
// The signed text contains the content in Markdown, the sender handle and the signature for the content
// It is needed for relayed comments to Diaspora.
if ($item['signed_text']) {
$sign = base64_encode(json_encode(['signed_text' => $item['signed_text'],'signature' => '','signer' => '']));
@ -1585,7 +1585,7 @@ class DFRN
Logger::info('Process verb ' . $item['verb'] . ' and object-type ' . $item['object-type'] . ' for entrytype ' . $entrytype);
if (($entrytype == self::TOP_LEVEL) && !empty($importer['id'])) {
// The filling of the the "contact" variable is done for legcy reasons
// The filling of the "contact" variable is done for legacy reasons
// The functions below are partly used by ostatus.php as well - where we have this variable
$contact = Contact::selectFirst([], ['id' => $importer['id']]);
@ -1713,7 +1713,7 @@ class DFRN
* Checks if an incoming message is wanted
*
* @param array $item
* @param array $imporer
* @param array $importer
* @return boolean Is the message wanted?
*/
private static function isSolicitedMessage(array $item, array $importer): bool

View file

@ -2068,7 +2068,7 @@ class Diaspora
}
/**
* Processes poll participations - unssupported
* Processes poll participations - unsupported
*
* @param array $importer Array of the importer user
* @param object $data The message object
@ -2204,7 +2204,7 @@ class Diaspora
$author = WebFingerUri::fromString($author_handle);
// the current protocol version doesn't know these fields
// That means that we will assume their existance
// That means that we will assume their existence
if (isset($data->following)) {
$following = (XML::unescape($data->following) == 'true');
} else {
@ -2255,7 +2255,7 @@ class Diaspora
} elseif (!$following && $sharing) {
Logger::info("Author " . $author . " wants to share with us.");
} elseif ($following && $sharing) {
Logger::info("Author " . $author . " wants to have a bidirectional conection.");
Logger::info("Author " . $author . " wants to have a bidirectional connection.");
} elseif ($following && !$sharing) {
Logger::info("Author " . $author . " wants to listen to us.");
}
@ -2756,7 +2756,7 @@ class Diaspora
* ************************************************************************************** */
/**
* returnes the handle of a contact
* returns the handle of a contact
*
* @param array $contact contact array
*
@ -2770,7 +2770,7 @@ class Diaspora
}
// Normally we should have a filled "addr" field - but in the past this wasn't the case
// So - just in case - we build the the address here.
// So - just in case - we build the address here.
if ($contact['nickname'] != '') {
$nick = $contact['nickname'];
} else {

View file

@ -51,12 +51,12 @@ class Email
$errors = imap_errors();
if (!empty($errors)) {
Logger::notice('IMAP Errors occured', ['errors' => $errors]);
Logger::notice('IMAP Errors occurred', ['errors' => $errors]);
}
$alerts = imap_alerts();
if (!empty($alerts)) {
Logger::notice('IMAP Alerts occured: ', ['alerts' => $alerts]);
Logger::notice('IMAP Alerts occurred: ', ['alerts' => $alerts]);
}
return $mbox;
@ -322,7 +322,7 @@ class Email
}
if ($out_str && $charset) {
// define start delimimter, end delimiter and spacer
// define start delimiter, end delimiter and spacer
$end = "?=";
$start = "=?" . $charset . "?B?";
$spacer = $end . "\r\n " . $start;

View file

@ -945,7 +945,7 @@ class Feed
$previous_created = $last_update;
// Don't cache when the last item was posted less then 15 minutes ago (Cache duration)
// Don't cache when the last item was posted less than 15 minutes ago (Cache duration)
if ((time() - strtotime($owner['last-item'])) < 15 * 60) {
$result = DI::cache()->get($cachekey);
if (!$nocache && !is_null($result)) {

View file

@ -1709,7 +1709,7 @@ class OStatus
$previous_created = $last_update;
// Don't cache when the last item was posted less then 15 minutes ago (Cache duration)
// Don't cache when the last item was posted less than 15 minutes ago (Cache duration)
if ((time() - strtotime($owner['last-item'])) < 15*60) {
$result = DI::cache()->get($cachekey);
if (!$nocache && !is_null($result)) {

View file

@ -176,7 +176,7 @@ class Relay
if (in_array($gserver['network'], [Protocol::ACTIVITYPUB, Protocol::DFRN])) {
$system = APContact::getByURL($gserver['url'] . '/friendica');
if (!empty($system['sharedinbox'])) {
Logger::info('Sucessfully probed for relay contact', ['server' => $gserver['url']]);
Logger::info('Successfully probed for relay contact', ['server' => $gserver['url']]);
$id = Contact::updateFromProbeByURL($system['url']);
Logger::info('Updated relay contact', ['server' => $gserver['url'], 'id' => $id]);
return;
@ -302,7 +302,7 @@ class Relay
DBA::close($tagserver);
}
// All adresses with the given id
// All addresses with the given id
if (!empty($tagserverlist)) {
$servers = DBA::select('gserver', ['id', 'url', 'network'], ['relay-subscribe' => true, 'relay-scope' => 'tags', 'id' => $tagserverlist]);
while ($server = DBA::fetch($servers)) {

View file

@ -85,7 +85,7 @@ class Salmon
Logger::notice('Key located', ['ret' => $ret]);
if (count($ret) == 1) {
/* We only found one one key so we don't care if the hash matches.
/* We only found one key so we don't care if the hash matches.
* If it's the wrong key we'll find out soon enough because
* message verification will fail. This also covers some older
* software which don't supply a keyhash. As long as they only

View file

@ -31,7 +31,7 @@ use Friendica\Network\HTTPException\UnauthorizedException;
use Friendica\Util\DateTimeFormat;
/**
* Authentification via the basic auth method
* Authentication via the basic auth method
*/
class BasicAuth
{

View file

@ -153,11 +153,11 @@ class ExAuth
if (is_array($aCommand)) {
switch ($aCommand[0]) {
case 'isuser':
// Check the existance of a given username
// Check the existence of a given username
$this->isUser($aCommand);
break;
case 'auth':
// Check if the givven password is correct
// Check if the given password is correct
$this->auth($aCommand);
break;
case 'setpass':
@ -225,7 +225,7 @@ class ExAuth
}
/**
* Check remote user existance via HTTP(S)
* Check remote user existence via HTTP(S)
*
* @param string $host The hostname
* @param string $user Username
@ -303,10 +303,10 @@ class ExAuth
// If the hostnames doesn't match or there is some failure, we try to check remotely
if ($Error && !$this->checkCredentials($aCommand[2], $aCommand[1], $aCommand[3], true)) {
$this->writeLog(LOG_WARNING, 'authentification failed for user ' . $sUser . '@' . $aCommand[2]);
$this->writeLog(LOG_WARNING, 'authentication failed for user ' . $sUser . '@' . $aCommand[2]);
fwrite(STDOUT, pack('nn', 2, 0));
} else {
$this->writeLog(LOG_NOTICE, 'authentificated user ' . $sUser . '@' . $aCommand[2]);
$this->writeLog(LOG_NOTICE, 'authenticated user ' . $sUser . '@' . $aCommand[2]);
fwrite(STDOUT, pack('nn', 2, 1));
}
}

View file

@ -190,7 +190,7 @@ class OAuthRequest
*
* The base string defined as the method, the url
* and the parameters (normalized), each urlencoded
* and the concated with &.
* and concatenated with &.
*/
public function get_signature_base_string()
{

Some files were not shown because too many files have changed in this diff Show more