From aca6e64669079abc385f3094d8b6c186d9b46082 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Fri, 6 Nov 2015 10:20:05 +0100 Subject: [ticket/14272] Only use maxlength and size for allowed input elements PHPBB3-14272 --- phpBB/adm/style/acp_attachments.html | 4 ++-- phpBB/adm/style/acp_avatar_options_gravatar.html | 4 ++-- phpBB/adm/style/acp_avatar_options_remote.html | 4 ++-- phpBB/adm/style/acp_captcha.html | 4 ++-- phpBB/adm/style/acp_forums.html | 12 +++++----- phpBB/adm/style/acp_groups.html | 4 ++-- phpBB/adm/style/acp_icons.html | 8 +++---- phpBB/adm/style/acp_inactive.html | 2 +- phpBB/adm/style/acp_jabber.html | 4 ++-- phpBB/adm/style/acp_ranks.html | 2 +- phpBB/adm/style/acp_search.html | 10 ++++---- phpBB/includes/acp/acp_attachments.php | 4 ++-- phpBB/includes/acp/acp_board.php | 4 ++-- phpBB/includes/functions_acp.php | 27 ++++++++++++---------- phpBB/phpbb/profilefields/type/type_int.php | 6 ++--- phpBB/phpbb/profilefields/type/type_string.php | 6 ++--- phpBB/phpbb/profilefields/type/type_text.php | 6 ++--- phpBB/phpbb/profilefields/type/type_url.php | 6 ++--- phpBB/phpbb/search/fulltext_native.php | 6 ++--- phpBB/phpbb/search/fulltext_postgres.php | 4 ++-- phpBB/phpbb/search/fulltext_sphinx.php | 4 ++-- phpBB/styles/prosilver/template/mcp_topic.html | 4 ++-- phpBB/styles/prosilver/template/pagination.html | 2 +- .../styles/prosilver/template/posting_editor.html | 2 +- .../prosilver/template/posting_poll_body.html | 4 ++-- phpBB/styles/subsilver2/template/mcp_topic.html | 4 ++-- .../subsilver2/template/posting_attach_body.html | 2 +- phpBB/styles/subsilver2/template/posting_body.html | 2 +- .../subsilver2/template/posting_poll_body.html | 4 ++-- tests/functions_acp/build_cfg_template_test.php | 8 +++---- 30 files changed, 83 insertions(+), 80 deletions(-) diff --git a/phpBB/adm/style/acp_attachments.html b/phpBB/adm/style/acp_attachments.html index da8a0096ea..d048191864 100644 --- a/phpBB/adm/style/acp_attachments.html +++ b/phpBB/adm/style/acp_attachments.html @@ -196,7 +196,7 @@
-
+
@@ -346,7 +346,7 @@ {orphan.REAL_FILENAME} {orphan.FILETIME} {orphan.FILESIZE} - {L_ATTACH_ID}{L_COLON} + {L_ATTACH_ID}{L_COLON} diff --git a/phpBB/adm/style/acp_avatar_options_gravatar.html b/phpBB/adm/style/acp_avatar_options_gravatar.html index 0c2e8cc984..dbe9891e19 100644 --- a/phpBB/adm/style/acp_avatar_options_gravatar.html +++ b/phpBB/adm/style/acp_avatar_options_gravatar.html @@ -5,7 +5,7 @@

{L_GRAVATAR_AVATAR_SIZE_EXPLAIN}
- {L_PIXEL} ×  - {L_PIXEL} + {L_PIXEL} ×  + {L_PIXEL}
diff --git a/phpBB/adm/style/acp_avatar_options_remote.html b/phpBB/adm/style/acp_avatar_options_remote.html index 1c0e3db599..3b514620b4 100644 --- a/phpBB/adm/style/acp_avatar_options_remote.html +++ b/phpBB/adm/style/acp_avatar_options_remote.html @@ -5,7 +5,7 @@

{L_LINK_REMOTE_SIZE_EXPLAIN}
- {L_PIXEL} ×  - {L_PIXEL} + {L_PIXEL} ×  + {L_PIXEL}
diff --git a/phpBB/adm/style/acp_captcha.html b/phpBB/adm/style/acp_captcha.html index f4866653c3..9c1f25fa03 100644 --- a/phpBB/adm/style/acp_captcha.html +++ b/phpBB/adm/style/acp_captcha.html @@ -20,11 +20,11 @@

{L_REG_LIMIT_EXPLAIN}
-
+

{L_MAX_LOGIN_ATTEMPTS_EXPLAIN}
-
+

{L_VISUAL_CONFIRM_POST_EXPLAIN}
diff --git a/phpBB/adm/style/acp_forums.html b/phpBB/adm/style/acp_forums.html index 0d8b8ad583..bba66c14d2 100644 --- a/phpBB/adm/style/acp_forums.html +++ b/phpBB/adm/style/acp_forums.html @@ -242,7 +242,7 @@

{L_FORUM_TOPICS_PAGE_EXPLAIN}
-
+
@@ -257,15 +257,15 @@

{L_AUTO_PRUNE_FREQ_EXPLAIN}
-
{L_DAYS}
+
{L_DAYS}

{L_AUTO_PRUNE_DAYS_EXPLAIN}
-
{L_DAYS}
+
{L_DAYS}

{L_AUTO_PRUNE_VIEWED_EXPLAIN}
-
{L_DAYS}
+
{L_DAYS}

