Merge pull request #6702 from marc1706/ticket/16777

[ticket/16777] Remove remainders of max image size
This commit is contained in:
Marc Alexander 2024-09-29 20:47:40 +02:00 committed by GitHub
commit 94112979a0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 38 additions and 20 deletions

View file

@ -260,8 +260,6 @@ class acp_board
'max_sig_urls' => array('lang' => 'MAX_SIG_URLS', 'validate' => 'int:0:9999', 'type' => 'number:0:9999', 'explain' => true), 'max_sig_urls' => array('lang' => 'MAX_SIG_URLS', 'validate' => 'int:0:9999', 'type' => 'number:0:9999', 'explain' => true),
'max_sig_font_size' => array('lang' => 'MAX_SIG_FONT_SIZE', 'validate' => 'int:0:9999', 'type' => 'number:0:9999', 'explain' => true, 'append' => ' %'), 'max_sig_font_size' => array('lang' => 'MAX_SIG_FONT_SIZE', 'validate' => 'int:0:9999', 'type' => 'number:0:9999', 'explain' => true, 'append' => ' %'),
'max_sig_smilies' => array('lang' => 'MAX_SIG_SMILIES', 'validate' => 'int:0:9999', 'type' => 'number:0:9999', 'explain' => true), 'max_sig_smilies' => array('lang' => 'MAX_SIG_SMILIES', 'validate' => 'int:0:9999', 'type' => 'number:0:9999', 'explain' => true),
'max_sig_img_width' => array('lang' => 'MAX_SIG_IMG_WIDTH', 'validate' => 'int:0:9999', 'type' => 'number:0:9999', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
'max_sig_img_height' => array('lang' => 'MAX_SIG_IMG_HEIGHT', 'validate' => 'int:0:9999', 'type' => 'number:0:9999', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
'legend3' => 'ACP_SUBMIT_CHANGES', 'legend3' => 'ACP_SUBMIT_CHANGES',
) )

View file

@ -1179,8 +1179,6 @@ class parse_message extends bbcode_firstpass
// Set some config values // Set some config values
$parser->set_vars(array( $parser->set_vars(array(
'max_font_size' => $config['max_' . $this->mode . '_font_size'], 'max_font_size' => $config['max_' . $this->mode . '_font_size'],
'max_img_height' => $config['max_' . $this->mode . '_img_height'],
'max_img_width' => $config['max_' . $this->mode . '_img_width'],
'max_smilies' => $config['max_' . $this->mode . '_smilies'], 'max_smilies' => $config['max_' . $this->mode . '_smilies'],
'max_urls' => $config['max_' . $this->mode . '_urls'] 'max_urls' => $config['max_' . $this->mode . '_urls']
)); ));

View file

@ -404,8 +404,6 @@ class phpbb_questionnaire_phpbb_data_provider
'max_reg_attempts' => true, 'max_reg_attempts' => true,
'max_sig_chars' => true, 'max_sig_chars' => true,
'max_sig_font_size' => true, 'max_sig_font_size' => true,
'max_sig_img_height' => true,
'max_sig_img_width' => true,
'max_sig_smilies' => true, 'max_sig_smilies' => true,
'max_sig_urls' => true, 'max_sig_urls' => true,
'min_name_chars' => true, 'min_name_chars' => true,

View file

