diff --git a/include/api.php b/include/api.php index c00578cdf..4fbbc3777 100644 --- a/include/api.php +++ b/include/api.php @@ -40,6 +40,7 @@ use Friendica\Object\Image; use Friendica\Protocol\Diaspora; use Friendica\Util\DateTimeFormat; use Friendica\Util\Network; +use Friendica\Util\Proxy as ProxyUtils; use Friendica\Util\XML; require_once 'include/conversation.php'; @@ -47,7 +48,6 @@ require_once 'mod/share.php'; require_once 'mod/item.php'; require_once 'include/security.php'; require_once 'mod/wall_upload.php'; -require_once 'mod/proxy.php'; define('API_METHOD_ANY', '*'); define('API_METHOD_GET', 'GET'); @@ -2518,7 +2518,7 @@ function api_get_entitities(&$text, $bbcode) preg_match_all("/\[img](.*?)\[\/img\]/ism", $bbcode, $images); foreach ($images[1] as $image) { - $replace = proxy_url($image); + $replace = ProxyUtils::proxifyUrl($image); $text = str_replace($image, $replace, $text); } return []; @@ -2627,7 +2627,7 @@ function api_get_entitities(&$text, $bbcode) // If image cache is activated, then use the following sizes: // thumb (150), small (340), medium (600) and large (1024) if (!Config::get("system", "proxy_disabled")) { - $media_url = proxy_url($url); + $media_url = ProxyUtils::proxifyUrl($url); $sizes = []; $scale = Image::getScalingDimensions($image[0], $image[1], 150); diff --git a/include/conversation.php b/include/conversation.php index 89bc4b547..5addb610c 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -20,6 +20,7 @@ use Friendica\Model\Term; use Friendica\Object\Post; use Friendica\Object\Thread; use Friendica\Util\DateTimeFormat; +use Friendica\Util\Proxy as ProxyUtils; use Friendica\Util\Temporal; use Friendica\Util\XML; @@ -407,7 +408,6 @@ function visible_activity($item) { * */ function conversation(App $a, array $items, $mode, $update, $preview = false, $order = 'commented', $uid = 0) { - require_once 'mod/proxy.php'; $ssl_state = ((local_user()) ? true : false); @@ -418,8 +418,10 @@ function conversation(App $a, array $items, $mode, $update, $preview = false, $o if (local_user()) { $str_blocked = PConfig::get(local_user(), 'system', 'blocked'); + if ($str_blocked) { $arr_blocked = explode(',', $str_blocked); + for ($x = 0; $x < count($arr_blocked); $x ++) { $arr_blocked[$x] = trim($arr_blocked[$x]); } @@ -477,6 +479,7 @@ function conversation(App $a, array $items, $mode, $update, $preview = false, $o } } elseif ($mode === 'notes') { $profile_owner = local_user(); + if (!$update) { $live_update_div = '
' . "\r\n" . "