Minor fixes

This commit is contained in:
Alejandro Gallardo Escobar 2015-05-20 17:37:39 +02:00
parent 6c715cf483
commit 3176cdfaee
1 changed files with 5 additions and 5 deletions

View File

@ -33,14 +33,14 @@ function pandora_session_read ($session_id) {
return false;
}
function pandora_session_write ($session_id, $val) {
function pandora_session_write ($session_id, $data) {
$session_id = addslashes($session_id);
$values = array();
$values['last_active'] = time();
if (!empty($val))
$values['data'] = addslashes($val);
if (!empty($data))
$values['data'] = addslashes($data);
$session_exists = (bool) db_get_value('COUNT(id_session)', 'tsessions_php', 'id_session', $session_id);
@ -58,7 +58,7 @@ function pandora_session_write ($session_id, $val) {
function pandora_session_destroy ($session_id) {
$session_id = addslashes($session_id);
$retval = db_process_sql_delete('tsessions_php', array('id_session' => $session_id));
$retval = (bool) db_process_sql_delete('tsessions_php', array('id_session' => $session_id));
return $retval;
}
@ -72,7 +72,7 @@ function pandora_session_gc ($max_lifetime = 300) {
$time_limit = time() - $max_lifetime;
$retval = db_process_sql_delete('tsessions_php', array('last_active' => "<" . $time_limit));
$retval = (bool) db_process_sql_delete('tsessions_php', array('last_active' => "<" . $time_limit));
return $retval;
}