This is long overdue - use a symblic constant NULL_DATE instead of the easily mis-typed sequence '0000-00-00 00:00:00'
This commit is contained in:
@@ -53,7 +53,7 @@ function events_post(&$a) {
|
||||
}
|
||||
|
||||
if($nofinish) {
|
||||
$finish = '0000-00-00 00:00:00';
|
||||
$finish = NULL_DATE;
|
||||
}
|
||||
|
||||
if($finish_text) {
|
||||
|
||||
@@ -7,7 +7,7 @@ function feed_init(&$a) {
|
||||
|
||||
$params = array();
|
||||
|
||||
$params['begin'] = ((x($_REQUEST,'date_begin')) ? $_REQUEST['date_begin'] : '0000-00-00 00:00:00');
|
||||
$params['begin'] = ((x($_REQUEST,'date_begin')) ? $_REQUEST['date_begin'] : NULL_DATE);
|
||||
$params['end'] = ((x($_REQUEST,'date_end')) ? $_REQUEST['date_end'] : '');
|
||||
$params['type'] = ((stristr(argv(0),'json')) ? 'json' : 'xml');
|
||||
$params['pages'] = ((x($_REQUEST,'pages')) ? intval($_REQUEST['pages']) : 0);
|
||||
|
||||
@@ -256,7 +256,7 @@ function import_post(&$a) {
|
||||
require_once('include/photo/photo_driver.php');
|
||||
$photos = import_profile_photo($xchan['xchan_photo_l'],$xchan['xchan_hash']);
|
||||
if($photos[4])
|
||||
$photodate = '0000-00-00 00:00:00';
|
||||
$photodate = NULL_DATE;
|
||||
else
|
||||
$photodate = $xchan['xchan_photo_date'];
|
||||
|
||||
|
||||
@@ -384,13 +384,13 @@ function item_post(&$a) {
|
||||
}
|
||||
|
||||
|
||||
$expires = '0000-00-00 00:00:00';
|
||||
$expires = NULL_DATE;
|
||||
|
||||
if(feature_enabled($profile_uid,'content_expire')) {
|
||||
if(x($_REQUEST,'expire')) {
|
||||
$expires = datetime_convert(date_default_timezone_get(),'UTC', $_REQUEST['expire']);
|
||||
if($expires <= datetime_convert())
|
||||
$expires = '0000-00-00 00:00:00';
|
||||
$expires = NULL_DATE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ function mail_post(&$a) {
|
||||
$body = ((x($_REQUEST,'body')) ? escape_tags(trim($_REQUEST['body'])) : '');
|
||||
$recipient = ((x($_REQUEST,'messageto')) ? notags(trim($_REQUEST['messageto'])) : '');
|
||||
$rstr = ((x($_REQUEST,'messagerecip')) ? notags(trim($_REQUEST['messagerecip'])) : '');
|
||||
$expires = ((x($_REQUEST,'expires')) ? datetime_convert(date_default_timezone_get(),'UTC', $_REQUEST['expires']) : '0000-00-00 00:00:00');
|
||||
$expires = ((x($_REQUEST,'expires')) ? datetime_convert(date_default_timezone_get(),'UTC', $_REQUEST['expires']) : NULL_DATE);
|
||||
|
||||
// If we have a raw string for a recipient which hasn't been auto-filled,
|
||||
// it means they probably aren't in our address book, hence we don't know
|
||||
|
||||
@@ -304,7 +304,7 @@ function profiles_post(&$a) {
|
||||
$with = ((x($_POST,'with')) ? escape_tags(trim($_POST['with'])) : '');
|
||||
|
||||
if(! strlen($howlong))
|
||||
$howlong = '0000-00-00 00:00:00';
|
||||
$howlong = NULL_DATE;
|
||||
else
|
||||
$howlong = datetime_convert(date_default_timezone_get(),'UTC',$howlong);
|
||||
|
||||
@@ -707,7 +707,7 @@ logger('extra_fields: ' . print_r($extra_fields,true));
|
||||
'$marital' => marital_selector($r[0]['marital']),
|
||||
'$marital_min' => marital_selector_min($r[0]['marital']),
|
||||
'$with' => $r[0]['with'],
|
||||
'$howlong' => ($r[0]['howlong'] === '0000-00-00 00:00:00' ? '' : datetime_convert('UTC',date_default_timezone_get(),$r[0]['howlong'])),
|
||||
'$howlong' => ($r[0]['howlong'] === 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' => $r[0]['about'],
|
||||
|
||||
@@ -24,7 +24,7 @@ function removeaccount_post(&$a) {
|
||||
if(! account_verify_password($account['account_email'],$_POST['qxz_password']))
|
||||
return;
|
||||
|
||||
if($account['account_password_changed'] != '0000-00-00 00:00:00') {
|
||||
if($account['account_password_changed'] != 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);
|
||||
|
||||
@@ -23,7 +23,7 @@ function removeme_post(&$a) {
|
||||
if(! account_verify_password($account['account_email'],$_POST['qxz_password']))
|
||||
return;
|
||||
|
||||
if($account['account_password_changed'] != '0000-00-00 00:00:00') {
|
||||
if($account['account_password_changed'] != 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);
|
||||
|
||||
Reference in New Issue
Block a user