4images Forum & Community
4images Help / Hilfe => Bug Fixes & Patches => Topic started by: V@no on April 02, 2009, 03:27:36 PM
-
In global.php find:
4images version 1.7
if (isset($HTTP_GET_VARS['l']) || isset($HTTP_POST_VARS['l'])) {
$l = (isset($HTTP_GET_VARS['l'])) ? trim($HTTP_GET_VARS['l']) : trim($HTTP_POST_VARS['l']);
if (file_exists(ROOT_PATH.'lang/'.$l.'/main.php')) {
$config['language_dir'] = $l;
}
}
Replace it with:
$l = null;
if (isset($HTTP_GET_VARS['l']) || isset($HTTP_POST_VARS['l'])) {
$requested_l = (isset($HTTP_GET_VARS['l'])) ? trim($HTTP_GET_VARS['l']) : trim($HTTP_POST_VARS['l']);
if (!preg_match('#\.\.[\\\/]#', $requested_l) && $requested_l != $config['language_dir'] && file_exists(ROOT_PATH.'lang/'.$requested_l.'/main.php')) {
$l = $requested_l;
$config['language_dir'] = $l;
}
}
4images version 1.7.1 - 1.7.6
if ($requested_l != $config['language_dir'] && file_exists(ROOT_PATH.'lang/'.$requested_l.'/main.php')) {
Replace it with:
if (!preg_match('#\.\.[\\\/]#', $requested_l) && $requested_l != $config['language_dir'] && file_exists(ROOT_PATH.'lang/'.$requested_l.'/main.php')) {
For these who installed [MOD] Language select (http://www.4homepages.de/forum/index.php?topic=4743.0) with cookies support (http://www.4homepages.de/forum/index.php?topic=4743.msg31555#msg31555) and can't find anything mentioned above, then you'll need find in global.php:
if (isset($HTTP_GET_VARS['l']) || isset($HTTP_POST_VARS['l'])) {
$l = (isset($HTTP_GET_VARS['l'])) ? trim($HTTP_GET_VARS['l']) : trim($HTTP_POST_VARS['l']);
if (file_exists(ROOT_PATH.'lang/'.$l.'/main.php')) {
$config['language_dir'] = $l;
setcookie('4images_lang', $l, (time()+ 60 * 60 * 24 * 365), "/", "", 0);
}
}
else
{
if (isset($HTTP_COOKIE_VARS['4images_lang']) && file_exists(ROOT_PATH.'lang/'.$HTTP_COOKIE_VARS['4images_lang'].'/main.php'))
{
$l = $config['language_dir'] = $HTTP_COOKIE_VARS['4images_lang'];
}
}
And replace it with:
if (isset($HTTP_GET_VARS['l']) || isset($HTTP_POST_VARS['l'])) {
$requested_l = (isset($HTTP_GET_VARS['l'])) ? trim($HTTP_GET_VARS['l']) : trim($HTTP_POST_VARS['l']);
if (!preg_match('#\.\.[\\\/]#', $requested_l) && file_exists(ROOT_PATH.'lang/'.$requested_l.'/main.php')) {
$l = $requested_l;
$config['language_dir'] = $l;
setcookie('4images_lang', $l, (time()+ 60 * 60 * 24 * 365), "/", "", 0);
}
}
else
{
if (isset($HTTP_COOKIE_VARS['4images_lang']) && !preg_match('#\.\.[\\\/]#', $HTTP_COOKIE_VARS['4images_lang']) && file_exists(ROOT_PATH.'lang/'.$HTTP_COOKIE_VARS['4images_lang'].'/main.php'))
{
$l = $config['language_dir'] = $HTTP_COOKIE_VARS['4images_lang'];
}
}
(I've already updated the code in the mentioned mod with this fix)
P.S.
thanks to 4dabdura (http://www.4homepages.de/forum/index.php?action=profile;u=24319) for reporting this bug and Jan (http://www.4homepages.de/forum/index.php?action=profile;u=2) for providing us with the fix.
-
Thanks V@no!
-
... thanks V@no for your fix for version 1.7 - 1.7.6 ...
-
thank you V@no
this is important edit
-
thanks V@no!
-
thanks
the fix is not compatible with [lang mod]
http://www.4homepages.de/forum/index.php?topic=4743.msg74088#msg74088
I've updated the code in this post:
http://www.4homepages.de/forum/index.php?topic=4743.msg31555#msg31555
-
Habt ihr das im "Downloadpaket" schon beigefügt? Damit andere, die 4images z.B heute einsetzen wollen bzw. downloaden wollen das nicht hier extra suchen müssen!
-
Hi,
Thank V@no for the updates and fix. :)
Regards,
Yesme
-
Hi,
Thank V@no for the updates and fix. :)
Best Regards,
Jasi
----------------------------------------------------------
Danke V@no für's Update und den Fix ! :)
Beste Grüße
Jasi
-
Habt ihr das im "Downloadpaket" schon beigefügt? Damit andere, die 4images z.B heute einsetzen wollen bzw. downloaden wollen das nicht hier extra suchen müssen!
Ist nicht drin. Habe es gestern runtergeladen und installiert und jetzt die Änderungen gemacht.
-
Thank you for the follow-up
-
Thank you very much :D
I'm banned for spam. All links were removed. One message is more then enough.
-
teknopaylaşım (http://www.teknopaylasim.net)
bilgi paylaşım (http://www.bilgibaz.net)
Oyun sunucuları, domain, hosting, reseller, vps (http://www.liderserver.com)