Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

German umlauts (ä, ö, ü, and possibly other special characters) removed in parameters of action functions #48

Open
crystlbrd opened this issue Aug 15, 2018 · 2 comments

Comments

@crystlbrd
Copy link

crystlbrd commented Aug 15, 2018

I found a rather interesting error. I'm from Germany and we have often umlauts in our words. In one case I was working on a backend system and was trying to call a page like this:

header('Location: ' . URL . 'controller/action/' . urlencode('somethingWithAnUmlaut'));

And it worked very well, with one exception: the umlaut was removed in the URL and the parameter in the action function. After some digging I found the responsible code for it:

$url = filter_var($url, FILTER_SANITIZE_URL);

MINI seems to decode the URL after catching it (didn't looked up where this happens), so the URL isn't coded in HTTP at that line anymore. Unfortunately the filter used in that line removes all umlauts and some other German special characters (e.c. ß). In my case I just commented the line out. But that's of course not a long term solution. Any ideas here?

P.S.: I really love this 'framework'. Great work to all, who toke the effort making this project this awesome.

@sa-tasche
Copy link

sa-tasche commented Mar 16, 2020

  1. See: default_charset in php.ini
    See also: https://phptherightway.com/#php_and_utf8

  2. instead of FILTER_SANITIZE_URL use FILTER_SANITIZE_ENCODED
    See: https://www.php.net/manual/de/filter.filters.sanitize.php
    See: https://phptherightway.com/#data_filtering

@ebitkov
Copy link

ebitkov commented May 13, 2024

As defined in the RFC 1738, any special characters (including umlauts) may not be used unencoded, even if it's technically possible:

Thus, only alphanumerics, the special characters "$-_.+!*'(),", and
reserved characters used for their reserved purposes may be used
unencoded within a URL.

Therefore I propose to close this issue as wontfix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants