Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
as6325400 committed Oct 21, 2024
1 parent add44de commit 74e36d9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions webapp/src/Controller/Team/SubmissionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,14 @@ public function createAction(Request $request, ?Problem $problem = null): Respon
$entryPoint = $formPaste->get('entry_point')->getData() ?: null;
// Check for invalid characters in entry point name
$invalidChars = '/[<>:"\/\\|?*]/';
if(preg_match($invalidChars, $entryPoint)) {
if (preg_match($invalidChars, $entryPoint)) {
$this->addFlash('danger', 'Invalid entry point name.');
return $this->redirectToRoute('team_index');
}
$tempFileName = $entryPoint . '.' . $language->getExtensions()[0];
} else {
$entryPoint = $tempFileName;
}
else $entryPoint = $tempFileName;

$tempFilePath = $tempDir . DIRECTORY_SEPARATOR . $tempFileName;
file_put_contents($tempFilePath, $codeContent);
Expand Down

0 comments on commit 74e36d9

Please sign in to comment.