Update stray queries to PDO-style parameters
This commit is contained in:
parent
f82e952247
commit
48377ec823
@ -438,9 +438,9 @@ class Asset
|
|||||||
$this->slug = $this->subdir . '/' . $this->title;
|
$this->slug = $this->subdir . '/' . $this->title;
|
||||||
Registry::get('db')->query('
|
Registry::get('db')->query('
|
||||||
UPDATE assets
|
UPDATE assets
|
||||||
SET subdir = {string:subdir},
|
SET subdir = :subdir,
|
||||||
slug = {string:slug}
|
slug = :slug
|
||||||
WHERE id_asset = {int:id_asset}',
|
WHERE id_asset = :id_asset',
|
||||||
[
|
[
|
||||||
'id_asset' => $this->id_asset,
|
'id_asset' => $this->id_asset,
|
||||||
'subdir' => $this->subdir,
|
'subdir' => $this->subdir,
|
||||||
|
@ -98,7 +98,7 @@ class AssetIterator implements Iterator
|
|||||||
if (isset($options['id_user_uploaded']))
|
if (isset($options['id_user_uploaded']))
|
||||||
{
|
{
|
||||||
$params['id_user_uploaded'] = $options['id_user_uploaded'];
|
$params['id_user_uploaded'] = $options['id_user_uploaded'];
|
||||||
$where[] = 'id_user_uploaded = {int:id_user_uploaded}';
|
$where[] = 'id_user_uploaded = :id_user_uploaded';
|
||||||
}
|
}
|
||||||
if (isset($options['id_tag']))
|
if (isset($options['id_tag']))
|
||||||
{
|
{
|
||||||
|
@ -40,7 +40,7 @@ class Authentication
|
|||||||
$key = Registry::get('db')->queryValue('
|
$key = Registry::get('db')->queryValue('
|
||||||
SELECT reset_key
|
SELECT reset_key
|
||||||
FROM users
|
FROM users
|
||||||
WHERE id_user = {int:id}',
|
WHERE id_user = :id',
|
||||||
[
|
[
|
||||||
'id' => $id_user,
|
'id' => $id_user,
|
||||||
]);
|
]);
|
||||||
@ -65,7 +65,7 @@ class Authentication
|
|||||||
UPDATE users
|
UPDATE users
|
||||||
SET reset_key = NULL,
|
SET reset_key = NULL,
|
||||||
reset_blocked_until = NULL
|
reset_blocked_until = NULL
|
||||||
WHERE id_user = {int:id_user}',
|
WHERE id_user = :id_user',
|
||||||
['id_user' => $id_user]);
|
['id_user' => $id_user]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -74,7 +74,7 @@ class Authentication
|
|||||||
$resetTime = Registry::get('db')->queryValue('
|
$resetTime = Registry::get('db')->queryValue('
|
||||||
SELECT reset_blocked_until
|
SELECT reset_blocked_until
|
||||||
FROM users
|
FROM users
|
||||||
WHERE id_user = {int:id_user}',
|
WHERE id_user = :id_user',
|
||||||
['id_user' => $id_user]);
|
['id_user' => $id_user]);
|
||||||
|
|
||||||
return max(0, $resetTime - time());
|
return max(0, $resetTime - time());
|
||||||
@ -117,7 +117,7 @@ class Authentication
|
|||||||
UPDATE users
|
UPDATE users
|
||||||
SET reset_key = {string:key},
|
SET reset_key = {string:key},
|
||||||
reset_blocked_until = UNIX_TIMESTAMP() + ' . static::DEFAULT_RESET_TIMEOUT . '
|
reset_blocked_until = UNIX_TIMESTAMP() + ' . static::DEFAULT_RESET_TIMEOUT . '
|
||||||
WHERE id_user = {int:id}',
|
WHERE id_user = :id',
|
||||||
[
|
[
|
||||||
'id' => $id_user,
|
'id' => $id_user,
|
||||||
'key' => self::newActivationKey(),
|
'key' => self::newActivationKey(),
|
||||||
@ -151,8 +151,8 @@ class Authentication
|
|||||||
|
|
||||||
$success = Registry::get('db')->query('
|
$success = Registry::get('db')->query('
|
||||||
UPDATE users
|
UPDATE users
|
||||||
SET reset_blocked_until = {int:new_time_out}
|
SET reset_blocked_until = :new_time_out
|
||||||
WHERE id_user = {int:id_user}',
|
WHERE id_user = :id_user',
|
||||||
[
|
[
|
||||||
'id_user' => $id_user,
|
'id_user' => $id_user,
|
||||||
'new_time_out' => time() + $newResetTimeOut,
|
'new_time_out' => time() + $newResetTimeOut,
|
||||||
|
@ -69,7 +69,7 @@ class Email
|
|||||||
$row = Registry::get('db')->queryAssoc('
|
$row = Registry::get('db')->queryAssoc('
|
||||||
SELECT first_name, surname, emailaddress, reset_key
|
SELECT first_name, surname, emailaddress, reset_key
|
||||||
FROM users
|
FROM users
|
||||||
WHERE id_user = {int:id_user}',
|
WHERE id_user = :id_user',
|
||||||
[
|
[
|
||||||
'id_user' => $id_user,
|
'id_user' => $id_user,
|
||||||
]);
|
]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user