{L_PRUNE_OLD_POLLS_EXPLAIN}
@@ -289,11 +289,11 @@

{L_AUTO_PRUNE_SHADOW_FREQ_EXPLAIN}
-
{L_DAYS}
+
{L_DAYS}

{L_AUTO_PRUNE_SHADOW_DAYS_EXPLAIN}
-
{L_DAYS}
+
{L_DAYS}
diff --git a/phpBB/adm/style/acp_groups.html b/phpBB/adm/style/acp_groups.html index d24d62497d..e062dbe005 100644 --- a/phpBB/adm/style/acp_groups.html +++ b/phpBB/adm/style/acp_groups.html @@ -86,11 +86,11 @@ {L_GROUP_SETTINGS_SAVE}

{L_GROUP_MESSAGE_LIMIT_EXPLAIN}
-
+

{L_GROUP_MAX_RECIPIENTS_EXPLAIN}
-
+

{L_GROUP_COLOR_EXPLAIN}
diff --git a/phpBB/adm/style/acp_icons.html b/phpBB/adm/style/acp_icons.html index f18dad0ef6..e0d2840bb5 100644 --- a/phpBB/adm/style/acp_icons.html +++ b/phpBB/adm/style/acp_icons.html @@ -108,8 +108,8 @@ - - + + @@ -136,8 +136,8 @@ - - + + + {L_DISPLAY_LOG}{L_COLON}  {S_LIMIT_DAYS} {L_SORT_BY}{L_COLON} {S_SORT_KEY} {S_SORT_DIR} {L_USERS_PER_PAGE}{L_COLON} diff --git a/phpBB/adm/style/acp_jabber.html b/phpBB/adm/style/acp_jabber.html index 9246987f1f..3c3b895624 100644 --- a/phpBB/adm/style/acp_jabber.html +++ b/phpBB/adm/style/acp_jabber.html @@ -31,7 +31,7 @@

{L_JAB_PORT_EXPLAIN}
-
+

{L_JAB_USERNAME_EXPLAIN}
@@ -50,7 +50,7 @@

{L_JAB_PACKAGE_SIZE_EXPLAIN}
-
+
diff --git a/phpBB/adm/style/acp_ranks.html b/phpBB/adm/style/acp_ranks.html index fa06513b98..e67c9acd80 100644 --- a/phpBB/adm/style/acp_ranks.html +++ b/phpBB/adm/style/acp_ranks.html @@ -44,7 +44,7 @@
style="display: none;">
-
+
diff --git a/phpBB/adm/style/acp_search.html b/phpBB/adm/style/acp_search.html index 1cde52acf3..0736d22fe7 100644 --- a/phpBB/adm/style/acp_search.html +++ b/phpBB/adm/style/acp_search.html @@ -18,11 +18,11 @@

{L_SEARCH_INTERVAL_EXPLAIN}
-
{L_SECONDS}
+
{L_SECONDS}

{L_SEARCH_GUEST_INTERVAL_EXPLAIN}
-
{L_SECONDS}
+
{L_SECONDS}

{L_LIMIT_SEARCH_LOAD_EXPLAIN}
@@ -30,15 +30,15 @@

{L_MIN_SEARCH_AUTHOR_CHARS_EXPLAIN}
-
+

{L_MAX_NUM_SEARCH_KEYWORDS_EXPLAIN}
-
+

