diff --git a/Zotlabs/Daemon/Cron.php b/Zotlabs/Daemon/Cron.php
index 95c108ead..6fe668536 100644
--- a/Zotlabs/Daemon/Cron.php
+++ b/Zotlabs/Daemon/Cron.php
@@ -2,6 +2,7 @@
namespace Zotlabs\Daemon;
+use DBA;
use Zotlabs\Lib\Config;
use Zotlabs\Lib\ObjCache;
use Zotlabs\Lib\Libsync;
@@ -93,7 +94,7 @@ class Cron {
// delete expired access tokens
$r = q("select atoken_id from atoken where atoken_expires > '%s' and atoken_expires < %s",
- dbesc(NULL_DATE),
+ dbesc(DBA::$dba->get_null_date()),
db_utcnow()
);
if ($r) {
diff --git a/Zotlabs/Daemon/Onepoll.php b/Zotlabs/Daemon/Onepoll.php
index 146ca47ea..dd0daca08 100644
--- a/Zotlabs/Daemon/Onepoll.php
+++ b/Zotlabs/Daemon/Onepoll.php
@@ -2,6 +2,7 @@
namespace Zotlabs\Daemon;
+use DBA;
use Zotlabs\Lib\Activity;
use Zotlabs\Lib\ActivityStreams;
use Zotlabs\Lib\ASCollection;
@@ -57,7 +58,7 @@ class Onepoll {
logger("onepoll: poll: ($contact_id) IMPORTER: {$importer['xchan_name']}, CONTACT: {$contact['xchan_name']}");
- $last_update = ((($contact['abook_updated'] === $contact['abook_created']) || ($contact['abook_updated'] <= NULL_DATE))
+ $last_update = ((($contact['abook_updated'] === $contact['abook_created']) || ($contact['abook_updated'] <= DBA::$dba->get_null_date()))
? datetime_convert('UTC', 'UTC', 'now - 7 days')
: datetime_convert('UTC', 'UTC', $contact['abook_updated'] . ' - 2 days')
);
diff --git a/Zotlabs/Daemon/Poller.php b/Zotlabs/Daemon/Poller.php
index 2103310b9..466b75697 100644
--- a/Zotlabs/Daemon/Poller.php
+++ b/Zotlabs/Daemon/Poller.php
@@ -2,6 +2,7 @@
namespace Zotlabs\Daemon;
+use DBA;
use Zotlabs\Lib\Config;
class Poller {
@@ -117,7 +118,7 @@ class Poller {
// if we've never connected with them, start the mark for death countdown from now
- if ($c <= NULL_DATE) {
+ if ($c <= DBA::$dba->get_null_date()) {
q("update abook set abook_connected = '%s' where abook_id = %d",
dbesc(datetime_convert()),
intval($contact['abook_id'])
@@ -173,7 +174,7 @@ class Poller {
if ($dirmode == DIRECTORY_MODE_SECONDARY || $dirmode == DIRECTORY_MODE_PRIMARY) {
$r = q("SELECT * FROM updates WHERE ud_update = 1 AND (ud_last = '%s' OR ud_last > %s - INTERVAL %s)",
- dbesc(NULL_DATE),
+ dbesc(DBA::$dba->get_null_date()),
db_utcnow(),
db_quoteinterval('7 DAY')
);
@@ -184,7 +185,7 @@ class Poller {
// If they didn't respond when we attempted before, back off to once a day
// After 7 days we won't bother anymore
- if ($rr['ud_last'] > NULL_DATE)
+ if ($rr['ud_last'] > DBA::$dba->get_null_date())
if ($rr['ud_last'] > datetime_convert('UTC', 'UTC', 'now - 1 day'))
continue;
diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php
index aa499b5c4..b1c341434 100644
--- a/Zotlabs/Lib/Activity.php
+++ b/Zotlabs/Lib/Activity.php
@@ -3,6 +3,7 @@
namespace Zotlabs\Lib;
use App;
+use DBA;
use Zotlabs\Access\PermissionLimits;
use Zotlabs\Access\PermissionRoles;
use Zotlabs\Access\Permissions;
@@ -568,7 +569,7 @@ class Activity {
$ret['published'] = datetime_convert('UTC', 'UTC', $i['created'], ATOM_TIME);
if ($i['created'] !== $i['edited'])
$ret['updated'] = datetime_convert('UTC', 'UTC', $i['edited'], ATOM_TIME);
- if ($i['expires'] > NULL_DATE) {
+ if ($i['expires'] > DBA::$dba->get_null_date()) {
$ret['expires'] = datetime_convert('UTC', 'UTC', $i['expires'], ATOM_TIME);
}
@@ -593,7 +594,7 @@ class Activity {
$ret['commentPolicy'] = (($i['item_wall']) ? map_scope(PermissionLimits::Get($i['uid'], 'post_comments')) : '');
- if (array_key_exists('comments_closed', $i) && $i['comments_closed'] !== EMPTY_STR && $i['comments_closed'] > NULL_DATE) {
+ if (array_key_exists('comments_closed', $i) && $i['comments_closed'] !== EMPTY_STR && $i['comments_closed'] > DBA::$dba->get_null_date()) {
if ($ret['commentPolicy']) {
$ret['commentPolicy'] .= ' ';
}
@@ -1564,7 +1565,7 @@ class Activity {
'abook_created' => datetime_convert(),
'abook_updated' => datetime_convert(),
'abook_connected' => datetime_convert(),
- 'abook_dob' => NULL_DATE,
+ 'abook_dob' => DBA::$dba->get_null_date(),
'abook_pending' => intval(($automatic) ? 0 : 1),
'abook_instance' => z_root()
]
@@ -2088,7 +2089,7 @@ class Activity {
}
}
}
- if ($pollItem['comments_closed'] > NULL_DATE) {
+ if ($pollItem['comments_closed'] > DBA::$dba->get_null_date()) {
if ($pollItem['comments_closed'] > datetime_convert()) {
$o['closed'] = datetime_convert('UTC', 'UTC', $pollItem['comments_closed'], ATOM_TIME);
// set this to force an update
@@ -2306,7 +2307,7 @@ class Activity {
if ($s['mid'] === $s['parent_mid']) {
$s['item_thread_top'] = 1;
$s['item_nocomment'] = 0;
- $s['comments_closed'] = NULL_DATE;
+ $s['comments_closed'] = DBA::$dba->get_null_date();
// it is a parent node - decode the comment policy info if present
if ($act->objprop('commentPolicy')) {
diff --git a/Zotlabs/Lib/Libzot.php b/Zotlabs/Lib/Libzot.php
index 1b7a1f0a5..515efd463 100644
--- a/Zotlabs/Lib/Libzot.php
+++ b/Zotlabs/Lib/Libzot.php
@@ -3,6 +3,7 @@
namespace Zotlabs\Lib;
use App;
+use DBA;
use Zotlabs\Access\PermissionLimits;
use Zotlabs\Access\Permissions;
use Zotlabs\Daemon\Master;
@@ -348,7 +349,7 @@ class Libzot {
$next_birthday = datetime_convert('UTC', 'UTC', $record['data']['profile']['next_birthday']);
}
else {
- $next_birthday = NULL_DATE;
+ $next_birthday = DBA::$dba->get_null_date();
}
$profile_assign = get_pconfig($channel['channel_id'], 'system', 'profile_assign', '');
diff --git a/Zotlabs/Lib/Libzotdir.php b/Zotlabs/Lib/Libzotdir.php
index 25f308fc2..4d32a7500 100644
--- a/Zotlabs/Lib/Libzotdir.php
+++ b/Zotlabs/Lib/Libzotdir.php
@@ -2,6 +2,7 @@
namespace Zotlabs\Lib;
+use DBA;
use Zotlabs\Lib\Config;
use Zotlabs\Lib\Libzot;
use Zotlabs\Lib\Zotfinger;
@@ -216,7 +217,7 @@ class Libzotdir {
[
'site_url' => DIRECTORY_FALLBACK_MASTER,
'site_flags' => DIRECTORY_MODE_PRIMARY,
- 'site_update' => NULL_DATE,
+ 'site_update' => DBA::$dba->get_null_date(),
'site_directory' => DIRECTORY_FALLBACK_MASTER . '/dirsearch',
'site_realm' => DIRECTORY_REALM,
'site_valid' => 1,
@@ -247,7 +248,7 @@ class Libzotdir {
$token = Config::Get('system','realm_token');
- $syncdate = (($rr['site_sync'] <= NULL_DATE) ? datetime_convert('UTC','UTC','now - 2 days') : $rr['site_sync']);
+ $syncdate = (($rr['site_sync'] <= DBA::$dba->get_null_date()) ? datetime_convert('UTC','UTC','now - 2 days') : $rr['site_sync']);
$x = z_fetch_url($rr['site_directory'] . '?f=&sync=' . urlencode($syncdate) . (($token) ? '&t=' . $token : ''));
if (! $x['success'])
@@ -724,7 +725,7 @@ class Libzotdir {
if ($u) {
$x = q("UPDATE updates SET $date_sql $flag_sql ud_last = '%s', ud_host = '%s', ud_addr = '%s', ud_update = 0 WHERE ud_id = %d",
- dbesc(NULL_DATE),
+ dbesc(DBA::$dba->get_null_date()),
dbesc(z_root()),
dbesc($addr),
intval($u[0]['ud_id'])
diff --git a/Zotlabs/Lib/ThreadItem.php b/Zotlabs/Lib/ThreadItem.php
index 9c0172469..18631e47b 100644
--- a/Zotlabs/Lib/ThreadItem.php
+++ b/Zotlabs/Lib/ThreadItem.php
@@ -3,6 +3,7 @@
namespace Zotlabs\Lib;
use App;
+use DBA;
use Zotlabs\Access\AccessList;
require_once('include/text.php');
@@ -415,7 +416,7 @@ class ThreadItem {
'isotime' => datetime_convert('UTC', date_default_timezone_get(), $item['created'], 'c'),
'localtime' => datetime_convert('UTC', date_default_timezone_get(), $item['created']),
'editedtime' => (($item['edited'] != $item['created']) ? sprintf(t('Last edited %s'), relative_time($item['edited'])) : ''),
- 'expiretime' => (($item['expires'] > NULL_DATE) ? sprintf(t('Expires %s'), relative_time($item['expires'])) : ''),
+ 'expiretime' => (($item['expires'] > DBA::$dba->get_null_date()) ? sprintf(t('Expires %s'), relative_time($item['expires'])) : ''),
'lock' => $lock,
'locktype' => $locktype,
'delayed' => (($item['item_delayed']) ? sprintf(t('Published %s'), relative_time($item['created'])) : ''),
diff --git a/Zotlabs/Module/Admin.php b/Zotlabs/Module/Admin.php
index 89eaeccfe..7dfbe6f0f 100644
--- a/Zotlabs/Module/Admin.php
+++ b/Zotlabs/Module/Admin.php
@@ -8,6 +8,7 @@
namespace Zotlabs\Module;
+use DBA;
use Zotlabs\Lib\Config;
require_once('include/account.php');
@@ -90,7 +91,7 @@ class Admin extends \Zotlabs\Web\Controller {
$r = q("SELECT COUNT(CASE WHEN account_id > 0 THEN 1 ELSE NULL END) AS total, COUNT(CASE WHEN account_expires > %s THEN 1 ELSE NULL END) AS expiring, COUNT(CASE WHEN account_expires < %s AND account_expires > '%s' THEN 1 ELSE NULL END) AS expired, COUNT(CASE WHEN (account_flags & %d)>0 THEN 1 ELSE NULL END) AS blocked FROM account",
db_utcnow(),
db_utcnow(),
- dbesc(NULL_DATE),
+ dbesc(DBA::$dba->get_null_date()),
intval(ACCOUNT_BLOCKED)
);
if ($r) {
diff --git a/Zotlabs/Module/Changeaddr.php b/Zotlabs/Module/Changeaddr.php
index f8a045727..42ecf2c8f 100644
--- a/Zotlabs/Module/Changeaddr.php
+++ b/Zotlabs/Module/Changeaddr.php
@@ -1,6 +1,7 @@
NULL_DATE) {
+ if($account['account_password_changed'] > DBA::$dba->get_null_date()) {
$d1 = datetime_convert('UTC','UTC','now - 48 hours');
if($account['account_password_changed'] > $d1) {
notice( t('Channel name changes are not allowed within 48 hours of changing the account password.') . EOL);
diff --git a/Zotlabs/Module/Channel_calendar.php b/Zotlabs/Module/Channel_calendar.php
index 30683404b..7e97675a5 100644
--- a/Zotlabs/Module/Channel_calendar.php
+++ b/Zotlabs/Module/Channel_calendar.php
@@ -3,6 +3,7 @@
namespace Zotlabs\Module;
use App;
+use DBA;
use Zotlabs\Web\Controller;
use Zotlabs\Lib\Libsync;
use Zotlabs\Access\AccessList;
@@ -300,7 +301,7 @@ class Channel_calendar extends Controller {
from event left join item on item.resource_id = event.event_hash
where event.uid = %d and event.dtstart > '%s' and event.dtend > event.dtstart",
intval(local_channel()),
- dbesc(NULL_DATE)
+ dbesc(DBA::$dba->get_null_date())
);
}
else {
diff --git a/Zotlabs/Module/Dirsearch.php b/Zotlabs/Module/Dirsearch.php
index d27b195e4..7767bb379 100644
--- a/Zotlabs/Module/Dirsearch.php
+++ b/Zotlabs/Module/Dirsearch.php
@@ -2,6 +2,7 @@
namespace Zotlabs\Module;
use App;
+use DBA;
use Zotlabs\Lib\Config;
use Zotlabs\Web\Controller;
@@ -232,7 +233,7 @@ class Dirsearch extends Controller {
$spkt = array('transactions' => array());
$r = q("SELECT * FROM updates WHERE ud_update = 0 AND ud_last = '%s' AND ud_date >= '%s' ORDER BY ud_date DESC",
- dbesc(NULL_DATE),
+ dbesc(DBA::$dba->get_null_date()),
dbesc($sync)
);
diff --git a/Zotlabs/Module/Feed.php b/Zotlabs/Module/Feed.php
index 65ab313df..2391e0c5f 100644
--- a/Zotlabs/Module/Feed.php
+++ b/Zotlabs/Module/Feed.php
@@ -2,6 +2,7 @@
namespace Zotlabs\Module;
+use DBA;
use Zotlabs\Lib\PConfig;
use Zotlabs\Web\Controller;
@@ -21,7 +22,7 @@ class Feed extends Controller {
killme();
}
- $params['begin'] = $_REQUEST['date_begin'] ?? NULL_DATE;
+ $params['begin'] = $_REQUEST['date_begin'] ?? DBA::$dba->get_null_date();
$params['end'] = $_REQUEST['date_end'] ?? '';
$params['type'] = 'xml';
$params['pages'] = ((!empty($_REQUEST['pages'])) ? intval($_REQUEST['pages']) : 0);
diff --git a/Zotlabs/Module/Import.php b/Zotlabs/Module/Import.php
index 7aed6469e..64d4113ab 100644
--- a/Zotlabs/Module/Import.php
+++ b/Zotlabs/Module/Import.php
@@ -7,6 +7,7 @@ require_once('include/import.php');
require_once('include/perm_upgrade.php');
use App;
+use DBA;
use URLify;
use Zotlabs\Daemon\Master;
use Zotlabs\Lib\Config;
@@ -331,7 +332,7 @@ class Import extends Controller {
else {
$photos = import_xchan_photo($xchan['xchan_photo_l'], $xchan['xchan_hash']);
if ($photos[4])
- $photodate = NULL_DATE;
+ $photodate = DBA::$dba->get_null_date();
else
$photodate = $xchan['xchan_photo_date'];
diff --git a/Zotlabs/Module/Item.php b/Zotlabs/Module/Item.php
index c3ba2d893..7842b62ef 100644
--- a/Zotlabs/Module/Item.php
+++ b/Zotlabs/Module/Item.php
@@ -3,6 +3,7 @@
namespace Zotlabs\Module;
use App;
+use DBA;
use URLify;
use Zotlabs\Lib\Config;
use Zotlabs\Lib\IConfig;
@@ -209,7 +210,7 @@ class Item extends Controller {
}
- $expires = NULL_DATE;
+ $expires = DBA::$dba->get_null_date();
$route = '';
$parent_item = null;
@@ -559,7 +560,7 @@ class Item extends Controller {
if (!empty($_POST['expire'])) {
$expires = datetime_convert(date_default_timezone_get(), 'UTC', $_POST['expire']);
if ($expires <= datetime_convert())
- $expires = NULL_DATE;
+ $expires = DBA::$dba->get_null_date();
}
}
@@ -801,7 +802,7 @@ class Item extends Controller {
$item_origin = (($origin) ? 1 : 0);
$item_consensus = (($consensus) ? 1 : 0);
$item_nocomment = (($nocomment) ? 1 : 0);
- $comments_closed = (($nocomment) ? $comments_closed : NULL_DATE);
+ $comments_closed = (($nocomment) ? $comments_closed : DBA::$dba->get_null_date());
// determine if this is a wall post
@@ -875,7 +876,7 @@ class Item extends Controller {
if ($obj['endTime']) {
$d = datetime_convert('UTC','UTC', $obj['endTime']);
- if ($d > NULL_DATE) {
+ if ($d > DBA::$dba->get_null_date()) {
$comments_closed = $d;
}
}
diff --git a/Zotlabs/Module/Outbox.php b/Zotlabs/Module/Outbox.php
index 24a3399a5..52bb780ca 100644
--- a/Zotlabs/Module/Outbox.php
+++ b/Zotlabs/Module/Outbox.php
@@ -3,6 +3,7 @@
namespace Zotlabs\Module;
use App;
+use DBA;
use Zotlabs\Lib\Activity;
use Zotlabs\Lib\ActivityStreams;
use Zotlabs\Lib\Config;
@@ -47,7 +48,7 @@ class Outbox extends Controller {
$params = [];
- $params['begin'] = ((x($_REQUEST, 'date_begin')) ? $_REQUEST['date_begin'] : NULL_DATE);
+ $params['begin'] = ((x($_REQUEST, 'date_begin')) ? $_REQUEST['date_begin'] : DBA::$dba->get_null_date());
$params['end'] = ((x($_REQUEST, 'date_end')) ? $_REQUEST['date_end'] : '');
$params['type'] = 'json';
$params['pages'] = ((x($_REQUEST, 'pages')) ? intval($_REQUEST['pages']) : 0);
diff --git a/Zotlabs/Module/Profiles.php b/Zotlabs/Module/Profiles.php
index 4ccec5b46..fc0875b27 100644
--- a/Zotlabs/Module/Profiles.php
+++ b/Zotlabs/Module/Profiles.php
@@ -1,6 +1,7 @@
get_null_date();
else
$howlong = datetime_convert(date_default_timezone_get(),'UTC',$howlong);
@@ -774,7 +775,7 @@ class Profiles extends \Zotlabs\Web\Controller {
'$marital' => marital_selector($r[0]['marital']),
'$marital_min' => marital_selector_min($r[0]['marital']),
'$with' => array('with', t("Who (if applicable)"), $r[0]['partner'], t('Examples: cathy123, Cathy Williams, cathy@example.com')),
- '$howlong' => array('howlong', t('Since (date)'), ($r[0]['howlong'] <= NULL_DATE ? '' : datetime_convert('UTC',date_default_timezone_get(),$r[0]['howlong']))),
+ '$howlong' => array('howlong', t('Since (date)'), ($r[0]['howlong'] <= DBA::$dba->get_null_date() ? '' : datetime_convert('UTC',date_default_timezone_get(),$r[0]['howlong']))),
'$sexual' => sexpref_selector($r[0]['sexual']),
'$sexual_min' => sexpref_selector_min($r[0]['sexual']),
'$about' => array('about', t('Tell us about yourself'), $r[0]['about']),
diff --git a/Zotlabs/Module/Removeaccount.php b/Zotlabs/Module/Removeaccount.php
index 98dd6e2c7..788f3e050 100644
--- a/Zotlabs/Module/Removeaccount.php
+++ b/Zotlabs/Module/Removeaccount.php
@@ -1,6 +1,7 @@
NULL_DATE) {
+ if($account['account_password_changed'] > DBA::$dba->get_null_date()) {
$d1 = datetime_convert('UTC','UTC','now - 48 hours');
if($account['account_password_changed'] > $d1) {
notice( t('Account removals are not allowed within 48 hours of changing the account password.') . EOL);
diff --git a/Zotlabs/Module/Removeme.php b/Zotlabs/Module/Removeme.php
index d71f8d4ab..cb4e0ebde 100644
--- a/Zotlabs/Module/Removeme.php
+++ b/Zotlabs/Module/Removeme.php
@@ -1,6 +1,7 @@
NULL_DATE) {
+ if($account['account_password_changed'] > DBA::$dba->get_null_date()) {
$d1 = datetime_convert('UTC','UTC','now - 48 hours');
if($account['account_password_changed'] > $d1) {
notice( t('Channel removals are not allowed within 48 hours of changing the account password.') . EOL);
diff --git a/Zotlabs/Module/Sse.php b/Zotlabs/Module/Sse.php
index 673457db1..0df9c53d7 100644
--- a/Zotlabs/Module/Sse.php
+++ b/Zotlabs/Module/Sse.php
@@ -3,6 +3,7 @@
namespace Zotlabs\Module;
use App;
+use DBA;
use Zotlabs\Lib\Apps;
use Zotlabs\Lib\Config;
use Zotlabs\Web\Controller;
@@ -136,7 +137,7 @@ class Sse extends Controller {
session_reset();
- XConfig::Set(self::$ob_hash, 'sse', 'timestamp', NULL_DATE);
+ XConfig::Set(self::$ob_hash, 'sse', 'timestamp', DBA::$dba->get_null_date());
XConfig::Set(self::$ob_hash, 'sse', 'notifications', []);
if (ob_get_length() > 0) {
diff --git a/Zotlabs/Module/Tasks.php b/Zotlabs/Module/Tasks.php
index 0709f31f6..9570d4a25 100644
--- a/Zotlabs/Module/Tasks.php
+++ b/Zotlabs/Module/Tasks.php
@@ -3,21 +3,21 @@ namespace Zotlabs\Module;
require_once('include/event.php');
-
+use DBA;
class Tasks extends \Zotlabs\Web\Controller {
function init() {
-
-
+
+
// logger('request: ' . print_r($_REQUEST,true));
-
+
$arr = array();
-
- if(argc() > 1 && argv(1) === 'fetch') {
+
+ if(argc() > 1 && argv(1) === 'fetch') {
if(argc() > 2 && argv(2) === 'all')
$arr['all'] = 1;
-
+
$x = tasks_fetch($arr);
$x['html'] = '';
if($x['tasks']) {
@@ -53,7 +53,7 @@ class Tasks extends \Zotlabs\Web\Controller {
$event = $r[0];
if($event['event_status'] === 'COMPLETED') {
$event['event_status'] = 'IN-PROCESS';
- $event['event_status_date'] = NULL_DATE;
+ $event['event_status_date'] = DBA::$dba->get_null_date();
$event['event_percent'] = 0;
$event['event_sequence'] = $event['event_sequence'] + 1;
$event['edited'] = datetime_convert();
diff --git a/Zotlabs/Module/Tokens.php b/Zotlabs/Module/Tokens.php
index 90681180e..07bdf35ad 100644
--- a/Zotlabs/Module/Tokens.php
+++ b/Zotlabs/Module/Tokens.php
@@ -3,6 +3,7 @@
namespace Zotlabs\Module;
use App;
+use DBA;
use Zotlabs\Web\Controller;
use Zotlabs\Lib\Apps;
use Zotlabs\Lib\AccessList;
@@ -84,7 +85,7 @@ class Tokens extends Controller {
if(trim($_POST['expires']))
$expires = datetime_convert(date_default_timezone_get(),'UTC',$_POST['expires']);
else
- $expires = NULL_DATE;
+ $expires = DBA::$dba->get_null_date();
$max_atokens = service_class_fetch($channel['channel_id'],'access_tokens');
if($max_atokens) {
$r = q("select count(atoken_id) as total where atoken_uid = %d",
@@ -290,7 +291,7 @@ class Tokens extends Controller {
'$atoken' => $atoken,
'$name' => array('name', t('Login Name') . ' *', $atoken['atoken_name'] ?? '',''),
'$token'=> array('token', t('Login Password') . ' *', $atoken['atoken_token'] ?? new_token(), ''),
- '$expires'=> array('expires', t('Expires (yyyy-mm-dd)'), ((isset($atoken['atoken_expires']) && $atoken['atoken_expires'] > NULL_DATE) ? datetime_convert('UTC',date_default_timezone_get(),$atoken['atoken_expires']) : ''), ''),
+ '$expires'=> array('expires', t('Expires (yyyy-mm-dd)'), ((isset($atoken['atoken_expires']) && $atoken['atoken_expires'] > DBA::$dba->get_null_date()) ? datetime_convert('UTC',date_default_timezone_get(),$atoken['atoken_expires']) : ''), ''),
'$submit' => t('Submit'),
'$delete' => t('Delete')
));
diff --git a/Zotlabs/Widget/Pinned.php b/Zotlabs/Widget/Pinned.php
index 7b95d3bc6..1e1672ea7 100644
--- a/Zotlabs/Widget/Pinned.php
+++ b/Zotlabs/Widget/Pinned.php
@@ -1,6 +1,7 @@
get_null_date() ? true : false);
$location = format_location($item);
$isevent = false;
@@ -131,7 +132,7 @@ class Pinned {
'isotime' => datetime_convert('UTC', date_default_timezone_get(), $item['created'], 'c'),
'localtime' => datetime_convert('UTC', date_default_timezone_get(), $item['created'], 'r'),
'editedtime' => (($item['edited'] != $item['created']) ? sprintf( t('last edited: %s'), datetime_convert('UTC', date_default_timezone_get(), $item['edited'], 'r') ) : ''),
- 'expiretime' => ($item['expires'] > NULL_DATE ? sprintf( t('Expires: %s'), datetime_convert('UTC', date_default_timezone_get(), $item['expires'], 'r') ) : ''),
+ 'expiretime' => ($item['expires'] > DBA::$dba->get_null_date() ? sprintf( t('Expires: %s'), datetime_convert('UTC', date_default_timezone_get(), $item['expires'], 'r') ) : ''),
'verified' => $verified,
'forged' => $forged,
'location' => $location,
diff --git a/boot.php b/boot.php
index 415f10e9d..e90d6ee2a 100644
--- a/boot.php
+++ b/boot.php
@@ -29,6 +29,7 @@
// composer autoloader for all namespaced Classes
+use DBA;
use Zotlabs\Access\PermissionLimits;
use Zotlabs\Access\PermissionRoles;
use Zotlabs\Access\Permissions;
@@ -1896,7 +1897,7 @@ function notice($s) {
$x = null;
- $t = get_xconfig($hash, 'sse', 'timestamp', NULL_DATE);
+ $t = get_xconfig($hash, 'sse', 'timestamp', DBA::$dba->get_null_date());
if (datetime_convert('UTC', 'UTC', $t) < datetime_convert('UTC', 'UTC', '- 30 seconds')) {
set_xconfig($hash, 'sse', 'notifications', []);
@@ -1945,7 +1946,7 @@ function info($s) {
$x = null;
- $t = get_xconfig($hash, 'sse', 'timestamp', NULL_DATE);
+ $t = get_xconfig($hash, 'sse', 'timestamp', DBA::$dba->get_null_date());
if (datetime_convert('UTC', 'UTC', $t) < datetime_convert('UTC', 'UTC', '- 30 seconds')) {
set_xconfig($hash, 'sse', 'notifications', []);
diff --git a/include/account.php b/include/account.php
index 577b86521..4a0367bc9 100644
--- a/include/account.php
+++ b/include/account.php
@@ -4,6 +4,7 @@
* @brief Somme account related functions.
*/
+use DBA;
use Zotlabs\Lib\Config;
use Zotlabs\Lib\Crypto;
@@ -186,7 +187,7 @@ function create_account_from_register($arr) {
if ( ! $register ) return $result;
// account
- $expires = NULL_DATE;
+ $expires = DBA::$dba->get_null_date();
$default_service_class = Config::Get('system','default_service_class');
if($default_service_class === false)
@@ -901,7 +902,7 @@ function downgrade_accounts() {
and account_expires > '%s'
and account_expires < %s ",
intval(ACCOUNT_EXPIRED),
- dbesc(NULL_DATE),
+ dbesc(DBA::$dba->get_null_date()),
db_getfunc('UTC_TIMESTAMP')
);
@@ -915,7 +916,7 @@ function downgrade_accounts() {
q("UPDATE account set account_service_class = '%s', account_expires = '%s'
where account_id = %d",
dbesc($basic),
- dbesc(NULL_DATE),
+ dbesc(DBA::$dba->get_null_date()),
intval($rr['account_id'])
);
$ret = array('account' => $rr);
@@ -1214,7 +1215,7 @@ function get_pending_accounts($get_all = false) {
function remove_expired_registrations() {
q("DELETE FROM register WHERE (reg_expires < '%s' OR reg_expires = '%s') AND (reg_flags & %d) > 0",
dbesc(datetime_convert()),
- dbesc(NULL_DATE),
+ dbesc(DBA::$dba->get_null_date()),
dbesc(ACCOUNT_UNVERIFIED)
);
}
diff --git a/include/api_zot.php b/include/api_zot.php
index 44a5a3ea4..322ea2aa1 100644
--- a/include/api_zot.php
+++ b/include/api_zot.php
@@ -105,7 +105,7 @@
$records = 10;
}
if(! $_REQUEST['since'])
- $start = NULL_DATE;
+ $start = DBA::$dba->get_null_date();
else {
$start = datetime_convert(date_default_timezone_get(),'UTC', $_REQUEST['since']);
}
@@ -210,7 +210,7 @@
$start = ((array_key_exists('start',$_REQUEST)) ? intval($_REQUEST['start']) : 0);
$records = ((array_key_exists('records',$_REQUEST)) ? intval($_REQUEST['records']) : 0);
- $since = ((array_key_exists('since',$_REQUEST)) ? datetime_convert(date_default_timezone_get(),'UTC',$_REQUEST['since']) : NULL_DATE);
+ $since = ((array_key_exists('since',$_REQUEST)) ? datetime_convert(date_default_timezone_get(),'UTC',$_REQUEST['since']) : DBA::$dba->get_null_date());
$until = ((array_key_exists('until',$_REQUEST)) ? datetime_convert(date_default_timezone_get(),'UTC',$_REQUEST['until']) : datetime_convert());
$x = attach_list_files(api_user(),get_observer_hash(),$hash,$filename,$filetype,'created asc',$start,$records, $since, $until);
diff --git a/include/attach.php b/include/attach.php
index 99dbd7388..f2fdbe34b 100644
--- a/include/attach.php
+++ b/include/attach.php
@@ -11,6 +11,7 @@
* @todo Also an 'append' option to the storage function might be a useful addition.
*/
+use DBA;
use Zotlabs\Access\PermissionLimits;
use Zotlabs\Daemon\Master;
use Zotlabs\Lib\AccessList;
@@ -226,7 +227,7 @@ function attach_list_files($channel_id, $observer, $hash = '', $filename = '', $
$limit = " LIMIT " . intval($entries) . " OFFSET " . intval($start) . " ";
if(! $since)
- $since = NULL_DATE;
+ $since = DBA::$dba->get_null_date();
if(! $until)
$until = datetime_convert();
diff --git a/include/channel.php b/include/channel.php
index e433c8e8f..72ec134b6 100644
--- a/include/channel.php
+++ b/include/channel.php
@@ -5,6 +5,7 @@
*/
+use DBA;
use Zotlabs\Access\PermissionRoles;
use Zotlabs\Access\PermissionLimits;
use Zotlabs\Access\Permissions;
@@ -1302,7 +1303,7 @@ function channel_export_items_page($channel_id, $start, $finish, $page = 0, $lim
}
if(! $start)
- $start = NULL_DATE;
+ $start = DBA::$dba->get_null_date();
else
$start = datetime_convert('UTC', 'UTC', $start);
@@ -1823,7 +1824,7 @@ function advanced_profile() {
if(App::$profile['partner'])
$profile['marital']['partner'] = zidify_links(bbcode(App::$profile['partner']));
- if(strlen(App::$profile['howlong']) && App::$profile['howlong'] > NULL_DATE) {
+ if(strlen(App::$profile['howlong']) && App::$profile['howlong'] > DBA::$dba->get_null_date()) {
$profile['howlong'] = relative_date(App::$profile['howlong'], t('for %1$d %2$s'));
}
@@ -2649,10 +2650,10 @@ function channel_store_lowlevel($arr) {
'channel_eprvkey' => ((array_key_exists('channel_eprvkey',$arr)) ? $arr['channel_eprvkey'] : ''),
'channel_notifyflags' => ((array_key_exists('channel_notifyflags',$arr)) ? $arr['channel_notifyflags'] : '65535'),
'channel_pageflags' => ((array_key_exists('channel_pageflags',$arr)) ? $arr['channel_pageflags'] : '0'),
- 'channel_dirdate' => ((array_key_exists('channel_dirdate',$arr)) ? $arr['channel_dirdate'] : NULL_DATE),
- 'channel_lastpost' => ((array_key_exists('channel_lastpost',$arr)) ? $arr['channel_lastpost'] : NULL_DATE),
- 'channel_deleted' => ((array_key_exists('channel_deleted',$arr)) ? $arr['channel_deleted'] : NULL_DATE),
- 'channel_active' => ((array_key_exists('channel_active',$arr)) ? $arr['channel_active'] : NULL_DATE),
+ 'channel_dirdate' => ((array_key_exists('channel_dirdate',$arr)) ? $arr['channel_dirdate'] : DBA::$dba->get_null_date()),
+ 'channel_lastpost' => ((array_key_exists('channel_lastpost',$arr)) ? $arr['channel_lastpost'] : DBA::$dba->get_null_date()),
+ 'channel_deleted' => ((array_key_exists('channel_deleted',$arr)) ? $arr['channel_deleted'] : DBA::$dba->get_null_date()),
+ 'channel_active' => ((array_key_exists('channel_active',$arr)) ? $arr['channel_active'] : DBA::$dba->get_null_date()),
'channel_max_anon_mail' => ((array_key_exists('channel_max_anon_mail',$arr)) ? $arr['channel_max_anon_mail'] : '10'),
'channel_max_friend_req' => ((array_key_exists('channel_max_friend_req',$arr)) ? $arr['channel_max_friend_req'] : '10'),
'channel_expire_days' => ((array_key_exists('channel_expire_days',$arr)) ? $arr['channel_expire_days'] : '0'),
@@ -2695,7 +2696,7 @@ function profile_store_lowlevel($arr) {
'gender' => ((array_key_exists('gender',$arr)) ? $arr['gender'] : ''),
'marital' => ((array_key_exists('marital',$arr)) ? $arr['marital'] : ''),
'partner' => ((array_key_exists('partner',$arr)) ? $arr['partner'] : ''),
- 'howlong' => ((array_key_exists('howlong',$arr)) ? $arr['howlong'] : NULL_DATE),
+ 'howlong' => ((array_key_exists('howlong',$arr)) ? $arr['howlong'] : DBA::$dba->get_null_date()),
'sexual' => ((array_key_exists('sexual',$arr)) ? $arr['sexual'] : ''),
'politic' => ((array_key_exists('politic',$arr)) ? $arr['politic'] : ''),
'religion' => ((array_key_exists('religion',$arr)) ? $arr['religion'] : ''),
diff --git a/include/connections.php b/include/connections.php
index f0ea8583b..6f523b375 100644
--- a/include/connections.php
+++ b/include/connections.php
@@ -1,5 +1,6 @@
((array_key_exists('abook_my_perms',$arr)) ? $arr['abook_my_perms'] : 0),
'abook_their_perms' => ((array_key_exists('abook_their_perms',$arr)) ? $arr['abook_their_perms'] : 0),
'abook_closeness' => ((array_key_exists('abook_closeness',$arr)) ? $arr['abook_closeness'] : 99),
- 'abook_created' => ((array_key_exists('abook_created',$arr)) ? $arr['abook_created'] : NULL_DATE),
- 'abook_updated' => ((array_key_exists('abook_updated',$arr)) ? $arr['abook_updated'] : NULL_DATE),
- 'abook_connected' => ((array_key_exists('abook_connected',$arr)) ? $arr['abook_connected'] : NULL_DATE),
- 'abook_dob' => ((array_key_exists('abook_dob',$arr)) ? $arr['abook_dob'] : NULL_DATE),
+ 'abook_created' => ((array_key_exists('abook_created',$arr)) ? $arr['abook_created'] : DBA::$dba->get_null_date()),
+ 'abook_updated' => ((array_key_exists('abook_updated',$arr)) ? $arr['abook_updated'] : DBA::$dba->get_null_date()),
+ 'abook_connected' => ((array_key_exists('abook_connected',$arr)) ? $arr['abook_connected'] : DBA::$dba->get_null_date()),
+ 'abook_dob' => ((array_key_exists('abook_dob',$arr)) ? $arr['abook_dob'] : DBA::$dba->get_null_date()),
'abook_flags' => ((array_key_exists('abook_flags',$arr)) ? $arr['abook_flags'] : 0),
'abook_blocked' => ((array_key_exists('abook_blocked',$arr)) ? $arr['abook_blocked'] : 0),
'abook_ignored' => ((array_key_exists('abook_ignored',$arr)) ? $arr['abook_ignored'] : 0),
diff --git a/include/conversation.php b/include/conversation.php
index d1b2f82f7..3f043c389 100644
--- a/include/conversation.php
+++ b/include/conversation.php
@@ -1,5 +1,6 @@
datetime_convert('UTC', date_default_timezone_get(), $item['created'], 'c'),
'localtime' => datetime_convert('UTC', date_default_timezone_get(), $item['created'], 'r'),
'editedtime' => (($item['edited'] != $item['created']) ? sprintf( t('last edited: %s'), datetime_convert('UTC', date_default_timezone_get(), $item['edited'], 'r')) : ''),
- 'expiretime' => (($item['expires'] > NULL_DATE) ? sprintf( t('Expires: %s'), datetime_convert('UTC', date_default_timezone_get(), $item['expires'], 'r')):''),
+ 'expiretime' => (($item['expires'] > DBA::$dba->get_null_date()) ? sprintf( t('Expires: %s'), datetime_convert('UTC', date_default_timezone_get(), $item['expires'], 'r')):''),
'location' => $location,
'divider' => false,
'indent' => '',
diff --git a/include/dba/dba_driver.php b/include/dba/dba_driver.php
index c121b6bb5..e41daba60 100644
--- a/include/dba/dba_driver.php
+++ b/include/dba/dba_driver.php
@@ -272,7 +272,7 @@ function dbg($state) {
function dbesc($str) {
if(is_null_date($str))
- $str = NULL_DATE;
+ $str = DBA::$dba->get_null_date();
if(\DBA::$dba && \DBA::$dba->connected)
return(\DBA::$dba->escape($str));
@@ -289,7 +289,7 @@ function dbunescbin($str) {
function dbescdate($date) {
if(is_null_date($date))
- return \DBA::$dba->escape(NULL_DATE);
+ return \DBA::$dba->escape(DBA::$dba->get_null_date());
return \DBA::$dba->escape($date);
}
@@ -392,7 +392,7 @@ function dbq($sql) {
function dbesc_array_cb(&$item, $key) {
if(is_string($item)) {
if(is_null_date($item))
- $item = NULL_DATE;
+ $item = DBA::$dba->get_null_date();
$item = dbesc($item);
}
}
diff --git a/include/event.php b/include/event.php
index c9d4a79d5..403458322 100644
--- a/include/event.php
+++ b/include/event.php
@@ -5,6 +5,7 @@
*/
+use DBA;
use Sabre\VObject;
use Zotlabs\Lib\Activity;
@@ -537,14 +538,14 @@ function event_store_event($arr) {
$arr['deny_gid'] = $arr['deny_gid'] ?? '';
if (! $arr['dtend']) {
- $arr['dtend'] = NULL_DATE;
+ $arr['dtend'] = DBA::$dba->get_null_date();
$arr['nofinish'] = 1;
}
if(array_key_exists('event_status_date',$arr))
$arr['event_status_date'] = datetime_convert('UTC','UTC', $arr['event_status_date']);
else
- $arr['event_status_date'] = NULL_DATE;
+ $arr['event_status_date'] = DBA::$dba->get_null_date();
$existing_event = null;
diff --git a/include/feedutils.php b/include/feedutils.php
index 0a9c37b11..f914b162a 100644
--- a/include/feedutils.php
+++ b/include/feedutils.php
@@ -4,6 +4,7 @@
* @brief Some functions to work with XML feeds.
*/
+use DBA;
use Zotlabs\Lib\Config;
use Zotlabs\Lib\MessageFilter;
@@ -25,7 +26,7 @@ function get_public_feed($channel, $params) {
$params = [];
$params['type'] = ((x($params,'type')) ? $params['type'] : 'xml');
- $params['begin'] = ((x($params,'begin')) ? $params['begin'] : NULL_DATE);
+ $params['begin'] = ((x($params,'begin')) ? $params['begin'] : DBA::$dba->get_null_date());
$params['end'] = ((x($params,'end')) ? $params['end'] : datetime_convert('UTC','UTC','now'));
$params['start'] = ((x($params,'start')) ? $params['start'] : 0);
$params['records'] = ((x($params,'records')) ? $params['records'] : 40);
@@ -1302,7 +1303,7 @@ function consume_feed($xml, $importer, &$contact, $pass = 0) {
if($r) {
$parent_item = $r[0];
if(intval($parent_item['item_nocomment']) || $parent_item['comment_policy'] === 'none'
- || ($parent_item['comments_closed'] > NULL_DATE && $parent_item['comments_closed'] < datetime_convert())) {
+ || ($parent_item['comments_closed'] > DBA::$dba->get_null_date() && $parent_item['comments_closed'] < datetime_convert())) {
logger('comments disabled for post ' . $parent_item['mid']);
continue;
}
@@ -1459,7 +1460,7 @@ function consume_feed($xml, $importer, &$contact, $pass = 0) {
$datarray['owner_xchan'] = $contact['xchan_hash'];
- if(array_key_exists('created',$datarray) && $datarray['created'] > NULL_DATE && $expire_days) {
+ if(array_key_exists('created',$datarray) && $datarray['created'] > DBA::$dba->get_null_date() && $expire_days) {
$t1 = $datarray['created'];
$t2 = datetime_convert('UTC','UTC','now - ' . $expire_days . 'days');
if($t1 < $t2) {
diff --git a/include/hubloc.php b/include/hubloc.php
index 982455f9c..c49497020 100644
--- a/include/hubloc.php
+++ b/include/hubloc.php
@@ -4,6 +4,7 @@
* @brief Hubloc related functions.
*/
+use DBA;
use Zotlabs\Daemon\Master;
use Zotlabs\Lib\Config;
@@ -35,8 +36,8 @@ function hubloc_store_lowlevel($arr) {
'hubloc_callback' => ((array_key_exists('hubloc_callback',$arr)) ? $arr['hubloc_callback'] : ''),
'hubloc_connect' => ((array_key_exists('hubloc_connect',$arr)) ? $arr['hubloc_connect'] : ''),
'hubloc_sitekey' => ((array_key_exists('hubloc_sitekey',$arr)) ? $arr['hubloc_sitekey'] : ''),
- 'hubloc_updated' => ((array_key_exists('hubloc_updated',$arr)) ? $arr['hubloc_updated'] : NULL_DATE),
- 'hubloc_connected' => ((array_key_exists('hubloc_connected',$arr)) ? $arr['hubloc_connected'] : NULL_DATE),
+ 'hubloc_updated' => ((array_key_exists('hubloc_updated',$arr)) ? $arr['hubloc_updated'] : DBA::$dba->get_null_date()),
+ 'hubloc_connected' => ((array_key_exists('hubloc_connected',$arr)) ? $arr['hubloc_connected'] : DBA::$dba->get_null_date()),
'hubloc_primary' => ((array_key_exists('hubloc_primary',$arr)) ? $arr['hubloc_primary'] : 0),
'hubloc_orphancheck' => ((array_key_exists('hubloc_orphancheck',$arr)) ? $arr['hubloc_orphancheck'] : 0),
'hubloc_error' => ((array_key_exists('hubloc_error',$arr)) ? $arr['hubloc_error'] : 0),
@@ -52,9 +53,9 @@ function site_store_lowlevel($arr) {
'site_url' => ((array_key_exists('site_url',$arr)) ? $arr['site_url'] : ''),
'site_access' => ((array_key_exists('site_access',$arr)) ? $arr['site_access'] : 0),
'site_flags' => ((array_key_exists('site_flags',$arr)) ? $arr['site_flags'] : 0),
- 'site_update' => ((array_key_exists('site_update',$arr)) ? $arr['site_update'] : NULL_DATE),
- 'site_pull' => ((array_key_exists('site_pull',$arr)) ? $arr['site_pull'] : NULL_DATE),
- 'site_sync' => ((array_key_exists('site_sync',$arr)) ? $arr['site_sync'] : NULL_DATE),
+ 'site_update' => ((array_key_exists('site_update',$arr)) ? $arr['site_update'] : DBA::$dba->get_null_date()),
+ 'site_pull' => ((array_key_exists('site_pull',$arr)) ? $arr['site_pull'] : DBA::$dba->get_null_date()),
+ 'site_sync' => ((array_key_exists('site_sync',$arr)) ? $arr['site_sync'] : DBA::$dba->get_null_date()),
'site_directory' => ((array_key_exists('site_directory',$arr)) ? $arr['site_directory'] : ''),
'site_register' => ((array_key_exists('site_register',$arr)) ? $arr['site_register'] : 0),
'site_sellpage' => ((array_key_exists('site_sellpage',$arr)) ? $arr['site_sellpage'] : ''),
@@ -362,7 +363,7 @@ function z6_discover() {
// find unregistered zot6 clone hublocs
$c = q("select channel_hash, channel_portable_id from channel where channel_deleted = '%s'",
- dbesc(NULL_DATE)
+ dbesc(DBA::$dba->get_null_date())
);
if ($c) {
foreach ($c as $entry) {
diff --git a/include/import.php b/include/import.php
index 77d35a3e7..aa1bfeb77 100644
--- a/include/import.php
+++ b/include/import.php
@@ -1,5 +1,6 @@
get_null_date()))
$app['app_created'] = datetime_convert();
- if((! $app['app_edited']) || ($app['app_edited'] <= NULL_DATE))
+ if((! $app['app_edited']) || ($app['app_edited'] <= DBA::$dba->get_null_date()))
$app['app_edited'] = datetime_convert();
$app['app_channel'] = $channel['channel_id'];
@@ -746,9 +747,9 @@ function sync_chatrooms($channel, $chatrooms) {
unset($chatroom['cr_aid']);
unset($chatroom['cr_uid']);
- if((! $chatroom['cr_created']) || ($chatroom['cr_created'] <= NULL_DATE))
+ if((! $chatroom['cr_created']) || ($chatroom['cr_created'] <= DBA::$dba->get_null_date()))
$chatroom['cr_created'] = datetime_convert();
- if((! $chatroom['cr_edited']) || ($chatroom['cr_edited'] <= NULL_DATE))
+ if((! $chatroom['cr_edited']) || ($chatroom['cr_edited'] <= DBA::$dba->get_null_date()))
$chatroom['cr_edited'] = datetime_convert();
$chatroom['cr_aid'] = $channel['channel_account_id'];
diff --git a/include/items.php b/include/items.php
index 420d731f5..29a494314 100644
--- a/include/items.php
+++ b/include/items.php
@@ -4,6 +4,7 @@
* @brief Items related functions.
*/
+use DBA;
use Zotlabs\Lib\Config;
use Zotlabs\Lib\Crypto;
use Zotlabs\Lib\Enotify;
@@ -232,7 +233,7 @@ function comments_are_now_closed($item) {
return $x['closed'];
}
- if($item['comments_closed'] > NULL_DATE) {
+ if($item['comments_closed'] > DBA::$dba->get_null_date()) {
$d = datetime_convert();
if($d > $item['comments_closed'])
return true;
@@ -732,14 +733,14 @@ function get_item_elements($x,$allow_code = false) {
$arr['expires'] = ((!empty($x['expires']) && $x['expires'])
? datetime_convert('UTC','UTC',$x['expires'])
- : NULL_DATE);
+ : DBA::$dba->get_null_date());
$arr['commented'] = ((!empty($x['commented']) && $x['commented'])
? datetime_convert('UTC','UTC',$x['commented'])
: $arr['created']);
$arr['comments_closed'] = ((!empty($x['comments_closed']) && $x['comments_closed'])
? datetime_convert('UTC','UTC',$x['comments_closed'])
- : NULL_DATE);
+ : DBA::$dba->get_null_date());
$arr['title'] = (($x['title']) ? htmlspecialchars($x['title'], ENT_COMPAT,'UTF-8',false) : '');
@@ -1210,7 +1211,7 @@ function encode_item($item,$mirror = false,$zap_compat = false) {
if($y = encode_item_flags($item))
$x['flags'] = $y;
- if($item['comments_closed'] > NULL_DATE)
+ if($item['comments_closed'] > DBA::$dba->get_null_date())
$x['comments_closed'] = $item['comments_closed'];
$x['public_scope'] = $item['public_policy'];
@@ -1773,9 +1774,9 @@ function item_store($arr, $allow_exec = false, $deliver = true, $addAndSync = tr
$arr['owner_xchan'] = ((!empty($arr['owner_xchan'])) ? notags(trim($arr['owner_xchan'])) : '');
$arr['created'] = ((!empty($arr['created']) !== false) ? datetime_convert('UTC','UTC',$arr['created']) : datetime_convert());
$arr['edited'] = ((!empty($arr['edited']) !== false) ? datetime_convert('UTC','UTC',$arr['edited']) : datetime_convert());
- $arr['expires'] = ((!empty($arr['expires']) !== false) ? datetime_convert('UTC','UTC',$arr['expires']) : NULL_DATE);
+ $arr['expires'] = ((!empty($arr['expires']) !== false) ? datetime_convert('UTC','UTC',$arr['expires']) : DBA::$dba->get_null_date());
$arr['commented'] = ((!empty($arr['commented']) !== false) ? datetime_convert('UTC','UTC',$arr['commented']) : datetime_convert());
- $arr['comments_closed'] = ((!empty($arr['comments_closed']) !== false) ? datetime_convert('UTC','UTC',$arr['comments_closed']) : NULL_DATE);
+ $arr['comments_closed'] = ((!empty($arr['comments_closed']) !== false) ? datetime_convert('UTC','UTC',$arr['comments_closed']) : DBA::$dba->get_null_date());
$arr['html'] = ((array_key_exists('html',$arr)) ? $arr['html'] : '');
if($deliver) {
@@ -4440,7 +4441,7 @@ function zot_feed($uid, $observer_hash, $arr) {
}
if (!$mindate)
- $mindate = NULL_DATE;
+ $mindate = DBA::$dba->get_null_date();
$mindate = dbesc($mindate);
@@ -4458,7 +4459,7 @@ function zot_feed($uid, $observer_hash, $arr) {
$limit = " LIMIT 5000 ";
- if ($mindate > NULL_DATE) {
+ if ($mindate > DBA::$dba->get_null_date()) {
$sql_extra .= " and ( created > '$mindate' or changed > '$mindate' ) ";
}
diff --git a/include/text.php b/include/text.php
index 7782752cc..50b46e00d 100644
--- a/include/text.php
+++ b/include/text.php
@@ -3,6 +3,7 @@
* @file include/text.php
*/
+use DBA;
use Zotlabs\Lib as Zlib;
use Michelf\MarkdownExtra;
@@ -2017,7 +2018,7 @@ function format_poll($item,$s,$opts) {
$message = (($totalResponses) ? sprintf(tt('%d Vote in total', '%d Votes in total', $totalResponses, 'noun'), $totalResponses) . EOL : '');
- if ($item['comments_closed'] > NULL_DATE) {
+ if ($item['comments_closed'] > DBA::$dba->get_null_date()) {
$t = datetime_convert('UTC',date_default_timezone_get(), $item['comments_closed'], 'Y-m-d H:i');
$closed = ((datetime_convert() > $item['comments_closed']) ? true : false);
if ($closed) {
diff --git a/include/xchan.php b/include/xchan.php
index d0c4a049d..47a21b5f9 100644
--- a/include/xchan.php
+++ b/include/xchan.php
@@ -1,5 +1,6 @@
((array_key_exists('xchan_network',$arr)) ? $arr['xchan_network'] : ''),
'xchan_instance_url' => ((array_key_exists('xchan_instance_url',$arr)) ? $arr['xchan_instance_url'] : ''),
'xchan_flags' => ((array_key_exists('xchan_flags',$arr)) ? intval($arr['xchan_flags']) : 0),
- 'xchan_photo_date' => ((array_key_exists('xchan_photo_date',$arr)) ? datetime_convert('UTC','UTC',$arr['xchan_photo_date']) : NULL_DATE),
- 'xchan_name_date' => ((array_key_exists('xchan_name_date',$arr)) ? datetime_convert('UTC','UTC',$arr['xchan_name_date']) : NULL_DATE),
- 'xchan_updated' => ((array_key_exists('xchan_updated',$arr)) ? datetime_convert('UTC','UTC',$arr['xchan_updated']) : NULL_DATE),
+ 'xchan_photo_date' => ((array_key_exists('xchan_photo_date',$arr)) ? datetime_convert('UTC','UTC',$arr['xchan_photo_date']) : DBA::$dba->get_null_date()),
+ 'xchan_name_date' => ((array_key_exists('xchan_name_date',$arr)) ? datetime_convert('UTC','UTC',$arr['xchan_name_date']) : DBA::$dba->get_null_date()),
+ 'xchan_updated' => ((array_key_exists('xchan_updated',$arr)) ? datetime_convert('UTC','UTC',$arr['xchan_updated']) : DBA::$dba->get_null_date()),
'xchan_hidden' => ((array_key_exists('xchan_hidden',$arr)) ? intval($arr['xchan_hidden']) : 0),
'xchan_orphan' => ((array_key_exists('xchan_orphan',$arr)) ? intval($arr['xchan_orphan']) : 0),
'xchan_censored' => ((array_key_exists('xchan_censored',$arr)) ? intval($arr['xchan_censored']) : 0),