X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=include%2Fbbcode.php;h=20631818a2503fbe8167130edd644e1cccd6a41b;hb=28d79281a9d521591d197215aaf9a7c92ed265e1;hp=dfaed8ef78233c5df79f07301534ff246c9e1038;hpb=e7e2ea2ba3f44eb34e216280bfe68105dc9506a2;p=friendica.git
diff --git a/include/bbcode.php b/include/bbcode.php
index dfaed8ef78..20631818a2 100644
--- a/include/bbcode.php
+++ b/include/bbcode.php
@@ -13,6 +13,7 @@ use Friendica\Core\System;
use Friendica\Core\Config;
use Friendica\Model\Contact;
use Friendica\Util\Map;
+use Friendica\Util\Network;
require_once 'include/event.php';
require_once 'mod/proxy.php';
@@ -688,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 = fetch_url("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) {
@@ -747,9 +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
- require_once("include/network.php");
-
- $body = fetch_url($match[1]);
+ $body = Network::fetchUrl($match[1]);
$doc = new DOMDocument();
@$doc->loadHTML($body);
@@ -804,9 +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
- require_once("include/network.php");
-
- $body = fetch_url($match[1]);
+ $body = Network::fetchUrl($match[1]);
$doc = new DOMDocument();
@$doc->loadHTML($body);
@@ -1000,8 +997,9 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true, $simplehtml = fa
if ((!$tryoembed || $simplehtml) && !in_array($simplehtml, [3, 7])) {
$Text = preg_replace("/([#@!])\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism", '$1$3', $Text);
} elseif ($simplehtml == 3) {
+ // The ! is converted to @ since Diaspora only understands the @
$Text = preg_replace("/([@!])\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism",
- '$1$3',
+ '@$3',
$Text);
} elseif ($simplehtml == 7) {
$Text = preg_replace("/([@!])\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism",