diff --git a/webapp/src/Service/SubmissionService.php b/webapp/src/Service/SubmissionService.php index 9d503fffee..c53cd17e45 100644 --- a/webapp/src/Service/SubmissionService.php +++ b/webapp/src/Service/SubmissionService.php @@ -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; }