Add Symfony Validation to entity User
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
//
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user