Skip to content

Commit

Permalink
Submission: Use str_ends_with
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsNiklas authored and meisterT committed Nov 23, 2023
1 parent 2bd24d5 commit f866ca5
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions webapp/src/Service/SubmissionService.php
Original file line number Diff line number Diff line change
Expand Up @@ -530,9 +530,7 @@ public function submitSolution(
if ($source !== 'shadowing' && $language->getFilterCompilerFiles()) {
$matchesExtension = false;
foreach ($language->getExtensions() as $extension) {
$extensionWithDot = '.' . $extension;
$extensionLength = strlen($extensionWithDot);
if (substr($file->getClientOriginalName(), -$extensionLength) === $extensionWithDot) {
if (str_ends_with($file->getClientOriginalName(), '.' . $extension)) {
$matchesExtension = true;
break;
}
Expand Down

0 comments on commit f866ca5

Please sign in to comment.