{L_SEARCH_STORE_RESULTS_EXPLAIN}
-
{L_SECONDS}
+
{L_SECONDS}
diff --git a/phpBB/includes/acp/acp_attachments.php b/phpBB/includes/acp/acp_attachments.php index 4956aab241..b0e0711b22 100644 --- a/phpBB/includes/acp/acp_attachments.php +++ b/phpBB/includes/acp/acp_attachments.php @@ -1735,8 +1735,8 @@ class acp_attachments $size_var = $filesize['si_identifier']; $value = $filesize['value']; - // size="8" and maxlength="15" attributes as a fallback for browsers that do not support type="number" yet. - return ' '; + // size and maxlength must not be specified for input of type number + return ' '; } /** diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php index 4a1c74fd77..cec621e89d 100644 --- a/phpBB/includes/acp/acp_board.php +++ b/phpBB/includes/acp/acp_board.php @@ -842,7 +842,7 @@ class acp_board { global $user; - return ' ' . $user->lang['MIN_CHARS'] . '   ' . $user->lang['MAX_CHARS']; + return ' ' . $user->lang['MIN_CHARS'] . '   ' . $user->lang['MAX_CHARS']; } /** @@ -870,7 +870,7 @@ class acp_board { global $user; - return ' ' . $user->lang['MIN_CHARS'] . '   ' . $user->lang['MAX_CHARS']; + return ' ' . $user->lang['MIN_CHARS'] . '   ' . $user->lang['MAX_CHARS']; } /** diff --git a/phpBB/includes/functions_acp.php b/phpBB/includes/functions_acp.php index d566336d26..bd12c3dd5c 100644 --- a/phpBB/includes/functions_acp.php +++ b/phpBB/includes/functions_acp.php @@ -254,6 +254,16 @@ function build_cfg_template($tpl_type, $key, &$new, $config_key, $vars) case 'text': case 'url': case 'email': + case 'tel': + case 'search': + // maxlength and size are only valid for these types and will be + // ignored for other input types. + $size = (int) $tpl_type[1]; + $maxlength = (int) $tpl_type[2]; + + $tpl = ''; + break; + case 'color': case 'date': case 'time': @@ -261,39 +271,32 @@ function build_cfg_template($tpl_type, $key, &$new, $config_key, $vars) case 'datetime-local': case 'month': case 'range': - case 'search': - case 'tel': case 'week': - $size = (int) $tpl_type[1]; - $maxlength = (int) $tpl_type[2]; - - $tpl = ''; + $tpl = ''; break; case 'number': - $min = $max = $maxlength = ''; + $max = ''; $min = ( isset($tpl_type[1]) ) ? (int) $tpl_type[1] : false; if ( isset($tpl_type[2]) ) { $max = (int) $tpl_type[2]; - $maxlength = strlen( (string) $max ); } - $tpl = ''; + $tpl = ''; break; case 'dimension': - $min = $max = $maxlength = $size = ''; + $max = ''; $min = (int) $tpl_type[1]; if ( isset($tpl_type[2]) ) { $max = (int) $tpl_type[2]; - $size = $maxlength = strlen( (string) $max ); } - $tpl = ' x '; + $tpl = ' x '; break; case 'textarea': diff --git a/phpBB/phpbb/profilefields/type/type_int.php b/phpBB/phpbb/profilefields/type/type_int.php index dd08df94c1..9dc0181cb8 100644 --- a/phpBB/phpbb/profilefields/type/type_int.php +++ b/phpBB/phpbb/profilefields/type/type_int.php @@ -61,9 +61,9 @@ class type_int extends type_base public function get_options($default_lang_id, $field_data) { $options = array( - 0 => array('TITLE' => $this->user->lang['FIELD_LENGTH'], 'FIELD' => ''), - 1 => array('TITLE' => $this->user->lang['MIN_FIELD_NUMBER'], 'FIELD' => ''), - 2 => array('TITLE' => $this->user->lang['MAX_FIELD_NUMBER'], 'FIELD' => ''), + 0 => array('TITLE' => $this->user->lang['FIELD_LENGTH'], 'FIELD' => ''), + 1 => array('TITLE' => $this->user->lang['MIN_FIELD_NUMBER'], 'FIELD' => ''), + 2 => array('TITLE' => $this->user->lang['MAX_FIELD_NUMBER'], 'FIELD' => ''), 3 => array('TITLE' => $this->user->lang['DEFAULT_VALUE'], 'FIELD' => ''), ); diff --git a/phpBB/phpbb/profilefields/type/type_string.php b/phpBB/phpbb/profilefields/type/type_string.php index 67befc457d..a8432eaae5 100644 --- a/phpBB/phpbb/profilefields/type/type_string.php +++ b/phpBB/phpbb/profilefields/type/type_string.php @@ -61,9 +61,9 @@ class type_string extends type_string_common public function get_options($default_lang_id, $field_data) { $options = array( - 0 => array('TITLE' => $this->user->lang['FIELD_LENGTH'], 'FIELD' => ''), - 1 => array('TITLE' => $this->user->lang['MIN_FIELD_CHARS'], 'FIELD' => ''), - 2 => array('TITLE' => $this->user->lang['MAX_FIELD_CHARS'], 'FIELD' => ''), + 0 => array('TITLE' => $this->user->lang['FIELD_LENGTH'], 'FIELD' => ''), + 1 => array('TITLE' => $this->user->lang['MIN_FIELD_CHARS'], 'FIELD' => ''), + 2 => array('TITLE' => $this->user->lang['MAX_FIELD_CHARS'], 'FIELD' => ''), 3 => array('TITLE' => $this->user->lang['FIELD_VALIDATION'], 'FIELD' => ''), ); diff --git a/phpBB/phpbb/profilefields/type/type_text.php b/phpBB/phpbb/profilefields/type/type_text.php index bacf60a213..79ee82351a 100644 --- a/phpBB/phpbb/profilefields/type/type_text.php +++ b/phpBB/phpbb/profilefields/type/type_text.php @@ -61,9 +61,9 @@ class type_text extends type_string_common public function get_options($default_lang_id, $field_data) { $options = array( - 0 => array('TITLE' => $this->user->lang['FIELD_LENGTH'], 'FIELD' => ' ' . $this->user->lang['ROWS'] . '
' . $this->user->lang['COLUMNS'] . ' '), - 1 => array('TITLE' => $this->user->lang['MIN_FIELD_CHARS'], 'FIELD' => ''), - 2 => array('TITLE' => $this->user->lang['MAX_FIELD_CHARS'], 'FIELD' => ''), + 0 => array('TITLE' => $this->user->lang['FIELD_LENGTH'], 'FIELD' => ' ' . $this->user->lang['ROWS'] . '
' . $this->user->lang['COLUMNS'] . ' '), + 1 => array('TITLE' => $this->user->lang['MIN_FIELD_CHARS'], 'FIELD' => ''), + 2 => array('TITLE' => $this->user->lang['MAX_FIELD_CHARS'], 'FIELD' => ''), 3 => array('TITLE' => $this->user->lang['FIELD_VALIDATION'], 'FIELD' => ''), ); diff --git a/phpBB/phpbb/profilefields/type/type_url.php b/phpBB/phpbb/profilefields/type/type_url.php index fe0bffd582..375cf5b19a 100644 --- a/phpBB/phpbb/profilefields/type/type_url.php +++ b/phpBB/phpbb/profilefields/type/type_url.php @@ -29,9 +29,9 @@ class type_url extends type_string public function get_options($default_lang_id, $field_data) { $options = array( - 0 => array('TITLE' => $this->user->lang['FIELD_LENGTH'], 'FIELD' => ''), - 1 => array('TITLE' => $this->user->lang['MIN_FIELD_CHARS'], 'FIELD' => ''), - 2 => array('TITLE' => $this->user->lang['MAX_FIELD_CHARS'], 'FIELD' => ''), + 0 => array('TITLE' => $this->user->lang['FIELD_LENGTH'], 'FIELD' => ''), + 1 => array('TITLE' => $this->user->lang['MIN_FIELD_CHARS'], 'FIELD' => ''), + 2 => array('TITLE' => $this->user->lang['MAX_FIELD_CHARS'], 'FIELD' => ''), ); return $options; diff --git a/phpBB/phpbb/search/fulltext_native.php b/phpBB/phpbb/search/fulltext_native.php index a02f889415..e2c02ffdab 100644 --- a/phpBB/phpbb/search/fulltext_native.php +++ b/phpBB/phpbb/search/fulltext_native.php @@ -1975,15 +1975,15 @@ class fulltext_native extends \phpbb\search\base

' . $this->user->lang['MIN_SEARCH_CHARS_EXPLAIN'] . '
-
+

' . $this->user->lang['MAX_SEARCH_CHARS_EXPLAIN'] . '
-
+

' . $this->user->lang['COMMON_WORD_THRESHOLD_EXPLAIN'] . '
-
%
+
%
'; diff --git a/phpBB/phpbb/search/fulltext_postgres.php b/phpBB/phpbb/search/fulltext_postgres.php index c2186b0df3..04441e6226 100644 --- a/phpBB/phpbb/search/fulltext_postgres.php +++ b/phpBB/phpbb/search/fulltext_postgres.php @@ -1089,11 +1089,11 @@ class fulltext_postgres extends \phpbb\search\base

' . $this->user->lang['FULLTEXT_POSTGRES_MIN_WORD_LEN_EXPLAIN'] . '
-
+

' . $this->user->lang['FULLTEXT_POSTGRES_MAX_WORD_LEN_EXPLAIN'] . '
-
+
'; diff --git a/phpBB/phpbb/search/fulltext_sphinx.php b/phpBB/phpbb/search/fulltext_sphinx.php index 612ef8f1f3..e935b0f6d1 100644 --- a/phpBB/phpbb/search/fulltext_sphinx.php +++ b/phpBB/phpbb/search/fulltext_sphinx.php @@ -952,11 +952,11 @@ class fulltext_sphinx

' . $this->user->lang['FULLTEXT_SPHINX_PORT_EXPLAIN'] . '
-
+

' . $this->user->lang['FULLTEXT_SPHINX_INDEXER_MEM_LIMIT_EXPLAIN'] . '
-
' . $this->user->lang['MIB'] . '
+
' . $this->user->lang['MIB'] . '

' . $this->user->lang['FULLTEXT_SPHINX_CONFIG_FILE_EXPLAIN'] . '
diff --git a/phpBB/styles/prosilver/template/mcp_topic.html b/phpBB/styles/prosilver/template/mcp_topic.html index c21b676370..e6978191de 100644 --- a/phpBB/styles/prosilver/template/mcp_topic.html +++ b/phpBB/styles/prosilver/template/mcp_topic.html @@ -34,7 +34,7 @@

