diff options
author | Paul S. Owen <psotfx@users.sourceforge.net> | 2001-07-11 01:09:26 +0000 |
---|---|---|
committer | Paul S. Owen <psotfx@users.sourceforge.net> | 2001-07-11 01:09:26 +0000 |
commit | 2cabdbebc3797c6b20b97dc5dc6ad57a43923fa2 (patch) | |
tree | b930f066e15307d38b91b92027bc7a5f048e400c | |
parent | cef137d818ca51bb61a0dc06704634d38dae71b4 (diff) | |
download | forums-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.php | 9 |
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]; |