]> git.mxchange.org Git - friendica.git/commitdiff
Fix errors in all modules
authorArt4 <art4@wlabs.de>
Mon, 18 Nov 2024 22:20:28 +0000 (22:20 +0000)
committerArt4 <art4@wlabs.de>
Mon, 18 Nov 2024 22:20:28 +0000 (22:20 +0000)
src/Module/Admin/Themes/Embed.php
src/Module/Api/Mastodon/Markers.php
src/Module/Api/Twitter/Friendships/Show.php
src/Module/BaseNotifications.php
src/Module/Calendar/Event/API.php
src/Module/Circle.php
view/theme/duepuntozero/config.php
view/theme/quattro/config.php
view/theme/vier/config.php

index 00a79db54d56313a399090fa0da235c2df6539f1..64f686a1abc6341cd0745f03b62fb97ad4ccb2f8 100644 (file)
@@ -49,7 +49,7 @@ class Embed extends BaseAdmin
                        require_once "view/theme/$theme/config.php";
                        if (function_exists('theme_admin_post')) {
                                self::checkFormSecurityTokenRedirectOnError('/admin/themes/' . $theme . '/embed?mode=minimal', 'admin_theme_settings');
-                               theme_admin_post($this->appHelper);
+                               theme_admin_post();
                        }
                }
 
index b5ed3e825acaee59c563577a99ea4988924f6c26..11ae2e9324733de1a4262a732b9a2be28b055518 100644 (file)
@@ -31,7 +31,7 @@ class Markers extends BaseApi
                        }
                }
 
-               if (empty($timeline) || empty($last_read_id) || empty($application['id'])) {
+               if ($timeline === '' || $last_read_id === '' || empty($application['id'])) {
                        $this->logAndJsonError(422, $this->errorFactory->UnprocessableEntity());
                }
 
index 1c2bea6cbad45225814761f25edecd320588ffb0..2099bf16a90a53306343078db8e8648d43372b56 100644 (file)
@@ -28,12 +28,12 @@ class Show extends ContactEndpoint
                $target_cid = BaseApi::getContactIDForSearchterm($this->getRequestValue($request, 'target_screen_name', ''), '', $this->getRequestValue($request, 'target_id', 0), $uid);
 
                $source = Contact::getById($source_cid);
-               if (empty($source)) {
+               if ($source === false) {
                        throw new NotFoundException('Source not found');
                }
 
                $target = Contact::getById($target_cid);
-               if (empty($source)) {
+               if ($target === false) {
                        throw new NotFoundException('Target not found');
                }
 
index f9f47d4a2117b75fe6ddeb6eca23456f1c7e2419..04450759955d809f277e1e9a5ab4fd08a00933b7 100644 (file)
@@ -131,7 +131,7 @@ abstract class BaseNotifications extends BaseModule
 
                $notif_tpl = Renderer::getMarkupTemplate('notifications/notifications.tpl');
                return Renderer::replaceMacros($notif_tpl, [
-                       '$header'        => $header ?? $this->t('Notifications'),
+                       '$header'        => $header ?: $this->t('Notifications'),
                        '$tabs'          => $tabs,
                        '$notifications' => $notifications,
                        '$noContent'     => $noContent,
index 3223ecd42b548d94072ab88a83a97810bf00588b..8a62efdc8ad3bb7a8f6186830a126f4cfb5ad681 100644 (file)
@@ -140,9 +140,9 @@ class API extends BaseModule
                $share     = intval($request['share'] ?? 0);
                $isPreview = intval($request['preview'] ?? 0);
 
-               $start = DateTimeFormat::convert($strStartDateTime ?? DBA::NULL_DATETIME, 'UTC', $this->timezone);
+               $start = DateTimeFormat::convert($strStartDateTime, 'UTC', $this->timezone);
                if (!$noFinish) {
-                       $finish = DateTimeFormat::convert($strFinishDateTime ?? DBA::NULL_DATETIME, 'UTC', $this->timezone);
+                       $finish = DateTimeFormat::convert($strFinishDateTime, 'UTC', $this->timezone);
                } else {
                        $finish = DBA::NULL_DATETIME;
                }
index ae81d3f757c27edac29b46495ffba728891502d9..b638eec557e6ec2326d8a2b15c6f3e948f638642 100644 (file)
@@ -70,6 +70,8 @@ class Circle extends BaseModule
                                throw new \Exception(DI::l10n()->t('Permission denied.'), 403);
                        }
 
+                       $message = '';
+
                        if (isset($this->parameters['command'])) {
                                $circle_id = $this->parameters['circle'];
                                $contact_id = $this->parameters['contact'];
@@ -169,7 +171,9 @@ class Circle extends BaseModule
                        ]);
                }
 
-               $nocircle = false;
+               $nocircle    = false;
+               $members     = [];
+               $preselected = [];
 
                // @TODO: Replace with parameter from router
                if ((DI::args()->getArgc() == 2) && (DI::args()->getArgv()[1] === 'none') ||
@@ -181,9 +185,6 @@ class Circle extends BaseModule
                                'name' => DI::l10n()->t('Contacts not in any circle'),
                        ];
 
-                       $members = [];
-                       $preselected = [];
-
                        $context = $context + [
                                '$title' => $circle['name'],
                                '$gname' => ['circle_name', DI::l10n()->t('Circle Name: '), $circle['name'], ''],
index 1c70b4414c1c30a4e871f9d60ac391b9d0212c64..35629a9143a6d971dd654e3be3edb7ca0eacc689 100644 (file)
@@ -42,7 +42,7 @@ function theme_admin(AppHelper $appHelper)
        return clean_form($appHelper, $colorset, $user);
 }
 
-function theme_admin_post(AppHelper $appHelper)
+function theme_admin_post()
 {
        if (isset($_POST['duepuntozero-settings-submit'])) {
                DI::config()->set('duepuntozero', 'colorset', $_POST['duepuntozero_colorset']);
index 97f68c0579964056280bbd52b5347c568cc2d171..4406b3d9ea00deedf303bc6fcd21cacbb6096a26 100644 (file)
@@ -46,7 +46,7 @@ function theme_admin(AppHelper $appHelper) {
        return quattro_form($appHelper,$align, $color, $tfs, $pfs);
 }
 
-function theme_admin_post(AppHelper $appHelper) {
+function theme_admin_post() {
        if (isset($_POST['quattro-settings-submit'])){
                DI::config()->set('quattro', 'align', $_POST['quattro_align']);
                DI::config()->set('quattro', 'color', $_POST['quattro_color']);
index f30bf1be7e77e11a61a9c8a020be775ddc47f04a..f69e9521a7992b9cb36eed65b63e6a1c7e95e2ed 100644 (file)
@@ -91,7 +91,7 @@ function theme_admin(AppHelper $appHelper) {
        return $o;
 }
 
-function theme_admin_post(AppHelper $appHelper) {
+function theme_admin_post() {
        if (isset($_POST['vier-settings-submit'])){
                DI::config()->set('vier', 'style', $_POST['vier_style']);
                DI::config()->set('vier', 'show_pages', $_POST['vier_show_pages']);