]> git.mxchange.org Git - friendica.git/commitdiff
Apply suggestions from code review
authorPhilipp <admin+Github@philipp.info>
Sun, 19 Feb 2023 10:12:48 +0000 (11:12 +0100)
committerGitHub <noreply@github.com>
Sun, 19 Feb 2023 10:12:48 +0000 (11:12 +0100)
Co-authored-by: Hypolite Petovan <hypolite@mrpetovan.com>
30 files changed:
mod/message.php
src/Module/Admin/Addons/Details.php
src/Module/Admin/Addons/Index.php
src/Module/Admin/Features.php
src/Module/Admin/Logs/Settings.php
src/Module/Admin/Logs/View.php
src/Module/Admin/Site.php
src/Module/Admin/Storage.php
src/Module/Admin/Themes/Details.php
src/Module/Admin/Themes/Embed.php
src/Module/Admin/Themes/Index.php
src/Module/Contact.php
src/Module/Contact/Profile.php
src/Module/Debug/Localtime.php
src/Module/Help.php
src/Module/Home.php
src/Module/Install.php
src/Module/Moderation/Users/Create.php
src/Module/Moderation/Users/Deleted.php
src/Module/Moderation/Users/Index.php
src/Module/Moderation/Users/Pending.php
src/Module/NodeInfo210.php
src/Module/Profile/Schedule.php
src/Module/Profile/UnkMail.php
src/Module/Security/Login.php
src/Module/Security/PasswordTooLong.php
src/Module/Settings/Account.php
src/Module/Settings/Display.php
src/Module/Settings/OAuth.php
src/Module/Settings/Profile/Index.php

index c5d923de0bb90d0ef42c45302470ecf6dc7b43fe..1e8c012eeb622b5f5dfa663a3f2b6da10d4c5829 100644 (file)
@@ -58,7 +58,6 @@ function message_init(App $a)
 
        $head_tpl = Renderer::getMarkupTemplate('message-head.tpl');
        DI::page()['htmlhead'] .= Renderer::replaceMacros($head_tpl, [
-               '$baseurl' => DI::baseUrl(),
                '$base'    => $base
        ]);
 }
@@ -178,7 +177,6 @@ function message_content(App $a)
 
                $tpl = Renderer::getMarkupTemplate('msg-header.tpl');
                DI::page()['htmlhead'] .= Renderer::replaceMacros($tpl, [
-                       '$baseurl' => DI::baseUrl(),
                        '$nickname' => $a->getLoggedInUserNickname(),
                        '$linkurl' => DI::l10n()->t('Please enter a link URL:')
                ]);
@@ -284,7 +282,6 @@ function message_content(App $a)
 
                $tpl = Renderer::getMarkupTemplate('msg-header.tpl');
                DI::page()['htmlhead'] .= Renderer::replaceMacros($tpl, [
-                       '$baseurl' => DI::baseUrl(),
                        '$nickname' => $a->getLoggedInUserNickname(),
                        '$linkurl' => DI::l10n()->t('Please enter a link URL:')
                ]);
index 51b900d6113e4510d976d02beba7c4df4a132b70..1667f7d5c7f388f933976d863b2b6ec1cf5fe3d5 100644 (file)
@@ -112,7 +112,6 @@ class Details extends BaseAdmin
                        '$page' => DI::l10n()->t('Addons'),
                        '$toggle' => DI::l10n()->t('Toggle'),
                        '$settings' => DI::l10n()->t('Settings'),
-                       '$baseurl' => DI::baseUrl(),
 
                        '$addon' => $addon,
                        '$status' => $status,
index 4ec7a334a9decb0275910bba45e36dd81e00d448..ca8e075012e805cc66c75dfbbfb42a1c54f1f509 100644 (file)
@@ -68,7 +68,6 @@ class Index extends BaseAdmin
                        '$page' => DI::l10n()->t('Addons'),
                        '$submit' => DI::l10n()->t('Save Settings'),
                        '$reload' => DI::l10n()->t('Reload active addons'),
-                       '$baseurl' => DI::baseUrl(),
                        '$function' => 'addons',
                        '$addons' => $addons,
                        '$pcount' => count($addons),
