diff options
author | Bart van Bragt <bartvb@users.sourceforge.net> | 2005-03-17 22:41:20 +0000 |
---|---|---|
committer | Bart van Bragt <bartvb@users.sourceforge.net> | 2005-03-17 22:41:20 +0000 |
commit | a6d2d210db5b5a17079d343bb494cc4ff6ca7583 (patch) | |
tree | f22de1e7aa9088ce63a54e496db79ad80bf2096d | |
parent | 4269b318a29f3cff9da6bdf2f7cff959dcb0c961 (diff) | |
download | forums-a6d2d210db5b5a17079d343bb494cc4ff6ca7583.tar forums-a6d2d210db5b5a17079d343bb494cc4ff6ca7583.tar.gz forums-a6d2d210db5b5a17079d343bb494cc4ff6ca7583.tar.bz2 forums-a6d2d210db5b5a17079d343bb494cc4ff6ca7583.tar.xz forums-a6d2d210db5b5a17079d343bb494cc4ff6ca7583.zip |
Show a useful error message if a language file is missing
git-svn-id: file:///svn/phpbb/trunk@5104 89ea8834-ac86-4346-8a33-228a782c2dd0
-rw-r--r-- | phpBB/includes/session.php | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index 9983c8049d..824d1d201e 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -544,7 +544,11 @@ class user extends session // We include common language file here to not load it every time a custom language file is included $lang = &$this->lang; - require($this->lang_path . "common.$phpEx"); + if ((@include $this->lang_path . "common.$phpEx") === FALSE) + { + die("Language file " . $this->lang_path . "common.$phpEx" . " couldn't be opened."); + } + $this->add_lang($lang_set); unset($lang_set); @@ -688,10 +692,13 @@ class user extends session // $lang == $this->lang // $help == $this->help // - add appropiate variables here, name them as they are used within the language file... - +die($lang_file); if (!$use_db) { - require($this->lang_path . (($use_help) ? 'help_' : '') . "$lang_file.$phpEx"); + if ( (@include $this->lang_path . (($use_help) ? 'help_' : '') . "$lang_file.$phpEx") === FALSE ) + { + trigger_error("Language file " . $this->lang_path . (($use_help) ? 'help_' : '') . "$lang_file.$phpEx" . " couldn't be opened."); + } } else if ($use_db) { |