{L_POSTS_PER_PAGE_EXPLAIN}
-
+
@@ -73,7 +73,7 @@
- + {L_SELECT_TOPIC}
{TO_TOPIC_INFO}
diff --git a/phpBB/styles/prosilver/template/pagination.html b/phpBB/styles/prosilver/template/pagination.html index 4680eaa175..29aae53026 100644 --- a/phpBB/styles/prosilver/template/pagination.html +++ b/phpBB/styles/prosilver/template/pagination.html @@ -7,7 +7,7 @@ diff --git a/phpBB/styles/prosilver/template/posting_editor.html b/phpBB/styles/prosilver/template/posting_editor.html index 484ca341c4..f897bf7a3b 100644 --- a/phpBB/styles/prosilver/template/posting_editor.html +++ b/phpBB/styles/prosilver/template/posting_editor.html @@ -164,7 +164,7 @@
-
+
{L_STICK_TOPIC_FOR_EXPLAIN}
diff --git a/phpBB/styles/prosilver/template/posting_poll_body.html b/phpBB/styles/prosilver/template/posting_poll_body.html index dcaec14a93..ee7100aded 100644 --- a/phpBB/styles/prosilver/template/posting_poll_body.html +++ b/phpBB/styles/prosilver/template/posting_poll_body.html @@ -27,12 +27,12 @@
-
+
{L_POLL_MAX_OPTIONS_EXPLAIN}
-
+
{L_POLL_FOR_EXPLAIN}
diff --git a/phpBB/styles/subsilver2/template/mcp_topic.html b/phpBB/styles/subsilver2/template/mcp_topic.html index 7d54510cee..c6a8236b20 100644 --- a/phpBB/styles/subsilver2/template/mcp_topic.html +++ b/phpBB/styles/subsilver2/template/mcp_topic.html @@ -44,7 +44,7 @@ {L_MERGE_TOPIC_ID} - {L_SELECT_TOPIC} + {L_SELECT_TOPIC} @@ -57,7 +57,7 @@ {L_POSTS_PER_PAGE}
{L_POSTS_PER_PAGE_EXPLAIN} - + {L_DISPLAY_POSTS}{L_COLON} {S_SELECT_SORT_DAYS} {L_SORT_BY} {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR}  diff --git a/phpBB/styles/subsilver2/template/posting_attach_body.html b/phpBB/styles/subsilver2/template/posting_attach_body.html index 8c70e4c831..67b3aaf3ea 100644 --- a/phpBB/styles/subsilver2/template/posting_attach_body.html +++ b/phpBB/styles/subsilver2/template/posting_attach_body.html @@ -31,7 +31,7 @@ {L_FILENAME} - + {L_FILE_COMMENT} diff --git a/phpBB/styles/subsilver2/template/posting_body.html b/phpBB/styles/subsilver2/template/posting_body.html index fd5ab9dd63..b984c9f96f 100644 --- a/phpBB/styles/subsilver2/template/posting_body.html +++ b/phpBB/styles/subsilver2/template/posting_body.html @@ -336,7 +336,7 @@ {L_STICK_TOPIC_FOR}{L_COLON}
{L_STICKY_ANNOUNCE_TIME_LIMIT} -  {L_DAYS} {L_STICK_TOPIC_FOR_EXPLAIN} +  {L_DAYS} {L_STICK_TOPIC_FOR_EXPLAIN} diff --git a/phpBB/styles/subsilver2/template/posting_poll_body.html b/phpBB/styles/subsilver2/template/posting_poll_body.html index 07cb6d527e..a18f319c1c 100644 --- a/phpBB/styles/subsilver2/template/posting_poll_body.html +++ b/phpBB/styles/subsilver2/template/posting_poll_body.html @@ -15,11 +15,11 @@ {L_POLL_MAX_OPTIONS}{L_COLON}
{L_POLL_MAX_OPTIONS_EXPLAIN} - + {L_POLL_FOR}{L_COLON} -  {L_DAYS} {L_POLL_FOR_EXPLAIN} +  {L_DAYS} {L_POLL_FOR_EXPLAIN} diff --git a/tests/functions_acp/build_cfg_template_test.php b/tests/functions_acp/build_cfg_template_test.php index a8d7ae6f09..2e3a8adac7 100644 --- a/tests/functions_acp/build_cfg_template_test.php +++ b/tests/functions_acp/build_cfg_template_test.php @@ -68,7 +68,7 @@ class phpbb_functions_acp_build_cfg_template_test extends phpbb_test_case array('config_key_name_width' => 10, 'config_key_name_height' => 20), 'config_key_name', array(), - ' x ', + ' x ', ), array( array('dimension', 0, 15), @@ -76,7 +76,7 @@ class phpbb_functions_acp_build_cfg_template_test extends phpbb_test_case array('config_key_name_width' => 10, 'config_key_name_height' => 20), 'config_key_name', array(), - ' x ', + ' x ', ), ); } @@ -104,7 +104,7 @@ class phpbb_functions_acp_build_cfg_template_test extends phpbb_test_case array('config_key_name' => 10), 'config_key_name', array(), - '', + '', ), array( array('number', -1, 9999), @@ -112,7 +112,7 @@ class phpbb_functions_acp_build_cfg_template_test extends phpbb_test_case array('config_key_name' => 10), 'config_key_name', array(), - '', + '', ), ); } -- cgit v1.2.1 From be5a40f6a910f7fd28c73155fb507e5ce16d11a6 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Fri, 6 Nov 2015 10:25:14 +0100 Subject: [ticket/14272] Assign min/max for all allowed types PHPBB3-14272 --- phpBB/includes/functions_acp.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/phpBB/includes/functions_acp.php b/phpBB/includes/functions_acp.php index bd12c3dd5c..8d5050d1bd 100644 --- a/phpBB/includes/functions_acp.php +++ b/phpBB/includes/functions_acp.php @@ -265,17 +265,17 @@ function build_cfg_template($tpl_type, $key, &$new, $config_key, $vars) break; case 'color': - case 'date': - case 'time': case 'datetime': case 'datetime-local': case 'month': - case 'range': case 'week': $tpl = ''; break; + case 'date': + case 'time': case 'number': + case 'range': $max = ''; $min = ( isset($tpl_type[1]) ) ? (int) $tpl_type[1] : false; if ( isset($tpl_type[2]) ) @@ -283,7 +283,7 @@ function build_cfg_template($tpl_type, $key, &$new, $config_key, $vars) $max = (int) $tpl_type[2]; } - $tpl = ''; + $tpl = ''; break; case 'dimension': -- cgit v1.2.1 From 685449bfe3d470adb6fe14867b3cfb820bcd135a Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Fri, 6 Nov 2015 10:31:56 +0100 Subject: [ticket/14272] Fix invalid or missing min/max settings PHPBB3-14272 --- phpBB/adm/style/acp_search.html | 2 +- phpBB/includes/acp/acp_attachments.php | 2 +- phpBB/phpbb/search/fulltext_sphinx.php | 4 ++-- phpBB/styles/prosilver/template/pagination.html | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/phpBB/adm/style/acp_search.html b/phpBB/adm/style/acp_search.html index 0736d22fe7..f7ad3c5e89 100644 --- a/phpBB/adm/style/acp_search.html +++ b/phpBB/adm/style/acp_search.html @@ -30,7 +30,7 @@

