mirror of
https://github.com/friendica/friendica
synced 2025-04-25 01:50:11 +00:00
Many deprecated function calls are replaced
This commit is contained in:
parent
cfad5809ff
commit
60f5fd8188
28 changed files with 61 additions and 71 deletions
|
@ -182,7 +182,7 @@ class APContact
|
|||
DI::cache()->set($cachekey, System::callstack(20), Duration::FIVE_MINUTES);
|
||||
}
|
||||
|
||||
if (Network::isLocalLink($url) && ($local_uid = User::getIdForURL($url))) {
|
||||
if (DI::baseUrl()->isLocalUrl($url) && ($local_uid = User::getIdForURL($url))) {
|
||||
try {
|
||||
$data = Transmitter::getProfile($local_uid);
|
||||
$local_owner = User::getOwnerDataById($local_uid);
|
||||
|
|
|
@ -335,7 +335,7 @@ class Attach
|
|||
{
|
||||
preg_match_all("/\[attachment\](.*?)\[\/attachment\]/ism", $post['body'], $matches, PREG_SET_ORDER);
|
||||
foreach ($matches as $attachment) {
|
||||
if (Network::isLocalLink($attachment[1]) && preg_match('|.*?/attach/(\d+)|', $attachment[1], $match)) {
|
||||
if (DI::baseUrl()->isLocalUrl($attachment[1]) && preg_match('|.*?/attach/(\d+)|', $attachment[1], $match)) {
|
||||
$fields = [
|
||||
'allow_cid' => $post['allow_cid'], 'allow_gid' => $post['allow_gid'],
|
||||
'deny_cid' => $post['deny_cid'], 'deny_gid' => $post['deny_gid']
|
||||
|
@ -349,7 +349,7 @@ class Attach
|
|||
{
|
||||
preg_match_all("/\[attachment\](.*?)\[\/attachment\]/ism", $body, $matches, PREG_SET_ORDER);
|
||||
foreach ($matches as $attachment) {
|
||||
if (Network::isLocalLink($attachment[1]) && preg_match('|.*?/attach/(\d+)|', $attachment[1], $match)) {
|
||||
if (DI::baseUrl()->isLocalUrl($attachment[1]) && preg_match('|.*?/attach/(\d+)|', $attachment[1], $match)) {
|
||||
$attach = self::getById($match[1], $uid);
|
||||
if (empty($attach)) {
|
||||
return $body;
|
||||
|
|
|
@ -1793,7 +1793,7 @@ class Contact
|
|||
return;
|
||||
}
|
||||
|
||||
if (Network::isLocalLink($contact['url'])) {
|
||||
if (DI::baseUrl()->isLocalUrl($contact['url'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1910,7 +1910,7 @@ class Contact
|
|||
return $contact;
|
||||
}
|
||||
|
||||
$local = !empty($contact['url']) && Network::isLocalLink($contact['url']);
|
||||
$local = !empty($contact['url']) && DI::baseUrl()->isLocalUrl($contact['url']);
|
||||
|
||||
if (!$local && !empty($contact['id']) && !empty($contact['avatar'])) {
|
||||
self::updateAvatar($contact['id'], $contact['avatar'], true);
|
||||
|
@ -2300,7 +2300,7 @@ class Contact
|
|||
if (($uid == 0) && !$force && empty($contact['thumb']) && empty($contact['micro']) && !$create_cache) {
|
||||
if (($contact['avatar'] != $avatar) || empty($contact['blurhash'])) {
|
||||
$update_fields = ['avatar' => $avatar];
|
||||
if (!Network::isLocalLink($avatar)) {
|
||||
if (!DI::baseUrl()->isLocalUrl($avatar)) {
|
||||
try {
|
||||
$fetchResult = HTTPSignature::fetchRaw($avatar, 0, [HttpClientOptions::ACCEPT_CONTENT => [HttpClientAccept::IMAGE]]);
|
||||
|
||||
|
@ -2348,7 +2348,7 @@ class Contact
|
|||
$cache_avatar = DI::config()->get('system', 'cache_contact_avatar');
|
||||
|
||||
// Local contact avatars don't need to be cached
|
||||
if ($cache_avatar && Network::isLocalLink($contact['url'])) {
|
||||
if ($cache_avatar && DI::baseUrl()->isLocalUrl($contact['url'])) {
|
||||
$cache_avatar = !DBA::exists('contact', ['nurl' => $contact['nurl'], 'self' => true]);
|
||||
}
|
||||
|
||||
|
|
|
@ -109,7 +109,7 @@ class Item
|
|||
'owner-id', 'owner-link', 'owner-alias', 'owner-name', 'owner-avatar', 'owner-network', 'owner-contact-type', 'owner-updated', 'owner-gsid',
|
||||
'causer-id', 'causer-link', 'causer-alias', 'causer-name', 'causer-avatar', 'causer-contact-type', 'causer-network', 'causer-gsid',
|
||||
'contact-id', 'contact-uid', 'contact-link', 'contact-name', 'contact-avatar',
|
||||
'writable', 'restrictions', 'self', 'cid', 'alias',
|
||||
'writable', 'restrictions', 'self', 'cid', 'alias', 'post-reason',
|
||||
'event-created', 'event-edited', 'event-start', 'event-finish',
|
||||
'event-summary', 'event-desc', 'event-location', 'event-type',
|
||||
'event-nofinish', 'event-ignore', 'event-id',
|
||||
|
@ -3988,7 +3988,7 @@ class Item
|
|||
{
|
||||
if (!empty($item['plink']) && Network::isValidHttpUrl($item['plink'])) {
|
||||
$plink = $item['plink'];
|
||||
} elseif (!empty($item['uri']) && Network::isValidHttpUrl($item['uri']) && !Network::isLocalLink($item['uri'])) {
|
||||
} elseif (!empty($item['uri']) && Network::isValidHttpUrl($item['uri']) && !DI::baseUrl()->isLocalUrl($item['uri'])) {
|
||||
$plink = $item['uri'];
|
||||
}
|
||||
|
||||
|
|
|
@ -182,7 +182,7 @@ class Media
|
|||
*/
|
||||
public static function fetchAdditionalData(array $media): array
|
||||
{
|
||||
if (Network::isLocalLink($media['url'])) {
|
||||
if (DI::baseUrl()->isLocalUrl($media['url'])) {
|
||||
$media = self::fetchLocalData($media);
|
||||
if (preg_match('|.*?/search\?(.+)|', $media['url'], $matches)) {
|
||||
return $media;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue