1
1
Fork 0

Review update

Rename function, move others
This commit is contained in:
Adam Magness 2018-01-27 11:13:41 -05:00
commit f04d40a37e
55 changed files with 331 additions and 326 deletions

View file

@ -734,7 +734,7 @@ function navbar_complete(App $a) {
if (! $localsearch) {
$p = (($a->pager['page'] != 1) ? '&p=' . $a->pager['page'] : '');
$x = Network::zFetchURL(get_server() . '/lsearch?f=' . $p . '&search=' . urlencode($search));
$x = Network::curl(get_server() . '/lsearch?f=' . $p . '&search=' . urlencode($search));
if ($x['success']) {
$j = json_decode($x['body'],true);
if ($j && isset($j['results'])) {

View file

@ -5074,7 +5074,7 @@ function api_get_nick($profile)
if ($StatusnetHost != $profile) {
$StatusnetUser = preg_replace("=https?://(.*)/user/(.*)=ism", "$2", $profile);
if ($StatusnetUser != $profile) {
$UserData = Network::fetchURL("http://".$StatusnetHost."/api/users/show.json?user_id=".$StatusnetUser);
$UserData = Network::fetchUrl("http://".$StatusnetHost."/api/users/show.json?user_id=".$StatusnetUser);
$user = json_decode($UserData);
if ($user) {
$nick = $user->screen_name;

View file

@ -1,11 +1,11 @@
<?php
use Friendica\Content\Text\BBCode;
use Friendica\Content\Text\Markdown;
use Friendica\Core\Addon;
use Friendica\Core\System;
use Friendica\Model\Contact;
use Friendica\Network\Probe;
use Friendica\Util\Network;
use League\HTMLToMarkdown\HtmlConverter;
require_once 'include/event.php';
@ -83,7 +83,7 @@ function diaspora2bb($s) {
$s = preg_replace('/(\[code\])+(.*?)(\[\/code\])+/ism', '[code]$2[/code]', $s);
// Don't show link to full picture (until it is fixed)
$s = Network::scaleExternalImages($s, false);
$s = BBCode::scaleExternalImages($s, false);
return $s;
}

View file

@ -689,7 +689,7 @@ function GetProfileUsername($profile, $username, $compact = false, $getnetwork =
$StatusnetUser = preg_replace("=https?://(.*)/user/(.*)=ism", "$2", $profile);
if ($StatusnetUser != $profile) {
/// @TODO Some hosts run on https, not just http and sometimes http is disabled, let's support both here
$UserData = Network::fetchURL("http://".$StatusnetHost."/api/users/show.json?user_id=".$StatusnetUser);
$UserData = Network::fetchUrl("http://".$StatusnetHost."/api/users/show.json?user_id=".$StatusnetUser);
$user = json_decode($UserData);
if ($user) {
if ($getnetwork) {
@ -748,7 +748,7 @@ function bb_RemovePictureLinks($match) {
$text = "[url=".$match[2]."]".$match[2]."[/url]";
// if its not a picture then look if its a page that contains a picture link
$body = Network::fetchURL($match[1]);
$body = Network::fetchUrl($match[1]);
$doc = new DOMDocument();
@$doc->loadHTML($body);
@ -803,7 +803,7 @@ function bb_CleanPictureLinksSub($match) {
$text = "[img]".$match[2]."[/img]";
// if its not a picture then look if its a page that contains a picture link
$body = Network::fetchURL($match[1]);
$body = Network::fetchUrl($match[1]);
$doc = new DOMDocument();
@$doc->loadHTML($body);

View file

@ -15,7 +15,7 @@ use Friendica\Model\Contact;
use Friendica\Model\Profile;
use Friendica\Object\Thread;
use Friendica\Object\Post;
use Friendica\Util\Network;
use Friendica\Util\XML;
require_once "include/bbcode.php";
require_once "include/acl_selectors.php";
@ -185,8 +185,8 @@ function localize_item(&$item) {
$xmlhead="<"."?xml version='1.0' encoding='UTF-8' ?".">";
$obj = Network::parseXmlString($xmlhead.$item['object']);
$links = Network::parseXmlString($xmlhead."<links>".unxmlify($obj->link)."</links>");
$obj = XML::parseString($xmlhead.$item['object']);
$links = XML::parseString($xmlhead."<links>".unxmlify($obj->link)."</links>");
$Bname = $obj->title;
$Blink = ""; $Bphoto = "";
@ -221,8 +221,8 @@ function localize_item(&$item) {
$xmlhead = "<" . "?xml version='1.0' encoding='UTF-8' ?" . ">";
$obj = Network::parseXmlString($xmlhead.$item['object']);
$links = Network::parseXmlString($xmlhead."<links>".unxmlify($obj->link)."</links>");
$obj = XML::parseString($xmlhead.$item['object']);
$links = XML::parseString($xmlhead."<links>".unxmlify($obj->link)."</links>");
$Bname = $obj->title;
$Blink = "";
@ -296,7 +296,7 @@ function localize_item(&$item) {
}
$plink = '[url=' . $obj['plink'] . ']' . $post_type . '[/url]';
$parsedobj = Network::parseXmlString($xmlhead.$item['object']);
$parsedobj = XML::parseString($xmlhead.$item['object']);
$tag = sprintf('#[url=%s]%s[/url]', $parsedobj->id, $parsedobj->content);
$item['body'] = L10n::t('%1$s tagged %2$s\'s %3$s with %4$s', $author, $objauthor, $plink, $tag );
@ -313,7 +313,7 @@ function localize_item(&$item) {
$xmlhead = "<" . "?xml version='1.0' encoding='UTF-8' ?" . ">";
$obj = Network::parseXmlString($xmlhead.$item['object']);
$obj = XML::parseString($xmlhead.$item['object']);
if (strlen($obj->id)) {
$r = q("SELECT * FROM `item` WHERE `uri` = '%s' AND `uid` = %d LIMIT 1",
dbesc($obj->id),

View file

@ -363,7 +363,7 @@ function addHostnameSub($matches, $basepath)
$url = $matches[1];
$parts = array_merge($base, parse_url($url));
$url2 = Network::unParseURL($parts);
$url2 = Network::unparseURL($parts);
return str_replace($url, $url2, $link);
}

View file

@ -1481,7 +1481,7 @@ function subscribe_to_hub($url, $importer, $contact, $hubmode = 'subscribe') {
dba::update('contact', ['hub-verify' => $verify_token], ['id' => $contact['id']]);
}
Network::postURL($url, $params);
Network::post($url, $params);
logger('subscribe_to_hub: returns: ' . $a->get_curl_code(), LOGGER_DEBUG);