Skip to content

Commit

Permalink
Validate locale earlier
Browse files Browse the repository at this point in the history
  • Loading branch information
kylekatarnls committed Dec 27, 2024
1 parent f01cfa9 commit 129700e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Carbon/AbstractTranslator.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ public function resetMessages(?string $locale = null): bool
return true;
}

$this->assertValidLocale($locale);

foreach ($this->getDirectories() as $directory) {
$data = @include \sprintf('%s/%s.php', rtrim($directory, '\\/'), $locale);

Expand Down

1 comment on commit 129700e

@Hirsi98
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the change? This change has broken many of our php features.

Please sign in to comment.