MDL-17065 user: profile iamges of deleted users are not accessible anymore
This commit is contained in:
+7
-4
@@ -17,10 +17,13 @@
|
||||
|
||||
if (count($args) == 2) {
|
||||
$userid = (integer)$args[0];
|
||||
$image = $args[1];
|
||||
$pathname = make_user_directory($userid, true) . "/$image";
|
||||
if (file_exists($pathname) and !is_dir($pathname)) {
|
||||
send_file($pathname, $image);
|
||||
// do not serve images of deleted users
|
||||
if ($user = get_record('user', 'id', $userid, 'deleted', 0, 'picture', 1)) {
|
||||
$image = $args[1];
|
||||
$pathname = make_user_directory($userid, true) . "/$image";
|
||||
if (file_exists($pathname) and !is_dir($pathname)) {
|
||||
send_file($pathname, $image);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user