Browse Source

App::get_baseurl is now replaced with System::baseUrl

pull/3658/head
Michael 4 years ago
parent
commit
5adfeb0bd5
  1. 29
      boot.php
  2. 14
      include/Contact.php
  3. 3
      include/ForumManager.php
  4. 24
      include/Photo.php
  5. 72
      include/Smilies.php
  6. 44
      include/api.php
  7. 14
      include/auth.php
  8. 4
      include/bb2diaspora.php
  9. 10
      include/bbcode.php
  10. 2
      include/contact_widgets.php
  11. 16
      include/conversation.php
  12. 4
      include/dbstructure.php
  13. 2
      include/delivery.php
  14. 24
      include/dfrn.php
  15. 14
      include/diaspora.php
  16. 10
      include/enotify.php
  17. 6
      include/event.php
  18. 2
      include/follow.php
  19. 30
      include/identity.php
  20. 34
      include/items.php
  21. 4
      include/like.php
  22. 10
      include/message.php
  23. 4
      include/nav.php
  24. 4
      include/network.php
  25. 2
      include/oauth.php
  26. 4
      include/oembed.php
  27. 24
      include/ostatus.php
  28. 4
      include/plugin.php
  29. 2
      include/poller.php
  30. 2
      include/pubsubpublish.php
  31. 2
      include/redir.php
  32. 8
      include/security.php
  33. 12
      include/socgraph.php
  34. 2
      include/tags.php
  35. 8
      include/text.php
  36. 2
      include/threads.php
  37. 4
      include/uimport.php
  38. 30
      include/user.php
  39. 10
      index.php
  40. 42
      mod/admin.php
  41. 2
      mod/allfriends.php
  42. 2
      mod/bookmarklet.php
  43. 12
      mod/cal.php
  44. 14
      mod/contacts.php
  45. 10
      mod/content.php
  46. 14
      mod/delegate.php
  47. 10
      mod/dfrn_confirm.php
  48. 16
      mod/dfrn_poll.php
  49. 28
      mod/dfrn_request.php
  50. 2
      mod/dirfind.php
  51. 10
      mod/display.php
  52. 6
      mod/editpost.php
  53. 22
      mod/events.php
  54. 10
      mod/fbrowser.php
  55. 2
      mod/fetch.php
  56. 2
      mod/filerm.php
  57. 6
      mod/follow.php
  58. 8
      mod/friendica.php
  59. 10
      mod/group.php
  60. 8
      mod/hcard.php
  61. 2
      mod/help.php
  62. 6
      mod/home.php
  63. 9
      mod/hostxrd.php
  64. 2
      mod/ignored.php
  65. 14
      mod/install.php
  66. 6
      mod/invite.php
  67. 20
      mod/item.php
  68. 2
      mod/like.php
  69. 2
      mod/localtime.php
  70. 3
      mod/login.php
  71. 16
      mod/lostpass.php
  72. 2
      mod/manage.php
  73. 2
      mod/manifest.php
  74. 6
      mod/match.php
  75. 24
      mod/message.php
  76. 2
      mod/mood.php
  77. 4
      mod/msearch.php
  78. 2
      mod/navigation.php
  79. 2
      mod/network.php
  80. 2
      mod/nodeinfo.php
  81. 4
      mod/noscrape.php
  82. 2
      mod/notice.php
  83. 3
      mod/notifications.php
  84. 6
      mod/notify.php
  85. 4
      mod/oexchange.php
  86. 12
      mod/openid.php
  87. 2
      mod/opensearch.php
  88. 4
      mod/ostatus_subscribe.php
  89. 2
      mod/p.php
  90. 22
      mod/photos.php
  91. 10
      mod/ping.php
  92. 8
      mod/poke.php
  93. 16
      mod/profile.php
  94. 20
      mod/profile_photo.php
  95. 6
      mod/profiles.php
  96. 10
      mod/proxy.php
  97. 2
      mod/randprof.php
  98. 8
      mod/redir.php
  99. 18
      mod/register.php
  100. 8
      mod/regmod.php

29
boot.php

