Commit fff8c20c authored by Guillaume Perréal's avatar Guillaume Perréal
Browse files

UploadedFileRepository: vérifie le format de l'idenfiant dans ->get.

Showing with 6 additions and 0 deletions
+6 -0
......@@ -93,6 +93,12 @@ class UploadedFileRepository extends EntityRepository implements FileManagerInte
public function get($id)
{
if(!$id) {
return null;
}
if(!is_string($id) || !\Rhumsaa\Uuid\Uuid::isValid($id)) {
throw new \InvalidArgumentException(sprintf("Identifiant invalide: %s", (string)$id));
}
return $this->findOneById($id);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment