From 35b97f5fffa97e407b6f977db079ee8100cd977a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oscar=20Rodr=C3=ADguez?= Date: Sat, 21 Nov 2020 21:14:54 +0100 Subject: [PATCH] Fix image upload --- src/AppBundle/Controller/UserController.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/AppBundle/Controller/UserController.php b/src/AppBundle/Controller/UserController.php index 6d3857b..79eca09 100644 --- a/src/AppBundle/Controller/UserController.php +++ b/src/AppBundle/Controller/UserController.php @@ -151,7 +151,6 @@ public function editAction(Request $request){ && $name != null && $surname != null){ - $user->setImage($image); $user->setRole($role); $user->setEmail($email); $user->setName($name); @@ -239,8 +238,8 @@ public function uploadImageAction(Request $request){ if(!empty($file) && $file != null){ $ext = $file->guessExtension(); - if($ext == 'jpg' || $ext == 'gif' - || $ext = 'jpeg' || $ext = 'png'){ + if($ext === 'jpg' || $ext === 'gif' + || $ext === 'jpeg' || $ext === 'png'){ $file_name = time().".".$ext; $file->move("uploads/users", $file_name);