mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-17 04:15:15 +02:00
commit
a7fd9e3223
222 changed files with 494 additions and 497 deletions
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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));
|
||||
*
|
||||
|
|
|
@ -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'])) {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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]';
|
||||
|
@ -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));
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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" />',
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
|
|
|
@ -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)) {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -214,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 = [];
|
||||
|
@ -258,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;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
/**
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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)) {
|
||||
|
@ -2437,7 +2437,7 @@ class GServer
|
|||
}
|
||||
}
|
||||
|
||||
// Disvover Mastodon servers
|
||||
// Discover Mastodon servers
|
||||
$accesstoken = DI::config()->get('system', 'instances_social_key');
|
||||
|
||||
if (!empty($accesstoken)) {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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) {
|
||||
|
@ -933,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) {
|
||||
|
@ -1499,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;
|
||||
|
@ -2501,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);
|
||||
|
@ -2615,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
|
||||
|
|
|
@ -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]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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]);
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
|
|
|
@ -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'] == '') {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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.'));
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 privat goup,.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'])) {
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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') {
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -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'),
|
||||
|
|
|
@ -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 = [])
|
||||
|
|
|
@ -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()]);
|
||||
|
|
|
@ -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'];
|
||||
}
|
||||
|
|
|
@ -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(),
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
|
|
|
@ -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])) {
|
||||
|
|
|
@ -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';
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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];
|
||||
|
@ -1372,7 +1372,7 @@ class Receiver
|
|||
/**
|
||||
* Fetches the object data from external ressources 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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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)) {
|
||||
|
|
|
@ -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)) {
|
||||
|
|
|
@ -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)) {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
@ -306,7 +306,7 @@ class ExAuth
|
|||
$this->writeLog(LOG_WARNING, 'authentification 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));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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()
|
||||
{
|
||||
|
|
|
@ -135,7 +135,7 @@ class OAuthUtil
|
|||
$value = isset($split[1]) ? OAuthUtil::urldecode_rfc3986($split[1]) : '';
|
||||
|
||||
if (isset($parsed_parameters[$parameter])) {
|
||||
// We have already recieved parameter(s) with this name, so add to the list
|
||||
// We have already received parameter(s) with this name, so add to the list
|
||||
// of parameters with this name
|
||||
|
||||
if (is_scalar($parsed_parameters[$parameter])) {
|
||||
|
|
|
@ -46,7 +46,7 @@ class TrustedBrowser extends BaseEntity
|
|||
protected $last_used;
|
||||
|
||||
/**
|
||||
* Please do not use this constructor directly, instead use one of the method of the TrustedBroser factory.
|
||||
* Please do not use this constructor directly, instead use one of the method of the TrustedBrowser factory.
|
||||
*
|
||||
* @see \Friendica\Security\TwoFactor\Factory\TrustedBrowser
|
||||
*
|
||||
|
|
|
@ -30,7 +30,7 @@ class Arrays
|
|||
* Private constructor
|
||||
*/
|
||||
private function __construct() {
|
||||
// Utitlities don't have instances
|
||||
// Utilities don't have instances
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -627,7 +627,7 @@ class HTTPSignature
|
|||
}
|
||||
|
||||
if (empty($algorithm)) {
|
||||
Logger::info('No alagorithm');
|
||||
Logger::info('No algorithm');
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -349,7 +349,7 @@ class Network
|
|||
$pair = $param . '=' . str_replace(' ', '+', $value);
|
||||
$url = str_replace($pair, '', $url);
|
||||
|
||||
// Third try: Maybey the url isn't encoded at all
|
||||
// Third try: Maybe the url isn't encoded at all
|
||||
$pair = $param . '=' . $value;
|
||||
$url = str_replace($pair, '', $url);
|
||||
|
||||
|
|
|
@ -91,7 +91,7 @@ class ParseUrl
|
|||
}
|
||||
|
||||
/**
|
||||
* Search for chached embeddable data of an url otherwise fetch it
|
||||
* Search for cached embeddable data of an url otherwise fetch it
|
||||
*
|
||||
* @param string $url The url of the page which should be scraped
|
||||
* @param bool $do_oembed The false option is used by the function fetch_oembed()
|
||||
|
@ -686,7 +686,7 @@ class ParseUrl
|
|||
{
|
||||
$urlarr = parse_url($url);
|
||||
|
||||
// If the url does allready have an scheme
|
||||
// If the url does already have an scheme
|
||||
// we can stop the process here
|
||||
if (isset($urlarr['scheme'])) {
|
||||
return $url;
|
||||
|
|
|
@ -31,7 +31,7 @@ class PidFile
|
|||
*
|
||||
* @param string $file Filename of pid file
|
||||
*
|
||||
* @return boolean|string PID or "false" if not existent
|
||||
* @return boolean|string PID or "false" if nonexistent
|
||||
*/
|
||||
private static function pidFromFile(string $file)
|
||||
{
|
||||
|
|
|
@ -75,7 +75,7 @@ class Proxy
|
|||
* This function only performs the URL replacement on http URL and if the
|
||||
* provided URL isn't local
|
||||
*
|
||||
* @param string $url The URL to proxyfy
|
||||
* @param string $url The URL to proxify
|
||||
* @param string $size One of the Proxy::SIZE_* constants
|
||||
* @return string The proxyfied URL or relative path
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
|
|
|
@ -532,7 +532,7 @@ class Strings
|
|||
}
|
||||
|
||||
/**
|
||||
* This function converts a PHP's shorhand notation string for file sizes in to an integer number of total bytes.
|
||||
* This function converts a file size string written in PHP's shorthand notation to an integer number of total bytes.
|
||||
* For example: The string for shorthand notation of '2M' (which is 2,097,152 Bytes) is converted to 2097152
|
||||
* @see https://www.php.net/manual/en/faq.using.php#faq.using.shorthandbytes
|
||||
* @param string $shorthand
|
||||
|
|
|
@ -178,7 +178,7 @@ class DbaDefinitionSqlWriter
|
|||
* Creates the SQL definition to modify a table field
|
||||
*
|
||||
* @param string $fieldName The table field name
|
||||
* @param array $parameters The paramters to modify
|
||||
* @param array $parameters The parameters to modify
|
||||
*
|
||||
* @return string The SQL definition
|
||||
*/
|
||||
|
@ -235,7 +235,7 @@ class DbaDefinitionSqlWriter
|
|||
* @param string $method The method to create the index (default is ADD)
|
||||
*
|
||||
* @return string The SQL definition
|
||||
* @throws Exception in cases the paramter contains invalid content
|
||||
* @throws Exception in cases the parameter contains invalid content
|
||||
*/
|
||||
public static function createIndex(string $indexName, array $fieldNames, string $method = 'ADD'): string
|
||||
{
|
||||
|
|
|
@ -259,7 +259,7 @@ class XML
|
|||
* @param integer $get_attributes 1 or 0. If this is 1 the function will get the attributes as well as the tag values -
|
||||
* this results in a different array structure in the return value.
|
||||
* @param string $priority Can be 'tag' or 'attribute'. This will change the way the resulting
|
||||
* array sturcture. For 'tag', the tags are given more importance.
|
||||
* array structure. For 'tag', the tags are given more importance.
|
||||
*
|
||||
* @return array The parsed XML in an array form. Use print_r() to see the resulting array structure.
|
||||
* @throws \Exception
|
||||
|
@ -397,7 +397,7 @@ class XML
|
|||
}
|
||||
$repeated_tag_index[$tag . '_' . $level]++;
|
||||
} else { // If it is not an array...
|
||||
$current[$tag] = [$current[$tag], $result]; //...Make it an array using using the existing value and the new value
|
||||
$current[$tag] = [$current[$tag], $result]; //...Make it an array using the existing value and the new value
|
||||
$repeated_tag_index[$tag . '_' . $level] = 1;
|
||||
if ($priority == 'tag' and $get_attributes) {
|
||||
if (isset($current[$tag.'_attr'])) { // The attribute of the last(0th) tag must be moved as well
|
||||
|
@ -441,7 +441,7 @@ class XML
|
|||
* Parse XML string
|
||||
*
|
||||
* @param string $s XML string to parse into object
|
||||
* @param boolean $suppress_log Whether to supressing logging
|
||||
* @param boolean $suppress_log Whether to suppressing logging
|
||||
* @return SimpleXMLElement|bool SimpleXMLElement or false on failure
|
||||
*/
|
||||
public static function parseString(string $s, bool $suppress_log = false)
|
||||
|
@ -536,7 +536,7 @@ class XML
|
|||
*
|
||||
* @param string $str
|
||||
* @return string Escaped text.
|
||||
* @todo Move this generic method to Util\Strings and also rewrite all other findingd
|
||||
* @todo Move this generic method to Util\Strings and also rewrite all other occurrences
|
||||
*/
|
||||
public static function escape(string $str): string
|
||||
{
|
||||
|
@ -548,7 +548,7 @@ class XML
|
|||
*
|
||||
* @param string $s xml escaped text
|
||||
* @return string unescaped text
|
||||
* @todo Move this generic method to Util\Strings and also rewrite all other findingd
|
||||
* @todo Move this generic method to Util\Strings and also rewrite all other occurrences
|
||||
*/
|
||||
public static function unescape(string $s): string
|
||||
{
|
||||
|
|
|
@ -48,7 +48,7 @@ use GuzzleHttp\Psr7\Uri;
|
|||
*/
|
||||
class CheckRelMeProfileLink
|
||||
{
|
||||
/* Cheks the homepage of a profile for a rel-me link back to the user profile
|
||||
/* Checks the homepage of a profile for a rel-me link back to the user profile
|
||||
*
|
||||
* @param $uid (int) the UID of the user
|
||||
*/
|
||||
|
|
|
@ -30,7 +30,7 @@ use Friendica\Network\HTTPException;
|
|||
class RevokeFollow
|
||||
{
|
||||
/**
|
||||
* Issue asynchronous follow revokation message to remote servers.
|
||||
* Issue asynchronous follow revocation message to remote servers.
|
||||
* The local relationship has already been updated, so we can't use the user-specific contact
|
||||
*
|
||||
* @param int $cid Target public contact id
|
||||
|
|
|
@ -890,7 +890,7 @@ class Notifier
|
|||
Worker::coolDown();
|
||||
}
|
||||
|
||||
// We deliver posts to relay servers slightly delayed to priorize the direct delivery
|
||||
// We deliver posts to relay servers slightly delayed to prioritize the direct delivery
|
||||
foreach ($relay_inboxes as $inbox) {
|
||||
Logger::info('Delivery to relay servers via ActivityPub', ['cmd' => $cmd, 'id' => $target_item['id'], 'inbox' => $inbox]);
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ class SpoolPost {
|
|||
|
||||
// It is not named like a spool file, so we don't care.
|
||||
if (substr($file, 0, 5) != "item-") {
|
||||
Logger::info('Spool file does does not start with "item-"', ['file' => $file]);
|
||||
Logger::info('Spool file does not start with "item-"', ['file' => $file]);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue