Actions
Defect #38464
closedRendering a custom field with a URL pattern set and containing " :" in the value raises Addressable::URI::InvalidURIError
Defect #38464:
Rendering a custom field with a URL pattern set and containing " :" in the value raises Addressable::URI::InvalidURIError
Resolution:
Fixed
Affected version:
Description
An Addressable::URI::InvalidURIError occurs in Issues#show for certain values used to format a URL.
Steps to reproduce:
- Create an issue custom field:
- Field format: Text
- Link values to URL: https://example.com/%value%
- Inside an issue:
- Set the custom field value to:
Test :Test, i.e.Test, blank, colon,Test - Save the issue
- Set the custom field value to:
- When the issue is about to be shown, an
Addressable::URI::InvalidURIErroroccurs.
The error is caused by the url_from_pattern method in lib/redmine/field_format.rb. The issue can be solved by replacing the 5 occurrances of Addressable::URI.encode with URI.encode_www_form_component.
>> Addressable::URI.encode "Test :Test" Traceback (most recent call last): Addressable::URI::InvalidURIError (Invalid scheme format: 'Test ') >> URI.encode_www_form_component "Test :Test" => "Test+%3ATest"
Best regards,
Thomas
Files
Actions