aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_user.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2006-09-05 15:17:45 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2006-09-05 15:17:45 +0000
commit504eef65c5fe128c86cd2f122cda53cf4df04347 (patch)
treeac2a79f958f0679295bd2a8eddff84229dfcf002 /phpBB/includes/functions_user.php
parent2c2a2c10d92d76a1497469bb15b2e4f6d499793e (diff)
downloadforums-504eef65c5fe128c86cd2f122cda53cf4df04347.tar
forums-504eef65c5fe128c86cd2f122cda53cf4df04347.tar.gz
forums-504eef65c5fe128c86cd2f122cda53cf4df04347.tar.bz2
forums-504eef65c5fe128c86cd2f122cda53cf4df04347.tar.xz
forums-504eef65c5fe128c86cd2f122cda53cf4df04347.zip
check file type
git-svn-id: file:///svn/phpbb/trunk@6354 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions_user.php')
-rw-r--r--phpBB/includes/functions_user.php20
1 files changed, 19 insertions, 1 deletions
diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php
index 1e688e8ab0..1d41aeb9ba 100644
--- a/phpBB/includes/functions_user.php
+++ b/phpBB/includes/functions_user.php
@@ -1255,7 +1255,7 @@ function avatar_delete($id)
*/
function avatar_remote($data, &$error)
{
- global $config, $db, $user, $phpbb_root_path;
+ global $config, $db, $user, $phpbb_root_path, $phpEx;
if (!preg_match('#^(http|https|ftp)://#i', $data['remotelink']))
{
@@ -1284,6 +1284,24 @@ function avatar_remote($data, &$error)
return false;
}
+ // Check image type
+ include_once($phpbb_root_path . 'includes/functions_upload.' . $phpEx);
+ $types = fileupload::image_types();
+ $extension = strtolower(filespec::get_extension($data['remotelink']));
+
+ if (!isset($types[$image_data[2]]) || !in_array($extension, $types[$image_data[2]]))
+ {
+ if (!isset($types[$image_data[2]]))
+ {
+ $error[] = $user->lang['UNABLE_GET_IMAGE_SIZE'];
+ }
+ else
+ {
+ $error[] = sprintf($user->lang['IMAGE_FILETYPE_MISMATCH'], $types[$image_data[2]][0], $extension);
+ }
+ return false;
+ }
+
if ($config['avatar_max_width'] || $config['avatar_max_height'])
{
if ($width > $config['avatar_max_width'] || $height > $config['avatar_max_height'])