2011-08-02 01:51:01 +02:00
|
|
|
<?php
|
2016-04-27 16:31:03 +02:00
|
|
|
/**
|
|
|
|
* @file include/network.php
|
|
|
|
*/
|
2017-04-30 06:07:00 +02:00
|
|
|
use Friendica\App;
|
2018-01-17 19:42:40 +01:00
|
|
|
use Friendica\Core\Addon;
|
2018-01-21 19:33:59 +01:00
|
|
|
use Friendica\Core\L10n;
|
2017-08-26 08:04:21 +02:00
|
|
|
use Friendica\Core\System;
|
2017-04-30 06:01:26 +02:00
|
|
|
use Friendica\Core\Config;
|
2017-05-07 20:44:30 +02:00
|
|
|
use Friendica\Network\Probe;
|
2017-12-07 14:56:11 +01:00
|
|
|
use Friendica\Object\Image;
|
2018-01-27 04:51:07 +01:00
|
|
|
use Friendica\Util\Network;
|
2017-11-10 13:45:33 +01:00
|
|
|
use Friendica\Util\XML;
|
2011-08-02 01:51:01 +02:00
|
|
|
|
2017-11-10 06:00:50 +01:00
|
|
|
function parse_xml_string($s, $strict = true)
|
|
|
|
{
|
2018-01-27 04:51:07 +01:00
|
|
|
return Network::parseXmlString($s, $strict);
|
2016-04-27 16:31:03 +02:00
|
|
|
}
|
2011-08-18 13:20:30 +02:00
|
|
|
|
2017-11-10 06:00:50 +01:00
|
|
|
function scale_external_images($srctext, $include_link = true, $scale_replace = false)
|
|
|
|
{
|
2018-01-27 04:51:07 +01:00
|
|
|
return Network::scaleExternalImages($srctext, $include_link, $scale_replace);
|
2012-02-25 23:22:51 +01:00
|
|
|
}
|
2012-04-03 08:07:26 +02:00
|
|
|
|
2017-11-10 06:00:50 +01:00
|
|
|
function fix_contact_ssl_policy(&$contact, $new_policy)
|
|
|
|
{
|
2018-01-27 04:51:07 +01:00
|
|
|
Network::fixContactSslPolicy($contact, $new_policy);
|
2012-04-03 08:07:26 +02:00
|
|
|
}
|
|
|
|
|
2017-02-18 04:35:46 +01:00
|
|
|
function strip_tracking_query_params($url)
|
|
|
|
{
|
2018-01-27 04:51:07 +01:00
|
|
|
return Network::stripTrackingQueryParams($url);
|
2017-02-18 04:35:46 +01:00
|
|
|
}
|
|
|
|
|
2017-11-10 06:00:50 +01:00
|
|
|
function original_url($url, $depth = 1, $fetchbody = false)
|
|
|
|
{
|
2018-01-27 04:51:07 +01:00
|
|
|
return Network::originalURL($url, $depth, $fetchbody);
|
2014-04-04 10:55:30 +02:00
|
|
|
}
|
2014-05-03 12:07:34 +02:00
|
|
|
|
2017-11-10 06:00:50 +01:00
|
|
|
function short_link($url)
|
|
|
|
{
|
2018-01-27 04:51:07 +01:00
|
|
|
return Network::shortLink($url);
|
2016-04-27 16:31:03 +02:00
|
|
|
}
|
2016-02-01 17:43:12 +01:00
|
|
|
|
2017-11-10 06:00:50 +01:00
|
|
|
function json_return_and_die($x)
|
|
|
|
{
|
2018-01-27 04:51:07 +01:00
|
|
|
Network::jsonReturnAndDie($x);
|
2016-02-01 17:43:12 +01:00
|
|
|
}
|
2016-07-04 08:05:30 +02:00
|
|
|
|
2017-11-10 06:00:50 +01:00
|
|
|
function matching_url($url1, $url2)
|
|
|
|
{
|
2018-01-27 04:51:07 +01:00
|
|
|
return Network::matchingURL($url1, $url2);
|
2016-07-04 08:05:30 +02:00
|
|
|
}
|
2017-10-16 22:31:13 +02:00
|
|
|
|
2017-11-10 06:00:50 +01:00
|
|
|
function unParseUrl($parsed)
|
|
|
|
{
|
2018-01-27 04:51:07 +01:00
|
|
|
return Network::unParseURL($parsed);
|
2017-10-16 22:31:13 +02:00
|
|
|
}
|