diff options
author | alecpl <alec@alec.pl> | 2009-05-29 19:10:24 +0000 |
---|---|---|
committer | alecpl <alec@alec.pl> | 2009-05-29 19:10:24 +0000 |
commit | dadefb80b387b7a54763905e07b35ac5b3297a8f (patch) | |
tree | f8182df185a5e2f6ca9b5c7a35b0fba11f40435c /program/include | |
parent | 3297f6640bef3ddcc9afdd44aa9eb8789f35e5fa (diff) |
- prevent duplicated inserts (#1485867)
Diffstat (limited to 'program/include')
-rw-r--r-- | program/include/session.inc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/program/include/session.inc b/program/include/session.inc index a73ee5c48..ee9bb75ab 100644 --- a/program/include/session.inc +++ b/program/include/session.inc @@ -65,8 +65,13 @@ function rcube_sess_write($key, $vars) $now = $DB->fromunixtime(time()); - if ($oldvars = rcube_sess_read($key)) { - $a_oldvars = rcube_sess_unserialize($oldvars); + $sql_result = $DB->query( + "SELECT vars FROM " . get_table_name('session') . " + WHERE sess_id=?", $key); + + if ($sql_arr = $DB->fetch_assoc($sql_result)) { + + $a_oldvars = rcube_sess_unserialize($sql_arr['vars']); foreach ((array)$GLOBALS['rcube_session_unsets'] as $k) unset($a_oldvars[$k]); |