Project

General

Profile

Actions

Defect #24821

closed

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 9 days ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Custom fields
Target version:
Resolution:
Fixed
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 16 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 15 days ago Actions #3

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

Setting the target version to 6.1.7.

Updated by Go MAEDA 12 days ago Actions #4

  • Status changed from New to Resolved
  • Assignee set to Go MAEDA
  • Resolution set to Fixed

Committed the patch in r25478.

Updated by Go MAEDA 9 days ago Actions #5

  • Status changed from Resolved to Closed

Merged the fix into the stable branches in r25489 and r25490.

Actions

Also available in: PDF Atom