Code: Select all
if ( $width > 0 && $height > 0 && $width <= $board_config['avatar_max_width'] && $height <= $board_config['avatar_max_height'] )
Code: Select all
list($width, $height) = @getimagesize($avatar_filename);
Code: Select all
echo("CUSTOM 3!!!");
echo("width=$width");
echo("height=$height");
echo("imagesize=".@getimagesize($avatar_filename));
echo("avatar_filename=".$avatar_filename);
Code: Select all
//new
$avatar_file = basename($avatar_file);
//new
$avatar_filename = str_replace(array('../', '..\\', './', '.\\'), '', $avatar_filename);
if ($avatar_filename{0} == '/' || $avatar_filename{0} == "\\")
{
return '';
}
//new
global $lang;
//changed
if ( !preg_match("#^((ht|f)tp://)([^ \?&=\#\"\n\r\t<]*?(\.(jpg|jpeg|gif|png))$)#is", $avatar_filename) )
//changed
if ( $width > 0 && $height > 0 && $width <= $board_config['avatar_max_width'] && $height <= $board_config['avatar_max_height'] )
//new
if (!is_uploaded_file($avatar_filename))
{
message_die(GENERAL_ERROR, 'Unable to upload file', '', __LINE__, __FILE__);
}
Code: Select all
echo("width=".$width."height=".$height);
Code: Select all
if ( $width > 0 && $height > 0 && $width <= $board_config['avatar_max_width'] && $height <= $board_config['avatar_max_height'] )
Code: Select all
if ( $width <= $board_config['avatar_max_width'] && $height <= $board_config['avatar_max_height'] )
failed to open stream: Permission denied
Code: Select all
$move_file($avatar_filename, './' . $board_config['avatar_path'] . "/$new_filename");
Code: Select all
@getimagesize($avatar_filename);