Fix errors in all modules

This commit is contained in:
Art4 2024-11-18 22:20:28 +00:00
parent 6cb9676250
commit f254283dc6
9 changed files with 15 additions and 14 deletions

View 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();
}
}

View 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());
}

View 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');
}

View 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,

View 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;
}

View 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'];
@ -170,6 +172,8 @@ class Circle extends BaseModule
}
$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'], ''],

View 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']);

View 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']);

View 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']);