use Friendica\Core\System;
use Friendica\Core\Session;
use Friendica\Database\DBA;
+use Friendica\DI;
use Friendica\Model\Contact;
use Friendica\Model\Group;
use Friendica\Model\Item;
$title = trim(HTML::toPlaintext(BBCode::convert($item["title"], false), 0, true));
$author_name = $item["author-name"];
- $image = $a->removeBaseURL($item["author-avatar"]);
+ $image = DI::baseUrl()->remove($item["author-avatar"]);
if ($title == "") {
$title = $author_name;
$profiles = '';
foreach ($r as $rr) {
$profiles .= Renderer::replaceMacros($tpl, [
- '$photo' => $a->removeBaseURL($rr['thumb']),
+ '$photo' => DI::baseUrl()->remove($rr['thumb']),
'$id' => $rr['id'],
'$alt' => L10n::t('Profile Image'),
'$profile_name' => $rr['profile-name'],
return $this->baseURL->getUrlPath();
}
- /**
- * @brief Removes the base url from an url. This avoids some mixed content problems.
- *
- * @param string $origURL
- *
- * @return string The cleaned url
- *
- * @deprecated 2019.09 - Use BaseURL->remove() instead
- * @see BaseURL::remove()
- */
- public function removeBaseURL(string $origURL)
- {
- return $this->baseURL->remove($origURL);
- }
-
/**
* Returns the current UserAgent as a String
*
use Friendica\Core\Session;
use Friendica\Core\System;
use Friendica\Database\DBA;
+use Friendica\DI;
use Friendica\Model\Profile;
use Friendica\Model\User;
// user info
$contact = DBA::selectFirst('contact', ['micro'], ['uid' => $a->user['uid'], 'self' => true]);
$userinfo = [
- 'icon' => (DBA::isResult($contact) ? $a->removeBaseURL($contact['micro']) : 'images/person-48.jpg'),
+ 'icon' => (DBA::isResult($contact) ? DI::baseUrl()->remove($contact['micro']) : 'images/person-48.jpg'),
'name' => $a->user['username'],
];
}
*/
public static function removedBaseUrl(string $orig_url)
{
- return DI::app()->removeBaseURL($orig_url);
+ return DI::baseUrl()->remove($orig_url);
}
/**
];
if (!empty($item['plink'])) {
- $ret["href"] = $a->removeBaseURL($item['plink']);
+ $ret["href"] = DI::baseUrl()->remove($item['plink']);
$ret["title"] = L10n::t('link to source');
}
'$type' => $type,
'$wall' => $wall,
'$default' => '',
- '$mylink' => $a->removeBaseURL($a->contact['url']),
+ '$mylink' => DI::baseUrl()->remove($a->contact['url']),
'$mytitle' => L10n::t('This is you'),
- '$myphoto' => $a->removeBaseURL($a->contact['thumb']),
+ '$myphoto' => DI::baseUrl()->remove($a->contact['thumb']),
'$submit' => L10n::t('Submit'),
'$edbold' => L10n::t('Bold'),
'$editalic' => L10n::t('Italic'),
'profile_url' => $profile_link,
'item_photo_menu' => item_photo_menu($item),
'name' => $name_e,
- 'thumb' => $a->removeBaseURL(ProxyUtils::proxifyUrl($item['author-avatar'], false, ProxyUtils::SIZE_THUMB)),
+ 'thumb' => DI::baseUrl()->remove(ProxyUtils::proxifyUrl($item['author-avatar'], false, ProxyUtils::SIZE_THUMB)),
'osparkle' => $osparkle,
'sparkle' => $sparkle,
'title' => $title_e,
'shiny' => $shiny,
'owner_self' => $item['author-link'] == Session::get('my_url'),
'owner_url' => $this->getOwnerUrl(),
- 'owner_photo' => $a->removeBaseURL(ProxyUtils::proxifyUrl($item['owner-avatar'], false, ProxyUtils::SIZE_THUMB)),
+ 'owner_photo' => DI::baseUrl()->remove(ProxyUtils::proxifyUrl($item['owner-avatar'], false, ProxyUtils::SIZE_THUMB)),
'owner_name' => $owner_name_e,
'plink' => Item::getPlink($item),
'edpost' => $edpost,
'$qcomment' => $qcomment,
'$default' => $default_text,
'$profile_uid' => $uid,
- '$mylink' => $a->removeBaseURL($a->contact['url']),
+ '$mylink' => DI::baseUrl()->remove($a->contact['url']),
'$mytitle' => L10n::t('This is you'),
- '$myphoto' => $a->removeBaseURL($a->contact['thumb']),
+ '$myphoto' => DI::baseUrl()->remove($a->contact['thumb']),
'$comment' => L10n::t('Comment'),
'$submit' => L10n::t('Submit'),
'$edbold' => L10n::t('Bold'),
use Friendica\Core\Renderer;
use Friendica\Core\Session;
use Friendica\Database\DBA;
+use Friendica\DI;
use Friendica\Model;
use Friendica\Module;
use Friendica\Util\Strings;
// user info
$r = q("SELECT `micro` FROM `contact` WHERE `uid` = %d AND `self`", intval($a->user['uid']));
- $r[0]['photo'] = (DBA::isResult($r) ? $a->removeBaseURL($r[0]['micro']) : 'images/person-48.jpg');
+ $r[0]['photo'] = (DBA::isResult($r) ? DI::baseUrl()->remove($r[0]['micro']) : 'images/person-48.jpg');
$r[0]['name'] = $a->user['username'];
} elseif (!local_user() && remote_user()) {
$r = q("SELECT `name`, `nick`, `micro` AS `photo` FROM `contact` WHERE `id` = %d", intval(remote_user()));
use Friendica\Core\Renderer;
use Friendica\Core\System;
use Friendica\Database\DBA;
+use Friendica\DI;
use Friendica\Model\Contact;
use Friendica\Model\GContact;
use Friendica\Util\Proxy as ProxyUtils;
$entry = Renderer::replaceMacros($tpl, [
'$id' => $rr['id'],
'$profile_link' => $profile_link,
- '$photo' => $a->removeBaseURL($rr['thumb']),
+ '$photo' => DI::baseUrl()->remove($rr['thumb']),
'$alt_text' => $rr['name']]);
$aside['$lastusers_items'][] = $entry;
}