mirror of
https://github.com/itflow-org/itflow
synced 2026-03-08 06:44:51 +00:00
Add check on edit user to see if User directory is created before Avatar upload
This commit is contained in:
4
post.php
4
post.php
@@ -80,6 +80,10 @@ if(isset($_POST['edit_user'])){
|
|||||||
}
|
}
|
||||||
$path = strip_tags(mysqli_real_escape_string($mysqli,$_POST['current_avatar_path']));
|
$path = strip_tags(mysqli_real_escape_string($mysqli,$_POST['current_avatar_path']));
|
||||||
|
|
||||||
|
if(!file_exists("uploads/users/$user_id")) {
|
||||||
|
mkdir("uploads/users/$user_id");
|
||||||
|
}
|
||||||
|
|
||||||
if($_FILES['file']['tmp_name']!='') {
|
if($_FILES['file']['tmp_name']!='') {
|
||||||
//delete old avatar file
|
//delete old avatar file
|
||||||
unlink($path);
|
unlink($path);
|
||||||
|
|||||||
Reference in New Issue
Block a user