settings: Fix length of custom profile field URL input.

The backend validates that URL inputs are RFC valid URLs (with no
specific length limit), but the frontend appears to have a maximum
length of 50 specified, likely because of a copy-paste error.

Increase the HTML maxlength for this input to 2048, which is a length
supported for URLs by all major browsers.

Fixes #21633
This commit is contained in:
Archisman Das 2022-04-03 03:04:55 +05:30 committed by Tim Abbott
parent 2ad60b0cda
commit 491b1513eb
2 changed files with 3 additions and 0 deletions

View File

@ -170,6 +170,7 @@ export function append_custom_profile_fields(element_id, user_id) {
is_long_text_field: field.type === all_field_types.LONG_TEXT.id,
is_user_field: field.type === all_field_types.USER.id,
is_date_field: field.type === all_field_types.DATE.id,
is_url_field: field.type === all_field_types.URL.id,
is_select_field,
field_choices,
});

View File

@ -20,6 +20,8 @@
<input class="custom_user_field_value datepicker" data-field-id="{{ field.id }}" type="text"
value="{{ field_value.value }}" />
<span class="remove_date"><i class="fa fa-close"></i></span>
{{else if is_url_field }}
<input class="custom_user_field_value" type="{{ field_type }}" value="{{ field_value.value }}" maxlength="2048" />
{{else}}
<input class="custom_user_field_value" type="{{ field_type }}" value="{{ field_value.value }}" maxlength="50" />
{{/if}}