Add Symfony Validation to entity User

This commit is contained in:
2026-06-25 16:08:56 +02:00
parent dbf23badf9
commit c21b869641
5 changed files with 32 additions and 4 deletions
+24
View File
@@ -12,6 +12,8 @@ use Symfony\Component\Routing\Attribute\Route;
use Psr\Log\LoggerInterface;
use Symfony\Component\Process\Process;
#[Route('/admin/test')]
final class TestController extends AbstractController
{
@@ -63,4 +65,26 @@ final class TestController extends AbstractController
return $this->render('/frontend/test.html.twig', []);
}
#[Route('/url', name: 'app_test_url')]
public function url()
{
$process = new Process([
'yt-dlp',
'--print',
'%(title)s|%(filesize,filesize_approx)s',
'--', // 🛡️ Protection cruciale contre l'injection d'arguments
'https://www.youtube.com/watch?v=Z8hhP38-4Eg'
]);
$process->run();
//dd($process->getOutput());
if (!$process->isSuccessful()) {
echo $process->getCommandLine() . "<br>" . $process->getErrorOutput();
die;
return new Response("error1", Response::HTTP_INTERNAL_SERVER_ERROR);
}
}
//
}