Welcome Guest, Not a member yet? Register   Sign In
Umlaute and other special characters in URL
#1

[eluser]Akinzekeel[/eluser]
Hi everyone,

I was having problems with German Umlaute (special characters) in the URL since I moved from a linux system over to Microsoft/IIS this night.

Whenever there was an Umlaut in the URL the "Disallowed characters" error message showed up, even though I had this in my config.php:

Code:
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-\+\=äöüÄÖÜß';


Turned out I had to make a small modification in the system/core/URI.php. On line 231 I had to replace
Code:
if ( ! preg_match("|^[".str_replace(array('\\-', '\-'), '-', preg_quote($this->config->item('permitted_uri_chars'), '-'))."]+$|i", $str))

with
Code:
if ( ! preg_match("|^[".str_replace(array('\\-', '\-'), '-', preg_quote($this->config->item('permitted_uri_chars'), '-'))."]+$|i", utf8_encode($str)))


Just wanted to share my solution in case somebody else has the same problem.




Theme © iAndrew 2016 - Forum software by © MyBB