Tracking URL not working for Accented Characters #2257
Replies: 2 comments
-
In general URIs as defined by RFC 3986 (see Section 2: Characters) may contain any of the following 84 characters::
Note that this list doesn't state where in the URI these characters may occur. Any other character needs to be encoded with the percent-encoding (%hh). Each part of the URI has further restrictions about what characters need to be represented by an percent-encoded word. |
Beta Was this translation helpful? Give feedback.
-
I replied to the issue because I feel like this is probably a problem that needs to be deal with as its referring to the querystring data which could, reasonably, be any value |
Beta Was this translation helpful? Give feedback.
-
Folks,
URL Tracking breaks when there are Accented Characters. So I tried to fix it by editing app/lib/postal/message_parser.rb:
On line 4:
URL_REGEX = /(?<url>(?<protocol>https?)\:\/\/(?<domain>[A-Za-z0-9\-\.\:]+)(?<path>\/[A-Za-z0-9\.\/\+\?\&\-\_\%\=\,\~\:\;\(\)\[\]#]*)?+)/
I changed to:
URL_REGEX = /(?<url>(?<protocol>https?)\:\/\/(?<domain>[A-Za-z0-9\-\.\:]+)(?<path>\/[a-zA-Zà-úÀ-Ú0-9\.\/\+\?\&\-\_\%\=\,\~\:\;\(\)\[\]#]*)?+)/
This change works fine on regex101.com, but does not work on Postal. Actually it breaks all tracking urls. Does anyone know why?
Beta Was this translation helpful? Give feedback.
All reactions