From e84a8dc12cefc9e8a8b09dbe1ecc25af3cc02689 Mon Sep 17 00:00:00 2001 From: "Paul S. Owen" Date: Sun, 29 Feb 2004 12:51:18 +0000 Subject: [PATCH] Minor alteration git-svn-id: file:///svn/phpbb/trunk@4847 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/session.php | 42 +++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index f8e5c7aa66..f2bd4a4d6d 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -515,7 +515,6 @@ class user extends session } } - include($this->lang_path . '/common.' . $phpEx); $this->add_lang($lang_set); unset($lang_set); @@ -523,8 +522,7 @@ class user extends session { global $SID; - $style = intval($_GET['style']); - $SID .= '&style=' . $style; + $SID .= '&style=' . request_var('style', 0); } else { @@ -573,23 +571,6 @@ class user extends session return; } - // Internal usage - function set_lang($lang_file, $use_db = false, $use_help = false) - { - global $lang, $help, $phpEx; - - if (!$use_db) - { - include($this->lang_path . '/' . (($use_help) ? 'help_' : '') . $lang_file . '.' . $phpEx); - } - else if ($use_db) - { - // Get Database Language Strings - // Put them into $lang if nothing is prefixed, put them into $help if help: is prefixed - // For example: help:faq, posting - } - } - // Add Language Items - use_db and use_help are assigned where needed (only use them to force inclusion) // // $lang_set = array('posting', 'help' => 'faq'); @@ -601,11 +582,14 @@ class user extends session { global $lang, $help, $phpEx; + $lang = array(); + + require($this->lang_path . "common.$phpEx"); + if (is_array($lang_set)) { foreach ($lang_set as $key => $lang_file) { - $key = (string) $key; if ($key == 'db') { $this->add_lang($lang_file, true, $use_help); @@ -644,6 +628,22 @@ class user extends session } } + function set_lang($lang_file, $use_db = false, $use_help = false) + { + global $lang, $help, $phpEx; + + if (!$use_db) + { + require($this->lang_path . (($use_help) ? 'help_' : '') . "$lang_file.$phpEx"); + } + else if ($use_db) + { + // Get Database Language Strings + // Put them into $lang if nothing is prefixed, put them into $help if help: is prefixed + // For example: help:faq, posting + } + } + function format_date($gmepoch, $format = false) { static $lang_dates;