Merge pull request #12479 from MrPetovan/bug/deprecated

Fix several Deprecated notices
This commit is contained in:
Philipp 2022-12-19 17:13:12 +01:00 committed by GitHub
commit c9f92f41fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 14 additions and 9 deletions

View File

@ -388,10 +388,6 @@ class Site extends BaseAdmin
/* Banner */
$banner = DI::config()->get('system', 'banner');
if ($banner == false) {
$banner = '<a href="https://friendi.ca"><img id="logo-img" width="32" height="32" src="images/friendica.svg" alt="logo" /></a><span id="logo-text"><a href="https://friendi.ca">Friendica</a></span>';
}
$email_banner = DI::config()->get('system', 'email_banner');
if ($email_banner == false) {

View File

@ -59,9 +59,9 @@ class Display extends DisplayModule
$parentUriId = $item['parent-uri-id'];
if (empty($force)) {
$browserUpdate = $this->pConfig->get($profileUid, 'system', 'update_interval');
if (!empty($browserUpdate)) {
$updateDate = date(DateTimeFormat::MYSQL, time() - (intval($browserUpdate) / 500));
$browserUpdate = intval($this->pConfig->get($profileUid, 'system', 'update_interval') ?? 40000);
if ($browserUpdate >= 1000) {
$updateDate = date(DateTimeFormat::MYSQL, time() - ($browserUpdate * 2 / 1000));
if (!Post::exists([
"`parent-uri-id` = ? AND `uid` IN (?, ?) AND `received` > ?",
$parentUriId, 0,

View File

@ -114,7 +114,7 @@ class Status extends BaseDataTransferObject
$visibility = ['public', 'private', 'unlisted'];
$this->visibility = $visibility[$item['private']];
$languages = json_decode($item['language'], true);
$languages = json_decode($item['language'] ?? '', true);
if (is_array($languages)) {
reset($languages);
$this->language = key($languages);

View File

@ -140,7 +140,7 @@ class JsonLD
* @return array Compacted JSON array
* @throws Exception
*/
public static function compact($json, bool $logfailed = true)
public static function compact($json, bool $logfailed = true): array
{
jsonld_set_document_loader('Friendica\Util\JsonLD::documentLoader');
@ -203,6 +203,11 @@ class JsonLD
$json = json_decode(json_encode($compacted, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE), true);
if ($json === false) {
Logger::notice('JSON encode->decode failed', ['orig_json' => $orig_json, 'compacted' => $compacted]);
$json = [];
}
return $json;
}

View File

@ -64,6 +64,10 @@ return [
// Themes users can change to in their settings.
'allowed_themes' => 'frio,vier',
// banner (HTML string)
// HTML snippet of the top navigation banner. Not supported by frio.
'banner' => '<a href="https://friendi.ca"><img id="logo-img" width="32" height="32" src="images/friendica.svg" alt="logo" /></a><span id="logo-text"><a href="https://friendi.ca">Friendica</a></span>',
// cache_contact_avatar (Boolean)
// Cache versions of the contact avatars. Uses a lot of storage space
'cache_contact_avatar' => true,