Page 1 of 1
multilingual sidebar plugin
Posted: Sat May 14, 2011 3:05 pm
by Timbalu
Hi
I just noticed the serendipity_plugin_multilingual.php to spit out wrong urls changing languages multiple times with mod_rewrite=on settings. (like /blog/index.php?index.php and so on)
Changing line 88 from
to
Code: Select all
$url = $serendipity['rewrite'] == 'rewrite' ? '' : serendipity_currentURL();
will work as expected.
Re: multilingual sidebar plugin
Posted: Mon May 16, 2011 9:36 am
by garvinhicking
Hi!
I'm not really sure that works, because if a page is called through the index.php?/... method and the user wants to change the language there, he would loose variables.
The currentURL is a safety measure so that this can never happen; the URL changes to the compatibility format of course, but IMHO it's more important that a language changes works in every case instead of having the same URL...
Regards,
Garvin
Re: multilingual sidebar plugin
Posted: Mon May 16, 2011 10:38 am
by Timbalu
Hi Garvin
Yes thats true. But - at least here on my local test blog - it does not change the url only, it changes the page, in cases like ...
/archive(.html) [
lang change] leads to /index.php?archive(.html), which failes missing the slash after ?/.
We might add the missing slash somehow in case of mod_rewrite.... or does this effect compatibility too?
Edit:
Using strict = true in case of rewrite solves this problem.
Code: Select all
$url = $serendipity['rewrite'] == 'rewrite' ? serendipity_currentURL(true) : serendipity_currentURL();
Re: multilingual sidebar plugin
Posted: Mon May 16, 2011 11:44 am
by garvinhicking
Hi!
That's good! Using the 'true' shouldn't be a problem. I've committed that, thansk!
Regards,
Garvin