diff --git a/src/Module/Admin/Themes/Embed.php b/src/Module/Admin/Themes/Embed.php index 00a79db54d..64f686a1ab 100644 --- a/src/Module/Admin/Themes/Embed.php +++ b/src/Module/Admin/Themes/Embed.php @@ -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(); } } diff --git a/src/Module/Api/Mastodon/Markers.php b/src/Module/Api/Mastodon/Markers.php index b5ed3e825a..11ae2e9324 100644 --- a/src/Module/Api/Mastodon/Markers.php +++ b/src/Module/Api/Mastodon/Markers.php @@ -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()); } diff --git a/src/Module/Api/Twitter/Friendships/Show.php b/src/Module/Api/Twitter/Friendships/Show.php index 1c2bea6cba..2099bf16a9 100644 --- a/src/Module/Api/Twitter/Friendships/Show.php +++ b/src/Module/Api/Twitter/Friendships/Show.php @@ -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'); } diff --git a/src/Module/BaseNotifications.php b/src/Module/BaseNotifications.php index f9f47d4a21..0445075995 100644 --- a/src/Module/BaseNotifications.php +++ b/src/Module/BaseNotifications.php @@ -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, diff --git a/src/Module/Calendar/Event/API.php b/src/Module/Calendar/Event/API.php index 3223ecd42b..8a62efdc8a 100644 --- a/src/Module/Calendar/Event/API.php +++ b/src/Module/Calendar/Event/API.php @@ -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; } diff --git a/src/Module/Circle.php b/src/Module/Circle.php index ae81d3f757..b638eec557 100644 --- a/src/Module/Circle.php +++ b/src/Module/Circle.php @@ -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'], ''], diff --git a/view/theme/duepuntozero/config.php b/view/theme/duepuntozero/config.php index 1c70b4414c..35629a9143 100644 --- a/view/theme/duepuntozero/config.php +++ b/view/theme/duepuntozero/config.php @@ -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']); diff --git a/view/theme/quattro/config.php b/view/theme/quattro/config.php index 97f68c0579..4406b3d9ea 100644 --- a/view/theme/quattro/config.php +++ b/view/theme/quattro/config.php @@ -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']); diff --git a/view/theme/vier/config.php b/view/theme/vier/config.php index f30bf1be7e..f69e9521a7 100644 --- a/view/theme/vier/config.php +++ b/view/theme/vier/config.php @@ -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']);