Projects ⇒ Bugs ⇒ #787: Installer does'nt retain selected language [with fix] ⇒ CPG Dragonfly™ CMS
Bug #787 Installer does'nt retain selected language [with fix]
Project: Dragonfly 9.0.3 -> 9.3 Category: Output Control
Submitted: Sunday, May 07, 2006 (10:25:58) Modified: Sunday, May 14, 2006 (01:50:22)
Status: Closed Assigned to: NanoCaiordo
PHP Version: Irrelevant HTTPD Server: Apache 1.3

View/Vote Add Comment

by: NanoCaiordo
Description:
------------
While installing a fresh copy of the latest cvs version its not possible to change language.

$Source: /cvs/html/install.php,v $
$Revision: 9.24 $

Reproduce code:
---------------
### actual code ###
$MAIN_CFG['global'] = array('language' => 'english', 'multilingual' => '0', 'GoogleTap' => '0');
if (isset($_GET['newlang'])) {
setcookie('installlang',$_GET['newlang']);
$currentlang = $_GET['newlang'];
} elseif (isset($_COOKIE['installlang'])) {
$currentlang = $_COOKIE['installlang'];
}

Expected result:
----------------
### working code ###
if (isset($_GET['newlang'])) {
setcookie('installlang',$_GET['newlang']);
$currentlang = $_GET['newlang'];
} elseif (isset($_COOKIE['installlang'])) {
$currentlang = $_COOKIE['installlang'];
}
$MAIN_CFG['global'] = array('language' => $currentlang, 'multilingual' => '0', 'GoogleTap' => '0');
by: NanoCaiordo
### better fix ###
$instlang = array();
if (empty($currentlang) || !preg_match('#^[a-z_]+$#', $currentlang) || ($currentlang != 'english' && !file_exists(BASEDIR."install/language/$currentlang.php"))) {
$currentlang = 'english';
}
$MAIN_CFG['global'] = array('language' => $currentlang, 'multilingual' => '0', 'GoogleTap' => '0');


NOTE only $MAIN_CFG have been moved down
User Info

Welcome Anonymous



(Register)
Community

Support for DragonflyCMS in a other languages:

Deutsch
Español