{L_MIN_SEARCH_AUTHOR_CHARS_EXPLAIN}
-
+

{L_MAX_NUM_SEARCH_KEYWORDS_EXPLAIN}
diff --git a/phpBB/includes/acp/acp_attachments.php b/phpBB/includes/acp/acp_attachments.php index b0e0711b22..7e348aa45b 100644 --- a/phpBB/includes/acp/acp_attachments.php +++ b/phpBB/includes/acp/acp_attachments.php @@ -1736,7 +1736,7 @@ class acp_attachments $value = $filesize['value']; // size and maxlength must not be specified for input of type number - return ' '; + return ' '; } /** diff --git a/phpBB/phpbb/search/fulltext_sphinx.php b/phpBB/phpbb/search/fulltext_sphinx.php index e935b0f6d1..0dbc6e33df 100644 --- a/phpBB/phpbb/search/fulltext_sphinx.php +++ b/phpBB/phpbb/search/fulltext_sphinx.php @@ -952,11 +952,11 @@ class fulltext_sphinx

' . $this->user->lang['FULLTEXT_SPHINX_PORT_EXPLAIN'] . '
-
+

' . $this->user->lang['FULLTEXT_SPHINX_INDEXER_MEM_LIMIT_EXPLAIN'] . '
-
' . $this->user->lang['MIB'] . '
+
' . $this->user->lang['MIB'] . '

