mirror of
https://github.com/friendica/friendica
synced 2025-05-08 19:44:10 +02:00
Move z_fetch_url
move z_fetch_url method
This commit is contained in:
parent
c67452f72e
commit
2f9642392d
14 changed files with 58 additions and 60 deletions
|
@ -17,6 +17,7 @@ use Friendica\Model\Conversation;
|
|||
use Friendica\Network\Probe;
|
||||
use Friendica\Object\Image;
|
||||
use Friendica\Util\Lock;
|
||||
use Friendica\Util\Network;
|
||||
use Friendica\Util\XML;
|
||||
use dba;
|
||||
use DOMDocument;
|
||||
|
@ -725,7 +726,7 @@ class OStatus
|
|||
|
||||
self::$conv_list[$conversation] = true;
|
||||
|
||||
$conversation_data = z_fetch_url($conversation, false, $redirects, ['accept_content' => 'application/atom+xml, text/html']);
|
||||
$conversation_data = Network::zFetchURL($conversation, false, $redirects, ['accept_content' => 'application/atom+xml, text/html']);
|
||||
|
||||
if (!$conversation_data['success']) {
|
||||
return;
|
||||
|
@ -753,7 +754,7 @@ class OStatus
|
|||
}
|
||||
}
|
||||
if ($file != '') {
|
||||
$conversation_atom = z_fetch_url($attribute['href']);
|
||||
$conversation_atom = Network::zFetchURL($attribute['href']);
|
||||
|
||||
if ($conversation_atom['success']) {
|
||||
$xml = $conversation_atom['body'];
|
||||
|
@ -869,7 +870,7 @@ class OStatus
|
|||
return;
|
||||
}
|
||||
|
||||
$self_data = z_fetch_url($self);
|
||||
$self_data = Network::zFetchURL($self);
|
||||
|
||||
if (!$self_data['success']) {
|
||||
return;
|
||||
|
@ -914,7 +915,7 @@ class OStatus
|
|||
}
|
||||
|
||||
$stored = false;
|
||||
$related_data = z_fetch_url($related, false, $redirects, ['accept_content' => 'application/atom+xml, text/html']);
|
||||
$related_data = Network::zFetchURL($related, false, $redirects, ['accept_content' => 'application/atom+xml, text/html']);
|
||||
|
||||
if (!$related_data['success']) {
|
||||
return;
|
||||
|
@ -945,7 +946,7 @@ class OStatus
|
|||
}
|
||||
}
|
||||
if ($atom_file != '') {
|
||||
$related_atom = z_fetch_url($atom_file);
|
||||
$related_atom = Network::zFetchURL($atom_file);
|
||||
|
||||
if ($related_atom['success']) {
|
||||
logger('Fetched XML for URI '.$related_uri, LOGGER_DEBUG);
|
||||
|
@ -957,7 +958,7 @@ class OStatus
|
|||
|
||||
// Workaround for older GNU Social servers
|
||||
if (($xml == '') && strstr($related, '/notice/')) {
|
||||
$related_atom = z_fetch_url(str_replace('/notice/', '/api/statuses/show/', $related).'.atom');
|
||||
$related_atom = Network::zFetchURL(str_replace('/notice/', '/api/statuses/show/', $related).'.atom');
|
||||
|
||||
if ($related_atom['success']) {
|
||||
logger('GNU Social workaround to fetch XML for URI '.$related_uri, LOGGER_DEBUG);
|
||||
|
@ -968,7 +969,7 @@ class OStatus
|
|||
// Even more worse workaround for GNU Social ;-)
|
||||
if ($xml == '') {
|
||||
$related_guess = OStatus::convertHref($related_uri);
|
||||
$related_atom = z_fetch_url(str_replace('/notice/', '/api/statuses/show/', $related_guess).'.atom');
|
||||
$related_atom = Network::zFetchURL(str_replace('/notice/', '/api/statuses/show/', $related_guess).'.atom');
|
||||
|
||||
if ($related_atom['success']) {
|
||||
logger('GNU Social workaround 2 to fetch XML for URI '.$related_uri, LOGGER_DEBUG);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue