3 * @file include/network.php
6 use Friendica\Core\Addon;
7 use Friendica\Core\L10n;
8 use Friendica\Core\System;
9 use Friendica\Core\Config;
10 use Friendica\Network\Probe;
11 use Friendica\Object\Image;
12 use Friendica\Util\Network;
13 use Friendica\Util\XML;
15 function fetch_url($url, $binary = false, &$redirects = 0, $timeout = 0, $accept_content = null, $cookiejar = 0)
17 return Network::fetchURL($url, $binary, $redirects, $timeout, $accept_content, $cookiejar);
20 function z_fetch_url($url, $binary = false, &$redirects = 0, $opts = [])
22 return Network::zFetchURL($url, $binary, $redirects, $opts);
25 function post_url($url, $params, $headers = null, &$redirects = 0, $timeout = 0)
27 return Network::postURL($url, $params, $headers, $redirects, $timeout);
30 function xml_status($st, $message = '')
32 Network::xmlStatus($st, $message);
35 function http_status_exit($val, $description = [])
37 Network::httpStatusExit($val, $description);
40 function validate_url($url)
42 return Network::validateURL($url);
45 function validate_email($addr)
47 return Network::validateEmail($addr);
50 function allowed_url($url)
52 return Network::allowedURL($url);
55 function blocked_url($url)
57 return Network::blockedURL($url);
60 function allowedEmail($email)
62 return Network::allowedEmail($email);
65 function allowed_domain($domain, array $domain_list)
67 return Network::allowedDomain($domain, $domain_list);
70 function avatar_img($email)
72 return Network::avatarImg($email);
76 function parse_xml_string($s, $strict = true)
78 return Network::parseXmlString($s, $strict);
81 function scale_external_images($srctext, $include_link = true, $scale_replace = false)
83 return Network::scaleExternalImages($srctext, $include_link, $scale_replace);
86 function fix_contact_ssl_policy(&$contact, $new_policy)
88 Network::fixContactSslPolicy($contact, $new_policy);
91 function strip_tracking_query_params($url)
93 return Network::stripTrackingQueryParams($url);
96 function original_url($url, $depth = 1, $fetchbody = false)
98 return Network::originalURL($url, $depth, $fetchbody);
101 function short_link($url)
103 return Network::shortLink($url);
106 function json_return_and_die($x)
108 Network::jsonReturnAndDie($x);
111 function matching_url($url1, $url2)
113 return Network::matchingURL($url1, $url2);
116 function unParseUrl($parsed)
118 return Network::unParseURL($parsed);