@ -552,31 +552,16 @@ function system_unavailable() {
killme();
}
function clean_urls() {
$a = get_app();
return true;
}
function z_path() {
$base = App::get_baseurl();
if (!clean_urls()) {
$base .= '/?q=';
}
return $base;
}
/**
* @brief Returns the baseurl.
*
* @see App::get_baseurl()
* @see System::baseUrl()
*
* @return string
* @TODO Maybe super-flous and deprecated? Seems to only wrap App::get_baseurl()
* @TODO Function is deprecated and only used in some addons
*/
function z_root() {
return App::get_baseurl();
return System::baseUrl();
}
/**
@ -629,10 +614,10 @@ function check_url(App $a) {
// We will only change the url to an ip address if there is no existing setting
if (!x($url)) {
$url = set_config('system', 'url', App::get_baseurl());
$url = set_config('system', 'url', System::baseUrl());
}
if ((!link_compare($url, App::get_baseurl())) && (!preg_match("/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/", $a->get_hostname))) {
$url = set_config('system', 'url', App::get_baseurl());
if ((!link_compare($url, System::baseUrl())) && (!preg_match("/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/", $a->get_hostname))) {
$url = set_config('system', 'url', System::baseUrl());
}
return;
@ -914,7 +899,7 @@ function killme() {
*/
function goaway($s) {
if (!strstr(normalise_link($s), "http://")) {
$s = App::get_baseurl() . "/" . $s;
$s = System::baseUrl() . "/" . $s;
}
header("Location: $s");

14
include/Contact.php

@ -34,7 +34,7 @@ function user_remove($uid) {
if($uid == local_user()) {
unset($_SESSION['authenticated']);
unset($_SESSION['uid']);
goaway(App::get_baseurl());
goaway(System::baseUrl());
}
}
@ -402,7 +402,7 @@ function contact_photo_menu($contact, $uid = 0)
$sparkle = false;
if ($contact['network'] === NETWORK_DFRN) {
$sparkle = true;
$profile_link = App::get_baseurl() . '/redir/' . $contact['id'];
$profile_link = System::baseUrl() . '/redir/' . $contact['id'];
} else {
$profile_link = $contact['url'];
}
@ -418,17 +418,17 @@ function contact_photo_menu($contact, $uid = 0)
}
if (in_array($contact['network'], array(NETWORK_DFRN, NETWORK_DIASPORA))) {
$pm_url = App::get_baseurl() . '/message/new/' . $contact['id'];
$pm_url = System::baseUrl() . '/message/new/' . $contact['id'];
}
if ($contact['network'] == NETWORK_DFRN) {
$poke_link = App::get_baseurl() . '/poke/?f=&c=' . $contact['id'];
$poke_link = System::baseUrl() . '/poke/?f=&c=' . $contact['id'];
}
$contact_url = App::get_baseurl() . '/contacts/' . $contact['id'];
$contact_url = System::baseUrl() . '/contacts/' . $contact['id'];
$posts_link = App::get_baseurl() . '/contacts/' . $contact['id'] . '/posts';
$contact_drop_link = App::get_baseurl() . '/contacts/' . $contact['id'] . '/drop?confirm=1';
$posts_link = System::baseUrl() . '/contacts/' . $contact['id'] . '/posts';
$contact_drop_link = System::baseUrl() . '/contacts/' . $contact['id'] . '/drop?confirm=1';
/**
* menu array:

3
include/ForumManager.php

@ -1,6 +1,7 @@
<?php
use Friendica\App;
use Friendica\Core\System;
/**
* @file include/ForumManager.php
@ -106,7 +107,7 @@ class ForumManager {
'name' => $contact['name'],
'cid' => $contact['id'],
'selected' => $selected,
'micro' => App::remove_baseurl(proxy_url($contact['micro'], false, PROXY_SIZE_MICRO)),
'micro' => System::removedBaseUrl(proxy_url($contact['micro'], false, PROXY_SIZE_MICRO)),
'id' => ++$id,
);
$entries[] = $entry;

24
include/Photo.php

@ -858,9 +858,9 @@ function import_profile_photo($photo, $uid, $cid, $quit_on_error = false) {
$suffix = '?ts='.time();
$photo = App::get_baseurl() . '/photo/' . $hash . '-4.' . $img->getExt() . $suffix;
$thumb = App::get_baseurl() . '/photo/' . $hash . '-5.' . $img->getExt() . $suffix;
$micro = App::get_baseurl() . '/photo/' . $hash . '-6.' . $img->getExt() . $suffix;
$photo = System::baseUrl() . '/photo/' . $hash . '-4.' . $img->getExt() . $suffix;
$thumb = System::baseUrl() . '/photo/' . $hash . '-5.' . $img->getExt() . $suffix;
$micro = System::baseUrl() . '/photo/' . $hash . '-6.' . $img->getExt() . $suffix;
// Remove the cached photo
$a = get_app();
@ -889,9 +889,9 @@ function import_profile_photo($photo, $uid, $cid, $quit_on_error = false) {
}
if ($photo_failure) {
$photo = App::get_baseurl() . '/images/person-175.jpg';
$thumb = App::get_baseurl() . '/images/person-80.jpg';
$micro = App::get_baseurl() . '/images/person-48.jpg';
$photo = System::baseUrl() . '/images/person-175.jpg';
$thumb = System::baseUrl() . '/images/person-80.jpg';
$micro = System::baseUrl() . '/images/person-48.jpg';
}
return(array($photo,$thumb,$micro));
@ -1080,18 +1080,18 @@ function store_photo(App $a, $uid, $imagedata = "", $url = "") {
return(array());
}
$image = array("page" => App::get_baseurl().'/photos/'.$page_owner_nick.'/image/'.$hash,
"full" => App::get_baseurl()."/photo/{$hash}-0.".$ph->getExt());
$image = array("page" => System::baseUrl().'/photos/'.$page_owner_nick.'/image/'.$hash,
"full" => System::baseUrl()."/photo/{$hash}-0.".$ph->getExt());
if ($width > 800 || $height > 800) {
$image["large"] = App::get_baseurl()."/photo/{$hash}-0.".$ph->getExt();
$image["large"] = System::baseUrl()."/photo/{$hash}-0.".$ph->getExt();
}
if ($width > 640 || $height > 640) {
$ph->scaleImage(640);
$r = $ph->store($uid, $visitor, $hash, $tempfile, t('Wall Photos'), 1, 0, $defperm);
if ($r) {
$image["medium"] = App::get_baseurl()."/photo/{$hash}-1.".$ph->getExt();
$image["medium"] = System::baseUrl()."/photo/{$hash}-1.".$ph->getExt();
}
}
@ -1099,7 +1099,7 @@ function store_photo(App $a, $uid, $imagedata = "", $url = "") {
$ph->scaleImage(320);
$r = $ph->store($uid, $visitor, $hash, $tempfile, t('Wall Photos'), 2, 0, $defperm);
if ($r) {
$image["small"] = App::get_baseurl()."/photo/{$hash}-2.".$ph->getExt();
$image["small"] = System::baseUrl()."/photo/{$hash}-2.".$ph->getExt();
}
}
@ -1124,7 +1124,7 @@ function store_photo(App $a, $uid, $imagedata = "", $url = "") {
$r = $ph->store($uid, $visitor, $hash, $tempfile, t('Wall Photos'), 3, 0, $defperm);
if ($r) {
$image["thumb"] = App::get_baseurl()."/photo/{$hash}-3.".$ph->getExt();
$image["thumb"] = System::baseUrl()."/photo/{$hash}-3.".$ph->getExt();
}
}

72
include/Smilies.php

@ -87,41 +87,41 @@ class Smilies {
);
$icons = array(
'<img class="smiley" src="' . App::get_baseurl() . '/images/smiley-heart.gif" alt="&lt;3" title="&lt;3" />',
'<img class="smiley" src="' . App::get_baseurl() . '/images/smiley-brokenheart.gif" alt="&lt;/3" title="&lt;/3" />',
'<img class="smiley" src="' . App::get_baseurl() . '/images/smiley-brokenheart.gif" alt="&lt;\\3" title="&lt;\\3" />',
'<img class="smiley" src="' . App::get_baseurl() . '/images/smiley-smile.gif" alt=":-)" title=":-)" />',
'<img class="smiley" src="' . App::get_baseurl() . '/images/smiley-wink.gif" alt=";-)" title=";-)" />',
'<img class="smiley" src="' . App::get_baseurl() . '/images/smiley-frown.gif" alt=":-(" title=":-(" />',
'<img class="smiley" src="' . App::get_baseurl() . '/images/smiley-tongue-out.gif" alt=":-P" title=":-P" />',
'<img class="smiley" src="' . App::get_baseurl() . '/images/smiley-tongue-out.gif" alt=":-p" title=":-P" />',
'<img class="smiley" src="' . App::get_baseurl() . '/images/smiley-kiss.gif" alt=":-\" title=":-\" />',
'<img class="smiley" src="' . App::get_baseurl() . '/images/smiley-kiss.gif" alt=":-\" title=":-\" />',
'<img class="smiley" src="' . App::get_baseurl() . '/images/smiley-kiss.gif" alt=":-x" title=":-x" />',
'<img class="smiley" src="' . App::get_baseurl() . '/images/smiley-kiss.gif" alt=":-X" title=":-X" />',
'<img class="smiley" src="' . App::get_baseurl() . '/images/smiley-laughing.gif" alt=":-D" title=":-D" />',
'<img class="smiley" src="' . App::get_baseurl() . '/images/smiley-surprised.gif" alt="8-|" title="8-|" />',
'<img class="smiley" src="' . App::get_baseurl() . '/images/smiley-surprised.gif" alt="8-O" title="8-O" />',
'<img class="smiley" src="' . App::get_baseurl() . '/images/smiley-surprised.gif" alt=":-O" title="8-O" />',
'<img class="smiley" src="' . App::get_baseurl() . '/images/smiley-thumbsup.gif" alt="\\o/" title="\\o/" />',
'<img class="smiley" src="' . App::get_baseurl() . '/images/smiley-Oo.gif" alt="o.O" title="o.O" />',
'<img class="smiley" src="' . App::get_baseurl() . '/images/smiley-Oo.gif" alt="O.o" title="O.o" />',
'<img class="smiley" src="' . App::get_baseurl() . '/images/smiley-Oo.gif" alt="o_O" title="o_O" />',
'<img class="smiley" src="' . App::get_baseurl() . '/images/smiley-Oo.gif" alt="O_o" title="O_o" />',
'<img class="smiley" src="' . App::get_baseurl() . '/images/smiley-cry.gif" alt=":\'(" title=":\'("/>',
'<img class="smiley" src="' . App::get_baseurl() . '/images/smiley-foot-in-mouth.gif" alt=":-!" title=":-!" />',
'<img class="smiley" src="' . App::get_baseurl() . '/images/smiley-undecided.gif" alt=":-/" title=":-/" />',
'<img class="smiley" src="' . App::get_baseurl() . '/images/smiley-embarassed.gif" alt=":-[" title=":-[" />',
'<img class="smiley" src="' . App::get_baseurl() . '/images/smiley-cool.gif" alt="8-)" title="8-)" />',
'<img class="smiley" src="' . App::get_baseurl() . '/images/beer_mug.gif" alt=":beer" title=":beer" />',
'<img class="smiley" src="' . App::get_baseurl() . '/images/beer_mug.gif" alt=":homebrew" title=":homebrew" />',
'<img class="smiley" src="' . App::get_baseurl() . '/images/coffee.gif" alt=":coffee" title=":coffee" />',
'<img class="smiley" src="' . App::get_baseurl() . '/images/smiley-facepalm.gif" alt=":facepalm" title=":facepalm" />',
'<img class="smiley" src="' . App::get_baseurl() . '/images/like.gif" alt=":like" title=":like" />',
'<img class="smiley" src="' . App::get_baseurl() . '/images/dislike.gif" alt=":dislike" title=":dislike" />',
'<a href="http://friendica.com">~friendica <img class="smiley" src="' . App::get_baseurl() . '/images/friendica-16.png" alt="~friendica" title="~friendica" /></a>',
'<a href="http://redmatrix.me/">red<img class="smiley" src="' . App::get_baseurl() . '/images/rm-16.png" alt="red#" title="red#" />matrix</a>',
'<a href="http://redmatrix.me/">red<img class="smiley" src="' . App::get_baseurl() . '/images/rm-16.png" alt="red#matrix" title="red#matrix" />matrix</a>'
'<img class="smiley" src="' . System::baseUrl() . '/images/smiley-heart.gif" alt="&lt;3" title="&lt;3" />',
'<img class="smiley" src="' . System::baseUrl() . '/images/smiley-brokenheart.gif" alt="&lt;/3" title="&lt;/3" />',
'<img class="smiley" src="' . System::baseUrl() . '/images/smiley-brokenheart.gif" alt="&lt;\\3" title="&lt;\\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="http://friendica.com">~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>'
);
$params = array('texts' => $texts, 'icons' => $icons);
@ -210,7 +210,7 @@ class Smilies {
return $x[0];
$t = '';
for($cnt = 0; $cnt < strlen($x[1]); $cnt ++)
$t .= '<img class="smiley" src="' . App::get_baseurl() . '/images/smiley-heart.gif" alt="&lt;3" />';
$t .= '<img class="smiley" src="' . System::baseUrl() . '/images/smiley-heart.gif" alt="&lt;3" />';
$r = str_replace($x[0],$t,$x[0]);
return $r;
}

44
include/api.php

@ -97,7 +97,7 @@ $called_api = null;
*
* Register a function to be the endpont for defined API path.
*
* @param string $path API URL path, relative to App::get_baseurl()
* @param string $path API URL path, relative to System::baseUrl()
* @param string $func Function name to call on path request
* @param bool $auth API need logged user
* @param string $method HTTP method reqiured to call this endpoint.
@ -437,12 +437,12 @@ $called_api = null;
$arr['$user'] = $user_info;
$arr['$rss'] = array(
'alternate' => $user_info['url'],
'self' => App::get_baseurl() . "/" . $a->query_string,
'base' => App::get_baseurl(),
'self' => System::baseUrl() . "/" . $a->query_string,
'base' => System::baseUrl(),
'updated' => api_date(null),
'atom_updated' => datetime_convert('UTC', 'UTC', 'now', ATOM_TIME),
'language' => $user_info['language'],
'logo' => App::get_baseurl() . "/images/friendica-32.png",
'logo' => System::baseUrl() . "/images/friendica-32.png",
);
return $arr;
@ -755,7 +755,7 @@ $called_api = null;
'statusnet_blocking' => false,
'notifications' => false,
/// @TODO old way?
//'statusnet_profile_url' => App::get_baseurl()."/contacts/".$uinfo[0]['cid'],
//'statusnet_profile_url' => System::baseUrl()."/contacts/".$uinfo[0]['cid'],
'statusnet_profile_url' => $uinfo[0]['url'],
'uid' => intval($uinfo[0]['uid']),
'cid' => intval($uinfo[0]['cid']),
@ -1165,8 +1165,8 @@ $called_api = null;
if (dbm::is_result($r)) {
$phototypes = Photo::supportedTypes();
$ext = $phototypes[$r[0]['type']];
$_REQUEST['body'] .= "\n\n" . '[url=' . App::get_baseurl() . '/photos/' . $r[0]['nickname'] . '/image/' . $r[0]['resource-id'] . ']';
$_REQUEST['body'] .= '[img]' . App::get_baseurl() . '/photo/' . $r[0]['resource-id'] . '-' . $r[0]['scale'] . '.' . $ext . '[/img][/url]';
$_REQUEST['body'] .= "\n\n" . '[url=' . System::baseUrl() . '/photos/' . $r[0]['nickname'] . '/image/' . $r[0]['resource-id'] . ']';
$_REQUEST['body'] .= '[img]' . System::baseUrl() . '/photo/' . $r[0]['resource-id'] . '-' . $r[0]['scale'] . '.' . $ext . '[/img][/url]';
}
}
@ -1930,7 +1930,7 @@ $called_api = null;
$start = $page * $count;
// Ugly code - should be changed
$myurl = App::get_baseurl() . '/profile/'. $a->user['nickname'];
$myurl = System::baseUrl() . '/profile/'. $a->user['nickname'];
$myurl = substr($myurl,strpos($myurl, '://') + 3);
//$myurl = str_replace(array('www.','.'),array('','\\.'),$myurl);
$myurl = str_replace('www.', '', $myurl);
@ -2495,7 +2495,7 @@ $called_api = null;
$text = preg_replace_callback(
"|data:image/([^;]+)[^=]+=*|m",
function($match) use ($item) {
return App::get_baseurl()."/display/".$item['guid'];
return System::baseUrl()."/display/".$item['guid'];
},
$text);
return $text;
@ -2912,7 +2912,7 @@ $called_api = null;
$name = $a->config['sitename'];
$server = $a->get_hostname();
$logo = App::get_baseurl() . '/images/friendica-64.png';
$logo = System::baseUrl() . '/images/friendica-64.png';
$email = $a->config['admin_email'];
$closed = (($a->config['register_policy'] == REGISTER_CLOSED) ? 'true' : 'false');
$private = ((Config::get('system', 'block_public')) ? 'true' : 'false');
@ -2921,7 +2921,7 @@ $called_api = null;
$texlimit = string($a->config['api_import_size']);
}
$ssl = ((Config::get('system', 'have_ssl')) ? 'true' : 'false');
$sslserver = (($ssl === 'true') ? str_replace('http:','https:',App::get_baseurl()) : '');
$sslserver = (($ssl === 'true') ? str_replace('http:','https:',System::baseUrl()) : '');
$config = array(
'site' => array('name' => $name,'server' => $server, 'theme' => 'default', 'path' => '',
@ -3423,7 +3423,7 @@ $called_api = null;
$photo['album'] = $rr['album'];
$photo['filename'] = $rr['filename'];
$photo['type'] = $rr['type'];
$thumb = App::get_baseurl() . "/photo/" . $rr['resource-id'] . "-" . $rr['scale'] . "." . $typetoext[$rr['type']];
$thumb = System::baseUrl() . "/photo/" . $rr['resource-id'] . "-" . $rr['scale'] . "." . $typetoext[$rr['type']];
$photo['created'] = $rr['created'];
$photo['edited'] = $rr['edited'];
$photo['desc'] = $rr['desc'];
@ -3721,15 +3721,15 @@ $called_api = null;
);
$r = q("UPDATE `contact` SET `photo` = '%s', `thumb` = '%s', `micro` = '%s' WHERE `self` AND `uid` = %d",
dbesc(App::get_baseurl() . '/photo/' . $data['photo']['id'] . '-4.' . $fileext),
dbesc(App::get_baseurl() . '/photo/' . $data['photo']['id'] . '-5.' . $fileext),
dbesc(App::get_baseurl() . '/photo/' . $data['photo']['id'] . '-6.' . $fileext),
dbesc(System::baseUrl() . '/photo/' . $data['photo']['id'] . '-4.' . $fileext),
dbesc(System::baseUrl() . '/photo/' . $data['photo']['id'] . '-5.' . $fileext),
dbesc(System::baseUrl() . '/photo/' . $data['photo']['id'] . '-6.' . $fileext),
intval(local_user())
);
} else {
$r = q("UPDATE `profile` SET `photo` = '%s', `thumb` = '%s' WHERE `id` = %d AND `uid` = %d",
dbesc(App::get_baseurl() . '/photo/' . $data['photo']['id'] . '-4.' . $filetype),
dbesc(App::get_baseurl() . '/photo/' . $data['photo']['id'] . '-5.' . $filetype),
dbesc(System::baseUrl() . '/photo/' . $data['photo']['id'] . '-4.' . $filetype),
dbesc(System::baseUrl() . '/photo/' . $data['photo']['id'] . '-5.' . $filetype),
intval($_REQUEST['profile']),
intval(local_user())
);
@ -3745,7 +3745,7 @@ $called_api = null;
// Update global directory in background
//$user = api_get_user(get_app());
$url = App::get_baseurl() . '/profile/' . get_app()->user['nickname'];
$url = System::baseUrl() . '/profile/' . get_app()->user['nickname'];
if ($url && strlen(get_config('system', 'directory'))) {
proc_run(PRIORITY_LOW, "include/directory.php", $url);
}
@ -3974,8 +3974,8 @@ $called_api = null;
);
// adds link to the thumbnail scale photo
$arr['body'] = '[url=' . App::get_baseurl() . '/photos/' . $owner_record[0]['name'] . '/image/' . $hash . ']'
. '[img]' . App::get_baseurl() . '/photo/' . $hash . '-' . "2" . '.'. $typetoext[$filetype] . '[/img]'
$arr['body'] = '[url=' . System::baseUrl() . '/photos/' . $owner_record[0]['name'] . '/image/' . $hash . ']'
. '[img]' . System::baseUrl() . '/photo/' . $hash . '-' . "2" . '.'. $typetoext[$filetype] . '[/img]'
. '[/url]';
// do the magic for storing the item in the database and trigger the federation to other contacts
@ -4018,14 +4018,14 @@ $called_api = null;
for ($k = intval($data['photo']['minscale']); $k <= intval($data['photo']['maxscale']); $k++) {
$data['photo']['links'][$k . ":link"]["@attributes"] = array("type" => $data['photo']['type'],
"scale" => $k,
"href" => App::get_baseurl() . "/photo/" . $data['photo']['resource-id'] . "-" . $k . "." . $typetoext[$data['photo']['type']]);
"href" => System::baseUrl() . "/photo/" . $data['photo']['resource-id'] . "-" . $k . "." . $typetoext[$data['photo']['type']]);
}
} else {
$data['photo']['link'] = array();
// when we have profile images we could have only scales from 4 to 6, but index of array always needs to start with 0
$i = 0;
for ($k = intval($data['photo']['minscale']); $k <= intval($data['photo']['maxscale']); $k++) {
$data['photo']['link'][$i] = App::get_baseurl() . "/photo/" . $data['photo']['resource-id'] . "-" . $k . "." . $typetoext[$data['photo']['type']];
$data['photo']['link'][$i] = System::baseUrl() . "/photo/" . $data['photo']['resource-id'] . "-" . $k . "." . $typetoext[$data['photo']['type']];
$i++;
}
}

14
include/auth.php

@ -20,7 +20,7 @@ if (isset($_COOKIE["Friendica"])) {
if ($data->hash != cookie_hash($r[0])) {
logger("Hash for user ".$data->uid." doesn't fit.");
nuke_session();
goaway(z_root());
goaway(System::baseUrl());
}
// Renew the cookie
@ -51,7 +51,7 @@ if (isset($_SESSION) && x($_SESSION,'authenticated') && (!x($_POST,'auth-params'
call_hooks("logging_out");
nuke_session();
info(t('Logged out.').EOL);
goaway(z_root());
goaway(System::baseUrl());
}
if (x($_SESSION,'visitor_id') && !x($_SESSION,'uid')) {
@ -73,7 +73,7 @@ if (isset($_SESSION) && x($_SESSION,'authenticated') && (!x($_POST,'auth-params'
logger('Session address changed. Paranoid setting in effect, blocking session. '.
$_SESSION['addr'].' != '.$_SERVER['REMOTE_ADDR']);
nuke_session();
goaway(z_root());
goaway(System::baseUrl());
}
$r = q("SELECT `user`.*, `user`.`pubkey` as `upubkey`, `user`.`prvkey` as `uprvkey`
@ -83,7 +83,7 @@ if (isset($_SESSION) && x($_SESSION,'authenticated') && (!x($_POST,'auth-params'
if (!dbm::is_result($r)) {
nuke_session();
goaway(z_root());
goaway(System::baseUrl());
}
// Make sure to refresh the last login time for the user if the user
@ -122,7 +122,7 @@ if (isset($_SESSION) && x($_SESSION,'authenticated') && (!x($_POST,'auth-params'
if ($noid || strpos($temp_string,'@') || !validate_url($temp_string)) {
$a = get_app();
notice(t('Login failed.').EOL);
goaway(z_root());
goaway(System::baseUrl());
// NOTREACHED
}
@ -134,7 +134,7 @@ if (isset($_SESSION) && x($_SESSION,'authenticated') && (!x($_POST,'auth-params'
$openid->identity = $openid_url;
$_SESSION['openid'] = $openid_url;
$_SESSION['remember'] = $_POST['remember'];
$openid->returnUrl = App::get_baseurl(true).'/openid';
$openid->returnUrl = System::baseUrl(true).'/openid';
goaway($openid->authUrl());
} catch (Exception $e) {
notice(t('We encountered a problem while logging in with the OpenID you provided. Please check the correct spelling of the ID.').'<br /><br >'.t('The error message was:').' '.$e->getMessage());
@ -184,7 +184,7 @@ if (isset($_SESSION) && x($_SESSION,'authenticated') && (!x($_POST,'auth-params'
if (!$record || !count($record)) {
logger('authenticate: failed login attempt: '.notags(trim($_POST['username'])).' from IP '.$_SERVER['REMOTE_ADDR']);
notice(t('Login failed.').EOL);
goaway(z_root());
goaway(System::baseUrl());
}
if (! $_POST['remember']) {

4
include/bb2diaspora.php

@ -242,7 +242,7 @@ function format_event_diaspora($ev) {
$ev['start'] , $bd_format ))
: day_translate(datetime_convert('UTC', 'UTC',
$ev['start'] , $bd_format)))
. '](' . App::get_baseurl() . '/localtime/?f=&time=' . urlencode(datetime_convert('UTC','UTC',$ev['start'])) . ")\n";
. '](' . System::baseUrl() . '/localtime/?f=&time=' . urlencode(datetime_convert('UTC','UTC',$ev['start'])) . ")\n";
if (! $ev['nofinish']) {
$o .= t('Finishes:') . ' ' . '['
@ -250,7 +250,7 @@ function format_event_diaspora($ev) {
$ev['finish'] , $bd_format ))
: day_translate(datetime_convert('UTC', 'UTC',
$ev['finish'] , $bd_format )))
. '](' . App::get_baseurl() . '/localtime/?f=&time=' . urlencode(datetime_convert('UTC','UTC',$ev['finish'])) . ")\n";
. '](' . System::baseUrl() . '/localtime/?f=&time=' . urlencode(datetime_convert('UTC','UTC',$ev['finish'])) . ")\n";
}
if (strlen($ev['location'])) {

10
include/bbcode.php

@ -701,7 +701,7 @@ function GetProfileUsername($profile, $username, $compact = false, $getnetwork =
}
function bb_DiasporaLinks($match) {
return "[url=".App::get_baseurl()."/display/".$match[1]."]".$match[2]."[/url]";
return "[url=".System::baseUrl()."/display/".$match[1]."]".$match[2]."[/url]";
}
function bb_RemovePictureLinks($match) {
@ -1020,7 +1020,7 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true, $simplehtml = fa
// 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="' . App::get_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="' . System::baseUrl() . '/acctlink?addr=$1@$2" target="extlink">acct:$1@$2</a>', $Text);
// Perform MAIL Search
$Text = preg_replace("/\[mail\]([$MAILSearchString]*)\[\/mail\]/", '<a href="mailto:$1">$1</a>', $Text);
@ -1193,9 +1193,9 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true, $simplehtml = fa
return bb_ShareAttributes($match, $simplehtml);
}, $Text);
$Text = preg_replace("/\[crypt\](.*?)\[\/crypt\]/ism", '<br/><img src="' .App::get_baseurl() . '/images/lock_icon.gif" alt="' . t('Encrypted content') . '" title="' . t('Encrypted content') . '" /><br />', $Text);
$Text = preg_replace("/\[crypt(.*?)\](.*?)\[\/crypt\]/ism", '<br/><img src="' .App::get_baseurl() . '/images/lock_icon.gif" alt="' . t('Encrypted content') . '" title="' . '$1' . ' ' . t('Encrypted content') . '" /><br />', $Text);
//$Text = preg_replace("/\[crypt=(.*?)\](.*?)\[\/crypt\]/ism", '<br/><img src="' .App::get_baseurl() . '/images/lock_icon.gif" alt="' . t('Encrypted content') . '" title="' . '$1' . ' ' . t('Encrypted content') . '" /><br />', $Text);
$Text = preg_replace("/\[crypt\](.*?)\[\/crypt\]/ism", '<br/><img src="' .System::baseUrl() . '/images/lock_icon.gif" alt="' . t('Encrypted content') . '" title="' . t('Encrypted content') . '" /><br />', $Text);
$Text = preg_replace("/\[crypt(.*?)\](.*?)\[\/crypt\]/ism", '<br/><img src="' .System::baseUrl() . '/images/lock_icon.gif" alt="' . t('Encrypted content') . '" title="' . '$1' . ' ' . t('Encrypted content') . '" /><br />', $Text);
//$Text = preg_replace("/\[crypt=(.*?)\](.*?)\[\/crypt\]/ism", '<br/><img src="' .System::baseUrl() . '/images/lock_icon.gif" alt="' . t('Encrypted content') . '" title="' . '$1' . ' ' . t('Encrypted content') . '" /><br />', $Text);
// Try to Oembed
if ($tryoembed) {

2
include/contact_widgets.php

@ -265,7 +265,7 @@ function common_friends_visitor_widget($profile_uid) {
return replace_macros(get_markup_template('remote_friends_common.tpl'), array(
'$desc' => sprintf( tt("%d contact in common", "%d contacts in common", $t), $t),
'$base' => App::get_baseurl(),
'$base' => System::baseUrl(),
'$uid' => $profile_uid,
'$cid' => (($cid) ? $cid : '0'),
'$linkmore' => (($t > 5) ? 'true' : ''),

16
include/conversation.php

@ -66,7 +66,7 @@ function item_redir_and_replace_images($body, $images, $cid) {
while ($pos !== false && $cnt < 1000) {
$search = '/\[url\=(.*?)\]\[!#saved_image([0-9]*)#!\]\[\/url\]' . '/is';
$replace = '[url=' . z_path() . '/redir/' . $cid
$replace = '[url=' . System::baseUrl() . '/redir/' . $cid
. '?f=1&url=' . '$1' . '][!#saved_image' . '$2' .'#!][/url]';
$newbody .= substr($origbody, 0, $pos['start']['open']);
@ -681,7 +681,7 @@ function conversation(App $a, $items, $mode, $update, $preview = false) {
$hashtags = array();
$mentions = array();
$searchpath = App::get_baseurl()."/search?tag=";
$searchpath = System::baseUrl()."/search?tag=";
$taglist = dba::select('term', array('type', 'term', 'url'),
array("`otype` = ? AND `oid` = ? AND `type` IN (?, ?)", TERM_OBJ_POST, $item['id'], TERM_HASHTAG, TERM_MENTION),
@ -800,7 +800,7 @@ function conversation(App $a, $items, $mode, $update, $preview = false) {
'name' => $profile_name_e,
'sparkle' => $sparkle,
'lock' => $lock,
'thumb' => App::remove_baseurl(proxy_url($item['author-thumb'], false, PROXY_SIZE_THUMB)),
'thumb' => System::removedBaseUrl(proxy_url($item['author-thumb'], false, PROXY_SIZE_THUMB)),
'title' => $item['title_e'],
'body' => $body_e,
'tags' => $tags_e,
@ -819,7 +819,7 @@ function conversation(App $a, $items, $mode, $update, $preview = false) {
'indent' => '',
'owner_name' => $owner_name_e,
'owner_url' => $owner_url,
'owner_photo' => App::remove_baseurl(proxy_url($item['owner-thumb'], false, PROXY_SIZE_THUMB)),
'owner_photo' => System::removedBaseUrl(proxy_url($item['owner-thumb'], false, PROXY_SIZE_THUMB)),
'plink' => get_plink($item),
'edpost' => false,
'isstarred' => $isstarred,
@ -906,7 +906,7 @@ function conversation(App $a, $items, $mode, $update, $preview = false) {
}
$o = replace_macros($page_template, array(
'$baseurl' => App::get_baseurl($ssl_state),
'$baseurl' => System::baseUrl($ssl_state),
'$return_path' => $a->query_string,
'$live_update' => $live_update_div,
'$remove' => t('remove'),
@ -1226,7 +1226,7 @@ function status_editor(App $a, $x, $notes_cid = 0, $popup = false) {
$tpl = get_markup_template('jot-header.tpl');
$a->page['htmlhead'] .= replace_macros($tpl, array(
'$newpost' => 'true',
'$baseurl' => App::get_baseurl(true),
'$baseurl' => System::baseUrl(true),
'$geotag' => $geotag,
'$nickname' => $x['nickname'],
'$ispublic' => t('Visible to <strong>everybody</strong>'),
@ -1242,7 +1242,7 @@ function status_editor(App $a, $x, $notes_cid = 0, $popup = false) {
$tpl = get_markup_template('jot-end.tpl');
$a->page['end'] .= replace_macros($tpl, array(
'$newpost' => 'true',
'$baseurl' => App::get_baseurl(true),
'$baseurl' => System::baseUrl(true),
'$geotag' => $geotag,
'$nickname' => $x['nickname'],
'$ispublic' => t('Visible to <strong>everybody</strong>'),
@ -1310,7 +1310,7 @@ function status_editor(App $a, $x, $notes_cid = 0, $popup = false) {
'$ptyp' => (($notes_cid) ? 'note' : 'wall'),
'$content' => $x['content'],
'$post_id' => $x['post_id'],
'$baseurl' => App::get_baseurl(true),
'$baseurl' => System::baseUrl(true),
'$defloc' => $x['default_location'],
'$visitor' => $x['visitor'],
'$pvisit' => (($notes_cid) ? 'none' : $x['visitor']),

4
include/dbstructure.php

@ -90,11 +90,11 @@ function update_fail($update_id, $error_message) {
$email_tpl = get_intltext_template("update_fail_eml.tpl");
$email_msg = replace_macros($email_tpl, array(
'$sitename' => $a->config['sitename'],
'$siteurl' => App::get_baseurl(),
'$siteurl' => System::baseUrl(),
'$update' => DB_UPDATE_VERSION,
'$error' => sprintf(t('Update %s failed. See error logs.'), DB_UPDATE_VERSION)
));
$subject=sprintf(t('Update Error at %s'), App::get_baseurl());
$subject=sprintf(t('Update Error at %s'), System::baseUrl());
require_once('include/email.php');
$subject = email_header_encode($subject,'UTF-8');
mail($a->config['admin_email'], $subject, $email_msg,

2
include/delivery.php

@ -300,7 +300,7 @@ function delivery_run(&$argv, &$argc){
// perform local delivery if we are on the same site
if (link_compare($basepath,App::get_baseurl())) {
if (link_compare($basepath,System::baseUrl())) {
$nickname = basename($contact['url']);
if ($contact['issued-id']) {

24
include/dfrn.php

@ -429,7 +429,7 @@ class dfrn {
$ext = Photo::supportedTypes();
foreach ($rp as $p) {
$photos[$p['scale']] = App::get_baseurl().'/photo/'.$p['resource-id'].'-'.$p['scale'].'.'.$ext[$p['type']];
$photos[$p['scale']] = System::baseUrl().'/photo/'.$p['resource-id'].'-'.$p['scale'].'.'.$ext[$p['type']];
}
unset($rp, $ext);
@ -490,7 +490,7 @@ class dfrn {
$root->setAttribute("xmlns:ostatus", NAMESPACE_OSTATUS);
$root->setAttribute("xmlns:statusnet", NAMESPACE_STATUSNET);
xml::add_element($doc, $root, "id", App::get_baseurl()."/profile/".$owner["nick"]);
xml::add_element($doc, $root, "id", System::baseUrl()."/profile/".$owner["nick"]);
xml::add_element($doc, $root, "title", $owner["name"]);
$attributes = array("uri" => "https://friendi.ca", "version" => FRIENDICA_VERSION."-".DB_UPDATE_VERSION);
@ -507,13 +507,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 = array("rel" => "salmon", "href" => App::get_baseurl()."/salmon/".$owner["nick"]);
$attributes = array("rel" => "salmon", "href" => System::baseUrl()."/salmon/".$owner["nick"]);
xml::add_element($doc, $root, "link", "", $attributes);
$attributes = array("rel" => "http://salmon-protocol.org/ns/salmon-replies", "href" => App::get_baseurl()."/salmon/".$owner["nick"]);
$attributes = array("rel" => "http://salmon-protocol.org/ns/salmon-replies", "href" => System::baseUrl()."/salmon/".$owner["nick"]);
xml::add_element($doc, $root, "link", "", $attributes);
$attributes = array("rel" => "http://salmon-protocol.org/ns/salmon-mention", "href" => App::get_baseurl()."/salmon/".$owner["nick"]);
$attributes = array("rel" => "http://salmon-protocol.org/ns/salmon-mention", "href" => System::baseUrl()."/salmon/".$owner["nick"]);
xml::add_element($doc, $root, "link", "", $attributes);
}
@ -570,7 +570,7 @@ class dfrn {
}
xml::add_element($doc, $author, "name", $owner["name"], $attributes);
xml::add_element($doc, $author, "uri", App::get_baseurl().'/profile/'.$owner["nickname"], $attributes);
xml::add_element($doc, $author, "uri", System::baseUrl().'/profile/'.$owner["nickname"], $attributes);
xml::add_element($doc, $author, "dfrn:handle", $owner["addr"], $attributes);
$attributes = array("rel" => "photo", "type" => "image/jpeg",
@ -871,13 +871,13 @@ class dfrn {
$parent = q("SELECT `guid` FROM `item` WHERE `id` = %d", intval($item["parent"]));
$parent_item = (($item['thr-parent']) ? $item['thr-parent'] : $item['parent-uri']);
$attributes = array("ref" => $parent_item, "type" => "text/html",
"href" => App::get_baseurl().'/display/'.$parent[0]['guid'],
"href" => System::baseUrl().'/display/'.$parent[0]['guid'],
"dfrn:diaspora_guid" => $parent[0]['guid']);
xml::add_element($doc, $entry, "thr:in-reply-to", "", $attributes);
}
// Add conversation data. This is used for OStatus
$conversation_href = App::get_baseurl()."/display/".$owner["nick"]."/".$item["parent"];
$conversation_href = System::baseUrl()."/display/".$owner["nick"]."/".$item["parent"];
$conversation_uri = $conversation_href;
if (isset($parent_item)) {
@ -913,7 +913,7 @@ class dfrn {
// We save this value in "plink". Maybe we should read it from there as well?
xml::add_element($doc, $entry, "link", "", array("rel" => "alternate", "type" => "text/html",
"href" => App::get_baseurl()."/display/".$item["guid"]));
"href" => System::baseUrl()."/display/".$item["guid"]));
// "comment-allow" is some old fashioned stuff for old Friendica versions.
// It is included in the rewritten code for completeness
@ -1798,7 +1798,7 @@ class dfrn {
"to_email" => $importer["email"],
"uid" => $importer["importer_uid"],
"item" => $suggest,
"link" => App::get_baseurl()."/notifications/intros",
"link" => System::baseUrl()."/notifications/intros",
"source_name" => $importer["name"],
"source_link" => $importer["url"],
"source_photo" => $importer["photo"],
@ -2104,7 +2104,7 @@ class dfrn {
}
}
if ($Blink && link_compare($Blink, App::get_baseurl() . "/profile/" . $importer["nickname"])) {
if ($Blink && link_compare($Blink, System::baseUrl() . "/profile/" . $importer["nickname"])) {
// send a notification
notification(array(
@ -2115,7 +2115,7 @@ class dfrn {
"to_email" => $importer["email"],
"uid" => $importer["importer_uid"],
"item" => $item,
"link" => App::get_baseurl()."/display/".urlencode(get_item_guid($posted_id)),
"link" => System::baseUrl()."/display/".urlencode(get_item_guid($posted_id)),
"source_name" => stripslashes($item["author-name"]),
"source_link" => $item["author-link"],
"source_photo" => ((link_compare($item["author-link"],$importer["url"]))

14
include/diaspora.php

@ -1655,7 +1655,7 @@ class Diaspora {
$ulink = "[url=".$contact["url"]."]".$contact["name"]."[/url]";
$alink = "[url=".$parent_item["author-link"]."]".$parent_item["author-name"]."[/url]";
$plink = "[url=".App::get_baseurl()."/display/".urlencode($guid)."]".t("status")."[/url]";
$plink = "[url=".System::baseUrl()."/display/".urlencode($guid)."]".t("status")."[/url]";
return sprintf($bodyverb, $ulink, $alink, $plink);
}
@ -1670,7 +1670,7 @@ class Diaspora {
*/
private static function construct_like_object($importer, $parent_item) {
$objtype = ACTIVITY_OBJ_NOTE;
$link = '<link rel="alternate" type="text/html" href="'.App::get_baseurl()."/display/".$importer["nickname"]."/".$parent_item["id"].'" />';
$link = '<link rel="alternate" type="text/html" href="'.System::baseUrl()."/display/".$importer["nickname"]."/".$parent_item["id"].'" />';
$parent_body = $parent_item["body"];
$xmldata = array("object" => array("type" => $objtype,
@ -2364,7 +2364,7 @@ class Diaspora {
return false;
}
$orig_url = App::get_baseurl()."/display/".$original_item["guid"];
$orig_url = System::baseUrl()."/display/".$original_item["guid"];
$datarray = array();
@ -2654,7 +2654,7 @@ class Diaspora {
$nick = $contact["nick"];
}
return $nick."@".substr(App::get_baseurl(), strpos(App::get_baseurl(),"://") + 3);
return $nick."@".substr(System::baseUrl(), strpos(System::baseUrl(),"://") + 3);
}
@ -3621,9 +3621,9 @@ class Diaspora {
$first = ((strpos($profile['name'],' ')
? trim(substr($profile['name'],0,strpos($profile['name'],' '))) : $profile['name']));
$last = (($first === $profile['name']) ? '' : trim(substr($profile['name'], strlen($first))));
$large = App::get_baseurl().'/photo/custom/300/'.$profile['uid'].'.jpg';
$medium = App::get_baseurl().'/photo/custom/100/'.$profile['uid'].'.jpg';
$small = App::get_baseurl().'/photo/custom/50/' .$profile['uid'].'.jpg';
$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';
$searchable = (($profile['publish'] && $profile['net-publish']) ? 'true' : 'false');
if ($searchable === 'true') {

10
include/enotify.php

@ -27,7 +27,7 @@ function notification($params) {
$banner = t('Friendica Notification');
$product = FRIENDICA_PLATFORM;
$siteurl = App::get_baseurl(true);
$siteurl = System::baseUrl(true);
$thanks = t('Thank You,');
$sitename = $a->config['sitename'];
if (!x($a->config['admin_name']))
@ -67,7 +67,7 @@ function notification($params) {
$additional_mail_header .= "X-Friendica-Platform: ".FRIENDICA_PLATFORM."\n";
$additional_mail_header .= "X-Friendica-Version: ".FRIENDICA_VERSION."\n";
$additional_mail_header .= "List-ID: <notification.".$hostname.">\n";
$additional_mail_header .= "List-Archive: <".App::get_baseurl()."/notifications/system>\n";
$additional_mail_header .= "List-Archive: <".System::baseUrl()."/notifications/system>\n";
if (array_key_exists('item', $params)) {
$title = $params['item']['title'];
@ -503,7 +503,7 @@ function notification($params) {
}
$itemlink = App::get_baseurl().'/notify/view/'.$notify_id;
$itemlink = System::baseUrl().'/notify/view/'.$notify_id;
$msg = replace_macros($epreamble, array('$itemlink' => $itemlink));
$msg_cache = format_notification_message($datarray['name_cache'], strip_tags(bbcode($msg)));
$r = q("UPDATE `notify` SET `msg` = '%s', `msg_cache` = '%s' WHERE `id` = %d AND `uid` = %d",
@ -674,7 +674,7 @@ function check_item_notification($itemid, $uid, $defaulttype = "") {
$profiles[] = $owner[0]["url"];
// Notifications from Diaspora are often with an URL in the Diaspora format
$profiles[] = App::get_baseurl()."/u/".$user[0]["nickname"];
$profiles[] = System::baseUrl()."/u/".$user[0]["nickname"];
$profiles2 = array();
@ -728,7 +728,7 @@ function check_item_notification($itemid, $uid, $defaulttype = "") {
$params["to_email"] = $user[0]["email"];
$params["item"] = $item[0];
$params["parent"] = $item[0]["parent"];
$params["link"] = App::get_baseurl().'/display/'.urlencode($item[0]["guid"]);
$params["link"] = System::baseUrl().'/display/'.urlencode($item[0]["guid"]);
$params["otype"] = 'item';
$params["source_name"] = $item[0]["author-name"];
$params["source_link"] = $item[0]["author-link"];

6
include/event.php

@ -373,7 +373,7 @@ function event_store($arr) {
intval($arr['uid'])
);
//if (dbm::is_result($r))
// $plink = App::get_baseurl() . '/display/' . $r[0]['nickname'] . '/' . $item_id;
// $plink = System::baseUrl() . '/display/' . $r[0]['nickname'] . '/' . $item_id;
if ($item_id) {
@ -590,8 +590,8 @@ function process_events($arr) {
// Show edit and drop actions only if the user is the owner of the event and the event
// is a real event (no bithdays)
if (local_user() && local_user() == $rr['uid'] && $rr['type'] == 'event') {
$edit = ((! $rr['cid']) ? array(App::get_baseurl() . '/events/event/' . $rr['id'], t('Edit event'), '', '') : null);
$drop = array(App::get_baseurl() . '/events/drop/' . $rr['id'], t('Delete event'), '', '');
$edit = ((! $rr['cid']) ? array(System::baseUrl() . '/events/event/' . $rr['id'], t('Edit event'), '', '') : null);
$drop = array(System::baseUrl() . '/events/drop/' . $rr['id'], t('Delete event'), '', '');
}
$title = strip_tags(html_entity_decode(bbcode($rr['summary']), ENT_QUOTES, 'UTF-8'));

2
include/follow.php

@ -110,7 +110,7 @@ function new_contact($uid,$url,$interactive = false) {
if ($ret['network'] === NETWORK_DFRN) {
if ($interactive) {
if (strlen($a->path)) {
$myaddr = bin2hex(App::get_baseurl() . '/profile/' . $a->user['nickname']);
$myaddr = bin2hex(System::baseUrl() . '/profile/' . $a->user['nickname']);
} else {
$myaddr = bin2hex($a->user['nickname'] . '@' . $a->get_hostname());
}

30
include/identity.php

@ -243,7 +243,7 @@ function profile_sidebar($profile, $block = 0) {
if (isset($profile["url"])) {
$profile_url = normalise_link($profile["url"]);
} else {
$profile_url = normalise_link(App::get_baseurl()."/profile/".$profile["nickname"]);
$profile_url = normalise_link(System::baseUrl()."/profile/".$profile["nickname"]);
}
if (dba::exists('contact', array('pending' => false, 'uid' => local_user(), 'nurl' => $profile_url))) {
@ -290,7 +290,7 @@ function profile_sidebar($profile, $block = 0) {
// show edit profile to yourself
if (!$is_contact && $profile['uid'] == local_user() && feature_enabled(local_user(),'multi_profiles')) {
$profile['edit'] = array(App::get_baseurl(). '/profiles', t('Profiles'),"", t('Manage/edit profiles'));
$profile['edit'] = array(System::baseUrl(). '/profiles', t('Profiles'),"", t('Manage/edit profiles'));
$r = q("SELECT * FROM `profile` WHERE `uid` = %d",
local_user());
@ -319,7 +319,7 @@ function profile_sidebar($profile, $block = 0) {
}
}
if (!$is_contact && $profile['uid'] == local_user() && !feature_enabled(local_user(),'multi_profiles')) {
$profile['edit'] = array(App::get_baseurl(). '/profiles/'.$profile['id'], t('Edit profile'),"", t('Edit profile'));
$profile['edit'] = array(System::baseUrl(). '/profiles/'.$profile['id'], t('Edit profile'),"", t('Edit profile'));
$profile['menu'] = array(
'chg_photo' => t('Change profile photo'),
'cr_new' => null,
@ -360,7 +360,7 @@ function profile_sidebar($profile, $block = 0) {
if ($profile['guid'] != "")
$diaspora = array(
'guid' => $profile['guid'],
'podloc' => App::get_baseurl(),
'podloc' => System::baseUrl(),
'searchable' => (($profile['publish'] && $profile['net-publish']) ? 'true' : 'false' ),
'nickname' => $profile['nickname'],
'fullname' => $profile['name'],
@ -510,7 +510,7 @@ function get_birthdays() {
$url = $rr['url'];
if ($rr['network'] === NETWORK_DFRN) {
$sparkle = " sparkle";
$url = App::get_baseurl() . '/redir/' . $rr['cid'];
$url = System::baseUrl() . '/redir/' . $rr['cid'];
}
$rr['link'] = $url;
@ -524,7 +524,7 @@ function get_birthdays() {
}
$tpl = get_markup_template("birthdays_reminder.tpl");
return replace_macros($tpl, array(
'$baseurl' => App::get_baseurl(),
'$baseurl' => System::baseUrl(),
'$classtoday' => $classtoday,
'$count' => $total,
'$event_reminders' => t('Birthday Reminders'),
@ -612,7 +612,7 @@ function get_events() {
}
$tpl = get_markup_template("events_reminder.tpl");
return replace_macros($tpl, array(
'$baseurl' => App::get_baseurl(),
'$baseurl' => System::baseUrl(),
'$classtoday' => $classtoday,
'$count' => count($r),
'$event_reminders' => t('Event Reminders'),
@ -752,7 +752,7 @@ function advanced_profile(App $a) {
}
if ($a->profile['uid'] == local_user()) {
$profile['edit'] = array(App::get_baseurl(). '/profiles/'.$a->profile['id'], t('Edit profile'),"", t('Edit profile'));
$profile['edit'] = array(System::baseUrl(). '/profiles/'.$a->profile['id'], t('Edit profile'),"", t('Edit profile'));
}
return replace_macros($tpl, array(
@ -777,7 +777,7 @@ function profile_tabs($a, $is_owner=False, $nickname=Null) {
$tab = notags(trim($_GET['tab']));
}
$url = App::get_baseurl() . '/profile/' . $nickname;
$url = System::baseUrl() . '/profile/' . $nickname;
$tabs = array(
array(
@ -798,7 +798,7 @@ function profile_tabs($a, $is_owner=False, $nickname=Null) {
),
array(
'label' => t('Photos'),
'url' => App::get_baseurl() . '/photos/' . $nickname,
'url' => System::baseUrl() . '/photos/' . $nickname,
'sel' => ((!isset($tab) && $a->argv[0]=='photos') ? 'active' : ''),
'title' => t('Photo Albums'),
'id' => 'photo-tab',
@ -806,7 +806,7 @@ function profile_tabs($a, $is_owner=False, $nickname=Null) {
),
array(
'label' => t('Videos'),
'url' => App::get_baseurl() . '/videos/' . $nickname,
'url' => System::baseUrl() . '/videos/' . $nickname,
'sel' => ((!isset($tab) && $a->argv[0]=='videos') ? 'active' : ''),
'title' => t('Videos'),
'id' => 'video-tab',
@ -818,7 +818,7 @@ function profile_tabs($a, $is_owner=False, $nickname=Null) {
if ($is_owner && $a->theme_events_in_profile) {
$tabs[] = array(
'label' => t('Events'),
'url' => App::get_baseurl() . '/events',
'url' => System::baseUrl() . '/events',
'sel' =>((!isset($tab) && $a->argv[0]=='events') ? 'active' : ''),
'title' => t('Events and Calendar'),
'id' => 'events-tab',
@ -829,7 +829,7 @@ function profile_tabs($a, $is_owner=False, $nickname=Null) {
} elseif (! $is_owner) {
$tabs[] = array(
'label' => t('Events'),
'url' => App::get_baseurl() . '/cal/' . $nickname,
'url' => System::baseUrl() . '/cal/' . $nickname,
'sel' =>((!isset($tab) && $a->argv[0]=='cal') ? 'active' : ''),
'title' => t('Events and Calendar'),
'id' => 'events-tab',
@ -840,7 +840,7 @@ function profile_tabs($a, $is_owner=False, $nickname=Null) {
if ($is_owner) {
$tabs[] = array(
'label' => t('Personal Notes'),
'url' => App::get_baseurl() . '/notes',
'url' => System::baseUrl() . '/notes',
'sel' =>((!isset($tab) && $a->argv[0]=='notes') ? 'active' : ''),
'title' => t('Only You Can See This'),
'id' => 'notes-tab',
@ -851,7 +851,7 @@ function profile_tabs($a, $is_owner=False, $nickname=Null) {
if ((! $is_owner) && ((count($a->profile)) || (! $a->profile['hide-friends']))) {
$tabs[] = array(
'label' => t('Contacts'),
'url' => App::get_baseurl() . '/viewcontacts/' . $nickname,
'url' => System::baseUrl() . '/viewcontacts/' . $nickname,
'sel' => ((!isset($tab) && $a->argv[0]=='viewcontacts') ? 'active' : ''),
'title' => t('Contacts'),
'id' => 'viewcontacts-tab',

34
include/items.php

@ -223,7 +223,7 @@ function add_page_info_data($data) {
/// @todo make a positive list of allowed characters
$hashtag = str_replace(array(" ", "+", "/", ".", "#", "'", "โ€™", "`", "(", ")", "โ€ž", "โ€œ"),
array("", "", "", "", "", "", "", "", "", "", "", ""), $keyword);
$hashtags .= "#[url=" . App::get_baseurl() . "/search?tag=" . rawurlencode($hashtag) . "]" . $hashtag . "[/url] ";
$hashtags .= "#[url=" . System::baseUrl() . "/search?tag=" . rawurlencode($hashtag) . "]" . $hashtag . "[/url] ";
}
}
@ -271,7 +271,7 @@ function add_page_keywords($url, $no_photos = false, $photo = "", $keywords = fa
$tags .= ", ";
}
$tags .= "#[url=" . App::get_baseurl() . "/search?tag=" . rawurlencode($hashtag) . "]" . $hashtag . "[/url]";
$tags .= "#[url=" . System::baseUrl() . "/search?tag=" . rawurlencode($hashtag) . "]" . $hashtag . "[/url]";
}
}
@ -670,7 +670,7 @@ function item_store($arr, $force_parent = false, $notify = false, $dontcache = f
}
if ($arr['plink'] == "") {
$arr['plink'] = App::get_baseurl() . '/display/' . urlencode($arr['guid']);
$arr['plink'] = System::baseUrl() . '/display/' . urlencode($arr['guid']);
}
if ($arr['network'] == "") {
@ -842,7 +842,7 @@ function item_store($arr, $force_parent = false, $notify = false, $dontcache = f
$u = q("SELECT `nickname` FROM `user` WHERE `uid` = %d", intval($arr['uid']));
if (dbm::is_result($u)) {
$a = get_app();
$self = normalise_link(App::get_baseurl() . '/profile/' . $u[0]['nickname']);
$self = normalise_link(System::baseUrl() . '/profile/' . $u[0]['nickname']);
logger("item_store: 'myself' is ".$self." for parent ".$parent_id." checking again