1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

Introduced checks to stop negative postcounts (Bug #11561, #11421)

Allow IP v4/v6 urls for remote avatars (Bug #11633)
 Delete avatar files automatically (Bug #11631)
 Automatically add selected columsn to group by statements in the converter (Bug #11465)


git-svn-id: file:///svn/phpbb/trunk@7677 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Henry Sudhof
2007-05-25 16:03:40 +00:00
parent 17315b69c6
commit 20993d5cf1
6 changed files with 39 additions and 10 deletions

View File

@@ -1595,8 +1595,7 @@ function avatar_remote($data, &$error)
{
$data['remotelink'] = 'http://' . $data['remotelink'];
}
if (!preg_match('#^(http|https|ftp)://(.*?\.)*?[a-z0-9\-]+?\.[a-z]{2,4}:?([0-9]*?).*?\.(gif|jpg|jpeg|png)$#i', $data['remotelink']))
if (!preg_match('#^(http|https|ftp)://(?:(.*?\.)*?[a-z0-9\-]+?\.[a-z]{2,4}|(?:\d{1,3}\.){3,5}\d{1,3}):?([0-9]*?).*?\.(gif|jpg|jpeg|png)$#i', $data['remotelink']))
{
$error[] = $user->lang['AVATAR_URL_INVALID'];
return false;
@@ -2023,7 +2022,8 @@ function avatar_process_user(&$error, $custom_userdata = false)
$userdata = ($custom_userdata === false) ? $user->data : $custom_userdata;
// Delete old avatar if present
if ($userdata['user_avatar'] && empty($sql_ary['user_avatar']) && $userdata['user_avatar_type'] != AVATAR_GALLERY)
if ((!empty($userdata['user_avatar']) && empty($sql_ary['user_avatar']) && $userdata['user_avatar_type'] == AVATAR_UPLOAD)
|| ( !empty($userdata['user_avatar']) && !empty($sql_ary['user_avatar']) && $userdata['user_avatar_type'] == AVATAR_UPLOAD && $sql_ary['user_avatar_type'] != AVATAR_UPLOAD))
{
avatar_delete('user', $userdata);
}