mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-06-02 04:15:05 +02:00
- bug 168 fixed: crash when language file does not exists. Constant
PHPWG_DEFAULT_LANGUAGE added. New function get_language_filepath always used to find language files. git-svn-id: http://piwigo.org/svn/trunk@879 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
+2
-23
@@ -166,32 +166,11 @@ while ( $row =mysql_fetch_array( $result ) )
|
||||
include(PHPWG_ROOT_PATH.'include/user.inc.php');
|
||||
|
||||
// language files
|
||||
$user_langdir = PHPWG_ROOT_PATH.'language/'.$user['language'];
|
||||
$conf_langdir = PHPWG_ROOT_PATH.'language/'.$conf['default_language'];
|
||||
include_once(get_language_filepath('common.lang.php'));
|
||||
|
||||
if (file_exists($user_langdir.'/common.lang.php'))
|
||||
{
|
||||
include_once($user_langdir.'/common.lang.php');
|
||||
}
|
||||
else
|
||||
{
|
||||
include_once($conf_langdir.'/common.lang.php');
|
||||
}
|
||||
|
||||
// The administration section requires 2 more language files
|
||||
if (defined('IN_ADMIN') and IN_ADMIN)
|
||||
{
|
||||
foreach (array('admin') as $section)
|
||||
{
|
||||
if (file_exists($user_langdir.'/'.$section.'.lang.php'))
|
||||
{
|
||||
include_once($user_langdir.'/'.$section.'.lang.php');
|
||||
}
|
||||
else
|
||||
{
|
||||
include_once($conf_langdir.'/'.$section.'.lang.php');
|
||||
}
|
||||
}
|
||||
include_once(get_language_filepath('admin.lang.php'));
|
||||
}
|
||||
|
||||
// only now we can set the localized username of the guest user (and not in
|
||||
|
||||
Reference in New Issue
Block a user