Move redundant System::baseUrl() to DI::baseUrl() calls
This commit is contained in:
@@ -435,4 +435,12 @@ class BaseURL
|
||||
$redirectTo = $this->get($ssl) . '/' . ltrim($toUrl, '/');
|
||||
System::externalRedirect($redirectTo);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the base url as string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return $this->get();
|
||||
}
|
||||
}
|
||||
|
||||
+1
-2
@@ -10,7 +10,6 @@ use Friendica\Core\Hook;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\Renderer;
|
||||
use Friendica\Core\Session;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\DI;
|
||||
use Friendica\Model\Profile;
|
||||
@@ -141,7 +140,7 @@ class Nav
|
||||
|
||||
$myident = ((is_array($a->user) && isset($a->user['nickname'])) ? $a->user['nickname'] . '@' : '');
|
||||
|
||||
$sitelocation = $myident . substr(System::baseUrl($ssl_state), strpos(System::baseUrl($ssl_state), '//') + 2);
|
||||
$sitelocation = $myident . substr(DI::baseUrl()->get($ssl_state), strpos(DI::baseUrl()->get($ssl_state), '//') + 2);
|
||||
|
||||
// nav links: array of array('href', 'text', 'extra css classes', 'title')
|
||||
$nav = [];
|
||||
|
||||
@@ -15,8 +15,8 @@ use Friendica\Core\Config;
|
||||
use Friendica\Core\Hook;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\Renderer;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\DI;
|
||||
use Friendica\Util\DateTimeFormat;
|
||||
use Friendica\Util\Network;
|
||||
use Friendica\Util\ParseUrl;
|
||||
@@ -373,7 +373,7 @@ class OEmbed
|
||||
}
|
||||
$width = '100%';
|
||||
|
||||
$src = System::baseUrl() . '/oembed/' . Strings::base64UrlEncode($src);
|
||||
$src = DI::baseUrl() . '/oembed/' . Strings::base64UrlEncode($src);
|
||||
return '<iframe onload="resizeIframe(this);" class="embed_rich" height="' . $height . '" width="' . $width . '" src="' . $src . '" allowfullscreen scrolling="no" frameborder="no">' . L10n::t('Embedded content') . '</iframe>';
|
||||
}
|
||||
|
||||
|
||||
+38
-36
@@ -17,7 +17,7 @@ namespace Friendica\Content;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\Hook;
|
||||
use Friendica\Core\PConfig;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\DI;
|
||||
use Friendica\Util\Strings;
|
||||
|
||||
/**
|
||||
@@ -102,42 +102,44 @@ class Smilies
|
||||
|
||||
];
|
||||
|
||||
$baseUrl = DI::baseUrl();
|
||||
|
||||
$icons = [
|
||||
'<img class="smiley" src="' . System::baseUrl() . '/images/smiley-heart.gif" alt="<3" title="<3" />',
|
||||
'<img class="smiley" src="' . System::baseUrl() . '/images/smiley-brokenheart.gif" alt="</3" title="</3" />',
|
||||
'<img class="smiley" src="' . System::baseUrl() . '/images/smiley-brokenheart.gif" alt="<\\3" title="<\\3" />',
|
||||
'<img class="smiley" src="' . System::baseUrl() . '/images/smiley-smile.gif" alt=":-)" title=":-)" />',
|
||||
'<img class="smiley" src="' . System::baseUrl() . '/images/smiley-wink.gif" alt=";-)" title=";-)" />',
|
||||
'<img class="smiley" src="' . System::baseUrl() . '/images/smiley-frown.gif" alt=":-(" title=":-(" />',
|
||||
'<img class="smiley" src="' . System::baseUrl() . '/images/smiley-tongue-out.gif" alt=":-P" title=":-P" />',
|
||||
'<img class="smiley" src="' . System::baseUrl() . '/images/smiley-tongue-out.gif" alt=":-p" title=":-P" />',
|
||||
'<img class="smiley" src="' . System::baseUrl() . '/images/smiley-kiss.gif" alt=":-\" title=":-\" />',
|
||||
'<img class="smiley" src="' . System::baseUrl() . '/images/smiley-kiss.gif" alt=":-\" title=":-\" />',
|
||||
'<img class="smiley" src="' . System::baseUrl() . '/images/smiley-kiss.gif" alt=":-x" title=":-x" />',
|
||||
'<img class="smiley" src="' . System::baseUrl() . '/images/smiley-kiss.gif" alt=":-X" title=":-X" />',
|
||||
'<img class="smiley" src="' . System::baseUrl() . '/images/smiley-laughing.gif" alt=":-D" title=":-D" />',
|
||||
'<img class="smiley" src="' . System::baseUrl() . '/images/smiley-surprised.gif" alt="8-|" title="8-|" />',
|
||||
'<img class="smiley" src="' . System::baseUrl() . '/images/smiley-surprised.gif" alt="8-O" title="8-O" />',
|
||||
'<img class="smiley" src="' . System::baseUrl() . '/images/smiley-surprised.gif" alt=":-O" title="8-O" />',
|
||||
'<img class="smiley" src="' . System::baseUrl() . '/images/smiley-thumbsup.gif" alt="\\o/" title="\\o/" />',
|
||||
'<img class="smiley" src="' . System::baseUrl() . '/images/smiley-Oo.gif" alt="o.O" title="o.O" />',
|
||||
'<img class="smiley" src="' . System::baseUrl() . '/images/smiley-Oo.gif" alt="O.o" title="O.o" />',
|
||||
'<img class="smiley" src="' . System::baseUrl() . '/images/smiley-Oo.gif" alt="o_O" title="o_O" />',
|
||||
'<img class="smiley" src="' . System::baseUrl() . '/images/smiley-Oo.gif" alt="O_o" title="O_o" />',
|
||||
'<img class="smiley" src="' . System::baseUrl() . '/images/smiley-cry.gif" alt=":\'(" title=":\'("/>',
|
||||
'<img class="smiley" src="' . System::baseUrl() . '/images/smiley-foot-in-mouth.gif" alt=":-!" title=":-!" />',
|
||||
'<img class="smiley" src="' . System::baseUrl() . '/images/smiley-undecided.gif" alt=":-/" title=":-/" />',
|
||||
'<img class="smiley" src="' . System::baseUrl() . '/images/smiley-embarassed.gif" alt=":-[" title=":-[" />',
|
||||
'<img class="smiley" src="' . System::baseUrl() . '/images/smiley-cool.gif" alt="8-)" title="8-)" />',
|
||||
'<img class="smiley" src="' . System::baseUrl() . '/images/beer_mug.gif" alt=":beer" title=":beer" />',
|
||||
'<img class="smiley" src="' . System::baseUrl() . '/images/beer_mug.gif" alt=":homebrew" title=":homebrew" />',
|
||||
'<img class="smiley" src="' . System::baseUrl() . '/images/coffee.gif" alt=":coffee" title=":coffee" />',
|
||||
'<img class="smiley" src="' . System::baseUrl() . '/images/smiley-facepalm.gif" alt=":facepalm" title=":facepalm" />',
|
||||
'<img class="smiley" src="' . System::baseUrl() . '/images/like.gif" alt=":like" title=":like" />',
|
||||
'<img class="smiley" src="' . System::baseUrl() . '/images/dislike.gif" alt=":dislike" title=":dislike" />',
|
||||
'<a href="https://friendi.ca">~friendica <img class="smiley" src="' . System::baseUrl() . '/images/friendica-16.png" alt="~friendica" title="~friendica" /></a>',
|
||||
'<a href="http://redmatrix.me/">red<img class="smiley" src="' . System::baseUrl() . '/images/rm-16.png" alt="red#" title="red#" />matrix</a>',
|
||||
'<a href="http://redmatrix.me/">red<img class="smiley" src="' . System::baseUrl() . '/images/rm-16.png" alt="red#matrix" title="red#matrix" />matrix</a>'
|
||||
'<img class="smiley" src="' . $baseUrl . '/images/smiley-heart.gif" alt="<3" title="<3" />',
|
||||
'<img class="smiley" src="' . $baseUrl . '/images/smiley-brokenheart.gif" alt="</3" title="</3" />',
|
||||
'<img class="smiley" src="' . $baseUrl . '/images/smiley-brokenheart.gif" alt="<\\3" title="<\\3" />',
|
||||
'<img class="smiley" src="' . $baseUrl . '/images/smiley-smile.gif" alt=":-)" title=":-)" />',
|
||||
'<img class="smiley" src="' . $baseUrl . '/images/smiley-wink.gif" alt=";-)" title=";-)" />',
|
||||
'<img class="smiley" src="' . $baseUrl . '/images/smiley-frown.gif" alt=":-(" title=":-(" />',
|
||||
'<img class="smiley" src="' . $baseUrl . '/images/smiley-tongue-out.gif" alt=":-P" title=":-P" />',
|
||||
'<img class="smiley" src="' . $baseUrl . '/images/smiley-tongue-out.gif" alt=":-p" title=":-P" />',
|
||||
'<img class="smiley" src="' . $baseUrl . '/images/smiley-kiss.gif" alt=":-\" title=":-\" />',
|
||||
'<img class="smiley" src="' . $baseUrl . '/images/smiley-kiss.gif" alt=":-\" title=":-\" />',
|
||||
'<img class="smiley" src="' . $baseUrl . '/images/smiley-kiss.gif" alt=":-x" title=":-x" />',
|
||||
'<img class="smiley" src="' . $baseUrl . '/images/smiley-kiss.gif" alt=":-X" title=":-X" />',
|
||||
'<img class="smiley" src="' . $baseUrl . '/images/smiley-laughing.gif" alt=":-D" title=":-D" />',
|
||||
'<img class="smiley" src="' . $baseUrl . '/images/smiley-surprised.gif" alt="8-|" title="8-|" />',
|
||||
'<img class="smiley" src="' . $baseUrl . '/images/smiley-surprised.gif" alt="8-O" title="8-O" />',
|
||||
'<img class="smiley" src="' . $baseUrl . '/images/smiley-surprised.gif" alt=":-O" title="8-O" />',
|
||||
'<img class="smiley" src="' . $baseUrl . '/images/smiley-thumbsup.gif" alt="\\o/" title="\\o/" />',
|
||||
'<img class="smiley" src="' . $baseUrl . '/images/smiley-Oo.gif" alt="o.O" title="o.O" />',
|
||||
'<img class="smiley" src="' . $baseUrl . '/images/smiley-Oo.gif" alt="O.o" title="O.o" />',
|
||||
'<img class="smiley" src="' . $baseUrl . '/images/smiley-Oo.gif" alt="o_O" title="o_O" />',
|
||||
'<img class="smiley" src="' . $baseUrl . '/images/smiley-Oo.gif" alt="O_o" title="O_o" />',
|
||||
'<img class="smiley" src="' . $baseUrl . '/images/smiley-cry.gif" alt=":\'(" title=":\'("/>',
|
||||
'<img class="smiley" src="' . $baseUrl . '/images/smiley-foot-in-mouth.gif" alt=":-!" title=":-!" />',
|
||||
'<img class="smiley" src="' . $baseUrl . '/images/smiley-undecided.gif" alt=":-/" title=":-/" />',
|
||||
'<img class="smiley" src="' . $baseUrl . '/images/smiley-embarassed.gif" alt=":-[" title=":-[" />',
|
||||
'<img class="smiley" src="' . $baseUrl . '/images/smiley-cool.gif" alt="8-)" title="8-)" />',
|
||||
'<img class="smiley" src="' . $baseUrl . '/images/beer_mug.gif" alt=":beer" title=":beer" />',
|
||||
'<img class="smiley" src="' . $baseUrl . '/images/beer_mug.gif" alt=":homebrew" title=":homebrew" />',
|
||||
'<img class="smiley" src="' . $baseUrl . '/images/coffee.gif" alt=":coffee" title=":coffee" />',
|
||||
'<img class="smiley" src="' . $baseUrl . '/images/smiley-facepalm.gif" alt=":facepalm" title=":facepalm" />',
|
||||
'<img class="smiley" src="' . $baseUrl . '/images/like.gif" alt=":like" title=":like" />',
|
||||
'<img class="smiley" src="' . $baseUrl . '/images/dislike.gif" alt=":dislike" title=":dislike" />',
|
||||
'<a href="https://friendi.ca">~friendica <img class="smiley" src="' . $baseUrl . '/images/friendica-16.png" alt="~friendica" title="~friendica" /></a>',
|
||||
'<a href="http://redmatrix.me/">red<img class="smiley" src="' . $baseUrl . '/images/rm-16.png" alt="red#" title="red#" />matrix</a>',
|
||||
'<a href="http://redmatrix.me/">red<img class="smiley" src="' . $baseUrl . '/images/rm-16.png" alt="red#matrix" title="red#matrix" />matrix</a>'
|
||||
];
|
||||
|
||||
$params = ['texts' => $texts, 'icons' => $icons];
|
||||
|
||||
+11
-11
@@ -452,7 +452,7 @@ class BBCode
|
||||
foreach ($matches as $mtch) {
|
||||
Logger::log('scale_external_image: ' . $mtch[1]);
|
||||
|
||||
$hostname = str_replace('www.', '', substr(System::baseUrl(), strpos(System::baseUrl(), '://') + 3));
|
||||
$hostname = str_replace('www.', '', substr(DI::baseUrl(), strpos(DI::baseUrl(), '://') + 3));
|
||||
if (stristr($mtch[1], $hostname)) {
|
||||
continue;
|
||||
}
|
||||
@@ -1626,9 +1626,9 @@ class BBCode
|
||||
$text = preg_replace("/\[img\](.*?)\[\/img\]/ism", '<img src="$1" alt="' . L10n::t('Image/photo') . '" />', $text);
|
||||
$text = preg_replace("/\[zmg\](.*?)\[\/zmg\]/ism", '<img src="$1" alt="' . L10n::t('Image/photo') . '" />', $text);
|
||||
|
||||
$text = preg_replace("/\[crypt\](.*?)\[\/crypt\]/ism", '<br/><img src="' .System::baseUrl() . '/images/lock_icon.gif" alt="' . L10n::t('Encrypted content') . '" title="' . L10n::t('Encrypted content') . '" /><br />', $text);
|
||||
$text = preg_replace("/\[crypt(.*?)\](.*?)\[\/crypt\]/ism", '<br/><img src="' .System::baseUrl() . '/images/lock_icon.gif" alt="' . L10n::t('Encrypted content') . '" title="' . '$1' . ' ' . L10n::t('Encrypted content') . '" /><br />', $text);
|
||||
//$Text = preg_replace("/\[crypt=(.*?)\](.*?)\[\/crypt\]/ism", '<br/><img src="' .System::baseUrl() . '/images/lock_icon.gif" alt="' . L10n::t('Encrypted content') . '" title="' . '$1' . ' ' . L10n::t('Encrypted content') . '" /><br />', $Text);
|
||||
$text = preg_replace("/\[crypt\](.*?)\[\/crypt\]/ism", '<br/><img src="' .DI::baseUrl() . '/images/lock_icon.gif" alt="' . L10n::t('Encrypted content') . '" title="' . L10n::t('Encrypted content') . '" /><br />', $text);
|
||||
$text = preg_replace("/\[crypt(.*?)\](.*?)\[\/crypt\]/ism", '<br/><img src="' .DI::baseUrl() . '/images/lock_icon.gif" alt="' . L10n::t('Encrypted content') . '" title="' . '$1' . ' ' . L10n::t('Encrypted content') . '" /><br />', $text);
|
||||
//$Text = preg_replace("/\[crypt=(.*?)\](.*?)\[\/crypt\]/ism", '<br/><img src="' .DI::baseUrl() . '/images/lock_icon.gif" alt="' . L10n::t('Encrypted content') . '" title="' . '$1' . ' ' . L10n::t('Encrypted content') . '" /><br />', $Text);
|
||||
|
||||
// Simplify "video" element
|
||||
$text = preg_replace('(\[video.*?\ssrc\s?=\s?([^\s\]]+).*?\].*?\[/video\])ism', '[video]$1[/video]', $text);
|
||||
@@ -1778,21 +1778,21 @@ class BBCode
|
||||
$text = preg_replace_callback(
|
||||
"&\[url=/?posts/([^\[\]]*)\](.*)\[\/url\]&Usi",
|
||||
function ($match) {
|
||||
return "[url=" . System::baseUrl() . "/display/" . $match[1] . "]" . $match[2] . "[/url]";
|
||||
return "[url=" . DI::baseUrl() . "/display/" . $match[1] . "]" . $match[2] . "[/url]";
|
||||
}, $text
|
||||
);
|
||||
|
||||
$text = preg_replace_callback(
|
||||
"&\[url=/people\?q\=(.*)\](.*)\[\/url\]&Usi",
|
||||
function ($match) {
|
||||
return "[url=" . System::baseUrl() . "/search?search=%40" . $match[1] . "]" . $match[2] . "[/url]";
|
||||
return "[url=" . DI::baseUrl() . "/search?search=%40" . $match[1] . "]" . $match[2] . "[/url]";
|
||||
}, $text
|
||||
);
|
||||
|
||||
// Server independent link to posts and comments
|
||||
// See issue: https://github.com/diaspora/diaspora_federation/issues/75
|
||||
$expression = "=diaspora://.*?/post/([0-9A-Za-z\-_@.:]{15,254}[0-9A-Za-z])=ism";
|
||||
$text = preg_replace($expression, System::baseUrl()."/display/$1", $text);
|
||||
$text = preg_replace($expression, DI::baseUrl()."/display/$1", $text);
|
||||
|
||||
/* Tag conversion
|
||||
* Supports:
|
||||
@@ -1801,15 +1801,15 @@ class BBCode
|
||||
*/
|
||||
$text = preg_replace_callback("/(?:#\[url\=[^\[\]]*\]|\[url\=[^\[\]]*\]#)(.*?)\[\/url\]/ism", function($matches) {
|
||||
return '#<a href="'
|
||||
. System::baseUrl() . '/search?tag=' . rawurlencode($matches[1])
|
||||
. DI::baseUrl() . '/search?tag=' . rawurlencode($matches[1])
|
||||
. '" class="tag" rel="tag" title="' . XML::escape($matches[1]) . '">'
|
||||
. XML::escape($matches[1])
|
||||
. '</a>';
|
||||
}, $text);
|
||||
|
||||
// We need no target="_blank" for local links
|
||||
// convert links start with System::baseUrl() as local link without the target="_blank" attribute
|
||||
$escapedBaseUrl = preg_quote(System::baseUrl(), '/');
|
||||
// convert links start with DI::baseUrl() as local link without the target="_blank" attribute
|
||||
$escapedBaseUrl = preg_quote(DI::baseUrl(), '/');
|
||||
$text = preg_replace("/\[url\](".$escapedBaseUrl.".*?)\[\/url\]/ism", '<a href="$1">$1</a>', $text);
|
||||
$text = preg_replace("/\[url\=(".$escapedBaseUrl.".*?)\](.*?)\[\/url\]/ism", '<a href="$1">$2</a>', $text);
|
||||
|
||||
@@ -1823,7 +1823,7 @@ class BBCode
|
||||
// we may need to restrict this further if it picks up too many strays
|
||||
// link acct:user@host to a webfinger profile redirector
|
||||
|
||||
$text = preg_replace('/acct:([^@]+)@((?!\-)(?:[a-zA-Z\d\-]{0,62}[a-zA-Z\d]\.){1,126}(?!\d+)[a-zA-Z\d]{1,63})/', '<a href="' . System::baseUrl() . '/acctlink?addr=$1@$2" target="extlink">acct:$1@$2</a>', $text);
|
||||
$text = preg_replace('/acct:([^@]+)@((?!\-)(?:[a-zA-Z\d\-]{0,62}[a-zA-Z\d]\.){1,126}(?!\d+)[a-zA-Z\d]{1,63})/', '<a href="' . DI::baseUrl() . '/acctlink?addr=$1@$2" target="extlink">acct:$1@$2</a>', $text);
|
||||
|
||||
// Perform MAIL Search
|
||||
$text = preg_replace("/\[mail\](.*?)\[\/mail\]/", '<a href="mailto:$1">$1</a>', $text);
|
||||
|
||||
@@ -10,7 +10,6 @@ use Friendica\Core\L10n;
|
||||
use Friendica\Core\PConfig;
|
||||
use Friendica\Core\Protocol;
|
||||
use Friendica\Core\Renderer;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Core\Session;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\DI;
|
||||
@@ -23,7 +22,6 @@ use Friendica\Util\DateTimeFormat;
|
||||
use Friendica\Util\Proxy as ProxyUtils;
|
||||
use Friendica\Util\Strings;
|
||||
use Friendica\Util\Temporal;
|
||||
use Friendica\Util\XML;
|
||||
|
||||
class Widget
|
||||
{
|
||||
@@ -402,7 +400,7 @@ class Widget
|
||||
$tpl = Renderer::getMarkupTemplate('widget/remote_friends_common.tpl');
|
||||
return Renderer::replaceMacros($tpl, [
|
||||
'$desc' => L10n::tt("%d contact in common", "%d contacts in common", $t),
|
||||
'$base' => System::baseUrl(),
|
||||
'$base' => DI::baseUrl(),
|
||||
'$uid' => $profile_uid,
|
||||
'$cid' => (($cid) ? $cid : '0'),
|
||||
'$linkmore' => (($t > 5) ? 'true' : ''),
|
||||
|
||||
@@ -20,17 +20,6 @@ use Friendica\Util\XML;
|
||||
*/
|
||||
class System
|
||||
{
|
||||
/**
|
||||
* @brief Retrieves the Friendica instance base URL
|
||||
*
|
||||
* @param bool $ssl Whether to append http or https under BaseURL::SSL_POLICY_SELFSIGN
|
||||
* @return string Friendica server base URL
|
||||
*/
|
||||
public static function baseUrl($ssl = false)
|
||||
{
|
||||
return DI::baseUrl()->get($ssl);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Removes the baseurl from an url. This avoids some mixed content problems.
|
||||
*
|
||||
|
||||
+2
-2
@@ -125,10 +125,10 @@ class Theme
|
||||
$exts = ['.png', '.jpg'];
|
||||
foreach ($exts as $ext) {
|
||||
if (file_exists('view/theme/' . $theme . '/screenshot' . $ext)) {
|
||||
return System::baseUrl() . '/view/theme/' . $theme . '/screenshot' . $ext;
|
||||
return DI::baseUrl() . '/view/theme/' . $theme . '/screenshot' . $ext;
|
||||
}
|
||||
}
|
||||
return System::baseUrl() . '/images/blank.png';
|
||||
return DI::baseUrl() . '/images/blank.png';
|
||||
}
|
||||
|
||||
public static function uninstall($theme)
|
||||
|
||||
@@ -123,7 +123,7 @@ class UserImport
|
||||
}
|
||||
|
||||
$oldbaseurl = $account['baseurl'];
|
||||
$newbaseurl = System::baseUrl();
|
||||
$newbaseurl = DI::baseUrl();
|
||||
|
||||
$oldaddr = str_replace('http://', '@', Strings::normaliseLink($oldbaseurl));
|
||||
$newaddr = str_replace('http://', '@', Strings::normaliseLink($newbaseurl));
|
||||
|
||||
+1
-1
@@ -979,7 +979,7 @@ class Worker
|
||||
return;
|
||||
}
|
||||
|
||||
$url = System::baseUrl()."/worker";
|
||||
$url = DI::baseUrl() . '/worker';
|
||||
Network::fetchUrl($url, false, 1);
|
||||
}
|
||||
|
||||
|
||||
+34
-34
@@ -303,7 +303,7 @@ class Contact
|
||||
*/
|
||||
public static function isLocal($url)
|
||||
{
|
||||
return Strings::compareLink(self::getBasepath($url, true), System::baseUrl());
|
||||
return Strings::compareLink(self::getBasepath($url, true), DI::baseUrl());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -647,19 +647,19 @@ class Contact
|
||||
'self' => 1,
|
||||
'name' => $user['username'],
|
||||
'nick' => $user['nickname'],
|
||||
'photo' => System::baseUrl() . '/photo/profile/' . $user['uid'] . '.jpg',
|
||||
'thumb' => System::baseUrl() . '/photo/avatar/' . $user['uid'] . '.jpg',
|
||||
'micro' => System::baseUrl() . '/photo/micro/' . $user['uid'] . '.jpg',
|
||||
'photo' => DI::baseUrl() . '/photo/profile/' . $user['uid'] . '.jpg',
|
||||
'thumb' => DI::baseUrl() . '/photo/avatar/' . $user['uid'] . '.jpg',
|
||||
'micro' => DI::baseUrl() . '/photo/micro/' . $user['uid'] . '.jpg',
|
||||
'blocked' => 0,
|
||||
'pending' => 0,
|
||||
'url' => System::baseUrl() . '/profile/' . $user['nickname'],
|
||||
'nurl' => Strings::normaliseLink(System::baseUrl() . '/profile/' . $user['nickname']),
|
||||
'addr' => $user['nickname'] . '@' . substr(System::baseUrl(), strpos(System::baseUrl(), '://') + 3),
|
||||
'request' => System::baseUrl() . '/dfrn_request/' . $user['nickname'],
|
||||
'notify' => System::baseUrl() . '/dfrn_notify/' . $user['nickname'],
|
||||
'poll' => System::baseUrl() . '/dfrn_poll/' . $user['nickname'],
|
||||
'confirm' => System::baseUrl() . '/dfrn_confirm/' . $user['nickname'],
|
||||
'poco' => System::baseUrl() . '/poco/' . $user['nickname'],
|
||||
'url' => DI::baseUrl() . '/profile/' . $user['nickname'],
|
||||
'nurl' => Strings::normaliseLink(DI::baseUrl() . '/profile/' . $user['nickname']),
|
||||
'addr' => $user['nickname'] . '@' . substr(DI::baseUrl(), strpos(DI::baseUrl(), '://') + 3),
|
||||
'request' => DI::baseUrl() . '/dfrn_request/' . $user['nickname'],
|
||||
'notify' => DI::baseUrl() . '/dfrn_notify/' . $user['nickname'],
|
||||
'poll' => DI::baseUrl() . '/dfrn_poll/' . $user['nickname'],
|
||||
'confirm' => DI::baseUrl() . '/dfrn_confirm/' . $user['nickname'],
|
||||
'poco' => DI::baseUrl() . '/poco/' . $user['nickname'],
|
||||
'name-date' => DateTimeFormat::utcNow(),
|
||||
'uri-date' => DateTimeFormat::utcNow(),
|
||||
'avatar-date' => DateTimeFormat::utcNow(),
|
||||
@@ -722,7 +722,7 @@ class Contact
|
||||
// We are adding a timestamp value so that other systems won't use cached content
|
||||
$timestamp = strtotime($fields['avatar-date']);
|
||||
|
||||
$prefix = System::baseUrl() . '/photo/' .$avatar['resource-id'] . '-';
|
||||
$prefix = DI::baseUrl() . '/photo/' .$avatar['resource-id'] . '-';
|
||||
$suffix = '.' . $file_suffix . '?ts=' . $timestamp;
|
||||
|
||||
$fields['photo'] = $prefix . '4' . $suffix;
|
||||
@@ -730,25 +730,25 @@ class Contact
|
||||
$fields['micro'] = $prefix . '6' . $suffix;
|
||||
} else {
|
||||
// We hadn't found a photo entry, so we use the default avatar
|
||||
$fields['photo'] = System::baseUrl() . '/images/person-300.jpg';
|
||||
$fields['thumb'] = System::baseUrl() . '/images/person-80.jpg';
|
||||
$fields['micro'] = System::baseUrl() . '/images/person-48.jpg';
|
||||
$fields['photo'] = DI::baseUrl() . '/images/person-300.jpg';
|
||||
$fields['thumb'] = DI::baseUrl() . '/images/person-80.jpg';
|
||||
$fields['micro'] = DI::baseUrl() . '/images/person-48.jpg';
|
||||
}
|
||||
|
||||
$fields['avatar'] = System::baseUrl() . '/photo/profile/' .$uid . '.' . $file_suffix;
|
||||
$fields['avatar'] = DI::baseUrl() . '/photo/profile/' .$uid . '.' . $file_suffix;
|
||||
$fields['forum'] = $user['page-flags'] == User::PAGE_FLAGS_COMMUNITY;
|
||||
$fields['prv'] = $user['page-flags'] == User::PAGE_FLAGS_PRVGROUP;
|
||||
$fields['unsearchable'] = $user['hidewall'] || !$profile['net-publish'];
|
||||
|
||||
// it seems as if ported accounts can have wrong values, so we make sure that now everything is fine.
|
||||
$fields['url'] = System::baseUrl() . '/profile/' . $user['nickname'];
|
||||
$fields['url'] = DI::baseUrl() . '/profile/' . $user['nickname'];
|
||||
$fields['nurl'] = Strings::normaliseLink($fields['url']);
|
||||
$fields['addr'] = $user['nickname'] . '@' . substr(System::baseUrl(), strpos(System::baseUrl(), '://') + 3);
|
||||
$fields['request'] = System::baseUrl() . '/dfrn_request/' . $user['nickname'];
|
||||
$fields['notify'] = System::baseUrl() . '/dfrn_notify/' . $user['nickname'];
|
||||
$fields['poll'] = System::baseUrl() . '/dfrn_poll/'. $user['nickname'];
|
||||
$fields['confirm'] = System::baseUrl() . '/dfrn_confirm/' . $user['nickname'];
|
||||
$fields['poco'] = System::baseUrl() . '/poco/' . $user['nickname'];
|
||||
$fields['addr'] = $user['nickname'] . '@' . substr(DI::baseUrl(), strpos(DI::baseUrl(), '://') + 3);
|
||||
$fields['request'] = DI::baseUrl() . '/dfrn_request/' . $user['nickname'];
|
||||
$fields['notify'] = DI::baseUrl() . '/dfrn_notify/' . $user['nickname'];
|
||||
$fields['poll'] = DI::baseUrl() . '/dfrn_poll/'. $user['nickname'];
|
||||
$fields['confirm'] = DI::baseUrl() . '/dfrn_confirm/' . $user['nickname'];
|
||||
$fields['poco'] = DI::baseUrl() . '/poco/' . $user['nickname'];
|
||||
|
||||
$update = false;
|
||||
|
||||
@@ -769,8 +769,8 @@ class Contact
|
||||
DBA::update('contact', $fields, ['uid' => 0, 'nurl' => $self['nurl']]);
|
||||
|
||||
// Update the profile
|
||||
$fields = ['photo' => System::baseUrl() . '/photo/profile/' .$uid . '.' . $file_suffix,
|
||||
'thumb' => System::baseUrl() . '/photo/avatar/' . $uid .'.' . $file_suffix];
|
||||
$fields = ['photo' => DI::baseUrl() . '/photo/profile/' .$uid . '.' . $file_suffix,
|
||||
'thumb' => DI::baseUrl() . '/photo/avatar/' . $uid .'.' . $file_suffix];
|
||||
DBA::update('profile', $fields, ['uid' => $uid, 'is-default' => true]);
|
||||
}
|
||||
}
|
||||
@@ -1191,7 +1191,7 @@ class Contact
|
||||
$sparkle = false;
|
||||
if (($contact['network'] === Protocol::DFRN) && !$contact['self'] && empty($contact['pending'])) {
|
||||
$sparkle = true;
|
||||
$profile_link = System::baseUrl() . '/redir/' . $contact['id'];
|
||||
$profile_link = DI::baseUrl() . '/redir/' . $contact['id'];
|
||||
} else {
|
||||
$profile_link = $contact['url'];
|
||||
}
|
||||
@@ -1207,19 +1207,19 @@ class Contact
|
||||
}
|
||||
|
||||
if (self::canReceivePrivateMessages($contact) && empty($contact['pending'])) {
|
||||
$pm_url = System::baseUrl() . '/message/new/' . $contact['id'];
|
||||
$pm_url = DI::baseUrl() . '/message/new/' . $contact['id'];
|
||||
}
|
||||
|
||||
if (($contact['network'] == Protocol::DFRN) && !$contact['self'] && empty($contact['pending'])) {
|
||||
$poke_link = System::baseUrl() . '/poke/?c=' . $contact['id'];
|
||||
$poke_link = DI::baseUrl() . '/poke/?c=' . $contact['id'];
|
||||
}
|
||||
|
||||
$contact_url = System::baseUrl() . '/contact/' . $contact['id'];
|
||||
$contact_url = DI::baseUrl() . '/contact/' . $contact['id'];
|
||||
|
||||
$posts_link = System::baseUrl() . '/contact/' . $contact['id'] . '/conversations';
|
||||
$posts_link = DI::baseUrl() . '/contact/' . $contact['id'] . '/conversations';
|
||||
|
||||
if (!$contact['self']) {
|
||||
$contact_drop_link = System::baseUrl() . '/contact/' . $contact['id'] . '/drop?confirm=1';
|
||||
$contact_drop_link = DI::baseUrl() . '/contact/' . $contact['id'] . '/drop?confirm=1';
|
||||
}
|
||||
|
||||
$follow_link = '';
|
||||
@@ -2268,7 +2268,7 @@ class Contact
|
||||
if (($protocol === Protocol::DFRN) && !DBA::isResult($contact)) {
|
||||
if ($interactive) {
|
||||
if (strlen(DI::baseUrl()->getUrlPath())) {
|
||||
$myaddr = bin2hex(System::baseUrl() . '/profile/' . $a->user['nickname']);
|
||||
$myaddr = bin2hex(DI::baseUrl() . '/profile/' . $a->user['nickname']);
|
||||
} else {
|
||||
$myaddr = bin2hex($a->user['nickname'] . '@' . DI::baseUrl()->getHostname());
|
||||
}
|
||||
@@ -2594,7 +2594,7 @@ class Contact
|
||||
'to_name' => $user['username'],
|
||||
'to_email' => $user['email'],
|
||||
'uid' => $user['uid'],
|
||||
'link' => System::baseUrl() . '/notifications/intro',
|
||||
'link' => DI::baseUrl() . '/notifications/intro',
|
||||
'source_name' => ((strlen(stripslashes($contact_record['name']))) ? stripslashes($contact_record['name']) : L10n::t('[Name Withheld]')),
|
||||
'source_link' => $contact_record['url'],
|
||||
'source_photo' => $contact_record['photo'],
|
||||
|
||||
+4
-3
@@ -13,6 +13,7 @@ use Friendica\Core\PConfig;
|
||||
use Friendica\Core\Renderer;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\DI;
|
||||
use Friendica\Protocol\Activity;
|
||||
use Friendica\Util\DateTimeFormat;
|
||||
use Friendica\Util\Map;
|
||||
@@ -589,9 +590,9 @@ class Event
|
||||
$copy = null;
|
||||
$drop = null;
|
||||
if (local_user() && local_user() == $event['uid'] && $event['type'] == 'event') {
|
||||
$edit = !$event['cid'] ? [System::baseUrl() . '/events/event/' . $event['id'], L10n::t('Edit event') , '', ''] : null;
|
||||
$copy = !$event['cid'] ? [System::baseUrl() . '/events/copy/' . $event['id'] , L10n::t('Duplicate event'), '', ''] : null;
|
||||
$drop = [System::baseUrl() . '/events/drop/' . $event['id'] , L10n::t('Delete event') , '', ''];
|
||||
$edit = !$event['cid'] ? [DI::baseUrl() . '/events/event/' . $event['id'], L10n::t('Edit event') , '', ''] : null;
|
||||
$copy = !$event['cid'] ? [DI::baseUrl() . '/events/copy/' . $event['id'] , L10n::t('Duplicate event'), '', ''] : null;
|
||||
$drop = [DI::baseUrl() . '/events/drop/' . $event['id'] , L10n::t('Delete event') , '', ''];
|
||||
}
|
||||
|
||||
$title = BBCode::convert(Strings::escapeHtml($event['summary']));
|
||||
|
||||
@@ -12,8 +12,8 @@ use Friendica\Core\Config;
|
||||
use Friendica\Core\Logger;
|
||||
use Friendica\Core\Protocol;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Core\Worker;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\DI;
|
||||
use Friendica\Network\Probe;
|
||||
use Friendica\Protocol\ActivityPub;
|
||||
use Friendica\Protocol\PortableContact;
|
||||
@@ -149,7 +149,7 @@ class GContact
|
||||
}
|
||||
|
||||
// The global contacts should contain the original picture, not the cached one
|
||||
if (($gcontact['generation'] != 1) && stristr(Strings::normaliseLink($gcontact['photo']), Strings::normaliseLink(System::baseUrl() . '/photo/'))) {
|
||||
if (($gcontact['generation'] != 1) && stristr(Strings::normaliseLink($gcontact['photo']), Strings::normaliseLink(DI::baseUrl() . '/photo/'))) {
|
||||
$gcontact['photo'] = '';
|
||||
}
|
||||
|
||||
@@ -503,9 +503,9 @@ class GContact
|
||||
$done = [];
|
||||
|
||||
/// @TODO Check if it is really neccessary to poll the own server
|
||||
PortableContact::loadWorker(0, 0, 0, System::baseUrl() . '/poco');
|
||||
PortableContact::loadWorker(0, 0, 0, DI::baseUrl() . '/poco');
|
||||
|
||||
$done[] = System::baseUrl() . '/poco';
|
||||
$done[] = DI::baseUrl() . '/poco';
|
||||
|
||||
if (strlen(Config::get('system', 'directory'))) {
|
||||
$x = Network::fetchUrl(get_server() . '/pubsites');
|
||||
@@ -1122,7 +1122,7 @@ class GContact
|
||||
"notify" => $userdata['notify'], 'url' => $userdata['url'],
|
||||
"hide" => ($userdata['hidewall'] || !$userdata['net-publish']),
|
||||
'nick' => $userdata['nickname'], 'addr' => $userdata['addr'],
|
||||
"connect" => $userdata['addr'], "server_url" => System::baseUrl(),
|
||||
"connect" => $userdata['addr'], "server_url" => DI::baseUrl(),
|
||||
"generation" => 1, 'network' => Protocol::DFRN];
|
||||
|
||||
self::update($gcontact);
|
||||
@@ -1182,7 +1182,7 @@ class GContact
|
||||
'addr' => $user->nickname . '@' . $hostname,
|
||||
'nick' => $user->nickname,
|
||||
"network" => Protocol::OSTATUS,
|
||||
'photo' => System::baseUrl() . '/images/person-300.jpg'];
|
||||
'photo' => DI::baseUrl() . '/images/person-300.jpg'];
|
||||
|
||||
if (isset($user->bio)) {
|
||||
$contact['about'] = $user->bio;
|
||||
|
||||
+7
-7
@@ -1564,7 +1564,7 @@ class Item
|
||||
$item['edited'] = DateTimeFormat::utcNow();
|
||||
}
|
||||
|
||||
$item['plink'] = ($item['plink'] ?? '') ?: System::baseUrl() . '/display/' . urlencode($item['guid']);
|
||||
$item['plink'] = ($item['plink'] ?? '') ?: DI::baseUrl() . '/display/' . urlencode($item['guid']);
|
||||
|
||||
$default = ['url' => $item['author-link'], 'name' => $item['author-name'],
|
||||
'photo' => $item['author-avatar'], 'network' => $item['network']];
|
||||
@@ -2592,10 +2592,10 @@ class Item
|
||||
// All hashtags should point to the home server if "local_tags" is activated
|
||||
if (Config::get('system', 'local_tags')) {
|
||||
$item["body"] = preg_replace("/#\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism",
|
||||
"#[url=".System::baseUrl()."/search?tag=$2]$2[/url]", $item["body"]);
|
||||
"#[url=".DI::baseUrl()."/search?tag=$2]$2[/url]", $item["body"]);
|
||||
|
||||
$item["tag"] = preg_replace("/#\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism",
|
||||
"#[url=".System::baseUrl()."/search?tag=$2]$2[/url]", $item["tag"]);
|
||||
"#[url=".DI::baseUrl()."/search?tag=$2]$2[/url]", $item["tag"]);
|
||||
}
|
||||
|
||||
// mask hashtags inside of url, bookmarks and attachments to avoid urls in urls
|
||||
@@ -2624,7 +2624,7 @@ class Item
|
||||
}
|
||||
|
||||
$basetag = str_replace('_',' ',substr($tag,1));
|
||||
$newtag = '#[url=' . System::baseUrl() . '/search?tag=' . $basetag . ']' . $basetag . '[/url]';
|
||||
$newtag = '#[url=' . DI::baseUrl() . '/search?tag=' . $basetag . ']' . $basetag . '[/url]';
|
||||
|
||||
$item["body"] = str_replace($tag, $newtag, $item["body"]);
|
||||
|
||||
@@ -2676,13 +2676,13 @@ class Item
|
||||
return false;
|
||||
}
|
||||
|
||||
$link = Strings::normaliseLink(System::baseUrl() . '/profile/' . $user['nickname']);
|
||||
$link = Strings::normaliseLink(DI::baseUrl() . '/profile/' . $user['nickname']);
|
||||
|
||||
/*
|
||||
* Diaspora uses their own hardwired link URL in @-tags
|
||||
* instead of the one we supply with webfinger
|
||||
*/
|
||||
$dlink = Strings::normaliseLink(System::baseUrl() . '/u/' . $user['nickname']);
|
||||
$dlink = Strings::normaliseLink(DI::baseUrl() . '/u/' . $user['nickname']);
|
||||
|
||||
$cnt = preg_match_all('/[\@\!]\[url\=(.*?)\](.*?)\[\/url\]/ism', $item['body'], $matches, PREG_SET_ORDER);
|
||||
if ($cnt) {
|
||||
@@ -2852,7 +2852,7 @@ class Item
|
||||
}
|
||||
|
||||
Logger::log('check for photos', Logger::DEBUG);
|
||||
$site = substr(System::baseUrl(), strpos(System::baseUrl(), '://'));
|
||||
$site = substr(DI::baseUrl(), strpos(DI::baseUrl(), '://'));
|
||||
|
||||
$orig_body = $s;
|
||||
$new_body = '';
|
||||
|
||||
+4
-3
@@ -9,6 +9,7 @@ use Friendica\Core\L10n;
|
||||
use Friendica\Core\Logger;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Core\Worker;
|
||||
use Friendica\DI;
|
||||
use Friendica\Model\Item;
|
||||
use Friendica\Model\Photo;
|
||||
use Friendica\Database\DBA;
|
||||
@@ -148,7 +149,7 @@ class Mail
|
||||
$recip_host = substr($recip_host, 0, strpos($recip_host, '/'));
|
||||
|
||||
$recip_handle = (($contact['addr']) ? $contact['addr'] : $contact['nick'] . '@' . $recip_host);
|
||||
$sender_handle = $a->user['nickname'] . '@' . substr(System::baseUrl(), strpos(System::baseUrl(), '://') + 3);
|
||||
$sender_handle = $a->user['nickname'] . '@' . substr(DI::baseUrl(), strpos(DI::baseUrl(), '://') + 3);
|
||||
|
||||
$conv_guid = System::createUUID();
|
||||
$convuri = $recip_handle . ':' . $conv_guid;
|
||||
@@ -214,7 +215,7 @@ class Mail
|
||||
$images = $match[1];
|
||||
if (count($images)) {
|
||||
foreach ($images as $image) {
|
||||
if (!stristr($image, System::baseUrl() . '/photo/')) {
|
||||
if (!stristr($image, DI::baseUrl() . '/photo/')) {
|
||||
continue;
|
||||
}
|
||||
$image_uri = substr($image, strrpos($image, '/') + 1);
|
||||
@@ -262,7 +263,7 @@ class Mail
|
||||
|
||||
$conv_guid = System::createUUID();
|
||||
|
||||
$recip_handle = $recipient['nickname'] . '@' . substr(System::baseUrl(), strpos(System::baseUrl(), '://') + 3);
|
||||
$recip_handle = $recipient['nickname'] . '@' . substr(DI::baseUrl(), strpos(DI::baseUrl(), '://') + 3);
|
||||
|
||||
$sender_nick = basename($replyto);
|
||||
$sender_host = substr($replyto, strpos($replyto, '://') + 3);
|
||||
|
||||
+7
-7
@@ -456,9 +456,9 @@ class Photo
|
||||
|
||||
$suffix = "?ts=" . time();
|
||||
|
||||
$image_url = System::baseUrl() . "/photo/" . $resource_id . "-4." . $Image->getExt() . $suffix;
|
||||
$thumb = System::baseUrl() . "/photo/" . $resource_id . "-5." . $Image->getExt() . $suffix;
|
||||
$micro = System::baseUrl() . "/photo/" . $resource_id . "-6." . $Image->getExt() . $suffix;
|
||||
$image_url = DI::baseUrl() . "/photo/" . $resource_id . "-4." . $Image->getExt() . $suffix;
|
||||
$thumb = DI::baseUrl() . "/photo/" . $resource_id . "-5." . $Image->getExt() . $suffix;
|
||||
$micro = DI::baseUrl() . "/photo/" . $resource_id . "-6." . $Image->getExt() . $suffix;
|
||||
|
||||
// Remove the cached photo
|
||||
$a = \get_app();
|
||||
@@ -487,9 +487,9 @@ class Photo
|
||||
}
|
||||
|
||||
if ($photo_failure) {
|
||||
$image_url = System::baseUrl() . "/images/person-300.jpg";
|
||||
$thumb = System::baseUrl() . "/images/person-80.jpg";
|
||||
$micro = System::baseUrl() . "/images/person-48.jpg";
|
||||
$image_url = DI::baseUrl() . "/images/person-300.jpg";
|
||||
$thumb = DI::baseUrl() . "/images/person-80.jpg";
|
||||
$micro = DI::baseUrl() . "/images/person-48.jpg";
|
||||
}
|
||||
|
||||
return [$image_url, $thumb, $micro];
|
||||
@@ -622,7 +622,7 @@ class Photo
|
||||
}
|
||||
|
||||
foreach ($images as $image) {
|
||||
if (!stristr($image, System::baseUrl() . '/photo/')) {
|
||||
if (!stristr($image, DI::baseUrl() . '/photo/')) {
|
||||
continue;
|
||||
}
|
||||
$image_uri = substr($image,strrpos($image,'/') + 1);
|
||||
|
||||
+11
-13
@@ -20,8 +20,6 @@ use Friendica\Core\Protocol;
|
||||
use Friendica\Core\Renderer;
|
||||
use Friendica\Core\Session;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Core\Theme;
|
||||
use Friendica\Core\Worker;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\DI;
|
||||
use Friendica\Protocol\Activity;
|
||||
@@ -396,7 +394,7 @@ class Profile
|
||||
// show edit profile to yourself
|
||||
if (!$is_contact && $local_user_is_self) {
|
||||
if (Feature::isEnabled(local_user(), 'multi_profiles')) {
|
||||
$profile['edit'] = [System::baseUrl() . '/profiles', L10n::t('Profiles'), '', L10n::t('Manage/edit profiles')];
|
||||
$profile['edit'] = [DI::baseUrl() . '/profiles', L10n::t('Profiles'), '', L10n::t('Manage/edit profiles')];
|
||||
$r = q(
|
||||
"SELECT * FROM `profile` WHERE `uid` = %d",
|
||||
local_user()
|
||||
@@ -422,7 +420,7 @@ class Profile
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$profile['edit'] = [System::baseUrl() . '/profiles/' . $profile['id'], L10n::t('Edit profile'), '', L10n::t('Edit profile')];
|
||||
$profile['edit'] = [DI::baseUrl() . '/profiles/' . $profile['id'], L10n::t('Edit profile'), '', L10n::t('Edit profile')];
|
||||
$profile['menu'] = [
|
||||
'chg_photo' => L10n::t('Change profile photo'),
|
||||
'cr_new' => null,
|
||||
@@ -461,7 +459,7 @@ class Profile
|
||||
if (!empty($profile['guid'])) {
|
||||
$diaspora = [
|
||||
'guid' => $profile['guid'],
|
||||
'podloc' => System::baseUrl(),
|
||||
'podloc' => DI::baseUrl(),
|
||||
'searchable' => (($profile['publish'] && $profile['net-publish']) ? 'true' : 'false'),
|
||||
'nickname' => $profile['nickname'],
|
||||
'fullname' => $profile['name'],
|
||||
@@ -879,7 +877,7 @@ class Profile
|
||||
}
|
||||
|
||||
if ($a->profile['uid'] == local_user()) {
|
||||
$profile['edit'] = [System::baseUrl() . '/profiles/' . $a->profile['id'], L10n::t('Edit profile'), '', L10n::t('Edit profile')];
|
||||
$profile['edit'] = [DI::baseUrl() . '/profiles/' . $a->profile['id'], L10n::t('Edit profile'), '', L10n::t('Edit profile')];
|
||||
}
|
||||
|
||||
return Renderer::replaceMacros($tpl, [
|
||||
@@ -907,7 +905,7 @@ class Profile
|
||||
$nickname = $a->user['nickname'];
|
||||
}
|
||||
|
||||
$baseProfileUrl = System::baseUrl() . '/profile/' . $nickname;
|
||||
$baseProfileUrl = DI::baseUrl() . '/profile/' . $nickname;
|
||||
|
||||
$tabs = [
|
||||
[
|
||||
@@ -928,7 +926,7 @@ class Profile
|
||||
],
|
||||
[
|
||||
'label' => L10n::t('Photos'),
|
||||
'url' => System::baseUrl() . '/photos/' . $nickname,
|
||||
'url' => DI::baseUrl() . '/photos/' . $nickname,
|
||||
'sel' => $current == 'photos' ? 'active' : '',
|
||||
'title' => L10n::t('Photo Albums'),
|
||||
'id' => 'photo-tab',
|
||||
@@ -936,7 +934,7 @@ class Profile
|
||||
],
|
||||
[
|
||||
'label' => L10n::t('Videos'),
|
||||
'url' => System::baseUrl() . '/videos/' . $nickname,
|
||||
'url' => DI::baseUrl() . '/videos/' . $nickname,
|
||||
'sel' => $current == 'videos' ? 'active' : '',
|
||||
'title' => L10n::t('Videos'),
|
||||
'id' => 'video-tab',
|
||||
@@ -948,7 +946,7 @@ class Profile
|
||||
if ($is_owner && $a->theme_events_in_profile) {
|
||||
$tabs[] = [
|
||||
'label' => L10n::t('Events'),
|
||||
'url' => System::baseUrl() . '/events',
|
||||
'url' => DI::baseUrl() . '/events',
|
||||
'sel' => $current == 'events' ? 'active' : '',
|
||||
'title' => L10n::t('Events and Calendar'),
|
||||
'id' => 'events-tab',
|
||||
@@ -959,7 +957,7 @@ class Profile
|
||||
} elseif (!$is_owner) {
|
||||
$tabs[] = [
|
||||
'label' => L10n::t('Events'),
|
||||
'url' => System::baseUrl() . '/cal/' . $nickname,
|
||||
'url' => DI::baseUrl() . '/cal/' . $nickname,
|
||||
'sel' => $current == 'cal' ? 'active' : '',
|
||||
'title' => L10n::t('Events and Calendar'),
|
||||
'id' => 'events-tab',
|
||||
@@ -970,7 +968,7 @@ class Profile
|
||||
if ($is_owner) {
|
||||
$tabs[] = [
|
||||
'label' => L10n::t('Personal Notes'),
|
||||
'url' => System::baseUrl() . '/notes',
|
||||
'url' => DI::baseUrl() . '/notes',
|
||||
'sel' => $current == 'notes' ? 'active' : '',
|
||||
'title' => L10n::t('Only You Can See This'),
|
||||
'id' => 'notes-tab',
|
||||
@@ -981,7 +979,7 @@ class Profile
|
||||
if (!empty($_SESSION['new_member']) && $is_owner) {
|
||||
$tabs[] = [
|
||||
'label' => L10n::t('Tips for New Members'),
|
||||
'url' => System::baseUrl() . '/newmember',
|
||||
'url' => DI::baseUrl() . '/newmember',
|
||||
'sel' => false,
|
||||
'title' => L10n::t('Tips for New Members'),
|
||||
'id' => 'newmember-tab',
|
||||
|
||||
+3
-3
@@ -6,8 +6,8 @@ namespace Friendica\Model;
|
||||
|
||||
use Friendica\Core\Cache;
|
||||
use Friendica\Core\Logger;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\DI;
|
||||
use Friendica\Util\Strings;
|
||||
|
||||
/**
|
||||
@@ -208,7 +208,7 @@ class Term
|
||||
*/
|
||||
public static function insertFromTagFieldByItemId($item_id, $tag_str)
|
||||
{
|
||||
$profile_base = System::baseUrl();
|
||||
$profile_base = DI::baseUrl();
|
||||
$profile_data = parse_url($profile_base);
|
||||
$profile_path = $profile_data['path'] ?? '';
|
||||
$profile_base_friendica = $profile_data['host'] . $profile_path . '/profile/';
|
||||
@@ -425,7 +425,7 @@ class Term
|
||||
'implicit_mentions' => [],
|
||||
];
|
||||
|
||||
$searchpath = System::baseUrl() . "/search?tag=";
|
||||
$searchpath = DI::baseUrl() . "/search?tag=";
|
||||
|
||||
$taglist = DBA::select(
|
||||
'term',
|
||||
|
||||
+5
-5
@@ -217,12 +217,12 @@ class User
|
||||
// Check if the returned data is valid, otherwise fix it. See issue #6122
|
||||
|
||||
// Check for correct url and normalised nurl
|
||||
$url = System::baseUrl() . '/profile/' . $r['nickname'];
|
||||
$url = DI::baseUrl() . '/profile/' . $r['nickname'];
|
||||
$repair = ($r['url'] != $url) || ($r['nurl'] != Strings::normaliseLink($r['url']));
|
||||
|
||||
if (!$repair) {
|
||||
// Check if "addr" is present and correct
|
||||
$addr = $r['nickname'] . '@' . substr(System::baseUrl(), strpos(System::baseUrl(), '://') + 3);
|
||||
$addr = $r['nickname'] . '@' . substr(DI::baseUrl(), strpos(DI::baseUrl(), '://') + 3);
|
||||
$repair = ($addr != $r['addr']);
|
||||
}
|
||||
|
||||
@@ -635,7 +635,7 @@ class User
|
||||
|
||||
$openid = new LightOpenID(DI::baseUrl()->getHostname());
|
||||
$openid->identity = $openid_url;
|
||||
$openid->returnUrl = System::baseUrl() . '/openid';
|
||||
$openid->returnUrl = DI::baseUrl() . '/openid';
|
||||
$openid->required = ['namePerson/friendly', 'contact/email', 'namePerson'];
|
||||
$openid->optional = ['namePerson/first', 'media/image/aspect11', 'media/image/default'];
|
||||
try {
|
||||
@@ -782,8 +782,8 @@ class User
|
||||
$insert_result = DBA::insert('profile', [
|
||||
'uid' => $uid,
|
||||
'name' => $username,
|
||||
'photo' => System::baseUrl() . "/photo/profile/{$uid}.jpg",
|
||||
'thumb' => System::baseUrl() . "/photo/avatar/{$uid}.jpg",
|
||||
'photo' => DI::baseUrl() . "/photo/profile/{$uid}.jpg",
|
||||
'thumb' => DI::baseUrl() . "/photo/avatar/{$uid}.jpg",
|
||||
'publish' => $publish,
|
||||
'is-default' => 1,
|
||||
'net-publish' => $netpublish,
|
||||
|
||||
@@ -14,7 +14,6 @@ use Friendica\Core\Hook;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\Protocol;
|
||||
use Friendica\Core\Renderer;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Core\Worker;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\DI;
|
||||
@@ -970,7 +969,7 @@ class Contact extends BaseModule
|
||||
$profiledata = Model\Contact::getDetailsByURL($contact['url']);
|
||||
|
||||
if (local_user() && in_array($profiledata['network'], Protocol::FEDERATED)) {
|
||||
$profiledata['remoteconnect'] = System::baseUrl() . '/follow?url=' . urlencode($profiledata['url']);
|
||||
$profiledata['remoteconnect'] = DI::baseUrl() . '/follow?url=' . urlencode($profiledata['url']);
|
||||
}
|
||||
|
||||
Model\Profile::load($a, '', 0, $profiledata, true);
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
namespace Friendica\Module;
|
||||
|
||||
use Friendica\BaseModule;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\DI;
|
||||
use Friendica\Model\Item;
|
||||
@@ -38,7 +37,7 @@ class Objects extends BaseModule
|
||||
// If no original post could be found, it could possibly be a forum post, there we remove the "origin" field.
|
||||
// @TODO: Replace with parameter from router
|
||||
$item = Item::selectFirst(['id', 'author-link'], ['guid' => $a->argv[1], 'private' => false]);
|
||||
if (!DBA::isResult($item) || !strstr($item['author-link'], System::baseUrl())) {
|
||||
if (!DBA::isResult($item) || !strstr($item['author-link'], DI::baseUrl())) {
|
||||
throw new \Friendica\Network\HTTPException\NotFoundException();
|
||||
}
|
||||
}
|
||||
|
||||
+10
-10
@@ -118,19 +118,19 @@ class Profile extends BaseModule
|
||||
$page['htmlhead'] .= '<meta content="noindex, noarchive" name="robots" />' . "\n";
|
||||
}
|
||||
|
||||
$page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . System::baseUrl() . '/dfrn_poll/' . self::$which . '" title="DFRN: ' . L10n::t('%s\'s timeline', $a->profile['username']) . '"/>' . "\n";
|
||||
$page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . System::baseUrl() . '/feed/' . self::$which . '/" title="' . L10n::t('%s\'s posts', $a->profile['username']) . '"/>' . "\n";
|
||||
$page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . System::baseUrl() . '/feed/' . self::$which . '/comments" title="' . L10n::t('%s\'s comments', $a->profile['username']) . '"/>' . "\n";
|
||||
$page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . System::baseUrl() . '/feed/' . self::$which . '/activity" title="' . L10n::t('%s\'s timeline', $a->profile['username']) . '"/>' . "\n";
|
||||
$page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . DI::baseUrl() . '/dfrn_poll/' . self::$which . '" title="DFRN: ' . L10n::t('%s\'s timeline', $a->profile['username']) . '"/>' . "\n";
|
||||
$page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . DI::baseUrl() . '/feed/' . self::$which . '/" title="' . L10n::t('%s\'s posts', $a->profile['username']) . '"/>' . "\n";
|
||||
$page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . DI::baseUrl() . '/feed/' . self::$which . '/comments" title="' . L10n::t('%s\'s comments', $a->profile['username']) . '"/>' . "\n";
|
||||
$page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . DI::baseUrl() . '/feed/' . self::$which . '/activity" title="' . L10n::t('%s\'s timeline', $a->profile['username']) . '"/>' . "\n";
|
||||
$uri = urlencode('acct:' . $a->profile['nickname'] . '@' . DI::baseUrl()->getHostname() . (DI::baseUrl()->getUrlPath() ? '/' . DI::baseUrl()->getUrlPath() : ''));
|
||||
$page['htmlhead'] .= '<link rel="lrdd" type="application/xrd+xml" href="' . System::baseUrl() . '/xrd/?uri=' . $uri . '" />' . "\n";
|
||||
header('Link: <' . System::baseUrl() . '/xrd/?uri=' . $uri . '>; rel="lrdd"; type="application/xrd+xml"', false);
|
||||
$page['htmlhead'] .= '<link rel="lrdd" type="application/xrd+xml" href="' . DI::baseUrl() . '/xrd/?uri=' . $uri . '" />' . "\n";
|
||||
header('Link: <' . DI::baseUrl() . '/xrd/?uri=' . $uri . '>; rel="lrdd"; type="application/xrd+xml"', false);
|
||||
|
||||
$dfrn_pages = ['request', 'confirm', 'notify', 'poll'];
|
||||
foreach ($dfrn_pages as $dfrn) {
|
||||
$page['htmlhead'] .= '<link rel="dfrn-' . $dfrn . '" href="' . System::baseUrl() . '/dfrn_' . $dfrn . '/' . self::$which . '" />' . "\n";
|
||||
$page['htmlhead'] .= '<link rel="dfrn-' . $dfrn . '" href="' . DI::baseUrl() . '/dfrn_' . $dfrn . '/' . self::$which . '" />' . "\n";
|
||||
}
|
||||
$page['htmlhead'] .= '<link rel="dfrn-poco" href="' . System::baseUrl() . '/poco/' . self::$which . '" />' . "\n";
|
||||
$page['htmlhead'] .= '<link rel="dfrn-poco" href="' . DI::baseUrl() . '/poco/' . self::$which . '" />' . "\n";
|
||||
}
|
||||
|
||||
$category = $datequery = $datequery2 = '';
|
||||
@@ -193,8 +193,8 @@ class Profile extends BaseModule
|
||||
$commpage = $a->profile['page-flags'] == User::PAGE_FLAGS_COMMUNITY;
|
||||
$commvisitor = $commpage && $remote_contact;
|
||||
|
||||
DI::page()['aside'] .= Widget::postedByYear(System::baseUrl(true) . '/profile/' . $a->profile['nickname'], $a->profile['profile_uid'] ?? 0, true);
|
||||
DI::page()['aside'] .= Widget::categories(System::baseUrl(true) . '/profile/' . $a->profile['nickname'], XML::escape($category));
|
||||
DI::page()['aside'] .= Widget::postedByYear(DI::baseUrl()->get(true) . '/profile/' . $a->profile['nickname'], $a->profile['profile_uid'] ?? 0, true);
|
||||
DI::page()['aside'] .= Widget::categories(DI::baseUrl()->get(true) . '/profile/' . $a->profile['nickname'], XML::escape($category));
|
||||
DI::page()['aside'] .= Widget::tagCloud();
|
||||
|
||||
if (Security::canWriteToUserWall($a->profile['profile_uid'])) {
|
||||
|
||||
@@ -8,7 +8,6 @@ use Friendica\Core\L10n;
|
||||
use Friendica\Core\Protocol;
|
||||
use Friendica\Core\Renderer;
|
||||
use Friendica\Core\Session;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\DI;
|
||||
use Friendica\Model\User;
|
||||
@@ -71,7 +70,7 @@ class Delegation extends BaseSettingsModule
|
||||
if (DBA::isResult($user)) {
|
||||
$condition = [
|
||||
'uid' => local_user(),
|
||||
'nurl' => Strings::normaliseLink(System::baseUrl() . '/profile/' . $user['nickname'])
|
||||
'nurl' => Strings::normaliseLink(DI::baseUrl() . '/profile/' . $user['nickname'])
|
||||
];
|
||||
if (DBA::exists('contact', $condition)) {
|
||||
DBA::insert('manage', ['uid' => $user_id, 'mid' => local_user()]);
|
||||
@@ -109,7 +108,7 @@ class Delegation extends BaseSettingsModule
|
||||
['nurl'],
|
||||
[
|
||||
"`self` = 0 AND SUBSTRING_INDEX(`nurl`, '/', 3) = ? AND `uid` = ? AND `network` = ?",
|
||||
Strings::normaliseLink(System::baseUrl()),
|
||||
Strings::normaliseLink(DI::baseUrl()),
|
||||
local_user(),
|
||||
Protocol::DFRN,
|
||||
]
|
||||
@@ -158,7 +157,7 @@ class Delegation extends BaseSettingsModule
|
||||
'$submit' => L10n::t('Save Settings'),
|
||||
'$header' => L10n::t('Delegate Page Management'),
|
||||
'$delegates_header' => L10n::t('Delegates'),
|
||||
'$base' => System::baseUrl(),
|
||||
'$base' => DI::baseUrl(),
|
||||
'$desc' => L10n::t('Delegates are able to manage all aspects of this account/page except for basic account settings. Please do not delegate your personal account to anybody that you do not trust completely.'),
|
||||
'$head_delegates' => L10n::t('Existing Page Delegates'),
|
||||
'$delegates' => $delegates,
|
||||
|
||||
@@ -6,12 +6,9 @@
|
||||
namespace Friendica\Module\Settings;
|
||||
|
||||
use Friendica\App;
|
||||
use Friendica\App\Arguments;
|
||||
use Friendica\BaseModule;
|
||||
use Friendica\Core\Hook;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\Renderer;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\Database\DBStructure;
|
||||
use Friendica\DI;
|
||||
@@ -196,7 +193,7 @@ class UserExport extends BaseSettingsModule
|
||||
$output = [
|
||||
'version' => FRIENDICA_VERSION,
|
||||
'schema' => DB_UPDATE_VERSION,
|
||||
'baseurl' => System::baseUrl(),
|
||||
'baseurl' => DI::baseUrl(),
|
||||
'user' => $user,
|
||||
'contact' => $contact,
|
||||
'profile' => $profile,
|
||||
|
||||
+2
-3
@@ -12,7 +12,6 @@ use Friendica\BaseModule;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\Renderer;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Content\Text\BBCode;
|
||||
use Friendica\DI;
|
||||
|
||||
@@ -35,7 +34,7 @@ class Tos extends BaseModule
|
||||
{
|
||||
$this->privacy_operate = L10n::t('At the time of registration, and for providing communications between the user account and their contacts, the user has to provide a display name (pen name), an username (nickname) and a working email address. The names will be accessible on the profile page of the account by any visitor of the page, even if other profile details are not displayed. The email address will only be used to send the user notifications about interactions, but wont be visibly displayed. The listing of an account in the node\'s user directory or the global user directory is optional and can be controlled in the user settings, it is not necessary for communication.');
|
||||
$this->privacy_distribute = L10n::t('This data is required for communication and is passed on to the nodes of the communication partners and is stored there. Users can enter additional private data that may be transmitted to the communication partners accounts.');
|
||||
$this->privacy_delete = L10n::t('At any point in time a logged in user can export their account data from the <a href="%1$s/settings/userexport">account settings</a>. If the user wants to delete their account they can do so at <a href="%1$s/removeme">%1$s/removeme</a>. The deletion of the account will be permanent. Deletion of the data will also be requested from the nodes of the communication partners.', System::baseurl());
|
||||
$this->privacy_delete = L10n::t('At any point in time a logged in user can export their account data from the <a href="%1$s/settings/userexport">account settings</a>. If the user wants to delete their account they can do so at <a href="%1$s/removeme">%1$s/removeme</a>. The deletion of the account will be permanent. Deletion of the data will also be requested from the nodes of the communication partners.', DI::baseurl());
|
||||
// In some cases we don't need every single one of the above separate, but all in one block.
|
||||
// So here is an array to look over
|
||||
$this->privacy_complete = [L10n::t('Privacy Statement'), $this->privacy_operate, $this->privacy_distribute, $this->privacy_delete];
|
||||
@@ -77,7 +76,7 @@ class Tos extends BaseModule
|
||||
'$privstatementtitle' => L10n::t('Privacy Statement'),
|
||||
'$privacy_operate' => L10n::t('At the time of registration, and for providing communications between the user account and their contacts, the user has to provide a display name (pen name), an username (nickname) and a working email address. The names will be accessible on the profile page of the account by any visitor of the page, even if other profile details are not displayed. The email address will only be used to send the user notifications about interactions, but wont be visibly displayed. The listing of an account in the node\'s user directory or the global user directory is optional and can be controlled in the user settings, it is not necessary for communication.'),
|
||||
'$privacy_distribute' => L10n::t('This data is required for communication and is passed on to the nodes of the communication partners and is stored there. Users can enter additional private data that may be transmitted to the communication partners accounts.'),
|
||||
'$privacy_delete' => L10n::t('At any point in time a logged in user can export their account data from the <a href="%1$s/settings/userexport">account settings</a>. If the user wants to delete their account they can do so at <a href="%1$s/removeme">%1$s/removeme</a>. The deletion of the account will be permanent. Deletion of the data will also be requested from the nodes of the communication partners.', System::baseurl())
|
||||
'$privacy_delete' => L10n::t('At any point in time a logged in user can export their account data from the <a href="%1$s/settings/userexport">account settings</a>. If the user wants to delete their account they can do so at <a href="%1$s/removeme">%1$s/removeme</a>. The deletion of the account will be permanent. Deletion of the data will also be requested from the nodes of the communication partners.', DI::baseurl())
|
||||
]);
|
||||
} else {
|
||||
return;
|
||||
|
||||
@@ -15,7 +15,6 @@ use Friendica\Core\Cache;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\Logger;
|
||||
use Friendica\Core\Protocol;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\DI;
|
||||
use Friendica\Model\Contact;
|
||||
@@ -373,7 +372,7 @@ class Probe
|
||||
if (!empty($data['photo']) && !empty($data['baseurl'])) {
|
||||
$data['baseurl'] = Network::getUrlMatch(Strings::normaliseLink($data['baseurl']), Strings::normaliseLink($data['photo']));
|
||||
} elseif (empty($data['photo'])) {
|
||||
$data['photo'] = System::baseUrl() . '/images/person-300.jpg';
|
||||
$data['photo'] = DI::baseUrl() . '/images/person-300.jpg';
|
||||
}
|
||||
|
||||
if (empty($data['name'])) {
|
||||
|
||||
@@ -60,7 +60,7 @@ class Transmitter
|
||||
$count = DBA::count('contact', $condition);
|
||||
|
||||
$data = ['@context' => ActivityPub::CONTEXT];
|
||||
$data['id'] = System::baseUrl() . '/followers/' . $owner['nickname'];
|
||||
$data['id'] = DI::baseUrl() . '/followers/' . $owner['nickname'];
|
||||
$data['type'] = 'OrderedCollection';
|
||||
$data['totalItems'] = $count;
|
||||
|
||||
@@ -71,7 +71,7 @@ class Transmitter
|
||||
}
|
||||
|
||||
if (empty($page)) {
|
||||
$data['first'] = System::baseUrl() . '/followers/' . $owner['nickname'] . '?page=1';
|
||||
$data['first'] = DI::baseUrl() . '/followers/' . $owner['nickname'] . '?page=1';
|
||||
} else {
|
||||
$data['type'] = 'OrderedCollectionPage';
|
||||
$list = [];
|
||||
@@ -82,10 +82,10 @@ class Transmitter
|
||||
}
|
||||
|
||||
if (!empty($list)) {
|
||||
$data['next'] = System::baseUrl() . '/followers/' . $owner['nickname'] . '?page=' . ($page + 1);
|
||||
$data['next'] = DI::baseUrl() . '/followers/' . $owner['nickname'] . '?page=' . ($page + 1);
|
||||
}
|
||||
|
||||
$data['partOf'] = System::baseUrl() . '/followers/' . $owner['nickname'];
|
||||
$data['partOf'] = DI::baseUrl() . '/followers/' . $owner['nickname'];
|
||||
|
||||
$data['orderedItems'] = $list;
|
||||
}
|
||||
@@ -109,7 +109,7 @@ class Transmitter
|
||||
$count = DBA::count('contact', $condition);
|
||||
|
||||
$data = ['@context' => ActivityPub::CONTEXT];
|
||||
$data['id'] = System::baseUrl() . '/following/' . $owner['nickname'];
|
||||
$data['id'] = DI::baseUrl() . '/following/' . $owner['nickname'];
|
||||
$data['type'] = 'OrderedCollection';
|
||||
$data['totalItems'] = $count;
|
||||
|
||||
@@ -120,7 +120,7 @@ class Transmitter
|
||||
}
|
||||
|
||||
if (empty($page)) {
|
||||
$data['first'] = System::baseUrl() . '/following/' . $owner['nickname'] . '?page=1';
|
||||
$data['first'] = DI::baseUrl() . '/following/' . $owner['nickname'] . '?page=1';
|
||||
} else {
|
||||
$data['type'] = 'OrderedCollectionPage';
|
||||
$list = [];
|
||||
@@ -131,10 +131,10 @@ class Transmitter
|
||||
}
|
||||
|
||||
if (!empty($list)) {
|
||||
$data['next'] = System::baseUrl() . '/following/' . $owner['nickname'] . '?page=' . ($page + 1);
|
||||
$data['next'] = DI::baseUrl() . '/following/' . $owner['nickname'] . '?page=' . ($page + 1);
|
||||
}
|
||||
|
||||
$data['partOf'] = System::baseUrl() . '/following/' . $owner['nickname'];
|
||||
$data['partOf'] = DI::baseUrl() . '/following/' . $owner['nickname'];
|
||||
|
||||
$data['orderedItems'] = $list;
|
||||
}
|
||||
@@ -162,12 +162,12 @@ class Transmitter
|
||||
$count = DBA::count('item', $condition);
|
||||
|
||||
$data = ['@context' => ActivityPub::CONTEXT];
|
||||
$data['id'] = System::baseUrl() . '/outbox/' . $owner['nickname'];
|
||||
$data['id'] = DI::baseUrl() . '/outbox/' . $owner['nickname'];
|
||||
$data['type'] = 'OrderedCollection';
|
||||
$data['totalItems'] = $count;
|
||||
|
||||
if (empty($page)) {
|
||||
$data['first'] = System::baseUrl() . '/outbox/' . $owner['nickname'] . '?page=1';
|
||||
$data['first'] = DI::baseUrl() . '/outbox/' . $owner['nickname'] . '?page=1';
|
||||
} else {
|
||||
$data['type'] = 'OrderedCollectionPage';
|
||||
$list = [];
|
||||
@@ -184,10 +184,10 @@ class Transmitter
|
||||
}
|
||||
|
||||
if (!empty($list)) {
|
||||
$data['next'] = System::baseUrl() . '/outbox/' . $owner['nickname'] . '?page=' . ($page + 1);
|
||||
$data['next'] = DI::baseUrl() . '/outbox/' . $owner['nickname'] . '?page=' . ($page + 1);
|
||||
}
|
||||
|
||||
$data['partOf'] = System::baseUrl() . '/outbox/' . $owner['nickname'];
|
||||
$data['partOf'] = DI::baseUrl() . '/outbox/' . $owner['nickname'];
|
||||
|
||||
$data['orderedItems'] = $list;
|
||||
}
|
||||
@@ -240,10 +240,10 @@ class Transmitter
|
||||
$data['id'] = $contact['url'];
|
||||
$data['diaspora:guid'] = $user['guid'];
|
||||
$data['type'] = ActivityPub::ACCOUNT_TYPES[$user['account-type']];
|
||||
$data['following'] = System::baseUrl() . '/following/' . $user['nickname'];
|
||||
$data['followers'] = System::baseUrl() . '/followers/' . $user['nickname'];
|
||||
$data['inbox'] = System::baseUrl() . '/inbox/' . $user['nickname'];
|
||||
$data['outbox'] = System::baseUrl() . '/outbox/' . $user['nickname'];
|
||||
$data['following'] = DI::baseUrl() . '/following/' . $user['nickname'];
|
||||
$data['followers'] = DI::baseUrl() . '/followers/' . $user['nickname'];
|
||||
$data['inbox'] = DI::baseUrl() . '/inbox/' . $user['nickname'];
|
||||
$data['outbox'] = DI::baseUrl() . '/outbox/' . $user['nickname'];
|
||||
$data['preferredUsername'] = $user['nickname'];
|
||||
$data['name'] = $contact['name'];
|
||||
$data['vcard:hasAddress'] = ['@type' => 'vcard:Home', 'vcard:country-name' => $profile['country-name'],
|
||||
@@ -254,7 +254,7 @@ class Transmitter
|
||||
$data['publicKey'] = ['id' => $contact['url'] . '#main-key',
|
||||
'owner' => $contact['url'],
|
||||
'publicKeyPem' => $user['pubkey']];
|
||||
$data['endpoints'] = ['sharedInbox' => System::baseUrl() . '/inbox'];
|
||||
$data['endpoints'] = ['sharedInbox' => DI::baseUrl() . '/inbox'];
|
||||
$data['icon'] = ['type' => 'Image',
|
||||
'url' => $contact['photo']];
|
||||
|
||||
@@ -273,7 +273,7 @@ class Transmitter
|
||||
{
|
||||
return [
|
||||
'@context' => ActivityPub::CONTEXT,
|
||||
'id' => System::baseUrl() . '/profile/' . $username,
|
||||
'id' => DI::baseUrl() . '/profile/' . $username,
|
||||
'type' => 'Tombstone',
|
||||
'published' => DateTimeFormat::utcNow(DateTimeFormat::ATOM),
|
||||
'updated' => DateTimeFormat::utcNow(DateTimeFormat::ATOM),
|
||||
@@ -983,7 +983,7 @@ class Transmitter
|
||||
$terms = Term::tagArrayFromItemId($item['id'], [Term::HASHTAG, Term::MENTION, Term::IMPLICIT_MENTION]);
|
||||
foreach ($terms as $term) {
|
||||
if ($term['type'] == Term::HASHTAG) {
|
||||
$url = System::baseUrl() . '/search?tag=' . urlencode($term['term']);
|
||||
$url = DI::baseUrl() . '/search?tag=' . urlencode($term['term']);
|
||||
$tags[] = ['type' => 'Hashtag', 'href' => $url, 'name' => '#' . $term['term']];
|
||||
} elseif ($term['type'] == Term::MENTION || $term['type'] == Term::IMPLICIT_MENTION) {
|
||||
$contact = Contact::getDetailsByURL($term['url']);
|
||||
@@ -1460,7 +1460,7 @@ class Transmitter
|
||||
|
||||
$hash = hash('ripemd128', $contact['uid'].'-'.$contact['id'].'-'.$contact['created']);
|
||||
$uuid = substr($hash, 0, 8). '-' . substr($hash, 8, 4) . '-' . substr($hash, 12, 4) . '-' . substr($hash, 16, 4) . '-' . substr($hash, 20, 12);
|
||||
return System::baseUrl() . '/activity/' . $uuid;
|
||||
return DI::baseUrl() . '/activity/' . $uuid;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1480,7 +1480,7 @@ class Transmitter
|
||||
$suggestion = DBA::selectFirst('fsuggest', ['url', 'note', 'created'], ['id' => $suggestion_id]);
|
||||
|
||||
$data = ['@context' => ActivityPub::CONTEXT,
|
||||
'id' => System::baseUrl() . '/activity/' . System::createGUID(),
|
||||
'id' => DI::baseUrl() . '/activity/' . System::createGUID(),
|
||||
'type' => 'Announce',
|
||||
'actor' => $owner['url'],
|
||||
'object' => $suggestion['url'],
|
||||
@@ -1509,7 +1509,7 @@ class Transmitter
|
||||
$owner = User::getOwnerDataById($uid);
|
||||
|
||||
$data = ['@context' => ActivityPub::CONTEXT,
|
||||
'id' => System::baseUrl() . '/activity/' . System::createGUID(),
|
||||
'id' => DI::baseUrl() . '/activity/' . System::createGUID(),
|
||||
'type' => 'dfrn:relocate',
|
||||
'actor' => $owner['url'],
|
||||
'object' => $owner['url'],
|
||||
@@ -1548,7 +1548,7 @@ class Transmitter
|
||||
}
|
||||
|
||||
$data = ['@context' => ActivityPub::CONTEXT,
|
||||
'id' => System::baseUrl() . '/activity/' . System::createGUID(),
|
||||
'id' => DI::baseUrl() . '/activity/' . System::createGUID(),
|
||||
'type' => 'Delete',
|
||||
'actor' => $owner['url'],
|
||||
'object' => $owner['url'],
|
||||
@@ -1579,7 +1579,7 @@ class Transmitter
|
||||
$profile = APContact::getByURL($owner['url']);
|
||||
|
||||
$data = ['@context' => ActivityPub::CONTEXT,
|
||||
'id' => System::baseUrl() . '/activity/' . System::createGUID(),
|
||||
'id' => DI::baseUrl() . '/activity/' . System::createGUID(),
|
||||
'type' => 'Update',
|
||||
'actor' => $owner['url'],
|
||||
'object' => self::getProfile($uid),
|
||||
@@ -1616,7 +1616,7 @@ class Transmitter
|
||||
$owner = User::getOwnerDataById($uid);
|
||||
|
||||
if (empty($id)) {
|
||||
$id = System::baseUrl() . '/activity/' . System::createGUID();
|
||||
$id = DI::baseUrl() . '/activity/' . System::createGUID();
|
||||
}
|
||||
|
||||
$data = ['@context' => ActivityPub::CONTEXT,
|
||||
@@ -1673,7 +1673,7 @@ class Transmitter
|
||||
$owner = User::getOwnerDataById($uid);
|
||||
|
||||
$data = ['@context' => ActivityPub::CONTEXT,
|
||||
'id' => System::baseUrl() . '/activity/' . System::createGUID(),
|
||||
'id' => DI::baseUrl() . '/activity/' . System::createGUID(),
|
||||
'type' => 'Follow',
|
||||
'actor' => $owner['url'],
|
||||
'object' => $object,
|
||||
@@ -1705,7 +1705,7 @@ class Transmitter
|
||||
|
||||
$owner = User::getOwnerDataById($uid);
|
||||
$data = ['@context' => ActivityPub::CONTEXT,
|
||||
'id' => System::baseUrl() . '/activity/' . System::createGUID(),
|
||||
'id' => DI::baseUrl() . '/activity/' . System::createGUID(),
|
||||
'type' => 'Accept',
|
||||
'actor' => $owner['url'],
|
||||
'object' => [
|
||||
@@ -1742,7 +1742,7 @@ class Transmitter
|
||||
|
||||
$owner = User::getOwnerDataById($uid);
|
||||
$data = ['@context' => ActivityPub::CONTEXT,
|
||||
'id' => System::baseUrl() . '/activity/' . System::createGUID(),
|
||||
'id' => DI::baseUrl() . '/activity/' . System::createGUID(),
|
||||
'type' => 'Reject',
|
||||
'actor' => $owner['url'],
|
||||
'object' => [
|
||||
@@ -1782,7 +1782,7 @@ class Transmitter
|
||||
return;
|
||||
}
|
||||
|
||||
$id = System::baseUrl() . '/activity/' . System::createGUID();
|
||||
$id = DI::baseUrl() . '/activity/' . System::createGUID();
|
||||
|
||||
$owner = User::getOwnerDataById($uid);
|
||||
$data = ['@context' => ActivityPub::CONTEXT,
|
||||
|
||||
+13
-14
@@ -18,7 +18,6 @@ use Friendica\Core\Config;
|
||||
use Friendica\Core\Hook;
|
||||
use Friendica\Core\Logger;
|
||||
use Friendica\Core\Protocol;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\DI;
|
||||
use Friendica\Model\Contact;
|
||||
@@ -506,7 +505,7 @@ class DFRN
|
||||
$ext = Images::supportedTypes();
|
||||
|
||||
foreach ($rp as $p) {
|
||||
$photos[$p['scale']] = System::baseUrl().'/photo/'.$p['resource-id'].'-'.$p['scale'].'.'.$ext[$p['type']];
|
||||
$photos[$p['scale']] = DI::baseUrl().'/photo/'.$p['resource-id'].'-'.$p['scale'].'.'.$ext[$p['type']];
|
||||
}
|
||||
|
||||
|
||||
@@ -568,7 +567,7 @@ class DFRN
|
||||
$root->setAttribute("xmlns:ostatus", ActivityNamespace::OSTATUS);
|
||||
$root->setAttribute("xmlns:statusnet", ActivityNamespace::STATUSNET);
|
||||
|
||||
XML::addElement($doc, $root, "id", System::baseUrl()."/profile/".$owner["nick"]);
|
||||
XML::addElement($doc, $root, "id", DI::baseUrl()."/profile/".$owner["nick"]);
|
||||
XML::addElement($doc, $root, "title", $owner["name"]);
|
||||
|
||||
$attributes = ["uri" => "https://friendi.ca", "version" => FRIENDICA_VERSION."-".DB_UPDATE_VERSION];
|
||||
@@ -585,13 +584,13 @@ class DFRN
|
||||
// DFRN itself doesn't uses this. But maybe someone else wants to subscribe to the public feed.
|
||||
OStatus::hublinks($doc, $root, $owner["nick"]);
|
||||
|
||||
$attributes = ["rel" => "salmon", "href" => System::baseUrl()."/salmon/".$owner["nick"]];
|
||||
$attributes = ["rel" => "salmon", "href" => DI::baseUrl()."/salmon/".$owner["nick"]];
|
||||
XML::addElement($doc, $root, "link", "", $attributes);
|
||||
|
||||
$attributes = ["rel" => "http://salmon-protocol.org/ns/salmon-replies", "href" => System::baseUrl()."/salmon/".$owner["nick"]];
|
||||
$attributes = ["rel" => "http://salmon-protocol.org/ns/salmon-replies", "href" => DI::baseUrl()."/salmon/".$owner["nick"]];
|
||||
XML::addElement($doc, $root, "link", "", $attributes);
|
||||
|
||||
$attributes = ["rel" => "http://salmon-protocol.org/ns/salmon-mention", "href" => System::baseUrl()."/salmon/".$owner["nick"]];
|
||||
$attributes = ["rel" => "http://salmon-protocol.org/ns/salmon-mention", "href" => DI::baseUrl()."/salmon/".$owner["nick"]];
|
||||
XML::addElement($doc, $root, "link", "", $attributes);
|
||||
}
|
||||
|
||||
@@ -652,7 +651,7 @@ class DFRN
|
||||
}
|
||||
|
||||
XML::addElement($doc, $author, "name", $owner["name"], $attributes);
|
||||
XML::addElement($doc, $author, "uri", System::baseUrl().'/profile/'.$owner["nickname"], $attributes);
|
||||
XML::addElement($doc, $author, "uri", DI::baseUrl().'/profile/'.$owner["nickname"], $attributes);
|
||||
XML::addElement($doc, $author, "dfrn:handle", $owner["addr"], $attributes);
|
||||
|
||||
$attributes = ["rel" => "photo", "type" => "image/jpeg",
|
||||
@@ -989,7 +988,7 @@ class DFRN
|
||||
}
|
||||
|
||||
// Add conversation data. This is used for OStatus
|
||||
$conversation_href = System::baseUrl()."/display/".$item["parent-guid"];
|
||||
$conversation_href = DI::baseUrl()."/display/".$item["parent-guid"];
|
||||
$conversation_uri = $conversation_href;
|
||||
|
||||
if (isset($parent_item)) {
|
||||
@@ -1030,7 +1029,7 @@ class DFRN
|
||||
"link",
|
||||
"",
|
||||
["rel" => "alternate", "type" => "text/html",
|
||||
"href" => System::baseUrl() . "/display/" . $item["guid"]]
|
||||
"href" => DI::baseUrl() . "/display/" . $item["guid"]]
|
||||
);
|
||||
|
||||
// "comment-allow" is some old fashioned stuff for old Friendica versions.
|
||||
@@ -1901,7 +1900,7 @@ class DFRN
|
||||
'to_email' => $importer['email'],
|
||||
'uid' => $importer['importer_uid'],
|
||||
'item' => $suggest,
|
||||
'link' => System::baseUrl().'/notifications/intros',
|
||||
'link' => DI::baseUrl().'/notifications/intros',
|
||||
'source_name' => $importer['name'],
|
||||
'source_link' => $importer['url'],
|
||||
'source_photo' => $importer['photo'],
|
||||
@@ -2129,7 +2128,7 @@ class DFRN
|
||||
}
|
||||
}
|
||||
|
||||
if ($Blink && Strings::compareLink($Blink, System::baseUrl() . "/profile/" . $importer["nickname"])) {
|
||||
if ($Blink && Strings::compareLink($Blink, DI::baseUrl() . "/profile/" . $importer["nickname"])) {
|
||||
$author = DBA::selectFirst('contact', ['name', 'thumb', 'url'], ['id' => $item['author-id']]);
|
||||
|
||||
$parent = Item::selectFirst(['id'], ['uri' => $item['parent-uri'], 'uid' => $importer["importer_uid"]]);
|
||||
@@ -2145,7 +2144,7 @@ class DFRN
|
||||
"to_email" => $importer["email"],
|
||||
"uid" => $importer["importer_uid"],
|
||||
"item" => $item,
|
||||
"link" => System::baseUrl()."/display/".urlencode($item['guid']),
|
||||
"link" => DI::baseUrl()."/display/".urlencode($item['guid']),
|
||||
"source_name" => $author["name"],
|
||||
"source_link" => $author["url"],
|
||||
"source_photo" => $author["thumb"],
|
||||
@@ -2886,13 +2885,13 @@ class DFRN
|
||||
$community_page = ($user['page-flags'] == User::PAGE_FLAGS_COMMUNITY);
|
||||
$prvgroup = ($user['page-flags'] == User::PAGE_FLAGS_PRVGROUP);
|
||||
|
||||
$link = Strings::normaliseLink(System::baseUrl() . '/profile/' . $user['nickname']);
|
||||
$link = Strings::normaliseLink(DI::baseUrl() . '/profile/' . $user['nickname']);
|
||||
|
||||
/*
|
||||
* Diaspora uses their own hardwired link URL in @-tags
|
||||
* instead of the one we supply with webfinger
|
||||
*/
|
||||
$dlink = Strings::normaliseLink(System::baseUrl() . '/u/' . $user['nickname']);
|
||||
$dlink = Strings::normaliseLink(DI::baseUrl() . '/u/' . $user['nickname']);
|
||||
|
||||
$cnt = preg_match_all('/[\@\!]\[url\=(.*?)\](.*?)\[\/url\]/ism', $item['body'], $matches, PREG_SET_ORDER);
|
||||
if ($cnt) {
|
||||
|
||||
@@ -22,17 +22,16 @@ use Friendica\Core\Protocol;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Core\Worker;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\DI;
|
||||
use Friendica\Model\Contact;
|
||||
use Friendica\Model\Conversation;
|
||||
use Friendica\Model\GContact;
|
||||
use Friendica\Model\Group;
|
||||
use Friendica\Model\Item;
|
||||
use Friendica\Model\ItemDeliveryData;
|
||||
use Friendica\Model\Mail;
|
||||
use Friendica\Model\Profile;
|
||||
use Friendica\Model\User;
|
||||
use Friendica\Network\Probe;
|
||||
use Friendica\Protocol\ActivityNamespace;
|
||||
use Friendica\Util\Crypto;
|
||||
use Friendica\Util\DateTimeFormat;
|
||||
use Friendica\Util\Map;
|
||||
@@ -145,7 +144,7 @@ class Diaspora
|
||||
// Now we are collecting all relay contacts
|
||||
foreach ($serverlist as $server_url) {
|
||||
// We don't send messages to ourselves
|
||||
if (Strings::compareLink($server_url, System::baseUrl())) {
|
||||
if (Strings::compareLink($server_url, DI::baseUrl())) {
|
||||
continue;
|
||||
}
|
||||
$contact = self::getRelayContact($server_url);
|
||||
@@ -2670,7 +2669,7 @@ class Diaspora
|
||||
return false;
|
||||
}
|
||||
|
||||
$orig_url = System::baseUrl()."/display/".$original_item["guid"];
|
||||
$orig_url = DI::baseUrl()."/display/".$original_item["guid"];
|
||||
|
||||
$datarray = [];
|
||||
|
||||
@@ -2996,7 +2995,7 @@ class Diaspora
|
||||
$nick = $contact["nick"];
|
||||
}
|
||||
|
||||
return $nick . "@" . substr(System::baseUrl(), strpos(System::baseUrl(), "://") + 3);
|
||||
return $nick . "@" . substr(DI::baseUrl(), strpos(DI::baseUrl(), "://") + 3);
|
||||
}
|
||||
|
||||
|
||||
@@ -4117,9 +4116,9 @@ class Diaspora
|
||||
$first = $split_name['first'];
|
||||
$last = $split_name['last'];
|
||||
|
||||
$large = System::baseUrl().'/photo/custom/300/'.$profile['uid'].'.jpg';
|
||||
$medium = System::baseUrl().'/photo/custom/100/'.$profile['uid'].'.jpg';
|
||||
$small = System::baseUrl().'/photo/custom/50/' .$profile['uid'].'.jpg';
|
||||
$large = DI::baseUrl().'/photo/custom/300/'.$profile['uid'].'.jpg';
|
||||
$medium = DI::baseUrl().'/photo/custom/100/'.$profile['uid'].'.jpg';
|
||||
$small = DI::baseUrl().'/photo/custom/50/' .$profile['uid'].'.jpg';
|
||||
$searchable = (($profile['publish'] && $profile['net-publish']) ? 'true' : 'false');
|
||||
|
||||
$dob = null;
|
||||
|
||||
@@ -11,11 +11,9 @@ use DOMXPath;
|
||||
use Friendica\Content\Text\HTML;
|
||||
use Friendica\Core\Logger;
|
||||
use Friendica\Core\Protocol;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\DI;
|
||||
use Friendica\Model\Item;
|
||||
use Friendica\Protocol\ActivityNamespace;
|
||||
use Friendica\Util\ParseUrl;
|
||||
use Friendica\Util\Network;
|
||||
use Friendica\Util\XML;
|
||||
@@ -353,7 +351,7 @@ class Feed {
|
||||
$tags .= ', ';
|
||||
}
|
||||
|
||||
$taglink = "#[url=" . System::baseUrl() . "/search?tag=" . $hashtag . "]" . $hashtag . "[/url]";
|
||||
$taglink = "#[url=" . DI::baseUrl() . "/search?tag=" . $hashtag . "]" . $hashtag . "[/url]";
|
||||
$tags .= $taglink;
|
||||
}
|
||||
|
||||
|
||||
+10
-13
@@ -15,7 +15,6 @@ use Friendica\Core\Lock;
|
||||
use Friendica\Core\Logger;
|
||||
use Friendica\Core\PConfig;
|
||||
use Friendica\Core\Protocol;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\DI;
|
||||
use Friendica\Model\APContact;
|
||||
@@ -25,8 +24,6 @@ use Friendica\Model\GContact;
|
||||
use Friendica\Model\Item;
|
||||
use Friendica\Model\User;
|
||||
use Friendica\Network\Probe;
|
||||
use Friendica\Object\Image;
|
||||
use Friendica\Protocol\ActivityNamespace;
|
||||
use Friendica\Util\DateTimeFormat;
|
||||
use Friendica\Util\Images;
|
||||
use Friendica\Util\Network;
|
||||
@@ -649,7 +646,7 @@ class OStatus
|
||||
$item['tag'] = '';
|
||||
}
|
||||
|
||||
$item['tag'] .= '#[url=' . System::baseUrl() . '/search?tag=' . $term . ']' . $term . '[/url]';
|
||||
$item['tag'] .= '#[url=' . DI::baseUrl() . '/search?tag=' . $term . ']' . $term . '[/url]';
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1293,7 +1290,7 @@ class OStatus
|
||||
|
||||
$attributes = ["uri" => "https://friendi.ca", "version" => FRIENDICA_VERSION . "-" . DB_UPDATE_VERSION];
|
||||
XML::addElement($doc, $root, "generator", FRIENDICA_PLATFORM, $attributes);
|
||||
XML::addElement($doc, $root, "id", System::baseUrl() . "/profile/" . $owner["nick"]);
|
||||
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"], Config::get('config', 'sitename')));
|
||||
XML::addElement($doc, $root, "logo", $owner["photo"]);
|
||||
@@ -1313,16 +1310,16 @@ class OStatus
|
||||
|
||||
self::hublinks($doc, $root, $owner["nick"]);
|
||||
|
||||
$attributes = ["href" => System::baseUrl() . "/salmon/" . $owner["nick"], "rel" => "salmon"];
|
||||
$attributes = ["href" => DI::baseUrl() . "/salmon/" . $owner["nick"], "rel" => "salmon"];
|
||||
XML::addElement($doc, $root, "link", "", $attributes);
|
||||
|
||||
$attributes = ["href" => System::baseUrl() . "/salmon/" . $owner["nick"], "rel" => "http://salmon-protocol.org/ns/salmon-replies"];
|
||||
$attributes = ["href" => DI::baseUrl() . "/salmon/" . $owner["nick"], "rel" => "http://salmon-protocol.org/ns/salmon-replies"];
|
||||
XML::addElement($doc, $root, "link", "", $attributes);
|
||||
|
||||
$attributes = ["href" => System::baseUrl() . "/salmon/" . $owner["nick"], "rel" => "http://salmon-protocol.org/ns/salmon-mention"];
|
||||
$attributes = ["href" => DI::baseUrl() . "/salmon/" . $owner["nick"], "rel" => "http://salmon-protocol.org/ns/salmon-mention"];
|
||||
XML::addElement($doc, $root, "link", "", $attributes);
|
||||
|
||||
$attributes = ["href" => System::baseUrl() . $selfUri, "rel" => "self", "type" => "application/atom+xml"];
|
||||
$attributes = ["href" => DI::baseUrl() . $selfUri, "rel" => "self", "type" => "application/atom+xml"];
|
||||
XML::addElement($doc, $root, "link", "", $attributes);
|
||||
|
||||
if ($owner['account-type'] == Contact::TYPE_COMMUNITY) {
|
||||
@@ -1346,7 +1343,7 @@ class OStatus
|
||||
*/
|
||||
public static function hublinks(DOMDocument $doc, $root, $nick)
|
||||
{
|
||||
$h = System::baseUrl() . '/pubsubhubbub/'.$nick;
|
||||
$h = DI::baseUrl() . '/pubsubhubbub/'.$nick;
|
||||
XML::addElement($doc, $root, "link", "", ["href" => $h, "rel" => "hub"]);
|
||||
}
|
||||
|
||||
@@ -1492,7 +1489,7 @@ class OStatus
|
||||
$author->appendChild($urls);
|
||||
}
|
||||
|
||||
XML::addElement($doc, $author, "followers", "", ["url" => System::baseUrl() . "/profile/" . $owner["nick"] . "/contacts/followers"]);
|
||||
XML::addElement($doc, $author, "followers", "", ["url" => DI::baseUrl() . "/profile/" . $owner["nick"] . "/contacts/followers"]);
|
||||
XML::addElement($doc, $author, "statusnet:profile_info", "", ["local_id" => $owner["uid"]]);
|
||||
|
||||
if ($profile["publish"]) {
|
||||
@@ -1980,7 +1977,7 @@ class OStatus
|
||||
XML::addElement($doc, $entry, "content", $body, ["type" => "html"]);
|
||||
|
||||
XML::addElement($doc, $entry, "link", "", ["rel" => "alternate", "type" => "text/html",
|
||||
"href" => System::baseUrl()."/display/".$item["guid"]]
|
||||
"href" => DI::baseUrl()."/display/".$item["guid"]]
|
||||
);
|
||||
|
||||
if (!$feed_mode && $complete && ($item["id"] > 0)) {
|
||||
@@ -2024,7 +2021,7 @@ class OStatus
|
||||
} else {
|
||||
$mentioned[$parent["author-link"]] = $parent["author-link"];
|
||||
$mentioned[$parent["owner-link"]] = $parent["owner-link"];
|
||||
$parent_plink = System::baseUrl()."/display/".$parent["guid"];
|
||||
$parent_plink = DI::baseUrl()."/display/".$parent["guid"];
|
||||
}
|
||||
|
||||
$attributes = [
|
||||
|
||||
@@ -556,7 +556,7 @@ class Network
|
||||
Hook::callAll('avatar_lookup', $avatar);
|
||||
|
||||
if (! $avatar['success']) {
|
||||
$avatar['url'] = System::baseUrl() . '/images/person-300.jpg';
|
||||
$avatar['url'] = DI::baseUrl() . '/images/person-300.jpg';
|
||||
}
|
||||
|
||||
Logger::log('Avatar: ' . $avatar['email'] . ' ' . $avatar['url'], Logger::DEBUG);
|
||||
|
||||
+5
-6
@@ -3,7 +3,6 @@
|
||||
namespace Friendica\Util;
|
||||
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\DI;
|
||||
|
||||
/**
|
||||
@@ -76,7 +75,7 @@ class Proxy
|
||||
|
||||
// Only continue if it isn't a local image and the isn't deactivated
|
||||
if (self::isLocalImage($url)) {
|
||||
$url = str_replace(Strings::normaliseLink(System::baseUrl()) . '/', System::baseUrl() . '/', $url);
|
||||
$url = str_replace(Strings::normaliseLink(DI::baseUrl()) . '/', DI::baseUrl() . '/', $url);
|
||||
return $url;
|
||||
}
|
||||
|
||||
@@ -109,7 +108,7 @@ class Proxy
|
||||
$longpath .= '.' . $extension;
|
||||
}
|
||||
|
||||
$proxypath = System::baseUrl() . '/proxy/' . $longpath;
|
||||
$proxypath = DI::baseUrl() . '/proxy/' . $longpath;
|
||||
|
||||
if ($size != '') {
|
||||
$size = ':' . $size;
|
||||
@@ -120,7 +119,7 @@ class Proxy
|
||||
if ((strlen($proxypath) > 250) && $writemode) {
|
||||
return $shortpath;
|
||||
} elseif (strlen($proxypath) > 250) {
|
||||
return System::baseUrl() . '/proxy/' . $shortpath . '?url=' . urlencode($url);
|
||||
return DI::baseUrl() . '/proxy/' . $shortpath . '?url=' . urlencode($url);
|
||||
} elseif ($writemode) {
|
||||
return $longpath;
|
||||
} else {
|
||||
@@ -141,7 +140,7 @@ class Proxy
|
||||
*/
|
||||
public static function proxifyHtml($html)
|
||||
{
|
||||
$html = str_replace(Strings::normaliseLink(System::baseUrl()) . '/', System::baseUrl() . '/', $html);
|
||||
$html = str_replace(Strings::normaliseLink(DI::baseUrl()) . '/', DI::baseUrl() . '/', $html);
|
||||
|
||||
return preg_replace_callback('/(<img [^>]*src *= *["\'])([^"\']+)(["\'][^>]*>)/siU', 'self::replaceUrl', $html);
|
||||
}
|
||||
@@ -164,7 +163,7 @@ class Proxy
|
||||
}
|
||||
|
||||
// links normalised - bug #431
|
||||
$baseurl = Strings::normaliseLink(System::baseUrl());
|
||||
$baseurl = Strings::normaliseLink(DI::baseUrl());
|
||||
$url = Strings::normaliseLink($url);
|
||||
|
||||
return (substr($url, 0, strlen($baseurl)) == $baseurl);
|
||||
|
||||
@@ -8,7 +8,6 @@ use Friendica\Core\Config;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\Logger;
|
||||
use Friendica\Core\Protocol;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\DI;
|
||||
use Friendica\Model;
|
||||
@@ -292,7 +291,7 @@ class Delivery
|
||||
|
||||
// perform local delivery if we are on the same site
|
||||
|
||||
if (Strings::compareLink($basepath, System::baseUrl())) {
|
||||
if (Strings::compareLink($basepath, DI::baseUrl())) {
|
||||
$condition = ['nurl' => Strings::normaliseLink($contact['url']), 'self' => true];
|
||||
$target_self = DBA::selectFirst('contact', ['uid'], $condition);
|
||||
if (!DBA::isResult($target_self)) {
|
||||
|
||||
@@ -6,10 +6,9 @@
|
||||
namespace Friendica\Worker;
|
||||
|
||||
use Friendica\Core\Logger;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\DI;
|
||||
use Friendica\Model\PushSubscriber;
|
||||
use Friendica\Model\GServer;
|
||||
use Friendica\Protocol\OStatus;
|
||||
use Friendica\Util\Network;
|
||||
|
||||
@@ -47,7 +46,7 @@ class PubSubPublish
|
||||
|
||||
$headers = ["Content-type: application/atom+xml",
|
||||
sprintf("Link: <%s>;rel=hub,<%s>;rel=self",
|
||||
System::baseUrl() . '/pubsubhubbub/' . $subscriber['nickname'],
|
||||
DI::baseUrl() . '/pubsubhubbub/' . $subscriber['nickname'],
|
||||
$subscriber['topic']),
|
||||
"X-Hub-Signature: sha1=" . $hmac_sig];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user