index b9e3b1f64a511515ba80ca300acf91c9618bb196..f3e55a7e9c56faaaec4ee22c0f48a77af3d1a5b9 100644 (file)
@@ -81,7 +81,6 @@ class Features extends BaseAdmin
                $tpl = Renderer::getMarkupTemplate('admin/features.tpl');
                $o = Renderer::replaceMacros($tpl, [
                        '$form_security_token' => self::getFormSecurityToken("admin_manage_features"),
-                       '$baseurl'             => DI::baseUrl(),
                        '$title'               => DI::l10n()->t('Manage Additional Features'),
                        '$features'            => $features,
                        '$submit'              => DI::l10n()->t('Save Settings'),
index 34460e1ccebd454955fb2bea958c57dc1c665518..91b29387109ece7cf4613e84f1f405c98b711adc 100644 (file)
@@ -80,7 +80,6 @@ class Settings extends BaseAdmin
                        '$page' => DI::l10n()->t('Logs'),
                        '$submit' => DI::l10n()->t('Save Settings'),
                        '$clear' => DI::l10n()->t('Clear'),
-                       '$baseurl' => DI::baseUrl(),
                        '$logname' => DI::config()->get('system', 'logfile'),
                        // see /help/smarty3-templates#1_1 on any Friendica node
                        '$debugging' => ['debugging', DI::l10n()->t("Enable Debugging"), DI::config()->get('system', 'debugging'), ""],
index cd98ae133618b0084cadf1c16ef230e96bed750e..bab804f4e064a46d164a66863177698cab56f1fd 100644 (file)
@@ -80,7 +80,6 @@ class View extends BaseAdmin
                        }
                }
                return Renderer::replaceMacros($t, [
-                       '$baseurl'       => DI::baseUrl(),
                        '$title'         => DI::l10n()->t('Administration'),
                        '$page'          => DI::l10n()->t('View Logs'),
                        '$l10n'          => [
index f1ef5d7642477e94a73261d5ecd844757fc42e6d..8e2e10fab0e54079a34448776fb413039c35515c 100644 (file)
@@ -406,7 +406,6 @@ class Site extends BaseAdmin
                        '$relocate'          => DI::l10n()->t('Relocate Node'),
                        '$relocate_msg'      => DI::l10n()->t('Relocating your node enables you to change the DNS domain of this node and keep all the existing users and posts. This process takes a while and can only be started from the relocate console command like this:'),
                        '$relocate_cmd'      => DI::l10n()->t('(Friendica directory)# bin/console relocate https://newdomain.com'),
-                       '$baseurl'           => DI::baseUrl(),
 
                        // name, label, value, help string, extra data...
                        '$sitename'         => ['sitename', DI::l10n()->t('Site name'), DI::config()->get('config', 'sitename'), ''],
index 8baff7ae243aa630b74a8dfc5156b834338c7bcd..71d34cb25de6fc03fae490d310bd20a19a2bf53d 100644 (file)
@@ -144,7 +144,6 @@ class Storage extends BaseAdmin
                        '$use'                   => DI::l10n()->t('Use storage backend'),
                        '$save_reload'           => DI::l10n()->t('Save & Reload'),
                        '$noconfig'              => DI::l10n()->t('This backend doesn\'t have custom settings'),
-                       '$baseurl'               => DI::baseUrl(),
                        '$form_security_token'   => self::getFormSecurityToken("admin_storage"),
                        '$storagebackend'        => $current_storage_backend instanceof ICanWriteToStorage ? $current_storage_backend::getName() : DI::l10n()->t('Database (legacy)'),
                        '$availablestorageforms' => $available_storage_forms,
index c6bf3dac38427bc92bd09860a71a5ae92d758159..7648b6b97e00e41bcb198e5b2812e5ab40a851e0 100644 (file)
@@ -91,7 +91,6 @@ class Details extends BaseAdmin
                        '$page' => DI::l10n()->t('Themes'),
                        '$toggle' => DI::l10n()->t('Toggle'),
                        '$settings' => DI::l10n()->t('Settings'),
-                       '$baseurl' => DI::baseUrl(),
                        '$addon' => $theme,
                        '$status' => $status,
                        '$action' => $action,
index 82539eeb0d8484542f6c808fa5f2c2a7877f1e25..389f8294123ab4dad3e82b311b87592730be53a0 100644 (file)
@@ -95,7 +95,7 @@ class Embed extends BaseAdmin
 
                $t = Renderer::getMarkupTemplate('admin/addons/embed.tpl');
                return Renderer::replaceMacros($t, [
-                       '$action' => DI::baseUrl() . '/admin/themes/' . $theme . '/embed?mode=minimal',
+                       '$action' => 'admin/themes/' . $theme . '/embed?mode=minimal',
                        '$form' => $admin_form,
                        '$form_security_token' => self::getFormSecurityToken("admin_theme_settings"),
                ]);
index 69f516a63d0ecdee9115b4a70258ccc84a9218f9..c74297744b3ae94ccc43062f4fdf3ed7ecc86a12 100644 (file)
@@ -112,7 +112,6 @@ class Index extends BaseAdmin
                        '$page'                => DI::l10n()->t('Themes'),
                        '$submit'              => DI::l10n()->t('Save Settings'),
                        '$reload'              => DI::l10n()->t('Reload active themes'),
-                       '$baseurl'             => DI::baseUrl(),
                        '$function'            => 'themes',
                        '$addons'              => $addons,
                        '$pcount'              => count($themes),
index 0e378de36e2cbcc8770d88f95f4f5035523bc06a..a70db02345c681c77e46055e67c8ef870f96821d 100644 (file)
@@ -220,7 +220,6 @@ class Contact extends BaseModule
 
                $tpl = Renderer::getMarkupTemplate('contacts-head.tpl');
                DI::page()['htmlhead'] .= Renderer::replaceMacros($tpl, [
-                       '$baseurl' => DI::baseUrl(),
                ]);
 
                $o = '';
index d56655218efa7511f42a984d0307208fa4ad471a..34d02ac228750fb250bc94aafed2df325d6312ba 100644 (file)
@@ -236,7 +236,6 @@ class Profile extends BaseModule
                $_SESSION['return_path'] = $this->args->getQueryString();
 
                $this->page['htmlhead'] .= Renderer::replaceMacros(Renderer::getMarkupTemplate('contact_head.tpl'), [
-                       '$baseurl' => $this->baseUrl,
                ]);
 
                switch ($localRelationship->rel) {
index 519fe751e0b479c2a8680d50b75f6bc4c283bae0..1d5d966ad5ceb7069c20cae7ea3fb293dc8c239c 100644 (file)
@@ -58,7 +58,7 @@ class Localtime extends BaseModule
                        $output .= '<p>' . DI::l10n()->t('Converted localtime: %s', self::$mod_localtime) . '</p>';
                }
 
-               $output .= '<form action ="' . DI::baseUrl() . '/localtime?time=' . $time . '" method="post" >';
+               $output .= '<form action ="localtime?time=' . $time . '" method="post">';
                $output .= '<p>' . DI::l10n()->t('Please select your timezone:') . '</p>';
                $output .= Temporal::getTimezoneSelect(($_REQUEST['timezone'] ?? '') ?: Installer::DEFAULT_TZ);
                $output .= '<input type="submit" name="submit" value="' . DI::l10n()->t('Submit') . '" /></form>';
index 03392c73a6ea5d816b239d196c91f44c3a6c389c..3212d2fe48c6ac339e9c7d613f62ac2ea4cedc08 100644 (file)
@@ -102,7 +102,7 @@ class Help extends BaseModule
 
                                        $idNum[$level] ++;
 
-                                       $href = DI::baseUrl() . "/help/{$filename}#{$anchor}";
+                                       $href = "help/{$filename}#{$anchor}";
                                        $toc .= "<li><a href=\"{$href}\">" . strip_tags($line) . "</a></li>";
                                        $id = implode("_", array_slice($idNum, 1, $level));
                                        $line = "<a name=\"{$id}\"></a>" . $line;
index cfafc55251c621cd8fcbfefe78a2f4ae10471d57..fbba889a883af7839d36b7999a3e719d08536820 100644 (file)
@@ -69,7 +69,7 @@ class Home extends BaseModule
                        $customHome = $homeFilePath;
 
                        if (file_exists($cssFilePath)) {
-                               DI::page()['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . DI::baseUrl() . '/home.css' . '" media="all" />';
+                               DI::page()->registerStylesheet('home.css', 'all');
                        }
                }
 
index e8093095b036438a95bc2f9d1a2ca02a1fc000a3..abf76023798f0912b11bc9c5f62c007e8f84e572 100644 (file)
@@ -228,7 +228,7 @@ class Install extends BaseModule
                                        '$system_url'    => ['system-url',
                                                $this->t('The Friendica system URL'),
                                                (string)$baseUrl,
-                                               $this->t('Overwrite this field in case the system URL determination isn\'t right, otherwise leave it as is.'),
+                                               $this->t("Overwrite this field in case the system URL determination isn't right, otherwise leave it as is."),
                                                $this->t('Required')],
                                        '$php_path'   => $configCache->get('config', 'php_path'),
                                        '$submit'     => $this->t('Submit'),
index 48a9b1eef475ece22251c16d889aade6a3b723e9..75792541e38668bd0a31fe8f6b0c555e358ec7d8 100644 (file)
@@ -65,7 +65,6 @@ class Create extends BaseUsers
                        '$form_security_token' => self::getFormSecurityToken('admin_users_create'),
 
                        // values //
-                       '$baseurl'      => $this->baseUrl,
                        '$query_string' => $this->args->getQueryString(),
 
                        '$newusername'     => ['new_user_name', $this->t('Name'), '', $this->t('Name of the new user.')],
index 4781102876b8138feec4ee6550eedf88b559d2a0..58a29ed551ea064c08f7b58da0c5d35ba762bbec 100644 (file)
@@ -85,7 +85,6 @@ class Deleted extends BaseUsers
                        '$form_security_token' => self::getFormSecurityToken('moderation_users_deleted'),
 
                        // values //
-                       '$baseurl'      => $this->baseUrl,
                        '$query_string' => $this->args->getQueryString(),
 
                        '$users' => $users,
index 0df32c5097982d13fe26103b7161ecfee050ea86..d517ab9dd99d08ac60f25cbf32ad9bdf531ee669 100644 (file)
@@ -168,7 +168,6 @@ class Index extends BaseUsers
                        '$form_security_token' => self::getFormSecurityToken('moderation_users'),
 
                        // values //
-                       '$baseurl'      => $this->baseUrl,
                        '$query_string' => $this->args->getQueryString(),
 
                        '$users' => $users,
index 40e64bb8af153b5aa70872bc18e0bb11edd501e7..d0fb7b8d11567e91196afa89494ace4a0df7c7a9 100644 (file)
@@ -105,7 +105,6 @@ class Pending extends BaseUsers
                        '$form_security_token' => self::getFormSecurityToken('admin_users_pending'),
 
                        // values //
-                       '$baseurl' => $this->baseUrl,
                        '$query_string' => $this->args->getQueryString(),
 
                        '$pending' => $pending,
index ea55a33f16ba38c5944503bb8495a12a37b49698..e7112846c6c9c86400a12f595f47fdee31ee2d13 100644 (file)
@@ -52,7 +52,6 @@ class NodeInfo210 extends BaseModule
                $nodeinfo = [
                        'version' => '1.0',
                        'server'  => [
-                               'baseUrl'  => $this->baseUrl,
                                'name'     => $this->config->get('config', 'sitename'),
                                'software' => 'friendica',
                                'version'  => App::VERSION . '-' . DB_UPDATE_VERSION,
index cc4f134414d8df24cd13581885340887a66d0276..ef57c294aaa437cc42b897f87d4afdea0ae4b734 100644 (file)
@@ -78,7 +78,6 @@ class Schedule extends BaseProfile
                $tpl = Renderer::getMarkupTemplate('profile/schedule.tpl');
                $o .= Renderer::replaceMacros($tpl, [
                        '$form_security_token' => BaseModule::getFormSecurityToken("profile_schedule"),
-                       '$baseurl'             => DI::baseUrl(),
                        '$title'               => DI::l10n()->t('Scheduled Posts'),
                        '$nickname'            => $this->parameters['nickname'] ?? '',
                        '$scheduled_at'        => DI::l10n()->t('Scheduled'),
index 8393327251ad3c647ed70a08a52cb203bd961273..4b38d203780f3147d3ad2576171475c826d27a05 100644 (file)
@@ -141,7 +141,6 @@ class UnkMail extends \Friendica\BaseModule
 
                $tpl = Renderer::getMarkupTemplate('profile/unkmail-header.tpl');
                $this->page['htmlhead'] .= Renderer::replaceMacros($tpl, [
-                       '$baseurl'  => $this->baseUrl,
                        '$nickname' => $user['nickname'],
                        '$linkurl'  => $this->l10n->t('Please enter a link URL:')
                ]);
index 634123a8e3e07cc05527051ac67235bcec54919c..c5028ffc57a7536054b4131c9a2de3095108e681 100644 (file)
@@ -132,7 +132,6 @@ class Login extends BaseModule
                        DI::page()['htmlhead'] .= Renderer::replaceMacros(
                                Renderer::getMarkupTemplate('login_head.tpl'),
                                [
-                                       '$baseurl' => DI::baseUrl()
                                ]
                        );
 
index b4117a50602f82b73009d2b1424f35095e0662d6..eeeae4084ec87257fc0f6e55571be0ac9624cd3b 100644 (file)
@@ -93,7 +93,6 @@ class PasswordTooLong extends \Friendica\BaseModule
                                'submit' => $this->l10n->t('Update Password'),
                        ],
 
-                       '$baseurl'             => $this->baseUrl,
                        '$form_security_token' => self::getFormSecurityToken('security/password_too_long'),
                        '$return_url'          => $request['return_url'] ?? '',
 
index 4e756a849d7fc849cc0ea876cd86ed28a92cab47..cba12cc3957cf9e58f2e390dcc7c5eb1b8bf848e 100644 (file)
@@ -558,7 +558,6 @@ class Account extends BaseSettings
                        '$desc'   => DI::l10n()->t("Your Identity Address is <strong>'%s'</strong> or '%s'.", $nickname . '@' . DI::baseUrl()->getHost() . DI::baseUrl()->getPath(), DI::baseUrl() . '/profile/' . $nickname),
 
                        '$submit'              => DI::l10n()->t('Save Settings'),
-                       '$baseurl'             => DI::baseUrl(),
                        '$uid'                 => DI::userSession()->getLocalUserId(),
                        '$form_security_token' => self::getFormSecurityToken('settings'),
                        '$open'                => $this->parameters['open'] ?? 'password',
index c614eccd04277f97ed7f17b94ee43c49f75ecec0..d24a8e10d4d39afb4be8ac652694cc1785fca7d7 100644 (file)
@@ -252,7 +252,6 @@ class Display extends BaseSettings
                        '$calendar_title' => $this->t('Calendar'),
 
                        '$form_security_token' => self::getFormSecurityToken('settings_display'),
-                       '$baseurl'             => $this->baseUrl,
                        '$uid'                 => $uid,
 
                        '$theme'            => ['theme', $this->t('Display Theme:'), $theme_selected, '', $themes, true],
index 50ac3e95dc2756e9134a88aa04b0727d32e5bb82..98c547e1a7f285072a67b53b256802fabd4c54d0 100644 (file)
@@ -68,7 +68,6 @@ class OAuth extends BaseSettings
                $tpl = Renderer::getMarkupTemplate('settings/oauth.tpl');
                return Renderer::replaceMacros($tpl, [
                        '$form_security_token' => BaseSettings::getFormSecurityToken('settings_oauth'),
-                       '$baseurl'             => $this->baseUrl,
                        '$title'               => $this->t('Connected Apps'),
                        '$name'                => $this->t('Name'),
                        '$website'             => $this->t('Home Page'),
index baf4a71f31e632212c10687ce524b32c4e02c09f..4e3967ec1bbae495e844fc15f41467c901cdb999 100644 (file)
@@ -208,7 +208,6 @@ class Index extends BaseSettings
                ];
 
                DI::page()['htmlhead'] .= Renderer::replaceMacros(Renderer::getMarkupTemplate('settings/profile/index_head.tpl'), [
-                       '$baseurl' => DI::baseUrl(),
                ]);
 
                $personal_account = ($profile['account-type'] != User::ACCOUNT_TYPE_COMMUNITY);