Skip to content

Unable to open external link with non-ASCII characters #11471

@fblupi

Description

@fblupi

Describe the bug

When I open an external link that contains non-ASCII characters, it returns the "Invalid URL" error.

To Reproduce

  1. Call the link controller with an external_url with non-ASCII characters. For example: http://localhost:3000/link?external_url=https://twitter.com/hashtag/ConsellGrassotGràciaNova

Expected behavior

It should encode the URL and give us the chance to redirect the user to it.

Screenshots

Screenshot 2023-08-10 at 11 16 27

Stacktrace

0> URI.parse(params[:external_url])
=> URI must be ascii only "https://twitter.com/hashtag/ConsellGrassotGr\u00E0ciaNova"

Extra data

  • Device: Desktop
  • Device OS: MacOS 13.4.1
  • Browser: Firefox
  • Decidim Version: Reproduced on 0.26, 0.27 and 0.28
  • Decidim installation: Detected on Decidim Barcelona, tested locally on the development app

Additional context

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions