From 3c24bed412235cf8c7a3f16b46fed18004abf87b Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 26 Aug 2017 06:04:21 +0000 Subject: [PATCH 1/3] New class "System" --- boot.php | 1 + include/Contact.php | 1 + include/Photo.php | 1 + include/Smilies.php | 1 + include/api.php | 1 + include/auth.php | 1 + include/bb2diaspora.php | 1 + include/bbcode.php | 1 + include/contact_widgets.php | 1 + include/conversation.php | 1 + include/dbstructure.php | 1 + include/delivery.php | 1 + include/dfrn.php | 1 + include/diaspora.php | 1 + include/enotify.php | 1 + include/event.php | 1 + include/follow.php | 1 + include/identity.php | 1 + include/items.php | 1 + include/like.php | 1 + include/message.php | 1 + include/nav.php | 1 + include/network.php | 1 + include/oauth.php | 1 + include/oembed.php | 1 + include/ostatus.php | 1 + include/plugin.php | 1 + include/poller.php | 1 + include/pubsubpublish.php | 1 + include/redir.php | 1 + include/security.php | 1 + include/socgraph.php | 1 + include/tags.php | 1 + include/text.php | 1 + include/threads.php | 1 + include/uimport.php | 1 + index.php | 1 + mod/admin.php | 1 + mod/allfriends.php | 1 + mod/bookmarklet.php | 1 + mod/cal.php | 1 + mod/contacts.php | 1 + mod/content.php | 1 + mod/delegate.php | 1 + mod/dfrn_confirm.php | 1 + mod/dfrn_poll.php | 1 + mod/dfrn_request.php | 1 + mod/dirfind.php | 1 + mod/display.php | 1 + mod/editpost.php | 1 + mod/events.php | 1 + mod/fbrowser.php | 1 + mod/fetch.php | 1 + mod/filerm.php | 1 + mod/follow.php | 1 + mod/friendica.php | 1 + mod/group.php | 1 + mod/hcard.php | 1 + mod/help.php | 1 + mod/home.php | 1 + mod/ignored.php | 1 + mod/install.php | 1 + mod/invite.php | 1 + mod/item.php | 1 + mod/like.php | 1 + mod/localtime.php | 3 +- mod/lostpass.php | 1 + mod/manage.php | 1 + mod/manifest.php | 1 + mod/match.php | 1 + mod/message.php | 1 + mod/mood.php | 1 + mod/msearch.php | 1 + mod/navigation.php | 1 + mod/network.php | 1 + mod/nodeinfo.php | 1 + mod/noscrape.php | 1 + mod/notice.php | 1 + mod/notify.php | 1 + mod/oexchange.php | 1 + mod/openid.php | 1 + mod/opensearch.php | 1 + mod/ostatus_subscribe.php | 1 + mod/p.php | 1 + mod/photos.php | 1 + mod/ping.php | 1 + mod/poke.php | 1 + mod/profile.php | 1 + mod/profile_photo.php | 1 + mod/profiles.php | 1 + mod/proxy.php | 1 + mod/randprof.php | 1 + mod/redir.php | 1 + mod/register.php | 1 + mod/regmod.php | 1 + mod/removeme.php | 1 + mod/repair_ostatus.php | 1 + mod/rsd_xml.php | 3 +- mod/settings.php | 1 + mod/starred.php | 1 + mod/subthread.php | 1 + mod/suggest.php | 1 + mod/tagger.php | 1 + mod/tagrm.php | 1 + mod/toggle_mobile.php | 1 + mod/uexport.php | 1 + mod/videos.php | 1 + mod/wall_upload.php | 1 + mod/xrd.php | 1 + src/Core/System.php | 75 ++++++++++++++++++++++++++++++ src/Network/Probe.php | 1 + view/theme/duepuntozero/config.php | 1 + view/theme/frio/config.php | 1 + view/theme/frio/theme.php | 1 + view/theme/frost-mobile/theme.php | 1 + view/theme/frost/theme.php | 1 + view/theme/quattro/config.php | 1 + view/theme/quattro/theme.php | 1 + view/theme/smoothly/theme.php | 1 + view/theme/vier/config.php | 1 + view/theme/vier/theme.php | 1 + 121 files changed, 197 insertions(+), 2 deletions(-) create mode 100644 src/Core/System.php diff --git a/boot.php b/boot.php index 358e884947..216a93496e 100644 --- a/boot.php +++ b/boot.php @@ -21,6 +21,7 @@ require_once(__DIR__ . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php'); use Friendica\App; +use Friendica\Core\System; use Friendica\Core\Config; use Friendica\Util\Lock; diff --git a/include/Contact.php b/include/Contact.php index f69454e39e..0dbe2ca133 100644 --- a/include/Contact.php +++ b/include/Contact.php @@ -1,6 +1,7 @@ friendica items permanent-url compatibility */ use Friendica\App; +use Friendica\Core\System; function notice_init(App $a) { diff --git a/mod/notify.php b/mod/notify.php index e380681934..f2a73ea2a8 100644 --- a/mod/notify.php +++ b/mod/notify.php @@ -1,6 +1,7 @@ use Friendica\App; +use Friendica\Core\System; define('PROXY_DEFAULT_TIME', 86400); // 1 Day diff --git a/mod/randprof.php b/mod/randprof.php index 8d9083ada4..7bdd9e4ee0 100644 --- a/mod/randprof.php +++ b/mod/randprof.php @@ -1,6 +1,7 @@ '; killme(); -} \ No newline at end of file +} diff --git a/mod/settings.php b/mod/settings.php index f13e89cd16..c09b4397df 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -1,6 +1,7 @@ get_baseurl($ssl); + } + + /** + * @brief Removes the baseurl from an url. This avoids some mixed content problems. + * + * @param string $orig_url + * + * @return string The cleaned url + */ + function removedBaseUrl($orig_url) { + self::init(); + return self::$a->remove_baseurl($orig_url); + } + + /// @todo Move the following functions from boot.php + /* + function get_guid($size = 16, $prefix = "") + function killme() + function goaway($s) + function local_user() + function public_contact() + function remote_user() + function notice($s) + function info($s) + function is_site_admin() + function random_digits($digits) + function get_server() + function get_temppath() + function get_cachefile($file, $writemode = true) + function get_itemcachepath() + function get_spoolpath() + function current_load() + */ +} diff --git a/src/Network/Probe.php b/src/Network/Probe.php index 5168e4c262..a8e9e642a3 100644 --- a/src/Network/Probe.php +++ b/src/Network/Probe.php @@ -9,6 +9,7 @@ namespace Friendica\Network; */ use Friendica\App; +use Friendica\Core\System; use Friendica\Core\Config; use dbm; diff --git a/view/theme/duepuntozero/config.php b/view/theme/duepuntozero/config.php index b1ec4bae53..c2bb1a0706 100644 --- a/view/theme/duepuntozero/config.php +++ b/view/theme/duepuntozero/config.php @@ -5,6 +5,7 @@ */ use Friendica\App; +use Friendica\Core\System; function theme_content(App $a) { if (!local_user()) { diff --git a/view/theme/frio/config.php b/view/theme/frio/config.php index 229e863e93..eaa2585ad9 100644 --- a/view/theme/frio/config.php +++ b/view/theme/frio/config.php @@ -1,6 +1,7 @@ sourcename = 'Friendica mobile web'; diff --git a/view/theme/frost/theme.php b/view/theme/frost/theme.php index b09153876d..a3f4e011dd 100644 --- a/view/theme/frost/theme.php +++ b/view/theme/frost/theme.php @@ -10,6 +10,7 @@ */ use Friendica\App; +use Friendica\Core\System; function frost_init(App $a) { $a->videowidth = 400; diff --git a/view/theme/quattro/config.php b/view/theme/quattro/config.php index 47210012ca..9b3a65e3d2 100644 --- a/view/theme/quattro/config.php +++ b/view/theme/quattro/config.php @@ -5,6 +5,7 @@ */ use Friendica\App; +use Friendica\Core\System; function theme_content(App $a) { if (!local_user()) { diff --git a/view/theme/quattro/theme.php b/view/theme/quattro/theme.php index 5647fd493a..624e869043 100644 --- a/view/theme/quattro/theme.php +++ b/view/theme/quattro/theme.php @@ -8,6 +8,7 @@ */ use Friendica\App; +use Friendica\Core\System; function quattro_init(App $a) { $a->page['htmlhead'] .= ''; diff --git a/view/theme/smoothly/theme.php b/view/theme/smoothly/theme.php index 00f1147211..ab049b03b7 100644 --- a/view/theme/smoothly/theme.php +++ b/view/theme/smoothly/theme.php @@ -11,6 +11,7 @@ */ use Friendica\App; +use Friendica\Core\System; function smoothly_init(App $a) { set_template_engine($a, 'smarty3'); diff --git a/view/theme/vier/config.php b/view/theme/vier/config.php index 0747770d36..5a20e131b9 100644 --- a/view/theme/vier/config.php +++ b/view/theme/vier/config.php @@ -5,6 +5,7 @@ */ use Friendica\App; +use Friendica\Core\System; function theme_content(App $a) { if (!local_user()) { diff --git a/view/theme/vier/theme.php b/view/theme/vier/theme.php index 298f0df57f..ee1751e4a0 100644 --- a/view/theme/vier/theme.php +++ b/view/theme/vier/theme.php @@ -10,6 +10,7 @@ */ use Friendica\App; +use Friendica\Core\System; require_once "include/plugin.php"; require_once "include/socgraph.php"; From 5adfeb0bd5fed2f793332056c03bb7c043d5fc69 Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 26 Aug 2017 07:32:10 +0000 Subject: [PATCH 2/3] App::get_baseurl is now replaced with System::baseUrl --- boot.php | 29 +++------- include/Contact.php | 14 ++--- include/ForumManager.php | 3 +- include/Photo.php | 24 ++++----- include/Smilies.php | 72 ++++++++++++------------- include/api.php | 44 +++++++-------- include/auth.php | 14 ++--- include/bb2diaspora.php | 4 +- include/bbcode.php | 10 ++-- include/contact_widgets.php | 2 +- include/conversation.php | 16 +++--- include/dbstructure.php | 4 +- include/delivery.php | 2 +- include/dfrn.php | 24 ++++----- include/diaspora.php | 14 ++--- include/enotify.php | 10 ++-- include/event.php | 6 +-- include/follow.php | 2 +- include/identity.php | 30 +++++------ include/items.php | 34 ++++++------ include/like.php | 4 +- include/message.php | 10 ++-- include/nav.php | 4 +- include/network.php | 4 +- include/oauth.php | 2 +- include/oembed.php | 4 +- include/ostatus.php | 24 ++++----- include/plugin.php | 4 +- include/poller.php | 2 +- include/pubsubpublish.php | 2 +- include/redir.php | 2 +- include/security.php | 8 +-- include/socgraph.php | 12 ++--- include/tags.php | 2 +- include/text.php | 8 +-- include/threads.php | 2 +- include/uimport.php | 4 +- include/user.php | 30 ++++++----- index.php | 10 ++-- mod/admin.php | 42 +++++++-------- mod/allfriends.php | 2 +- mod/bookmarklet.php | 2 +- mod/cal.php | 12 ++--- mod/contacts.php | 14 ++--- mod/content.php | 10 ++-- mod/delegate.php | 14 ++--- mod/dfrn_confirm.php | 10 ++-- mod/dfrn_poll.php | 16 +++--- mod/dfrn_request.php | 28 +++++----- mod/dirfind.php | 2 +- mod/display.php | 10 ++-- mod/editpost.php | 6 +-- mod/events.php | 22 ++++---- mod/fbrowser.php | 10 ++-- mod/fetch.php | 2 +- mod/filerm.php | 2 +- mod/follow.php | 6 +-- mod/friendica.php | 8 +-- mod/group.php | 10 ++-- mod/hcard.php | 8 +-- mod/help.php | 2 +- mod/home.php | 6 +-- mod/hostxrd.php | 9 ++-- mod/ignored.php | 2 +- mod/install.php | 14 ++--- mod/invite.php | 6 +-- mod/item.php | 20 +++---- mod/like.php | 2 +- mod/localtime.php | 2 +- mod/login.php | 3 +- mod/lostpass.php | 16 +++--- mod/manage.php | 2 +- mod/manifest.php | 2 +- mod/match.php | 6 +-- mod/message.php | 24 ++++----- mod/mood.php | 2 +- mod/msearch.php | 4 +- mod/navigation.php | 2 +- mod/network.php | 2 +- mod/nodeinfo.php | 2 +- mod/noscrape.php | 4 +- mod/notice.php | 2 +- mod/notifications.php | 3 +- mod/notify.php | 6 +-- mod/oexchange.php | 4 +- mod/openid.php | 12 ++--- mod/opensearch.php | 2 +- mod/ostatus_subscribe.php | 4 +- mod/p.php | 2 +- mod/photos.php | 22 ++++---- mod/ping.php | 10 ++-- mod/poke.php | 8 +-- mod/profile.php | 16 +++--- mod/profile_photo.php | 20 +++---- mod/profiles.php | 6 +-- mod/proxy.php | 10 ++-- mod/randprof.php | 2 +- mod/redir.php | 8 +-- mod/register.php | 18 +++---- mod/regmod.php | 8 +-- mod/removeme.php | 4 +- mod/repair_ostatus.php | 2 +- mod/rsd_xml.php | 2 +- mod/settings.php | 18 +++---- mod/starred.php | 2 +- mod/subthread.php | 4 +- mod/suggest.php | 6 +-- mod/tagger.php | 16 +++--- mod/tagrm.php | 16 +++--- mod/toggle_mobile.php | 2 +- mod/uexport.php | 4 +- mod/videos.php | 28 +++++----- mod/wall_upload.php | 10 ++-- mod/xrd.php | 20 +++---- src/App.php | 14 +---- src/Core/System.php | 2 - src/Network/Probe.php | 2 +- view/php/default.php | 2 +- view/php/minimal.php | 2 +- view/theme/duepuntozero/config.php | 2 +- view/theme/frio/config.php | 2 +- view/theme/frio/php/default.php | 4 +- view/theme/frio/php/standard.php | 4 +- view/theme/frio/theme.php | 2 +- view/theme/frost-mobile/php/default.php | 2 +- view/theme/frost-mobile/theme.php | 4 +- view/theme/frost/php/default.php | 2 +- view/theme/frost/theme.php | 4 +- view/theme/quattro/config.php | 2 +- view/theme/quattro/theme.php | 4 +- view/theme/smoothly/php/default.php | 2 +- view/theme/smoothly/theme.php | 4 +- view/theme/vier/config.php | 2 +- view/theme/vier/theme.php | 4 +- 134 files changed, 603 insertions(+), 624 deletions(-) diff --git a/boot.php b/boot.php index 216a93496e..ac6cbc9550 100644 --- a/boot.php +++ b/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"); diff --git a/include/Contact.php b/include/Contact.php index 0dbe2ca133..95c7979aac 100644 --- a/include/Contact.php +++ b/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: diff --git a/include/ForumManager.php b/include/ForumManager.php index 0d782e6870..8473035aff 100644 --- a/include/ForumManager.php +++ b/include/ForumManager.php @@ -1,6 +1,7 @@ $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; diff --git a/include/Photo.php b/include/Photo.php index 7cdab27a02..f02ee130a0 100644 --- a/include/Photo.php +++ b/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(); } } diff --git a/include/Smilies.php b/include/Smilies.php index 488f3c55c1..d63511cd1d 100644 --- a/include/Smilies.php +++ b/include/Smilies.php @@ -87,41 +87,41 @@ class Smilies { ); $icons = array( - '<3', - '</3', - '<\\3', - ':-)', - ';-)', - ':-(', - ':-P', - ':-p', - ':-\', - ':-\', - ':-x', - ':-X', - ':-D', - '8-|', - '8-O', - ':-O', - '\\o/', - 'o.O', - 'O.o', - 'o_O', - 'O_o', - ':\'(', - ':-!', - ':-/', - ':-[', - '8-)', - ':beer', - ':homebrew', - ':coffee', - ':facepalm', - ':like', - ':dislike', - '~friendica ~friendica', - 'redred#matrix', - 'redred#matrixmatrix' + '<3', + '</3', + '<\\3', + ':-)', + ';-)', + ':-(', + ':-P', + ':-p', + ':-\', + ':-\', + ':-x', + ':-X', + ':-D', + '8-|', + '8-O', + ':-O', + '\\o/', + 'o.O', + 'O.o', + 'o_O', + 'O_o', + ':\'(', + ':-!', + ':-/', + ':-[', + '8-)', + ':beer', + ':homebrew', + ':coffee', + ':facepalm', + ':like', + ':dislike', + '~friendica ~friendica', + 'redred#matrix', + 'redred#matrixmatrix' ); $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 .= '<3'; + $t .= '<3'; $r = str_replace($x[0],$t,$x[0]); return $r; } diff --git a/include/api.php b/include/api.php index 31d5ddd97e..62e874145e 100644 --- a/include/api.php +++ b/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++; } } diff --git a/include/auth.php b/include/auth.php index 148afb3031..f220e1685b 100644 --- a/include/auth.php +++ b/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.').'