@ -225,8 +225,6 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_quote_depth',
INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_reg_attempts', '5'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_reg_attempts', '5');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_sig_chars', '255'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_sig_chars', '255');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_sig_font_size', '200'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_sig_font_size', '200');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_sig_img_height', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_sig_img_width', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_sig_smilies', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_sig_smilies', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_sig_urls', '5'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_sig_urls', '5');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('mention_batch_size', '50'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('mention_batch_size', '50');

View file

@ -208,10 +208,6 @@ $lang = array_merge($lang, array(
'MAX_SIG_FONT_SIZE' => 'Maximum signature font size', 'MAX_SIG_FONT_SIZE' => 'Maximum signature font size',
'MAX_SIG_FONT_SIZE_EXPLAIN' => 'Maximum font size allowed in user signatures. Set to 0 for unlimited size.', 'MAX_SIG_FONT_SIZE_EXPLAIN' => 'Maximum font size allowed in user signatures. Set to 0 for unlimited size.',
'MAX_SIG_IMG_HEIGHT' => 'Maximum signature image height',
'MAX_SIG_IMG_HEIGHT_EXPLAIN' => 'Maximum height of an image file in user signatures. Set to 0 for unlimited height.',
'MAX_SIG_IMG_WIDTH' => 'Maximum signature image width',
'MAX_SIG_IMG_WIDTH_EXPLAIN' => 'Maximum width of an image file in user signatures. Set to 0 for unlimited width.',
'MAX_SIG_LENGTH' => 'Maximum signature length', 'MAX_SIG_LENGTH' => 'Maximum signature length',
'MAX_SIG_LENGTH_EXPLAIN' => 'Maximum number of characters in user signatures.', 'MAX_SIG_LENGTH_EXPLAIN' => 'Maximum number of characters in user signatures.',
'MAX_SIG_SMILIES' => 'Maximum smilies per signature', 'MAX_SIG_SMILIES' => 'Maximum smilies per signature',

View file

@ -0,0 +1,34 @@
<?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\v400;
use phpbb\db\migration\migration;
class remove_max_img_size extends migration
{
public static function depends_on(): array
{
return [
'\phpbb\db\migration\data\v400\dev',
];
}
public function update_data(): array
{
return [
['config.remove', ['max_sig_img_width']],
['config.remove', ['max_sig_img_height']],
];
}
}

View file

@ -91,8 +91,6 @@ interface parser_interface
* Set a variable to be used by the parser * Set a variable to be used by the parser
* *
* - max_font_size * - max_font_size
* - max_img_height
* - max_img_width
* - max_smilies * - max_smilies
* - max_urls * - max_urls
* *

View file

@ -355,8 +355,6 @@ class factory implements \phpbb\textformatter\cache_interface
// Register some vars with a default value. Those should be set at runtime by whatever calls // Register some vars with a default value. Those should be set at runtime by whatever calls
// the parser // the parser
$configurator->registeredVars['max_font_size'] = 0; $configurator->registeredVars['max_font_size'] = 0;
$configurator->registeredVars['max_img_height'] = 0;
$configurator->registeredVars['max_img_width'] = 0;
// Load the Emoji plugin and modify its tag's template to obey viewsmilies // Load the Emoji plugin and modify its tag's template to obey viewsmilies
$tag = $configurator->Emoji->getTag(); $tag = $configurator->Emoji->getTag();

View file

@ -18,14 +18,16 @@ class phpbb_functional_manifest_test extends phpbb_functional_test_case
{ {
public function test_manifest() public function test_manifest()
{ {
$url_path = preg_replace('#^(/.+)/$#', '$1', parse_url(self::$root_url, PHP_URL_PATH));
$expected = [ $expected = [
'name' => 'yourdomain.com', 'name' => 'yourdomain.com',
'short_name' => 'yourdomain', 'short_name' => 'yourdomain',
'display' => 'standalone', 'display' => 'standalone',
'orientation' => 'portrait', 'orientation' => 'portrait',
'dir' => 'ltr', 'dir' => 'ltr',
'start_url' => '/', 'start_url' => $url_path,
'scope' => '/', 'scope' => $url_path,
]; ];
$this->login(); $this->login();

View file

@ -40,8 +40,6 @@ class phpbb_text_processing_message_parser_test extends phpbb_test_case
$map = array( $map = array(
array('MAX_FONT_SIZE_EXCEEDED', 120, 'You may only use fonts up to size 120.'), array('MAX_FONT_SIZE_EXCEEDED', 120, 'You may only use fonts up to size 120.'),
array('MAX_FONT_SIZE_EXCEEDED', 200, 'You may only use fonts up to size 200.'), array('MAX_FONT_SIZE_EXCEEDED', 200, 'You may only use fonts up to size 200.'),
array('MAX_IMG_HEIGHT_EXCEEDED', 12, 'Your images may only be up to 12 pixels high.'),
array('MAX_IMG_WIDTH_EXCEEDED', 34, 'Your images may only be up to 34 pixels wide.'),
array('TOO_MANY_SMILIES', 3, 'Your message contains too many smilies. The maximum number of smilies allowed is 3.'), array('TOO_MANY_SMILIES', 3, 'Your message contains too many smilies. The maximum number of smilies allowed is 3.'),
array('TOO_MANY_URLS', 2, 'Your message contains too many URLs. The maximum number of URLs allowed is 2.'), array('TOO_MANY_URLS', 2, 'Your message contains too many URLs. The maximum number of URLs allowed is 2.'),
array('UNAUTHORISED_BBCODE', '[img]', 'You cannot use certain BBCodes: [img].'), array('UNAUTHORISED_BBCODE', '[img]', 'You cannot use certain BBCodes: [img].'),