use Friendica\Util\DateTimeFormat;
use Friendica\Util\Network;
use Friendica\Util\ParseUrl;
-use Friendica\Util\Proxy as ProxyUtils;
+use Friendica\Util\Proxy;
use Friendica\Util\Strings;
/**
break;
case "photo":
- $ret .= '<img width="' . $oembed->width . '" src="' . ProxyUtils::proxifyUrl($oembed->url) . '">';
+ $ret .= '<img width="' . $oembed->width . '" src="' . Proxy::proxifyUrl($oembed->url) . '">';
break;
case "link":
break;
case "rich":
- $ret .= ProxyUtils::proxifyHtml($oembed->html);
+ $ret .= Proxy::proxifyHtml($oembed->html);
break;
}
use Friendica\Util\Images;
use Friendica\Util\Map;
use Friendica\Util\ParseUrl;
-use Friendica\Util\Proxy as ProxyUtils;
+use Friendica\Util\Proxy;
use Friendica\Util\Strings;
use Friendica\Util\XML;
} elseif ($uriid > 0) {
return Post\Link::getByLink($uriid, $image, $size);
} else {
- return ProxyUtils::proxifyUrl($image, $size);
+ return Proxy::proxifyUrl($image, $size);
}
}
$attributes['profile'] = ($author_contact['url'] ?? '') ?: $attributes['profile'];
if (!empty($author_contact['id'])) {
- $attributes['avatar'] = Contact::getAvatarUrlForId($author_contact['id'], ProxyUtils::SIZE_THUMB);
+ $attributes['avatar'] = Contact::getAvatarUrlForId($author_contact['id'], Proxy::SIZE_THUMB);
} elseif ($attributes['avatar']) {
- $attributes['avatar'] = self::proxyUrl($attributes['avatar'], self::INTERNAL, $uriid, ProxyUtils::SIZE_THUMB);
+ $attributes['avatar'] = self::proxyUrl($attributes['avatar'], self::INTERNAL, $uriid, Proxy::SIZE_THUMB);
}
$content = preg_replace(Strings::autoLinkRegEx(), '<a href="$1">$1</a>', $match[3]);
* Get avatar link for given contact id
*
* @param integer $cid contact id
- * @param string $size One of the ProxyUtils::SIZE_* constants
+ * @param string $size One of the Proxy::SIZE_* constants
* @param string $updated Contact update date
* @return string avatar link
*/
*
* @param string $url contact url
* @param integer $uid user id
- * @param string $size One of the ProxyUtils::SIZE_* constants
+ * @param string $size One of the Proxy::SIZE_* constants
* @return string avatar link
*/
public static function getAvatarUrlForUrl(string $url, int $uid, string $size = ''):string
* Get header link for given contact id
*
* @param integer $cid contact id
- * @param string $size One of the ProxyUtils::SIZE_* constants
+ * @param string $size One of the Proxy::SIZE_* constants
* @param string $updated Contact update date
* @return string header link
*/
* Get preview link for given media id
*
* @param integer $id media id
- * @param string $size One of the ProxyUtils::SIZE_* constants
+ * @param string $size One of the Proxy::SIZE_* constants
* @return string preview link
*/
public static function getPreviewUrlForId(int $id, string $size = ''):string
* Get media link for given media id
*
* @param integer $id media id
- * @param string $size One of the ProxyUtils::SIZE_* constants
+ * @param string $size One of the Proxy::SIZE_* constants
* @return string media link
*/
public static function getUrlForId(int $id, string $size = ''):string
use Friendica\Util\DateTimeFormat;
use Friendica\Util\HTTPSignature;
use Friendica\Util\Network;
-use Friendica\Util\Proxy as ProxyUtils;
+use Friendica\Util\Proxy;
use Friendica\Util\Strings;
class Profile
$p['address'] = BBCode::convertForUriId($profile['uri-id'] ?? 0, $p['address']);
}
- $p['photo'] = Contact::getAvatarUrlForId($cid, ProxyUtils::SIZE_SMALL);
+ $p['photo'] = Contact::getAvatarUrlForId($cid, Proxy::SIZE_SMALL);
$p['url'] = Contact::magicLinkById($cid, $profile['url']);
* Get avatar link for given user
*
* @param array $user
- * @param string $size One of the ProxyUtils::SIZE_* constants
+ * @param string $size One of the Proxy::SIZE_* constants
* @return string avatar link
* @throws Exception
*/
use Friendica\Network\Probe;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Images;
-use Friendica\Util\Proxy as ProxyUtils;
+use Friendica\Util\Proxy;
use Friendica\Util\Strings;
use Friendica\Util\XML;
}
// Is it a remote picture? Then make a smaller preview here
- $preview = Post\Link::getByLink($uriid, $preview, ProxyUtils::SIZE_SMALL);
+ $preview = Post\Link::getByLink($uriid, $preview, Proxy::SIZE_SMALL);
// Is it a local picture? Then make it smaller here
$preview = str_replace(["-0.jpg", "-0.png"], ["-2.jpg", "-2.png"], $preview);
XML::addElement($doc, $root, "id", DI::baseUrl() . "/profile/" . $owner["nick"]);
XML::addElement($doc, $root, "title", $title);
XML::addElement($doc, $root, "subtitle", sprintf("Updates from %s on %s", $owner["name"], DI::config()->get('config', 'sitename')));
- XML::addElement($doc, $root, "logo", User::getAvatarUrl($owner, ProxyUtils::SIZE_SMALL));
+ XML::addElement($doc, $root, "logo", User::getAvatarUrl($owner, Proxy::SIZE_SMALL));
XML::addElement($doc, $root, "updated", DateTimeFormat::utcNow(DateTimeFormat::ATOM));
$author = self::addAuthor($doc, $owner, true);
$attributes = [
"rel" => "avatar",
"type" => "image/jpeg", // To-Do?
- "media:width" => ProxyUtils::PIXEL_SMALL,
- "media:height" => ProxyUtils::PIXEL_SMALL,
- "href" => User::getAvatarUrl($owner, ProxyUtils::SIZE_SMALL)];
+ "media:width" => Proxy::PIXEL_SMALL,
+ "media:height" => Proxy::PIXEL_SMALL,
+ "href" => User::getAvatarUrl($owner, Proxy::SIZE_SMALL)];
XML::addElement($doc, $author, "link", "", $attributes);
if (isset($owner["thumb"])) {
$attributes = [
"rel" => "avatar",
"type" => "image/jpeg", // To-Do?
- "media:width" => ProxyUtils::PIXEL_THUMB,
- "media:height" => ProxyUtils::PIXEL_THUMB,
- "href" => User::getAvatarUrl($owner, ProxyUtils::SIZE_THUMB)];
+ "media:width" => Proxy::PIXEL_THUMB,
+ "media:height" => Proxy::PIXEL_THUMB,
+ "href" => User::getAvatarUrl($owner, Proxy::SIZE_THUMB)];
XML::addElement($doc, $author, "link", "", $attributes);
}
* provided URL isn't local
*
* @param string $url The URL to proxyfy
- * @param string $size One of the ProxyUtils::SIZE_* constants
+ * @param string $size One of the Proxy::SIZE_* constants
*
* @return string The proxyfied URL or relative path
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
use Friendica\Database\DBA;
use Friendica\DI;
-use Friendica\Model\Photo;
-use Friendica\Util\Proxy as ProxyUtils;
/**
* Clear cache entries