' . $this->user->lang['FULLTEXT_SPHINX_CONFIG_FILE_EXPLAIN'] . '
diff --git a/phpBB/styles/prosilver/template/pagination.html b/phpBB/styles/prosilver/template/pagination.html index 29aae53026..88c67459c2 100644 --- a/phpBB/styles/prosilver/template/pagination.html +++ b/phpBB/styles/prosilver/template/pagination.html @@ -7,7 +7,7 @@ -- cgit v1.2.1 From c99386e1553170a898f292d0c0717a5c1fa8151b Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 8 Nov 2015 13:11:16 +0100 Subject: [ticket/14272] Remove useless check PHPBB3-14272 --- phpBB/includes/functions_acp.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/functions_acp.php b/phpBB/includes/functions_acp.php index 8d5050d1bd..7874696950 100644 --- a/phpBB/includes/functions_acp.php +++ b/phpBB/includes/functions_acp.php @@ -269,7 +269,7 @@ function build_cfg_template($tpl_type, $key, &$new, $config_key, $vars) case 'datetime-local': case 'month': case 'week': - $tpl = ''; + $tpl = ''; break; case 'date': -- cgit v1.2.1 From 7705017f6381ec4fad769069ba84f12ba2e5c316 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Tue, 1 Dec 2015 14:59:43 +0100 Subject: [ticket/14272] Make sure phpbb_avatar_manager was defined PHPBB3-14272 --- phpBB/includes/acp/acp_groups.php | 4 +++- phpBB/includes/acp/acp_users.php | 3 ++- phpBB/includes/ucp/ucp_groups.php | 4 +++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/phpBB/includes/acp/acp_groups.php b/phpBB/includes/acp/acp_groups.php index befbcdf24a..69d59229ca 100644 --- a/phpBB/includes/acp/acp_groups.php +++ b/phpBB/includes/acp/acp_groups.php @@ -324,9 +324,11 @@ class acp_groups $avatar_data = null; $avatar_error = array(); + /** @var \phpbb\avatar\manager $phpbb_avatar_manager */ + $phpbb_avatar_manager = $phpbb_container->get('avatar.manager'); + if ($config['allow_avatar']) { - $phpbb_avatar_manager = $phpbb_container->get('avatar.manager'); $avatar_drivers = $phpbb_avatar_manager->get_enabled_drivers(); // This is normalised data, without the group_ prefix diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index 4d0bbf5721..febdcb93ed 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -1809,10 +1809,11 @@ class acp_users case 'avatar': $avatars_enabled = false; + /** @var \phpbb\avatar\manager $phpbb_avatar_manager */ + $phpbb_avatar_manager = $phpbb_container->get('avatar.manager'); if ($config['allow_avatar']) { - $phpbb_avatar_manager = $phpbb_container->get('avatar.manager'); $avatar_drivers = $phpbb_avatar_manager->get_enabled_drivers(); // This is normalised data, without the user_ prefix diff --git a/phpBB/includes/ucp/ucp_groups.php b/phpBB/includes/ucp/ucp_groups.php index b9606945b4..b2b1da1f5a 100644 --- a/phpBB/includes/ucp/ucp_groups.php +++ b/phpBB/includes/ucp/ucp_groups.php @@ -462,9 +462,11 @@ class ucp_groups $avatar_data = null; $avatar_error = array(); + /** @var \phpbb\avatar\manager $phpbb_avatar_manager */ + $phpbb_avatar_manager = $phpbb_container->get('avatar.manager'); + if ($config['allow_avatar']) { - $phpbb_avatar_manager = $phpbb_container->get('avatar.manager'); $avatar_drivers = $phpbb_avatar_manager->get_enabled_drivers(); // This is normalised data, without the group_ prefix -- cgit v1.2.1 From 74ec6f4e9ad269b982b342d6a14bdd5dc738f427 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 27 Dec 2015 08:36:19 +0100 Subject: [ticket/14272] Disable not toggled form elements PHPBB3-14272 --- phpBB/assets/javascript/core.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/phpBB/assets/javascript/core.js b/phpBB/assets/javascript/core.js index 36e881f5fd..f3004891b8 100644 --- a/phpBB/assets/javascript/core.js +++ b/phpBB/assets/javascript/core.js @@ -1534,6 +1534,13 @@ phpbb.toggleSelectSettings = function(el) { var $this = $(this), $setting = $($this.data('toggle-setting')); $setting.toggle($this.is(':selected')); + + // Disable any input elements that are not visible right now + if ($this.is(':selected')) { + $($this.data('toggle-setting') + ' input').prop('disabled', false); + } else { + $($this.data('toggle-setting') + ' input').prop('disabled', true); + } }); }; -- cgit v1.2.1 From 805b08460792b330a8c08754b769b8e818fb0fda Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 27 Dec 2015 08:38:41 +0100 Subject: [ticket/14272] Define min and max values for avatar width and height PHPBB3-14272 --- phpBB/includes/ucp/ucp_profile.php | 7 +++++++ phpBB/styles/prosilver/template/ucp_avatar_options_gravatar.html | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php index be0833254b..2708a8dedf 100644 --- a/phpBB/includes/ucp/ucp_profile.php +++ b/phpBB/includes/ucp/ucp_profile.php @@ -638,6 +638,13 @@ class ucp_profile $selected_driver = $phpbb_avatar_manager->clean_driver_name($request->variable('avatar_driver', $user->data['user_avatar_type'])); + $template->assign_vars(array( + 'AVATAR_MIN_WIDTH' => $config['avatar_min_width'], + 'AVATAR_MAX_WIDTH' => $config['avatar_max_width'], + 'AVATAR_MIN_HEIGHT' => $config['avatar_min_height'], + 'AVATAR_MAX_HEIGHT' => $config['avatar_max_height'], + )); + foreach ($avatar_drivers as $current_driver) { $driver = $phpbb_avatar_manager->get_driver($current_driver); diff --git a/phpBB/styles/prosilver/template/ucp_avatar_options_gravatar.html b/phpBB/styles/prosilver/template/ucp_avatar_options_gravatar.html index b1076c2d14..130a7c2cca 100644 --- a/phpBB/styles/prosilver/template/ucp_avatar_options_gravatar.html +++ b/phpBB/styles/prosilver/template/ucp_avatar_options_gravatar.html @@ -5,7 +5,7 @@

{L_GRAVATAR_AVATAR_SIZE_EXPLAIN}
- ×  - + ×  +
-- cgit v1.2.1 From f3c2c497d8443d7cb77eaaf9c8031db1cb3434d9 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Tue, 1 Dec 2015 15:15:43 +0100 Subject: [ticket/14272] Assign min and max values for avatar driver settings PHPBB3-14272 --- phpBB/adm/style/acp_avatar_options_gravatar.html | 4 ++-- phpBB/adm/style/acp_avatar_options_remote.html | 4 ++-- phpBB/includes/acp/acp_groups.php | 8 ++++++++ phpBB/includes/acp/acp_users.php | 8 ++++++++ phpBB/includes/ucp/ucp_groups.php | 8 ++++++++ 5 files changed, 28 insertions(+), 4 deletions(-) diff --git a/phpBB/adm/style/acp_avatar_options_gravatar.html b/phpBB/adm/style/acp_avatar_options_gravatar.html index dbe9891e19..d5906ba87d 100644 --- a/phpBB/adm/style/acp_avatar_options_gravatar.html +++ b/phpBB/adm/style/acp_avatar_options_gravatar.html @@ -5,7 +5,7 @@

{L_GRAVATAR_AVATAR_SIZE_EXPLAIN}
- {L_PIXEL} ×  - {L_PIXEL} + {L_PIXEL} ×  + {L_PIXEL}
diff --git a/phpBB/adm/style/acp_avatar_options_remote.html b/phpBB/adm/style/acp_avatar_options_remote.html index 3b514620b4..e64d13686c 100644 --- a/phpBB/adm/style/acp_avatar_options_remote.html +++ b/phpBB/adm/style/acp_avatar_options_remote.html @@ -5,7 +5,7 @@

{L_LINK_REMOTE_SIZE_EXPLAIN}
- {L_PIXEL} ×  - {L_PIXEL} + {L_PIXEL} ×  + {L_PIXEL}
diff --git a/phpBB/includes/acp/acp_groups.php b/phpBB/includes/acp/acp_groups.php index 69d59229ca..7c7cc50c57 100644 --- a/phpBB/includes/acp/acp_groups.php +++ b/phpBB/includes/acp/acp_groups.php @@ -669,6 +669,14 @@ class acp_groups $avatars_enabled = false; $selected_driver = $phpbb_avatar_manager->clean_driver_name($request->variable('avatar_driver', $avatar_data['avatar_type'])); + // Assign min and max values before generating avatar driver html + $template->assign_vars(array( + 'AVATAR_MIN_WIDTH' => $config['avatar_min_width'], + 'AVATAR_MAX_WIDTH' => $config['avatar_max_width'], + 'AVATAR_MIN_HEIGHT' => $config['avatar_min_height'], + 'AVATAR_MAX_HEIGHT' => $config['avatar_max_height'], + )); + foreach ($avatar_drivers as $current_driver) { $driver = $phpbb_avatar_manager->get_driver($current_driver); diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index febdcb93ed..4dcf70010c 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -1874,6 +1874,14 @@ class acp_users $selected_driver = $phpbb_avatar_manager->clean_driver_name($request->variable('avatar_driver', $user_row['user_avatar_type'])); + // Assign min and max values before generating avatar driver html + $template->assign_vars(array( + 'AVATAR_MIN_WIDTH' => $config['avatar_min_width'], + 'AVATAR_MAX_WIDTH' => $config['avatar_max_width'], + 'AVATAR_MIN_HEIGHT' => $config['avatar_min_height'], + 'AVATAR_MAX_HEIGHT' => $config['avatar_max_height'], + )); + foreach ($avatar_drivers as $current_driver) { $driver = $phpbb_avatar_manager->get_driver($current_driver); diff --git a/phpBB/includes/ucp/ucp_groups.php b/phpBB/includes/ucp/ucp_groups.php index b2b1da1f5a..86a8226d5b 100644 --- a/phpBB/includes/ucp/ucp_groups.php +++ b/phpBB/includes/ucp/ucp_groups.php @@ -651,6 +651,14 @@ class ucp_groups $avatars_enabled = false; $selected_driver = $phpbb_avatar_manager->clean_driver_name($request->variable('avatar_driver', $avatar_data['avatar_type'])); + // Assign min and max values before generating avatar driver html + $template->assign_vars(array( + 'AVATAR_MIN_WIDTH' => $config['avatar_min_width'], + 'AVATAR_MAX_WIDTH' => $config['avatar_max_width'], + 'AVATAR_MIN_HEIGHT' => $config['avatar_min_height'], + 'AVATAR_MAX_HEIGHT' => $config['avatar_max_height'], + )); + foreach ($avatar_drivers as $current_driver) { $driver = $phpbb_avatar_manager->get_driver($current_driver); -- cgit v1.2.1 From c9541e07952eec73099701082bc1317ef2bd4c56 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Thu, 3 Dec 2015 11:50:19 +0100 Subject: [ticket/14272] Use input type number instead of text in avatars PHPBB3-14272 --- phpBB/styles/prosilver/template/ucp_avatar_options_remote.html | 4 ++-- phpBB/styles/subsilver2/template/ucp_avatar_options_gravatar.html | 4 ++-- phpBB/styles/subsilver2/template/ucp_avatar_options_remote.html | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/phpBB/styles/prosilver/template/ucp_avatar_options_remote.html b/phpBB/styles/prosilver/template/ucp_avatar_options_remote.html index a8f6135fb2..8e175623ac 100644 --- a/phpBB/styles/prosilver/template/ucp_avatar_options_remote.html +++ b/phpBB/styles/prosilver/template/ucp_avatar_options_remote.html @@ -5,7 +5,7 @@

{L_LINK_REMOTE_SIZE_EXPLAIN}
- ×  - + ×  +
diff --git a/phpBB/styles/subsilver2/template/ucp_avatar_options_gravatar.html b/phpBB/styles/subsilver2/template/ucp_avatar_options_gravatar.html index b8840e0aab..9fb3f0e754 100644 --- a/phpBB/styles/subsilver2/template/ucp_avatar_options_gravatar.html +++ b/phpBB/styles/subsilver2/template/ucp_avatar_options_gravatar.html @@ -6,8 +6,8 @@ {L_GRAVATAR_AVATAR_SIZE}{L_COLON}
{L_GRAVATAR_AVATAR_SIZE_EXPLAIN} - {L_PIXEL} ×  - {L_PIXEL} + {L_PIXEL} ×  + {L_PIXEL} diff --git a/phpBB/styles/subsilver2/template/ucp_avatar_options_remote.html b/phpBB/styles/subsilver2/template/ucp_avatar_options_remote.html index 50ebb9b93d..309b3f9836 100644 --- a/phpBB/styles/subsilver2/template/ucp_avatar_options_remote.html +++ b/phpBB/styles/subsilver2/template/ucp_avatar_options_remote.html @@ -5,6 +5,6 @@ {L_LINK_REMOTE_SIZE}{L_COLON}
{L_LINK_REMOTE_SIZE_EXPLAIN} - {L_PIXEL} × {L_PIXEL} + {L_PIXEL} × {L_PIXEL} -- cgit v1.2.1 From b39b3da5af89d9687ff5e985244695131d36c753 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Wed, 3 Feb 2016 22:03:31 +0100 Subject: [ticket/14272] Allow input of floats for filesize This might be needed while switching the default input from KiB to MiB or similar changes to settings. PHPBB3-14272 --- phpBB/adm/style/acp_attachments.html | 2 +- phpBB/includes/acp/acp_attachments.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/adm/style/acp_attachments.html b/phpBB/adm/style/acp_attachments.html index d048191864..e1f7f140c9 100644 --- a/phpBB/adm/style/acp_attachments.html +++ b/phpBB/adm/style/acp_attachments.html @@ -196,7 +196,7 @@
-
+
diff --git a/phpBB/includes/acp/acp_attachments.php b/phpBB/includes/acp/acp_attachments.php index 7e348aa45b..8e8ace8337 100644 --- a/phpBB/includes/acp/acp_attachments.php +++ b/phpBB/includes/acp/acp_attachments.php @@ -1736,7 +1736,7 @@ class acp_attachments $value = $filesize['value']; // size and maxlength must not be specified for input of type number - return ' '; + return ' '; } /** -- cgit v1.2.1