mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-19 21:55:15 +00:00
silence phpstorm's false positive error messages on db intervals
This commit is contained in:
parent
ad6cf9f712
commit
33e034f7d4
3 changed files with 9 additions and 8 deletions
|
@ -307,9 +307,10 @@ function dbescdate($date)
|
||||||
return DBA::$dba->escape($date);
|
return DBA::$dba->escape($date);
|
||||||
}
|
}
|
||||||
|
|
||||||
function db_quoteinterval($txt)
|
function db_quoteinterval($txt, $includeInterval = false)
|
||||||
{
|
{
|
||||||
return DBA::$dba->quote_interval($txt);
|
$returnText = $includeInterval ? 'INTERVAL ' : '';
|
||||||
|
return $returnText . DBA::$dba->quote_interval($txt);
|
||||||
}
|
}
|
||||||
|
|
||||||
function dbesc_identifier($str)
|
function dbesc_identifier($str)
|
||||||
|
|
|
@ -92,9 +92,9 @@ class Cron implements DaemonInterface
|
||||||
// Ensure that every channel pings their directory occasionally.
|
// Ensure that every channel pings their directory occasionally.
|
||||||
$interval = floatval(Config::Get('system','delivery_interval', 2));
|
$interval = floatval(Config::Get('system','delivery_interval', 2));
|
||||||
$r = q(
|
$r = q(
|
||||||
"select channel_id from channel where channel_dirdate < %s - INTERVAL %s and channel_removed = 0",
|
"select channel_id from channel where channel_dirdate < %s - %s and channel_removed = 0",
|
||||||
db_utcnow(),
|
db_utcnow(),
|
||||||
db_quoteinterval('7 DAY')
|
db_quoteinterval('7 DAY', true)
|
||||||
);
|
);
|
||||||
if ($r) {
|
if ($r) {
|
||||||
foreach ($r as $rr) {
|
foreach ($r as $rr) {
|
||||||
|
@ -162,9 +162,9 @@ class Cron implements DaemonInterface
|
||||||
|
|
||||||
$r = q(
|
$r = q(
|
||||||
"select xchan_photo_l, xchan_hash from xchan where xchan_photo_l != '' and xchan_photo_m = ''
|
"select xchan_photo_l, xchan_hash from xchan where xchan_photo_l != '' and xchan_photo_m = ''
|
||||||
and xchan_photo_date < %s - INTERVAL %s",
|
and xchan_photo_date < %s - %s",
|
||||||
db_utcnow(),
|
db_utcnow(),
|
||||||
db_quoteinterval('1 DAY')
|
db_quoteinterval('1 DAY', true)
|
||||||
);
|
);
|
||||||
if ($r) {
|
if ($r) {
|
||||||
require_once('include/photo_factory.php');
|
require_once('include/photo_factory.php');
|
||||||
|
|
|
@ -1567,10 +1567,10 @@ class Item extends Controller
|
||||||
|
|
||||||
if (PConfig::Get($profile_uid, 'system', 'suppress_duplicates', true) && (!$orig_post)) {
|
if (PConfig::Get($profile_uid, 'system', 'suppress_duplicates', true) && (!$orig_post)) {
|
||||||
$z = q(
|
$z = q(
|
||||||
"select created from item where uid = %d and created > %s - INTERVAL %s and body = '%s' limit 1",
|
"select created from item where uid = %d and created > %s - %s and body = '%s' limit 1",
|
||||||
intval($profile_uid),
|
intval($profile_uid),
|
||||||
db_utcnow(),
|
db_utcnow(),
|
||||||
db_quoteinterval('2 MINUTE'),
|
db_quoteinterval('2 MINUTE', true),
|
||||||
dbesc($body)
|
dbesc($body)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue