mirror of
https://github.com/phpbb/phpbb.git
synced 2025-03-23 09:00:48 +01:00
Merge branch '3.3.x'
This commit is contained in:
commit
2d5289ed7e
phpBB
includes/acp
install/schemas
language/en/acp
phpbb
tests/plupload
@ -168,6 +168,8 @@ class acp_attachments
|
||||
'img_max_thumb_width' => array('lang' => 'MAX_THUMB_WIDTH', 'validate' => 'int:0:999999999999999', 'type' => 'number:0:999999999999999', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
|
||||
'img_min_thumb_filesize' => array('lang' => 'MIN_THUMB_FILESIZE', 'validate' => 'int:0:999999999999999', 'type' => 'number:0:999999999999999', 'explain' => true, 'append' => ' ' . $user->lang['BYTES']),
|
||||
'img_max' => array('lang' => 'MAX_IMAGE_SIZE', 'validate' => 'int:0:9999', 'type' => 'dimension:0:9999', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
|
||||
'img_strip_metadata' => array('lang' => 'IMAGE_STRIP_METADATA', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
|
||||
'img_quality' => array('lang' => 'IMAGE_QUALITY', 'validate' => 'int:50:90', 'type' => 'number:50:90', 'explain' => true, 'append' => ' %'),
|
||||
'img_link' => array('lang' => 'IMAGE_LINK_SIZE', 'validate' => 'int:0:9999', 'type' => 'dimension:0:9999', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
|
||||
)
|
||||
);
|
||||
|
@ -154,6 +154,8 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('img_max_height', '
|
||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('img_max_thumb_width', '400');
|
||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('img_max_width', '0');
|
||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('img_min_thumb_filesize', '12000');
|
||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('img_quality', '85');
|
||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('img_strip_metadata', '0');
|
||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('ip_check', '3');
|
||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('ip_login_limit_max', '50');
|
||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('ip_login_limit_time', '21600');
|
||||
|
@ -109,6 +109,10 @@ $lang = array_merge($lang, array(
|
||||
|
||||
'IMAGE_LINK_SIZE' => 'Image link dimensions',
|
||||
'IMAGE_LINK_SIZE_EXPLAIN' => 'Display image attachment as an inline text link if image is larger than this. To disable this behaviour, set the values to 0px by 0px.',
|
||||
'IMAGE_QUALITY' => 'Quality of uploaded image attachments (JPEG only)',
|
||||
'IMAGE_QUALITY_EXPLAIN' => 'Specify value between 50% (smaller file size) and 90% (higher quality). Quality higher than 90% increases filesize and is disabled. Setting only applies if maximum image dimensions are set to a value other than 0px by 0px.',
|
||||
'IMAGE_STRIP_METADATA' => 'Strip image metadata (JPEG only)',
|
||||
'IMAGE_STRIP_METADATA_EXPLAIN' => 'Strip Exif metadata, e.g. author name, GPS coordinates and camera details. Setting only applies if maximum image dimensions are set to a value other than 0px by 0px.',
|
||||
|
||||
'MAX_ATTACHMENTS' => 'Maximum number of attachments per post',
|
||||
'MAX_ATTACHMENTS_PM' => 'Maximum number of attachments per private message',
|
||||
|
30
phpBB/phpbb/db/migration/data/v32x/add_plupload_config.php
Normal file
30
phpBB/phpbb/db/migration/data/v32x/add_plupload_config.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* This file is part of the phpBB Forum Software package.
|
||||
*
|
||||
* @copyright (c) phpBB Limited <https://www.phpbb.com>
|
||||
* @license GNU General Public License, version 2 (GPL-2.0)
|
||||
*
|
||||
* For full copyright and license information, please see
|
||||
* the docs/CREDITS.txt file.
|
||||
*
|
||||
*/
|
||||
|
||||
namespace phpbb\db\migration\data\v32x;
|
||||
|
||||
class add_plupload_config extends \phpbb\db\migration\migration
|
||||
{
|
||||
static public function depends_on()
|
||||
{
|
||||
return ['\phpbb\db\migration\data\v32x\v329'];
|
||||
}
|
||||
|
||||
public function update_data()
|
||||
{
|
||||
return [
|
||||
['config.add', ['img_quality', '85']],
|
||||
['config.add', ['img_strip_metadata', '0']],
|
||||
];
|
||||
}
|
||||
}
|
@ -263,10 +263,13 @@ class plupload
|
||||
$resize = '';
|
||||
if ($this->config['img_max_height'] > 0 && $this->config['img_max_width'] > 0)
|
||||
{
|
||||
$preserve_headers_value = $this->config['img_strip_metadata'] ? 'false' : 'true';
|
||||
$resize = sprintf(
|
||||
'resize: {width: %d, height: %d, quality: 85},',
|
||||
'resize: {width: %d, height: %d, quality: %d, preserve_headers: %s},',
|
||||
(int) $this->config['img_max_width'],
|
||||
(int) $this->config['img_max_height']
|
||||
(int) $this->config['img_max_height'],
|
||||
(int) $this->config['img_quality'],
|
||||
$preserve_headers_value
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -19,12 +19,16 @@ class phpbb_plupload_test extends phpbb_test_case
|
||||
array(
|
||||
0,
|
||||
0,
|
||||
85,
|
||||
0,
|
||||
'',
|
||||
),
|
||||
array(
|
||||
130,
|
||||
150,
|
||||
'resize: {width: 130, height: 150, quality: 85},'
|
||||
85,
|
||||
1,
|
||||
'resize: {width: 130, height: 150, quality: 85, preserve_headers: false},'
|
||||
),
|
||||
);
|
||||
}
|
||||
@ -32,7 +36,7 @@ class phpbb_plupload_test extends phpbb_test_case
|
||||
/**
|
||||
* @dataProvider generate_resize_string_data
|
||||
*/
|
||||
public function test_generate_resize_string($config_width, $config_height, $expected)
|
||||
public function test_generate_resize_string($config_width, $config_height, $config_quality, $config_metadata, $expected)
|
||||
{
|
||||
global $phpbb_root_path, $phpEx;
|
||||
|
||||
@ -41,6 +45,8 @@ class phpbb_plupload_test extends phpbb_test_case
|
||||
$config = new \phpbb\config\config(array(
|
||||
'img_max_width' => $config_width,
|
||||
'img_max_height' => $config_height,
|
||||
'img_quality' => $config_quality,
|
||||
'img_strip_metadata' => $config_metadata,
|
||||
'upload_path' => 'files',
|
||||
));
|
||||
$plupload = new \phpbb\plupload\plupload(
|
||||
|
Loading…
x
Reference in New Issue
Block a user