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