'.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']) { diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php index 8a64ba7fde..20309b9d20 100644 --- a/include/bb2diaspora.php +++ b/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'])) { diff --git a/include/bbcode.php b/include/bbcode.php index c4d35d3c42..aabf261616 100644 --- a/include/bbcode.php +++ b/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})/', 'acct:$1@$2', $Text); + $Text = preg_replace('/acct:([^@]+)@((?!\-)(?:[a-zA-Z\d\-]{0,62}[a-zA-Z\d]\.){1,126}(?!\d+)[a-zA-Z\d]{1,63})/', 'acct:$1@$2', $Text); // Perform MAIL Search $Text = preg_replace("/\[mail\]([$MAILSearchString]*)\[\/mail\]/", '$1', $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", '
' . t('Encrypted content') . '
', $Text); - $Text = preg_replace("/\[crypt(.*?)\](.*?)\[\/crypt\]/ism", '
' . t('Encrypted content') . '
', $Text); - //$Text = preg_replace("/\[crypt=(.*?)\](.*?)\[\/crypt\]/ism", '
' . t('Encrypted content') . '
', $Text); + $Text = preg_replace("/\[crypt\](.*?)\[\/crypt\]/ism", '
' . t('Encrypted content') . '
', $Text); + $Text = preg_replace("/\[crypt(.*?)\](.*?)\[\/crypt\]/ism", '
' . t('Encrypted content') . '
', $Text); + //$Text = preg_replace("/\[crypt=(.*?)\](.*?)\[\/crypt\]/ism", '
' . t('Encrypted content') . '
', $Text); // Try to Oembed if ($tryoembed) { diff --git a/include/contact_widgets.php b/include/contact_widgets.php index 2073e40f70..b359781ffd 100644 --- a/include/contact_widgets.php +++ b/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' : ''), diff --git a/include/conversation.php b/include/conversation.php index 759712c47c..8d3ee98a26 100644 --- a/include/conversation.php +++ b/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 everybody'), @@ -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 everybody'), @@ -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']), diff --git a/include/dbstructure.php b/include/dbstructure.php index 4b8deca0d2..a2599fc392 100644 --- a/include/dbstructure.php +++ b/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, diff --git a/include/delivery.php b/include/delivery.php index 507e17f4a5..f95caed295 100644 --- a/include/delivery.php +++ b/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']) { diff --git a/include/dfrn.php b/include/dfrn.php index 6065697ba7..4c8f828af6 100644 --- a/include/dfrn.php +++ b/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"])) diff --git a/include/diaspora.php b/include/diaspora.php index d6bd8e7d56..4cc177a15b 100644 --- a/include/diaspora.php +++ b/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 = ''; $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') { diff --git a/include/enotify.php b/include/enotify.php index 09482a410b..62328c01fd 100644 --- a/include/enotify.php +++ b/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: \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"]; diff --git a/include/event.php b/include/event.php index 609e058d76..7840032c77 100644 --- a/include/event.php +++ b/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')); diff --git a/include/follow.php b/include/follow.php index 6f3f24b748..48e23bff62 100644 --- a/include/follow.php +++ b/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()); } diff --git a/include/identity.php b/include/identity.php index c25621c391..3686b23d2d 100644 --- a/include/identity.php +++ b/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', diff --git a/include/items.php b/include/items.php index 0586e71844..e8ec81277c 100644 --- a/include/items.php +++ b/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 against ".$arr['author-link']." and ".$arr['owner-link'], LOGGER_DEBUG); if ((normalise_link($arr['author-link']) == $self) || (normalise_link($arr['owner-link']) == $self)) { dba::update('thread', array('mention' => true), array('iid' => $parent_id)); @@ -1182,10 +1182,10 @@ function item_body_set_hashtags(&$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=".App::get_baseurl()."/search?tag=$2]$2[/url]", $item["body"]); + "#[url=".System::baseUrl()."/search?tag=$2]$2[/url]", $item["body"]); $item["tag"] = preg_replace("/#\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism", - "#[url=".App::get_baseurl()."/search?tag=$2]$2[/url]", $item["tag"]); + "#[url=".System::baseUrl()."/search?tag=$2]$2[/url]", $item["tag"]); } // mask hashtags inside of url, bookmarks and attachments to avoid urls in urls @@ -1215,7 +1215,7 @@ function item_body_set_hashtags(&$item) { $basetag = str_replace('_',' ',substr($tag,1)); - $newtag = '#[url=' . App::get_baseurl() . '/search?tag=' . rawurlencode($basetag) . ']' . $basetag . '[/url]'; + $newtag = '#[url=' . System::baseUrl() . '/search?tag=' . rawurlencode($basetag) . ']' . $basetag . '[/url]'; $item["body"] = str_replace($tag, $newtag, $item["body"]); @@ -1325,13 +1325,13 @@ function tag_deliver($uid, $item_id) { $item = $i[0]; - $link = normalise_link(App::get_baseurl() . '/profile/' . $u[0]['nickname']); + $link = normalise_link(System::baseUrl() . '/profile/' . $u[0]['nickname']); /* * Diaspora uses their own hardwired link URL in @-tags * instead of the one we supply with webfinger */ - $dlink = normalise_link(App::get_baseurl() . '/u/' . $u[0]['nickname']); + $dlink = normalise_link(System::baseUrl() . '/u/' . $u[0]['nickname']); $cnt = preg_match_all('/[\@\!]\[url\=(.*?)\](.*?)\[\/url\]/ism', $item['body'], $matches, PREG_SET_ORDER); if ($cnt) { @@ -1428,13 +1428,13 @@ function tgroup_check($uid, $item) { $community_page = (($u[0]['page-flags'] == PAGE_COMMUNITY) ? true : false); $prvgroup = (($u[0]['page-flags'] == PAGE_PRVGROUP) ? true : false); - $link = normalise_link(App::get_baseurl() . '/profile/' . $u[0]['nickname']); + $link = normalise_link(System::baseUrl() . '/profile/' . $u[0]['nickname']); /* * Diaspora uses their own hardwired link URL in @-tags * instead of the one we supply with webfinger */ - $dlink = normalise_link(App::get_baseurl() . '/u/' . $u[0]['nickname']); + $dlink = normalise_link(System::baseUrl() . '/u/' . $u[0]['nickname']); $cnt = preg_match_all('/[\@\!]\[url\=(.*?)\](.*?)\[\/url\]/ism', $item['body'], $matches, PREG_SET_ORDER); if ($cnt) { @@ -1699,7 +1699,7 @@ function new_follower($importer, $contact, $datarray, $item, $sharing = false) { 'to_name' => $r[0]['username'], 'to_email' => $r[0]['email'], 'uid' => $r[0]['uid'], - 'link' => App::get_baseurl() . '/notifications/intro', + 'link' => System::baseUrl() . '/notifications/intro', 'source_name' => ((strlen(stripslashes($contact_record['name']))) ? stripslashes($contact_record['name']) : t('[Name Withheld]')), 'source_link' => $contact_record['url'], 'source_photo' => $contact_record['photo'], @@ -1785,7 +1785,7 @@ function fix_private_photos($s, $uid, $item = null, $cid = 0) { $a = get_app(); logger('fix_private_photos: check for photos', LOGGER_DEBUG); - $site = substr(App::get_baseurl(),strpos(App::get_baseurl(),'://')); + $site = substr(System::baseUrl(),strpos(System::baseUrl(),'://')); $orig_body = $s; $new_body = ''; @@ -2077,7 +2077,7 @@ function drop_item($id, $interactive = true) { return 0; } notice( t('Item not found.') . EOL); - goaway(App::get_baseurl() . '/' . $_SESSION['return_url']); + goaway(System::baseUrl() . '/' . $_SESSION['return_url']); } $item = $r[0]; @@ -2129,7 +2129,7 @@ function drop_item($id, $interactive = true) { } // Now check how the user responded to the confirmation query if ($_REQUEST['canceled']) { - goaway(App::get_baseurl() . '/' . $_SESSION['return_url']); + goaway(System::baseUrl() . '/' . $_SESSION['return_url']); } logger('delete item: ' . $item['id'], LOGGER_DEBUG); @@ -2254,14 +2254,14 @@ function drop_item($id, $interactive = true) { if (! $interactive) { return $owner; } - goaway(App::get_baseurl() . '/' . $_SESSION['return_url']); + goaway(System::baseUrl() . '/' . $_SESSION['return_url']); //NOTREACHED } else { if (! $interactive) { return 0; } notice( t('Permission denied.') . EOL); - goaway(App::get_baseurl() . '/' . $_SESSION['return_url']); + goaway(System::baseUrl() . '/' . $_SESSION['return_url']); //NOTREACHED } diff --git a/include/like.php b/include/like.php index 37241790b2..bce1c776f3 100644 --- a/include/like.php +++ b/include/like.php @@ -184,7 +184,7 @@ function do_like($item_id, $verb) { $post_type = t('event'); } $objtype = $item['resource-id'] ? ACTIVITY_OBJ_IMAGE : ACTIVITY_OBJ_NOTE ; - $link = xmlify('' . "\n") ; + $link = xmlify('' . "\n") ; $body = $item['body']; $obj = <<< EOT @@ -201,7 +201,7 @@ EOT; $ulink = '[url=' . $author_contact['url'] . ']' . $author_contact['name'] . '[/url]'; $alink = '[url=' . $item['author-link'] . ']' . $item['author-name'] . '[/url]'; - $plink = '[url=' . App::get_baseurl() . '/display/' . $owner_self_contact['nick'] . '/' . $item['id'] . ']' . $post_type . '[/url]'; + $plink = '[url=' . System::baseUrl() . '/display/' . $owner_self_contact['nick'] . '/' . $item['id'] . ']' . $post_type . '[/url]'; $new_item = array( 'guid' => get_guid(32), diff --git a/include/message.php b/include/message.php index 410dc6b394..6800663b5c 100644 --- a/include/message.php +++ b/include/message.php @@ -27,7 +27,7 @@ function send_message($recipient=0, $body='', $subject='', $replyto=''){ } $guid = get_guid(32); - $uri = 'urn:X-dfrn:' . App::get_baseurl() . ':' . local_user() . ':' . $guid; + $uri = 'urn:X-dfrn:' . System::baseUrl() . ':' . local_user() . ':' . $guid; $convid = 0; $reply = false; @@ -53,7 +53,7 @@ function send_message($recipient=0, $body='', $subject='', $replyto=''){ $recip_host = substr($recip_host,0,strpos($recip_host,'/')); $recip_handle = (($contact[0]['addr']) ? $contact[0]['addr'] : $contact[0]['nick'] . '@' . $recip_host); - $sender_handle = $a->user['nickname'] . '@' . substr(App::get_baseurl(), strpos(App::get_baseurl(),'://') + 3); + $sender_handle = $a->user['nickname'] . '@' . substr(System::baseUrl(), strpos(System::baseUrl(),'://') + 3); $conv_guid = get_guid(32); $convuri = $recip_handle.':'.$conv_guid; @@ -134,7 +134,7 @@ function send_message($recipient=0, $body='', $subject='', $replyto=''){ $images = $match[1]; if (count($images)) { foreach ($images as $image) { - if (! stristr($image,App::get_baseurl() . '/photo/')) { + if (! stristr($image,System::baseUrl() . '/photo/')) { continue; } $image_uri = substr($image,strrpos($image,'/') + 1); @@ -170,7 +170,7 @@ function send_wallmessage($recipient='', $body='', $subject='', $replyto=''){ } $guid = get_guid(32); - $uri = 'urn:X-dfrn:' . App::get_baseurl() . ':' . local_user() . ':' . $guid; + $uri = 'urn:X-dfrn:' . System::baseUrl() . ':' . local_user() . ':' . $guid; $convid = 0; $reply = false; @@ -185,7 +185,7 @@ function send_wallmessage($recipient='', $body='', $subject='', $replyto=''){ $conv_guid = get_guid(32); - $recip_handle = $recipient['nickname'] . '@' . substr(App::get_baseurl(), strpos(App::get_baseurl(),'://') + 3); + $recip_handle = $recipient['nickname'] . '@' . substr(System::baseUrl(), strpos(System::baseUrl(),'://') + 3); $sender_nick = basename($replyto); $sender_host = substr($replyto,strpos($replyto,'://')+3); diff --git a/include/nav.php b/include/nav.php index 7966096368..382b89cfec 100644 --- a/include/nav.php +++ b/include/nav.php @@ -31,7 +31,7 @@ function nav(App $a) { $tpl = get_markup_template('nav.tpl'); $a->page['nav'] .= replace_macros($tpl, array( - '$baseurl' => App::get_baseurl(), + '$baseurl' => System::baseUrl(), '$sitelocation' => $nav_info['sitelocation'], '$nav' => $nav_info['nav'], '$banner' => $nav_info['banner'], @@ -68,7 +68,7 @@ function nav_info(App $a) $myident = ((is_array($a->user) && isset($a->user['nickname'])) ? $a->user['nickname'] . '@' : ''); - $sitelocation = $myident . substr(App::get_baseurl($ssl_state), strpos(App::get_baseurl($ssl_state), '//') + 2 ); + $sitelocation = $myident . substr(System::baseUrl($ssl_state), strpos(System::baseUrl($ssl_state), '//') + 2 ); // nav links: array of array('href', 'text', 'extra css classes', 'title') $nav = array(); diff --git a/include/network.php b/include/network.php index 08c038ec7d..4b1ddab033 100644 --- a/include/network.php +++ b/include/network.php @@ -612,7 +612,7 @@ function avatar_img($email) { call_hooks('avatar_lookup', $avatar); if (! $avatar['success']) { - $avatar['url'] = App::get_baseurl() . '/images/person-175.jpg'; + $avatar['url'] = System::baseUrl() . '/images/person-175.jpg'; } logger('Avatar: ' . $avatar['email'] . ' ' . $avatar['url'], LOGGER_DEBUG); @@ -661,7 +661,7 @@ function scale_external_images($srctext, $include_link = true, $scale_replace = foreach ($matches as $mtch) { logger('scale_external_image: ' . $mtch[1]); - $hostname = str_replace('www.','',substr(App::get_baseurl(),strpos(App::get_baseurl(),'://')+3)); + $hostname = str_replace('www.','',substr(System::baseUrl(),strpos(System::baseUrl(),'://')+3)); if (stristr($mtch[1],$hostname)) { continue; } diff --git a/include/oauth.php b/include/oauth.php index 61fbecb79a..ce22086d12 100644 --- a/include/oauth.php +++ b/include/oauth.php @@ -151,7 +151,7 @@ class FKOAuth1 extends OAuthServer { $_SESSION['mobile-theme'] = get_pconfig($record['uid'], 'system', 'mobile_theme'); $_SESSION['authenticated'] = 1; $_SESSION['page_flags'] = $record['page-flags']; - $_SESSION['my_url'] = App::get_baseurl() . '/profile/' . $record['nickname']; + $_SESSION['my_url'] = System::baseUrl() . '/profile/' . $record['nickname']; $_SESSION['addr'] = $_SERVER['REMOTE_ADDR']; $_SESSION["allow_api"] = true; diff --git a/include/oembed.php b/include/oembed.php index 2124efa5c8..715a0ba5bd 100755 --- a/include/oembed.php +++ b/include/oembed.php @@ -153,7 +153,7 @@ function oembed_format_object($j){ $th=120; $tw = $th*$tr; $tpl=get_markup_template('oembed_video.tpl'); $ret.=replace_macros($tpl, array( - '$baseurl' => App::get_baseurl(), + '$baseurl' => System::baseUrl(), '$embedurl' => $embedurl, '$escapedhtml' => base64_encode($jhtml), '$tw' => $tw, @@ -250,7 +250,7 @@ function oembed_iframe($src, $width, $height) { } $width = '100%'; - $s = App::get_baseurl() . '/oembed/' . base64url_encode($src); + $s = System::baseUrl() . '/oembed/' . base64url_encode($src); return ''; } diff --git a/include/ostatus.php b/include/ostatus.php index 2027ad2815..cd626201fc 100644 --- a/include/ostatus.php +++ b/include/ostatus.php @@ -457,7 +457,7 @@ class ostatus { if (strlen($item["tag"])) { $item["tag"] .= ','; } - $item["tag"] .= "#[url=".App::get_baseurl()."/search?tag=".$term."]".$term."[/url]"; + $item["tag"] .= "#[url=".System::baseUrl()."/search?tag=".$term."]".$term."[/url]"; } } } @@ -1453,7 +1453,7 @@ class ostatus { $attributes = array("uri" => "https://friendi.ca", "version" => FRIENDICA_VERSION."-".DB_UPDATE_VERSION); xml::add_element($doc, $root, "generator", FRIENDICA_PLATFORM, $attributes); - 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", sprintf("%s timeline", $owner["name"])); xml::add_element($doc, $root, "subtitle", sprintf("Updates from %s on %s", $owner["name"], $a->config["sitename"])); xml::add_element($doc, $root, "logo", $owner["photo"]); @@ -1466,23 +1466,23 @@ class ostatus { xml::add_element($doc, $root, "link", "", $attributes); /// @TODO We have to find out what this is - /// $attributes = array("href" => App::get_baseurl()."/sup", + /// $attributes = array("href" => System::baseUrl()."/sup", /// "rel" => "http://api.friendfeed.com/2008/03#sup", /// "type" => "application/json"); /// xml::add_element($doc, $root, "link", "", $attributes); self::hublinks($doc, $root, $owner["nick"]); - $attributes = array("href" => App::get_baseurl()."/salmon/".$owner["nick"], "rel" => "salmon"); + $attributes = array("href" => System::baseUrl()."/salmon/".$owner["nick"], "rel" => "salmon"); xml::add_element($doc, $root, "link", "", $attributes); - $attributes = array("href" => App::get_baseurl()."/salmon/".$owner["nick"], "rel" => "http://salmon-protocol.org/ns/salmon-replies"); + $attributes = array("href" => System::baseUrl()."/salmon/".$owner["nick"], "rel" => "http://salmon-protocol.org/ns/salmon-replies"); xml::add_element($doc, $root, "link", "", $attributes); - $attributes = array("href" => App::get_baseurl()."/salmon/".$owner["nick"], "rel" => "http://salmon-protocol.org/ns/salmon-mention"); + $attributes = array("href" => System::baseUrl()."/salmon/".$owner["nick"], "rel" => "http://salmon-protocol.org/ns/salmon-mention"); xml::add_element($doc, $root, "link", "", $attributes); - $attributes = array("href" => App::get_baseurl()."/api/statuses/user_timeline/".$owner["nick"].".atom", + $attributes = array("href" => System::baseUrl()."/api/statuses/user_timeline/".$owner["nick"].".atom", "rel" => "self", "type" => "application/atom+xml"); xml::add_element($doc, $root, "link", "", $attributes); @@ -1496,7 +1496,7 @@ class ostatus { * @param object $root XML root element where the hub links are added */ public static function hublinks($doc, $root, $nick) { - $h = App::get_baseurl() . '/pubsubhubbub/'.$nick; + $h = System::baseUrl() . '/pubsubhubbub/'.$nick; xml::add_element($doc, $root, "link", "", array("href" => $h, "rel" => "hub")); } @@ -1626,7 +1626,7 @@ class ostatus { } if (count($profile)) { - xml::add_element($doc, $author, "followers", "", array("url" => App::get_baseurl()."/viewcontacts/".$owner["nick"])); + xml::add_element($doc, $author, "followers", "", array("url" => System::baseUrl()."/viewcontacts/".$owner["nick"])); xml::add_element($doc, $author, "statusnet:profile_info", "", array("local_id" => $owner["uid"])); } @@ -2067,7 +2067,7 @@ class ostatus { xml::add_element($doc, $entry, "content", $body, array("type" => "html")); 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"])); if ($complete && ($item["id"] > 0)) xml::add_element($doc, $entry, "status_net", "", array("notice_id" => $item["id"])); @@ -2105,7 +2105,7 @@ class ostatus { } else { $mentioned[$parent[0]["author-link"]] = $parent[0]["author-link"]; $mentioned[$parent[0]["owner-link"]] = $parent[0]["owner-link"]; - $parent_plink = App::get_baseurl()."/display/".$parent[0]["guid"]; + $parent_plink = System::baseUrl()."/display/".$parent[0]["guid"]; } $attributes = array( @@ -2120,7 +2120,7 @@ class ostatus { } if (intval($item["parent"]) > 0) { - $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)) { diff --git a/include/plugin.php b/include/plugin.php index 79512ccf5f..d5bceafdea 100644 --- a/include/plugin.php +++ b/include/plugin.php @@ -402,10 +402,10 @@ function get_theme_screenshot($theme) { $exts = array('.png','.jpg'); foreach ($exts as $ext) { if (file_exists('view/theme/' . $theme . '/screenshot' . $ext)) { - return(App::get_baseurl() . '/view/theme/' . $theme . '/screenshot' . $ext); + return(System::baseUrl() . '/view/theme/' . $theme . '/screenshot' . $ext); } } - return(App::get_baseurl() . '/images/blank.png'); + return(System::baseUrl() . '/images/blank.png'); } // install and uninstall theme diff --git a/include/poller.php b/include/poller.php index 7524c3ad07..9758ab9464 100644 --- a/include/poller.php +++ b/include/poller.php @@ -800,7 +800,7 @@ function call_worker() { return; } - $url = App::get_baseurl()."/worker"; + $url = System::baseUrl()."/worker"; fetch_url($url, false, $redirects, 1); } diff --git a/include/pubsubpublish.php b/include/pubsubpublish.php index eeb071e1fa..23348d6d70 100644 --- a/include/pubsubpublish.php +++ b/include/pubsubpublish.php @@ -55,7 +55,7 @@ function handle_pubsubhubbub($id) { $headers = array("Content-type: application/atom+xml", sprintf("Link: <%s>;rel=hub,<%s>;rel=self", - App::get_baseurl().'/pubsubhubbub/'.$rr['nickname'], + System::baseUrl().'/pubsubhubbub/'.$rr['nickname'], $rr['topic']), "X-Hub-Signature: sha1=".$hmac_sig); diff --git a/include/redir.php b/include/redir.php index bc4f9714b7..8c04d711ed 100644 --- a/include/redir.php +++ b/include/redir.php @@ -23,7 +23,7 @@ function auto_redir(App $a, $contact_nick) { // // We also have to make sure that I'm a legitimate contact--I'm not blocked or pending. - $baseurl = App::get_baseurl(); + $baseurl = System::baseUrl(); $domain_st = strpos($baseurl, "://"); if ($domain_st === false) return; diff --git a/include/security.php b/include/security.php index 355faaea2e..ffab0e0953 100644 --- a/include/security.php +++ b/include/security.php @@ -51,8 +51,8 @@ function authenticate_success($user_record, $login_initial = false, $interactive $_SESSION['mobile-theme'] = get_pconfig($user_record['uid'], 'system', 'mobile_theme'); $_SESSION['authenticated'] = 1; $_SESSION['page_flags'] = $user_record['page-flags']; - $_SESSION['my_url'] = App::get_baseurl() . '/profile/' . $user_record['nickname']; - $_SESSION['my_address'] = $user_record['nickname'] . '@' . substr(App::get_baseurl(),strpos(App::get_baseurl(),'://')+3); + $_SESSION['my_url'] = System::baseUrl() . '/profile/' . $user_record['nickname']; + $_SESSION['my_address'] = $user_record['nickname'] . '@' . substr(System::baseUrl(),strpos(System::baseUrl(),'://')+3); $_SESSION['addr'] = $_SERVER['REMOTE_ADDR']; $a->user = $user_record; @@ -148,7 +148,7 @@ function authenticate_success($user_record, $login_initial = false, $interactive call_hooks('logged_in', $a->user); if (($a->module !== 'home') && isset($_SESSION['return_url'])) { - goaway(App::get_baseurl() . '/' . $_SESSION['return_url']); + goaway(System::baseUrl() . '/' . $_SESSION['return_url']); } } } @@ -429,7 +429,7 @@ function check_form_security_token_redirectOnErr($err_redirect, $typename = '', logger('check_form_security_token failed: user ' . $a->user['guid'] . ' - form element ' . $typename); logger('check_form_security_token failed: _REQUEST data: ' . print_r($_REQUEST, true), LOGGER_DATA); notice( check_form_security_std_err_msg() ); - goaway(App::get_baseurl() . $err_redirect ); + goaway(System::baseUrl() . $err_redirect ); } } function check_form_security_token_ForbiddenOnErr($typename = '', $formname = 'form_security_token') { diff --git a/include/socgraph.php b/include/socgraph.php index e0288fc464..0a28a177f8 100644 --- a/include/socgraph.php +++ b/include/socgraph.php @@ -244,7 +244,7 @@ function sanitize_gcontact($gcontact) { $alternate = poco_alternate_ostatus_url($gcontact['url']); // The global contacts should contain the original picture, not the cached one - if (($gcontact['generation'] != 1) && stristr(normalise_link($gcontact['photo']), normalise_link(App::get_baseurl()."/photo/"))) { + if (($gcontact['generation'] != 1) && stristr(normalise_link($gcontact['photo']), normalise_link(System::baseUrl()."/photo/"))) { $gcontact['photo'] = ""; } @@ -1634,9 +1634,9 @@ function update_suggestions() { $done = array(); /// @TODO Check if it is really neccessary to poll the own server - poco_load(0, 0, 0, App::get_baseurl() . '/poco'); + poco_load(0, 0, 0, System::baseUrl() . '/poco'); - $done[] = App::get_baseurl() . '/poco'; + $done[] = System::baseUrl() . '/poco'; if (strlen(get_config('system','directory'))) { $x = fetch_url(get_server()."/pubsites"); @@ -2321,7 +2321,7 @@ function update_gcontact_for_user($uid) { // The "addr" field was added in 3.4.3 so it can be empty for older users if ($r[0]["addr"] != "") { - $addr = $r[0]["nickname"].'@'.str_replace(array("http://", "https://"), "", App::get_baseurl()); + $addr = $r[0]["nickname"].'@'.str_replace(array("http://", "https://"), "", System::baseUrl()); } else { $addr = $r[0]["addr"]; } @@ -2332,7 +2332,7 @@ function update_gcontact_for_user($uid) { "notify" => $r[0]["notify"], "url" => $r[0]["url"], "hide" => ($r[0]["hidewall"] || !$r[0]["net-publish"]), "nick" => $r[0]["nickname"], "addr" => $addr, - "connect" => $addr, "server_url" => App::get_baseurl(), + "connect" => $addr, "server_url" => System::baseUrl(), "generation" => 1, "network" => NETWORK_DFRN); update_gcontact($gcontact); @@ -2391,7 +2391,7 @@ function gs_fetch_users($server) { "nick" => $user->nickname, "about" => $user->bio, "network" => NETWORK_OSTATUS, - "photo" => App::get_baseurl()."/images/person-175.jpg"); + "photo" => System::baseUrl()."/images/person-175.jpg"); get_gcontact_id($contact); } } diff --git a/include/tags.php b/include/tags.php index d4fa84e46d..8720367fae 100644 --- a/include/tags.php +++ b/include/tags.php @@ -4,7 +4,7 @@ use Friendica\App; use Friendica\Core\System; function create_tags_from_item($itemid) { - $profile_base = App::get_baseurl(); + $profile_base = System::baseUrl(); $profile_data = parse_url($profile_base); $profile_base_friendica = $profile_data['host'].$profile_data['path']."/profile/"; $profile_base_diaspora = $profile_data['host'].$profile_data['path']."/u/"; diff --git a/include/text.php b/include/text.php index fd31de5587..fa26b0ef83 100644 --- a/include/text.php +++ b/include/text.php @@ -25,7 +25,7 @@ function replace_macros($s, $r) { $a = get_app(); // pass $baseurl to all templates - $r['$baseurl'] = App::get_baseurl(); + $r['$baseurl'] = System::baseUrl(); $t = $a->template_engine(); try { @@ -1312,7 +1312,7 @@ function prepare_body(&$item, $attach = false, $preview = false) { $a = get_app(); call_hooks('prepare_body_init', $item); - $searchpath = z_root() . "/search?tag="; + $searchpath = System::baseUrl() . "/search?tag="; $tags = array(); $hashtags = array(); @@ -1395,10 +1395,10 @@ function prepare_body(&$item, $attach = false, $preview = false) { if (!$vhead) { $vhead = true; $a->page['htmlhead'] .= replace_macros(get_markup_template('videos_head.tpl'), array( - '$baseurl' => z_root(), + '$baseurl' => System::baseUrl(), )); $a->page['end'] .= replace_macros(get_markup_template('videos_end.tpl'), array( - '$baseurl' => z_root(), + '$baseurl' => System::baseUrl(), )); } diff --git a/include/threads.php b/include/threads.php index dcb3b3f134..4cb8815693 100644 --- a/include/threads.php +++ b/include/threads.php @@ -278,7 +278,7 @@ function update_threads_mention() { $users = q("SELECT `uid`, `nickname` FROM `user` ORDER BY `uid`"); foreach ($users AS $user) { - $self = normalise_link(App::get_baseurl() . '/profile/' . $user['nickname']); + $self = normalise_link(System::baseUrl() . '/profile/' . $user['nickname']); $selfhttps = str_replace("http://", "https://", $self); $parents = q("SELECT DISTINCT(`parent`) FROM `item` WHERE `uid` = %d AND ((`owner-link` IN ('%s', '%s')) OR (`author-link` IN ('%s', '%s')))", diff --git a/include/uimport.php b/include/uimport.php index 6d1f6d49a6..78b20bd691 100644 --- a/include/uimport.php +++ b/include/uimport.php @@ -124,7 +124,7 @@ function import_account(App $a, $file) { } $oldbaseurl = $account['baseurl']; - $newbaseurl = App::get_baseurl(); + $newbaseurl = System::baseUrl(); $olduid = $account['user']['uid']; unset($account['user']['uid']); @@ -278,5 +278,5 @@ function import_account(App $a, $file) { proc_run(PRIORITY_HIGH, 'include/notifier.php', 'relocate', $newuid); info(t("Done. You can now login with your username and password")); - goaway(App::get_baseurl() . "/login"); + goaway(System::baseUrl() . "/login"); } diff --git a/include/user.php b/include/user.php index 08719cd7c1..4ed5e57f3d 100644 --- a/include/user.php +++ b/include/user.php @@ -1,5 +1,7 @@ identity = $openid_url; - $openid->returnUrl = z_root() . '/openid'; + $openid->returnUrl = System::baseUrl() . '/openid'; $openid->required = array('namePerson/friendly', 'contact/email', 'namePerson'); $openid->optional = array('namePerson/first','media/image/aspect11','media/image/default'); try { @@ -237,8 +239,8 @@ function create_user($arr) { t('default'), 1, dbesc($username), - dbesc(z_root() . "/photo/profile/{$newuid}.jpg"), - dbesc(z_root() . "/photo/avatar/{$newuid}.jpg"), + dbesc(System::baseUrl() . "/photo/profile/{$newuid}.jpg"), + dbesc(System::baseUrl() . "/photo/avatar/{$newuid}.jpg"), intval($publish), intval($netpublish) @@ -368,17 +370,17 @@ function user_create_self_contact($uid) { datetime_convert(), dbesc($user['username']), dbesc($user['nickname']), - dbesc(z_root()."/photo/profile/".$user['uid'].".jpg"), - dbesc(z_root()."/photo/avatar/".$user['uid'].".jpg"), - dbesc(z_root()."/photo/micro/".$user['uid'].".jpg"), - dbesc(z_root()."/profile/".$user['nickname']), - dbesc(normalise_link(z_root()."/profile/".$user['nickname'])), - dbesc($user['nickname'].'@'.substr(z_root(), strpos(z_root(),'://') + 3)), - dbesc(z_root()."/dfrn_request/".$user['nickname']), - dbesc(z_root()."/dfrn_notify/".$user['nickname']), - dbesc(z_root()."/dfrn_poll/".$user['nickname']), - dbesc(z_root()."/dfrn_confirm/".$user['nickname']), - dbesc(z_root()."/poco/".$user['nickname']), + dbesc(System::baseUrl()."/photo/profile/".$user['uid'].".jpg"), + dbesc(System::baseUrl()."/photo/avatar/".$user['uid'].".jpg"), + dbesc(System::baseUrl()."/photo/micro/".$user['uid'].".jpg"), + dbesc(System::baseUrl()."/profile/".$user['nickname']), + dbesc(normalise_link(System::baseUrl()."/profile/".$user['nickname'])), + dbesc($user['nickname'].'@'.substr(System::baseUrl(), strpos(System::baseUrl(),'://') + 3)), + dbesc(System::baseUrl()."/dfrn_request/".$user['nickname']), + dbesc(System::baseUrl()."/dfrn_notify/".$user['nickname']), + dbesc(System::baseUrl()."/dfrn_poll/".$user['nickname']), + dbesc(System::baseUrl()."/dfrn_confirm/".$user['nickname']), + dbesc(System::baseUrl()."/poco/".$user['nickname']), dbesc(datetime_convert()), dbesc(datetime_convert()), dbesc(datetime_convert()) diff --git a/index.php b/index.php index ea67cd7233..5b4cea756b 100644 --- a/index.php +++ b/index.php @@ -63,15 +63,15 @@ if (!$install) { if ($a->max_processes_reached() || $a->maxload_reached()) { header($_SERVER["SERVER_PROTOCOL"] . ' 503 Service Temporarily Unavailable'); header('Retry-After: 120'); - header('Refresh: 120; url=' . App::get_baseurl() . "/" . $a->query_string); + header('Refresh: 120; url=' . System::baseUrl() . "/" . $a->query_string); die("System is currently unavailable. Please try again later"); } if (get_config('system', 'force_ssl') && ($a->get_scheme() == "http") && (intval(get_config('system', 'ssl_policy')) == SSL_POLICY_FULL) && - (substr(App::get_baseurl(), 0, 8) == "https://")) { + (substr(System::baseUrl(), 0, 8) == "https://")) { header("HTTP/1.1 302 Moved Temporarily"); - header("Location: " . App::get_baseurl() . "/" . $a->query_string); + header("Location: " . System::baseUrl() . "/" . $a->query_string); exit(); } @@ -155,7 +155,7 @@ if ((x($_GET,'zrl')) && (!$install && !$maintenance)) { * */ -// header('Link: <' . App::get_baseurl() . '/amcd>; rel="acct-mgmt";'); +// header('Link: <' . System::baseUrl() . '/amcd>; rel="acct-mgmt";'); if (x($_COOKIE["Friendica"]) || (x($_SESSION,'authenticated')) || (x($_POST,'auth-params')) || ($a->module === 'login')) { require("include/auth.php"); @@ -295,7 +295,7 @@ if (strlen($a->module)) { if ((x($_SERVER,'QUERY_STRING')) && ($_SERVER['QUERY_STRING'] === 'q=internal_error.html') && isset($dreamhost_error_hack)) { logger('index.php: dreamhost_error_hack invoked. Original URI =' . $_SERVER['REQUEST_URI']); - goaway(App::get_baseurl() . $_SERVER['REQUEST_URI']); + goaway(System::baseUrl() . $_SERVER['REQUEST_URI']); } logger('index.php: page not found: ' . $_SERVER['REQUEST_URI'] . ' ADDRESS: ' . $_SERVER['REMOTE_ADDR'] . ' QUERY: ' . $_SERVER['QUERY_STRING'], LOGGER_DEBUG); diff --git a/mod/admin.php b/mod/admin.php index ea369f142d..2919076675 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -308,7 +308,7 @@ function admin_page_blocklist(App $a) { '$threason' => t('Reason for the block'), '$delentry' => t('Delete entry from blocklist'), '$entries' => $blocklistform, - '$baseurl' => App::get_baseurl(true), + '$baseurl' => System::baseUrl(true), '$confirm_delete' => t('Delete entry from blocklist?'), '$form_security_token' => get_form_security_token("admin_blocklist") )); @@ -377,7 +377,7 @@ function admin_page_deleteitem(App $a) { '$intro1' => t('On this page you can delete an item from your node. If the item is a top level posting, the entire thread will be deleted.'), '$intro2' => t('You need to know the GUID of the item. You can find it e.g. by looking at the display URL. The last part of http://example.com/display/123456 is the GUID, here 123456.'), '$deleteitemguid' => array('deleteitemguid', t("GUID"), '', t("The GUID of the item you want to delete."), 'required', 'autofocus'), - '$baseurl' => App::get_baseurl(), + '$baseurl' => System::baseUrl(), '$form_security_token' => get_form_security_token("admin_deleteitem") )); } @@ -553,7 +553,7 @@ function admin_page_federation(App $a) { '$counts' => $counts, '$version' => FRIENDICA_VERSION, '$legendtext' => sprintf(t('Currently this node is aware of %d nodes from the following platforms:'), $total), - '$baseurl' => App::get_baseurl(), + '$baseurl' => System::baseUrl(), )); } @@ -666,7 +666,7 @@ function admin_page_summary(App $a) { '$accounts' => $accounts, '$pending' => array(t('Pending registrations'), $pending), '$version' => array(t('Version'), FRIENDICA_VERSION), - '$baseurl' => App::get_baseurl(), + '$baseurl' => System::baseUrl(), '$platform' => FRIENDICA_PLATFORM, '$codename' => FRIENDICA_CODENAME, '$build' => get_config('system','build'), @@ -704,7 +704,7 @@ function admin_page_site_post(App $a) { * send relocate for every local user * */ - $old_url = App::get_baseurl(true); + $old_url = System::baseUrl(true); // Generate host names for relocation the addresses in the format user@address.tld $new_host = str_replace("http://", "@", normalise_link($new_url)); @@ -1152,7 +1152,7 @@ function admin_page_site(App $a) { '$performance' => t('Performance'), '$worker_title' => t('Worker'), '$relocate'=> t('Relocate - WARNING: advanced function. Could make this server unreachable.'), - '$baseurl' => App::get_baseurl(true), + '$baseurl' => System::baseUrl(true), // name, label, value, help string, extra data... '$sitename' => array('sitename', t("Site name"), $a->config['sitename'],''), '$hostname' => array('hostname', t("Host name"), $a->config['hostname'], ""), @@ -1227,14 +1227,14 @@ function admin_page_site(App $a) { '$proxy_disabled' => array('proxy_disabled', t("Disable picture proxy"), get_config('system','proxy_disabled'), t("The picture proxy increases performance and privacy. It shouldn't be used on systems with very low bandwith.")), '$only_tag_search' => array('only_tag_search', t("Only search in tags"), get_config('system','only_tag_search'), t("On large systems the text search can slow down the system extremely.")), - '$relocate_url' => array('relocate_url', t("New base url"), App::get_baseurl(), t("Change base url for this server. Sends relocate message to all DFRN contacts of all users.")), + '$relocate_url' => array('relocate_url', t("New base url"), System::baseUrl(), t("Change base url for this server. Sends relocate message to all DFRN contacts of all users.")), '$rino' => array('rino', t("RINO Encryption"), intval(get_config('system','rino_encrypt')), t("Encryption layer between nodes."), array("Disabled", "RINO1 (deprecated)", "RINO2")), '$worker_queues' => array('worker_queues', t("Maximum number of parallel workers"), get_config('system','worker_queues'), t("On shared hosters set this to 2. On larger systems, values of 10 are great. Default value is 4.")), '$worker_dont_fork' => array('worker_dont_fork', t("Don't use 'proc_open' with the worker"), get_config('system','worker_dont_fork'), t("Enable this if your system doesn't allow the use of 'proc_open'. This can happen on shared hosters. If this is enabled you should increase the frequency of poller calls in your crontab.")), '$worker_fastlane' => array('worker_fastlane', t("Enable fastlane"), get_config('system','worker_fastlane'), t("When enabed, the fastlane mechanism starts an additional worker if processes with higher priority are blocked by processes of lower priority.")), - '$worker_frontend' => array('worker_frontend', t('Enable frontend worker'), get_config('system','frontend_worker'), sprintf(t('When enabled the Worker process is triggered when backend access is performed (e.g. messages being delivered). On smaller sites you might want to call %s/worker on a regular basis via an external cron job. You should only enable this option if you cannot utilize cron/scheduled jobs on your server.'), App::get_baseurl())), + '$worker_frontend' => array('worker_frontend', t('Enable frontend worker'), get_config('system','frontend_worker'), sprintf(t('When enabled the Worker process is triggered when backend access is performed (e.g. messages being delivered). On smaller sites you might want to call %s/worker on a regular basis via an external cron job. You should only enable this option if you cannot utilize cron/scheduled jobs on your server.'), System::baseUrl())), '$form_security_token' => get_form_security_token("admin_site") @@ -1317,13 +1317,13 @@ function admin_page_dbsync(App $a) { } if (! count($failed)) { $o = replace_macros(get_markup_template('structure_check.tpl'),array( - '$base' => App::get_baseurl(true), + '$base' => System::baseUrl(true), '$banner' => t('No failed updates.'), '$check' => t('Check database structure'), )); } else { $o = replace_macros(get_markup_template('failed_updates.tpl'),array( - '$base' => App::get_baseurl(true), + '$base' => System::baseUrl(true), '$banner' => t('Failed Updates'), '$desc' => t('This does not include updates prior to 1139, which did not return a status.'), '$mark' => t('Mark success (if update was manually applied)'), @@ -1391,7 +1391,7 @@ function admin_page_users_post(App $a) { Thank you and welcome to %4$s.')); $preamble = sprintf($preamble, $nu['username'], $a->config['sitename']); - $body = sprintf($body, App::get_baseurl(), $nu['email'], $result['password'], $a->config['sitename']); + $body = sprintf($body, System::baseUrl(), $nu['email'], $result['password'], $a->config['sitename']); notification(array( 'type' => "SYSTEM_EMAIL", @@ -1615,7 +1615,7 @@ function admin_page_users(App $a) { '$form_security_token' => get_form_security_token("admin_users"), // values // - '$baseurl' => App::get_baseurl(true), + '$baseurl' => System::baseUrl(true), '$pending' => $pending, 'deleted' => $deleted, @@ -1707,7 +1707,7 @@ function admin_page_plugins(App $a) { '$page' => t('Plugins'), '$toggle' => t('Toggle'), '$settings' => t('Settings'), - '$baseurl' => App::get_baseurl(true), + '$baseurl' => System::baseUrl(true), '$plugin' => $plugin, '$status' => $status, @@ -1732,10 +1732,10 @@ function admin_page_plugins(App $a) { */ if (x($_GET,"a") && $_GET['a']=="r") { - check_form_security_token_redirectOnErr(App::get_baseurl().'/admin/plugins', 'admin_themes', 't'); + check_form_security_token_redirectOnErr(System::baseUrl().'/admin/plugins', 'admin_themes', 't'); reload_plugins(); info("Plugins reloaded"); - goaway(App::get_baseurl().'/admin/plugins'); + goaway(System::baseUrl().'/admin/plugins'); } $plugins = array(); @@ -1770,7 +1770,7 @@ function admin_page_plugins(App $a) { '$page' => t('Plugins'), '$submit' => t('Save Settings'), '$reload' => t('Reload active plugins'), - '$baseurl' => App::get_baseurl(true), + '$baseurl' => System::baseUrl(true), '$function' => 'plugins', '$plugins' => $plugins, '$pcount' => count($plugins), @@ -1983,7 +1983,7 @@ function admin_page_themes(App $a) { '$page' => t('Themes'), '$toggle' => t('Toggle'), '$settings' => t('Settings'), - '$baseurl' => App::get_baseurl(true), + '$baseurl' => System::baseUrl(true), '$plugin' => $theme, '$status' => $status, '$action' => $action, @@ -2002,7 +2002,7 @@ function admin_page_themes(App $a) { // reload active themes if (x($_GET,"a") && $_GET['a']=="r") { - check_form_security_token_redirectOnErr(App::get_baseurl().'/admin/themes', 'admin_themes', 't'); + check_form_security_token_redirectOnErr(System::baseUrl().'/admin/themes', 'admin_themes', 't'); if ($themes) { foreach ($themes as $th) { if ($th['allowed']) { @@ -2012,7 +2012,7 @@ function admin_page_themes(App $a) { } } info("Themes reloaded"); - goaway(App::get_baseurl().'/admin/themes'); + goaway(System::baseUrl().'/admin/themes'); } /* @@ -2033,7 +2033,7 @@ function admin_page_themes(App $a) { '$page' => t('Themes'), '$submit' => t('Save Settings'), '$reload' => t('Reload active themes'), - '$baseurl' => App::get_baseurl(true), + '$baseurl' => System::baseUrl(true), '$function' => 'themes', '$plugins' => $xthemes, '$pcount' => count($themes), @@ -2107,7 +2107,7 @@ function admin_page_logs(App $a) { '$page' => t('Logs'), '$submit' => t('Save Settings'), '$clear' => t('Clear'), - '$baseurl' => App::get_baseurl(true), + '$baseurl' => System::baseUrl(true), '$logname' => get_config('system','logfile'), // name, label, value, help string, extra data... diff --git a/mod/allfriends.php b/mod/allfriends.php index 690097aa5f..8d849d3755 100644 --- a/mod/allfriends.php +++ b/mod/allfriends.php @@ -66,7 +66,7 @@ function allfriends_content(App $a) { $photo_menu = contact_photo_menu ($rr); } else { - $connlnk = App::get_baseurl() . '/follow/?url=' . $rr['url']; + $connlnk = System::baseUrl() . '/follow/?url=' . $rr['url']; $photo_menu = array( 'profile' => array(t("View Profile"), zrl($rr['url'])), 'follow' => array(t("Connect/Follow"), $connlnk) diff --git a/mod/bookmarklet.php b/mod/bookmarklet.php index e9c14e47b7..785a2fbea1 100644 --- a/mod/bookmarklet.php +++ b/mod/bookmarklet.php @@ -18,7 +18,7 @@ function bookmarklet_content(App $a) { } $referer = normalise_link($_SERVER["HTTP_REFERER"]); - $page = normalise_link(App::get_baseurl()."/bookmarklet"); + $page = normalise_link(System::baseUrl()."/bookmarklet"); if (!strstr($referer, $page)) { $content = add_page_info($_REQUEST["url"]); diff --git a/mod/cal.php b/mod/cal.php index 18ef1eca9f..a130e7a30f 100644 --- a/mod/cal.php +++ b/mod/cal.php @@ -79,7 +79,7 @@ function cal_content(App $a) { $htpl = get_markup_template('event_head.tpl'); $a->page['htmlhead'] .= replace_macros($htpl,array( - '$baseurl' => App::get_baseurl(), + '$baseurl' => System::baseUrl(), '$module_url' => '/cal/' . $a->data['user']['nickname'], '$modparams' => 2, '$i18n' => $i18n, @@ -87,7 +87,7 @@ function cal_content(App $a) { $etpl = get_markup_template('event_end.tpl'); $a->page['end'] .= replace_macros($etpl,array( - '$baseurl' => App::get_baseurl(), + '$baseurl' => System::baseUrl(), )); $o =""; @@ -229,7 +229,7 @@ function cal_content(App $a) { foreach ($r as $rr) { $j = (($rr['adjust']) ? datetime_convert('UTC',date_default_timezone_get(),$rr['start'], 'j') : datetime_convert('UTC','UTC',$rr['start'],'j')); if (! x($links,$j)) { - $links[$j] = App::get_baseurl() . '/' . $a->cmd . '#link-' . $j; + $links[$j] = System::baseUrl() . '/' . $a->cmd . '#link-' . $j; } } } @@ -268,12 +268,12 @@ function cal_content(App $a) { } $o = replace_macros($tpl, array( - '$baseurl' => App::get_baseurl(), + '$baseurl' => System::baseUrl(), '$tabs' => $tabs, '$title' => t('Events'), '$view' => t('View'), - '$previous' => array(App::get_baseurl()."/events/$prevyear/$prevmonth", t('Previous'),'',''), - '$next' => array(App::get_baseurl()."/events/$nextyear/$nextmonth", t('Next'),'',''), + '$previous' => array(System::baseUrl()."/events/$prevyear/$prevmonth", t('Previous'),'',''), + '$next' => array(System::baseUrl()."/events/$nextyear/$nextmonth", t('Next'),'',''), '$calendar' => cal($y,$m,$links, ' eventcal'), '$events' => $events, diff --git a/mod/contacts.php b/mod/contacts.php index d849192355..bbbd088cd1 100644 --- a/mod/contacts.php +++ b/mod/contacts.php @@ -85,16 +85,16 @@ function contacts_init(App $a) { '$networks_widget' => $networks_widget )); - $base = z_root(); + $base = System::baseUrl(); $tpl = get_markup_template("contacts-head.tpl"); $a->page['htmlhead'] .= replace_macros($tpl,array( - '$baseurl' => App::get_baseurl(true), + '$baseurl' => System::baseUrl(true), '$base' => $base )); $tpl = get_markup_template("contacts-end.tpl"); $a->page['end'] .= replace_macros($tpl,array( - '$baseurl' => App::get_baseurl(true), + '$baseurl' => System::baseUrl(true), '$base' => $base )); @@ -494,10 +494,10 @@ function contacts_content(App $a) { $contact = $a->data['contact']; $a->page['htmlhead'] .= replace_macros(get_markup_template('contact_head.tpl'), array( - '$baseurl' => App::get_baseurl(true), + '$baseurl' => System::baseUrl(true), )); $a->page['end'] .= replace_macros(get_markup_template('contact_end.tpl'), array( - '$baseurl' => App::get_baseurl(true), + '$baseurl' => System::baseUrl(true), )); require_once 'include/contact_selectors.php'; @@ -576,7 +576,7 @@ function contacts_content(App $a) { if (in_array($contact['network'], array(NETWORK_DIASPORA, NETWORK_OSTATUS)) && ($contact['rel'] == CONTACT_IS_FOLLOWER)) - $follow = App::get_baseurl(true)."/follow?url=".urlencode($contact["url"]); + $follow = System::baseUrl(true)."/follow?url=".urlencode($contact["url"]); // Load contactact related actions like hide, suggest, delete and others $contact_actions = contact_actions($contact); @@ -802,7 +802,7 @@ function contacts_content(App $a) { $tpl = get_markup_template("contacts-template.tpl"); $o .= replace_macros($tpl, array( - '$baseurl' => z_root(), + '$baseurl' => System::baseUrl(), '$header' => t('Contacts') . (($nets) ? ' - ' . network_to_name($nets) : ''), '$tabs' => $t, '$total' => $total, diff --git a/mod/content.php b/mod/content.php index 70f3ec5018..b6fad9e227 100644 --- a/mod/content.php +++ b/mod/content.php @@ -119,7 +119,7 @@ function content_content(App $a, $update = 0) { if($update) killme(); notice( t('No such group') . EOL ); - goaway(App::get_baseurl(true) . '/network'); + goaway(System::baseUrl(true) . '/network'); // NOTREACHED } @@ -199,7 +199,7 @@ function content_content(App $a, $update = 0) { } if($conv) { - $myurl = App::get_baseurl() . '/profile/'. $a->user['nickname']; + $myurl = System::baseUrl() . '/profile/'. $a->user['nickname']; $myurl = substr($myurl,strpos($myurl,'://')+3); $myurl = str_replace('www.','',$myurl); $diasp_url = str_replace('/profile/','/u/',$myurl); @@ -511,8 +511,8 @@ function render_content(App $a, $items, $mode, $update, $preview = false) { 'like' => '', 'dislike' => '', 'comment' => '', - //'conv' => (($preview) ? '' : array('href'=> App::get_baseurl($ssl_state) . '/display/' . $nickname . '/' . $item['id'], 'title'=> t('View in context'))), - 'conv' => (($preview) ? '' : array('href'=> App::get_baseurl($ssl_state).'/display/'.$item['guid'], 'title'=> t('View in context'))), + //'conv' => (($preview) ? '' : array('href'=> System::baseUrl($ssl_state) . '/display/' . $nickname . '/' . $item['id'], 'title'=> t('View in context'))), + 'conv' => (($preview) ? '' : array('href'=> System::baseUrl($ssl_state).'/display/'.$item['guid'], 'title'=> t('View in context'))), 'previewing' => $previewing, 'wait' => t('Please wait'), ); @@ -745,7 +745,7 @@ function render_content(App $a, $items, $mode, $update, $preview = false) { } if (local_user() && link_compare($a->contact['url'],$item['author-link'])) { - $edpost = array(App::get_baseurl($ssl_state)."/editpost/".$item['id'], t("Edit")); + $edpost = array(System::baseUrl($ssl_state)."/editpost/".$item['id'], t("Edit")); } else { $edpost = false; } diff --git a/mod/delegate.php b/mod/delegate.php index 4b59b4eeb3..4d35d46c70 100644 --- a/mod/delegate.php +++ b/mod/delegate.php @@ -21,7 +21,7 @@ function delegate_content(App $a) { // delegated admins can view but not change delegation permissions if (x($_SESSION,'submanage') && intval($_SESSION['submanage'])) { - goaway(App::get_baseurl() . '/delegate'); + goaway(System::baseUrl() . '/delegate'); } $id = $a->argv[2]; @@ -32,7 +32,7 @@ function delegate_content(App $a) { if (dbm::is_result($r)) { $r = q("select id from contact where uid = %d and nurl = '%s' limit 1", intval(local_user()), - dbesc(normalise_link(App::get_baseurl() . '/profile/' . $r[0]['nickname'])) + dbesc(normalise_link(System::baseUrl() . '/profile/' . $r[0]['nickname'])) ); if (dbm::is_result($r)) { q("insert into manage ( uid, mid ) values ( %d , %d ) ", @@ -41,21 +41,21 @@ function delegate_content(App $a) { ); } } - goaway(App::get_baseurl() . '/delegate'); + goaway(System::baseUrl() . '/delegate'); } if ($a->argc > 2 && $a->argv[1] === 'remove' && intval($a->argv[2])) { // delegated admins can view but not change delegation permissions if (x($_SESSION,'submanage') && intval($_SESSION['submanage'])) { - goaway(App::get_baseurl() . '/delegate'); + goaway(System::baseUrl() . '/delegate'); } q("DELETE FROM `manage` WHERE `uid` = %d AND `mid` = %d LIMIT 1", intval($a->argv[2]), intval(local_user()) ); - goaway(App::get_baseurl() . '/delegate'); + goaway(System::baseUrl() . '/delegate'); } @@ -95,7 +95,7 @@ function delegate_content(App $a) { $r = q("select nurl from contact where substring_index(contact.nurl,'/',3) = '%s' and contact.uid = %d and contact.self = 0 and network = '%s' ", - dbesc(normalise_link(App::get_baseurl())), + dbesc(normalise_link(System::baseUrl())), intval(local_user()), dbesc(NETWORK_DFRN) ); @@ -131,7 +131,7 @@ function delegate_content(App $a) { $o = replace_macros(get_markup_template('delegate.tpl'),array( '$header' => t('Delegate Page Management'), - '$base' => App::get_baseurl(), + '$base' => System::baseUrl(), '$desc' => 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_managers' => t('Existing Page Managers'), '$managers' => $full_managers, diff --git a/mod/dfrn_confirm.php b/mod/dfrn_confirm.php index 4e655c223c..9c64c8c883 100644 --- a/mod/dfrn_confirm.php +++ b/mod/dfrn_confirm.php @@ -197,7 +197,7 @@ function dfrn_confirm_post(App $a, $handsfree = null) { $params['public_key'] = $public_key; - $my_url = App::get_baseurl() . '/profile/' . $user[0]['nickname']; + $my_url = System::baseUrl() . '/profile/' . $user[0]['nickname']; openssl_public_encrypt($my_url, $params['source_url'], $site_pubkey); $params['source_url'] = bin2hex($params['source_url']); @@ -508,7 +508,7 @@ function dfrn_confirm_post(App $a, $handsfree = null) { // do anything special with this new friend. if ($handsfree === null) { - goaway(App::get_baseurl() . '/contacts/' . intval($contact_id)); + goaway(System::baseUrl() . '/contacts/' . intval($contact_id)); } else { return; } @@ -670,7 +670,7 @@ function dfrn_confirm_post(App $a, $handsfree = null) { if (dbm::is_result($r)) { $photo = $r[0]['photo']; } else { - $photo = App::get_baseurl() . '/images/person-175.jpg'; + $photo = System::baseUrl() . '/images/person-175.jpg'; } require_once 'include/Photo.php'; @@ -735,7 +735,7 @@ function dfrn_confirm_post(App $a, $handsfree = null) { 'to_name' => $r[0]['username'], 'to_email' => $r[0]['email'], 'uid' => $r[0]['uid'], - 'link' => App::get_baseurl() . '/contacts/' . $dfrn_record, + 'link' => System::baseUrl() . '/contacts/' . $dfrn_record, 'source_name' => ((strlen(stripslashes($r[0]['name']))) ? stripslashes($r[0]['name']) : t('[Name Withheld]')), 'source_link' => $r[0]['url'], 'source_photo' => $r[0]['photo'], @@ -810,7 +810,7 @@ function dfrn_confirm_post(App $a, $handsfree = null) { // somebody arrived here by mistake or they are fishing. Send them to the homepage. - goaway(z_root()); + goaway(System::baseUrl()); // NOTREACHED } diff --git a/mod/dfrn_poll.php b/mod/dfrn_poll.php index 33035d8798..d87d97a31e 100644 --- a/mod/dfrn_poll.php +++ b/mod/dfrn_poll.php @@ -78,7 +78,7 @@ function dfrn_poll_init(App $a) { $my_id = '0:' . $dfrn_id; break; default: - goaway(z_root()); + goaway(System::baseUrl()); break; // NOTREACHED } @@ -122,9 +122,9 @@ function dfrn_poll_init(App $a) { } } $profile = $r[0]['nickname']; - goaway((strlen($destination_url)) ? $destination_url : App::get_baseurl() . '/profile/' . $profile); + goaway((strlen($destination_url)) ? $destination_url : System::baseUrl() . '/profile/' . $profile); } - goaway(z_root()); + goaway(System::baseUrl()); } @@ -322,7 +322,7 @@ function dfrn_poll_post(App $a) { $my_id = '0:' . $dfrn_id; break; default: - goaway(z_root()); + goaway(System::baseUrl()); break; // NOTREACHED } @@ -447,7 +447,7 @@ function dfrn_poll_content(App $a) { $my_id = '0:' . $dfrn_id; break; default: - goaway(z_root()); + goaway(System::baseUrl()); break; // NOTREACHED } @@ -511,14 +511,14 @@ function dfrn_poll_content(App $a) { switch($destination_url) { case 'profile': - $dest = App::get_baseurl() . '/profile/' . $profile . '?f=&tab=profile'; + $dest = System::baseUrl() . '/profile/' . $profile . '?f=&tab=profile'; break; case 'photos': - $dest = App::get_baseurl() . '/photos/' . $profile; + $dest = System::baseUrl() . '/photos/' . $profile; break; case 'status': case '': - $dest = App::get_baseurl() . '/profile/' . $profile; + $dest = System::baseUrl() . '/profile/' . $profile; break; default: $appendix = (strstr($destination_url, '?') ? '&f=&redir=1' : '?f=&redir=1'); diff --git a/mod/dfrn_request.php b/mod/dfrn_request.php index dacade2ea9..067700641d 100644 --- a/mod/dfrn_request.php +++ b/mod/dfrn_request.php @@ -54,7 +54,7 @@ function dfrn_request_post(App $a) { if(x($_POST, 'cancel')) { - goaway(z_root()); + goaway(System::baseUrl()); } @@ -196,9 +196,9 @@ function dfrn_request_post(App $a) { if (isset($photo)) update_contact_avatar($photo, local_user(), $r[0]["id"], true); - $forwardurl = App::get_baseurl()."/contacts/".$r[0]['id']; + $forwardurl = System::baseUrl()."/contacts/".$r[0]['id']; } else { - $forwardurl = App::get_baseurl()."/contacts"; + $forwardurl = System::baseUrl()."/contacts"; } /* @@ -226,7 +226,7 @@ function dfrn_request_post(App $a) { // invalid/bogus request notice( t('Unrecoverable protocol error.') . EOL ); - goaway(z_root()); + goaway(System::baseUrl()); return; // NOTREACHED } @@ -507,19 +507,19 @@ function dfrn_request_post(App $a) { else { if (! validate_url($url)) { notice( t('Invalid profile URL.') . EOL); - goaway(App::get_baseurl() . '/' . $a->cmd); + goaway(System::baseUrl() . '/' . $a->cmd); return; // NOTREACHED } if (! allowed_url($url)) { notice( t('Disallowed profile URL.') . EOL); - goaway(App::get_baseurl() . '/' . $a->cmd); + goaway(System::baseUrl() . '/' . $a->cmd); return; // NOTREACHED } if (blocked_url($url)) { notice( t('Blocked domain') . EOL); - goaway(App::get_baseurl() . '/' . $a->cmd); + goaway(System::baseUrl() . '/' . $a->cmd); return; // NOTREACHED } @@ -527,7 +527,7 @@ function dfrn_request_post(App $a) { if (! count($parms)) { notice( t('Profile location is not valid or does not contain profile information.') . EOL ); - goaway(App::get_baseurl() . '/' . $a->cmd); + goaway(System::baseUrl() . '/' . $a->cmd); } else { if (! x($parms,'fn')) { @@ -617,7 +617,7 @@ function dfrn_request_post(App $a) { // "Homecoming" - send the requestor back to their site to record the introduction. - $dfrn_url = bin2hex(App::get_baseurl() . '/profile/' . $nickname); + $dfrn_url = bin2hex(System::baseUrl() . '/profile/' . $nickname); $aes_allow = ((function_exists('openssl_encrypt')) ? 1 : 0); goaway($parms['dfrn-request'] . "?dfrn_url=$dfrn_url" @@ -646,7 +646,7 @@ function dfrn_request_post(App $a) { $uri = urlencode($uri); } else { - $uri = App::get_baseurl().'/profile/'.$nickname; + $uri = System::baseUrl().'/profile/'.$nickname; } $url = str_replace('{uri}', $uri, $url); @@ -756,7 +756,7 @@ function dfrn_request_content(App $a) { 'to_name' => $r[0]['username'], 'to_email' => $r[0]['email'], 'uid' => $r[0]['uid'], - 'link' => App::get_baseurl() . '/notifications/intros', + 'link' => System::baseUrl() . '/notifications/intros', 'source_name' => ((strlen(stripslashes($r[0]['name']))) ? stripslashes($r[0]['name']) : t('[Name Withheld]')), 'source_link' => $r[0]['url'], 'source_photo' => $r[0]['photo'], @@ -820,16 +820,16 @@ function dfrn_request_content(App $a) { $myaddr = $_GET['address']; } elseif (local_user()) { if (strlen($a->path)) { - $myaddr = App::get_baseurl() . '/profile/' . $a->user['nickname']; + $myaddr = System::baseUrl() . '/profile/' . $a->user['nickname']; } else { - $myaddr = $a->user['nickname'] . '@' . substr(z_root(), strpos(z_root(),'://') + 3 ); + $myaddr = $a->user['nickname'] . '@' . substr(System::baseUrl(), strpos(System::baseUrl(),'://') + 3 ); } } else { // last, try a zrl $myaddr = get_my_url(); } - $target_addr = $a->profile['nickname'] . '@' . substr(z_root(), strpos(z_root(),'://') + 3 ); + $target_addr = $a->profile['nickname'] . '@' . substr(System::baseUrl(), strpos(System::baseUrl(),'://') + 3 ); /* diff --git a/mod/dirfind.php b/mod/dirfind.php index 4dfe735855..7d167494e6 100644 --- a/mod/dirfind.php +++ b/mod/dirfind.php @@ -206,7 +206,7 @@ function dirfind_content(App $a, $prefix = "") { $photo_menu = array(); } } else { - $connlnk = App::get_baseurl().'/follow/?url='.(($jj->connect) ? $jj->connect : $jj->url); + $connlnk = System::baseUrl().'/follow/?url='.(($jj->connect) ? $jj->connect : $jj->url); $conntxt = t('Connect'); $photo_menu = array( 'profile' => array(t("View Profile"), zrl($jj->url)), diff --git a/mod/display.php b/mod/display.php index 414e43c079..b76fe1d483 100644 --- a/mod/display.php +++ b/mod/display.php @@ -100,8 +100,8 @@ function display_init(App $a) { $profiledata = display_fetchauthor($a, $r); - if (strstr(normalise_link($profiledata["url"]), normalise_link(App::get_baseurl()))) { - $nickname = str_replace(normalise_link(App::get_baseurl())."/profile/", "", normalise_link($profiledata["url"])); + if (strstr(normalise_link($profiledata["url"]), normalise_link(System::baseUrl()))) { + $nickname = str_replace(normalise_link(System::baseUrl())."/profile/", "", normalise_link($profiledata["url"])); if (($nickname != $a->user["nickname"])) { $r = dba::fetch_first("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `contact`.`avatar-date` AS picdate, `user`.* FROM `profile` @@ -198,11 +198,11 @@ function display_fetchauthor($a, $item) { $profiledata = get_contact_details_by_url($profiledata["url"], local_user(), $profiledata); - $profiledata["photo"] = App::remove_baseurl($profiledata["photo"]); + $profiledata["photo"] = System::removedBaseUrl($profiledata["photo"]); if (local_user()) { if (in_array($profiledata["network"], array(NETWORK_DFRN, NETWORK_DIASPORA, NETWORK_OSTATUS))) { - $profiledata["remoteconnect"] = App::get_baseurl()."/follow?url=".urlencode($profiledata["url"]); + $profiledata["remoteconnect"] = System::baseUrl()."/follow?url=".urlencode($profiledata["url"]); } } elseif ($profiledata["network"] == NETWORK_DFRN) { $connect = str_replace("/profile/", "/dfrn_request/", $profiledata["url"]); @@ -295,7 +295,7 @@ function display_content(App $a, $update = 0) { // We are displaying an "alternate" link if that post was public. See issue 2864 $is_public = dba::exists('item', array('id' => $item_id, 'private' => false, 'wall' => true)); if ($is_public) { - $alternate = App::get_baseurl().'/display/'.$nick.'/'.$item_id.'.atom'; + $alternate = System::baseUrl().'/display/'.$nick.'/'.$item_id.'.atom'; } else { $alternate = ''; } diff --git a/mod/editpost.php b/mod/editpost.php index d6826e610a..149e432e15 100644 --- a/mod/editpost.php +++ b/mod/editpost.php @@ -37,7 +37,7 @@ function editpost_content(App $a) { $tpl = get_markup_template('jot-header.tpl'); $a->page['htmlhead'] .= replace_macros($tpl, array( - '$baseurl' => App::get_baseurl(), + '$baseurl' => System::baseUrl(), '$ispublic' => ' ', // t('Visible to everybody'), '$geotag' => $geotag, '$nickname' => $a->user['nickname'] @@ -45,7 +45,7 @@ function editpost_content(App $a) { $tpl = get_markup_template('jot-end.tpl'); $a->page['end'] .= replace_macros($tpl, array( - '$baseurl' => App::get_baseurl(), + '$baseurl' => System::baseUrl(), '$ispublic' => ' ', // t('Visible to everybody'), '$geotag' => $geotag, '$nickname' => $a->user['nickname'] @@ -119,7 +119,7 @@ function editpost_content(App $a) { '$ptyp' => $itm[0]['type'], '$content' => undo_post_tagging($itm[0]['body']), '$post_id' => $post_id, - '$baseurl' => App::get_baseurl(), + '$baseurl' => System::baseUrl(), '$defloc' => $a->user['default-location'], '$visitor' => 'none', '$pvisit' => 'none', diff --git a/mod/events.php b/mod/events.php index 8be5bc033e..4e70c00569 100644 --- a/mod/events.php +++ b/mod/events.php @@ -91,7 +91,7 @@ function events_post(App $a) { $type = 'event'; $action = ($event_id == '') ? 'new' : "event/" . $event_id; - $onerror_url = App::get_baseurl() . "/events/" . $action . "?summary=$summary&description=$desc&location=$location&start=$start_text&finish=$finish_text&adjust=$adjust&nofinish=$nofinish"; + $onerror_url = System::baseUrl() . "/events/" . $action . "?summary=$summary&description=$desc&location=$location&start=$start_text&finish=$finish_text&adjust=$adjust&nofinish=$nofinish"; if (strcmp($finish, $start) < 0 && !$nofinish) { notice(t('Event can not end before it has started.') . EOL); @@ -191,7 +191,7 @@ function events_content(App $a) { } if ($a->argc == 1) { - $_SESSION['return_url'] = App::get_baseurl() . '/' . $a->cmd; + $_SESSION['return_url'] = System::baseUrl() . '/' . $a->cmd; } if (($a->argc > 2) && ($a->argv[1] === 'ignore') && intval($a->argv[2])) { @@ -219,7 +219,7 @@ function events_content(App $a) { $htpl = get_markup_template('event_head.tpl'); $a->page['htmlhead'] .= replace_macros($htpl, array( - '$baseurl' => App::get_baseurl(), + '$baseurl' => System::baseUrl(), '$module_url' => '/events', '$modparams' => 1, '$i18n' => $i18n, @@ -227,7 +227,7 @@ function events_content(App $a) { $etpl = get_markup_template('event_end.tpl'); $a->page['end'] .= replace_macros($etpl, array( - '$baseurl' => App::get_baseurl(), + '$baseurl' => System::baseUrl(), )); $o = ''; @@ -338,7 +338,7 @@ function events_content(App $a) { foreach ($r as $rr) { $j = (($rr['adjust']) ? datetime_convert('UTC', date_default_timezone_get(), $rr['start'], 'j') : datetime_convert('UTC', 'UTC', $rr['start'], 'j')); if (! x($links,$j)) { - $links[$j] = App::get_baseurl() . '/' . $a->cmd . '#link-' . $j; + $links[$j] = System::baseUrl() . '/' . $a->cmd . '#link-' . $j; } } } @@ -373,13 +373,13 @@ function events_content(App $a) { } $o = replace_macros($tpl, array( - '$baseurl' => App::get_baseurl(), + '$baseurl' => System::baseUrl(), '$tabs' => $tabs, '$title' => t('Events'), '$view' => t('View'), - '$new_event' => array(App::get_baseurl() . '/events/new', t('Create New Event'), '', ''), - '$previous' => array(App::get_baseurl() . '/events/$prevyear/$prevmonth', t('Previous'), '', ''), - '$next' => array(App::get_baseurl() . '/events/$nextyear/$nextmonth', t('Next'), '', ''), + '$new_event' => array(System::baseUrl() . '/events/new', t('Create New Event'), '', ''), + '$previous' => array(System::baseUrl() . '/events/$prevyear/$prevmonth', t('Previous'), '', ''), + '$next' => array(System::baseUrl() . '/events/$nextyear/$nextmonth', t('Next'), '', ''), '$calendar' => cal($y, $m, $links, ' eventcal'), '$events' => $events, @@ -477,7 +477,7 @@ function events_content(App $a) { $tpl = get_markup_template('event_form.tpl'); $o .= replace_macros($tpl,array( - '$post' => App::get_baseurl() . '/events', + '$post' => System::baseUrl() . '/events', '$eid' => $eid, '$cid' => $cid, '$uri' => $uri, @@ -534,6 +534,6 @@ function events_content(App $a) { info(t('Event removed') . EOL); } - goaway(App::get_baseurl() . '/events'); + goaway(System::baseUrl() . '/events'); } } diff --git a/mod/fbrowser.php b/mod/fbrowser.php index 1aa627d234..d1448b81db 100644 --- a/mod/fbrowser.php +++ b/mod/fbrowser.php @@ -85,9 +85,9 @@ function fbrowser_content(App $a) { $scale = $rr['loq']; return array( - App::get_baseurl() . '/photos/' . $a->user['nickname'] . '/image/' . $rr['resource-id'], + System::baseUrl() . '/photos/' . $a->user['nickname'] . '/image/' . $rr['resource-id'], $filename_e, - App::get_baseurl() . '/photo/' . $rr['resource-id'] . '-' . $scale . '.'. $ext + System::baseUrl() . '/photo/' . $rr['resource-id'] . '-' . $scale . '.'. $ext ); } $files = array_map("_map_files1", $r); @@ -96,7 +96,7 @@ function fbrowser_content(App $a) { $o = replace_macros($tpl, array( '$type' => 'image', - '$baseurl' => App::get_baseurl(), + '$baseurl' => System::baseUrl(), '$path' => $path, '$folders' => $albums, '$files' => $files, @@ -123,7 +123,7 @@ function fbrowser_content(App $a) { $filename_e = $rr['filename']; } - return array( App::get_baseurl() . '/attach/' . $rr['id'], $filename_e, App::get_baseurl() . '/images/icons/16/' . $filetype . '.png'); + return array( System::baseUrl() . '/attach/' . $rr['id'], $filename_e, System::baseUrl() . '/images/icons/16/' . $filetype . '.png'); } $files = array_map("_map_files2", $files); @@ -131,7 +131,7 @@ function fbrowser_content(App $a) { $tpl = get_markup_template($template_file); $o = replace_macros($tpl, array( '$type' => 'file', - '$baseurl' => App::get_baseurl(), + '$baseurl' => System::baseUrl(), '$path' => array( array( "", t("Files")) ), '$folders' => false, '$files' =>$files, diff --git a/mod/fetch.php b/mod/fetch.php index 9ecfe10f49..30c38bf543 100644 --- a/mod/fetch.php +++ b/mod/fetch.php @@ -31,7 +31,7 @@ function fetch_init(App $a) { $parts = parse_url($r[0]["author-link"]); $host = $parts["scheme"]."://".$parts["host"]; - if (normalise_link($host) != normalise_link(App::get_baseurl())) { + if (normalise_link($host) != normalise_link(System::baseUrl())) { $location = $host."/fetch/".$a->argv[1]."/".urlencode($guid); header("HTTP/1.1 301 Moved Permanently"); diff --git a/mod/filerm.php b/mod/filerm.php index 29c6a67bec..bd46a8bfea 100644 --- a/mod/filerm.php +++ b/mod/filerm.php @@ -26,7 +26,7 @@ function filerm_content(App $a) { } if (x($_SESSION,'return_url')) { - goaway(App::get_baseurl() . '/' . $_SESSION['return_url']); + goaway(System::baseUrl() . '/' . $_SESSION['return_url']); } killme(); diff --git a/mod/follow.php b/mod/follow.php index df2686eb65..4f2b45e3bf 100644 --- a/mod/follow.php +++ b/mod/follow.php @@ -67,7 +67,7 @@ function follow_content(App $a) { $request = $ret["request"]; $tpl = get_markup_template('dfrn_request.tpl'); } else { - $request = App::get_baseurl()."/follow"; + $request = System::baseUrl()."/follow"; $tpl = get_markup_template('auto_request.tpl'); } @@ -183,13 +183,13 @@ function follow_post(App $a) { } goaway($return_url); } elseif ($result['cid']) { - goaway(App::get_baseurl().'/contacts/'.$result['cid']); + goaway(System::baseUrl().'/contacts/'.$result['cid']); } info( t('Contact added').EOL); if (strstr($return_url,'contacts')) { - goaway(App::get_baseurl().'/contacts/'.$contact_id); + goaway(System::baseUrl().'/contacts/'.$contact_id); } goaway($return_url); diff --git a/mod/friendica.php b/mod/friendica.php index 1c1b6c9409..e2d5b6dd03 100644 --- a/mod/friendica.php +++ b/mod/friendica.php @@ -18,7 +18,7 @@ function friendica_init(App $a) { $r = q("SELECT `username`, `nickname` FROM `user` WHERE `email` = '%s' $sql_extra", dbesc($adminlist[0])); $admin = array( 'name' => $r[0]['username'], - 'profile'=> App::get_baseurl() . '/profile/' . $r[0]['nickname'], + 'profile'=> System::baseUrl() . '/profile/' . $r[0]['nickname'], ); } else { $admin = false; @@ -48,7 +48,7 @@ function friendica_init(App $a) { $data = Array( 'version' => FRIENDICA_VERSION, - 'url' => z_root(), + 'url' => System::baseUrl(), 'plugins' => $visible_plugins, 'locked_features' => $locked_features, 'register_policy' => $register_policy[$a->config['register_policy']], @@ -56,7 +56,7 @@ function friendica_init(App $a) { 'site_name' => $a->config['sitename'], 'platform' => FRIENDICA_PLATFORM, 'info' => ((x($a->config,'info')) ? $a->config['info'] : ''), - 'no_scrape_url' => App::get_baseurl().'/noscrape' + 'no_scrape_url' => System::baseUrl().'/noscrape' ); echo json_encode($data); @@ -68,7 +68,7 @@ function friendica_content(App $a) { $o = '

Friendica

' . PHP_EOL; $o .= '

'; $o .= t('This is Friendica, version') . ' ' . FRIENDICA_VERSION . ' '; - $o .= t('running at web location') . ' ' . z_root(); + $o .= t('running at web location') . ' ' . System::baseUrl(); $o .= '

' . PHP_EOL; $o .= '

'; diff --git a/mod/group.php b/mod/group.php index 9083368565..71fca276a0 100644 --- a/mod/group.php +++ b/mod/group.php @@ -31,12 +31,12 @@ function group_post(App $a) { info(t('Group created.') . EOL); $r = group_byname(local_user(), $name); if ($r) { - goaway(App::get_baseurl() . '/group/' . $r); + goaway(System::baseUrl() . '/group/' . $r); } } else { notice(t('Could not create group.') . EOL); } - goaway(App::get_baseurl() . '/group'); + goaway(System::baseUrl() . '/group'); return; // NOTREACHED } @@ -49,7 +49,7 @@ function group_post(App $a) { ); if (! dbm::is_result($r)) { notice(t('Group not found.') . EOL); - goaway(App::get_baseurl() . '/contacts'); + goaway(System::baseUrl() . '/contacts'); return; // NOTREACHED } $group = $r[0]; @@ -127,7 +127,7 @@ function group_content(App $a) { notice(t('Unable to remove group.') . EOL); } } - goaway(App::get_baseurl() . '/group'); + goaway(System::baseUrl() . '/group'); // NOTREACHED } @@ -154,7 +154,7 @@ function group_content(App $a) { if (! dbm::is_result($r)) { notice(t('Group not found.') . EOL); - goaway(App::get_baseurl() . '/contacts'); + goaway(System::baseUrl() . '/contacts'); } $group = $r[0]; diff --git a/mod/hcard.php b/mod/hcard.php index a208890b98..d31ea1b270 100644 --- a/mod/hcard.php +++ b/mod/hcard.php @@ -44,14 +44,14 @@ function hcard_init(App $a) { } $a->page['htmlhead'] .= '' . "\r\n" ; - $a->page['htmlhead'] .= '' . "\r\n" ; + $a->page['htmlhead'] .= '' . "\r\n" ; $uri = urlencode('acct:' . $a->profile['nickname'] . '@' . $a->get_hostname() . (($a->path) ? '/' . $a->path : '')); - $a->page['htmlhead'] .= '' . "\r\n"; - header('Link: <' . App::get_baseurl() . '/xrd/?uri=' . $uri . '>; rel="lrdd"; type="application/xrd+xml"', false); + $a->page['htmlhead'] .= '' . "\r\n"; + header('Link: <' . System::baseUrl() . '/xrd/?uri=' . $uri . '>; rel="lrdd"; type="application/xrd+xml"', false); $dfrn_pages = array('request', 'confirm', 'notify', 'poll'); foreach ($dfrn_pages as $dfrn) { - $a->page['htmlhead'] .= "\r\n"; + $a->page['htmlhead'] .= "\r\n"; } } diff --git a/mod/help.php b/mod/help.php index 6a9d01faa0..9a4b275f95 100644 --- a/mod/help.php +++ b/mod/help.php @@ -81,7 +81,7 @@ function help_content(App $a) { if ($level>$lastlevel) $toc.="

    "; $idnum[$level]++; $id = implode("_", array_slice($idnum,1,$level)); - $href = App::get_baseurl()."/help/{$filename}#{$id}"; + $href = System::baseUrl()."/help/{$filename}#{$id}"; $toc .= "
  • ".strip_tags($line)."
  • "; $line = "".$line; $lastlevel = $level; diff --git a/mod/home.php b/mod/home.php index a502c0c576..3490c4faea 100644 --- a/mod/home.php +++ b/mod/home.php @@ -10,11 +10,11 @@ function home_init(App $a) { call_hooks('home_init',$ret); if (local_user() && ($a->user['nickname'])) { - goaway(App::get_baseurl()."/network"); + goaway(System::baseUrl()."/network"); } if (strlen(get_config('system','singleuser'))) { - goaway(App::get_baseurl()."/profile/" . get_config('system','singleuser')); + goaway(System::baseUrl()."/profile/" . get_config('system','singleuser')); } }} @@ -34,7 +34,7 @@ function home_content(App $a) { /// @TODO No absolute path used, maybe risky (security) if (file_exists('home.html')) { if (file_exists('home.css')) { - $a->page['htmlhead'] .= ''; + $a->page['htmlhead'] .= ''; } $o .= file_get_contents('home.html'); diff --git a/mod/hostxrd.php b/mod/hostxrd.php index c9f870a08c..fd4bfd10b0 100644 --- a/mod/hostxrd.php +++ b/mod/hostxrd.php @@ -1,6 +1,7 @@ get_hostname(),z_root(),z_path(),z_root() . '/post', salmon_key(get_config('system','site_pubkey'))),$tpl);*/ + '$zhost','$zroot','$domain','$zot_post','$bigkey'),array($a->get_hostname(),System::baseUrl(),System::baseUrl(),System::baseUrl() . '/post', salmon_key(get_config('system','site_pubkey'))),$tpl);*/ $tpl = get_markup_template('xrd_host.tpl'); echo replace_macros($tpl, array( '$zhost' => $a->get_hostname(), - '$zroot' => z_root(), - '$domain' => z_path(), - '$zot_post' => z_root() . '/post', + '$zroot' => System::baseUrl(), + '$domain' => System::baseUrl(), + '$zot_post' => System::baseUrl() . '/post', '$bigkey' => salmon_key(get_config('system','site_pubkey')), )); exit(); diff --git a/mod/ignored.php b/mod/ignored.php index 5f597ca17a..5c304c2950 100644 --- a/mod/ignored.php +++ b/mod/ignored.php @@ -42,7 +42,7 @@ function ignored_init(App $a) { if(strpos($return_path, '?')) $rand = "&$rand"; else $rand = "?$rand"; - goaway(App::get_baseurl() . "/" . $return_path . $rand); + goaway(System::baseUrl() . "/" . $return_path . $rand); } // the json doesn't really matter, it will either be 0 or 1 diff --git a/mod/install.php b/mod/install.php index 4c0353acf8..ae462914c8 100755 --- a/mod/install.php +++ b/mod/install.php @@ -18,7 +18,7 @@ function install_init(App $a) { // We overwrite current theme css, because during install we could not have a working mod_rewrite // so we could not have a css at all. Here we set a static css file for the install procedure pages $a->config['system']['theme'] = "../install"; - $a->theme['stylesheet'] = App::get_baseurl()."/view/install/style.css"; + $a->theme['stylesheet'] = System::baseUrl()."/view/install/style.css"; global $install_wizard_pass; if (x($_POST, 'pass')) { @@ -204,7 +204,7 @@ function install_content(App $a) { '$next' => t('Next'), '$reload' => t('Check again'), '$phpath' => $phpath, - '$baseurl' => App::get_baseurl(), + '$baseurl' => System::baseUrl(), )); return $o; }; break; @@ -238,7 +238,7 @@ function install_content(App $a) { '$lbl_10' => t('Please select a default timezone for your website'), - '$baseurl' => App::get_baseurl(), + '$baseurl' => System::baseUrl(), '$phpath' => $phpath, @@ -278,7 +278,7 @@ function install_content(App $a) { '$timezone' => field_timezone('timezone', t('Please select a default timezone for your website'), $timezone, ''), '$language' => array('language', t('System Language:'), 'en', t('Set the default language for your Friendica installation interface and to send emails.'), $lang_choices), - '$baseurl' => App::get_baseurl(), + '$baseurl' => System::baseUrl(), @@ -480,10 +480,10 @@ function check_htaccess(&$checks) { $status = true; $help = ""; if (function_exists('curl_init')) { - $test = fetch_url(App::get_baseurl()."/install/testrewrite"); + $test = fetch_url(System::baseUrl()."/install/testrewrite"); if ($test != "ok") { - $test = fetch_url(normalise_link(App::get_baseurl()."/install/testrewrite")); + $test = fetch_url(normalise_link(System::baseUrl()."/install/testrewrite")); } if ($test != "ok") { @@ -543,7 +543,7 @@ function load_database($db) { } function what_next() { - $baseurl = App::get_baseurl(); + $baseurl = System::baseUrl(); return t('

    What next

    ') ."

    ".t('IMPORTANT: You will need to [manually] setup a scheduled task for the poller.') diff --git a/mod/invite.php b/mod/invite.php index 88a0059cb5..81b5880024 100644 --- a/mod/invite.php +++ b/mod/invite.php @@ -124,7 +124,7 @@ function invite_content(App $a) { if ($a->config['register_policy'] == REGISTER_CLOSED) { $linktxt = sprintf( t('Visit %s for a list of public sites that you can join. Friendica members on other sites can all connect with each other, as well as with members of many other social networks.'), $dirloc . '/servers'); } else { - $linktxt = sprintf( t('To accept this invitation, please visit and register at %s or any other public Friendica website.'), App::get_baseurl()) + $linktxt = sprintf( t('To accept this invitation, please visit and register at %s or any other public Friendica website.'), System::baseUrl()) . "\r\n" . "\r\n" . sprintf( t('Friendica sites all inter-connect to create a huge privacy-enhanced social web that is owned and controlled by its members. They can also connect with many traditional social networks. See %s for a list of alternate Friendica sites you can join.'),$dirloc . '/servers'); } } else { // there is no global directory URL defined @@ -132,7 +132,7 @@ function invite_content(App $a) { $o = t('Our apologies. This system is not currently configured to connect with other public sites or invite members.'); return $o; } else { - $linktxt = sprintf( t('To accept this invitation, please visit and register at %s.'), App::get_baseurl() + $linktxt = sprintf( t('To accept this invitation, please visit and register at %s.'), System::baseUrl() . "\r\n" . "\r\n" . t('Friendica sites all inter-connect to create a huge privacy-enhanced social web that is owned and controlled by its members. They can also connect with many traditional social networks.')); } } @@ -145,7 +145,7 @@ function invite_content(App $a) { '$default_message' => t('You are cordially invited to join me and other close friends on Friendica - and help us to create a better social web.') . "\r\n" . "\r\n" . $linktxt . "\r\n" . "\r\n" . (($invonly) ? t('You will need to supply this invitation code: $invite_code') . "\r\n" . "\r\n" : '') .t('Once you have registered, please connect with me via my profile page at:') - . "\r\n" . "\r\n" . App::get_baseurl() . '/profile/' . $a->user['nickname'] + . "\r\n" . "\r\n" . System::baseUrl() . '/profile/' . $a->user['nickname'] . "\r\n" . "\r\n" . t('For more information about the Friendica project and why we feel it is important, please visit http://friendi.ca') . "\r\n" . "\r\n" , '$submit' => t('Submit') )); diff --git a/mod/item.php b/mod/item.php index 3b54b0cf87..a681ca70da 100644 --- a/mod/item.php +++ b/mod/item.php @@ -67,7 +67,7 @@ function item_post(App $a) { if (!$preview && x($_REQUEST, 'post_id_random')) { if (x($_SESSION, 'post-random') && $_SESSION['post-random'] == $_REQUEST['post_id_random']) { logger("item post: duplicate post", LOGGER_DEBUG); - item_post_return(App::get_baseurl(), $api_source, $return_path); + item_post_return(System::baseUrl(), $api_source, $return_path); } else { $_SESSION['post-random'] = $_REQUEST['post_id_random']; } @@ -437,7 +437,7 @@ function item_post(App $a) { $objecttype = ACTIVITY_OBJ_IMAGE; foreach ($images as $image) { - if (! stristr($image,App::get_baseurl() . '/photo/')) { + if (! stristr($image,System::baseUrl() . '/photo/')) { continue; } $image_uri = substr($image,strrpos($image,'/') + 1); @@ -626,7 +626,7 @@ function item_post(App $a) { if (strlen($attachments)) { $attachments .= ','; } - $attachments .= '[attach]href="' . App::get_baseurl() . '/attach/' . $r[0]['id'] . '" length="' . $r[0]['filesize'] . '" type="' . $r[0]['filetype'] . '" title="' . (($r[0]['filename']) ? $r[0]['filename'] : '') . '"[/attach]'; + $attachments .= '[attach]href="' . System::baseUrl() . '/attach/' . $r[0]['id'] . '" length="' . $r[0]['filesize'] . '" type="' . $r[0]['filetype'] . '" title="' . (($r[0]['filename']) ? $r[0]['filename'] : '') . '"[/attach]'; } $body = str_replace($match[1],'',$body); } @@ -721,7 +721,7 @@ function item_post(App $a) { // $datarray['prvnets'] = $user['prvnets']; $datarray['parent-uri'] = ($parent == 0) ? $uri : $parent_item['uri']; - $datarray['plink'] = App::get_baseurl() . '/display/' . urlencode($datarray['guid']); + $datarray['plink'] = System::baseUrl() . '/display/' . urlencode($datarray['guid']); $datarray['last-child'] = 1; $datarray['visible'] = 1; @@ -766,7 +766,7 @@ function item_post(App $a) { $json = array('cancel' => 1); if (x($_REQUEST, 'jsreload') && strlen($_REQUEST['jsreload'])) { - $json['reload'] = App::get_baseurl() . '/' . $_REQUEST['jsreload']; + $json['reload'] = System::baseUrl() . '/' . $_REQUEST['jsreload']; } echo json_encode($json); @@ -936,7 +936,7 @@ function item_post(App $a) { 'to_email' => $user['email'], 'uid' => $user['uid'], 'item' => $datarray, - 'link' => App::get_baseurl().'/display/'.urlencode($datarray['guid']), + 'link' => System::baseUrl().'/display/'.urlencode($datarray['guid']), 'source_name' => $datarray['author-name'], 'source_link' => $datarray['author-link'], 'source_photo' => $datarray['author-avatar'], @@ -968,7 +968,7 @@ function item_post(App $a) { 'to_email' => $user['email'], 'uid' => $user['uid'], 'item' => $datarray, - 'link' => App::get_baseurl().'/display/'.urlencode($datarray['guid']), + 'link' => System::baseUrl().'/display/'.urlencode($datarray['guid']), 'source_name' => $datarray['author-name'], 'source_link' => $datarray['author-link'], 'source_photo' => $datarray['author-avatar'], @@ -990,14 +990,14 @@ function item_post(App $a) { } $disclaimer = '


    ' . sprintf( t('This message was sent to you by %s, a member of the Friendica social network.'), $a->user['username']) . '
    '; - $disclaimer .= sprintf( t('You may visit them online at %s'), App::get_baseurl() . '/profile/' . $a->user['nickname']) . EOL; + $disclaimer .= sprintf( t('You may visit them online at %s'), System::baseUrl() . '/profile/' . $a->user['nickname']) . EOL; $disclaimer .= t('Please contact the sender by replying to this post if you do not wish to receive these messages.') . EOL; if (!$datarray['title']=='') { $subject = email_header_encode($datarray['title'], 'UTF-8'); } else { $subject = email_header_encode('[Friendica]' . ' ' . sprintf( t('%s posted an update.'), $a->user['username']), 'UTF-8'); } - $link = '' . $a->user['username'] . '

    '; + $link = '' . $a->user['username'] . '

    '; $html = prepare_body($datarray); $message = '' . $link . $html . $disclaimer . ''; include_once 'include/html2plain.php'; @@ -1037,7 +1037,7 @@ function item_post(App $a) { logger('post_complete'); - item_post_return(App::get_baseurl(), $api_source, $return_path); + item_post_return(System::baseUrl(), $api_source, $return_path); // NOTREACHED } diff --git a/mod/like.php b/mod/like.php index 3461090183..6918bd5521 100755 --- a/mod/like.php +++ b/mod/like.php @@ -27,7 +27,7 @@ function like_content(App $a) { // See if we've been passed a return path to redirect to $return_path = ((x($_REQUEST,'return')) ? $_REQUEST['return'] : ''); - like_content_return(App::get_baseurl(), $return_path); + like_content_return(System::baseUrl(), $return_path); killme(); // NOTREACHED // return; // NOTREACHED } diff --git a/mod/localtime.php b/mod/localtime.php index 554d87b124..0a3881f698 100644 --- a/mod/localtime.php +++ b/mod/localtime.php @@ -38,7 +38,7 @@ function localtime_content(App $a) { $o .= '

    ' . sprintf( t('Converted localtime: %s'),$a->data['mod-localtime']) . '

    '; - $o .= '
    '; + $o .= ''; $o .= '

    ' . t('Please select your timezone:') . '

    '; diff --git a/mod/login.php b/mod/login.php index 09f1f5d5cc..f30353e828 100644 --- a/mod/login.php +++ b/mod/login.php @@ -1,6 +1,7 @@ config['register_policy'] == REGISTER_CLOSED) ? false : true); diff --git a/mod/lostpass.php b/mod/lostpass.php index a192388ad7..a2e69ffb09 100644 --- a/mod/lostpass.php +++ b/mod/lostpass.php @@ -11,7 +11,7 @@ function lostpass_post(App $a) { $loginame = notags(trim($_POST['login-name'])); if(! $loginame) - goaway(z_root()); + goaway(System::baseUrl()); $r = q("SELECT * FROM `user` WHERE ( `email` = '%s' OR `nickname` = '%s' ) AND `verified` = 1 AND `blocked` = 0 LIMIT 1", dbesc($loginame), @@ -20,7 +20,7 @@ function lostpass_post(App $a) { if (! dbm::is_result($r)) { notice( t('No valid account found.') . EOL); - goaway(z_root()); + goaway(System::baseUrl()); } $uid = $r[0]['uid']; @@ -39,7 +39,7 @@ function lostpass_post(App $a) { $sitename = $a->config['sitename']; - $resetlink = App::get_baseurl() . '/lostpass?verify=' . $new_password; + $resetlink = System::baseUrl() . '/lostpass?verify=' . $new_password; $preamble = deindent(t(' Dear %1$s, @@ -66,7 +66,7 @@ function lostpass_post(App $a) { Login Name: %3$s')); $preamble = sprintf($preamble, $username, $sitename); - $body = sprintf($body, $resetlink, App::get_baseurl(), $email); + $body = sprintf($body, $resetlink, System::baseUrl(), $email); notification(array( 'type' => "SYSTEM_EMAIL", @@ -75,7 +75,7 @@ function lostpass_post(App $a) { 'preamble'=> $preamble, 'body' => $body)); - goaway(z_root()); + goaway(System::baseUrl()); } @@ -114,10 +114,10 @@ function lostpass_content(App $a) { '$lbl2' => t('Your password has been reset as requested.'), '$lbl3' => t('Your new password is'), '$lbl4' => t('Save or copy your new password - and then'), - '$lbl5' => '' . t('click here to login') . '.', + '$lbl5' => '' . t('click here to login') . '.', '$lbl6' => t('Your password may be changed from the Settings page after successful login.'), '$newpass' => $new_password, - '$baseurl' => App::get_baseurl() + '$baseurl' => System::baseUrl() )); info("Your password has been reset." . EOL); @@ -142,7 +142,7 @@ function lostpass_content(App $a) { ')); $preamble = sprintf($preamble, $username); - $body = sprintf($body, App::get_baseurl(), $email, $new_password); + $body = sprintf($body, System::baseUrl(), $email, $new_password); notification(array( 'type' => "SYSTEM_EMAIL", diff --git a/mod/manage.php b/mod/manage.php index c5123f2dde..04ead0bb72 100644 --- a/mod/manage.php +++ b/mod/manage.php @@ -92,7 +92,7 @@ function manage_post(App $a) { $ret = array(); call_hooks('home_init',$ret); - goaway( App::get_baseurl() . "/profile/" . $a->user['nickname'] ); + goaway( System::baseUrl() . "/profile/" . $a->user['nickname'] ); // NOTREACHED } diff --git a/mod/manifest.php b/mod/manifest.php index 90fd717413..203f5ab829 100644 --- a/mod/manifest.php +++ b/mod/manifest.php @@ -16,7 +16,7 @@ function manifest_content(App $a) { } $o = replace_macros($tpl, array( - '$baseurl' => App::get_baseurl(), + '$baseurl' => System::baseUrl(), '$touch_icon' => $touch_icon, '$title' => Config::get('config', 'sitename', 'Friendica'), )); diff --git a/mod/match.php b/mod/match.php index 7d5f7a8cd2..829ca39878 100644 --- a/mod/match.php +++ b/mod/match.php @@ -27,7 +27,7 @@ function match_content(App $a) { $a->page['aside'] .= findpeople_widget(); $a->page['aside'] .= follow_widget(); - $_SESSION['return_url'] = App::get_baseurl() . '/' . $a->cmd; + $_SESSION['return_url'] = System::baseUrl() . '/' . $a->cmd; $r = q("SELECT `pub_keywords`, `prv_keywords` FROM `profile` WHERE `is-default` = 1 AND `uid` = %d LIMIT 1", intval(local_user()) @@ -51,7 +51,7 @@ function match_content(App $a) { if(strlen(get_config('system','directory'))) $x = post_url(get_server().'/msearch', $params); else - $x = post_url(App::get_baseurl() . '/msearch', $params); + $x = post_url(System::baseUrl() . '/msearch', $params); $j = json_decode($x); @@ -72,7 +72,7 @@ function match_content(App $a) { if (!count($match)) { $jj->photo = str_replace("http:///photo/", get_server()."/photo/", $jj->photo); - $connlnk = App::get_baseurl() . '/follow/?url=' . $jj->url; + $connlnk = System::baseUrl() . '/follow/?url=' . $jj->url; $photo_menu = array( 'profile' => array(t("View Profile"), zrl($jj->url)), 'follow' => array(t("Connect/Follow"), $connlnk) diff --git a/mod/message.php b/mod/message.php index 34f68187af..01bbae7f5e 100644 --- a/mod/message.php +++ b/mod/message.php @@ -27,17 +27,17 @@ function message_init(App $a) { '$tabs'=>$tabs, '$new'=>$new, )); - $base = App::get_baseurl(); + $base = System::baseUrl(); $head_tpl = get_markup_template('message-head.tpl'); $a->page['htmlhead'] .= replace_macros($head_tpl,array( - '$baseurl' => App::get_baseurl(true), + '$baseurl' => System::baseUrl(true), '$base' => $base )); $end_tpl = get_markup_template('message-end.tpl'); $a->page['end'] .= replace_macros($end_tpl,array( - '$baseurl' => App::get_baseurl(true), + '$baseurl' => System::baseUrl(true), '$base' => $base )); @@ -139,7 +139,7 @@ function item_redir_and_replace_images($body, $images, $cid) { for($i = 0; $i < count($images); $i++) { $search = '/\[url\=(.*?)\]\[!#saved_image' . $i . '#!\]\[\/url\]' . '/is'; - $replace = '[url=' . z_path() . '/redir/' . $cid + $replace = '[url=' . System::baseUrl() . '/redir/' . $cid . '?f=1&url=' . '$1' . '][!#saved_image' . $i . '#!][/url]' ; $img_end = strpos($origbody, '[!#saved_image' . $i . '#!][/url]') + strlen('[!#saved_image' . $i . '#!][/url]'); @@ -175,7 +175,7 @@ function message_content(App $a) { return; } - $myprofile = App::get_baseurl().'/profile/' . $a->user['nickname']; + $myprofile = System::baseUrl().'/profile/' . $a->user['nickname']; $tpl = get_markup_template('mail_head.tpl'); $header = replace_macros($tpl, array( @@ -226,7 +226,7 @@ function message_content(App $a) { if ($r) { info( t('Message deleted.') . EOL ); } - //goaway(App::get_baseurl(true) . '/message' ); + //goaway(System::baseUrl(true) . '/message' ); goaway($_SESSION['return_url']); } else { @@ -257,7 +257,7 @@ function message_content(App $a) { if($r) info( t('Conversation removed.') . EOL ); } - //goaway(App::get_baseurl(true) . '/message' ); + //goaway(System::baseUrl(true) . '/message' ); goaway($_SESSION['return_url']); } @@ -269,14 +269,14 @@ function message_content(App $a) { $tpl = get_markup_template('msg-header.tpl'); $a->page['htmlhead'] .= replace_macros($tpl, array( - '$baseurl' => App::get_baseurl(true), + '$baseurl' => System::baseUrl(true), '$nickname' => $a->user['nickname'], '$linkurl' => t('Please enter a link URL:') )); $tpl = get_markup_template('msg-end.tpl'); $a->page['end'] .= replace_macros($tpl, array( - '$baseurl' => App::get_baseurl(true), + '$baseurl' => System::baseUrl(true), '$nickname' => $a->user['nickname'], '$linkurl' => t('Please enter a link URL:') )); @@ -416,14 +416,14 @@ function message_content(App $a) { $tpl = get_markup_template('msg-header.tpl'); $a->page['htmlhead'] .= replace_macros($tpl, array( - '$baseurl' => App::get_baseurl(true), + '$baseurl' => System::baseUrl(true), '$nickname' => $a->user['nickname'], '$linkurl' => t('Please enter a link URL:') )); $tpl = get_markup_template('msg-end.tpl'); $a->page['end'] .= replace_macros($tpl, array( - '$baseurl' => App::get_baseurl(true), + '$baseurl' => System::baseUrl(true), '$nickname' => $a->user['nickname'], '$linkurl' => t('Please enter a link URL:') )); @@ -556,7 +556,7 @@ function render_messages(array $msg, $t) { $tpl = get_markup_template($t); $rslt = ''; - $myprofile = App::get_baseurl().'/profile/' . $a->user['nickname']; + $myprofile = System::baseUrl().'/profile/' . $a->user['nickname']; foreach($msg as $rr) { diff --git a/mod/mood.php b/mod/mood.php index bbdd516835..c4d93b6de2 100644 --- a/mod/mood.php +++ b/mod/mood.php @@ -94,7 +94,7 @@ function mood_init(App $a) { $item_id = item_store($arr); if($item_id) { q("UPDATE `item` SET `plink` = '%s' WHERE `uid` = %d AND `id` = %d", - dbesc(App::get_baseurl() . '/display/' . $poster['nickname'] . '/' . $item_id), + dbesc(System::baseUrl() . '/display/' . $poster['nickname'] . '/' . $item_id), intval($uid), intval($item_id) ); diff --git a/mod/msearch.php b/mod/msearch.php index fcf87f9588..675a94fe39 100644 --- a/mod/msearch.php +++ b/mod/msearch.php @@ -32,8 +32,8 @@ function msearch_post(App $a) { foreach($r as $rr) $results[] = array( 'name' => $rr['name'], - 'url' => App::get_baseurl() . '/profile/' . $rr['nickname'], - 'photo' => App::get_baseurl() . '/photo/avatar/' . $rr['uid'] . '.jpg', + 'url' => System::baseUrl() . '/profile/' . $rr['nickname'], + 'photo' => System::baseUrl() . '/photo/avatar/' . $rr['uid'] . '.jpg', 'tags' => str_replace(array(',',' '),array(' ',' '),$rr['pub_keywords']) ); } diff --git a/mod/navigation.php b/mod/navigation.php index 26a637e22e..d05131ebe4 100644 --- a/mod/navigation.php +++ b/mod/navigation.php @@ -15,7 +15,7 @@ function navigation_content(App $a) { $tpl = get_markup_template('navigation.tpl'); return replace_macros($tpl, array( - '$baseurl' => App::get_baseurl(), + '$baseurl' => System::baseUrl(), '$sitelocation' => $nav_info['sitelocation'], '$nav' => $nav_info['nav'], '$banner' => $nav_info['banner'], diff --git a/mod/network.php b/mod/network.php index 519442e0b4..796d35b866 100644 --- a/mod/network.php +++ b/mod/network.php @@ -106,7 +106,7 @@ function network_init(App $a) { $redir_url = ($net_queries ? $net_baseurl."?".$net_queries : $net_baseurl); - goaway(App::get_baseurl() . $redir_url); + goaway(System::baseUrl() . $redir_url); } } diff --git a/mod/nodeinfo.php b/mod/nodeinfo.php index bf6740c7fe..5cc2734c8e 100644 --- a/mod/nodeinfo.php +++ b/mod/nodeinfo.php @@ -13,7 +13,7 @@ require_once 'include/plugin.php'; function nodeinfo_wellknown(App $a) { $nodeinfo = array('links' => array(array('rel' => 'http://nodeinfo.diaspora.software/ns/schema/1.0', - 'href' => App::get_baseurl().'/nodeinfo/1.0'))); + 'href' => System::baseUrl().'/nodeinfo/1.0'))); header('Content-type: application/json; charset=utf-8'); echo json_encode($nodeinfo, JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES); diff --git a/mod/noscrape.php b/mod/noscrape.php index 2732336504..4b2ce73a39 100644 --- a/mod/noscrape.php +++ b/mod/noscrape.php @@ -37,7 +37,7 @@ function noscrape_init(App $a) { 'addr' => $a->profile['addr'], 'nick' => $which, 'key' => $a->profile['pubkey'], - 'homepage' => App::get_baseurl()."/profile/{$which}", + 'homepage' => System::baseUrl()."/profile/{$which}", 'comm' => (x($a->profile,'page-flags')) && ($a->profile['page-flags'] == PAGE_COMMUNITY), 'photo' => $r[0]["photo"], 'tags' => $keywords @@ -72,7 +72,7 @@ function noscrape_init(App $a) { $dfrn_pages = array('request', 'confirm', 'notify', 'poll'); foreach ($dfrn_pages as $dfrn) { - $json_info["dfrn-{$dfrn}"] = App::get_baseurl()."/dfrn_{$dfrn}/{$which}"; + $json_info["dfrn-{$dfrn}"] = System::baseUrl()."/dfrn_{$dfrn}/{$which}"; } //Output all the JSON! diff --git a/mod/notice.php b/mod/notice.php index ed94b35d1a..ff8bed1800 100644 --- a/mod/notice.php +++ b/mod/notice.php @@ -11,7 +11,7 @@ function notice_init(App $a) { $r = q("SELECT `user`.`nickname` FROM `user` LEFT JOIN `item` ON `item`.`uid` = `user`.`uid` WHERE `item`.`id` = %d", intval($id)); if (dbm::is_result($r)) { $nick = $r[0]['nickname']; - $url = App::get_baseurl() . "/display/$nick/$id"; + $url = System::baseUrl() . "/display/$nick/$id"; goaway($url); } else { $a->error = 404; diff --git a/mod/notifications.php b/mod/notifications.php index 396361e91b..95467a584f 100644 --- a/mod/notifications.php +++ b/mod/notifications.php @@ -6,6 +6,7 @@ */ use Friendica\App; +use Friendica\Core\System; require_once("include/NotificationsManager.php"); require_once("include/contact_selectors.php"); @@ -14,7 +15,7 @@ require_once("include/network.php"); function notifications_post(App $a) { if (! local_user()) { - goaway(z_root()); + goaway(System::baseUrl()); } $request_id = (($a->argc > 1) ? $a->argv[1] : 0); diff --git a/mod/notify.php b/mod/notify.php index f2a73ea2a8..867ead9fa7 100644 --- a/mod/notify.php +++ b/mod/notify.php @@ -24,14 +24,14 @@ function notify_init(App $a) { $guid = basename($urldata["path"]); $itemdata = get_item_id($guid, local_user()); if ($itemdata["id"] != 0) { - $note['link'] = App::get_baseurl().'/display/'.$itemdata["nick"].'/'.$itemdata["id"]; + $note['link'] = System::baseUrl().'/display/'.$itemdata["nick"].'/'.$itemdata["id"]; } } goaway($note['link']); } - goaway(App::get_baseurl(true)); + goaway(System::baseUrl(true)); } if ($a->argc > 2 && $a->argv[1] === 'mark' && $a->argv[2] === 'all' ) { @@ -59,7 +59,7 @@ function notify_content(App $a) { if (dbm::is_result($r) > 0) { foreach ($r as $it) { $notif_content .= replace_macros($not_tpl,array( - '$item_link' => App::get_baseurl(true).'/notify/view/'. $it['id'], + '$item_link' => System::baseUrl(true).'/notify/view/'. $it['id'], '$item_image' => $it['photo'], '$item_text' => strip_tags(bbcode($it['msg'])), '$item_when' => relative_date($it['date']) diff --git a/mod/oexchange.php b/mod/oexchange.php index b04270ffb1..88edc9d60c 100644 --- a/mod/oexchange.php +++ b/mod/oexchange.php @@ -8,7 +8,7 @@ function oexchange_init(App $a) { if (($a->argc > 1) && ($a->argv[1] === 'xrd')) { $tpl = get_markup_template('oexchange_xrd.tpl'); - $o = replace_macros($tpl, array('$base' => App::get_baseurl())); + $o = replace_macros($tpl, array('$base' => System::baseUrl())); echo $o; killme(); } @@ -35,7 +35,7 @@ function oexchange_content(App $a) { $tags = (((x($_REQUEST,'tags')) && strlen($_REQUEST['tags'])) ? '&tags=' . urlencode(notags(trim($_REQUEST['tags']))) : ''); - $s = fetch_url(App::get_baseurl() . '/parse_url?f=&url=' . $url . $title . $description . $tags); + $s = fetch_url(System::baseUrl() . '/parse_url?f=&url=' . $url . $title . $description . $tags); if (! strlen($s)) { return; diff --git a/mod/openid.php b/mod/openid.php index a7413073f5..1dac83d2d5 100644 --- a/mod/openid.php +++ b/mod/openid.php @@ -9,7 +9,7 @@ function openid_content(App $a) { $noid = get_config('system','no_openid'); if($noid) - goaway(z_root()); + goaway(System::baseUrl()); logger('mod_openid ' . print_r($_REQUEST,true), LOGGER_DATA); @@ -23,7 +23,7 @@ function openid_content(App $a) { if(! strlen($authid)) { logger( t('OpenID protocol error. No ID returned.') . EOL); - goaway(z_root()); + goaway(System::baseUrl()); } // NOTE: we search both for normalised and non-normalised form of $authid @@ -51,7 +51,7 @@ function openid_content(App $a) { // just in case there was no return url set // and we fell through - goaway(z_root()); + goaway(System::baseUrl()); } // Successful OpenID login - but we can't match it to an existing account. @@ -59,7 +59,7 @@ function openid_content(App $a) { if ($a->config['register_policy'] == REGISTER_CLOSED) { notice( t('Account not found and OpenID registration is not permitted on this site.') . EOL); - goaway(z_root()); + goaway(System::baseUrl()); } unset($_SESSION['register']); @@ -103,12 +103,12 @@ function openid_content(App $a) { $args .= '&openid_url=' . urlencode(notags(trim($authid))); - goaway(App::get_baseurl() . '/register?' . $args); + goaway(System::baseUrl() . '/register?' . $args); // NOTREACHED } } notice( t('Login failed.') . EOL); - goaway(z_root()); + goaway(System::baseUrl()); // NOTREACHED } diff --git a/mod/opensearch.php b/mod/opensearch.php index 33dd6c0482..c61f4674b1 100644 --- a/mod/opensearch.php +++ b/mod/opensearch.php @@ -10,7 +10,7 @@ function opensearch_content(App $a) { header("Content-type: application/opensearchdescription+xml"); $o = replace_macros($tpl, array( - '$baseurl' => App::get_baseurl(), + '$baseurl' => System::baseUrl(), '$nodename' => $a->get_hostname(), )); diff --git a/mod/ostatus_subscribe.php b/mod/ostatus_subscribe.php index 7395cd0533..3250bdc2a2 100644 --- a/mod/ostatus_subscribe.php +++ b/mod/ostatus_subscribe.php @@ -51,7 +51,7 @@ function ostatus_subscribe_content(App $a) { $total = sizeof($friends); if ($counter >= $total) { - $a->page['htmlhead'] = ''; + $a->page['htmlhead'] = ''; del_pconfig($uid, "ostatus", "legacy_friends"); del_pconfig($uid, "ostatus", "legacy_contact"); $o .= t("Done"); @@ -80,7 +80,7 @@ function ostatus_subscribe_content(App $a) { $o .= "

    ".t("Keep this window open until done.")."

    "; - $a->page['htmlhead'] = ''; + $a->page['htmlhead'] = ''; return $o; } diff --git a/mod/p.php b/mod/p.php index 18c6a5d7f1..3ea810614e 100644 --- a/mod/p.php +++ b/mod/p.php @@ -35,7 +35,7 @@ function p_init($a){ $parts = parse_url($r[0]["author-link"]); $host = $parts["scheme"]."://".$parts["host"]; - if (normalise_link($host) != normalise_link(App::get_baseurl())) { + if (normalise_link($host) != normalise_link(System::baseUrl())) { $location = $host."/p/".urlencode($guid).".xml"; header("HTTP/1.1 301 Moved Permanently"); diff --git a/mod/photos.php b/mod/photos.php index 1aa330a85f..ac54e0e096 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -96,7 +96,7 @@ function photos_init(App $a) { '$title' => t('Photo Albums'), '$recent' => t('Recent Photos'), '$albums' => $albums['albums'], - '$baseurl' => z_root(), + '$baseurl' => System::baseUrl(), '$upload' => array(t('Upload New Photos'), 'photos/' . $a->data['user']['nickname'] . '/upload'), '$can_post' => $can_post )); @@ -374,7 +374,7 @@ function photos_post(App $a) { create_tags_from_itemuri($i[0]['uri'], $page_owner_uid); delete_thread_uri($i[0]['uri'], $page_owner_uid); - $url = App::get_baseurl(); + $url = System::baseUrl(); $drop_id = intval($i[0]['id']); // Update the photo albums cache @@ -526,8 +526,8 @@ function photos_post(App $a) { $arr['visible'] = $visibility; $arr['origin'] = 1; - $arr['body'] = '[url=' . App::get_baseurl() . '/photos/' . $a->data['user']['nickname'] . '/image/' . $p[0]['resource-id'] . ']' - . '[img]' . App::get_baseurl() . '/photo/' . $p[0]['resource-id'] . '-' . $p[0]['scale'] . '.'. $ext . '[/img]' + $arr['body'] = '[url=' . System::baseUrl() . '/photos/' . $a->data['user']['nickname'] . '/image/' . $p[0]['resource-id'] . ']' + . '[img]' . System::baseUrl() . '/photo/' . $p[0]['resource-id'] . '-' . $p[0]['scale'] . '.'. $ext . '[/img]' . '[/url]'; $item_id = item_store($arr); @@ -641,7 +641,7 @@ function photos_post(App $a) { } } elseif (strpos($tag, '#') === 0) { $tagname = substr($tag, 1); - $str_tags .= '#[url=' . App::get_baseurl() . "/search?tag=" . $tagname . ']' . $tagname . '[/url]'; + $str_tags .= '#[url=' . System::baseUrl() . "/search?tag=" . $tagname . ']' . $tagname . '[/url]'; } } } @@ -713,8 +713,8 @@ function photos_post(App $a) { $arr['tag'] = $tagged[4]; $arr['inform'] = $tagged[2]; $arr['origin'] = 1; - $arr['body'] = sprintf( t('%1$s was tagged in %2$s by %3$s'), '[url=' . $tagged[1] . ']' . $tagged[0] . '[/url]', '[url=' . App::get_baseurl() . '/photos/' . $owner_record['nickname'] . '/image/' . $p[0]['resource-id'] . ']' . t('a photo') . '[/url]', '[url=' . $owner_record['url'] . ']' . $owner_record['name'] . '[/url]') ; - $arr['body'] .= "\n\n" . '[url=' . App::get_baseurl() . '/photos/' . $owner_record['nickname'] . '/image/' . $p[0]['resource-id'] . ']' . '[img]' . App::get_baseurl() . "/photo/" . $p[0]['resource-id'] . '-' . $best . '.' . $ext . '[/img][/url]' . "\n" ; + $arr['body'] = sprintf( t('%1$s was tagged in %2$s by %3$s'), '[url=' . $tagged[1] . ']' . $tagged[0] . '[/url]', '[url=' . System::baseUrl() . '/photos/' . $owner_record['nickname'] . '/image/' . $p[0]['resource-id'] . ']' . t('a photo') . '[/url]', '[url=' . $owner_record['url'] . ']' . $owner_record['name'] . '[/url]') ; + $arr['body'] .= "\n\n" . '[url=' . System::baseUrl() . '/photos/' . $owner_record['nickname'] . '/image/' . $p[0]['resource-id'] . ']' . '[img]' . System::baseUrl() . "/photo/" . $p[0]['resource-id'] . '-' . $best . '.' . $ext . '[/img][/url]' . "\n" ; $arr['object'] = '' . ACTIVITY_OBJ_PERSON . '' . $tagged[0] . '' . $tagged[1] . '/' . $tagged[0] . ''; $arr['object'] .= '' . xmlify('' . "\n"); @@ -724,8 +724,8 @@ function photos_post(App $a) { $arr['object'] .= '' . "\n"; $arr['target'] = '' . ACTIVITY_OBJ_IMAGE . '' . $p[0]['desc'] . '' - . App::get_baseurl() . '/photos/' . $owner_record['nickname'] . '/image/' . $p[0]['resource-id'] . ''; - $arr['target'] .= '' . xmlify('' . "\n" . '') . ''; + . System::baseUrl() . '/photos/' . $owner_record['nickname'] . '/image/' . $p[0]['resource-id'] . ''; + $arr['target'] .= '' . xmlify('' . "\n" . '') . ''; $item_id = item_store($arr); if ($item_id) { @@ -943,8 +943,8 @@ function photos_post(App $a) { $arr['visible'] = $visible; $arr['origin'] = 1; - $arr['body'] = '[url=' . App::get_baseurl() . '/photos/' . $owner_record['nickname'] . '/image/' . $photo_hash . ']' - . '[img]' . App::get_baseurl() . "/photo/{$photo_hash}-{$smallest}.".$ph->getExt() . '[/img]' + $arr['body'] = '[url=' . System::baseUrl() . '/photos/' . $owner_record['nickname'] . '/image/' . $photo_hash . ']' + . '[img]' . System::baseUrl() . "/photo/{$photo_hash}-{$smallest}.".$ph->getExt() . '[/img]' . '[/url]'; $item_id = item_store($arr); diff --git a/mod/ping.php b/mod/ping.php index 138090331a..5a5bdcd589 100644 --- a/mod/ping.php +++ b/mod/ping.php @@ -183,7 +183,7 @@ function ping_init(App $a) $intro_count = count($intros1) + count($intros2); $intros = $intros1 + $intros2; - $myurl = App::get_baseurl() . '/profile/' . $a->user['nickname'] ; + $myurl = System::baseUrl() . '/profile/' . $a->user['nickname'] ; $mails = qu("SELECT `id`, `from-name`, `from-url`, `from-photo`, `created` FROM `mail` WHERE `uid` = %d AND `seen` = 0 AND `from-url` != '%s' ", intval(local_user()), @@ -266,7 +266,7 @@ function ping_init(App $a) if (dbm::is_result($intros)) { foreach ($intros as $intro) { $notif = array( - 'href' => App::get_baseurl() . '/notifications/intros/' . $intro['id'], + 'href' => System::baseUrl() . '/notifications/intros/' . $intro['id'], 'name' => $intro['name'], 'url' => $intro['url'], 'photo' => $intro['photo'], @@ -281,7 +281,7 @@ function ping_init(App $a) if (dbm::is_result($mails)) { foreach ($mails as $mail) { $notif = array( - 'href' => App::get_baseurl() . '/message/' . $mail['id'], + 'href' => System::baseUrl() . '/message/' . $mail['id'], 'name' => $mail['from-name'], 'url' => $mail['from-url'], 'photo' => $mail['from-photo'], @@ -296,7 +296,7 @@ function ping_init(App $a) if (dbm::is_result($regs)) { foreach ($regs as $reg) { $notif = array( - 'href' => App::get_baseurl() . '/admin/users/', + 'href' => System::baseUrl() . '/admin/users/', 'name' => $reg['name'], 'url' => $reg['url'], 'photo' => $reg['micro'], @@ -473,7 +473,7 @@ function ping_get_notifications($uid) ); } - $notification["href"] = App::get_baseurl() . "/notify/view/" . $notification["id"]; + $notification["href"] = System::baseUrl() . "/notify/view/" . $notification["id"]; if ($notification["visible"] && !$notification["spam"] && !$notification["deleted"] && !is_array($result[$notification["parent"]])) { diff --git a/mod/poke.php b/mod/poke.php index a7d1701c81..ca02b6bee5 100644 --- a/mod/poke.php +++ b/mod/poke.php @@ -124,7 +124,7 @@ function poke_init(App $a) { $arr['origin'] = 1; $arr['body'] = '[url=' . $poster['url'] . ']' . $poster['name'] . '[/url]' . ' ' . t($verbs[$verb][0]) . ' ' . '[url=' . $target['url'] . ']' . $target['name'] . '[/url]'; - $arr['object'] = '' . ACTIVITY_OBJ_PERSON . '' . $target['name'] . '' . App::get_baseurl() . '/contact/' . $target['id'] . ''; + $arr['object'] = '' . ACTIVITY_OBJ_PERSON . '' . $target['name'] . '' . System::baseUrl() . '/contact/' . $target['id'] . ''; $arr['object'] .= '' . xmlify('' . "\n"); $arr['object'] .= xmlify('' . "\n"); @@ -133,7 +133,7 @@ function poke_init(App $a) { $item_id = item_store($arr); if($item_id) { //q("UPDATE `item` SET `plink` = '%s' WHERE `uid` = %d AND `id` = %d", - // dbesc(App::get_baseurl() . '/display/' . $poster['nickname'] . '/' . $item_id), + // dbesc(System::baseUrl() . '/display/' . $poster['nickname'] . '/' . $item_id), // intval($uid), // intval($item_id) //); @@ -172,11 +172,11 @@ function poke_content(App $a) { } - $base = App::get_baseurl(); + $base = System::baseUrl(); $head_tpl = get_markup_template('poke_head.tpl'); $a->page['htmlhead'] .= replace_macros($head_tpl,array( - '$baseurl' => App::get_baseurl(true), + '$baseurl' => System::baseUrl(true), '$base' => $base )); diff --git a/mod/profile.php b/mod/profile.php index 37daaf0a2a..c2b4fe2489 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -16,7 +16,7 @@ function profile_init(App $a) { else { $r = q("select nickname from user where blocked = 0 and account_expired = 0 and account_removed = 0 and verified = 1 order by rand() limit 1"); if (dbm::is_result($r)) { - goaway(App::get_baseurl() . '/profile/' . $r[0]['nickname']); + goaway(System::baseUrl() . '/profile/' . $r[0]['nickname']); } else { logger('profile error: mod_profile ' . $a->query_string, LOGGER_DEBUG); @@ -59,16 +59,16 @@ function profile_init(App $a) { } $a->page['htmlhead'] .= '' . "\r\n" ; - $a->page['htmlhead'] .= '' . "\r\n" ; + $a->page['htmlhead'] .= '' . "\r\n" ; $uri = urlencode('acct:' . $a->profile['nickname'] . '@' . $a->get_hostname() . (($a->path) ? '/' . $a->path : '')); - $a->page['htmlhead'] .= '' . "\r\n"; - header('Link: <' . App::get_baseurl() . '/xrd/?uri=' . $uri . '>; rel="lrdd"; type="application/xrd+xml"', false); + $a->page['htmlhead'] .= '' . "\r\n"; + header('Link: <' . System::baseUrl() . '/xrd/?uri=' . $uri . '>; rel="lrdd"; type="application/xrd+xml"', false); $dfrn_pages = array('request', 'confirm', 'notify', 'poll'); foreach ($dfrn_pages as $dfrn) { - $a->page['htmlhead'] .= "\r\n"; + $a->page['htmlhead'] .= "\r\n"; } - $a->page['htmlhead'] .= "\r\n"; + $a->page['htmlhead'] .= "\r\n"; } @@ -180,8 +180,8 @@ function profile_content(App $a, $update = 0) { $commpage = (($a->profile['page-flags'] == PAGE_COMMUNITY) ? true : false); $commvisitor = (($commpage && $remote_contact == true) ? true : false); - $a->page['aside'] .= posted_date_widget(App::get_baseurl(true) . '/profile/' . $a->profile['nickname'],$a->profile['profile_uid'],true); - $a->page['aside'] .= categories_widget(App::get_baseurl(true) . '/profile/' . $a->profile['nickname'],(x($category) ? xmlify($category) : '')); + $a->page['aside'] .= posted_date_widget(System::baseUrl(true) . '/profile/' . $a->profile['nickname'],$a->profile['profile_uid'],true); + $a->page['aside'] .= categories_widget(System::baseUrl(true) . '/profile/' . $a->profile['nickname'],(x($category) ? xmlify($category) : '')); if (can_write_wall($a,$a->profile['profile_uid'])) { diff --git a/mod/profile_photo.php b/mod/profile_photo.php index ca55f80061..b4723b215f 100644 --- a/mod/profile_photo.php +++ b/mod/profile_photo.php @@ -103,15 +103,15 @@ function profile_photo_post(App $a) { ); $r = q("UPDATE `contact` SET `photo` = '%s', `thumb` = '%s', `micro` = '%s' WHERE `self` AND `uid` = %d", - dbesc(App::get_baseurl() . '/photo/' . $base_image['resource-id'] . '-4.' . $im->getExt()), - dbesc(App::get_baseurl() . '/photo/' . $base_image['resource-id'] . '-5.' . $im->getExt()), - dbesc(App::get_baseurl() . '/photo/' . $base_image['resource-id'] . '-6.' . $im->getExt()), + dbesc(System::baseUrl() . '/photo/' . $base_image['resource-id'] . '-4.' . $im->getExt()), + dbesc(System::baseUrl() . '/photo/' . $base_image['resource-id'] . '-5.' . $im->getExt()), + dbesc(System::baseUrl() . '/photo/' . $base_image['resource-id'] . '-6.' . $im->getExt()), intval(local_user()) ); } else { $r = q("update profile set photo = '%s', thumb = '%s' where id = %d and uid = %d", - dbesc(App::get_baseurl() . '/photo/' . $base_image['resource-id'] . '-4.' . $im->getExt()), - dbesc(App::get_baseurl() . '/photo/' . $base_image['resource-id'] . '-5.' . $im->getExt()), + dbesc(System::baseUrl() . '/photo/' . $base_image['resource-id'] . '-4.' . $im->getExt()), + dbesc(System::baseUrl() . '/photo/' . $base_image['resource-id'] . '-5.' . $im->getExt()), intval($_REQUEST['profile']), intval(local_user()) ); @@ -127,7 +127,7 @@ function profile_photo_post(App $a) { info( t('Shift-reload the page or clear browser cache if the new photo does not display immediately.') . EOL); // Update global directory in background - $url = App::get_baseurl() . '/profile/' . $a->user['nickname']; + $url = System::baseUrl() . '/profile/' . $a->user['nickname']; if ($url && strlen(get_config('system','directory'))) { proc_run(PRIORITY_LOW, "include/directory.php", $url); } @@ -138,7 +138,7 @@ function profile_photo_post(App $a) { } } - goaway(App::get_baseurl() . '/profiles'); + goaway(System::baseUrl() . '/profiles'); return; // NOTREACHED } @@ -232,7 +232,7 @@ function profile_photo_content(App $a) { proc_run(PRIORITY_LOW, "include/directory.php", $url); } - goaway(App::get_baseurl() . '/profiles'); + goaway(System::baseUrl() . '/profiles'); return; // NOTREACHED } $ph = new Photo($r[0]['data'], $r[0]['type']); @@ -257,7 +257,7 @@ function profile_photo_content(App $a) { '$submit' => t('Upload'), '$profiles' => $profiles, '$form_security_token' => get_form_security_token("profile_photo"), - '$select' => sprintf('%s %s', t('or'), ($newuser) ? '' . t('skip this step') . '' : '' . t('select a photo from your photo albums') . '') + '$select' => sprintf('%s %s', t('or'), ($newuser) ? '' . t('skip this step') . '' : '' . t('select a photo from your photo albums') . '') )); return $o; @@ -270,7 +270,7 @@ function profile_photo_content(App $a) { '$filename' => $filename, '$profile' => intval($_REQUEST['profile']), '$resource' => $a->config['imagecrop'] . '-' . $a->config['imagecrop_resolution'], - '$image_url' => App::get_baseurl() . '/photo/' . $filename, + '$image_url' => System::baseUrl() . '/photo/' . $filename, '$title' => t('Crop Image'), '$desc' => t('Please adjust the image cropping for optimum viewing.'), '$form_security_token' => get_form_security_token("profile_photo"), diff --git a/mod/profiles.php b/mod/profiles.php index 5161f814ca..42f4587563 100644 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -628,10 +628,10 @@ function profiles_content(App $a) { $a->page['htmlhead'] .= replace_macros(get_markup_template('profed_head.tpl'), array( - '$baseurl' => App::get_baseurl(true), + '$baseurl' => System::baseUrl(true), )); $a->page['end'] .= replace_macros(get_markup_template('profed_end.tpl'), array( - '$baseurl' => App::get_baseurl(true), + '$baseurl' => System::baseUrl(true), )); $opt_tpl = get_markup_template("profile-hide-friends.tpl"); @@ -708,7 +708,7 @@ function profiles_content(App $a) { '$lbl_ex2' => t('Example: fishing photography software'), '$disabled' => (($is_default) ? 'onclick="return false;" style="color: #BBBBFF;"' : ''), - '$baseurl' => App::get_baseurl(true), + '$baseurl' => System::baseUrl(true), '$profile_id' => $r[0]['id'], '$profile_name' => array('profile_name', t('Profile Name:'), $r[0]['profile-name'], t('Required'), '*'), '$is_default' => $is_default, diff --git a/mod/proxy.php b/mod/proxy.php index 65b3fdc510..20d02af85a 100644 --- a/mod/proxy.php +++ b/mod/proxy.php @@ -266,7 +266,7 @@ function proxy_url($url, $writemode = false, $size = '') { // Only continue if it isn't a local image and the isn't deactivated if (proxy_is_local_image($url)) { - $url = str_replace(normalise_link(App::get_baseurl()) . '/', App::get_baseurl() . '/', $url); + $url = str_replace(normalise_link(System::baseUrl()) . '/', System::baseUrl() . '/', $url); return $url; } @@ -299,7 +299,7 @@ function proxy_url($url, $writemode = false, $size = '') { $longpath .= '.' . $extension; } - $proxypath = App::get_baseurl() . '/proxy/' . $longpath; + $proxypath = System::baseUrl() . '/proxy/' . $longpath; if ($size != '') { $size = ':' . $size; @@ -310,7 +310,7 @@ function proxy_url($url, $writemode = false, $size = '') { if ((strlen($proxypath) > 250) && $writemode) { return $shortpath; } elseif (strlen($proxypath) > 250) { - return App::get_baseurl() . '/proxy/' . $shortpath . '?url=' . urlencode($url); + return System::baseUrl() . '/proxy/' . $shortpath . '?url=' . urlencode($url); } elseif ($writemode) { return $longpath; } else { @@ -332,7 +332,7 @@ function proxy_is_local_image($url) { } // links normalised - bug #431 - $baseurl = normalise_link(App::get_baseurl()); + $baseurl = normalise_link(System::baseUrl()); $url = normalise_link($url); return (substr($url, 0, strlen($baseurl)) == $baseurl); } @@ -374,7 +374,7 @@ function proxy_img_cb($matches) { } function proxy_parse_html($html) { - $html = str_replace(normalise_link(App::get_baseurl()) . '/', App::get_baseurl() . '/', $html); + $html = str_replace(normalise_link(System::baseUrl()) . '/', System::baseUrl() . '/', $html); return preg_replace_callback('/(]*src *= *["\'])([^"\']+)(["\'][^>]*>)/siU', 'proxy_img_cb', $html); } diff --git a/mod/randprof.php b/mod/randprof.php index 7bdd9e4ee0..f835780e07 100644 --- a/mod/randprof.php +++ b/mod/randprof.php @@ -12,5 +12,5 @@ function randprof_init(App $a) { goaway(zrl($x)); } - goaway(App::get_baseurl() . '/profile'); + goaway(System::baseUrl() . '/profile'); } diff --git a/mod/redir.php b/mod/redir.php index b0d2da262a..739ad01034 100644 --- a/mod/redir.php +++ b/mod/redir.php @@ -22,7 +22,7 @@ function redir_init(App $a) { ); if((! dbm::is_result($r)) || ($r[0]['network'] !== NETWORK_DFRN)) - goaway(z_root()); + goaway(System::baseUrl()); $cid = $r[0]['id']; } @@ -35,7 +35,7 @@ function redir_init(App $a) { ); if((! dbm::is_result($r)) || ($r[0]['network'] !== NETWORK_DFRN)) - goaway(z_root()); + goaway(System::baseUrl()); } $dfrn_id = $orig_id = (($r[0]['issued-id']) ? $r[0]['issued-id'] : $r[0]['dfrn-id']); @@ -67,7 +67,7 @@ function redir_init(App $a) { } if (local_user()) { - $handle = $a->user['nickname'] . '@' . substr(App::get_baseurl(),strpos(App::get_baseurl(),'://')+3); + $handle = $a->user['nickname'] . '@' . substr(System::baseUrl(),strpos(System::baseUrl(),'://')+3); } if (remote_user()) { $handle = $_SESSION['handle']; @@ -78,5 +78,5 @@ function redir_init(App $a) { goaway($url); } - goaway(z_root()); + goaway(System::baseUrl()); } diff --git a/mod/register.php b/mod/register.php index 6ae9c5d522..cb9c1729f5 100644 --- a/mod/register.php +++ b/mod/register.php @@ -68,7 +68,7 @@ function register_post(App $a) { $user = $result['user']; if($netpublish && $a->config['register_policy'] != REGISTER_APPROVE) { - $url = App::get_baseurl() . '/profile/' . $user['nickname']; + $url = System::baseUrl() . '/profile/' . $user['nickname']; proc_run(PRIORITY_LOW, "include/directory.php", $url); } @@ -89,13 +89,13 @@ function register_post(App $a) { $res = send_register_open_eml( $user['email'], $a->config['sitename'], - App::get_baseurl(), + System::baseUrl(), $user['username'], $result['password']); if($res) { info( t('Registration successful. Please check your email for further instructions.') . EOL ) ; - goaway(z_root()); + goaway(System::baseUrl()); } else { notice( sprintf( @@ -107,13 +107,13 @@ function register_post(App $a) { } } else { info( t('Registration successful.') . EOL ) ; - goaway(z_root()); + goaway(System::baseUrl()); } } elseif($a->config['register_policy'] == REGISTER_APPROVE) { if(! strlen($a->config['admin_email'])) { notice( t('Your registration can not be processed.') . EOL); - goaway(z_root()); + goaway(System::baseUrl()); } $hash = random_string(); @@ -146,9 +146,9 @@ function register_post(App $a) { 'source_name' => $user['username'], 'source_mail' => $user['email'], 'source_nick' => $user['nickname'], - 'source_link' => App::get_baseurl()."/admin/users/", - 'link' => App::get_baseurl()."/admin/users/", - 'source_photo' => App::get_baseurl() . "/photo/avatar/".$user['uid'].".jpg", + 'source_link' => System::baseUrl()."/admin/users/", + 'link' => System::baseUrl()."/admin/users/", + 'source_photo' => System::baseUrl() . "/photo/avatar/".$user['uid'].".jpg", 'to_email' => $admin['email'], 'uid' => $admin['uid'], 'language' => ($admin['language']?$admin['language']:'en'), @@ -162,7 +162,7 @@ function register_post(App $a) { $user['username']); info( t('Your registration is pending approval by the site owner.') . EOL ) ; - goaway(z_root()); + goaway(System::baseUrl()); } diff --git a/mod/regmod.php b/mod/regmod.php index 28d45f5a60..a2c454f9a2 100644 --- a/mod/regmod.php +++ b/mod/regmod.php @@ -40,7 +40,7 @@ function user_allow($hash) { intval($user[0]['uid']) ); if (dbm::is_result($r) && $r[0]['net-publish']) { - $url = App::get_baseurl() . '/profile/' . $user[0]['nickname']; + $url = System::baseUrl() . '/profile/' . $user[0]['nickname']; if ($url && strlen(get_config('system','directory'))) { proc_run(PRIORITY_LOW, "include/directory.php", $url); } @@ -51,7 +51,7 @@ function user_allow($hash) { send_register_open_eml( $user[0]['email'], $a->config['sitename'], - App::get_baseurl(), + System::baseUrl(), $user[0]['username'], $register[0]['password']); @@ -119,13 +119,13 @@ function regmod_content(App $a) { if ($cmd === 'deny') { user_deny($hash); - goaway(App::get_baseurl()."/admin/users/"); + goaway(System::baseUrl()."/admin/users/"); killme(); } if ($cmd === 'allow') { user_allow($hash); - goaway(App::get_baseurl()."/admin/users/"); + goaway(System::baseUrl()."/admin/users/"); killme(); } } diff --git a/mod/removeme.php b/mod/removeme.php index fe3770842d..5dcd33e8f5 100644 --- a/mod/removeme.php +++ b/mod/removeme.php @@ -38,7 +38,7 @@ function removeme_post(App $a) { function removeme_content(App $a) { if (! local_user()) { - goaway(z_root()); + goaway(System::baseUrl()); } $hash = random_string(); @@ -50,7 +50,7 @@ function removeme_content(App $a) { $tpl = get_markup_template('removeme.tpl'); $o .= replace_macros($tpl, array( - '$basedir' => App::get_baseurl(), + '$basedir' => System::baseUrl(), '$hash' => $hash, '$title' => t('Remove My Account'), '$desc' => t('This will completely remove your account. Once this has been done it is not recoverable.'), diff --git a/mod/repair_ostatus.php b/mod/repair_ostatus.php index 3cbc92ae1d..ea83b08adf 100755 --- a/mod/repair_ostatus.php +++ b/mod/repair_ostatus.php @@ -54,7 +54,7 @@ function repair_ostatus_content(App $a) { $result = new_contact($uid,$r[0]["url"],true); - $a->page['htmlhead'] = ''; + $a->page['htmlhead'] = ''; return $o; } diff --git a/mod/rsd_xml.php b/mod/rsd_xml.php index 7b234e465e..8c7170dcdf 100644 --- a/mod/rsd_xml.php +++ b/mod/rsd_xml.php @@ -12,7 +12,7 @@ function rsd_xml_content(App $a) Friendica http://friendica.com/ - + http://status.net/wiki/TwitterCompatibleAPI false diff --git a/mod/settings.php b/mod/settings.php index c09b4397df..c98e1b99be 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -143,7 +143,7 @@ function settings_post(App $a) { q("DELETE FROM tokens WHERE id='%s' AND uid=%d", dbesc($key), local_user()); - goaway(App::get_baseurl(true)."/settings/oauth/"); + goaway(System::baseUrl(true)."/settings/oauth/"); return; } @@ -188,7 +188,7 @@ function settings_post(App $a) { local_user()); } } - goaway(App::get_baseurl(true)."/settings/oauth/"); + goaway(System::baseUrl(true)."/settings/oauth/"); return; } @@ -723,7 +723,7 @@ function settings_content(App $a) { $r = q("DELETE FROM clients WHERE client_id='%s' AND uid=%d", dbesc($a->argv[3]), local_user()); - goaway(App::get_baseurl(true)."/settings/oauth/"); + goaway(System::baseUrl(true)."/settings/oauth/"); return; } @@ -739,7 +739,7 @@ function settings_content(App $a) { $tpl = get_markup_template("settings_oauth.tpl"); $o .= replace_macros($tpl, array( '$form_security_token' => get_form_security_token("settings_oauth"), - '$baseurl' => App::get_baseurl(true), + '$baseurl' => System::baseUrl(true), '$title' => t('Connected Apps'), '$add' => t('Add application'), '$edit' => t('Edit'), @@ -829,7 +829,7 @@ function settings_content(App $a) { /// @TODO Found to much different usage to test empty/non-empty strings (e.g. empty(), trim() == '' ) which is wanted? if ($legacy_contact != "") { - $a->page['htmlhead'] = ''; + $a->page['htmlhead'] = ''; } $settings_connectors .= '
    '; @@ -838,7 +838,7 @@ function settings_content(App $a) { $settings_connectors .= ''.t('If you enter your old GNU Social/Statusnet account name here (in the format user@domain.tld), your contacts will be added automatically. The field will be emptied when done.').''; $settings_connectors .= '
    '; - $settings_connectors .= '

    '.t("Repair OStatus subscriptions").'

    '; + $settings_connectors .= '

    '.t("Repair OStatus subscriptions").'

    '; $settings_connectors .= '
    '; @@ -1005,7 +1005,7 @@ function settings_content(App $a) { '$ptitle' => t('Display Settings'), '$form_security_token' => get_form_security_token("settings_display"), '$submit' => t('Save Settings'), - '$baseurl' => App::get_baseurl(true), + '$baseurl' => System::baseUrl(true), '$uid' => local_user(), '$theme' => array('theme', t('Display Theme:'), $theme_selected, '', $themes, true), @@ -1223,7 +1223,7 @@ function settings_content(App $a) { $tpl_addr = get_markup_template("settings_nick_set.tpl"); $prof_addr = replace_macros($tpl_addr,array( - '$desc' => sprintf(t("Your Identity Address is '%s' or '%s'."), $nickname.'@'.$a->get_hostname().$a->get_path(), App::get_baseurl().'/profile/'.$nickname), + '$desc' => sprintf(t("Your Identity Address is '%s' or '%s'."), $nickname.'@'.$a->get_hostname().$a->get_path(), System::baseUrl().'/profile/'.$nickname), '$basepath' => $a->get_hostname() )); @@ -1271,7 +1271,7 @@ function settings_content(App $a) { '$ptitle' => t('Account Settings'), '$submit' => t('Save Settings'), - '$baseurl' => App::get_baseurl(true), + '$baseurl' => System::baseUrl(true), '$uid' => local_user(), '$form_security_token' => get_form_security_token("settings"), '$nickname_block' => $prof_addr, diff --git a/mod/starred.php b/mod/starred.php index b0cb5bd1d6..f8e845bc6e 100644 --- a/mod/starred.php +++ b/mod/starred.php @@ -49,7 +49,7 @@ function starred_init(App $a) { $rand = "?$rand"; } - goaway(App::get_baseurl() . "/" . $return_path . $rand); + goaway(System::baseUrl() . "/" . $return_path . $rand); } // the json doesn't really matter, it will either be 0 or 1 diff --git a/mod/subthread.php b/mod/subthread.php index 9568dab41a..d4b861baab 100644 --- a/mod/subthread.php +++ b/mod/subthread.php @@ -89,7 +89,7 @@ function subthread_content(App $a) { $post_type = (($item['resource-id']) ? t('photo') : t('status')); $objtype = (($item['resource-id']) ? ACTIVITY_OBJ_IMAGE : ACTIVITY_OBJ_NOTE ); - $link = xmlify('' . "\n") ; + $link = xmlify('' . "\n") ; $body = $item['body']; $obj = <<< EOT @@ -131,7 +131,7 @@ EOT; $ulink = '[url=' . $contact['url'] . ']' . $contact['name'] . '[/url]'; $alink = '[url=' . $item['author-link'] . ']' . $item['author-name'] . '[/url]'; - $plink = '[url=' . App::get_baseurl() . '/display/' . $owner['nickname'] . '/' . $item['id'] . ']' . $post_type . '[/url]'; + $plink = '[url=' . System::baseUrl() . '/display/' . $owner['nickname'] . '/' . $item['id'] . ']' . $post_type . '[/url]'; $arr['body'] = sprintf( $bodyverb, $ulink, $alink, $plink ); $arr['verb'] = $activity; diff --git a/mod/suggest.php b/mod/suggest.php index 1f6fec186f..19e89f05ba 100644 --- a/mod/suggest.php +++ b/mod/suggest.php @@ -62,7 +62,7 @@ function suggest_content(App $a) { return; } - $_SESSION['return_url'] = App::get_baseurl() . '/' . $a->cmd; + $_SESSION['return_url'] = System::baseUrl() . '/' . $a->cmd; $a->page['aside'] .= findpeople_widget(); $a->page['aside'] .= follow_widget(); @@ -79,8 +79,8 @@ function suggest_content(App $a) { foreach ($r as $rr) { - $connlnk = App::get_baseurl() . '/follow/?url=' . (($rr['connect']) ? $rr['connect'] : $rr['url']); - $ignlnk = App::get_baseurl() . '/suggest?ignore=' . $rr['id']; + $connlnk = System::baseUrl() . '/follow/?url=' . (($rr['connect']) ? $rr['connect'] : $rr['url']); + $ignlnk = System::baseUrl() . '/suggest?ignore=' . $rr['id']; $photo_menu = array( 'profile' => array(t("View Profile"), zrl($rr["url"])), 'follow' => array(t("Connect/Follow"), $connlnk), diff --git a/mod/tagger.php b/mod/tagger.php index 3ca067e459..ea15b3f403 100644 --- a/mod/tagger.php +++ b/mod/tagger.php @@ -65,7 +65,7 @@ function tagger_content(App $a) { $targettype = (($item['resource-id']) ? ACTIVITY_OBJ_IMAGE : ACTIVITY_OBJ_NOTE ); $link = xmlify('' . "\n") ; + . System::baseUrl() . '/display/' . $owner['nickname'] . '/' . $item['id'] . '" />' . "\n") ; $body = xmlify($item['body']); @@ -80,7 +80,7 @@ function tagger_content(App $a) { EOT; - $tagid = App::get_baseurl() . '/search?tag=' . $term; + $tagid = System::baseUrl() . '/search?tag=' . $term; $objtype = ACTIVITY_OBJ_TAGTERM; $obj = <<< EOT @@ -100,7 +100,7 @@ EOT; return; } - $termlink = html_entity_decode('⌗') . '[url=' . App::get_baseurl() . '/search?tag=' . urlencode($term) . ']'. $term . '[/url]'; + $termlink = html_entity_decode('⌗') . '[url=' . System::baseUrl() . '/search?tag=' . urlencode($term) . ']'. $term . '[/url]'; $arr = array(); @@ -143,7 +143,7 @@ EOT; $post_id = item_store($arr); // q("UPDATE `item` set plink = '%s' where id = %d", -// dbesc(App::get_baseurl() . '/display/' . $owner_nick . '/' . $post_id), +// dbesc(System::baseUrl() . '/display/' . $owner_nick . '/' . $post_id), // intval($post_id) // ); @@ -162,7 +162,7 @@ EOT; ); if((! $blocktags) && $t[0]['tcount']==0 ) { /*q("update item set tag = '%s' where id = %d", - dbesc($item['tag'] . (strlen($item['tag']) ? ',' : '') . '#[url=' . App::get_baseurl() . '/search?tag=' . $term . ']'. $term . '[/url]'), + dbesc($item['tag'] . (strlen($item['tag']) ? ',' : '') . '#[url=' . System::baseUrl() . '/search?tag=' . $term . ']'. $term . '[/url]'), intval($item['id']) );*/ @@ -171,7 +171,7 @@ EOT; $term_objtype, TERM_HASHTAG, dbesc($term), - dbesc(App::get_baseurl() . '/search?tag=' . $term), + dbesc(System::baseUrl() . '/search?tag=' . $term), intval($owner_uid) ); } @@ -195,14 +195,14 @@ EOT; $term_objtype, TERM_HASHTAG, dbesc($term), - dbesc(App::get_baseurl() . '/search?tag=' . $term), + dbesc(System::baseUrl() . '/search?tag=' . $term), intval($owner_uid) ); } /*if(count($x) && !$x[0]['blocktags'] && (! stristr($r[0]['tag'], ']' . $term . '['))) { q("update item set tag = '%s' where id = %d", - dbesc($r[0]['tag'] . (strlen($r[0]['tag']) ? ',' : '') . '#[url=' . App::get_baseurl() . '/search?tag=' . $term . ']'. $term . '[/url]'), + dbesc($r[0]['tag'] . (strlen($r[0]['tag']) ? ',' : '') . '#[url=' . System::baseUrl() . '/search?tag=' . $term . ']'. $term . '[/url]'), intval($r[0]['id']) ); }*/ diff --git a/mod/tagrm.php b/mod/tagrm.php index f767902d90..a952b613b1 100644 --- a/mod/tagrm.php +++ b/mod/tagrm.php @@ -8,11 +8,11 @@ require_once('include/bbcode.php'); function tagrm_post(App $a) { if (! local_user()) { - goaway(App::get_baseurl() . '/' . $_SESSION['photo_return']); + goaway(System::baseUrl() . '/' . $_SESSION['photo_return']); } if ((x($_POST,'submit')) && ($_POST['submit'] === t('Cancel'))) { - goaway(App::get_baseurl() . '/' . $_SESSION['photo_return']); + goaway(System::baseUrl() . '/' . $_SESSION['photo_return']); } $tag = ((x($_POST,'tag')) ? hex2bin(notags(trim($_POST['tag']))) : ''); @@ -24,7 +24,7 @@ function tagrm_post(App $a) { ); if (! dbm::is_result($r)) { - goaway(App::get_baseurl() . '/' . $_SESSION['photo_return']); + goaway(System::baseUrl() . '/' . $_SESSION['photo_return']); } $arr = explode(',', $r[0]['tag']); @@ -44,7 +44,7 @@ function tagrm_post(App $a) { ); info( t('Tag removed') . EOL ); - goaway(App::get_baseurl() . '/' . $_SESSION['photo_return']); + goaway(System::baseUrl() . '/' . $_SESSION['photo_return']); // NOTREACHED @@ -57,13 +57,13 @@ function tagrm_content(App $a) { $o = ''; if (! local_user()) { - goaway(App::get_baseurl() . '/' . $_SESSION['photo_return']); + goaway(System::baseUrl() . '/' . $_SESSION['photo_return']); // NOTREACHED } $item = (($a->argc > 1) ? intval($a->argv[1]) : 0); if (! $item) { - goaway(App::get_baseurl() . '/' . $_SESSION['photo_return']); + goaway(System::baseUrl() . '/' . $_SESSION['photo_return']); // NOTREACHED } @@ -73,13 +73,13 @@ function tagrm_content(App $a) { ); if (! dbm::is_result($r)) { - goaway(App::get_baseurl() . '/' . $_SESSION['photo_return']); + goaway(System::baseUrl() . '/' . $_SESSION['photo_return']); } $arr = explode(',', $r[0]['tag']); if (! count($arr)) { - goaway(App::get_baseurl() . '/' . $_SESSION['photo_return']); + goaway(System::baseUrl() . '/' . $_SESSION['photo_return']); } $o .= '

    ' . t('Remove Item Tag') . '

    '; diff --git a/mod/toggle_mobile.php b/mod/toggle_mobile.php index caa02b1e4b..2449de4aa2 100644 --- a/mod/toggle_mobile.php +++ b/mod/toggle_mobile.php @@ -14,7 +14,7 @@ function toggle_mobile_init(App $a) { if (isset($_GET['address'])) { $address = $_GET['address']; } else { - $address = App::get_baseurl(); + $address = System::baseUrl(); } goaway($address); diff --git a/mod/uexport.php b/mod/uexport.php index d00cb14ecd..e0b9be91f3 100644 --- a/mod/uexport.php +++ b/mod/uexport.php @@ -43,7 +43,7 @@ function uexport_content(App $a) { $tpl = get_markup_template("uexport.tpl"); return replace_macros($tpl, array( - '$baseurl' => App::get_baseurl(), + '$baseurl' => System::baseUrl(), '$title' => t('Export personal data'), '$options' => $options )); @@ -114,7 +114,7 @@ function uexport_account($a) { $output = array( 'version' => FRIENDICA_VERSION, 'schema' => DB_UPDATE_VERSION, - 'baseurl' => App::get_baseurl(), + 'baseurl' => System::baseUrl(), 'user' => $user, 'contact' => $contact, 'profile' => $profile, diff --git a/mod/videos.php b/mod/videos.php index d340cad61b..09b44151d8 100644 --- a/mod/videos.php +++ b/mod/videos.php @@ -62,7 +62,7 @@ function videos_init(App $a) { if($albums_visible) { $o .= ''; @@ -90,12 +90,12 @@ function videos_init(App $a) { $tpl = get_markup_template("videos_head.tpl"); $a->page['htmlhead'] .= replace_macros($tpl,array( - '$baseurl' => App::get_baseurl(), + '$baseurl' => System::baseUrl(), )); $tpl = get_markup_template("videos_end.tpl"); $a->page['end'] .= replace_macros($tpl,array( - '$baseurl' => App::get_baseurl(), + '$baseurl' => System::baseUrl(), )); } @@ -110,7 +110,7 @@ function videos_post(App $a) { $owner_uid = $a->data['user']['uid']; if (local_user() != $owner_uid) { - goaway(App::get_baseurl() . '/videos/' . $a->data['user']['nickname']); + goaway(System::baseUrl() . '/videos/' . $a->data['user']['nickname']); } if (($a->argc == 2) && x($_POST,'delete') && x($_POST, 'id')) { @@ -118,7 +118,7 @@ function videos_post(App $a) { // Check if we should do HTML-based delete confirmation if (!x($_REQUEST,'confirm')) { if (x($_REQUEST,'canceled')) { - goaway(App::get_baseurl() . '/videos/' . $a->data['user']['nickname']); + goaway(System::baseUrl() . '/videos/' . $a->data['user']['nickname']); } $drop_url = $a->query_string; @@ -166,7 +166,7 @@ function videos_post(App $a) { create_tags_from_itemuri($i[0]['uri'], local_user()); delete_thread_uri($i[0]['uri'], local_user()); - $url = App::get_baseurl(); + $url = System::baseUrl(); $drop_id = intval($i[0]['id']); if ($i[0]['visible']) { @@ -175,11 +175,11 @@ function videos_post(App $a) { } } - goaway(App::get_baseurl() . '/videos/' . $a->data['user']['nickname']); + goaway(System::baseUrl() . '/videos/' . $a->data['user']['nickname']); return; // NOTREACHED } - goaway(App::get_baseurl() . '/videos/' . $a->data['user']['nickname']); + goaway(System::baseUrl() . '/videos/' . $a->data['user']['nickname']); } @@ -385,13 +385,13 @@ function videos_content(App $a) { $videos[] = array( 'id' => $rr['id'], - 'link' => App::get_baseurl() . '/videos/' . $a->data['user']['nickname'] . '/video/' . $rr['resource-id'], + 'link' => System::baseUrl() . '/videos/' . $a->data['user']['nickname'] . '/video/' . $rr['resource-id'], 'title' => t('View Video'), - 'src' => App::get_baseurl() . '/attach/' . $rr['id'] . '?attachment=0', + 'src' => System::baseUrl() . '/attach/' . $rr['id'] . '?attachment=0', 'alt' => $alt_e, 'mime' => $rr['filetype'], 'album' => array( - 'link' => App::get_baseurl() . '/videos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($rr['album']), + 'link' => System::baseUrl() . '/videos/' . $a->data['user']['nickname'] . '/album/' . bin2hex($rr['album']), 'name' => $name_e, 'alt' => t('View Album'), ), @@ -404,9 +404,9 @@ function videos_content(App $a) { $o .= replace_macros($tpl, array( '$title' => t('Recent Videos'), '$can_post' => $can_post, - '$upload' => array(t('Upload New Videos'), App::get_baseurl().'/videos/'.$a->data['user']['nickname'].'/upload'), + '$upload' => array(t('Upload New Videos'), System::baseUrl().'/videos/'.$a->data['user']['nickname'].'/upload'), '$videos' => $videos, - '$delete_url' => (($can_post)?App::get_baseurl().'/videos/'.$a->data['user']['nickname']:False) + '$delete_url' => (($can_post)?System::baseUrl().'/videos/'.$a->data['user']['nickname']:False) )); diff --git a/mod/wall_upload.php b/mod/wall_upload.php index 36d4db53d9..164ca470c3 100644 --- a/mod/wall_upload.php +++ b/mod/wall_upload.php @@ -302,9 +302,9 @@ function wall_upload_post(App $a, $desktopmode = true) { $picture["width"] = $r[0]["width"]; $picture["height"] = $r[0]["height"]; $picture["type"] = $r[0]["type"]; - $picture["albumpage"] = App::get_baseurl() . '/photos/' . $page_owner_nick . '/image/' . $hash; - $picture["picture"] = App::get_baseurl() . "/photo/{$hash}-0." . $ph->getExt(); - $picture["preview"] = App::get_baseurl() . "/photo/{$hash}-{$smallest}." . $ph->getExt(); + $picture["albumpage"] = System::baseUrl() . '/photos/' . $page_owner_nick . '/image/' . $hash; + $picture["picture"] = System::baseUrl() . "/photo/{$hash}-0." . $ph->getExt(); + $picture["preview"] = System::baseUrl() . "/photo/{$hash}-{$smallest}." . $ph->getExt(); if ($r_json) { echo json_encode(array('picture'=>$picture)); @@ -322,9 +322,9 @@ function wall_upload_post(App $a, $desktopmode = true) { /* mod Waitman Gobble NO WARRANTY */ // if we get the signal then return the image url info in BBCODE if ($_REQUEST['hush']!='yeah') { - echo "\n\n" . '[url=' . App::get_baseurl() . '/photos/' . $page_owner_nick . '/image/' . $hash . '][img]' . App::get_baseurl() . "/photo/{$hash}-{$smallest}.".$ph->getExt()."[/img][/url]\n\n"; + echo "\n\n" . '[url=' . System::baseUrl() . '/photos/' . $page_owner_nick . '/image/' . $hash . '][img]' . System::baseUrl() . "/photo/{$hash}-{$smallest}.".$ph->getExt()."[/img][/url]\n\n"; } else { - $m = '[url='.App::get_baseurl().'/photos/'.$page_owner_nick.'/image/'.$hash.'][img]'.App::get_baseurl()."/photo/{$hash}-{$smallest}.".$ph->getExt()."[/img][/url]"; + $m = '[url='.System::baseUrl().'/photos/'.$page_owner_nick.'/image/'.$hash.'][img]'.System::baseUrl()."/photo/{$hash}-{$smallest}.".$ph->getExt()."[/img][/url]"; return($m); } /* mod Waitman Gobble NO WARRANTY */ diff --git a/mod/xrd.php b/mod/xrd.php index 78e3fbc963..97ee0016e4 100644 --- a/mod/xrd.php +++ b/mod/xrd.php @@ -37,14 +37,14 @@ function xrd_init(App $a) { $tpl = get_markup_template('xrd_diaspora.tpl'); $dspr = replace_macros($tpl,array( - '$baseurl' => App::get_baseurl(), + '$baseurl' => System::baseUrl(), '$dspr_guid' => $r['guid'], '$dspr_key' => base64_encode(pemtorsa($r['pubkey'])) )); $tpl = get_markup_template('xrd_person.tpl'); - $profile_url = App::get_baseurl().'/profile/'.$r['nickname']; + $profile_url = System::baseUrl().'/profile/'.$r['nickname']; if ($acct) { $alias = $profile_url; @@ -62,15 +62,15 @@ function xrd_init(App $a) { '$accturi' => $uri, '$alias' => $alias, '$profile_url' => $profile_url, - '$hcard_url' => App::get_baseurl() . '/hcard/' . $r['nickname'], - '$atom' => App::get_baseurl() . '/dfrn_poll/' . $r['nickname'], - '$zot_post' => App::get_baseurl() . '/post/' . $r['nickname'], - '$poco_url' => App::get_baseurl() . '/poco/' . $r['nickname'], - '$photo' => App::get_baseurl() . '/photo/profile/' . $r['uid'] . '.jpg', + '$hcard_url' => System::baseUrl() . '/hcard/' . $r['nickname'], + '$atom' => System::baseUrl() . '/dfrn_poll/' . $r['nickname'], + '$zot_post' => System::baseUrl() . '/post/' . $r['nickname'], + '$poco_url' => System::baseUrl() . '/poco/' . $r['nickname'], + '$photo' => System::baseUrl() . '/photo/profile/' . $r['uid'] . '.jpg', '$dspr' => $dspr, - '$salmon' => App::get_baseurl() . '/salmon/' . $r['nickname'], - '$salmen' => App::get_baseurl() . '/salmon/' . $r['nickname'] . '/mention', - '$subscribe' => App::get_baseurl() . '/follow?url={uri}', + '$salmon' => System::baseUrl() . '/salmon/' . $r['nickname'], + '$salmen' => System::baseUrl() . '/salmon/' . $r['nickname'] . '/mention', + '$subscribe' => System::baseUrl() . '/follow?url={uri}', '$modexp' => 'data:application/magic-public-key,' . $salmon_key, '$bigkey' => salmon_key($r['pubkey']), )); diff --git a/src/App.php b/src/App.php index 4b65afd797..a5c6f34227 100644 --- a/src/App.php +++ b/src/App.php @@ -370,11 +370,6 @@ class App { * @return string Friendica server base URL */ function get_baseurl($ssl = false) { - // Is the function called statically? - if (!(isset($this) && get_class($this) == __CLASS__)) { - return self::$a->get_baseurl($ssl); - } - $scheme = $this->scheme; if (Config::get('system', 'ssl_policy') == SSL_POLICY_FULL) { @@ -521,7 +516,7 @@ class App { $tpl = get_markup_template('head.tpl'); $this->page['htmlhead'] = replace_macros($tpl, array( - '$baseurl' => $this->get_baseurl(), // FIXME for z_path!!!! + '$baseurl' => $this->get_baseurl(), '$local_user' => local_user(), '$generator' => 'Friendica' . ' ' . FRIENDICA_VERSION, '$delitem' => t('Delete this item?'), @@ -541,7 +536,7 @@ class App { } $tpl = get_markup_template('end.tpl'); $this->page['end'] = replace_macros($tpl, array( - '$baseurl' => $this->get_baseurl() // FIXME for z_path!!!! + '$baseurl' => $this->get_baseurl() )) . $this->page['end']; } @@ -582,11 +577,6 @@ class App { */ function remove_baseurl($orig_url) { - // Is the function called statically? - if (!(isset($this) && get_class($this) == __CLASS__)) { - return self::$a->remove_baseurl($orig_url); - } - // Remove the hostname from the url if it is an internal link $nurl = normalise_link($orig_url); $base = normalise_link($this->get_baseurl()); diff --git a/src/Core/System.php b/src/Core/System.php index 152546a617..c64739a427 100644 --- a/src/Core/System.php +++ b/src/Core/System.php @@ -1,8 +1,6 @@ "> <?php if(x($page,'title')) echo $page['title'] ?> - + diff --git a/view/php/minimal.php b/view/php/minimal.php index 9831ca5e55..0b1a4b8b77 100644 --- a/view/php/minimal.php +++ b/view/php/minimal.php @@ -2,7 +2,7 @@ <?php if(x($page,'title')) echo $page['title'] ?> - + diff --git a/view/theme/duepuntozero/config.php b/view/theme/duepuntozero/config.php index c2bb1a0706..5570347490 100644 --- a/view/theme/duepuntozero/config.php +++ b/view/theme/duepuntozero/config.php @@ -63,7 +63,7 @@ function clean_form(App $a, &$colorset, $user) { /// @TODO No need for adding string here, $o is not defined $o .= replace_macros($t, array( '$submit' => t('Submit'), - '$baseurl' => App::get_baseurl(), + '$baseurl' => System::baseUrl(), '$title' => t("Theme settings"), '$colorset' => array('duepuntozero_colorset', t('Variations'), $color, '', $colorset), )); diff --git a/view/theme/frio/config.php b/view/theme/frio/config.php index eaa2585ad9..6e5aca1bad 100644 --- a/view/theme/frio/config.php +++ b/view/theme/frio/config.php @@ -66,7 +66,7 @@ function frio_form($arr) { $t = get_markup_template('theme_settings.tpl'); $o .= replace_macros($t, array( '$submit' => t('Submit'), - '$baseurl' => App::get_baseurl(), + '$baseurl' => System::baseUrl(), '$title' => t("Theme settings"), '$schema' => array('frio_schema', t("Select scheme"), $arr["schema"], '', $scheme_choices), '$nav_bg' => array_key_exists("nav_bg", $disable) ? "" : array('frio_nav_bg', t('Navigation bar background color'), $arr['nav_bg']), diff --git a/view/theme/frio/php/default.php b/view/theme/frio/php/default.php index 6d2e786564..f07ffaecba 100644 --- a/view/theme/frio/php/default.php +++ b/view/theme/frio/php/default.php @@ -17,9 +17,9 @@ <?php if(x($page,'title')) echo $page['title'] ?> - + - + - + - + diff --git a/view/theme/frio/theme.php b/view/theme/frio/theme.php index c926d210df..5104c44b60 100644 --- a/view/theme/frio/theme.php +++ b/view/theme/frio/theme.php @@ -21,7 +21,7 @@ function frio_init(App $a) { set_template_engine($a, 'smarty3'); - $baseurl = App::get_baseurl(); + $baseurl = System::baseUrl(); $style = get_pconfig(local_user(), 'frio', 'style'); diff --git a/view/theme/frost-mobile/php/default.php b/view/theme/frost-mobile/php/default.php index 9d920c2f62..72135fd7ae 100644 --- a/view/theme/frost-mobile/php/default.php +++ b/view/theme/frost-mobile/php/default.php @@ -2,7 +2,7 @@ <?php if(x($page,'title')) echo $page['title'] ?> - + module === 'home') echo 'onLoad="setTimeout(\'homeRedirect()\', 1500)"'?>> diff --git a/view/theme/frost-mobile/theme.php b/view/theme/frost-mobile/theme.php index 934f50386a..2d104dc751 100644 --- a/view/theme/frost-mobile/theme.php +++ b/view/theme/frost-mobile/theme.php @@ -26,8 +26,8 @@ function frost_mobile_content_loaded(App $a) { // I could do this in style.php, but by having the CSS in a file the browser will cache it, // making pages load faster if ( $a->module === 'home' || $a->module === 'login' || $a->module === 'register' || $a->module === 'lostpass' ) { -// $a->page['htmlhead'] = str_replace('$stylesheet', App::get_baseurl() . '/view/theme/frost-mobile/login-style.css', $a->page['htmlhead']); - $a->theme['stylesheet'] = App::get_baseurl() . '/view/theme/frost-mobile/login-style.css'; +// $a->page['htmlhead'] = str_replace('$stylesheet', System::baseUrl() . '/view/theme/frost-mobile/login-style.css', $a->page['htmlhead']); + $a->theme['stylesheet'] = System::baseUrl() . '/view/theme/frost-mobile/login-style.css'; } if ( $a->module === 'login' ) { diff --git a/view/theme/frost/php/default.php b/view/theme/frost/php/default.php index 65632ee071..e58fd2ca8b 100644 --- a/view/theme/frost/php/default.php +++ b/view/theme/frost/php/default.php @@ -2,7 +2,7 @@ <?php if(x($page,'title')) echo $page['title'] ?> - + module === 'home') echo 'onLoad="setTimeout(\'homeRedirect()\', 1500)"'?>> diff --git a/view/theme/frost/theme.php b/view/theme/frost/theme.php index a3f4e011dd..4c38b605d5 100644 --- a/view/theme/frost/theme.php +++ b/view/theme/frost/theme.php @@ -24,8 +24,8 @@ function frost_content_loaded(App $a) { // I could do this in style.php, but by having the CSS in a file the browser will cache it, // making pages load faster if( $a->module === 'home' || $a->module === 'login' || $a->module === 'register' || $a->module === 'lostpass' ) { - //$a->page['htmlhead'] = str_replace('$stylesheet', App::get_baseurl() . '/view/theme/frost/login-style.css', $a->page['htmlhead']); - $a->theme['stylesheet'] = App::get_baseurl() . '/view/theme/frost/login-style.css'; + //$a->page['htmlhead'] = str_replace('$stylesheet', System::baseUrl() . '/view/theme/frost/login-style.css', $a->page['htmlhead']); + $a->theme['stylesheet'] = System::baseUrl() . '/view/theme/frost/login-style.css'; } if ( $a->module === 'login' ) { diff --git a/view/theme/quattro/config.php b/view/theme/quattro/config.php index 9b3a65e3d2..4cd5a4a7d3 100644 --- a/view/theme/quattro/config.php +++ b/view/theme/quattro/config.php @@ -69,7 +69,7 @@ function quattro_form(App $a, $align, $color, $tfs, $pfs) { $t = get_markup_template("theme_settings.tpl" ); $o .= replace_macros($t, array( '$submit' => t('Submit'), - '$baseurl' => App::get_baseurl(), + '$baseurl' => System::baseUrl(), '$title' => t("Theme settings"), '$align' => array('quattro_align', t('Alignment'), $align, '', array('left'=>t('Left'), 'center'=>t('Center'))), '$color' => array('quattro_color', t('Color scheme'), $color, '', $colors), diff --git a/view/theme/quattro/theme.php b/view/theme/quattro/theme.php index 624e869043..ac172cee05 100644 --- a/view/theme/quattro/theme.php +++ b/view/theme/quattro/theme.php @@ -11,6 +11,6 @@ use Friendica\App; use Friendica\Core\System; function quattro_init(App $a) { - $a->page['htmlhead'] .= ''; - $a->page['htmlhead'] .= '';; + $a->page['htmlhead'] .= ''; + $a->page['htmlhead'] .= '';; } diff --git a/view/theme/smoothly/php/default.php b/view/theme/smoothly/php/default.php index 568f267c1c..1bbd32cc17 100644 --- a/view/theme/smoothly/php/default.php +++ b/view/theme/smoothly/php/default.php @@ -2,7 +2,7 @@ <?php if(x($page,'title')) echo $page['title'] ?> - +