diff --git a/user/pix.php b/user/pix.php index 8eb3c099c0b..b3509ef9393 100644 --- a/user/pix.php +++ b/user/pix.php @@ -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); + } } }