Project

General

Profile

Actions

Defect #24821

open

Custom field URL pattern with "mailto:" is rejected as invalid

Defect #24821: Custom field URL pattern with "mailto:" is rejected as invalid

Added by Maxim Krušina almost 10 years ago. Updated about 15 hours ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Custom fields
Target version:
Resolution:
Affected version:

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 Actions #1

  • Description updated (diff)

Updated by Go MAEDA 2 days ago Actions #2

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 Actions #3

  • Target version changed from Candidate for next minor release to 6.1.7

Setting the target version to 6.1.7.

Actions

Also available in: PDF Atom