aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul S. Owen <psotfx@users.sourceforge.net>2001-07-11 01:09:26 +0000
committerPaul S. Owen <psotfx@users.sourceforge.net>2001-07-11 01:09:26 +0000
commit2cabdbebc3797c6b20b97dc5dc6ad57a43923fa2 (patch)
treeb930f066e15307d38b91b92027bc7a5f048e400c
parentcef137d818ca51bb61a0dc06704634d38dae71b4 (diff)
downloadforums-2cabdbebc3797c6b20b97dc5dc6ad57a43923fa2.tar
forums-2cabdbebc3797c6b20b97dc5dc6ad57a43923fa2.tar.gz
forums-2cabdbebc3797c6b20b97dc5dc6ad57a43923fa2.tar.bz2
forums-2cabdbebc3797c6b20b97dc5dc6ad57a43923fa2.tar.xz
forums-2cabdbebc3797c6b20b97dc5dc6ad57a43923fa2.zip
Fixed content type check when using Opera
git-svn-id: file:///svn/phpbb/trunk@626 89ea8834-ac86-4346-8a33-228a782c2dd0
-rw-r--r--phpBB/profile.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/phpBB/profile.php b/phpBB/profile.php
index 0fddd45cce..348b958c41 100644
--- a/phpBB/profile.php
+++ b/phpBB/profile.php
@@ -553,6 +553,13 @@ if(isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']))
if($user_avatar_size <= $board_config['avatar_filesize'] && $avatar_size > 0)
{
$error_type = false;
+
+ //
+ // Opera appends the image name after the type, not big, not clever!
+ //
+ preg_match("'(image\/[a-z]+)'", $user_avatar_type, $user_avatar_type);
+ $user_avatar_type = $user_avatar_type[1];
+
switch($user_avatar_type)
{
case "image/jpeg":
@@ -648,7 +655,7 @@ if(isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']))
}
fclose($fsock);
- if(preg_match("/Content-Length\: ([0-9]+)[^\/]+Content-Type\: ([^.*]+?)[\s]+/i", $avatar_data, $file_data))
+ if(preg_match("/Content-Length\: ([0-9]+)[^\/]+Content-Type\: (image\/[a-z]+)[\s]+/i", $avatar_data, $file_data))
{
$file_size = $file_data[1];
$file_type = $file_data[2];