Ignore:
Timestamp:
Sep 27, 2005, 11:57:14 PM (19 years ago)
Author:
plg
Message:
  • 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.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/common.inc.php

    r862 r879  
    167167
    168168// language files
    169 $user_langdir = PHPWG_ROOT_PATH.'language/'.$user['language'];
    170 $conf_langdir = PHPWG_ROOT_PATH.'language/'.$conf['default_language'];
     169include_once(get_language_filepath('common.lang.php'));
    171170
    172 if (file_exists($user_langdir.'/common.lang.php'))
    173 {
    174   include_once($user_langdir.'/common.lang.php');
    175 }
    176 else
    177 {
    178   include_once($conf_langdir.'/common.lang.php');
    179 }
    180 
    181 // The administration section requires 2 more language files
    182171if (defined('IN_ADMIN') and IN_ADMIN)
    183172{
    184   foreach (array('admin') as $section)
    185   {
    186     if (file_exists($user_langdir.'/'.$section.'.lang.php'))
    187     {
    188       include_once($user_langdir.'/'.$section.'.lang.php');
    189     }
    190     else
    191     {
    192       include_once($conf_langdir.'/'.$section.'.lang.php');
    193     }
    194   }
     173  include_once(get_language_filepath('admin.lang.php'));
    195174}
    196175
Note: See TracChangeset for help on using the changeset viewer.