use Friendica\Content\Text\HTML;
use Friendica\Core\Hook;
use Friendica\Core\L10n;
-use Friendica\Core\Logger;
use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues;
use Friendica\Core\Protocol;
use Friendica\Core\Session\Capability\IHandleUserSessions;
$only_to_group = ($tag[1] == Tag::TAG_CHARACTER[Tag::EXCLUSIVE_MENTION]);
$private_id = $contact['id'];
$group_contact = $contact;
- Logger::info('Private group or exclusive mention', ['url' => $tag[2], 'mention' => $tag[1]]);
+ DI::logger()->info('Private group or exclusive mention', ['url' => $tag[2], 'mention' => $tag[1]]);
} elseif ($item['allow_cid'] == '<' . $contact['id'] . '>') {
$private_group = false;
$only_to_group = true;
$private_id = $contact['id'];
$group_contact = $contact;
- Logger::info('Public group', ['url' => $tag[2], 'mention' => $tag[1]]);
+ DI::logger()->info('Public group', ['url' => $tag[2], 'mention' => $tag[1]]);
} else {
- Logger::info('Post with group mention will not be converted to a group post', ['url' => $tag[2], 'mention' => $tag[1]]);
+ DI::logger()->info('Post with group mention will not be converted to a group post', ['url' => $tag[2], 'mention' => $tag[1]]);
}
}
- Logger::info('Got inform', ['inform' => $item['inform']]);
+ DI::logger()->info('Got inform', ['inform' => $item['inform']]);
if (($item['gravity'] == ItemModel::GRAVITY_PARENT) && !empty($group_contact) && ($private_group || $only_to_group)) {
// we tagged a group in a top level post. Now we change the post
$fields = ['uri-id', 'uri', 'body', 'title', 'author-name', 'author-link', 'author-avatar', 'guid', 'created', 'plink', 'network', 'quote-uri-id'];
$shared_item = Post::selectFirst($fields, ['uri-id' => $item['quote-uri-id'], 'uid' => [$item['uid'], 0], 'private' => [ItemModel::PUBLIC, ItemModel::UNLISTED]]);
if (!DBA::isResult($shared_item)) {
- Logger::notice('Post does not exist.', ['uri-id' => $item['quote-uri-id'], 'uid' => $item['uid']]);
+ DI::logger()->notice('Post does not exist.', ['uri-id' => $item['quote-uri-id'], 'uid' => $item['uid']]);
return $body;
}
$shared_item = Post::selectFirst($fields, ['guid' => $guid, 'uid' => 0, 'private' => [ItemModel::PUBLIC, ItemModel::UNLISTED]]);
if (!DBA::isResult($shared_item)) {
- Logger::notice('Post does not exist.', ['guid' => $guid]);
+ DI::logger()->notice('Post does not exist.', ['guid' => $guid]);
return '';
}
$expire_date = time() - ($expire_interval * 86400);
$created_date = strtotime($created);
if ($created_date < $expire_date) {
- Logger::notice('Item created before expiration interval.', ['created' => date('c', $created_date), 'expired' => date('c', $expire_date)]);
+ DI::logger()->notice('Item created before expiration interval.', ['created' => date('c', $created_date), 'expired' => date('c', $expire_date)]);
return true;
}
}
namespace Friendica\Content;
use Friendica\Core\Hook;
-use Friendica\Core\Logger;
use Friendica\DI;
use Friendica\Network\HTTPException;
use Friendica\Util\ParseUrl;
*/
public static function searchAndAppendToBody(string $body, bool $searchNakedUrls = false, bool $no_photos = false)
{
- Logger::debug('add_page_info_to_body: fetch page info for body', ['body' => $body]);
+ DI::logger()->debug('add_page_info_to_body: fetch page info for body', ['body' => $body]);
$url = self::getRelevantUrlFromBody($body, $searchNakedUrls);
if (!$url) {
}
}
- Logger::debug('fetch page info for URL', ['url' => $url, 'data' => $data]);
+ DI::logger()->debug('fetch page info for URL', ['url' => $url, 'data' => $data]);
return $data;
}
use Friendica\Content\PageInfo;
use Friendica\Content\Smilies;
use Friendica\Core\Hook;
-use Friendica\Core\Logger;
use Friendica\Core\Protocol;
use Friendica\Core\Renderer;
use Friendica\DI;
// than the maximum, then don't waste time looking for the images
if ($maxlen && (strlen($body) > $maxlen)) {
- Logger::info('the total body length exceeds the limit', ['maxlen' => $maxlen, 'body_len' => strlen($body)]);
+ DI::logger()->info('the total body length exceeds the limit', ['maxlen' => $maxlen, 'body_len' => strlen($body)]);
$orig_body = $body;
$new_body = '';
if (($textlen + $img_start) > $maxlen) {
if ($textlen < $maxlen) {
- Logger::debug('the limit happens before an embedded image');
+ DI::logger()->debug('the limit happens before an embedded image');
$new_body = $new_body . substr($orig_body, 0, $maxlen - $textlen);
$textlen = $maxlen;
}
if (($textlen + $img_end) > $maxlen) {
if ($textlen < $maxlen) {
- Logger::debug('the limit happens before the end of a non-embedded image');
+ DI::logger()->debug('the limit happens before the end of a non-embedded image');
$new_body = $new_body . substr($orig_body, 0, $maxlen - $textlen);
$textlen = $maxlen;
}
if (($textlen + strlen($orig_body)) > $maxlen) {
if ($textlen < $maxlen) {
- Logger::debug('the limit happens after the end of the last image');
+ DI::logger()->debug('the limit happens after the end of the last image');
$new_body = $new_body . substr($orig_body, 0, $maxlen - $textlen);
}
} else {
- Logger::debug('the text size with embedded images extracted did not violate the limit');
+ DI::logger()->debug('the text size with embedded images extracted did not violate the limit');
$new_body = $new_body . $orig_body;
}
try {
return (string)Uri::fromParts($parts);
} catch (\Throwable $th) {
- Logger::notice('Exception on unparsing url', ['url' => $url, 'parts' => $parts, 'code' => $th->getCode(), 'message' => $th->getMessage()]);
+ DI::logger()->notice('Exception on unparsing url', ['url' => $url, 'parts' => $parts, 'code' => $th->getCode(), 'message' => $th->getMessage()]);
return $url;
}
}
namespace Friendica\Content\Text;
-use Friendica\Core\Logger;
use Friendica\DI;
use Friendica\Model\Contact;
{
// @TODO Temporary until we find the source of the null value to finally set the correct type-hint
if (is_null($s)) {
- Logger::warning('Received null value');
+ DI::logger()->warning('Received null value');
return '';
}
use Friendica\Content\ContactSelector;
use Friendica\Content\Text\BBCode;
-use Friendica\Core\Logger;
use Friendica\Core\Protocol;
use Friendica\Core\Renderer;
use Friendica\DI;
public static function getHTML(array $contact, bool $hide_mention = false, bool $hide_follow = false): string
{
if (!isset($contact['network']) || !isset($contact['id'])) {
- Logger::warning('Incomplete contact', ['contact' => $contact]);
+ DI::logger()->warning('Incomplete contact', ['contact' => $contact]);
}
$contact_url = Contact::getProfileLink($contact);