aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/session.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2008-03-31 14:58:14 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2008-03-31 14:58:14 +0000
commit3e42df098cedbd4c70f893ea23de7f06df519fe2 (patch)
treedf5d5b407cf15af4219b244c79d530bc3e1424ba /phpBB/includes/session.php
parent45c97a40d268ec2be7e3300a46a2068e75f5ce52 (diff)
downloadforums-3e42df098cedbd4c70f893ea23de7f06df519fe2.tar
forums-3e42df098cedbd4c70f893ea23de7f06df519fe2.tar.gz
forums-3e42df098cedbd4c70f893ea23de7f06df519fe2.tar.bz2
forums-3e42df098cedbd4c70f893ea23de7f06df519fe2.tar.xz
forums-3e42df098cedbd4c70f893ea23de7f06df519fe2.zip
merging some changes
git-svn-id: file:///svn/phpbb/trunk@8484 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/session.php')
-rw-r--r--phpBB/includes/session.php17
1 files changed, 16 insertions, 1 deletions
diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php
index d0c8c3abe6..f6b1c61b20 100644
--- a/phpBB/includes/session.php
+++ b/phpBB/includes/session.php
@@ -312,9 +312,24 @@ class session
$sql_ary['session_page'] = substr($this->page['page'], 0, 199);
}
+ $db->sql_return_on_error(true);
+
$sql = 'UPDATE ' . SESSIONS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . "
WHERE session_id = '" . $db->sql_escape($this->session_id) . "'";
- $db->sql_query($sql);
+ $result = $db->sql_query($sql);
+
+ $db->sql_return_on_error(false);
+
+ // If the database is not yet updated, there will be an error due to the session_forum_id
+ // @todo REMOVE for 3.0.2
+ if ($result === false)
+ {
+ unset($sql_ary['session_forum_id']);
+
+ $sql = 'UPDATE ' . SESSIONS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . "
+ WHERE session_id = '" . $db->sql_escape($this->session_id) . "'";
+ $db->sql_query($sql);
+ }
}
$this->data['is_registered'] = ($this->data['user_id'] != ANONYMOUS && ($this->data['user_type'] == USER_NORMAL || $this->data['user_type'] == USER_FOUNDER)) ? true : false;