aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/auth/provider/oauth/token_storage.php
diff options
context:
space:
mode:
authorJoseph Warner <hardolaf@hardolaf.com>2013-09-02 16:47:40 -0400
committerJoseph Warner <hardolaf@hardolaf.com>2013-09-02 16:47:53 -0400
commit29e3768ecc7bc8adf96d4e31c4e05a6f1de6735a (patch)
treec79a5ce75fef95c0d615e619e90de9c77acf3237 /phpBB/phpbb/auth/provider/oauth/token_storage.php
parent63ba06406575b5c7882ef26ee3b5469ca16afec5 (diff)
downloadforums-29e3768ecc7bc8adf96d4e31c4e05a6f1de6735a.tar
forums-29e3768ecc7bc8adf96d4e31c4e05a6f1de6735a.tar.gz
forums-29e3768ecc7bc8adf96d4e31c4e05a6f1de6735a.tar.bz2
forums-29e3768ecc7bc8adf96d4e31c4e05a6f1de6735a.tar.xz
forums-29e3768ecc7bc8adf96d4e31c4e05a6f1de6735a.zip
[feature/oauth] More minor changes from review
PHPBB3-11673
Diffstat (limited to 'phpBB/phpbb/auth/provider/oauth/token_storage.php')
-rw-r--r--phpBB/phpbb/auth/provider/oauth/token_storage.php26
1 files changed, 13 insertions, 13 deletions
diff --git a/phpBB/phpbb/auth/provider/oauth/token_storage.php b/phpBB/phpbb/auth/provider/oauth/token_storage.php
index f9ba28ee69..d21deb8999 100644
--- a/phpBB/phpbb/auth/provider/oauth/token_storage.php
+++ b/phpBB/phpbb/auth/provider/oauth/token_storage.php
@@ -82,11 +82,11 @@ class phpbb_auth_provider_oauth_token_storage implements TokenStorageInterface
}
$data = array(
- 'user_id' => $this->user->data['user_id'],
+ 'user_id' => (int) $this->user->data['user_id'],
'provider' => $service,
);
- if ($this->user->data['user_id'] === ANONYMOUS)
+ if ((int) $this->user->data['user_id'] === ANONYMOUS)
{
$data['session_id'] = $this->user->data['session_id'];
}
@@ -104,7 +104,7 @@ class phpbb_auth_provider_oauth_token_storage implements TokenStorageInterface
$this->cachedToken = $token;
$data = array(
- 'user_id' => $this->user->data['user_id'],
+ 'user_id' => (int) $this->user->data['user_id'],
'provider' => $service,
'oauth_token' => $this->json_encode_token($token),
'session_id' => $this->user->data['session_id'],
@@ -127,11 +127,11 @@ class phpbb_auth_provider_oauth_token_storage implements TokenStorageInterface
}
$data = array(
- 'user_id' => $this->user->data['user_id'],
+ 'user_id' => (int) $this->user->data['user_id'],
'provider' => $service,
);
- if ($this->user->data['user_id'] === ANONYMOUS)
+ if ((int) $this->user->data['user_id'] === ANONYMOUS)
{
$data['session_id'] = $this->user->data['session_id'];
}
@@ -149,12 +149,12 @@ class phpbb_auth_provider_oauth_token_storage implements TokenStorageInterface
$this->cachedToken = null;
$sql = 'DELETE FROM ' . $this->auth_provider_oauth_table . '
- WHERE user_id = ' . $this->user->data['user_id'] . "
+ WHERE user_id = ' . (int) $this->user->data['user_id'] . "
AND provider = '" . $this->db->sql_escape($service) . "'";
- if ($this->user->data['user_id'] === ANONYMOUS)
+ if ((int) $this->user->data['user_id'] === ANONYMOUS)
{
- $sql .= " AND session_id = '" . $this->user->data['session_id'] . "'";
+ $sql .= " AND session_id = '" . $this->db->sql_escape($this->user->data['session_id']) . "'";
}
$this->db->sql_query($sql);
@@ -168,11 +168,11 @@ class phpbb_auth_provider_oauth_token_storage implements TokenStorageInterface
$this->cachedToken = null;
$sql = 'DELETE FROM ' . $this->auth_provider_oauth_table . '
- WHERE user_id = ' . $this->user->data['user_id'];
+ WHERE user_id = ' . (int) $this->user->data['user_id'];
- if ($this->user->data['user_id'] === ANONYMOUS)
+ if ((int) $this->user->data['user_id'] === ANONYMOUS)
{
- $sql .= " AND session_id = '" . $this->user->data['session_id'] . "'";
+ $sql .= " AND session_id = '" . $this->db->sql_escape($this->user->data['session_id']) . "'";
}
$this->db->sql_query($sql);
@@ -194,8 +194,8 @@ class phpbb_auth_provider_oauth_token_storage implements TokenStorageInterface
SET ' . $this->db->sql_build_array('UPDATE', array(
'user_id' => (int) $user_id
)) . '
- WHERE user_id = ' . $this->user->data['user_id'] . "
- AND session_id = '" . $this->user->data['session_id'] . "'";
+ WHERE user_id = ' . (int) $this->user->data['user_id'] . "
+ AND session_id = '" . $this->db->sql_escape($this->user->data['session_id']) . "'";
$this->db->sql_query($sql);
}