From 9774c95b807eeae0a9f70ce6c75f3f20a5147673 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sat, 27 Apr 2019 22:18:30 -0400 Subject: [PATCH] Remove duplicate $baseurl template variable - Remove unused $overwriteURL parameter in Renderer::replaceMacros --- mod/cal.php | 2 -- mod/editpost.php | 3 --- mod/events.php | 2 -- mod/fbrowser.php | 2 -- mod/lostpass.php | 1 - mod/opensearch.php | 2 -- mod/photos.php | 1 - mod/poke.php | 4 ---- mod/toggle_mobile.php | 1 - mod/uexport.php | 1 - mod/videos.php | 4 +--- src/App.php | 4 ---- src/Content/Nav.php | 1 - src/Content/OEmbed.php | 1 - src/Core/Renderer.php | 16 +++++++--------- src/Model/Item.php | 4 +--- src/Model/Profile.php | 2 -- src/Module/Admin/Addons/Index.php | 5 ++--- src/Module/Admin/Blocklist/Contact.php | 5 ++--- src/Module/Admin/Blocklist/Server.php | 7 ++++--- src/Module/Admin/DBSync.php | 8 +++----- src/Module/Admin/Federation.php | 2 -- src/Module/Admin/Item/Delete.php | 2 -- src/Module/Admin/Logs/Settings.php | 5 +++-- src/Module/Admin/Site.php | 7 +++---- src/Module/Admin/Summary.php | 4 +--- src/Module/Admin/Themes/Details.php | 4 +--- src/Module/Admin/Themes/Embed.php | 2 -- src/Module/Admin/Themes/Index.php | 6 ++---- src/Module/Admin/Users.php | 3 +-- src/Module/Contact.php | 5 +---- src/Module/Install.php | 10 +++------- src/Module/Manifest.php | 1 - src/Module/Register.php | 1 - src/Module/Xrd.php | 1 - view/templates/admin/dbsync/failed_updates.tpl | 4 ++-- view/templates/admin/dbsync/structure_check.tpl | 2 +- view/theme/duepuntozero/config.php | 1 - view/theme/frio/config.php | 1 - view/theme/quattro/config.php | 1 - view/theme/vier/config.php | 1 - 41 files changed, 38 insertions(+), 101 deletions(-) diff --git a/mod/cal.php b/mod/cal.php index 5baffec8a..cba484344 100644 --- a/mod/cal.php +++ b/mod/cal.php @@ -90,7 +90,6 @@ function cal_content(App $a) $htpl = Renderer::getMarkupTemplate('event_head.tpl'); $a->page['htmlhead'] .= Renderer::replaceMacros($htpl, [ - '$baseurl' => System::baseUrl(), '$module_url' => '/cal/' . $a->data['user']['nickname'], '$modparams' => 2, '$i18n' => $i18n, @@ -268,7 +267,6 @@ function cal_content(App $a) } $o = Renderer::replaceMacros($tpl, [ - '$baseurl' => System::baseUrl(), '$tabs' => $tabs, '$title' => L10n::t('Events'), '$view' => L10n::t('View'), diff --git a/mod/editpost.php b/mod/editpost.php index c1c0d16d7..e14baffa2 100644 --- a/mod/editpost.php +++ b/mod/editpost.php @@ -8,7 +8,6 @@ use Friendica\Content\Feature; use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Renderer; -use Friendica\Core\System; use Friendica\Model\FileTag; use Friendica\Model\Item; use Friendica\Database\DBA; @@ -48,7 +47,6 @@ function editpost_content(App $a) $tpl = Renderer::getMarkupTemplate('jot-header.tpl'); $a->page['htmlhead'] .= Renderer::replaceMacros($tpl, [ - '$baseurl' => System::baseUrl(), '$ispublic' => ' ', // L10n::t('Visible to everybody'), '$geotag' => $geotag, '$nickname' => $a->user['nickname'] @@ -91,7 +89,6 @@ function editpost_content(App $a) '$posttype' => $item['post-type'], '$content' => undo_post_tagging($item['body']), '$post_id' => $post_id, - '$baseurl' => System::baseUrl(), '$defloc' => $a->user['default-location'], '$visitor' => 'none', '$pvisit' => 'none', diff --git a/mod/events.php b/mod/events.php index 008cf643c..6569653a0 100644 --- a/mod/events.php +++ b/mod/events.php @@ -237,7 +237,6 @@ function events_content(App $a) $htpl = Renderer::getMarkupTemplate('event_head.tpl'); $a->page['htmlhead'] .= Renderer::replaceMacros($htpl, [ - '$baseurl' => System::baseUrl(), '$module_url' => '/events', '$modparams' => 1, '$i18n' => $i18n, @@ -379,7 +378,6 @@ function events_content(App $a) } $o = Renderer::replaceMacros($tpl, [ - '$baseurl' => System::baseUrl(), '$tabs' => $tabs, '$title' => L10n::t('Events'), '$view' => L10n::t('View'), diff --git a/mod/fbrowser.php b/mod/fbrowser.php index faff17381..f2bccb085 100644 --- a/mod/fbrowser.php +++ b/mod/fbrowser.php @@ -104,7 +104,6 @@ function fbrowser_content(App $a) $o = Renderer::replaceMacros($tpl, [ '$type' => 'image', - '$baseurl' => System::baseUrl(), '$path' => $path, '$folders' => $albums, '$files' => $files, @@ -134,7 +133,6 @@ function fbrowser_content(App $a) $tpl = Renderer::getMarkupTemplate($template_file); $o = Renderer::replaceMacros($tpl, [ '$type' => 'file', - '$baseurl' => System::baseUrl(), '$path' => [ [ "", L10n::t("Files")] ], '$folders' => false, '$files' => $files, diff --git a/mod/lostpass.php b/mod/lostpass.php index 548cea185..01e84268b 100644 --- a/mod/lostpass.php +++ b/mod/lostpass.php @@ -139,7 +139,6 @@ function lostpass_generate_password($user) '$lbl5' => '' . L10n::t('click here to login') . '.', '$lbl6' => L10n::t('Your password may be changed from the Settings page after successful login.'), '$newpass' => $new_password, - '$baseurl' => System::baseUrl() ]); info("Your password has been reset." . EOL); diff --git a/mod/opensearch.php b/mod/opensearch.php index 2057f0b5d..0744157e5 100644 --- a/mod/opensearch.php +++ b/mod/opensearch.php @@ -2,7 +2,6 @@ use Friendica\App; use Friendica\Core\Renderer; -use Friendica\Core\System; function opensearch_content(App $a) { @@ -11,7 +10,6 @@ function opensearch_content(App $a) { header("Content-type: application/opensearchdescription+xml"); $o = Renderer::replaceMacros($tpl, [ - '$baseurl' => System::baseUrl(), '$nodename' => $a->getHostName(), ]); diff --git a/mod/photos.php b/mod/photos.php index 137e0adb5..a8160bd4c 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -115,7 +115,6 @@ function photos_init(App $a) { '$title' => L10n::t('Photo Albums'), '$recent' => L10n::t('Recent Photos'), '$albums' => $ret['albums'], - '$baseurl' => System::baseUrl(), '$upload' => [L10n::t('Upload New Photos'), 'photos/' . $a->data['user']['nickname'] . '/upload'], '$can_post' => $can_post ]); diff --git a/mod/poke.php b/mod/poke.php index b8a1ba7bf..e8ddf86cd 100644 --- a/mod/poke.php +++ b/mod/poke.php @@ -154,15 +154,11 @@ function poke_content(App $a) $name = $contact['name']; $id = $contact['id']; - $base = System::baseUrl(); - $head_tpl = Renderer::getMarkupTemplate('poke_head.tpl'); $a->page['htmlhead'] .= Renderer::replaceMacros($head_tpl,[ '$baseurl' => System::baseUrl(true), - '$base' => $base ]); - $parent = (!empty($_GET['parent']) ? intval($_GET['parent']) : '0'); diff --git a/mod/toggle_mobile.php b/mod/toggle_mobile.php index 2821e0a64..d1a26b3ca 100644 --- a/mod/toggle_mobile.php +++ b/mod/toggle_mobile.php @@ -1,7 +1,6 @@ System::baseUrl(), '$title' => L10n::t('Export personal data'), '$options' => $options ]); diff --git a/mod/videos.php b/mod/videos.php index 4120c136f..f45817c4e 100644 --- a/mod/videos.php +++ b/mod/videos.php @@ -67,9 +67,7 @@ function videos_init(App $a) $a->page['aside'] .= $vcard_widget; $tpl = Renderer::getMarkupTemplate("videos_head.tpl"); - $a->page['htmlhead'] .= Renderer::replaceMacros($tpl,[ - '$baseurl' => System::baseUrl(), - ]); + $a->page['htmlhead'] .= Renderer::replaceMacros($tpl); } return; diff --git a/src/App.php b/src/App.php index 9cde12499..70089a767 100644 --- a/src/App.php +++ b/src/App.php @@ -406,8 +406,6 @@ class App * @param bool $ssl Whether to append http or https under BaseURL::SSL_POLICY_SELFSIGN * * @return string Friendica server base URL - * - * @deprecated 2019.06 - use BaseURL->get($ssl) instead */ public function getBaseURL($ssl = false) { @@ -509,7 +507,6 @@ class App * being first */ $this->page['htmlhead'] = Core\Renderer::replaceMacros($tpl, [ - '$baseurl' => $this->getBaseURL(), '$local_user' => local_user(), '$generator' => 'Friendica' . ' ' . FRIENDICA_VERSION, '$delitem' => Core\L10n::t('Delete this item?'), @@ -562,7 +559,6 @@ class App $tpl = Core\Renderer::getMarkupTemplate('footer.tpl'); $this->page['footer'] = Core\Renderer::replaceMacros($tpl, [ - '$baseurl' => $this->getBaseURL(), '$footerScripts' => $this->footerScripts, ]) . $this->page['footer']; } diff --git a/src/Content/Nav.php b/src/Content/Nav.php index 1eae2a3e3..a63244e85 100644 --- a/src/Content/Nav.php +++ b/src/Content/Nav.php @@ -67,7 +67,6 @@ class Nav $tpl = Renderer::getMarkupTemplate('nav.tpl'); $nav .= Renderer::replaceMacros($tpl, [ - '$baseurl' => System::baseUrl(), '$sitelocation' => $nav_info['sitelocation'], '$nav' => $nav_info['nav'], '$banner' => $nav_info['banner'], diff --git a/src/Content/OEmbed.php b/src/Content/OEmbed.php index 0093ba11a..7190f1ce0 100644 --- a/src/Content/OEmbed.php +++ b/src/Content/OEmbed.php @@ -181,7 +181,6 @@ class OEmbed $tw = $th * $tr; $tpl = Renderer::getMarkupTemplate('oembed_video.tpl'); $ret .= Renderer::replaceMacros($tpl, [ - '$baseurl' => System::baseUrl(), '$embedurl' => $oembed->embed_url, '$escapedhtml' => base64_encode($oembed->html), '$tw' => $tw, diff --git a/src/Core/Renderer.php b/src/Core/Renderer.php index 72073086a..fd5e73302 100644 --- a/src/Core/Renderer.php +++ b/src/Core/Renderer.php @@ -52,22 +52,20 @@ class Renderer extends BaseObject /** * @brief This is our template processor * - * @param string|FriendicaSmarty $s The string requiring macro substitution or an instance of FriendicaSmarty - * @param array $vars key value pairs (search => replace) - * @param bool $overwriteURL Overwrite the base url with the system wide set base url + * @param string|FriendicaSmarty $s The string requiring macro substitution or an instance of FriendicaSmarty + * @param array $vars Key value pairs (search => replace) * * @return string substituted string - * @throws \Friendica\Network\HTTPException\InternalServerErrorException + * @throws Exception */ - public static function replaceMacros($s, $vars, $overwriteURL = true) + public static function replaceMacros($s, array $vars = []) { $stamp1 = microtime(true); $a = self::getApp(); - // pass $baseurl to all templates - if ($overwriteURL) { - $vars['$baseurl'] = System::baseUrl(); - } + // pass $baseurl to all templates if it isn't set + $vars = array_merge(['$baseurl' => $a->getBaseURL()], $vars); + $t = self::getTemplateEngine(); try { diff --git a/src/Model/Item.php b/src/Model/Item.php index c309da24e..d85ed414f 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -3466,9 +3466,7 @@ class Item extends BaseObject if (strpos($mime, 'video') !== false) { if (!$vhead) { $vhead = true; - $a->page['htmlhead'] .= Renderer::replaceMacros(Renderer::getMarkupTemplate('videos_head.tpl'), [ - '$baseurl' => System::baseUrl(), - ]); + $a->page['htmlhead'] .= Renderer::replaceMacros(Renderer::getMarkupTemplate('videos_head.tpl')); } $url_parts = explode('/', $the_url); diff --git a/src/Model/Profile.php b/src/Model/Profile.php index 79971cd99..fb87bc521 100644 --- a/src/Model/Profile.php +++ b/src/Model/Profile.php @@ -641,7 +641,6 @@ class Profile } $tpl = Renderer::getMarkupTemplate('birthdays_reminder.tpl'); return Renderer::replaceMacros($tpl, [ - '$baseurl' => System::baseUrl(), '$classtoday' => $classtoday, '$count' => $total, '$event_reminders' => L10n::t('Birthday Reminders'), @@ -730,7 +729,6 @@ class Profile } $tpl = Renderer::getMarkupTemplate('events_reminder.tpl'); return Renderer::replaceMacros($tpl, [ - '$baseurl' => System::baseUrl(), '$classtoday' => $classtoday, '$count' => count($r), '$event_reminders' => L10n::t('Event Reminders'), diff --git a/src/Module/Admin/Addons/Index.php b/src/Module/Admin/Addons/Index.php index 20d8ff196..6c8d48dc4 100644 --- a/src/Module/Admin/Addons/Index.php +++ b/src/Module/Admin/Addons/Index.php @@ -7,7 +7,6 @@ use Friendica\Core\Addon; use Friendica\Core\Config; use Friendica\Core\L10n; use Friendica\Core\Renderer; -use Friendica\Core\System; use Friendica\Database\DBA; use Friendica\Module\BaseAdminModule; @@ -61,7 +60,7 @@ class Index extends BaseAdminModule '$page' => L10n::t('Addons'), '$submit' => L10n::t('Save Settings'), '$reload' => L10n::t('Reload active addons'), - '$baseurl' => System::baseUrl(true), + '$baseurl' => $a->getBaseURL(true), '$function' => 'addons', '$addons' => $addons, '$pcount' => count($addons), @@ -69,4 +68,4 @@ class Index extends BaseAdminModule '$form_security_token' => parent::getFormSecurityToken('admin_addons'), ]); } -} \ No newline at end of file +} diff --git a/src/Module/Admin/Blocklist/Contact.php b/src/Module/Admin/Blocklist/Contact.php index 69aa0a473..bebcf444b 100644 --- a/src/Module/Admin/Blocklist/Contact.php +++ b/src/Module/Admin/Blocklist/Contact.php @@ -5,7 +5,6 @@ namespace Friendica\Module\Admin\Blocklist; use Friendica\Content\Pager; use Friendica\Core\L10n; use Friendica\Core\Renderer; -use Friendica\Core\System; use Friendica\Database\DBA; use Friendica\Module\BaseAdminModule; use Friendica\Model; @@ -77,7 +76,7 @@ class Contact extends BaseAdminModule '$form_security_token' => parent::getFormSecurityToken("admin_contactblock"), // values // - '$baseurl' => System::baseUrl(true), + '$baseurl' => $a->getBaseURL(true), '$contacts' => $contacts, '$total_contacts' => L10n::tt('%s total blocked contact', '%s total blocked contacts', $total), @@ -86,4 +85,4 @@ class Contact extends BaseAdminModule ]); return $o; } -} \ No newline at end of file +} diff --git a/src/Module/Admin/Blocklist/Server.php b/src/Module/Admin/Blocklist/Server.php index 1d0dc1fb8..2d5f97893 100644 --- a/src/Module/Admin/Blocklist/Server.php +++ b/src/Module/Admin/Blocklist/Server.php @@ -5,7 +5,6 @@ namespace Friendica\Module\Admin\Blocklist; use Friendica\Core\Config; use Friendica\Core\L10n; use Friendica\Core\Renderer; -use Friendica\Core\System; use Friendica\Module\BaseAdminModule; use Friendica\Util\Strings; @@ -55,6 +54,8 @@ class Server extends BaseAdminModule { parent::content(); + $a = self::getApp(); + $blocklist = Config::get('system', 'blocklist'); $blocklistform = []; if (is_array($blocklist)) { @@ -83,9 +84,9 @@ class Server extends BaseAdminModule '$threason' => L10n::t('Reason for the block'), '$delentry' => L10n::t('Delete entry from blocklist'), '$entries' => $blocklistform, - '$baseurl' => System::baseUrl(true), + '$baseurl' => $a->getBaseURL(true), '$confirm_delete' => L10n::t('Delete entry from blocklist?'), '$form_security_token' => parent::getFormSecurityToken("admin_blocklist") ]); } -} \ No newline at end of file +} diff --git a/src/Module/Admin/DBSync.php b/src/Module/Admin/DBSync.php index c62fefe4c..a9c2cb6db 100644 --- a/src/Module/Admin/DBSync.php +++ b/src/Module/Admin/DBSync.php @@ -5,12 +5,10 @@ namespace Friendica\Module\Admin; use Friendica\Core\Config; use Friendica\Core\L10n; use Friendica\Core\Renderer; -use Friendica\Core\System; use Friendica\Core\Update; use Friendica\Database\DBA; use Friendica\Database\DBStructure; use Friendica\Module\BaseAdminModule; -use Friendica\Util\Strings; class DBSync extends BaseAdminModule { @@ -88,13 +86,13 @@ class DBSync extends BaseAdminModule if (!count($failed)) { $o = Renderer::replaceMacros(Renderer::getMarkupTemplate('admin/dbsync/structure_check.tpl'), [ - '$base' => System::baseUrl(true), + '$base' => $a->getBaseURL(true), '$banner' => L10n::t('No failed updates.'), '$check' => L10n::t('Check database structure'), ]); } else { $o = Renderer::replaceMacros(Renderer::getMarkupTemplate('admin/dbsync/failed_updates.tpl'), [ - '$base' => System::baseUrl(true), + '$base' => $a->getBaseURL(true), '$banner' => L10n::t('Failed Updates'), '$desc' => L10n::t('This does not include updates prior to 1139, which did not return a status.'), '$mark' => L10n::t("Mark success \x28if update was manually applied\x29"), @@ -105,4 +103,4 @@ class DBSync extends BaseAdminModule return $o; } -} \ No newline at end of file +} diff --git a/src/Module/Admin/Federation.php b/src/Module/Admin/Federation.php index 7a1c09db6..ae7445d9e 100644 --- a/src/Module/Admin/Federation.php +++ b/src/Module/Admin/Federation.php @@ -5,7 +5,6 @@ namespace Friendica\Module\Admin; use Friendica\Core\Config; use Friendica\Core\L10n; use Friendica\Core\Renderer; -use Friendica\Core\System; use Friendica\Database\DBA; use Friendica\Module\BaseAdminModule; @@ -194,7 +193,6 @@ class Federation extends BaseAdminModule '$counts' => $counts, '$version' => FRIENDICA_VERSION, '$legendtext' => L10n::t('Currently this node is aware of %d nodes with %d registered users from the following platforms:', $total, $users), - '$baseurl' => System::baseUrl(), ]); } } diff --git a/src/Module/Admin/Item/Delete.php b/src/Module/Admin/Item/Delete.php index 94bab4eb3..9a9c9209b 100644 --- a/src/Module/Admin/Item/Delete.php +++ b/src/Module/Admin/Item/Delete.php @@ -4,7 +4,6 @@ namespace Friendica\Module\Admin\Item; use Friendica\Core\L10n; use Friendica\Core\Renderer; -use Friendica\Core\System; use Friendica\Model\Item; use Friendica\Module\BaseAdminModule; use Friendica\Util\Strings; @@ -50,7 +49,6 @@ class Delete extends BaseAdminModule '$intro1' => L10n::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' => L10n::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' => ['deleteitemguid', L10n::t("GUID"), '', L10n::t("The GUID of the item you want to delete."), 'required', 'autofocus'], - '$baseurl' => System::baseUrl(), '$form_security_token' => parent::getFormSecurityToken("admin_deleteitem") ]); } diff --git a/src/Module/Admin/Logs/Settings.php b/src/Module/Admin/Logs/Settings.php index 7a04fcbef..c42c5402c 100644 --- a/src/Module/Admin/Logs/Settings.php +++ b/src/Module/Admin/Logs/Settings.php @@ -5,7 +5,6 @@ namespace Friendica\Module\Admin\Logs; use Friendica\Core\Config; use Friendica\Core\L10n; use Friendica\Core\Renderer; -use Friendica\Core\System; use Friendica\Module\BaseAdminModule; use Friendica\Util\Strings; use Psr\Log\LogLevel; @@ -36,6 +35,8 @@ class Settings extends BaseAdminModule { parent::content(); + $a = self::getApp(); + $log_choices = [ LogLevel::ERROR => 'Error', LogLevel::WARNING => 'Warning', @@ -57,7 +58,7 @@ class Settings extends BaseAdminModule '$page' => L10n::t('Logs'), '$submit' => L10n::t('Save Settings'), '$clear' => L10n::t('Clear'), - '$baseurl' => System::baseUrl(true), + '$baseurl' => $a->getBaseURL(true), '$logname' => Config::get('system', 'logfile'), // see /help/smarty3-templates#1_1 on any Friendica node '$debugging' => ['debugging', L10n::t("Enable Debugging"), Config::get('system', 'debugging'), ""], diff --git a/src/Module/Admin/Site.php b/src/Module/Admin/Site.php index 1bafa9ab3..05ca16a16 100644 --- a/src/Module/Admin/Site.php +++ b/src/Module/Admin/Site.php @@ -7,7 +7,6 @@ use Friendica\Core\Config; use Friendica\Core\L10n; use Friendica\Core\Renderer; use Friendica\Core\StorageManager; -use Friendica\Core\System; use Friendica\Core\Theme; use Friendica\Core\Worker; use Friendica\Database\DBA; @@ -578,7 +577,7 @@ class Site extends BaseAdminModule '$relay_title' => L10n::t('Message Relay'), '$relocate' => L10n::t('Relocate Instance'), '$relocate_warning' => L10n::t('Warning! Advanced function. Could make this server unreachable.'), - '$baseurl' => System::baseUrl(true), + '$baseurl' => $a->getBaseURL(true), // name, label, value, help string, extra data... '$sitename' => ['sitename', L10n::t('Site name'), Config::get('config', 'sitename'), ''], @@ -662,14 +661,14 @@ class Site extends BaseAdminModule '$proxy_disabled' => ['proxy_disabled', L10n::t('Disable picture proxy'), Config::get('system', 'proxy_disabled'), L10n::t('The picture proxy increases performance and privacy. It shouldn\'t be used on systems with very low bandwidth.')], '$only_tag_search' => ['only_tag_search', L10n::t('Only search in tags'), Config::get('system', 'only_tag_search'), L10n::t('On large systems the text search can slow down the system extremely.')], - '$relocate_url' => ['relocate_url', L10n::t('New base url'), System::baseUrl(), L10n::t('Change base url for this server. Sends relocate message to all Friendica and Diaspora* contacts of all users.')], + '$relocate_url' => ['relocate_url', L10n::t('New base url'), $a->getBaseURL(), L10n::t('Change base url for this server. Sends relocate message to all Friendica and Diaspora* contacts of all users.')], '$rino' => ['rino', L10n::t('RINO Encryption'), intval(Config::get('system', 'rino_encrypt')), L10n::t('Encryption layer between nodes.'), [0 => L10n::t('Disabled'), 1 => L10n::t('Enabled')]], '$worker_queues' => ['worker_queues', L10n::t('Maximum number of parallel workers'), Config::get('system', 'worker_queues'), L10n::t('On shared hosters set this to %d. On larger systems, values of %d are great. Default value is %d.', 5, 20, 10)], '$worker_dont_fork' => ['worker_dont_fork', L10n::t('Don\'t use "proc_open" with the worker'), Config::get('system', 'worker_dont_fork'), L10n::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 worker calls in your crontab.')], '$worker_fastlane' => ['worker_fastlane', L10n::t('Enable fastlane'), Config::get('system', 'worker_fastlane'), L10n::t('When enabed, the fastlane mechanism starts an additional worker if processes with higher priority are blocked by processes of lower priority.')], - '$worker_frontend' => ['worker_frontend', L10n::t('Enable frontend worker'), Config::get('system', 'frontend_worker'), L10n::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())], + '$worker_frontend' => ['worker_frontend', L10n::t('Enable frontend worker'), Config::get('system', 'frontend_worker'), L10n::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.', $a->getBaseURL())], '$relay_subscribe' => ['relay_subscribe', L10n::t('Subscribe to relay'), Config::get('system', 'relay_subscribe'), L10n::t('Enables the receiving of public posts from the relay. They will be included in the search, subscribed tags and on the global community page.')], '$relay_server' => ['relay_server', L10n::t('Relay server'), Config::get('system', 'relay_server', 'https://relay.diasp.org'), L10n::t('Address of the relay server where public posts should be send to. For example https://relay.diasp.org')], diff --git a/src/Module/Admin/Summary.php b/src/Module/Admin/Summary.php index 49ad59cdf..8529c7142 100644 --- a/src/Module/Admin/Summary.php +++ b/src/Module/Admin/Summary.php @@ -7,7 +7,6 @@ use Friendica\Core\Config; use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\Renderer; -use Friendica\Core\System; use Friendica\Core\Update; use Friendica\Database\DBA; use Friendica\Database\DBStructure; @@ -130,7 +129,6 @@ class Summary extends BaseAdminModule '$accounts' => $accounts, '$pending' => [L10n::t('Pending registrations'), $pending], '$version' => [L10n::t('Version'), FRIENDICA_VERSION], - '$baseurl' => System::baseUrl(), '$platform' => FRIENDICA_PLATFORM, '$codename' => FRIENDICA_CODENAME, '$build' => Config::get('system', 'build'), @@ -143,7 +141,7 @@ class Summary extends BaseAdminModule private static function checkSelfHostMeta() { // Fetch the host-meta to check if this really is a vital server - return Network::curl(System::baseUrl() . '/.well-known/host-meta')->isSuccess(); + return Network::curl(self::getApp()->getBaseURL() . '/.well-known/host-meta')->isSuccess(); } } \ No newline at end of file diff --git a/src/Module/Admin/Themes/Details.php b/src/Module/Admin/Themes/Details.php index 540083bb2..d8a2d2139 100644 --- a/src/Module/Admin/Themes/Details.php +++ b/src/Module/Admin/Themes/Details.php @@ -3,10 +3,8 @@ namespace Friendica\Module\Admin\Themes; use Friendica\Content\Text\Markdown; -use Friendica\Core\Config; use Friendica\Core\L10n; use Friendica\Core\Renderer; -use Friendica\Core\System; use Friendica\Core\Theme; use Friendica\Module\BaseAdminModule; use Friendica\Util\Strings; @@ -107,7 +105,7 @@ class Details extends BaseAdminModule '$page' => L10n::t('Themes'), '$toggle' => L10n::t('Toggle'), '$settings' => L10n::t('Settings'), - '$baseurl' => System::baseUrl(true), + '$baseurl' => $a->getBaseURL(true), '$addon' => $theme, '$status' => $status, '$action' => $action, diff --git a/src/Module/Admin/Themes/Embed.php b/src/Module/Admin/Themes/Embed.php index 0a309e23c..4ca2a4e7a 100644 --- a/src/Module/Admin/Themes/Embed.php +++ b/src/Module/Admin/Themes/Embed.php @@ -4,8 +4,6 @@ namespace Friendica\Module\Admin\Themes; use Friendica\Core\L10n; use Friendica\Core\Renderer; -use Friendica\Core\System; -use Friendica\Core\Theme; use Friendica\Module\BaseAdminModule; use Friendica\Util\Strings; diff --git a/src/Module/Admin/Themes/Index.php b/src/Module/Admin/Themes/Index.php index 2b89c4e20..62c775bf0 100644 --- a/src/Module/Admin/Themes/Index.php +++ b/src/Module/Admin/Themes/Index.php @@ -2,11 +2,9 @@ namespace Friendica\Module\Admin\Themes; -use Friendica\Content\Text\Markdown; use Friendica\Core\Config; use Friendica\Core\L10n; use Friendica\Core\Renderer; -use Friendica\Core\System; use Friendica\Core\Theme; use Friendica\Module\BaseAdminModule; use Friendica\Util\Strings; @@ -23,7 +21,7 @@ class Index extends BaseAdminModule // reload active themes if (!empty($_GET['action'])) { - parent::checkFormSecurityTokenRedirectOnError(System::baseUrl() . '/admin/themes', 'admin_themes', 't'); + parent::checkFormSecurityTokenRedirectOnError($a->getBaseURL() . '/admin/themes', 'admin_themes', 't'); switch ($_GET['action']) { case 'reload': @@ -96,7 +94,7 @@ class Index extends BaseAdminModule '$page' => L10n::t('Themes'), '$submit' => L10n::t('Save Settings'), '$reload' => L10n::t('Reload active themes'), - '$baseurl' => System::baseUrl(true), + '$baseurl' => $a->getBaseURL(true), '$function' => 'themes', '$addons' => $addons, '$pcount' => count($themes), diff --git a/src/Module/Admin/Users.php b/src/Module/Admin/Users.php index 85567fd2a..4d25f4f89 100644 --- a/src/Module/Admin/Users.php +++ b/src/Module/Admin/Users.php @@ -6,7 +6,6 @@ use Friendica\Content\Pager; use Friendica\Core\Config; use Friendica\Core\L10n; use Friendica\Core\Renderer; -use Friendica\Core\System; use Friendica\Database\DBA; use Friendica\Model\Register; use Friendica\Model\User; @@ -78,7 +77,7 @@ class Users extends BaseAdminModule Thank you and welcome to %4$s.')); $preamble = sprintf($preamble, $user['username'], Config::get('config', 'sitename')); - $body = sprintf($body, System::baseUrl(), $user['nickname'], $result['password'], Config::get('config', 'sitename')); + $body = sprintf($body, $a->getBaseURL(), $user['nickname'], $result['password'], Config::get('config', 'sitename')); notification([ 'type' => SYSTEM_EMAIL, diff --git a/src/Module/Contact.php b/src/Module/Contact.php index 3074bf7d6..ea3eecd4a 100644 --- a/src/Module/Contact.php +++ b/src/Module/Contact.php @@ -120,11 +120,9 @@ class Contact extends BaseModule '$networks_widget' => $networks_widget ]); - $base = $a->getBaseURL(); $tpl = Renderer::getMarkupTemplate('contacts-head.tpl'); $a->page['htmlhead'] .= Renderer::replaceMacros($tpl, [ - '$baseurl' => System::baseUrl(true), - '$base' => $base + '$baseurl' => $a->getBaseURL(true), ]); } @@ -809,7 +807,6 @@ class Contact extends BaseModule $tpl = Renderer::getMarkupTemplate('contacts-template.tpl'); $o .= Renderer::replaceMacros($tpl, [ - '$baseurl' => System::baseUrl(), '$header' => L10n::t('Contacts') . (($nets) ? ' - ' . ContactSelector::networkToName($nets) : ''), '$tabs' => $t, '$total' => $total, diff --git a/src/Module/Install.php b/src/Module/Install.php index 1cef8fbaf..b19e69a32 100644 --- a/src/Module/Install.php +++ b/src/Module/Install.php @@ -173,15 +173,14 @@ class Install extends BaseModule '$next' => L10n::t('Next'), '$reload' => L10n::t('Check again'), '$php_path' => $php_path, - '$baseurl' => $a->getBaseURL() ]); break; case self::BASE_CONFIG: $ssl_choices = [ - BaseUrl::SSL_POLICY_NONE => L10n::t("No SSL policy, links will track page SSL state"), - BaseUrl::SSL_POLICY_FULL => L10n::t("Force all links to use SSL"), - BaseUrl::SSL_POLICY_SELFSIGN => L10n::t("Self-signed certificate, use SSL for local links only \x28discouraged\x29") + BaseURL::SSL_POLICY_NONE => L10n::t("No SSL policy, links will track page SSL state"), + BaseURL::SSL_POLICY_FULL => L10n::t("Force all links to use SSL"), + BaseURL::SSL_POLICY_SELFSIGN => L10n::t("Self-signed certificate, use SSL for local links only \x28discouraged\x29") ]; $tpl = Renderer::getMarkupTemplate('install_base.tpl'); @@ -208,7 +207,6 @@ class Install extends BaseModule $configCache->get('system', 'urlpath'), L10n::t('Overwrite this field in case the sub path determination isn\'t right, otherwise leave it as is. Leaving this field blank means the installation is at the base URL without sub path.'), ''], - '$baseurl' => $a->getBaseURL(), '$php_path' => $configCache->get('config', 'php_path'), '$submit' => L10n::t('Submit'), ]); @@ -249,7 +247,6 @@ class Install extends BaseModule '', 'required'], '$lbl_10' => L10n::t('Please select a default timezone for your website'), - '$baseurl' => $a->getBaseURL(), '$php_path' => $configCache->get('config', 'php_path'), '$submit' => L10n::t('Submit') ]); @@ -286,7 +283,6 @@ class Install extends BaseModule $configCache->get('system', 'language'), L10n::t('Set the default language for your Friendica installation interface and to send emails.'), $lang_choices], - '$baseurl' => $a->getBaseURL(), '$php_path' => $configCache->get('config', 'php_path'), '$submit' => L10n::t('Submit') ]); diff --git a/src/Module/Manifest.php b/src/Module/Manifest.php index 40ae53891..9dadcf0f7 100644 --- a/src/Module/Manifest.php +++ b/src/Module/Manifest.php @@ -22,7 +22,6 @@ class Manifest extends BaseModule } $output = Renderer::replaceMacros($tpl, [ - '$baseurl' => $app->getBaseURL(), '$touch_icon' => $touch_icon, '$title' => $config->get('config', 'sitename', 'Friendica'), ]); diff --git a/src/Module/Register.php b/src/Module/Register.php index 202cf948e..06b62783f 100644 --- a/src/Module/Register.php +++ b/src/Module/Register.php @@ -144,7 +144,6 @@ class Register extends BaseModule '$tostext' => L10n::t('Terms of Service'), '$showprivstatement' => Config::get('system', 'tosprivstatement'), '$privstatement'=> $tos->privacy_complete, - '$baseurl' => System::baseurl(), '$form_security_token' => BaseModule::getFormSecurityToken('register'), '$explicit_content' => Config::get('system', 'explicit_content', false), '$explicit_content_note' => L10n::t('Note: This node explicitly contains adult content') diff --git a/src/Module/Xrd.php b/src/Module/Xrd.php index 38ce151ff..f7e20c9db 100644 --- a/src/Module/Xrd.php +++ b/src/Module/Xrd.php @@ -178,7 +178,6 @@ class Xrd extends BaseModule '$atom' => $baseURL . '/dfrn_poll/' . $user['nickname'], '$poco_url' => $baseURL . '/poco/' . $user['nickname'], '$photo' => $baseURL . '/photo/profile/' . $user['uid'] . '.jpg', - '$baseurl' => $baseURL, '$salmon' => $baseURL . '/salmon/' . $user['nickname'], '$salmen' => $baseURL . '/salmon/' . $user['nickname'] . '/mention', '$subscribe' => $baseURL . '/follow?url={uri}', diff --git a/view/templates/admin/dbsync/failed_updates.tpl b/view/templates/admin/dbsync/failed_updates.tpl index 8a5e0c2fa..f75f266c7 100644 --- a/view/templates/admin/dbsync/failed_updates.tpl +++ b/view/templates/admin/dbsync/failed_updates.tpl @@ -9,8 +9,8 @@

{{$f}}


diff --git a/view/templates/admin/dbsync/structure_check.tpl b/view/templates/admin/dbsync/structure_check.tpl index 7193d38ee..06d61a080 100644 --- a/view/templates/admin/dbsync/structure_check.tpl +++ b/view/templates/admin/dbsync/structure_check.tpl @@ -2,7 +2,7 @@

{{$banner}}

-

{{$check}}

+

{{$check}}


diff --git a/view/theme/duepuntozero/config.php b/view/theme/duepuntozero/config.php index 430fa7f60..cd0445551 100644 --- a/view/theme/duepuntozero/config.php +++ b/view/theme/duepuntozero/config.php @@ -70,7 +70,6 @@ function clean_form(App $a, &$colorset, $user) $t = Renderer::getMarkupTemplate("theme_settings.tpl"); $o = Renderer::replaceMacros($t, [ '$submit' => L10n::t('Submit'), - '$baseurl' => System::baseUrl(), '$title' => L10n::t("Theme settings"), '$colorset' => ['duepuntozero_colorset', L10n::t('Variations'), $color, '', $colorset], ]); diff --git a/view/theme/frio/config.php b/view/theme/frio/config.php index cd4d7b894..d1591273f 100644 --- a/view/theme/frio/config.php +++ b/view/theme/frio/config.php @@ -119,7 +119,6 @@ function frio_form($arr) $t = Renderer::getMarkupTemplate('theme_settings.tpl'); $ctx = [ '$submit' => L10n::t('Submit'), - '$baseurl' => System::baseUrl(), '$title' => L10n::t('Theme settings'), '$scheme' => ['frio_scheme', L10n::t('Select color scheme'), $arr['scheme'], '', $scheme_choices], '$share_string' => ['frio_share_string', L10n::t('Copy or paste schemestring'), $arr['share_string'], L10n::t('You can copy this string to share your theme with others. Pasting here applies the schemestring'), false, false], diff --git a/view/theme/quattro/config.php b/view/theme/quattro/config.php index cdef0eeaa..bbe33a1e1 100644 --- a/view/theme/quattro/config.php +++ b/view/theme/quattro/config.php @@ -72,7 +72,6 @@ function quattro_form(App $a, $align, $color, $tfs, $pfs) { $t = Renderer::getMarkupTemplate("theme_settings.tpl" ); $o = Renderer::replaceMacros($t, [ '$submit' => L10n::t('Submit'), - '$baseurl' => System::baseUrl(), '$title' => L10n::t("Theme settings"), '$align' => ['quattro_align', L10n::t('Alignment'), $align, '', ['left' => L10n::t('Left'), 'center' => L10n::t('Center')]], '$color' => ['quattro_color', L10n::t('Color scheme'), $color, '', $colors], diff --git a/view/theme/vier/config.php b/view/theme/vier/config.php index f70935653..d34a447d5 100644 --- a/view/theme/vier/config.php +++ b/view/theme/vier/config.php @@ -118,7 +118,6 @@ function vier_form(App $a, $style, $show_pages, $show_profiles, $show_helpers, $ $t = Renderer::getMarkupTemplate("theme_settings.tpl"); $o = Renderer::replaceMacros($t, [ '$submit' => L10n::t('Submit'), - '$baseurl' => System::baseUrl(), '$title' => L10n::t("Theme settings"), '$style' => ['vier_style', L10n::t('Set style'), $style, '', $styles], '$show_pages' => ['vier_show_pages', L10n::t('Community Pages'), $show_pages, '', $show_or_not],