Hello,
I have defined a custom_url_rewrite() function in my settings.php.
When going from source -> alias, it prefixes the language ('lang-en/' or 'lang-nl/') to the url and ...
when going from alias -> source, it strips the language from the url.
It works fine, except for one thing ... Some forms (including the login form :-/ ) redirect to a URL like
lang-nl/lang-nl/user/login?time=1155399481
The action attribute on the <form> element already contains the language prefix
and I guess after the form input is received, drupal_goto() is called on the destination url
again and custom_url_rewrite() then adds the prefix again ...
I think this is a bug, though I'm not entirely sure either whether I'm not doing something stupid myself ;-)
I tried to locate the exact cause of the problem, but it's taking me too much time :-/
So I'm posting the fragment from my settings.php below.
Hope someone can tell me what's going wrong.
Best regards,
Eric
<?php
if(preg_match('/^lang-en(\/|$)/', $_GET['q'])) {
$GLOBALS['wkvlanguage'] = 'en';
} else {
$GLOBALS['wkvlanguage'] = 'nl';
}
function custom_url_rewrite($type, $path, $original) {
// $type is either 'alias' or 'source', depending on the
// desired resulting path type of the operation (to be
// in line with drupal_lookup_path() operation),
// $path is possibly already processed by Drupal,