Commit 4d35d490 authored by fettesvieh's avatar fettesvieh

R2 release

parent 97280c4a
......@@ -62,13 +62,14 @@ class auth
}
if (validate::isNumber($user_id)) {
global $db;
static $info = array();
static $user_info = array();
if (empty($info)) {
if (empty($user_info[$user_id])) {
$info = $db->select('nickname, realname, access, mail, website, time_zone, dst, language, draft', 'users', 'id = \'' . $user_id . '\'');
$user_info[$user_id] = $info[0];
}
return count($info) == '1' ? $info[0] : false;
return !empty($user_info[$user_id]) == '1' ? $user_info[$user_id] : false;
}
return false;
}
......
......@@ -72,13 +72,13 @@ function comments($module = 0, $entry_id = 0)
'name' => $db->escape($form['name']),
'user_id' => $auth->isUser() && preg_match('/\d/', USER_ID) ? USER_ID : '',
'message' => $db->escape($form['message']),
'module' => $db->escape($module, 2),
'entry_id' => $entry_id,
'module' => $db->escape($form['module'], 2),
'entry_id' => $form['entry_id'],
);
$bool = $db->insert('comments', $insert_values);
return comboBox($bool ? lang('comments', 'create_success') : lang('comments', 'create_error'), uri($module . '/details/id_' . $entry_id));
return comboBox($bool ? lang('comments', 'create_success') : lang('comments', 'create_error'), uri($form['module'] . '/details/id_' . $form['entry_id']));
}
}
if (!isset($_POST['submit']) || isset($errors) && is_array($errors)) {
......
......@@ -25,7 +25,7 @@ if (isset($_POST['submit'])) {
if (isset($errors)) {
$tpl->assign('error_msg', comboBox($errors));
} else {
$hash = md5(mt_rand(0, microtime(true));
$hash = md5(mt_rand(0, microtime(true)));
$host = htmlentities($_SERVER['HTTP_HOST']);
$newsletter = config::output('newsletter');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment