From 446e855b7403365086d7f5efe9463c837c524300 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 4 May 2025 12:11:25 +0200 Subject: [PATCH] Replace methods with safe variants. Let's see how this works out. --- .../Data/Export/ExportController.php | 1 + .../Requests/Data/Bulk/TransactionRequest.php | 2 +- app/Console/Commands/Export/ExportsData.php | 4 +- .../Commands/System/ForcesDecimalSize.php | 10 +- .../Commands/System/OutputsInstructions.php | 4 +- .../Commands/System/ScansAttachments.php | 8 +- .../Commands/System/VerifySecurityAlerts.php | 2 +- .../Upgrade/RemovesDatabaseDecryption.php | 2 +- .../Commands/Upgrade/UpgradesDatabase.php | 2 +- .../Upgrade/UpgradesRecurrenceMetaData.php | 2 +- .../Commands/Upgrade/UpgradesToGroups.php | 4 +- app/Exceptions/Handler.php | 8 +- app/Factory/PiggyBankFactory.php | 2 +- app/Factory/TransactionJournalFactory.php | 4 +- .../Events/VersionCheckEventHandler.php | 4 +- app/Helpers/Attachments/AttachmentHelper.php | 16 +- .../Collector/Extensions/MetaCollection.php | 56 +- app/Helpers/Collector/GroupCollector.php | 2 +- .../Webhook/Sha3SignatureGenerator.php | 2 +- .../Auth/ForgotPasswordController.php | 2 +- .../Controllers/Chart/AccountController.php | 6 +- app/Http/Controllers/Controller.php | 6 +- app/Http/Controllers/DebugController.php | 14 +- .../Controllers/Export/IndexController.php | 2 +- .../Controllers/Json/RecurrenceController.php | 2 +- .../Controllers/PreferencesController.php | 8 +- .../Controllers/System/InstallController.php | 4 +- .../Transaction/CreateController.php | 2 +- .../Transaction/EditController.php | 2 +- app/Http/Middleware/AcceptHeaders.php | 2 +- app/Http/Requests/ReportFormRequest.php | 4 +- app/Jobs/DownloadExchangeRates.php | 2 +- app/Jobs/MailError.php | 8 +- app/Mail/InvitationMail.php | 2 +- app/Models/AccountMeta.php | 4 +- app/Models/Configuration.php | 4 +- app/Models/TransactionJournalMeta.php | 4 +- app/Providers/AppServiceProvider.php | 2 +- .../Account/AccountRepository.php | 2 +- .../Currency/CurrencyRepository.php | 6 +- .../Recurring/RecurringRepository.php | 14 +- .../TransactionGroupRepository.php | 4 +- app/Repositories/User/UserRepository.php | 4 +- .../UserGroups/Account/AccountRepository.php | 2 +- .../Currency/CurrencyRepository.php | 6 +- app/Rules/IsValidBulkClause.php | 2 +- app/Rules/IsValidPositiveAmount.php | 2 +- app/Rules/UniqueAccountNumber.php | 2 +- .../FireflyIIIOrg/Update/UpdateRequest.php | 2 +- .../Internal/Support/JournalServiceTrait.php | 2 +- .../Support/RecurringTransactionTrait.php | 4 +- .../Webhook/StandardWebhookSender.php | 2 +- .../Authentication/RemoteUserGuard.php | 4 +- app/Support/CacheProperties.php | 2 +- app/Support/Cronjobs/UpdateCheckCronjob.php | 2 +- app/Support/Http/Controllers/CreateStuff.php | 4 +- .../Http/Controllers/RequestInformation.php | 2 +- app/Support/ParseDateString.php | 16 +- app/Support/Request/ConvertsDataTypes.php | 2 +- app/Support/Search/AccountSearch.php | 4 +- .../Search/QueryParser/GdbotsQueryParser.php | 2 +- app/Support/Steam.php | 8 +- app/Support/System/OAuthKeys.php | 8 +- app/Support/Twig/General.php | 6 +- app/Support/Twig/TransactionGroupTwig.php | 4 +- app/Transformers/RecurrenceTransformer.php | 2 +- .../WebhookMessageTransformer.php | 2 +- .../Bulk/ValidatesBulkTransactionQuery.php | 2 +- app/Validation/FireflyValidator.php | 6 +- composer.json | 6 +- composer.lock | 482 +++++++++++------- 71 files changed, 480 insertions(+), 353 deletions(-) diff --git a/app/Api/V1/Controllers/Data/Export/ExportController.php b/app/Api/V1/Controllers/Data/Export/ExportController.php index b4decbf49f..ad578e6f42 100644 --- a/app/Api/V1/Controllers/Data/Export/ExportController.php +++ b/app/Api/V1/Controllers/Data/Export/ExportController.php @@ -29,6 +29,7 @@ use FireflyIII\Api\V1\Requests\Data\Export\ExportRequest; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Support\Export\ExportDataGenerator; use Illuminate\Http\Response as LaravelResponse; +use function Safe\date; /** * Class ExportController diff --git a/app/Api/V1/Requests/Data/Bulk/TransactionRequest.php b/app/Api/V1/Requests/Data/Bulk/TransactionRequest.php index fb8f302f76..9bee14442d 100644 --- a/app/Api/V1/Requests/Data/Bulk/TransactionRequest.php +++ b/app/Api/V1/Requests/Data/Bulk/TransactionRequest.php @@ -48,7 +48,7 @@ class TransactionRequest extends FormRequest try { $data = [ - 'query' => json_decode($this->get('query'), true, 8, JSON_THROW_ON_ERROR), + 'query' => \Safe\json_decode($this->get('query'), true, 8, JSON_THROW_ON_ERROR), ]; } catch (\JsonException $e) { // dont really care. the validation should catch invalid json. diff --git a/app/Console/Commands/Export/ExportsData.php b/app/Console/Commands/Export/ExportsData.php index a4cc991d89..83fd906dc6 100644 --- a/app/Console/Commands/Export/ExportsData.php +++ b/app/Console/Commands/Export/ExportsData.php @@ -273,7 +273,7 @@ class ExportsData extends Command */ private function exportData(array $options, array $data): void { - $date = date('Y_m_d'); + $date = \Safe\date('Y_m_d'); foreach ($data as $key => $content) { $file = sprintf('%s%s_%s.csv', $options['directory'], $date, $key); if (false === $options['force'] && file_exists($file)) { @@ -283,7 +283,7 @@ class ExportsData extends Command $this->friendlyWarning(sprintf('File "%s" exists already but will be replaced.', $file)); } // continue to write to file. - file_put_contents($file, $content); + \Safe\file_put_contents($file, $content); $this->friendlyPositive(sprintf('Wrote %s-export to file "%s".', $key, $file)); } } diff --git a/app/Console/Commands/System/ForcesDecimalSize.php b/app/Console/Commands/System/ForcesDecimalSize.php index 66340b4c6c..eaec52cdfb 100644 --- a/app/Console/Commands/System/ForcesDecimalSize.php +++ b/app/Console/Commands/System/ForcesDecimalSize.php @@ -130,7 +130,7 @@ class ForcesDecimalSize extends Command // if sqlite, add function? if ('sqlite' === (string) config('database.default')) { DB::connection()->getPdo()->sqliteCreateFunction('REGEXP', static function ($pattern, $value) { - mb_regex_encoding('UTF-8'); + \Safe\mb_regex_encoding('UTF-8'); $pattern = trim($pattern, '"'); return (false !== mb_ereg($pattern, (string) $value)) ? 1 : 0; @@ -234,7 +234,7 @@ class ForcesDecimalSize extends Command /** @var Builder $query */ $query = Account::leftJoin('account_meta', 'accounts.id', '=', 'account_meta.account_id') ->where('account_meta.name', 'currency_id') - ->where('account_meta.data', json_encode((string) $currency->id)) + ->where('account_meta.data', \Safe\json_encode((string) $currency->id)) ; $query->where(static function (Builder $q) use ($fields, $currency, $operator, $cast, $regularExpression): void { foreach ($fields as $field) { @@ -338,7 +338,7 @@ class ForcesDecimalSize extends Command ->leftJoin('accounts', 'piggy_banks.account_id', '=', 'accounts.id') ->leftJoin('account_meta', 'accounts.id', '=', 'account_meta.account_id') ->where('account_meta.name', 'currency_id') - ->where('account_meta.data', json_encode((string) $currency->id)) + ->where('account_meta.data', \Safe\json_encode((string) $currency->id)) ->where(static function (Builder $q) use ($fields, $currency, $cast, $operator, $regularExpression): void { foreach ($fields as $field) { $q->orWhere( @@ -394,7 +394,7 @@ class ForcesDecimalSize extends Command ->leftJoin('accounts', 'piggy_banks.account_id', '=', 'accounts.id') ->leftJoin('account_meta', 'accounts.id', '=', 'account_meta.account_id') ->where('account_meta.name', 'currency_id') - ->where('account_meta.data', json_encode((string) $currency->id)) + ->where('account_meta.data', \Safe\json_encode((string) $currency->id)) ->where(static function (Builder $q) use ($fields, $currency, $operator, $cast, $regularExpression): void { foreach ($fields as $field) { $q->orWhere( @@ -448,7 +448,7 @@ class ForcesDecimalSize extends Command $query = PiggyBank::leftJoin('accounts', 'piggy_banks.account_id', '=', 'accounts.id') ->leftJoin('account_meta', 'accounts.id', '=', 'account_meta.account_id') ->where('account_meta.name', 'currency_id') - ->where('account_meta.data', json_encode((string) $currency->id)) + ->where('account_meta.data', \Safe\json_encode((string) $currency->id)) ->where(static function (Builder $q) use ($fields, $currency, $operator, $cast, $regularExpression): void { foreach ($fields as $field) { $q->orWhere( diff --git a/app/Console/Commands/System/OutputsInstructions.php b/app/Console/Commands/System/OutputsInstructions.php index 7842cf1ad6..e9cd25e5be 100644 --- a/app/Console/Commands/System/OutputsInstructions.php +++ b/app/Console/Commands/System/OutputsInstructions.php @@ -111,8 +111,8 @@ class OutputsInstructions extends Command */ private function showLogo(): void { - $today = date('m-d'); - $month = date('m'); + $today = \Safe\date('m-d'); + $month = \Safe\date('m'); // variation in colors and effects just because I can! // default is Ukraine flag: $colors = ['blue', 'blue', 'blue', 'yellow', 'yellow', 'yellow', 'default', 'default']; diff --git a/app/Console/Commands/System/ScansAttachments.php b/app/Console/Commands/System/ScansAttachments.php index b5fad33afa..001f2ec80c 100644 --- a/app/Console/Commands/System/ScansAttachments.php +++ b/app/Console/Commands/System/ScansAttachments.php @@ -63,15 +63,15 @@ class ScansAttachments extends Command app('log')->error(sprintf('Could not decrypt data of attachment #%d: %s', $attachment->id, $e->getMessage())); $decryptedContent = $encryptedContent; } - $tempFileName = tempnam(sys_get_temp_dir(), 'FireflyIII'); + $tempFileName = \Safe\tempnam(sys_get_temp_dir(), 'FireflyIII'); if (false === $tempFileName) { app('log')->error(sprintf('Could not create temporary file for attachment #%d', $attachment->id)); exit(1); } - file_put_contents($tempFileName, $decryptedContent); - $attachment->md5 = (string) md5_file($tempFileName); - $attachment->mime = (string) mime_content_type($tempFileName); + \Safe\file_put_contents($tempFileName, $decryptedContent); + $attachment->md5 = (string) \Safe\md5_file($tempFileName); + $attachment->mime = (string) \Safe\mime_content_type($tempFileName); $attachment->save(); $this->friendlyInfo(sprintf('Fixed attachment #%d', $attachment->id)); } diff --git a/app/Console/Commands/System/VerifySecurityAlerts.php b/app/Console/Commands/System/VerifySecurityAlerts.php index 894c73daa2..0cad167ccb 100644 --- a/app/Console/Commands/System/VerifySecurityAlerts.php +++ b/app/Console/Commands/System/VerifySecurityAlerts.php @@ -57,7 +57,7 @@ class VerifySecurityAlerts extends Command return 0; } $content = $disk->get('alerts.json'); - $json = json_decode($content, true, 10); + $json = \Safe\json_decode($content, true, 10); /** @var array $array */ foreach ($json as $array) { diff --git a/app/Console/Commands/Upgrade/RemovesDatabaseDecryption.php b/app/Console/Commands/Upgrade/RemovesDatabaseDecryption.php index 89a961925c..9bc4477888 100644 --- a/app/Console/Commands/Upgrade/RemovesDatabaseDecryption.php +++ b/app/Console/Commands/Upgrade/RemovesDatabaseDecryption.php @@ -167,7 +167,7 @@ class RemovesDatabaseDecryption extends Command { // try to json_decrypt the value. try { - $newValue = json_decode($value, true, 512, JSON_THROW_ON_ERROR) ?? $value; + $newValue = \Safe\json_decode($value, true, 512, JSON_THROW_ON_ERROR) ?? $value; } catch (\JsonException $e) { $message = sprintf('Could not JSON decode preference row #%d: %s. This does not have to be a problem.', $id, $e->getMessage()); $this->friendlyError($message); diff --git a/app/Console/Commands/Upgrade/UpgradesDatabase.php b/app/Console/Commands/Upgrade/UpgradesDatabase.php index b09c15f657..d30b32662a 100644 --- a/app/Console/Commands/Upgrade/UpgradesDatabase.php +++ b/app/Console/Commands/Upgrade/UpgradesDatabase.php @@ -24,7 +24,7 @@ declare(strict_types=1); namespace FireflyIII\Console\Commands\Upgrade; -set_time_limit(0); +\Safe\set_time_limit(0); use FireflyIII\Console\Commands\ShowsFriendlyMessages; use Illuminate\Console\Command; diff --git a/app/Console/Commands/Upgrade/UpgradesRecurrenceMetaData.php b/app/Console/Commands/Upgrade/UpgradesRecurrenceMetaData.php index d20f763945..39a715ced9 100644 --- a/app/Console/Commands/Upgrade/UpgradesRecurrenceMetaData.php +++ b/app/Console/Commands/Upgrade/UpgradesRecurrenceMetaData.php @@ -100,7 +100,7 @@ class UpgradesRecurrenceMetaData extends Command if ('tags' === $meta->name) { $array = explode(',', $meta->value); - $value = json_encode($array, JSON_THROW_ON_ERROR); + $value = \Safe\json_encode($array, JSON_THROW_ON_ERROR); } RecurrenceTransactionMeta::create( diff --git a/app/Console/Commands/Upgrade/UpgradesToGroups.php b/app/Console/Commands/Upgrade/UpgradesToGroups.php index d1c0625efe..f294db33a8 100644 --- a/app/Console/Commands/Upgrade/UpgradesToGroups.php +++ b/app/Console/Commands/Upgrade/UpgradesToGroups.php @@ -368,8 +368,8 @@ class UpgradesToGroups extends Command { $groupId = DB::table('transaction_groups')->insertGetId( [ - 'created_at' => date('Y-m-d H:i:s'), - 'updated_at' => date('Y-m-d H:i:s'), + 'created_at' => \Safe\date('Y-m-d H:i:s'), + 'updated_at' => \Safe\date('Y-m-d H:i:s'), 'title' => null, 'user_id' => $array['user_id'], ] diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 13fa54bc88..021d3513b9 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -224,7 +224,7 @@ class Handler extends ExceptionHandler $data = [ 'class' => get_class($e), 'errorMessage' => $e->getMessage(), - 'time' => date('r'), + 'time' => \Safe\date('r'), 'stackTrace' => $e->getTraceAsString(), 'file' => $e->getFile(), 'line' => $e->getLine(), @@ -235,7 +235,7 @@ class Handler extends ExceptionHandler 'json' => request()->acceptsJson(), 'method' => request()->method(), 'headers' => $headers, - 'post' => 'POST' === request()->method() ? json_encode(request()->all()) : '', + 'post' => 'POST' === request()->method() ? \Safe\json_encode(request()->all()) : '', ]; // create job that will mail. @@ -283,8 +283,8 @@ class Handler extends ExceptionHandler } $safe = route('index'); $previous = $exception->redirectTo; - $previousHost = parse_url($previous, PHP_URL_HOST); - $safeHost = parse_url($safe, PHP_URL_HOST); + $previousHost = \Safe\parse_url($previous, PHP_URL_HOST); + $safeHost = \Safe\parse_url($safe, PHP_URL_HOST); return null !== $previousHost && $previousHost === $safeHost ? $previous : $safe; } diff --git a/app/Factory/PiggyBankFactory.php b/app/Factory/PiggyBankFactory.php index 5c308c1d08..a6707e8b40 100644 --- a/app/Factory/PiggyBankFactory.php +++ b/app/Factory/PiggyBankFactory.php @@ -284,7 +284,7 @@ class PiggyBankFactory Log::debug(sprintf('Will link account #%d with info: ', $account->id), $toBeLinked[$account->id]); } } - Log::debug(sprintf('Link information: %s', json_encode($toBeLinked))); + Log::debug(sprintf('Link information: %s', \Safe\json_encode($toBeLinked))); if (0 !== count($toBeLinked)) { $piggyBank->accounts()->sync($toBeLinked); } diff --git a/app/Factory/TransactionJournalFactory.php b/app/Factory/TransactionJournalFactory.php index 67428dbc50..f2d716bbc4 100644 --- a/app/Factory/TransactionJournalFactory.php +++ b/app/Factory/TransactionJournalFactory.php @@ -315,7 +315,7 @@ class TransactionJournalFactory unset($dataRow['import_hash_v2'], $dataRow['original_source']); try { - $json = json_encode($dataRow, JSON_THROW_ON_ERROR); + $json = \Safe\json_encode($dataRow, JSON_THROW_ON_ERROR); } catch (\JsonException $e) { app('log')->error(sprintf('Could not encode dataRow: %s', $e->getMessage())); $json = microtime(); @@ -344,7 +344,7 @@ class TransactionJournalFactory ->leftJoin('transaction_journals', 'transaction_journals.id', '=', 'journal_meta.transaction_journal_id') ->whereNotNull('transaction_journals.id') ->where('transaction_journals.user_id', $this->user->id) - ->where('data', json_encode($hash, JSON_THROW_ON_ERROR)) + ->where('data', \Safe\json_encode($hash, JSON_THROW_ON_ERROR)) ->with(['transactionJournal', 'transactionJournal.transactionGroup']) ->first(['journal_meta.*']) ; diff --git a/app/Handlers/Events/VersionCheckEventHandler.php b/app/Handlers/Events/VersionCheckEventHandler.php index 75e313a313..3624250767 100644 --- a/app/Handlers/Events/VersionCheckEventHandler.php +++ b/app/Handlers/Events/VersionCheckEventHandler.php @@ -73,7 +73,7 @@ class VersionCheckEventHandler $diff = $now - $lastCheckTime->data; Log::debug(sprintf('Last check time is %d, current time is %d, difference is %d', $lastCheckTime->data, $now, $diff)); if ($diff < 604800) { - Log::debug(sprintf('Checked for updates less than a week ago (on %s).', date('Y-m-d H:i:s', $lastCheckTime->data))); + Log::debug(sprintf('Checked for updates less than a week ago (on %s).', \Safe\date('Y-m-d H:i:s', $lastCheckTime->data))); return; } @@ -105,7 +105,7 @@ class VersionCheckEventHandler $diff = $now - $lastCheckTime->data; Log::debug(sprintf('Last warning time is %d, current time is %d, difference is %d', $lastCheckTime->data, $now, $diff)); if ($diff < 604800 * 4) { - Log::debug(sprintf('Warned about updates less than four weeks ago (on %s).', date('Y-m-d H:i:s', $lastCheckTime->data))); + Log::debug(sprintf('Warned about updates less than four weeks ago (on %s).', \Safe\date('Y-m-d H:i:s', $lastCheckTime->data))); return; } diff --git a/app/Helpers/Attachments/AttachmentHelper.php b/app/Helpers/Attachments/AttachmentHelper.php index a4cbc352ba..42f7034bd3 100644 --- a/app/Helpers/Attachments/AttachmentHelper.php +++ b/app/Helpers/Attachments/AttachmentHelper.php @@ -118,7 +118,7 @@ class AttachmentHelper implements AttachmentHelperInterface public function saveAttachmentFromApi(Attachment $attachment, string $content): bool { Log::debug(sprintf('Now in %s', __METHOD__)); - $resource = tmpfile(); + $resource = \Safe\tmpfile(); if (false === $resource) { Log::error('Cannot create temp-file for file upload.'); @@ -133,17 +133,17 @@ class AttachmentHelper implements AttachmentHelperInterface $path = stream_get_meta_data($resource)['uri']; Log::debug(sprintf('Path is %s', $path)); - $result = fwrite($resource, $content); + $result = \Safe\fwrite($resource, $content); if (false === $result) { Log::error('Could not write temp file.'); return false; } Log::debug(sprintf('Wrote %d bytes to temp file.', $result)); - $finfo = finfo_open(FILEINFO_MIME_TYPE); + $finfo = \Safe\finfo_open(FILEINFO_MIME_TYPE); if (false === $finfo) { Log::error('Could not open finfo.'); - fclose($resource); + \Safe\fclose($resource); return false; } @@ -151,7 +151,7 @@ class AttachmentHelper implements AttachmentHelperInterface $allowedMime = config('firefly.allowedMimes'); if (!in_array($mime, $allowedMime, true)) { Log::error(sprintf('Mime type %s is not allowed for API file upload.', $mime)); - fclose($resource); + \Safe\fclose($resource); return false; } @@ -163,7 +163,7 @@ class AttachmentHelper implements AttachmentHelperInterface $this->uploadDisk->put($file, $content); // update attachment. - $attachment->md5 = (string) md5_file($path); + $attachment->md5 = (string) \Safe\md5_file($path); $attachment->mime = $mime; $attachment->size = strlen($content); $attachment->uploaded = true; @@ -225,7 +225,7 @@ class AttachmentHelper implements AttachmentHelperInterface $attachment = new Attachment(); // create Attachment object. $attachment->user()->associate($user); $attachment->attachable()->associate($model); - $attachment->md5 = (string) md5_file($file->getRealPath()); + $attachment->md5 = (string) \Safe\md5_file($file->getRealPath()); $attachment->filename = $file->getClientOriginalName(); $attachment->mime = $file->getMimeType(); $attachment->size = $file->getSize(); @@ -333,7 +333,7 @@ class AttachmentHelper implements AttachmentHelperInterface */ protected function hasFile(UploadedFile $file, Model $model): bool { - $md5 = md5_file($file->getRealPath()); + $md5 = \Safe\md5_file($file->getRealPath()); $name = $file->getClientOriginalName(); $class = get_class($model); $count = 0; diff --git a/app/Helpers/Collector/Extensions/MetaCollection.php b/app/Helpers/Collector/Extensions/MetaCollection.php index 1ce417a77d..f1cad62f17 100644 --- a/app/Helpers/Collector/Extensions/MetaCollection.php +++ b/app/Helpers/Collector/Extensions/MetaCollection.php @@ -166,7 +166,7 @@ trait MetaCollection { $this->joinMetaDataTables(); $this->query->where('journal_meta.name', '=', 'external_id'); - $this->query->where('journal_meta.data', '!=', sprintf('%s', json_encode($externalId))); + $this->query->where('journal_meta.data', '!=', sprintf('%s', \Safe\json_encode($externalId))); $this->query->whereNull('journal_meta.deleted_at'); return $this; @@ -189,14 +189,14 @@ trait MetaCollection { $this->joinMetaDataTables(); $this->query->where('journal_meta.name', '=', 'external_url'); - $this->query->where('journal_meta.data', '!=', json_encode($url)); + $this->query->where('journal_meta.data', '!=', \Safe\json_encode($url)); return $this; } public function excludeInternalReference(string $internalReference): GroupCollectorInterface { - $internalReference = (string) json_encode($internalReference); + $internalReference = (string) \Safe\json_encode($internalReference); $internalReference = str_replace('\\', '\\\\', trim($internalReference, '"')); $this->joinMetaDataTables(); @@ -210,14 +210,14 @@ trait MetaCollection { $this->joinMetaDataTables(); $this->query->where('journal_meta.name', '=', 'recurrence_id'); - $this->query->where('journal_meta.data', '!=', sprintf('%s', json_encode($recurringId))); + $this->query->where('journal_meta.data', '!=', sprintf('%s', \Safe\json_encode($recurringId))); return $this; } public function externalIdContains(string $externalId): GroupCollectorInterface { - $externalId = (string) json_encode($externalId); + $externalId = (string) \Safe\json_encode($externalId); $externalId = str_replace('\\', '\\\\', trim($externalId, '"')); $this->joinMetaDataTables(); @@ -229,7 +229,7 @@ trait MetaCollection public function externalIdDoesNotContain(string $externalId): GroupCollectorInterface { - $externalId = (string) json_encode($externalId); + $externalId = (string) \Safe\json_encode($externalId); $externalId = str_replace('\\', '\\\\', trim($externalId, '"')); $this->joinMetaDataTables(); @@ -241,7 +241,7 @@ trait MetaCollection public function externalIdDoesNotEnd(string $externalId): GroupCollectorInterface { - $externalId = (string) json_encode($externalId); + $externalId = (string) \Safe\json_encode($externalId); $externalId = str_replace('\\', '\\\\', trim($externalId, '"')); $this->joinMetaDataTables(); @@ -253,7 +253,7 @@ trait MetaCollection public function externalIdDoesNotStart(string $externalId): GroupCollectorInterface { - $externalId = (string) json_encode($externalId); + $externalId = (string) \Safe\json_encode($externalId); $externalId = str_replace('\\', '\\\\', trim($externalId, '"')); $this->joinMetaDataTables(); @@ -265,7 +265,7 @@ trait MetaCollection public function externalIdEnds(string $externalId): GroupCollectorInterface { - $externalId = (string) json_encode($externalId); + $externalId = (string) \Safe\json_encode($externalId); $externalId = str_replace('\\', '\\\\', trim($externalId, '"')); $this->joinMetaDataTables(); @@ -277,7 +277,7 @@ trait MetaCollection public function externalIdStarts(string $externalId): GroupCollectorInterface { - $externalId = (string) json_encode($externalId); + $externalId = (string) \Safe\json_encode($externalId); $externalId = str_replace('\\', '\\\\', trim($externalId, '"')); $this->joinMetaDataTables(); @@ -290,7 +290,7 @@ trait MetaCollection public function externalUrlContains(string $url): GroupCollectorInterface { $this->joinMetaDataTables(); - $url = (string) json_encode($url); + $url = (string) \Safe\json_encode($url); $url = str_replace('\\', '\\\\', trim($url, '"')); $this->query->where('journal_meta.name', '=', 'external_url'); $this->query->whereLike('journal_meta.data', sprintf('%%%s%%', $url)); @@ -301,7 +301,7 @@ trait MetaCollection public function externalUrlDoesNotContain(string $url): GroupCollectorInterface { $this->joinMetaDataTables(); - $url = (string) json_encode($url); + $url = (string) \Safe\json_encode($url); $url = str_replace('\\', '\\\\', trim($url, '"')); $this->query->where('journal_meta.name', '=', 'external_url'); $this->query->whereNotLike('journal_meta.data', sprintf('%%%s%%', $url)); @@ -312,7 +312,7 @@ trait MetaCollection public function externalUrlDoesNotEnd(string $url): GroupCollectorInterface { $this->joinMetaDataTables(); - $url = (string) json_encode($url); + $url = (string) \Safe\json_encode($url); $url = str_replace('\\', '\\\\', ltrim($url, '"')); $this->query->where('journal_meta.name', '=', 'external_url'); $this->query->whereNotLike('journal_meta.data', sprintf('%%%s', $url)); @@ -323,7 +323,7 @@ trait MetaCollection public function externalUrlDoesNotStart(string $url): GroupCollectorInterface { $this->joinMetaDataTables(); - $url = (string) json_encode($url); + $url = (string) \Safe\json_encode($url); $url = str_replace('\\', '\\\\', rtrim($url, '"')); // var_dump($url); @@ -336,7 +336,7 @@ trait MetaCollection public function externalUrlEnds(string $url): GroupCollectorInterface { $this->joinMetaDataTables(); - $url = (string) json_encode($url); + $url = (string) \Safe\json_encode($url); $url = str_replace('\\', '\\\\', ltrim($url, '"')); $this->query->where('journal_meta.name', '=', 'external_url'); $this->query->whereLike('journal_meta.data', sprintf('%%%s', $url)); @@ -347,7 +347,7 @@ trait MetaCollection public function externalUrlStarts(string $url): GroupCollectorInterface { $this->joinMetaDataTables(); - $url = (string) json_encode($url); + $url = (string) \Safe\json_encode($url); $url = str_replace('\\', '\\\\', rtrim($url, '"')); // var_dump($url); @@ -398,7 +398,7 @@ trait MetaCollection public function internalReferenceContains(string $internalReference): GroupCollectorInterface { - $internalReference = (string) json_encode($internalReference); + $internalReference = (string) \Safe\json_encode($internalReference); $internalReference = str_replace('\\', '\\\\', trim($internalReference, '"')); // var_dump($internalReference); // exit; @@ -413,7 +413,7 @@ trait MetaCollection public function internalReferenceDoesNotContain(string $internalReference): GroupCollectorInterface { - $internalReference = (string) json_encode($internalReference); + $internalReference = (string) \Safe\json_encode($internalReference); $internalReference = str_replace('\\', '\\\\', trim($internalReference, '"')); $this->joinMetaDataTables(); @@ -426,7 +426,7 @@ trait MetaCollection public function internalReferenceDoesNotEnd(string $internalReference): GroupCollectorInterface { - $internalReference = (string) json_encode($internalReference); + $internalReference = (string) \Safe\json_encode($internalReference); $internalReference = str_replace('\\', '\\\\', trim($internalReference, '"')); $this->joinMetaDataTables(); @@ -439,7 +439,7 @@ trait MetaCollection public function internalReferenceDoesNotStart(string $internalReference): GroupCollectorInterface { - $internalReference = (string) json_encode($internalReference); + $internalReference = (string) \Safe\json_encode($internalReference); $internalReference = str_replace('\\', '\\\\', trim($internalReference, '"')); $this->joinMetaDataTables(); @@ -452,7 +452,7 @@ trait MetaCollection public function internalReferenceEnds(string $internalReference): GroupCollectorInterface { - $internalReference = (string) json_encode($internalReference); + $internalReference = (string) \Safe\json_encode($internalReference); $internalReference = str_replace('\\', '\\\\', trim($internalReference, '"')); $this->joinMetaDataTables(); @@ -465,7 +465,7 @@ trait MetaCollection public function internalReferenceStarts(string $internalReference): GroupCollectorInterface { - $internalReference = (string) json_encode($internalReference); + $internalReference = (string) \Safe\json_encode($internalReference); $internalReference = str_replace('\\', '\\\\', trim($internalReference, '"')); $this->joinMetaDataTables(); @@ -703,7 +703,7 @@ trait MetaCollection { $this->joinMetaDataTables(); $this->query->where('journal_meta.name', '=', 'external_id'); - $this->query->where('journal_meta.data', '=', sprintf('%s', json_encode($externalId))); + $this->query->where('journal_meta.data', '=', sprintf('%s', \Safe\json_encode($externalId))); $this->query->whereNull('journal_meta.deleted_at'); return $this; @@ -713,7 +713,7 @@ trait MetaCollection { $this->joinMetaDataTables(); $this->query->where('journal_meta.name', '=', 'external_url'); - $this->query->where('journal_meta.data', '=', json_encode($url)); + $this->query->where('journal_meta.data', '=', \Safe\json_encode($url)); $this->query->whereNull('journal_meta.deleted_at'); return $this; @@ -721,12 +721,12 @@ trait MetaCollection public function setInternalReference(string $internalReference): GroupCollectorInterface { - $internalReference = (string) json_encode($internalReference); + $internalReference = (string) \Safe\json_encode($internalReference); $internalReference = str_replace('\\', '\\\\', trim($internalReference, '"')); $this->joinMetaDataTables(); $this->query->where('journal_meta.name', '=', 'internal_reference'); - $this->query->where('journal_meta.data', '=', sprintf('%s', json_encode($internalReference))); + $this->query->where('journal_meta.data', '=', sprintf('%s', \Safe\json_encode($internalReference))); $this->query->whereNull('journal_meta.deleted_at'); return $this; @@ -736,7 +736,7 @@ trait MetaCollection { $this->joinMetaDataTables(); $this->query->where('journal_meta.name', '=', 'recurrence_id'); - $this->query->where('journal_meta.data', '=', sprintf('%s', json_encode($recurringId))); + $this->query->where('journal_meta.data', '=', sprintf('%s', \Safe\json_encode($recurringId))); $this->query->whereNull('journal_meta.deleted_at'); return $this; @@ -746,7 +746,7 @@ trait MetaCollection { $this->joinMetaDataTables(); $this->query->where('journal_meta.name', '=', 'sepa_ct_id'); - $this->query->where('journal_meta.data', '=', sprintf('%s', json_encode($sepaCT))); + $this->query->where('journal_meta.data', '=', sprintf('%s', \Safe\json_encode($sepaCT))); $this->query->whereNull('journal_meta.deleted_at'); return $this; diff --git a/app/Helpers/Collector/GroupCollector.php b/app/Helpers/Collector/GroupCollector.php index 81eddda840..828da5f3a3 100644 --- a/app/Helpers/Collector/GroupCollector.php +++ b/app/Helpers/Collector/GroupCollector.php @@ -593,7 +593,7 @@ class GroupCollector implements GroupCollectorInterface if (array_key_exists('meta_name', $result) && in_array($result['meta_name'], $dates, true)) { $name = $result['meta_name']; if (array_key_exists('meta_data', $result) && '' !== (string) $result['meta_data']) { - $result[$name] = Carbon::createFromFormat('!Y-m-d', substr(json_decode($result['meta_data']), 0, 10)); + $result[$name] = Carbon::createFromFormat('!Y-m-d', substr(\Safe\json_decode($result['meta_data']), 0, 10)); } } diff --git a/app/Helpers/Webhook/Sha3SignatureGenerator.php b/app/Helpers/Webhook/Sha3SignatureGenerator.php index 4e13fac540..25aee00464 100644 --- a/app/Helpers/Webhook/Sha3SignatureGenerator.php +++ b/app/Helpers/Webhook/Sha3SignatureGenerator.php @@ -46,7 +46,7 @@ class Sha3SignatureGenerator implements SignatureGeneratorInterface $json = ''; try { - $json = json_encode($message->message, JSON_THROW_ON_ERROR); + $json = \Safe\json_encode($message->message, JSON_THROW_ON_ERROR); } catch (\JsonException $e) { app('log')->error('Could not generate hash.'); app('log')->error(sprintf('JSON value: %s', $json)); diff --git a/app/Http/Controllers/Auth/ForgotPasswordController.php b/app/Http/Controllers/Auth/ForgotPasswordController.php index de924f295b..56388c6d46 100644 --- a/app/Http/Controllers/Auth/ForgotPasswordController.php +++ b/app/Http/Controllers/Auth/ForgotPasswordController.php @@ -101,7 +101,7 @@ class ForgotPasswordController extends Controller */ private function validateHost(): void { - $configuredHost = parse_url((string) config('app.url'), PHP_URL_HOST); + $configuredHost = \Safe\parse_url((string) config('app.url'), PHP_URL_HOST); if (false === $configuredHost || null === $configuredHost) { throw new FireflyException('Please set a valid and correct Firefly III URL in the APP_URL environment variable.'); } diff --git a/app/Http/Controllers/Chart/AccountController.php b/app/Http/Controllers/Chart/AccountController.php index f8e2a847ed..dc4810aaed 100644 --- a/app/Http/Controllers/Chart/AccountController.php +++ b/app/Http/Controllers/Chart/AccountController.php @@ -469,14 +469,14 @@ class AccountController extends Controller Log::debug('Balances exist at:'); foreach ($range as $key => $value) { $newRange[] = ['date' => $key, 'info' => $value]; - Log::debug(sprintf('%d - %s (%s)', count($newRange) - 1, $key, json_encode($value))); + Log::debug(sprintf('%d - %s (%s)', count($newRange) - 1, $key, \Safe\json_encode($value))); } $carbon = Carbon::createFromFormat('Y-m-d', $newRange[0]['date'])->endOfDay(); Log::debug(sprintf('Start of loop, $carbon is %s', $carbon->format('Y-m-d H:i:s'))); while ($end->gte($current)) { $momentBalance = $previous; // $theDate = $current->format('Y-m-d'); - Log::debug(sprintf('Now at %s, with momentBalance %s', $current->format('Y-m-d H:i:s'), json_encode($momentBalance))); + Log::debug(sprintf('Now at %s, with momentBalance %s', $current->format('Y-m-d H:i:s'), \Safe\json_encode($momentBalance))); // loop over the array with balances, find one that is earlier or on the same day. while ($carbon->lte($current) && array_key_exists($expectedIndex, $newRange)) { @@ -491,7 +491,7 @@ class AccountController extends Controller $carbon = Carbon::createFromFormat('Y-m-d', $newRange[$expectedIndex]['date'])->endOfDay(); } } - Log::debug(sprintf('momentBalance is now %s', json_encode($momentBalance))); + Log::debug(sprintf('momentBalance is now %s', \Safe\json_encode($momentBalance))); $return = $this->updateChartKeys($return, $momentBalance); $previous = $momentBalance; diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php index e64530ebcf..ca4b5728be 100644 --- a/app/Http/Controllers/Controller.php +++ b/app/Http/Controllers/Controller.php @@ -81,15 +81,15 @@ abstract class Controller extends BaseController // overrule v2 layout back to v1. if ('true' === request()->get('force_default_layout') && 'v2' === config('view.layout')) { - View::getFinder()->setPaths([realpath(base_path('resources/views'))]); // @phpstan-ignore-line + View::getFinder()->setPaths([\Safe\realpath(base_path('resources/views'))]); // @phpstan-ignore-line } View::share('authGuard', $authGuard); View::share('logoutUrl', $logoutUrl); // upload size - $maxFileSize = Steam::phpBytes((string) ini_get('upload_max_filesize')); - $maxPostSize = Steam::phpBytes((string) ini_get('post_max_size')); + $maxFileSize = Steam::phpBytes((string) \Safe\ini_get('upload_max_filesize')); + $maxPostSize = Steam::phpBytes((string) \Safe\ini_get('post_max_size')); $uploadSize = min($maxFileSize, $maxPostSize); View::share('uploadSize', $uploadSize); diff --git a/app/Http/Controllers/DebugController.php b/app/Http/Controllers/DebugController.php index a4d93201c0..62ba16aa7f 100644 --- a/app/Http/Controllers/DebugController.php +++ b/app/Http/Controllers/DebugController.php @@ -242,7 +242,7 @@ class DebugController extends Controller if ($handler instanceof RotatingFileHandler) { $logFile = $handler->getUrl(); if (null !== $logFile && file_exists($logFile)) { - $logContent = file_get_contents($logFile); + $logContent = \Safe\file_get_contents($logFile); } } } @@ -267,8 +267,8 @@ class DebugController extends Controller private function getSystemInformation(): array { - $maxFileSize = Steam::phpBytes((string) ini_get('upload_max_filesize')); - $maxPostSize = Steam::phpBytes((string) ini_get('post_max_size')); + $maxFileSize = Steam::phpBytes((string) \Safe\ini_get('upload_max_filesize')); + $maxPostSize = Steam::phpBytes((string) \Safe\ini_get('post_max_size')); $drivers = DB::availableDrivers(); $currentDriver = DB::getDriverName(); @@ -280,8 +280,8 @@ class DebugController extends Controller 'interface' => \PHP_SAPI, 'bits' => \PHP_INT_SIZE * 8, 'bcscale' => bcscale(), - 'display_errors' => ini_get('display_errors'), - 'error_reporting' => $this->errorReporting((int) ini_get('error_reporting')), + 'display_errors' => \Safe\ini_get('display_errors'), + 'error_reporting' => $this->errorReporting((int) \Safe\ini_get('error_reporting')), 'upload_size' => min($maxFileSize, $maxPostSize), 'all_drivers' => $drivers, 'current_driver' => $currentDriver, @@ -300,7 +300,7 @@ class DebugController extends Controller try { if (file_exists('/var/www/counter-main.txt')) { - $return['build'] = trim((string) file_get_contents('/var/www/counter-main.txt')); + $return['build'] = trim((string) \Safe\file_get_contents('/var/www/counter-main.txt')); app('log')->debug(sprintf('build is now "%s"', $return['build'])); } } catch (\Exception $e) { @@ -310,7 +310,7 @@ class DebugController extends Controller try { if (file_exists('/var/www/build-date-main.txt')) { - $return['build_date'] = trim((string) file_get_contents('/var/www/build-date-main.txt')); + $return['build_date'] = trim((string) \Safe\file_get_contents('/var/www/build-date-main.txt')); } } catch (\Exception $e) { app('log')->debug('Could not check build date, but thats ok.'); diff --git a/app/Http/Controllers/Export/IndexController.php b/app/Http/Controllers/Export/IndexController.php index 8ab072fb12..8fbadde074 100644 --- a/app/Http/Controllers/Export/IndexController.php +++ b/app/Http/Controllers/Export/IndexController.php @@ -91,7 +91,7 @@ class IndexController extends Controller $generator->setStart($firstDate); $result = $generator->export(); - $name = sprintf('%s_transaction_export.csv', date('Y_m_d')); + $name = sprintf('%s_transaction_export.csv', \Safe\date('Y_m_d')); $quoted = sprintf('"%s"', addcslashes($name, '"\\')); // headers for CSV file. diff --git a/app/Http/Controllers/Json/RecurrenceController.php b/app/Http/Controllers/Json/RecurrenceController.php index 10fdb61b67..d4685e5a30 100644 --- a/app/Http/Controllers/Json/RecurrenceController.php +++ b/app/Http/Controllers/Json/RecurrenceController.php @@ -153,7 +153,7 @@ class RecurrenceController extends Controller */ public function suggest(Request $request): JsonResponse { - $string = '' === (string) $request->get('date') ? date('Y-m-d') : (string) $request->get('date'); + $string = '' === (string) $request->get('date') ? \Safe\date('Y-m-d') : (string) $request->get('date'); $today = today(config('app.timezone'))->startOfDay(); try { diff --git a/app/Http/Controllers/PreferencesController.php b/app/Http/Controllers/PreferencesController.php index bf8b12af22..e5561ccb10 100644 --- a/app/Http/Controllers/PreferencesController.php +++ b/app/Http/Controllers/PreferencesController.php @@ -110,7 +110,7 @@ class PreferencesController extends Controller if (is_array($fiscalYearStartStr)) { $fiscalYearStartStr = '01-01'; } - $fiscalYearStart = sprintf('%s-%s', date('Y'), (string) $fiscalYearStartStr); + $fiscalYearStart = sprintf('%s-%s', \Safe\date('Y'), (string) $fiscalYearStartStr); $tjOptionalFields = Preferences::get('transaction_journal_optional_fields', [])->data; $availableDarkModes = config('firefly.available_dark_modes'); @@ -149,7 +149,7 @@ class PreferencesController extends Controller // list of locales also has "equal" which makes it equal to whatever the language is. try { - $locales = json_decode((string) file_get_contents(resource_path(sprintf('locales/%s/locales.json', $language))), true, 512, JSON_THROW_ON_ERROR); + $locales = \Safe\json_decode((string) \Safe\file_get_contents(resource_path(sprintf('locales/%s/locales.json', $language))), true, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $e) { app('log')->error($e->getMessage()); $locales = []; @@ -271,9 +271,9 @@ class PreferencesController extends Controller // custom fiscal year $customFiscalYear = 1 === (int) $request->get('customFiscalYear'); - $string = strtotime((string) $request->get('fiscalYearStart')); + $string = \Safe\strtotime((string) $request->get('fiscalYearStart')); if (false !== $string) { - $fiscalYearStart = date('m-d', $string); + $fiscalYearStart = \Safe\date('m-d', $string); Preferences::set('customFiscalYear', $customFiscalYear); Preferences::set('fiscalYearStart', $fiscalYearStart); } diff --git a/app/Http/Controllers/System/InstallController.php b/app/Http/Controllers/System/InstallController.php index df765dc6fb..6a851d43a1 100644 --- a/app/Http/Controllers/System/InstallController.php +++ b/app/Http/Controllers/System/InstallController.php @@ -169,7 +169,7 @@ class InstallController extends Controller return; } - file_put_contents($publicKey, (string) $key->getPublicKey()); - file_put_contents($privateKey, $key->toString('PKCS1')); + \Safe\file_put_contents($publicKey, (string) $key->getPublicKey()); + \Safe\file_put_contents($privateKey, $key->toString('PKCS1')); } } diff --git a/app/Http/Controllers/Transaction/CreateController.php b/app/Http/Controllers/Transaction/CreateController.php index fad87c640a..d306b18c78 100644 --- a/app/Http/Controllers/Transaction/CreateController.php +++ b/app/Http/Controllers/Transaction/CreateController.php @@ -116,7 +116,7 @@ class CreateController extends Controller $accountToTypes = config('firefly.account_to_transaction'); $defaultCurrency = $this->defaultCurrency; $previousUrl = $this->rememberPreviousUrl('transactions.create.url'); - $parts = parse_url($previousUrl); + $parts = \Safe\parse_url($previousUrl); $search = sprintf('?%s', $parts['query'] ?? ''); $previousUrl = str_replace($search, '', $previousUrl); if (!is_array($optionalFields)) { diff --git a/app/Http/Controllers/Transaction/EditController.php b/app/Http/Controllers/Transaction/EditController.php index c638deb7c8..1bf0ef9c9f 100644 --- a/app/Http/Controllers/Transaction/EditController.php +++ b/app/Http/Controllers/Transaction/EditController.php @@ -85,7 +85,7 @@ class EditController extends Controller $defaultCurrency = $this->defaultCurrency; $cash = $repository->getCashAccount(); $previousUrl = $this->rememberPreviousUrl('transactions.edit.url'); - $parts = parse_url($previousUrl); + $parts = \Safe\parse_url($previousUrl); $search = sprintf('?%s', $parts['query'] ?? ''); $previousUrl = str_replace($search, '', $previousUrl); diff --git a/app/Http/Middleware/AcceptHeaders.php b/app/Http/Middleware/AcceptHeaders.php index 54c9d1f643..cb3745b904 100644 --- a/app/Http/Middleware/AcceptHeaders.php +++ b/app/Http/Middleware/AcceptHeaders.php @@ -71,7 +71,7 @@ class AcceptHeaders // throw bad request if trace id is not a UUID $uuid = $request->header('X-Trace-Id'); - if (is_string($uuid) && '' !== trim($uuid) && (1 !== preg_match('/^[a-f\d]{8}(-[a-f\d]{4}){4}[a-f\d]{8}$/i', trim($uuid)))) { + if (is_string($uuid) && '' !== trim($uuid) && (1 !== \Safe\preg_match('/^[a-f\d]{8}(-[a-f\d]{4}){4}[a-f\d]{8}$/i', trim($uuid)))) { throw new BadRequestHttpException('Bad X-Trace-Id header.'); } diff --git a/app/Http/Requests/ReportFormRequest.php b/app/Http/Requests/ReportFormRequest.php index da6c5e4417..250d520122 100644 --- a/app/Http/Requests/ReportFormRequest.php +++ b/app/Http/Requests/ReportFormRequest.php @@ -143,7 +143,7 @@ class ReportFormRequest extends FormRequest // validate as date // if regex for YYYY-MM-DD: $pattern = '/^(19|20)\d\d-(0[1-9]|1[012])-(0[1-9]|[12][\d]|3[01])$/'; - $result = preg_match($pattern, $string); + $result = \Safe\preg_match($pattern, $string); if (false !== $result && 0 !== $result) { try { $date = new Carbon($parts[1]); @@ -181,7 +181,7 @@ class ReportFormRequest extends FormRequest // validate as date // if regex for YYYY-MM-DD: $pattern = '/^(19|20)\d\d-(0[1-9]|1[012])-(0[1-9]|[12][\d]|3[01])$/'; - $result = preg_match($pattern, $string); + $result = \Safe\preg_match($pattern, $string); if (false !== $result && 0 !== $result) { try { $date = new Carbon($parts[0]); diff --git a/app/Jobs/DownloadExchangeRates.php b/app/Jobs/DownloadExchangeRates.php index 5ba8d7f998..bc17d08316 100644 --- a/app/Jobs/DownloadExchangeRates.php +++ b/app/Jobs/DownloadExchangeRates.php @@ -113,7 +113,7 @@ class DownloadExchangeRates implements ShouldQueue return; } $body = (string) $res->getBody(); - $json = json_decode($body, true); + $json = \Safe\json_decode($body, true); if (false === $json || null === $json) { app('log')->warning(sprintf('Trying to grab "%s" resulted in bad JSON.', $url)); diff --git a/app/Jobs/MailError.php b/app/Jobs/MailError.php index 72e45fa30e..21984409af 100644 --- a/app/Jobs/MailError.php +++ b/app/Jobs/MailError.php @@ -55,7 +55,7 @@ class MailError extends Job implements ShouldQueue $debug = $exceptionData; unset($debug['stackTrace'], $debug['headers']); - app('log')->error(sprintf('Exception is: %s', json_encode($debug))); + app('log')->error(sprintf('Exception is: %s', \Safe\json_encode($debug))); } /** @@ -126,11 +126,11 @@ class MailError extends Job implements ShouldQueue if (!file_exists($file)) { Log::debug(sprintf('Wrote new file in "%s"', $file)); - file_put_contents($file, json_encode($limits, JSON_PRETTY_PRINT)); + \Safe\file_put_contents($file, \Safe\json_encode($limits, JSON_PRETTY_PRINT)); } if (file_exists($file)) { Log::debug(sprintf('Read file in "%s"', $file)); - $limits = json_decode((string) file_get_contents($file), true); + $limits = \Safe\json_decode((string) \Safe\file_get_contents($file), true); } // limit reached? foreach ($types as $type => $info) { @@ -158,7 +158,7 @@ class MailError extends Job implements ShouldQueue } ++$limits[$type]['sent']; } - file_put_contents($file, json_encode($limits, JSON_PRETTY_PRINT)); + \Safe\file_put_contents($file, \Safe\json_encode($limits, JSON_PRETTY_PRINT)); Log::debug('No limits reached, return FALSE.'); return false; diff --git a/app/Mail/InvitationMail.php b/app/Mail/InvitationMail.php index 36bae2e7bb..8a368d9a25 100644 --- a/app/Mail/InvitationMail.php +++ b/app/Mail/InvitationMail.php @@ -49,7 +49,7 @@ class InvitationMail extends Mailable $this->invitee = $invitee; $this->admin = $admin; $this->url = $url; - $this->host = (string) parse_url($url, PHP_URL_HOST); + $this->host = (string) \Safe\parse_url($url, PHP_URL_HOST); } /** diff --git a/app/Models/AccountMeta.php b/app/Models/AccountMeta.php index fa3b58a5b6..baefb2f9b7 100644 --- a/app/Models/AccountMeta.php +++ b/app/Models/AccountMeta.php @@ -47,11 +47,11 @@ class AccountMeta extends Model public function getDataAttribute(mixed $value): string { - return (string) json_decode($value, true); + return (string) \Safe\json_decode($value, true); } public function setDataAttribute(mixed $value): void { - $this->attributes['data'] = json_encode($value); + $this->attributes['data'] = \Safe\json_encode($value); } } diff --git a/app/Models/Configuration.php b/app/Models/Configuration.php index a6a137e975..93abb2cfc1 100644 --- a/app/Models/Configuration.php +++ b/app/Models/Configuration.php @@ -50,7 +50,7 @@ class Configuration extends Model */ public function getDataAttribute($value) { - return json_decode($value); + return \Safe\json_decode($value); } /** @@ -58,6 +58,6 @@ class Configuration extends Model */ public function setDataAttribute($value): void { - $this->attributes['data'] = json_encode($value); + $this->attributes['data'] = \Safe\json_encode($value); } } diff --git a/app/Models/TransactionJournalMeta.php b/app/Models/TransactionJournalMeta.php index 09ac979206..00e2aae961 100644 --- a/app/Models/TransactionJournalMeta.php +++ b/app/Models/TransactionJournalMeta.php @@ -52,7 +52,7 @@ class TransactionJournalMeta extends Model */ public function getDataAttribute($value) { - return json_decode($value, false); + return \Safe\json_decode($value, false); } /** @@ -60,7 +60,7 @@ class TransactionJournalMeta extends Model */ public function setDataAttribute($value): void { - $data = json_encode($value); + $data = \Safe\json_encode($value); $this->attributes['data'] = $data; $this->attributes['hash'] = hash('sha256', (string) $data); } diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index ca3b82710a..32d30664a8 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -46,7 +46,7 @@ class AppServiceProvider extends ServiceProvider 'Cache-Control' => 'no-store', ]; $uuid = (string) request()->header('X-Trace-Id'); - if ('' !== trim($uuid) && (1 === preg_match('/^[a-f\d]{8}(-[a-f\d]{4}){4}[a-f\d]{8}$/i', trim($uuid)))) { + if ('' !== trim($uuid) && (1 === \Safe\preg_match('/^[a-f\d]{8}(-[a-f\d]{4}){4}[a-f\d]{8}$/i', trim($uuid)))) { $headers['X-Trace-Id'] = $uuid; } diff --git a/app/Repositories/Account/AccountRepository.php b/app/Repositories/Account/AccountRepository.php index 3f97289ee6..ae6b6f3a1f 100644 --- a/app/Repositories/Account/AccountRepository.php +++ b/app/Repositories/Account/AccountRepository.php @@ -108,7 +108,7 @@ class AccountRepository implements AccountRepositoryInterface, UserGroupInterfac ->where('accounts.active', true) ->where( static function (EloquentBuilder $q1) use ($number): void { - $json = json_encode($number); + $json = \Safe\json_encode($number); $q1->where('account_meta.name', '=', 'account_number'); $q1->where('account_meta.data', '=', $json); } diff --git a/app/Repositories/Currency/CurrencyRepository.php b/app/Repositories/Currency/CurrencyRepository.php index 3100f2d809..f6c00d39a4 100644 --- a/app/Repositories/Currency/CurrencyRepository.php +++ b/app/Repositories/Currency/CurrencyRepository.php @@ -81,7 +81,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface, UserGroupInterf } // is being used in accounts: - $meta = AccountMeta::where('name', 'currency_id')->where('data', json_encode((string) $currency->id))->count(); + $meta = AccountMeta::where('name', 'currency_id')->where('data', \Safe\json_encode((string) $currency->id))->count(); if ($meta > 0) { app('log')->info(sprintf('Used in %d accounts as currency_id, return true. ', $meta)); @@ -89,7 +89,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface, UserGroupInterf } // second search using integer check. - $meta = AccountMeta::where('name', 'currency_id')->where('data', json_encode((int) $currency->id))->count(); + $meta = AccountMeta::where('name', 'currency_id')->where('data', \Safe\json_encode((int) $currency->id))->count(); if ($meta > 0) { app('log')->info(sprintf('Used in %d accounts as currency_id, return true. ', $meta)); @@ -117,7 +117,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface, UserGroupInterf // is being used in accounts (as integer) $meta = AccountMeta::leftJoin('accounts', 'accounts.id', '=', 'account_meta.account_id') ->whereNull('accounts.deleted_at') - ->where('account_meta.name', 'currency_id')->where('account_meta.data', json_encode($currency->id))->count() + ->where('account_meta.name', 'currency_id')->where('account_meta.data', \Safe\json_encode($currency->id))->count() ; if ($meta > 0) { app('log')->info(sprintf('Used in %d accounts as currency_id, return true. ', $meta)); diff --git a/app/Repositories/Recurring/RecurringRepository.php b/app/Repositories/Recurring/RecurringRepository.php index bbbac73933..689e1ace72 100644 --- a/app/Repositories/Recurring/RecurringRepository.php +++ b/app/Repositories/Recurring/RecurringRepository.php @@ -68,16 +68,16 @@ class RecurringRepository implements RecurringRepositoryInterface, UserGroupInte $set = TransactionJournalMeta::where(static function (Builder $q1) use ($recurrence): void { $q1->where('name', 'recurrence_id'); - $q1->where('data', json_encode((string) $recurrence->id)); + $q1->where('data', \Safe\json_encode((string) $recurrence->id)); })->get(['journal_meta.transaction_journal_id']); // there are X journals made for this recurrence. Any of them meant for today? foreach ($set as $journalMeta) { $count = TransactionJournalMeta::where(static function (Builder $q2) use ($date): void { $string = (string) $date; - app('log')->debug(sprintf('Search for date: %s', json_encode($string))); + app('log')->debug(sprintf('Search for date: %s', \Safe\json_encode($string))); $q2->where('name', 'recurrence_date'); - $q2->where('data', json_encode($string)); + $q2->where('data', \Safe\json_encode($string)); }) ->where('transaction_journal_id', $journalMeta->transaction_journal_id) ->count() @@ -232,7 +232,7 @@ class RecurringRepository implements RecurringRepositoryInterface, UserGroupInte return TransactionJournalMeta::leftJoin('transaction_journals', 'transaction_journals.id', '=', 'journal_meta.transaction_journal_id') ->where('transaction_journals.user_id', $this->user->id) ->where('journal_meta.name', '=', 'recurrence_id') - ->where('journal_meta.data', '=', json_encode((string) $recurrence->id)) + ->where('journal_meta.data', '=', \Safe\json_encode((string) $recurrence->id)) ->get(['journal_meta.transaction_journal_id'])->pluck('transaction_journal_id')->toArray() ; } @@ -272,7 +272,7 @@ class RecurringRepository implements RecurringRepositoryInterface, UserGroupInte /** @var RecurrenceMeta $meta */ foreach ($transaction->recurrenceTransactionMeta as $meta) { if ('tags' === $meta->name && '' !== $meta->value) { - $tags = json_decode($meta->value, true, 512, JSON_THROW_ON_ERROR); + $tags = \Safe\json_decode($meta->value, true, 512, JSON_THROW_ON_ERROR); } } @@ -285,7 +285,7 @@ class RecurringRepository implements RecurringRepositoryInterface, UserGroupInte ->whereNull('transaction_journals.deleted_at') ->where('transaction_journals.user_id', $this->user->id) ->where('name', 'recurrence_id') - ->where('data', json_encode((string) $recurrence->id)) + ->where('data', \Safe\json_encode((string) $recurrence->id)) ->get()->pluck('transaction_journal_id')->toArray() ; $search = []; @@ -311,7 +311,7 @@ class RecurringRepository implements RecurringRepositoryInterface, UserGroupInte ->whereNull('transaction_journals.deleted_at') ->where('transaction_journals.user_id', $this->user->id) ->where('name', 'recurrence_id') - ->where('data', json_encode((string) $recurrence->id)) + ->where('data', \Safe\json_encode((string) $recurrence->id)) ->get()->pluck('transaction_journal_id')->toArray() ; $search = []; diff --git a/app/Repositories/TransactionGroup/TransactionGroupRepository.php b/app/Repositories/TransactionGroup/TransactionGroupRepository.php index 97a5b7f48c..50eddb7fd6 100644 --- a/app/Repositories/TransactionGroup/TransactionGroupRepository.php +++ b/app/Repositories/TransactionGroup/TransactionGroupRepository.php @@ -304,7 +304,7 @@ class TransactionGroupRepository implements TransactionGroupRepositoryInterface, $return = []; foreach ($query as $row) { - $return[$row->name] = new Carbon(json_decode($row->data, true, 512, JSON_THROW_ON_ERROR)); + $return[$row->name] = new Carbon(\Safe\json_decode($row->data, true, 512, JSON_THROW_ON_ERROR)); } return new NullArrayObject($return); @@ -324,7 +324,7 @@ class TransactionGroupRepository implements TransactionGroupRepositoryInterface, $return = []; foreach ($query as $row) { - $return[$row->name] = json_decode($row->data); + $return[$row->name] = \Safe\json_decode($row->data); } return new NullArrayObject($return); diff --git a/app/Repositories/User/UserRepository.php b/app/Repositories/User/UserRepository.php index 9abc8554a3..5de94de9bd 100644 --- a/app/Repositories/User/UserRepository.php +++ b/app/Repositories/User/UserRepository.php @@ -54,7 +54,7 @@ class UserRepository implements UserRepositoryInterface // save old email as pref app('preferences')->setForUser($user, 'previous_email_latest', $oldEmail); - app('preferences')->setForUser($user, 'previous_email_'.date('Y-m-d-H-i-s'), $oldEmail); + app('preferences')->setForUser($user, 'previous_email_'.\Safe\date('Y-m-d-H-i-s'), $oldEmail); // set undo and confirm token: app('preferences')->setForUser($user, 'email_change_undo_token', bin2hex(random_bytes(16))); @@ -389,7 +389,7 @@ class UserRepository implements UserRepositoryInterface // save old email as pref app('preferences')->setForUser($user, 'admin_previous_email_latest', $oldEmail); - app('preferences')->setForUser($user, 'admin_previous_email_'.date('Y-m-d-H-i-s'), $oldEmail); + app('preferences')->setForUser($user, 'admin_previous_email_'.\Safe\date('Y-m-d-H-i-s'), $oldEmail); $user->email = $newEmail; $user->save(); diff --git a/app/Repositories/UserGroups/Account/AccountRepository.php b/app/Repositories/UserGroups/Account/AccountRepository.php index 97877aeb3e..37b0c24859 100644 --- a/app/Repositories/UserGroups/Account/AccountRepository.php +++ b/app/Repositories/UserGroups/Account/AccountRepository.php @@ -66,7 +66,7 @@ class AccountRepository implements AccountRepositoryInterface ->where('accounts.active', true) ->where( static function (EloquentBuilder $q1) use ($number): void { - $json = json_encode($number); + $json = \Safe\json_encode($number); $q1->where('account_meta.name', '=', 'account_number'); $q1->where('account_meta.data', '=', $json); } diff --git a/app/Repositories/UserGroups/Currency/CurrencyRepository.php b/app/Repositories/UserGroups/Currency/CurrencyRepository.php index 73bce5a06b..d935fe6502 100644 --- a/app/Repositories/UserGroups/Currency/CurrencyRepository.php +++ b/app/Repositories/UserGroups/Currency/CurrencyRepository.php @@ -81,7 +81,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface } // is being used in accounts: - $meta = AccountMeta::where('name', 'currency_id')->where('data', json_encode((string) $currency->id))->count(); + $meta = AccountMeta::where('name', 'currency_id')->where('data', \Safe\json_encode((string) $currency->id))->count(); if ($meta > 0) { app('log')->info(sprintf('Used in %d accounts as currency_id, return true. ', $meta)); @@ -89,7 +89,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface } // second search using integer check. - $meta = AccountMeta::where('name', 'currency_id')->where('data', json_encode((int) $currency->id))->count(); + $meta = AccountMeta::where('name', 'currency_id')->where('data', \Safe\json_encode((int) $currency->id))->count(); if ($meta > 0) { app('log')->info(sprintf('Used in %d accounts as currency_id, return true. ', $meta)); @@ -117,7 +117,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface // is being used in accounts (as integer) $meta = AccountMeta::leftJoin('accounts', 'accounts.id', '=', 'account_meta.account_id') ->whereNull('accounts.deleted_at') - ->where('account_meta.name', 'currency_id')->where('account_meta.data', json_encode($currency->id))->count() + ->where('account_meta.name', 'currency_id')->where('account_meta.data', \Safe\json_encode($currency->id))->count() ; if ($meta > 0) { app('log')->info(sprintf('Used in %d accounts as currency_id, return true. ', $meta)); diff --git a/app/Rules/IsValidBulkClause.php b/app/Rules/IsValidBulkClause.php index 30d108edd1..7487a8ba41 100644 --- a/app/Rules/IsValidBulkClause.php +++ b/app/Rules/IsValidBulkClause.php @@ -63,7 +63,7 @@ class IsValidBulkClause implements ValidationRule private function basicValidation(string $value): bool { try { - $array = json_decode($value, true, 8, JSON_THROW_ON_ERROR); + $array = \Safe\json_decode($value, true, 8, JSON_THROW_ON_ERROR); } catch (\JsonException $e) { $this->error = (string) trans('validation.json'); diff --git a/app/Rules/IsValidPositiveAmount.php b/app/Rules/IsValidPositiveAmount.php index 89d7ada4a6..5f3cc94f66 100644 --- a/app/Rules/IsValidPositiveAmount.php +++ b/app/Rules/IsValidPositiveAmount.php @@ -40,7 +40,7 @@ class IsValidPositiveAmount implements ValidationRule { if (is_array($value)) { $fail('validation.numeric')->translate(); - $message = sprintf('IsValidPositiveAmount: "%s" is not a number.', json_encode($value)); + $message = sprintf('IsValidPositiveAmount: "%s" is not a number.', \Safe\json_encode($value)); Log::debug($message); Log::channel('audit')->info($message); diff --git a/app/Rules/UniqueAccountNumber.php b/app/Rules/UniqueAccountNumber.php index 7e2bc5d24c..921f78ae33 100644 --- a/app/Rules/UniqueAccountNumber.php +++ b/app/Rules/UniqueAccountNumber.php @@ -138,7 +138,7 @@ class UniqueAccountNumber implements ValidationRule ->where('accounts.user_id', auth()->user()->id) ->where('account_types.type', $type) ->where('account_meta.name', '=', 'account_number') - ->where('account_meta.data', json_encode($accountNumber)) + ->where('account_meta.data', \Safe\json_encode($accountNumber)) ; if (null !== $this->account) { diff --git a/app/Services/FireflyIIIOrg/Update/UpdateRequest.php b/app/Services/FireflyIIIOrg/Update/UpdateRequest.php index b6321dd852..a72e1f35cb 100644 --- a/app/Services/FireflyIIIOrg/Update/UpdateRequest.php +++ b/app/Services/FireflyIIIOrg/Update/UpdateRequest.php @@ -99,7 +99,7 @@ class UpdateRequest implements UpdateRequestInterface $body = (string) $res->getBody(); try { - $json = json_decode($body, true, 512, JSON_THROW_ON_ERROR); + $json = \Safe\json_decode($body, true, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $e) { Log::error('Body is not valid JSON'); Log::error($body); diff --git a/app/Services/Internal/Support/JournalServiceTrait.php b/app/Services/Internal/Support/JournalServiceTrait.php index 9a87b5aa75..f4e27a24de 100644 --- a/app/Services/Internal/Support/JournalServiceTrait.php +++ b/app/Services/Internal/Support/JournalServiceTrait.php @@ -260,7 +260,7 @@ trait JournalServiceTrait if (null === $account) { // final attempt, create it. if (AccountTypeEnum::ASSET->value === $preferredType) { - throw new FireflyException(sprintf('TransactionFactory: Cannot create asset account with these values: %s', json_encode($data))); + throw new FireflyException(sprintf('TransactionFactory: Cannot create asset account with these values: %s', \Safe\json_encode($data))); } // fix name of account if only IBAN is given: if ('' === (string) $data['name'] && '' !== (string) $data['iban']) { diff --git a/app/Services/Internal/Support/RecurringTransactionTrait.php b/app/Services/Internal/Support/RecurringTransactionTrait.php index 9df6075d19..95b5520599 100644 --- a/app/Services/Internal/Support/RecurringTransactionTrait.php +++ b/app/Services/Internal/Support/RecurringTransactionTrait.php @@ -307,9 +307,9 @@ trait RecurringTransactionTrait /** @var null|RecurrenceMeta $entry */ $entry = $transaction->recurrenceTransactionMeta()->where('name', 'tags')->first(); if (null === $entry) { - $entry = RecurrenceTransactionMeta::create(['rt_id' => $transaction->id, 'name' => 'tags', 'value' => json_encode($tags)]); + $entry = RecurrenceTransactionMeta::create(['rt_id' => $transaction->id, 'name' => 'tags', 'value' => \Safe\json_encode($tags)]); } - $entry->value = json_encode($tags); + $entry->value = \Safe\json_encode($tags); $entry->save(); } if (0 === count($tags)) { diff --git a/app/Services/Webhook/StandardWebhookSender.php b/app/Services/Webhook/StandardWebhookSender.php index 911fde75d9..264e754bc8 100644 --- a/app/Services/Webhook/StandardWebhookSender.php +++ b/app/Services/Webhook/StandardWebhookSender.php @@ -80,7 +80,7 @@ class StandardWebhookSender implements WebhookSenderInterface app('log')->debug(sprintf('Trying to send webhook message #%d', $this->message->id)); try { - $json = json_encode($this->message->message, JSON_THROW_ON_ERROR); + $json = \Safe\json_encode($this->message->message, JSON_THROW_ON_ERROR); } catch (\JsonException $e) { app('log')->error('Did not send message because of a JSON error.'); app('log')->error($e->getMessage()); diff --git a/app/Support/Authentication/RemoteUserGuard.php b/app/Support/Authentication/RemoteUserGuard.php index 93c418ce69..c73cd0da42 100644 --- a/app/Support/Authentication/RemoteUserGuard.php +++ b/app/Support/Authentication/RemoteUserGuard.php @@ -69,7 +69,7 @@ class RemoteUserGuard implements Guard if (function_exists('apache_request_headers')) { Log::debug('Use apache_request_headers to find user ID.'); - $userID = request()->server($header) ?? apache_request_headers()[$header] ?? null; + $userID = request()->server($header) ?? \Safe\apache_request_headers()[$header] ?? null; } if (null === $userID || '' === $userID) { @@ -87,7 +87,7 @@ class RemoteUserGuard implements Guard $header = config('auth.guard_email'); if (null !== $header) { - $emailAddress = (string) (request()->server($header) ?? apache_request_headers()[$header] ?? null); + $emailAddress = (string) (request()->server($header) ?? \Safe\apache_request_headers()[$header] ?? null); $preference = app('preferences')->getForUser($retrievedUser, 'remote_guard_alt_email'); if ('' !== $emailAddress && null === $preference && $emailAddress !== $userID) { diff --git a/app/Support/CacheProperties.php b/app/Support/CacheProperties.php index 8a8ba020b7..ed52fa17d9 100644 --- a/app/Support/CacheProperties.php +++ b/app/Support/CacheProperties.php @@ -78,7 +78,7 @@ class CacheProperties $content = ''; foreach ($this->properties as $property) { try { - $content .= json_encode($property, JSON_THROW_ON_ERROR); + $content .= \Safe\json_encode($property, JSON_THROW_ON_ERROR); } catch (\JsonException $e) { // @ignoreException $content .= hash('sha256', (string) time()); diff --git a/app/Support/Cronjobs/UpdateCheckCronjob.php b/app/Support/Cronjobs/UpdateCheckCronjob.php index 0cfb0a0967..980973e099 100644 --- a/app/Support/Cronjobs/UpdateCheckCronjob.php +++ b/app/Support/Cronjobs/UpdateCheckCronjob.php @@ -63,7 +63,7 @@ class UpdateCheckCronjob extends AbstractCronjob $this->jobFired = false; $this->jobErrored = false; $this->jobSucceeded = true; - $this->message = sprintf('Checked for updates less than a week ago (on %s).', date('Y-m-d H:i:s', $lastCheckTime->data)); + $this->message = sprintf('Checked for updates less than a week ago (on %s).', \Safe\date('Y-m-d H:i:s', $lastCheckTime->data)); return; } diff --git a/app/Support/Http/Controllers/CreateStuff.php b/app/Support/Http/Controllers/CreateStuff.php index 59fe677edd..6fb55a9d22 100644 --- a/app/Support/Http/Controllers/CreateStuff.php +++ b/app/Support/Http/Controllers/CreateStuff.php @@ -106,8 +106,8 @@ trait CreateStuff Log::alert('NO OAuth keys were found. They have been created.'); - file_put_contents($publicKey, (string) $key->getPublicKey()); - file_put_contents($privateKey, $key->toString('PKCS1')); + \Safe\file_put_contents($publicKey, (string) $key->getPublicKey()); + \Safe\file_put_contents($privateKey, $key->toString('PKCS1')); } /** diff --git a/app/Support/Http/Controllers/RequestInformation.php b/app/Support/Http/Controllers/RequestInformation.php index 7307496f2e..7f18f6fe3c 100644 --- a/app/Support/Http/Controllers/RequestInformation.php +++ b/app/Support/Http/Controllers/RequestInformation.php @@ -46,7 +46,7 @@ trait RequestInformation final protected function getDomain(): string // get request info { $url = url()->to('/'); - $parts = parse_url($url); + $parts = \Safe\parse_url($url); return $parts['host'] ?? ''; } diff --git a/app/Support/ParseDateString.php b/app/Support/ParseDateString.php index 6ddde18a15..4d61dc35d5 100644 --- a/app/Support/ParseDateString.php +++ b/app/Support/ParseDateString.php @@ -85,7 +85,7 @@ class ParseDateString // if regex for YYYY-MM-DD: $pattern = '/^(19|20)\d\d-(0[1-9]|1[012])-(0[1-9]|[12]\d|3[01])$/'; - $result = preg_match($pattern, $date); + $result = \Safe\preg_match($pattern, $date); if (false !== $result && 0 !== $result) { return $this->parseDefaultDate($date); } @@ -182,7 +182,7 @@ class ParseDateString // verify if correct $pattern = '/[+-]\d+[wqmdy]/'; - $result = preg_match($pattern, $part); + $result = \Safe\preg_match($pattern, $part); if (0 === $result || false === $result) { app('log')->error(sprintf('Part "%s" does not match regular expression. Will be skipped.', $part)); @@ -256,7 +256,7 @@ class ParseDateString protected function isDayRange(string $date): bool { $pattern = '/^xxxx-xx-(0[1-9]|[12]\d|3[01])$/'; - $result = preg_match($pattern, $date); + $result = \Safe\preg_match($pattern, $date); if (false !== $result && 0 !== $result) { app('log')->debug(sprintf('"%s" is a day range.', $date)); @@ -283,7 +283,7 @@ class ParseDateString { // if regex for xxxx-MM-xx: $pattern = '/^xxxx-(0[1-9]|1[012])-xx$/'; - $result = preg_match($pattern, $date); + $result = \Safe\preg_match($pattern, $date); if (false !== $result && 0 !== $result) { app('log')->debug(sprintf('"%s" is a month range.', $date)); @@ -311,7 +311,7 @@ class ParseDateString { // if regex for YYYY-xx-xx: $pattern = '/^(19|20)\d\d-xx-xx$/'; - $result = preg_match($pattern, $date); + $result = \Safe\preg_match($pattern, $date); if (false !== $result && 0 !== $result) { app('log')->debug(sprintf('"%s" is a year range.', $date)); @@ -339,7 +339,7 @@ class ParseDateString { // if regex for xxxx-MM-DD: $pattern = '/^xxxx-(0[1-9]|1[012])-(0[1-9]|[12]\d|3[01])$/'; - $result = preg_match($pattern, $date); + $result = \Safe\preg_match($pattern, $date); if (false !== $result && 0 !== $result) { app('log')->debug(sprintf('"%s" is a month/day range.', $date)); @@ -368,7 +368,7 @@ class ParseDateString { // if regex for YYYY-xx-DD: $pattern = '/^(19|20)\d\d-xx-(0[1-9]|[12]\d|3[01])$/'; - $result = preg_match($pattern, $date); + $result = \Safe\preg_match($pattern, $date); if (false !== $result && 0 !== $result) { app('log')->debug(sprintf('"%s" is a day/year range.', $date)); @@ -397,7 +397,7 @@ class ParseDateString { // if regex for YYYY-MM-xx: $pattern = '/^(19|20)\d\d-(0[1-9]|1[012])-xx$/'; - $result = preg_match($pattern, $date); + $result = \Safe\preg_match($pattern, $date); if (false !== $result && 0 !== $result) { app('log')->debug(sprintf('"%s" is a month/year range.', $date)); diff --git a/app/Support/Request/ConvertsDataTypes.php b/app/Support/Request/ConvertsDataTypes.php index fd776c1e60..d8792fdc79 100644 --- a/app/Support/Request/ConvertsDataTypes.php +++ b/app/Support/Request/ConvertsDataTypes.php @@ -125,7 +125,7 @@ trait ConvertsDataTypes $string = str_replace($this->characters, "\x20", $string); // clear zalgo text (TODO also in API v2) - $string = preg_replace('/(\pM{2})\pM+/u', '\1', $string); + $string = \Safe\preg_replace('/(\pM{2})\pM+/u', '\1', $string); return trim((string) $string); } diff --git a/app/Support/Search/AccountSearch.php b/app/Support/Search/AccountSearch.php index ec5ef15e58..a40c407e3f 100644 --- a/app/Support/Search/AccountSearch.php +++ b/app/Support/Search/AccountSearch.php @@ -81,7 +81,7 @@ class AccountSearch implements GenericSearchInterface // meta data: $searchQuery->orWhere( static function (Builder $q) use ($originalQuery): void { - $json = json_encode($originalQuery, JSON_THROW_ON_ERROR); + $json = \Safe\json_encode($originalQuery, JSON_THROW_ON_ERROR); $q->where('account_meta.name', '=', 'account_number'); $q->whereLike('account_meta.data', $json); } @@ -108,7 +108,7 @@ class AccountSearch implements GenericSearchInterface // meta data: $searchQuery->Where( static function (Builder $q) use ($originalQuery): void { - $json = json_encode($originalQuery, JSON_THROW_ON_ERROR); + $json = \Safe\json_encode($originalQuery, JSON_THROW_ON_ERROR); $q->where('account_meta.name', 'account_number'); $q->where('account_meta.data', $json); } diff --git a/app/Support/Search/QueryParser/GdbotsQueryParser.php b/app/Support/Search/QueryParser/GdbotsQueryParser.php index 3685e8c281..56dde78b20 100644 --- a/app/Support/Search/QueryParser/GdbotsQueryParser.php +++ b/app/Support/Search/QueryParser/GdbotsQueryParser.php @@ -54,7 +54,7 @@ class GdbotsQueryParser implements QueryParserInterface return new NodeGroup($nodes); } catch (\LogicException|\TypeError $e) { - fwrite(STDERR, "Setting up GdbotsQueryParserTest\n"); + \Safe\fwrite(STDERR, "Setting up GdbotsQueryParserTest\n"); app('log')->error($e->getMessage()); app('log')->error(sprintf('Could not parse search: "%s".', $query)); diff --git a/app/Support/Steam.php b/app/Support/Steam.php index 5d53d36515..7e14c580c9 100644 --- a/app/Support/Steam.php +++ b/app/Support/Steam.php @@ -270,8 +270,8 @@ class Steam ]; // clear zalgo text - $string = preg_replace('/(\pM{2})\pM+/u', '\1', $string); - $string = preg_replace('/\s+/', '', $string); + $string = \Safe\preg_replace('/(\pM{2})\pM+/u', '\1', $string); + $string = \Safe\preg_replace('/\s+/', '', $string); return str_replace($search, '', $string); } @@ -549,8 +549,8 @@ class Steam { // Log::debug(sprintf('getSafeUrl(%s, %s)', $unknownUrl, $safeUrl)); $returnUrl = $safeUrl; - $unknownHost = parse_url($unknownUrl, PHP_URL_HOST); - $safeHost = parse_url($safeUrl, PHP_URL_HOST); + $unknownHost = \Safe\parse_url($unknownUrl, PHP_URL_HOST); + $safeHost = \Safe\parse_url($safeUrl, PHP_URL_HOST); if (null !== $unknownHost && $unknownHost === $safeHost) { $returnUrl = $unknownUrl; diff --git a/app/Support/System/OAuthKeys.php b/app/Support/System/OAuthKeys.php index cda0721846..e0c0fa0b7a 100644 --- a/app/Support/System/OAuthKeys.php +++ b/app/Support/System/OAuthKeys.php @@ -96,8 +96,8 @@ class OAuthKeys { $private = storage_path('oauth-private.key'); $public = storage_path('oauth-public.key'); - app('fireflyconfig')->set(self::PRIVATE_KEY, Crypt::encrypt(file_get_contents($private))); - app('fireflyconfig')->set(self::PUBLIC_KEY, Crypt::encrypt(file_get_contents($public))); + app('fireflyconfig')->set(self::PRIVATE_KEY, Crypt::encrypt(\Safe\file_get_contents($private))); + app('fireflyconfig')->set(self::PUBLIC_KEY, Crypt::encrypt(\Safe\file_get_contents($public))); } /** @@ -123,8 +123,8 @@ class OAuthKeys } $private = storage_path('oauth-private.key'); $public = storage_path('oauth-public.key'); - file_put_contents($private, $privateContent); - file_put_contents($public, $publicContent); + \Safe\file_put_contents($private, $privateContent); + \Safe\file_put_contents($public, $publicContent); return true; } diff --git a/app/Support/Twig/General.php b/app/Support/Twig/General.php index 80383ec78f..e0e4a8fdf3 100644 --- a/app/Support/Twig/General.php +++ b/app/Support/Twig/General.php @@ -240,8 +240,8 @@ class General extends AbstractExtension return new TwigFilter( 'phphost', static function (string $string): string { - $proto = (string) parse_url($string, PHP_URL_SCHEME); - $host = (string) parse_url($string, PHP_URL_HOST); + $proto = (string) \Safe\parse_url($string, PHP_URL_SCHEME); + $host = (string) \Safe\parse_url($string, PHP_URL_HOST); return e(sprintf('%s://%s', $proto, $host)); } @@ -272,7 +272,7 @@ class General extends AbstractExtension return new TwigFunction( 'phpdate', static function (string $str): string { - return date($str); + return \Safe\date($str); } ); } diff --git a/app/Support/Twig/TransactionGroupTwig.php b/app/Support/Twig/TransactionGroupTwig.php index 73d1542a26..b3df2e485a 100644 --- a/app/Support/Twig/TransactionGroupTwig.php +++ b/app/Support/Twig/TransactionGroupTwig.php @@ -254,7 +254,7 @@ class TransactionGroupTwig extends AbstractExtension return today(config('app.timezone')); } - return new Carbon(json_decode($entry->data, false)); + return new Carbon(\Safe\json_decode($entry->data, false)); } ); } @@ -275,7 +275,7 @@ class TransactionGroupTwig extends AbstractExtension return ''; } - return json_decode($entry->data, true); + return \Safe\json_decode($entry->data, true); } ); } diff --git a/app/Transformers/RecurrenceTransformer.php b/app/Transformers/RecurrenceTransformer.php index 8eecfbcf3e..2bf862a7aa 100644 --- a/app/Transformers/RecurrenceTransformer.php +++ b/app/Transformers/RecurrenceTransformer.php @@ -264,7 +264,7 @@ class RecurrenceTransformer extends AbstractTransformer break; case 'tags': - $array['tags'] = json_decode($transactionMeta->value); + $array['tags'] = \Safe\json_decode($transactionMeta->value); break; diff --git a/app/Transformers/WebhookMessageTransformer.php b/app/Transformers/WebhookMessageTransformer.php index f0fd5c056d..5271582bbb 100644 --- a/app/Transformers/WebhookMessageTransformer.php +++ b/app/Transformers/WebhookMessageTransformer.php @@ -39,7 +39,7 @@ class WebhookMessageTransformer extends AbstractTransformer $json = '{}'; try { - $json = json_encode($message->message, JSON_THROW_ON_ERROR); + $json = \Safe\json_encode($message->message, JSON_THROW_ON_ERROR); } catch (\JsonException $e) { app('log')->error(sprintf('Could not encode webhook message #%d: %s', $message->id, $e->getMessage())); } diff --git a/app/Validation/Api/Data/Bulk/ValidatesBulkTransactionQuery.php b/app/Validation/Api/Data/Bulk/ValidatesBulkTransactionQuery.php index 876d4269be..c5651941d4 100644 --- a/app/Validation/Api/Data/Bulk/ValidatesBulkTransactionQuery.php +++ b/app/Validation/Api/Data/Bulk/ValidatesBulkTransactionQuery.php @@ -34,7 +34,7 @@ trait ValidatesBulkTransactionQuery $data = $validator->getData(); // assumption is all validation has already taken place and the query key exists. $query = $data['query'] ?? '[]'; - $json = json_decode($query, true, 8, JSON_THROW_ON_ERROR); + $json = \Safe\json_decode($query, true, 8, JSON_THROW_ON_ERROR); if ( array_key_exists('where', $json) diff --git a/app/Validation/FireflyValidator.php b/app/Validation/FireflyValidator.php index 213bfab7a6..7faa885731 100644 --- a/app/Validation/FireflyValidator.php +++ b/app/Validation/FireflyValidator.php @@ -110,7 +110,7 @@ class FireflyValidator extends Validator return false; } $regex = '/^[a-z]{6}[0-9a-z]{2}([0-9a-z]{3})?\z/i'; - $result = preg_match($regex, $value); + $result = \Safe\preg_match($regex, $value); if (false === $result || 0 === $result) { return false; } @@ -200,7 +200,7 @@ class FireflyValidator extends Validator $value = strtoupper($value); // replace characters outside of ASCI range. - $value = (string) iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $value); + $value = (string) \Safe\iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $value); $search = [' ', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']; $replace = ['', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35']; @@ -634,7 +634,7 @@ class FireflyValidator extends Validator ->whereNull('accounts.deleted_at') ->where('accounts.user_id', auth()->user()->id) ->where('account_meta.name', 'account_number') - ->where('account_meta.data', json_encode($value)) + ->where('account_meta.data', \Safe\json_encode($value)) ; if ($accountId > 0) { diff --git a/composer.json b/composer.json index b2b00813bc..eca5b62ed0 100644 --- a/composer.json +++ b/composer.json @@ -81,7 +81,7 @@ "ext-tokenizer": "*", "ext-xml": "*", "ext-xmlwriter": "*", - "bacon/bacon-qr-code": "^2", + "bacon/bacon-qr-code": "^3.0", "diglactic/laravel-breadcrumbs": "^10", "gdbots/query-parser": "^3.0", "guzzlehttp/guzzle": "^7.9", @@ -123,7 +123,9 @@ "phpstan/phpstan": "^2", "phpstan/phpstan-deprecation-rules": "^2", "phpstan/phpstan-strict-rules": "^2", - "phpunit/phpunit": "^11" + "phpunit/phpunit": "^11", + "rector/rector": "^2.0", + "thecodingmachine/phpstan-safe-rule": "^1.4" }, "suggest": {}, "autoload": { diff --git a/composer.lock b/composer.lock index ddea61e47f..186d66d610 100644 --- a/composer.lock +++ b/composer.lock @@ -4,32 +4,32 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "3c350a535ca785e45a43f67c3a41154b", + "content-hash": "ce140fe154a7c5c4f9326b67873620d3", "packages": [ { "name": "bacon/bacon-qr-code", - "version": "2.0.8", + "version": "v3.0.1", "source": { "type": "git", "url": "https://github.com/Bacon/BaconQrCode.git", - "reference": "8674e51bb65af933a5ffaf1c308a660387c35c22" + "reference": "f9cc1f52b5a463062251d666761178dbdb6b544f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Bacon/BaconQrCode/zipball/8674e51bb65af933a5ffaf1c308a660387c35c22", - "reference": "8674e51bb65af933a5ffaf1c308a660387c35c22", + "url": "https://api.github.com/repos/Bacon/BaconQrCode/zipball/f9cc1f52b5a463062251d666761178dbdb6b544f", + "reference": "f9cc1f52b5a463062251d666761178dbdb6b544f", "shasum": "" }, "require": { "dasprid/enum": "^1.0.3", "ext-iconv": "*", - "php": "^7.1 || ^8.0" + "php": "^8.1" }, "require-dev": { - "phly/keep-a-changelog": "^2.1", - "phpunit/phpunit": "^7 | ^8 | ^9", - "spatie/phpunit-snapshot-assertions": "^4.2.9", - "squizlabs/php_codesniffer": "^3.4" + "phly/keep-a-changelog": "^2.12", + "phpunit/phpunit": "^10.5.11 || 11.0.4", + "spatie/phpunit-snapshot-assertions": "^5.1.5", + "squizlabs/php_codesniffer": "^3.9" }, "suggest": { "ext-imagick": "to generate QR code images" @@ -56,9 +56,9 @@ "homepage": "https://github.com/Bacon/BaconQrCode", "support": { "issues": "https://github.com/Bacon/BaconQrCode/issues", - "source": "https://github.com/Bacon/BaconQrCode/tree/2.0.8" + "source": "https://github.com/Bacon/BaconQrCode/tree/v3.0.1" }, - "time": "2022-12-07T17:46:57+00:00" + "time": "2024-10-01T13:55:55+00:00" }, { "name": "beberlei/assert", @@ -1656,22 +1656,22 @@ }, { "name": "jc5/google2fa-laravel", - "version": "v2.0.8", + "version": "2.0.9", "source": { "type": "git", "url": "https://github.com/JC5/google2fa-laravel.git", - "reference": "0205b0e58b90ee41e6d108d4c26ad9d0f7997baa" + "reference": "af390d117e92963c75fa36868b754e6321b3710f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/JC5/google2fa-laravel/zipball/0205b0e58b90ee41e6d108d4c26ad9d0f7997baa", - "reference": "0205b0e58b90ee41e6d108d4c26ad9d0f7997baa", + "url": "https://api.github.com/repos/JC5/google2fa-laravel/zipball/af390d117e92963c75fa36868b754e6321b3710f", + "reference": "af390d117e92963c75fa36868b754e6321b3710f", "shasum": "" }, "require": { "laravel/framework": ">=5.4.36", "php": ">=8", - "pragmarx/google2fa-qrcode": "^1.0" + "pragmarx/google2fa-qrcode": ">1.0" }, "require-dev": { "orchestra/testbench": "3.4.*|3.5.*|3.6.*|3.7.*|4.*|5.*|6.*", @@ -1718,7 +1718,7 @@ }, { "name": "James Cole", - "email": "thegrumpydictator@gmail.com", + "email": "james@firefly-iii.org", "role": "Developer" } ], @@ -1731,9 +1731,9 @@ ], "support": { "issues": "https://github.com/JC5/google2fa-laravel/issues", - "source": "https://github.com/JC5/google2fa-laravel/tree/v2.0.8" + "source": "https://github.com/JC5/google2fa-laravel/tree/2.0.9" }, - "time": "2022-03-30T16:00:00+00:00" + "time": "2023-09-16T02:59:44+00:00" }, { "name": "jc5/recovery", @@ -2228,16 +2228,16 @@ }, { "name": "laravel/sanctum", - "version": "v4.1.0", + "version": "v4.1.1", "source": { "type": "git", "url": "https://github.com/laravel/sanctum.git", - "reference": "4e4ced5023e9d8949214e0fb43d9f4bde79c7166" + "reference": "a360a6a1fd2400ead4eb9b6a9c1bb272939194f5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/sanctum/zipball/4e4ced5023e9d8949214e0fb43d9f4bde79c7166", - "reference": "4e4ced5023e9d8949214e0fb43d9f4bde79c7166", + "url": "https://api.github.com/repos/laravel/sanctum/zipball/a360a6a1fd2400ead4eb9b6a9c1bb272939194f5", + "reference": "a360a6a1fd2400ead4eb9b6a9c1bb272939194f5", "shasum": "" }, "require": { @@ -2288,7 +2288,7 @@ "issues": "https://github.com/laravel/sanctum/issues", "source": "https://github.com/laravel/sanctum" }, - "time": "2025-04-22T13:53:47+00:00" + "time": "2025-04-23T13:03:38+00:00" }, { "name": "laravel/serializable-closure", @@ -3711,16 +3711,16 @@ }, { "name": "nesbot/carbon", - "version": "3.9.0", + "version": "3.9.1", "source": { "type": "git", "url": "https://github.com/CarbonPHP/carbon.git", - "reference": "6d16a8a015166fe54e22c042e0805c5363aef50d" + "reference": "ced71f79398ece168e24f7f7710462f462310d4d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/CarbonPHP/carbon/zipball/6d16a8a015166fe54e22c042e0805c5363aef50d", - "reference": "6d16a8a015166fe54e22c042e0805c5363aef50d", + "url": "https://api.github.com/repos/CarbonPHP/carbon/zipball/ced71f79398ece168e24f7f7710462f462310d4d", + "reference": "ced71f79398ece168e24f7f7710462f462310d4d", "shasum": "" }, "require": { @@ -3813,7 +3813,7 @@ "type": "tidelift" } ], - "time": "2025-03-27T12:57:33+00:00" + "time": "2025-05-01T19:51:51+00:00" }, { "name": "nette/schema", @@ -4968,26 +4968,31 @@ }, { "name": "pragmarx/google2fa-qrcode", - "version": "v1.0.3", + "version": "v3.0.0", "source": { "type": "git", "url": "https://github.com/antonioribeiro/google2fa-qrcode.git", - "reference": "fd5ff0531a48b193a659309cc5fb882c14dbd03f" + "reference": "ce4d8a729b6c93741c607cfb2217acfffb5bf76b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/antonioribeiro/google2fa-qrcode/zipball/fd5ff0531a48b193a659309cc5fb882c14dbd03f", - "reference": "fd5ff0531a48b193a659309cc5fb882c14dbd03f", + "url": "https://api.github.com/repos/antonioribeiro/google2fa-qrcode/zipball/ce4d8a729b6c93741c607cfb2217acfffb5bf76b", + "reference": "ce4d8a729b6c93741c607cfb2217acfffb5bf76b", "shasum": "" }, "require": { - "bacon/bacon-qr-code": "~1.0|~2.0", - "php": ">=5.4", + "php": ">=7.1", "pragmarx/google2fa": ">=4.0" }, "require-dev": { + "bacon/bacon-qr-code": "^2.0", + "chillerlan/php-qrcode": "^1.0|^2.0|^3.0|^4.0", "khanamiryan/qrcode-detector-decoder": "^1.0", - "phpunit/phpunit": "~4|~5|~6|~7" + "phpunit/phpunit": "~4|~5|~6|~7|~8|~9" + }, + "suggest": { + "bacon/bacon-qr-code": "For QR Code generation, requires imagick", + "chillerlan/php-qrcode": "For QR Code generation" }, "type": "library", "extra": { @@ -5024,9 +5029,9 @@ ], "support": { "issues": "https://github.com/antonioribeiro/google2fa-qrcode/issues", - "source": "https://github.com/antonioribeiro/google2fa-qrcode/tree/master" + "source": "https://github.com/antonioribeiro/google2fa-qrcode/tree/v3.0.0" }, - "time": "2019-03-20T16:42:58+00:00" + "time": "2021-08-15T12:53:48+00:00" }, { "name": "pragmarx/random", @@ -5097,16 +5102,16 @@ }, { "name": "predis/predis", - "version": "v2.3.0", + "version": "v2.4.0", "source": { "type": "git", "url": "https://github.com/predis/predis.git", - "reference": "bac46bfdb78cd6e9c7926c697012aae740cb9ec9" + "reference": "f49e13ee3a2a825631562aa0223ac922ec5d058b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/predis/predis/zipball/bac46bfdb78cd6e9c7926c697012aae740cb9ec9", - "reference": "bac46bfdb78cd6e9c7926c697012aae740cb9ec9", + "url": "https://api.github.com/repos/predis/predis/zipball/f49e13ee3a2a825631562aa0223ac922ec5d058b", + "reference": "f49e13ee3a2a825631562aa0223ac922ec5d058b", "shasum": "" }, "require": { @@ -5115,6 +5120,7 @@ "require-dev": { "friendsofphp/php-cs-fixer": "^3.3", "phpstan/phpstan": "^1.9", + "phpunit/phpcov": "^6.0 || ^8.0", "phpunit/phpunit": "^8.0 || ^9.4" }, "suggest": { @@ -5137,7 +5143,7 @@ "role": "Maintainer" } ], - "description": "A flexible and feature-complete Redis client for PHP.", + "description": "A flexible and feature-complete Redis/Valkey client for PHP.", "homepage": "http://github.com/predis/predis", "keywords": [ "nosql", @@ -5146,7 +5152,7 @@ ], "support": { "issues": "https://github.com/predis/predis/issues", - "source": "https://github.com/predis/predis/tree/v2.3.0" + "source": "https://github.com/predis/predis/tree/v2.4.0" }, "funding": [ { @@ -5154,7 +5160,7 @@ "type": "github" } ], - "time": "2024-11-21T20:00:02+00:00" + "time": "2025-04-30T15:16:02+00:00" }, { "name": "psr/cache", @@ -5903,16 +5909,16 @@ }, { "name": "spatie/backtrace", - "version": "1.7.1", + "version": "1.7.2", "source": { "type": "git", "url": "https://github.com/spatie/backtrace.git", - "reference": "0f2477c520e3729de58e061b8192f161c99f770b" + "reference": "9807de6b8fecfaa5b3d10650985f0348b02862b2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/backtrace/zipball/0f2477c520e3729de58e061b8192f161c99f770b", - "reference": "0f2477c520e3729de58e061b8192f161c99f770b", + "url": "https://api.github.com/repos/spatie/backtrace/zipball/9807de6b8fecfaa5b3d10650985f0348b02862b2", + "reference": "9807de6b8fecfaa5b3d10650985f0348b02862b2", "shasum": "" }, "require": { @@ -5950,7 +5956,7 @@ "spatie" ], "support": { - "source": "https://github.com/spatie/backtrace/tree/1.7.1" + "source": "https://github.com/spatie/backtrace/tree/1.7.2" }, "funding": [ { @@ -5962,7 +5968,7 @@ "type": "other" } ], - "time": "2024-12-02T13:28:15+00:00" + "time": "2025-04-28T14:55:53+00:00" }, { "name": "spatie/error-solutions", @@ -6476,16 +6482,16 @@ }, { "name": "symfony/cache", - "version": "v7.2.5", + "version": "v7.2.6", "source": { "type": "git", "url": "https://github.com/symfony/cache.git", - "reference": "9131e3018872d2ebb6fe8a9a4d6631273513d42c" + "reference": "8b49dde3f5a5e9867595a3a269977f78418d75ee" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/cache/zipball/9131e3018872d2ebb6fe8a9a4d6631273513d42c", - "reference": "9131e3018872d2ebb6fe8a9a4d6631273513d42c", + "url": "https://api.github.com/repos/symfony/cache/zipball/8b49dde3f5a5e9867595a3a269977f78418d75ee", + "reference": "8b49dde3f5a5e9867595a3a269977f78418d75ee", "shasum": "" }, "require": { @@ -6554,7 +6560,7 @@ "psr6" ], "support": { - "source": "https://github.com/symfony/cache/tree/v7.2.5" + "source": "https://github.com/symfony/cache/tree/v7.2.6" }, "funding": [ { @@ -6570,7 +6576,7 @@ "type": "tidelift" } ], - "time": "2025-03-25T15:54:33+00:00" + "time": "2025-04-08T09:06:23+00:00" }, { "name": "symfony/cache-contracts", @@ -6724,16 +6730,16 @@ }, { "name": "symfony/console", - "version": "v7.2.5", + "version": "v7.2.6", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "e51498ea18570c062e7df29d05a7003585b19b88" + "reference": "0e2e3f38c192e93e622e41ec37f4ca70cfedf218" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/e51498ea18570c062e7df29d05a7003585b19b88", - "reference": "e51498ea18570c062e7df29d05a7003585b19b88", + "url": "https://api.github.com/repos/symfony/console/zipball/0e2e3f38c192e93e622e41ec37f4ca70cfedf218", + "reference": "0e2e3f38c192e93e622e41ec37f4ca70cfedf218", "shasum": "" }, "require": { @@ -6797,7 +6803,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v7.2.5" + "source": "https://github.com/symfony/console/tree/v7.2.6" }, "funding": [ { @@ -6813,7 +6819,7 @@ "type": "tidelift" } ], - "time": "2025-03-12T08:11:12+00:00" + "time": "2025-04-07T19:09:28+00:00" }, { "name": "symfony/css-selector", @@ -7481,16 +7487,16 @@ }, { "name": "symfony/http-foundation", - "version": "v7.2.5", + "version": "v7.2.6", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "371272aeb6286f8135e028ca535f8e4d6f114126" + "reference": "6023ec7607254c87c5e69fb3558255aca440d72b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/371272aeb6286f8135e028ca535f8e4d6f114126", - "reference": "371272aeb6286f8135e028ca535f8e4d6f114126", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/6023ec7607254c87c5e69fb3558255aca440d72b", + "reference": "6023ec7607254c87c5e69fb3558255aca440d72b", "shasum": "" }, "require": { @@ -7539,7 +7545,7 @@ "description": "Defines an object-oriented layer for the HTTP specification", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-foundation/tree/v7.2.5" + "source": "https://github.com/symfony/http-foundation/tree/v7.2.6" }, "funding": [ { @@ -7555,20 +7561,20 @@ "type": "tidelift" } ], - "time": "2025-03-25T15:54:33+00:00" + "time": "2025-04-09T08:14:01+00:00" }, { "name": "symfony/http-kernel", - "version": "v7.2.5", + "version": "v7.2.6", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "b1fe91bc1fa454a806d3f98db4ba826eb9941a54" + "reference": "f9dec01e6094a063e738f8945ef69c0cfcf792ec" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/b1fe91bc1fa454a806d3f98db4ba826eb9941a54", - "reference": "b1fe91bc1fa454a806d3f98db4ba826eb9941a54", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/f9dec01e6094a063e738f8945ef69c0cfcf792ec", + "reference": "f9dec01e6094a063e738f8945ef69c0cfcf792ec", "shasum": "" }, "require": { @@ -7653,7 +7659,7 @@ "description": "Provides a structured process for converting a Request into a Response", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-kernel/tree/v7.2.5" + "source": "https://github.com/symfony/http-kernel/tree/v7.2.6" }, "funding": [ { @@ -7669,20 +7675,20 @@ "type": "tidelift" } ], - "time": "2025-03-28T13:32:50+00:00" + "time": "2025-05-02T09:04:03+00:00" }, { "name": "symfony/mailer", - "version": "v7.2.3", + "version": "v7.2.6", "source": { "type": "git", "url": "https://github.com/symfony/mailer.git", - "reference": "f3871b182c44997cf039f3b462af4a48fb85f9d3" + "reference": "998692469d6e698c6eadc7ef37a6530a9eabb356" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mailer/zipball/f3871b182c44997cf039f3b462af4a48fb85f9d3", - "reference": "f3871b182c44997cf039f3b462af4a48fb85f9d3", + "url": "https://api.github.com/repos/symfony/mailer/zipball/998692469d6e698c6eadc7ef37a6530a9eabb356", + "reference": "998692469d6e698c6eadc7ef37a6530a9eabb356", "shasum": "" }, "require": { @@ -7733,7 +7739,7 @@ "description": "Helps sending emails", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/mailer/tree/v7.2.3" + "source": "https://github.com/symfony/mailer/tree/v7.2.6" }, "funding": [ { @@ -7749,7 +7755,7 @@ "type": "tidelift" } ], - "time": "2025-01-27T11:08:17+00:00" + "time": "2025-04-04T09:50:51+00:00" }, { "name": "symfony/mailgun-mailer", @@ -7822,16 +7828,16 @@ }, { "name": "symfony/mime", - "version": "v7.2.4", + "version": "v7.2.6", "source": { "type": "git", "url": "https://github.com/symfony/mime.git", - "reference": "87ca22046b78c3feaff04b337f33b38510fd686b" + "reference": "706e65c72d402539a072d0d6ad105fff6c161ef1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/87ca22046b78c3feaff04b337f33b38510fd686b", - "reference": "87ca22046b78c3feaff04b337f33b38510fd686b", + "url": "https://api.github.com/repos/symfony/mime/zipball/706e65c72d402539a072d0d6ad105fff6c161ef1", + "reference": "706e65c72d402539a072d0d6ad105fff6c161ef1", "shasum": "" }, "require": { @@ -7886,7 +7892,7 @@ "mime-type" ], "support": { - "source": "https://github.com/symfony/mime/tree/v7.2.4" + "source": "https://github.com/symfony/mime/tree/v7.2.6" }, "funding": [ { @@ -7902,7 +7908,7 @@ "type": "tidelift" } ], - "time": "2025-02-19T08:51:20+00:00" + "time": "2025-04-27T13:34:41+00:00" }, { "name": "symfony/options-resolver", @@ -7973,7 +7979,7 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.31.0", + "version": "v1.32.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", @@ -8032,7 +8038,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.31.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.32.0" }, "funding": [ { @@ -8052,7 +8058,7 @@ }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.31.0", + "version": "v1.32.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", @@ -8110,7 +8116,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.31.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.32.0" }, "funding": [ { @@ -8130,16 +8136,16 @@ }, { "name": "symfony/polyfill-intl-idn", - "version": "v1.31.0", + "version": "v1.32.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-idn.git", - "reference": "c36586dcf89a12315939e00ec9b4474adcb1d773" + "reference": "9614ac4d8061dc257ecc64cba1b140873dce8ad3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/c36586dcf89a12315939e00ec9b4474adcb1d773", - "reference": "c36586dcf89a12315939e00ec9b4474adcb1d773", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/9614ac4d8061dc257ecc64cba1b140873dce8ad3", + "reference": "9614ac4d8061dc257ecc64cba1b140873dce8ad3", "shasum": "" }, "require": { @@ -8193,7 +8199,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.31.0" + "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.32.0" }, "funding": [ { @@ -8209,11 +8215,11 @@ "type": "tidelift" } ], - "time": "2024-09-09T11:45:10+00:00" + "time": "2024-09-10T14:38:51+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.31.0", + "version": "v1.32.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", @@ -8274,7 +8280,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.31.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.32.0" }, "funding": [ { @@ -8294,19 +8300,20 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.31.0", + "version": "v1.32.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341" + "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/85181ba99b2345b0ef10ce42ecac37612d9fd341", - "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/6d857f4d76bd4b343eac26d6b539585d2bc56493", + "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493", "shasum": "" }, "require": { + "ext-iconv": "*", "php": ">=7.2" }, "provide": { @@ -8354,7 +8361,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.31.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.32.0" }, "funding": [ { @@ -8370,20 +8377,20 @@ "type": "tidelift" } ], - "time": "2024-09-09T11:45:10+00:00" + "time": "2024-12-23T08:48:59+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.31.0", + "version": "v1.32.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8" + "reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", - "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/0cc9dd0f17f61d8131e7df6b84bd344899fe2608", + "reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608", "shasum": "" }, "require": { @@ -8434,7 +8441,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.31.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.32.0" }, "funding": [ { @@ -8450,11 +8457,11 @@ "type": "tidelift" } ], - "time": "2024-09-09T11:45:10+00:00" + "time": "2025-01-02T08:10:11+00:00" }, { "name": "symfony/polyfill-php83", - "version": "v1.31.0", + "version": "v1.32.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php83.git", @@ -8510,7 +8517,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php83/tree/v1.31.0" + "source": "https://github.com/symfony/polyfill-php83/tree/v1.32.0" }, "funding": [ { @@ -8530,7 +8537,7 @@ }, { "name": "symfony/polyfill-uuid", - "version": "v1.31.0", + "version": "v1.32.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-uuid.git", @@ -8589,7 +8596,7 @@ "uuid" ], "support": { - "source": "https://github.com/symfony/polyfill-uuid/tree/v1.31.0" + "source": "https://github.com/symfony/polyfill-uuid/tree/v1.32.0" }, "funding": [ { @@ -8917,16 +8924,16 @@ }, { "name": "symfony/string", - "version": "v7.2.0", + "version": "v7.2.6", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "446e0d146f991dde3e73f45f2c97a9faad773c82" + "reference": "a214fe7d62bd4df2a76447c67c6b26e1d5e74931" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/446e0d146f991dde3e73f45f2c97a9faad773c82", - "reference": "446e0d146f991dde3e73f45f2c97a9faad773c82", + "url": "https://api.github.com/repos/symfony/string/zipball/a214fe7d62bd4df2a76447c67c6b26e1d5e74931", + "reference": "a214fe7d62bd4df2a76447c67c6b26e1d5e74931", "shasum": "" }, "require": { @@ -8984,7 +8991,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v7.2.0" + "source": "https://github.com/symfony/string/tree/v7.2.6" }, "funding": [ { @@ -9000,20 +9007,20 @@ "type": "tidelift" } ], - "time": "2024-11-13T13:31:26+00:00" + "time": "2025-04-20T20:18:16+00:00" }, { "name": "symfony/translation", - "version": "v7.2.4", + "version": "v7.2.6", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "283856e6981286cc0d800b53bd5703e8e363f05a" + "reference": "e7fd8e2a4239b79a0fd9fb1fef3e0e7f969c6dc6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/283856e6981286cc0d800b53bd5703e8e363f05a", - "reference": "283856e6981286cc0d800b53bd5703e8e363f05a", + "url": "https://api.github.com/repos/symfony/translation/zipball/e7fd8e2a4239b79a0fd9fb1fef3e0e7f969c6dc6", + "reference": "e7fd8e2a4239b79a0fd9fb1fef3e0e7f969c6dc6", "shasum": "" }, "require": { @@ -9079,7 +9086,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v7.2.4" + "source": "https://github.com/symfony/translation/tree/v7.2.6" }, "funding": [ { @@ -9095,7 +9102,7 @@ "type": "tidelift" } ], - "time": "2025-02-13T10:27:23+00:00" + "time": "2025-04-07T19:09:28+00:00" }, { "name": "symfony/translation-contracts", @@ -9251,16 +9258,16 @@ }, { "name": "symfony/var-dumper", - "version": "v7.2.3", + "version": "v7.2.6", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "82b478c69745d8878eb60f9a049a4d584996f73a" + "reference": "9c46038cd4ed68952166cf7001b54eb539184ccb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/82b478c69745d8878eb60f9a049a4d584996f73a", - "reference": "82b478c69745d8878eb60f9a049a4d584996f73a", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/9c46038cd4ed68952166cf7001b54eb539184ccb", + "reference": "9c46038cd4ed68952166cf7001b54eb539184ccb", "shasum": "" }, "require": { @@ -9314,7 +9321,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v7.2.3" + "source": "https://github.com/symfony/var-dumper/tree/v7.2.6" }, "funding": [ { @@ -9330,20 +9337,20 @@ "type": "tidelift" } ], - "time": "2025-01-17T11:39:41+00:00" + "time": "2025-04-09T08:14:01+00:00" }, { "name": "symfony/var-exporter", - "version": "v7.2.5", + "version": "v7.2.6", "source": { "type": "git", "url": "https://github.com/symfony/var-exporter.git", - "reference": "c37b301818bd7288715d40de634f05781b686ace" + "reference": "422b8de94c738830a1e071f59ad14d67417d7007" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-exporter/zipball/c37b301818bd7288715d40de634f05781b686ace", - "reference": "c37b301818bd7288715d40de634f05781b686ace", + "url": "https://api.github.com/repos/symfony/var-exporter/zipball/422b8de94c738830a1e071f59ad14d67417d7007", + "reference": "422b8de94c738830a1e071f59ad14d67417d7007", "shasum": "" }, "require": { @@ -9390,7 +9397,7 @@ "serialize" ], "support": { - "source": "https://github.com/symfony/var-exporter/tree/v7.2.5" + "source": "https://github.com/symfony/var-exporter/tree/v7.2.6" }, "funding": [ { @@ -9406,7 +9413,7 @@ "type": "tidelift" } ], - "time": "2025-03-13T12:21:46+00:00" + "time": "2025-05-02T08:36:00+00:00" }, { "name": "thecodingmachine/safe", @@ -9604,16 +9611,16 @@ }, { "name": "twig/twig", - "version": "v3.20.0", + "version": "v3.21.1", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "3468920399451a384bef53cf7996965f7cd40183" + "reference": "285123877d4dd97dd7c11842ac5fb7e86e60d81d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/3468920399451a384bef53cf7996965f7cd40183", - "reference": "3468920399451a384bef53cf7996965f7cd40183", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/285123877d4dd97dd7c11842ac5fb7e86e60d81d", + "reference": "285123877d4dd97dd7c11842ac5fb7e86e60d81d", "shasum": "" }, "require": { @@ -9667,7 +9674,7 @@ ], "support": { "issues": "https://github.com/twigphp/Twig/issues", - "source": "https://github.com/twigphp/Twig/tree/v3.20.0" + "source": "https://github.com/twigphp/Twig/tree/v3.21.1" }, "funding": [ { @@ -9679,7 +9686,7 @@ "type": "tidelift" } ], - "time": "2025-02-13T08:34:43+00:00" + "time": "2025-05-03T07:21:55+00:00" }, { "name": "verifiedjoseph/ntfy-php-library", @@ -9737,16 +9744,16 @@ }, { "name": "vlucas/phpdotenv", - "version": "v5.6.1", + "version": "v5.6.2", "source": { "type": "git", "url": "https://github.com/vlucas/phpdotenv.git", - "reference": "a59a13791077fe3d44f90e7133eb68e7d22eaff2" + "reference": "24ac4c74f91ee2c193fa1aaa5c249cb0822809af" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/a59a13791077fe3d44f90e7133eb68e7d22eaff2", - "reference": "a59a13791077fe3d44f90e7133eb68e7d22eaff2", + "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/24ac4c74f91ee2c193fa1aaa5c249cb0822809af", + "reference": "24ac4c74f91ee2c193fa1aaa5c249cb0822809af", "shasum": "" }, "require": { @@ -9805,7 +9812,7 @@ ], "support": { "issues": "https://github.com/vlucas/phpdotenv/issues", - "source": "https://github.com/vlucas/phpdotenv/tree/v5.6.1" + "source": "https://github.com/vlucas/phpdotenv/tree/v5.6.2" }, "funding": [ { @@ -9817,7 +9824,7 @@ "type": "tidelift" } ], - "time": "2024-07-20T21:52:34+00:00" + "time": "2025-04-30T23:37:27+00:00" }, { "name": "voku/portable-ascii", @@ -10534,20 +10541,20 @@ }, { "name": "hamcrest/hamcrest-php", - "version": "v2.0.1", + "version": "v2.1.1", "source": { "type": "git", "url": "https://github.com/hamcrest/hamcrest-php.git", - "reference": "8c3d0a3f6af734494ad8f6fbbee0ba92422859f3" + "reference": "f8b1c0173b22fa6ec77a81fe63e5b01eba7e6487" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/8c3d0a3f6af734494ad8f6fbbee0ba92422859f3", - "reference": "8c3d0a3f6af734494ad8f6fbbee0ba92422859f3", + "url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/f8b1c0173b22fa6ec77a81fe63e5b01eba7e6487", + "reference": "f8b1c0173b22fa6ec77a81fe63e5b01eba7e6487", "shasum": "" }, "require": { - "php": "^5.3|^7.0|^8.0" + "php": "^7.4|^8.0" }, "replace": { "cordoval/hamcrest-php": "*", @@ -10555,8 +10562,8 @@ "kodova/hamcrest-php": "*" }, "require-dev": { - "phpunit/php-file-iterator": "^1.4 || ^2.0", - "phpunit/phpunit": "^4.8.36 || ^5.7 || ^6.5 || ^7.0" + "phpunit/php-file-iterator": "^1.4 || ^2.0 || ^3.0", + "phpunit/phpunit": "^4.8.36 || ^5.7 || ^6.5 || ^7.0 || ^8.0 || ^9.0" }, "type": "library", "extra": { @@ -10579,9 +10586,9 @@ ], "support": { "issues": "https://github.com/hamcrest/hamcrest-php/issues", - "source": "https://github.com/hamcrest/hamcrest-php/tree/v2.0.1" + "source": "https://github.com/hamcrest/hamcrest-php/tree/v2.1.1" }, - "time": "2020-07-09T08:09:16+00:00" + "time": "2025-04-30T06:54:44+00:00" }, { "name": "iamcal/sql-parser", @@ -10863,16 +10870,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.13.0", + "version": "1.13.1", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "024473a478be9df5fdaca2c793f2232fe788e414" + "reference": "1720ddd719e16cf0db4eb1c6eca108031636d46c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/024473a478be9df5fdaca2c793f2232fe788e414", - "reference": "024473a478be9df5fdaca2c793f2232fe788e414", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/1720ddd719e16cf0db4eb1c6eca108031636d46c", + "reference": "1720ddd719e16cf0db4eb1c6eca108031636d46c", "shasum": "" }, "require": { @@ -10911,7 +10918,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.13.0" + "source": "https://github.com/myclabs/DeepCopy/tree/1.13.1" }, "funding": [ { @@ -10919,7 +10926,7 @@ "type": "tidelift" } ], - "time": "2025-02-12T12:17:51+00:00" + "time": "2025-04-29T12:36:36+00:00" }, { "name": "nikic/php-parser", @@ -11217,16 +11224,16 @@ }, { "name": "phpstan/phpstan", - "version": "2.1.13", + "version": "2.1.14", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "e55e03e6d4ac49cd1240907e5b08e5cd378572a9" + "reference": "8f2e03099cac24ff3b379864d171c5acbfc6b9a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/e55e03e6d4ac49cd1240907e5b08e5cd378572a9", - "reference": "e55e03e6d4ac49cd1240907e5b08e5cd378572a9", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/8f2e03099cac24ff3b379864d171c5acbfc6b9a2", + "reference": "8f2e03099cac24ff3b379864d171c5acbfc6b9a2", "shasum": "" }, "require": { @@ -11271,7 +11278,7 @@ "type": "github" } ], - "time": "2025-04-27T12:28:25+00:00" + "time": "2025-05-02T15:32:28+00:00" }, { "name": "phpstan/phpstan-deprecation-rules", @@ -11693,16 +11700,16 @@ }, { "name": "phpunit/phpunit", - "version": "11.5.18", + "version": "11.5.19", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "fc3e887c7f3f9917e1bf61e523413d753db00a17" + "reference": "0da1ebcdbc4d5bd2d189cfe02846a89936d8dda5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/fc3e887c7f3f9917e1bf61e523413d753db00a17", - "reference": "fc3e887c7f3f9917e1bf61e523413d753db00a17", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/0da1ebcdbc4d5bd2d189cfe02846a89936d8dda5", + "reference": "0da1ebcdbc4d5bd2d189cfe02846a89936d8dda5", "shasum": "" }, "require": { @@ -11712,7 +11719,7 @@ "ext-mbstring": "*", "ext-xml": "*", "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.13.0", + "myclabs/deep-copy": "^1.13.1", "phar-io/manifest": "^2.0.4", "phar-io/version": "^3.2.1", "php": ">=8.2", @@ -11774,7 +11781,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/11.5.18" + "source": "https://github.com/sebastianbergmann/phpunit/tree/11.5.19" }, "funding": [ { @@ -11798,7 +11805,66 @@ "type": "tidelift" } ], - "time": "2025-04-22T06:09:49+00:00" + "time": "2025-05-02T06:56:52+00:00" + }, + { + "name": "rector/rector", + "version": "2.0.14", + "source": { + "type": "git", + "url": "https://github.com/rectorphp/rector.git", + "reference": "63923bc9383c1212476c41d8cebf58a425e6f98d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/rectorphp/rector/zipball/63923bc9383c1212476c41d8cebf58a425e6f98d", + "reference": "63923bc9383c1212476c41d8cebf58a425e6f98d", + "shasum": "" + }, + "require": { + "php": "^7.4|^8.0", + "phpstan/phpstan": "^2.1.12" + }, + "conflict": { + "rector/rector-doctrine": "*", + "rector/rector-downgrade-php": "*", + "rector/rector-phpunit": "*", + "rector/rector-symfony": "*" + }, + "suggest": { + "ext-dom": "To manipulate phpunit.xml via the custom-rule command" + }, + "bin": [ + "bin/rector" + ], + "type": "library", + "autoload": { + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Instant Upgrade and Automated Refactoring of any PHP code", + "keywords": [ + "automation", + "dev", + "migration", + "refactoring" + ], + "support": { + "issues": "https://github.com/rectorphp/rector/issues", + "source": "https://github.com/rectorphp/rector/tree/2.0.14" + }, + "funding": [ + { + "url": "https://github.com/tomasvotruba", + "type": "github" + } + ], + "time": "2025-04-28T00:03:14+00:00" }, { "name": "sebastian/cli-parser", @@ -12778,6 +12844,64 @@ ], "time": "2024-10-20T05:08:20+00:00" }, + { + "name": "thecodingmachine/phpstan-safe-rule", + "version": "v1.4.0", + "source": { + "type": "git", + "url": "https://github.com/thecodingmachine/phpstan-safe-rule.git", + "reference": "33dcbc3228c55ea4c364ecf74a3661cf7b7f168d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thecodingmachine/phpstan-safe-rule/zipball/33dcbc3228c55ea4c364ecf74a3661cf7b7f168d", + "reference": "33dcbc3228c55ea4c364ecf74a3661cf7b7f168d", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^5", + "php": "^8.1", + "phpstan/phpstan": "^2.0", + "thecodingmachine/safe": "^1.2 || ^2.0 || ^3.0" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpunit": "^10.4", + "squizlabs/php_codesniffer": "^3.4" + }, + "type": "phpstan-extension", + "extra": { + "phpstan": { + "includes": [ + "phpstan-safe-rule.neon" + ] + }, + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "psr-4": { + "TheCodingMachine\\Safe\\PHPStan\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "David Négrier", + "email": "d.negrier@thecodingmachine.com" + } + ], + "description": "A PHPStan rule to detect safety issues. Must be used in conjunction with thecodingmachine/safe", + "support": { + "issues": "https://github.com/thecodingmachine/phpstan-safe-rule/issues", + "source": "https://github.com/thecodingmachine/phpstan-safe-rule/tree/v1.4.0" + }, + "time": "2025-02-11T12:41:29+00:00" + }, { "name": "theseer/tokenizer", "version": "1.2.3",