drupal_link doesn't accept uri

Created on 25 June 2020, about 4 years ago
Updated 18 January 2023, over 1 year ago

So, What I'd like to work is this:

{{ drupal_link('learn more', node.field_file_url|file_uri) }}

As a workaround, I can use file_url but given a uri like private://foo/bar.png it doesn't seem possible to use drupal_link.

This is caused by this fairly reasonable safeguard working under the assumption that the link being provided is user input and not system data :-/

    if (!in_array($user_input[0], ['/', '#', '?'])) {
      $user_input = '/' . $user_input;
    }
πŸ› Bug report
Status

Closed: duplicate

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States neclimdul Houston, TX

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

No activities found.

Production build 0.69.0 2024