mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
adjust text for getting image dimensions as well as not suppressing warnings for getimagesize()
git-svn-id: file:///svn/phpbb/trunk@6973 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
458bd5b3cd
commit
766e311ff3
7 changed files with 11 additions and 10 deletions
|
@ -65,7 +65,7 @@ class acp_icons
|
||||||
{
|
{
|
||||||
foreach ($img_ary as $img)
|
foreach ($img_ary as $img)
|
||||||
{
|
{
|
||||||
$img_size = @getimagesize($phpbb_root_path . $img_path . '/' . $path . $img);
|
$img_size = getimagesize($phpbb_root_path . $img_path . '/' . $path . $img);
|
||||||
|
|
||||||
if (!$img_size[0] || !$img_size[1] || strlen($img) > 255)
|
if (!$img_size[0] || !$img_size[1] || strlen($img) > 255)
|
||||||
{
|
{
|
||||||
|
@ -222,7 +222,7 @@ class acp_icons
|
||||||
{
|
{
|
||||||
if ($image_width[$image] == 0 || $image_height[$image] == 0)
|
if ($image_width[$image] == 0 || $image_height[$image] == 0)
|
||||||
{
|
{
|
||||||
$img_size = @getimagesize($phpbb_root_path . $img_path . '/' . $image);
|
$img_size = getimagesize($phpbb_root_path . $img_path . '/' . $image);
|
||||||
$image_width[$image] = $img_size[0];
|
$image_width[$image] = $img_size[0];
|
||||||
$image_height[$image] = $img_size[1];
|
$image_height[$image] = $img_size[1];
|
||||||
}
|
}
|
||||||
|
|
|
@ -2619,7 +2619,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'])
|
||||||
{
|
{
|
||||||
list($width, $height) = @getimagesize($filename);
|
list($width, $height) = getimagesize($filename);
|
||||||
|
|
||||||
$display_cat = (!$width && !$height) ? ATTACHMENT_CATEGORY_IMAGE : (($width <= $config['img_link_width'] && $height <= $config['img_link_height']) ? ATTACHMENT_CATEGORY_IMAGE : ATTACHMENT_CATEGORY_NONE);
|
$display_cat = (!$width && !$height) ? ATTACHMENT_CATEGORY_IMAGE : (($width <= $config['img_link_width'] && $height <= $config['img_link_height']) ? ATTACHMENT_CATEGORY_IMAGE : ATTACHMENT_CATEGORY_NONE);
|
||||||
}
|
}
|
||||||
|
@ -2704,7 +2704,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 = $user->lang['VIEWED'];
|
$l_downloaded_viewed = $user->lang['VIEWED'];
|
||||||
|
|
||||||
|
|
|
@ -358,7 +358,7 @@ function upload_attachment($form_name, $forum_id, $local = false, $local_storage
|
||||||
|
|
||||||
// If this error occurs a user tried to exploit an IE Bug by renaming extensions
|
// If this error occurs a user tried to exploit an IE Bug by renaming extensions
|
||||||
// Since the image category is displaying content inline we need to catch this.
|
// Since the image category is displaying content inline we need to catch this.
|
||||||
trigger_error($user->lang['UNABLE_GET_IMAGE_SIZE']);
|
trigger_error($user->lang['ATTACHED_IMAGE_NOT_IMAGE']);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do we have to create a thumbnail?
|
// Do we have to create a thumbnail?
|
||||||
|
@ -552,7 +552,7 @@ function create_thumbnail($source, $destination, $mimetype)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
list($width, $height, $type, ) = @getimagesize($source);
|
list($width, $height, $type, ) = getimagesize($source);
|
||||||
|
|
||||||
if (!$width || !$height)
|
if (!$width || !$height)
|
||||||
{
|
{
|
||||||
|
|
|
@ -313,7 +313,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];
|
||||||
|
|
|
@ -1394,7 +1394,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;
|
||||||
|
|
|
@ -273,7 +273,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)
|
||||||
{
|
{
|
||||||
|
|
|
@ -65,6 +65,7 @@ $lang = array_merge($lang, array(
|
||||||
'ARE_WATCHING_TOPIC' => 'You have subscribed to receive updates on this topic.',
|
'ARE_WATCHING_TOPIC' => 'You have subscribed to receive updates on this topic.',
|
||||||
'ASCENDING' => 'Ascending',
|
'ASCENDING' => 'Ascending',
|
||||||
'ATTACHMENTS' => 'Attachments',
|
'ATTACHMENTS' => 'Attachments',
|
||||||
|
'ATTACHED_IMAGE_NOT_IMAGE' => 'You tried to attach an invalid image file.',
|
||||||
'AUTHOR' => 'Author',
|
'AUTHOR' => 'Author',
|
||||||
'AUTH_NO_PROFILE_CREATED' => 'Creating a user profile failed',
|
'AUTH_NO_PROFILE_CREATED' => 'Creating a user profile failed',
|
||||||
'AVATAR_DISALLOWED_EXTENSION' => 'The extension %s is not allowed',
|
'AVATAR_DISALLOWED_EXTENSION' => 'The extension %s is not allowed',
|
||||||
|
@ -559,7 +560,7 @@ $lang = array_merge($lang, array(
|
||||||
'TOTAL_USERS_ZERO' => 'Total members <strong>0</strong>',
|
'TOTAL_USERS_ZERO' => 'Total members <strong>0</strong>',
|
||||||
'TRACKED_PHP_ERROR' => 'Tracked PHP errors: %s',
|
'TRACKED_PHP_ERROR' => 'Tracked PHP errors: %s',
|
||||||
|
|
||||||
'UNABLE_GET_IMAGE_SIZE' => 'Accessing the image was impossible or file isn’t a valid image.',
|
'UNABLE_GET_IMAGE_SIZE' => 'It was not possible to determine the dimensions of the image.',
|
||||||
'UNABLE_TO_DELIVER_FILE'=> 'Unable to deliver file.',
|
'UNABLE_TO_DELIVER_FILE'=> 'Unable to deliver file.',
|
||||||
'UNKNOWN_BROWSER' => 'Unknown browser',
|
'UNKNOWN_BROWSER' => 'Unknown browser',
|
||||||
'UNMARK_ALL' => 'Unmark all',
|
'UNMARK_ALL' => 'Unmark all',
|
||||||
|
|
Loading…
Add table
Reference in a new issue