From 9559ea4fc6f7758c5252fb5cee1b5fa5315da94a Mon Sep 17 00:00:00 2001 From: deva Date: Mon, 27 Oct 2008 18:08:29 +0000 Subject: Fixed bug, where links were not converted corretly when residing at the end of the message. --- forum/utils/profile.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'forum/utils/profile.php') diff --git a/forum/utils/profile.php b/forum/utils/profile.php index a8676b4..b8b46d2 100644 --- a/forum/utils/profile.php +++ b/forum/utils/profile.php @@ -17,7 +17,8 @@ if($action == "update") { if(is_uploaded_file($_FILES['userfile']['tmp_name'])) { if(!file_exists("gfx/avatars")) mkdir("gfx/avatars"); - $filename = $_FILES['userfile']['name']; + // Prepend username to prevent overwriting of other users avatars. + $filename = $current_user->username . "_" . $_FILES['userfile']['name']; if($current_user->avatar) unlink("gfx/avatars/" . $current_user->avatar); move_uploaded_file($_FILES['userfile']['tmp_name'], "gfx/avatars/" . $filename); $current_user->avatar = $filename; -- cgit v1.2.3