Defect #24821
openCustom field URL pattern with "mailto:" is rejected as invalid
Description
I would like to have a custom field for storing e-mails.
So I created custom field "e-mail" and set URL to "mailto:%value%" but Redmine will not allow me to save this with error: URL is invalid
I tried to do this via Text custom field and same URL (mailto:%value%) but still no way...
Files
Updated by Toshi MARUYAMA almost 10 years ago
- Description updated (diff)
Updated by Go MAEDA 2 days ago
- File 0001-Allow-mailto-in-custom-field-URL-patterns.patch 0001-Allow-mailto-in-custom-field-URL-patterns.patch added
- Subject changed from Cannot use mailto: in link custom field to Custom field URL pattern with "mailto:" is rejected as invalid
- Target version set to Candidate for next minor release
The attached patch fixes this.
A URL pattern such as mailto:%value% is rejected because the pattern is checked with uri_with_safe_scheme? after the tokens are removed. The remaining mailto: has no address, so URI.parse raises URI::InvalidComponentError. Since mailto is already one of the allowed schemes, this rejection is not intended.
A URL pattern is not a complete URI until the tokens are replaced, so the patch checks only the scheme of the pattern. This fixes both the Link and Text formats. Patterns with other schemes, such as foo://, are still rejected. uri_with_safe_scheme? itself is unchanged.
Updated by Go MAEDA about 15 hours ago
- Target version changed from Candidate for next minor release to 6.1.7
Setting the target version to 6.1.7.