postalserver / postalserver/postal

Tracking URL not working for Accented Characters

Open
#2,258 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Ruby
Stars
16.8k
Forks
1.3k
Avg merge
13d 7h
Merged PRs (30d)
2

Description

Folks,

URL Tracking breaks when there are Accented Characters.

Example of URL that does not work:
https://domain.com/auth/signin?utm_source=canal_proprietario&utm_medium=email&utm_campaign=1_botão2

I tried to fix it by editing app/lib/postal/message_parser.rb:

On line 4:

`URL_REGEX = /(?(?https?)\:\/\/(?[A-Za-z0-9\-\.\:]+)(?\/[A-Za-z0-9\.\/\+\?\&\-\_\%\=\,\~\:\;\(\)\[\]#]*)?+)/`

I changed to:

`URL_REGEX = /(?(?https?)\:\/\/(?[A-Za-z0-9\-\.\:]+)(?\/[a-zA-Zà-úÀ-Ú0-9\.\/\+\?\&\-\_\%\=\,\~\:\;\(\)\[\]#]*)?+)/`

This change works fine on regex101.com, but does not work on Postal. Actually it breaks all tracking urls.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.