From 62035f07671659e8b7f48bf29dd51a59bfb60e71 Mon Sep 17 00:00:00 2001 From: spitfire305 Date: Mon, 9 Sep 2024 21:10:20 +0000 Subject: [PATCH] Fix styling --- app/Rules/AccountEmail.php | 2 +- app/Rules/AccountName.php | 2 +- app/Rules/CalendarFormat.php | 2 +- app/Rules/CampaignDelete.php | 2 +- app/Rules/EntityFileRule.php | 6 +++--- app/Rules/EntityLink.php | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/Rules/AccountEmail.php b/app/Rules/AccountEmail.php index 73dc1123f..200321f9c 100644 --- a/app/Rules/AccountEmail.php +++ b/app/Rules/AccountEmail.php @@ -15,7 +15,7 @@ class AccountEmail implements ValidationRule */ public function validate(string $attribute, mixed $value, Closure $fail): void { - if(Str::contains($value, ['@boxmail.lol', '@fireboxmail.lol'])) { + if (Str::contains($value, ['@boxmail.lol', '@fireboxmail.lol'])) { $fail('The validation error message.'); } } diff --git a/app/Rules/AccountName.php b/app/Rules/AccountName.php index 0b1fdf2f1..f0fc1d945 100644 --- a/app/Rules/AccountName.php +++ b/app/Rules/AccountName.php @@ -15,7 +15,7 @@ class AccountName implements ValidationRule */ public function validate(string $attribute, mixed $value, Closure $fail): void { - if (Str::contains($value, ['<', '>', 'https', 'http://', 'www.', 'Ђ', ' Illuro']) && Str::length($value) < 31) { + if (Str::contains($value, ['<', '>', 'https', 'http://', 'www.', 'Ђ', ' Illuro']) && Str::length($value) < 31) { $fail('Invalid account name.'); } } diff --git a/app/Rules/CalendarFormat.php b/app/Rules/CalendarFormat.php index 67ac1b3ad..a707fd5a7 100644 --- a/app/Rules/CalendarFormat.php +++ b/app/Rules/CalendarFormat.php @@ -14,7 +14,7 @@ class CalendarFormat implements ValidationRule */ public function validate(string $attribute, mixed $value, Closure $fail): void { - if(preg_match('/^[ymMds\s,-]+$/', $value)) { + if (preg_match('/^[ymMds\s,-]+$/', $value)) { $fail(__('calendars.validators.format')); } } diff --git a/app/Rules/CampaignDelete.php b/app/Rules/CampaignDelete.php index c5341371e..55a68c01f 100644 --- a/app/Rules/CampaignDelete.php +++ b/app/Rules/CampaignDelete.php @@ -15,7 +15,7 @@ class CampaignDelete implements ValidationRule */ public function validate(string $attribute, mixed $value, Closure $fail): void { - if(!Str::is(mb_strtolower($value), 'delete')) { + if (!Str::is(mb_strtolower($value), 'delete')) { $fail(__('validation.delete_campaign', ['code' => 'delete'])); } } diff --git a/app/Rules/EntityFileRule.php b/app/Rules/EntityFileRule.php index 77db3367e..e24a55af7 100644 --- a/app/Rules/EntityFileRule.php +++ b/app/Rules/EntityFileRule.php @@ -19,16 +19,16 @@ public function validate(string $attribute, mixed $value, Closure $fail): void if ($value instanceof UploadedFile && !$value->isValid()) { $fail(__('validation.mimes', ['values' => 'jpg, jpeg, png, gif, webp, pdf, xls(x), csv, mp3, ogg, json'])); } - + // Block any hacking shenanigans if ($this->shouldBlockPhpUpload($value, [])) { $fail(__('validation.mimes', ['values' => 'jpg, jpeg, png, gif, webp, pdf, xls(x), csv, mp3, ogg, json'])); } - + if (empty($value->getPath())) { $fail(__('validation.mimes', ['values' => 'jpg, jpeg, png, gif, webp, pdf, xls(x), csv, mp3, ogg, json'])); } - + $validExtensions = explode(',', 'jpeg,png,jpg,gif,webp,pdf,xls,xlsx,mp3'); if (!in_array($value->guessExtension(), $validExtensions)) { $fail(__('validation.mimes', ['values' => 'jpg, jpeg, png, gif, webp, pdf, xls(x), csv, mp3, ogg, json'])); diff --git a/app/Rules/EntityLink.php b/app/Rules/EntityLink.php index d76b21bb8..3389478af 100644 --- a/app/Rules/EntityLink.php +++ b/app/Rules/EntityLink.php @@ -89,10 +89,10 @@ public function validate(string $attribute, mixed $value, Closure $fail): void ->where('access', 1) ->where('action', CampaignPermission::ACTION_READ) ->first(); - + // We don't check for the public role have deny as a permission, this is good enough if (empty($permission)) { - $fail( __('validation.entity_link')); + $fail(__('validation.entity_link')); } } }