aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/develop
diff options
context:
space:
mode:
authorHenry Sudhof <kellanved@phpbb.com>2007-05-03 09:40:21 +0000
committerHenry Sudhof <kellanved@phpbb.com>2007-05-03 09:40:21 +0000
commit58ac5df6b376ef57c333565b94698c41b02e67cf (patch)
tree92927e747b85576a97e2abaa821b1caa6ccc380f /phpBB/develop
parent5e7a80cbd836a9f5daff45076a4ba02abd3c85a6 (diff)
downloadforums-58ac5df6b376ef57c333565b94698c41b02e67cf.tar
forums-58ac5df6b376ef57c333565b94698c41b02e67cf.tar.gz
forums-58ac5df6b376ef57c333565b94698c41b02e67cf.tar.bz2
forums-58ac5df6b376ef57c333565b94698c41b02e67cf.tar.xz
forums-58ac5df6b376ef57c333565b94698c41b02e67cf.zip
finetuning.
git-svn-id: file:///svn/phpbb/trunk@7454 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/develop')
-rwxr-xr-xphpBB/develop/adjust_avatars.php13
1 files changed, 10 insertions, 3 deletions
diff --git a/phpBB/develop/adjust_avatars.php b/phpBB/develop/adjust_avatars.php
index 5133ed8081..81599e694b 100755
--- a/phpBB/develop/adjust_avatars.php
+++ b/phpBB/develop/adjust_avatars.php
@@ -101,6 +101,11 @@ while ($row = $db->sql_fetchrow($result))
}
else
{
+ // nuke this avatar
+ $sql = 'UPDATE ' . USERS_TABLE . "
+ SET user_avatar = '', user_avatar_type = 0
+ WHERE user_id = {$row['user_id']}";
+ $db->sql_query($sql);
echo '<br /> Failed updating user ' . $row['user_id'] . "\n";
}
@@ -128,11 +133,13 @@ function adjust_avatar($old_name, $midfix)
global $config, $phpbb_root_path;
$avatar_path = $phpbb_root_path . $config['avatar_path'];
- if (@file_exists($avatar_path . '/' . $old_name) && @is_writable($avatar_path . '/' . $old_name))
+ $extension = strtolower(substr(strrchr($old_name, '.'), 1));
+ $new_name = $config['avatar_salt'] . '_' . $midfix . '.' . $extension;
+
+ if (@file_exists($avatar_path . '/' . $old_name) && @is_writable($avatar_path . '/' . $old_name) && @is_writable($avatar_path . '/' . $new_name))
{
- $new_name = $config['avatar_salt'] . '_' . $midfix . '.' . substr(strrchr($old_name, '.'), 1);
@rename($avatar_path . '/' . $old_name, $avatar_path . '/' . $new_name);
- return $midfix . '.' . substr(strrchr($old_name, '.'), 1);
+ return $midfix . '.' . $extension;
}
return false;
}