fix query as @annado comment

This commit is contained in:
fabrixxm 2014-05-12 19:02:03 +02:00
parent d7b514c2c0
commit f55a22cb19

View file

@ -993,9 +993,10 @@ function item_store($arr,$force_parent = false) {
/* check for create date and expire time */ /* check for create date and expire time */
$uid = intval($arr['uid']); $uid = intval($arr['uid']);
$r = q("SELECT expire FROM user WHERE expire != 0 AND uid = %d", $uid); $r = q("SELECT expire FROM user WHERE uid = %d", $uid);
if(count($r)) { if(count($r)) {
$expire_interval = $r[0]['expire']; $expire_interval = $r[0]['expire'];
if ($expire_interval>0) {
$expire_date = new DateTime( '- '.$expire_interval.' days', new DateTimeZone('UTC')); $expire_date = new DateTime( '- '.$expire_interval.' days', new DateTimeZone('UTC'));
$created_date = new DateTime($arr['created'], new DateTimeZone('UTC')); $created_date = new DateTime($arr['created'], new DateTimeZone('UTC'));
if ($created_date < $expire_date) { if ($created_date < $expire_date) {
@ -1003,6 +1004,7 @@ function item_store($arr,$force_parent = false) {
return 0; return 0;
} }
} }
}
// Shouldn't happen but we want to make absolutely sure it doesn't leak from a plugin. // Shouldn't happen but we want to make absolutely sure it doesn't leak from a plugin.