1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-05-29 18:50:25 +02:00

Fix issue where nothing is reported for avatars larger than max filesize, bug

git-svn-id: file:///svn/phpbb/trunk@2373 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Paul S. Owen 2002-03-20 14:39:43 +00:00
parent f24f3be056
commit 45cb06bcc4

@ -215,6 +215,8 @@ if ( isset($HTTP_POST_VARS['submit']) || isset($HTTP_POST_VARS['avatargallery'])
if ( isset($HTTP_POST_VARS['submit']) ) if ( isset($HTTP_POST_VARS['submit']) )
{ {
include($phpbb_root_path . 'includes/usercp_avatar.'.$phpEx);
$error = FALSE; $error = FALSE;
$passwd_sql = ''; $passwd_sql = '';
@ -354,13 +356,11 @@ if ( isset($HTTP_POST_VARS['submit']) )
$signature = prepare_message($signature, $allowhtml, $allowbbcode, $allowsmilies, $signature_bbcode_uid); $signature = prepare_message($signature, $allowhtml, $allowbbcode, $allowsmilies, $signature_bbcode_uid);
} }
include($phpbb_root_path . 'includes/usercp_avatar.'.$phpEx);
if ( isset($HTTP_POST_VARS['avatardel']) && $mode == 'editprofile' ) if ( isset($HTTP_POST_VARS['avatardel']) && $mode == 'editprofile' )
{ {
$avatar_sql = user_avatar_delete($userdata['avatar_type'], $userdata['avatar_file']); $avatar_sql = user_avatar_delete($userdata['avatar_type'], $userdata['avatar_file']);
} }
else if ( ( $user_avatar_loc != '' || !empty($user_avatar_url) ) && $board_config['allow_avatar_upload'] ) else if ( ( $user_avatar_loc != '' || !empty($user_avatar_url) || !empty($user_avatar_name) ) && $board_config['allow_avatar_upload'] )
{ {
if ( !empty($user_avatar_loc) && !empty($user_avatar_url) ) if ( !empty($user_avatar_loc) && !empty($user_avatar_url) )
{ {
@ -383,7 +383,7 @@ if ( isset($HTTP_POST_VARS['submit']) )
$l_avatar_size = sprintf($lang['Avatar_filesize'], round($board_config['avatar_filesize'] / 1024)); $l_avatar_size = sprintf($lang['Avatar_filesize'], round($board_config['avatar_filesize'] / 1024));
$error = true; $error = true;
$error_msg = ( ( !empty($error_msg) ) ? '<br />' : '' ) . $l_avatar_size; $error_msg .= ( ( !empty($error_msg) ) ? '<br />' : '' ) . $l_avatar_size;
} }
} }
else if ( $user_avatar_remoteurl != '' && $board_config['allow_avatar_remote'] ) else if ( $user_avatar_remoteurl != '' && $board_config['allow_avatar_remote'] )
@ -395,7 +395,6 @@ if ( isset($HTTP_POST_VARS['submit']) )
$avatar_sql = user_avatar_gallery($mode, $error, $error_msg, $user_avatar_local); $avatar_sql = user_avatar_gallery($mode, $error, $error_msg, $user_avatar_local);
} }
if ( !$error ) if ( !$error )
{ {
if ( $avatar_sql == '' ) if ( $avatar_sql == '' )
@ -831,7 +830,7 @@ else
// us from doing file uploads.... // us from doing file uploads....
// //
$ini_val = ( phpversion() >= '4.0.0' ) ? 'ini_get' : 'get_cfg_var'; $ini_val = ( phpversion() >= '4.0.0' ) ? 'ini_get' : 'get_cfg_var';
$form_enctype = ( !$ini_val('file_uploads') || phpversion() == '4.0.4pl1' || !$board_config['allow_avatar_upload'] || ( phpversion() < '4.0.3' && $ini_val('open_basedir') != '' ) ) ? '' : 'enctype="multipart/form-data"'; $form_enctype = ( !@$ini_val('file_uploads') || phpversion() == '4.0.4pl1' || !$board_config['allow_avatar_upload'] || ( phpversion() < '4.0.3' && @$ini_val('open_basedir') != '' ) ) ? '' : 'enctype="multipart/form-data"';
$template->assign_vars(array( $template->assign_vars(array(
'USERNAME' => $username, 'USERNAME' => $username,