1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-05-11 01:55:24 +02:00

we included a check for getimagesize() existance... now we again can suppress notices while running this function.

git-svn-id: file:///svn/phpbb/trunk@7646 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen 2007-05-19 16:40:56 +00:00
parent 47d3e4d9b8
commit 4c44eddc90
10 changed files with 22 additions and 9 deletions

View File

@ -294,7 +294,7 @@ function send_avatar_to_browser($file)
{ {
header('Pragma: public'); header('Pragma: public');
$image_data = getimagesize($file_path); $image_data = @getimagesize($file_path);
header('Content-Type: ' . image_type_to_mime_type($image_data[2])); header('Content-Type: ' . image_type_to_mime_type($image_data[2]));
if (strpos(strtolower($browser), 'msie') !== false) if (strpos(strtolower($browser), 'msie') !== false)

View File

@ -2956,7 +2956,7 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,
{ {
if ($config['img_link_width'] || $config['img_link_height']) if ($config['img_link_width'] || $config['img_link_height'])
{ {
$dimension = getimagesize($filename); $dimension = @getimagesize($filename);
// If the dimensions could not be determined or the image being 0x0 we display it as a link for safety purposes // If the dimensions could not be determined or the image being 0x0 we display it as a link for safety purposes
if ($dimension === false || empty($dimension[0]) || empty($dimension[1])) if ($dimension === false || empty($dimension[0]) || empty($dimension[1]))
@ -3053,7 +3053,7 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,
// Macromedia Flash Files // Macromedia Flash Files
case ATTACHMENT_CATEGORY_FLASH: case ATTACHMENT_CATEGORY_FLASH:
list($width, $height) = getimagesize($filename); list($width, $height) = @getimagesize($filename);
$l_downloaded_viewed = 'VIEWED_COUNT'; $l_downloaded_viewed = 'VIEWED_COUNT';

View File

@ -679,7 +679,7 @@ function get_image_dim($source)
if (file_exists(relative_base($source, $relative_path))) if (file_exists(relative_base($source, $relative_path)))
{ {
$image = relative_base($source, $relative_path); $image = relative_base($source, $relative_path);
return getimagesize($image); return @getimagesize($image);
} }
return false; return false;

View File

@ -578,7 +578,7 @@ function create_thumbnail($source, $destination, $mimetype)
return false; return false;
} }
$dimension = getimagesize($source); $dimension = @getimagesize($source);
if ($dimension === false) if ($dimension === false)
{ {

View File

@ -319,7 +319,7 @@ class filespec
{ {
$this->width = $this->height = 0; $this->width = $this->height = 0;
if (($this->image_info = getimagesize($this->destination_file)) !== false) if (($this->image_info = @getimagesize($this->destination_file)) !== false)
{ {
$this->width = $this->image_info[0]; $this->width = $this->image_info[0];
$this->height = $this->image_info[1]; $this->height = $this->image_info[1];

View File

@ -1603,7 +1603,7 @@ function avatar_remote($data, &$error)
} }
// Make sure getimagesize works... // Make sure getimagesize works...
if (($image_data = getimagesize($data['remotelink'])) === false) if (($image_data = @getimagesize($data['remotelink'])) === false)
{ {
$error[] = $user->lang['UNABLE_GET_IMAGE_SIZE']; $error[] = $user->lang['UNABLE_GET_IMAGE_SIZE'];
return false; return false;

View File

@ -280,7 +280,7 @@ class bbcode_firstpass extends bbcode
if ($config['max_' . $this->mode . '_img_height'] || $config['max_' . $this->mode . '_img_width']) if ($config['max_' . $this->mode . '_img_height'] || $config['max_' . $this->mode . '_img_width'])
{ {
$stats = getimagesize($in); $stats = @getimagesize($in);
if ($stats === false) if ($stats === false)
{ {

View File

@ -459,6 +459,18 @@ function compose_pm($id, $mode, $action)
confirm_box(false, 'SAVE_DRAFT', $s_hidden_fields); confirm_box(false, 'SAVE_DRAFT', $s_hidden_fields);
} }
} }
else
{
if (!$subject)
{
$error[] = $user->lang['EMPTY_MESSAGE_SUBJECT'];
}
if (!$message)
{
$error[] = $user->lang['TOO_FEW_CHARS'];
}
}
unset($subject, $message); unset($subject, $message);
} }

View File

@ -329,7 +329,7 @@ $lang = array_merge($lang, array(
'POPUP_ON_PM' => 'Pop up window on new private message', 'POPUP_ON_PM' => 'Pop up window on new private message',
'POST_EDIT_PM' => 'Edit message', 'POST_EDIT_PM' => 'Edit message',
'POST_FORWARD_PM' => 'Forward message', 'POST_FORWARD_PM' => 'Forward message',
'POST_NEW_PM' => 'Post message', 'POST_NEW_PM' => 'Compose message',
'POST_PM_LOCKED' => 'Private messaging is locked', 'POST_PM_LOCKED' => 'Private messaging is locked',
'POST_PM_POST' => 'Quote post', 'POST_PM_POST' => 'Quote post',
'POST_QUOTE_PM' => 'Quote message', 'POST_QUOTE_PM' => 'Quote message',

View File

@ -1409,6 +1409,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
'S_UNREAD_POST' => $post_unread, 'S_UNREAD_POST' => $post_unread,
'S_FIRST_UNREAD' => $s_first_unread, 'S_FIRST_UNREAD' => $s_first_unread,
'S_CUSTOM_FIELDS' => (isset($cp_row['row']) && sizeof($cp_row['row'])) ? true : false, 'S_CUSTOM_FIELDS' => (isset($cp_row['row']) && sizeof($cp_row['row'])) ? true : false,
'S_TOPIC_POSTER' => ($topic_data['topic_poster'] == $poster_id) ? true : false,
'S_IGNORE_POST' => ($row['hide_post']) ? true : false, 'S_IGNORE_POST' => ($row['hide_post']) ? true : false,
'L_IGNORE_POST' => ($row['hide_post']) ? sprintf($user->lang['POST_BY_FOE'], get_username_string('full', $poster_id, $row['username'], $row['user_colour'], $row['post_username']), '<a href="' . $viewtopic_url . "&amp;p={$row['post_id']}&amp;view=show#p{$row['post_id']}" . '">', '</a>') : '', 'L_IGNORE_POST' => ($row['hide_post']) ? sprintf($user->lang['POST_BY_FOE'], get_username_string('full', $poster_id, $row['username'], $row['user_colour'], $row['post_username']), '<a href="' . $viewtopic_url . "&amp;p={$row['post_id']}&amp;view=show#p{$row['post_id']}" . '">', '</a>') : '',