From 3a15a5b0a2d6a6b5dc99ac83e16d662f9caae18d Mon Sep 17 00:00:00 2001 From: Mike Macgirvin Date: Sat, 9 Mar 2024 22:17:09 +1100 Subject: [PATCH] ATOM_TIME -> ISO8601 --- Code/Lib/Activity.php | 20 ++++++++++---------- Code/Lib/ActivityPub.php | 2 +- Code/Lib/JcsEddsa2022.php | 2 +- Code/Lib/MastAPI.php | 4 ++-- Code/Module/Cover_photo.php | 4 ++-- Code/Module/Display.php | 2 +- Code/Module/Item.php | 4 ++-- Code/Module/Photos.php | 2 +- include/constants.php | 2 +- include/event.php | 20 ++++++++++---------- include/feedutils.php | 8 ++++---- include/items.php | 4 ++-- include/misc.php | 6 +++--- include/photos.php | 8 ++++---- 14 files changed, 44 insertions(+), 44 deletions(-) diff --git a/Code/Lib/Activity.php b/Code/Lib/Activity.php index e372df4ee..68d3f2b52 100644 --- a/Code/Lib/Activity.php +++ b/Code/Lib/Activity.php @@ -857,9 +857,9 @@ class Activity } } - $activity['published'] = datetime_convert('UTC', 'UTC', $item['created'], ATOM_TIME); + $activity['published'] = datetime_convert('UTC', 'UTC', $item['created'], ISO8601); if ($item['created'] !== $item['edited']) { - $activity['updated'] = datetime_convert('UTC', 'UTC', $item['edited'], ATOM_TIME); + $activity['updated'] = datetime_convert('UTC', 'UTC', $item['edited'], ISO8601); if ($activity['type'] === 'Create') { $activity['type'] = 'Update'; } @@ -1193,12 +1193,12 @@ class Activity $activity['id'] = $item['mid']; - $activity['published'] = datetime_convert('UTC', 'UTC', $item['created'], ATOM_TIME); + $activity['published'] = datetime_convert('UTC', 'UTC', $item['created'], ISO8601); if ($item['created'] !== $item['edited']) { - $activity['updated'] = datetime_convert('UTC', 'UTC', $item['edited'], ATOM_TIME); + $activity['updated'] = datetime_convert('UTC', 'UTC', $item['edited'], ISO8601); } if ($item['expires'] > NULL_DATE) { - $activity['expires'] = datetime_convert('UTC', 'UTC', $item['expires'], ATOM_TIME); + $activity['expires'] = datetime_convert('UTC', 'UTC', $item['expires'], ISO8601); } if ($item['app']) { $activity['generator'] = ['type' => 'Application', 'name' => $item['app']]; @@ -1217,7 +1217,7 @@ class Activity if (!isset($activity['startTime'])) { if ($item['comments_closed'] && datetime_convert(datetime: $item['comments_closed']) > NULL_DATE) { - $activity['endTime'] = datetime_convert(datetime: $item['comments_closed'], format: ATOM_TIME); + $activity['endTime'] = datetime_convert(datetime: $item['comments_closed'], format: ISO8601); } } @@ -1654,12 +1654,12 @@ class Activity $actor->setPreferredUsername(substr($p['xchan_addr'], 0, strpos($p['xchan_addr'], '@'))); } $actor->setName($p['xchan_name']); - $actor->setPublished(datetime_convert('UTC','UTC', $p['xchan_created'], ATOM_TIME)); - $actor->setUpdated(datetime_convert('UTC', 'UTC', $p['xchan_name_date'], ATOM_TIME)); + $actor->setPublished(datetime_convert('UTC','UTC', $p['xchan_created'], ISO8601)); + $actor->setUpdated(datetime_convert('UTC', 'UTC', $p['xchan_name_date'], ISO8601)); $actor->setIcon([ 'type' => 'Image', 'mediaType' => (($p['xchan_photo_mimetype']) ?: 'image/png'), - 'updated' => datetime_convert('UTC', 'UTC', $p['xchan_photo_date'], ATOM_TIME), + 'updated' => datetime_convert('UTC', 'UTC', $p['xchan_photo_date'], ISO8601), 'url' => $p['xchan_photo_l'], 'height' => 300, 'width' => 300, @@ -2901,7 +2901,7 @@ class Activity } if ($pollItem['comments_closed'] > NULL_DATE) { if ($pollItem['comments_closed'] > datetime_convert()) { - $o['closed'] = datetime_convert('UTC', 'UTC', $pollItem['comments_closed'], ATOM_TIME); + $o['closed'] = datetime_convert('UTC', 'UTC', $pollItem['comments_closed'], ISO8601); // set this to force an update $answer_found = true; } diff --git a/Code/Lib/ActivityPub.php b/Code/Lib/ActivityPub.php index cca0f9e44..c43a86005 100644 --- a/Code/Lib/ActivityPub.php +++ b/Code/Lib/ActivityPub.php @@ -372,7 +372,7 @@ class ActivityPub [ 'id' => z_root() . '/channel/' . $x['sender']['channel_address'] . '#update', 'type' => 'Update', - 'updated' => datetime_convert(format: ATOM_TIME), + 'updated' => datetime_convert(format: ISO8601), 'actor' => $p, 'object' => z_root() . '/channel/' . $x['sender']['channel_address'], 'to' => [z_root() . '/followers/' . $x['sender']['channel_address']], diff --git a/Code/Lib/JcsEddsa2022.php b/Code/Lib/JcsEddsa2022.php index f8679a2e7..15c879d7e 100644 --- a/Code/Lib/JcsEddsa2022.php +++ b/Code/Lib/JcsEddsa2022.php @@ -21,7 +21,7 @@ class JcsEddsa2022 $options = [ 'type' => 'DataIntegrityProof', 'cryptosuite' => 'eddsa-jcs-2022', - 'created' => Time::convert(format: ATOM_TIME), + 'created' => Time::convert(format: ISO8601), 'verificationMethod' => Channel::url($channel) . '#' . $pubkey, 'proofPurpose' => 'assertionMethod', ]; diff --git a/Code/Lib/MastAPI.php b/Code/Lib/MastAPI.php index 9b991d48b..f21d1ad17 100644 --- a/Code/Lib/MastAPI.php +++ b/Code/Lib/MastAPI.php @@ -52,7 +52,7 @@ class MastAPI $ret['display_name'] = $channel['channel_name']; $ret['locked'] = !intval(PConfig::Get($channel['channel_id'], 'system', 'autoperms')); $ret['discoverable'] = (bool)((1 - intval($channel['xchan_hidden']))); - $ret['created_at'] = datetime_convert('UTC', 'UTC', $a[0]['account_created'], ATOM_TIME); + $ret['created_at'] = datetime_convert('UTC', 'UTC', $a[0]['account_created'], ISO8601); $ret['note'] = bbcode($p[0]['about'], ['export' => true]); $ret['url'] = Channel::url($channel); $ret['avatar'] = $channel['xchan_photo_l']; @@ -64,7 +64,7 @@ class MastAPI $ret['followers_count'] = intval($followers[0]['total']); $ret['following_count'] = intval($following[0]['total']); $ret['statuses_count'] = intval($statuses[0]['total']); - $ret['last_status_at'] = datetime_convert('UTC', 'UTC', $channel['lastpost'], ATOM_TIME); + $ret['last_status_at'] = datetime_convert('UTC', 'UTC', $channel['lastpost'], ISO8601); return $ret; diff --git a/Code/Module/Cover_photo.php b/Code/Module/Cover_photo.php index 9d0ae9e52..c43220135 100644 --- a/Code/Module/Cover_photo.php +++ b/Code/Module/Cover_photo.php @@ -294,8 +294,8 @@ class Cover_photo extends Controller $arr['obj'] = [ 'type' => ACTIVITY_OBJ_NOTE, - 'published' => datetime_convert('UTC', 'UTC', 'now', ATOM_TIME), - 'updated' => datetime_convert('UTC', 'UTC', 'now', ATOM_TIME), + 'published' => datetime_convert('UTC', 'UTC', 'now', ISO8601), + 'updated' => datetime_convert('UTC', 'UTC', 'now', ISO8601), 'id' => $arr['mid'], 'url' => ['type' => 'Link', 'mediaType' => $photo['mimetype'], 'href' => z_root() . '/photo/' . $photo['resource_id'] . '-7'], 'source' => ['content' => $arr['body'], 'mediaType' => 'text/x-multicode'], diff --git a/Code/Module/Display.php b/Code/Module/Display.php index 5e2cce796..cd84972d2 100644 --- a/Code/Module/Display.php +++ b/Code/Module/Display.php @@ -452,7 +452,7 @@ class Display extends Controller '$generator_uri' => z_root(), '$feed_id' => xmlify(App::$cmd), '$feed_title' => xmlify(t('Article')), - '$feed_updated' => xmlify(datetime_convert('UTC', 'UTC', 'now', ATOM_TIME)), + '$feed_updated' => xmlify(datetime_convert('UTC', 'UTC', 'now', ISO8601)), '$author' => '', '$owner' => '', '$profile_page' => xmlify(z_root() . '/display/?mid=' . $target_item['mid']), diff --git a/Code/Module/Item.php b/Code/Module/Item.php index 06dbb841e..d109dac63 100644 --- a/Code/Module/Item.php +++ b/Code/Module/Item.php @@ -2034,7 +2034,7 @@ class Item extends Controller $matches = null; if (preg_match('/\[ends](.*?)\[\/ends]/ism', $body, $matches)) { - $obj['endTime'] = datetime_convert(date_default_timezone_get(), 'UTC', $matches[1], ATOM_TIME); + $obj['endTime'] = datetime_convert(date_default_timezone_get(), 'UTC', $matches[1], ISO8601); $body = str_replace('[ends]' . $matches[1] . '[/ends]', EMPTY_STR, $body); } @@ -2074,7 +2074,7 @@ class Item extends Controller $obj['oneOf'] = $ptr; } - $obj['endTime'] = datetime_convert(date_default_timezone_get(), 'UTC', 'now + ' . $expire_value . ' ' . $expire_unit, ATOM_TIME); + $obj['endTime'] = datetime_convert(date_default_timezone_get(), 'UTC', 'now + ' . $expire_value . ' ' . $expire_unit, ISO8601); if ($item['item_private']) { $obj['to'] = Activity::map_acl($item); diff --git a/Code/Module/Photos.php b/Code/Module/Photos.php index 4f28c493f..cc6b1caa2 100644 --- a/Code/Module/Photos.php +++ b/Code/Module/Photos.php @@ -437,7 +437,7 @@ class Photos extends Controller $obj['name'] = (($title) ? $title : $p[0]['filename']); $obj['summary'] = (($desc) ? $desc : $p[0]['filename']); - $obj['updated'] = datetime_convert('UTC', 'UTC', 'now', ATOM_TIME); + $obj['updated'] = datetime_convert('UTC', 'UTC', 'now', ISO8601); $obj['source'] = ['content' => $body, 'mediaType' => 'text/x-multicode']; $obj['content'] = bbcode($body . $footer_text, ['export' => true]); if (isset($obj['url']) && is_array($obj['url'])) { diff --git a/include/constants.php b/include/constants.php index 191e43e99..82ed80edb 100644 --- a/include/constants.php +++ b/include/constants.php @@ -8,7 +8,7 @@ */ define ( 'EOL', '
' . "\r\n" ); define ( 'EMPTY_STR', '' ); -define ( 'ATOM_TIME', 'Y-m-d\\TH:i:s\\Z' ); // aka ISO 8601 "Zulu" +define ( 'ISO8601', 'Y-m-d\\TH:i:s\\Z' ); // aka "Zulu" define ( 'TEMPLATE_BUILD_PATH', 'cache/smarty3' ); //define ( 'USE_BEARCAPS', true); diff --git a/include/event.php b/include/event.php index 7d31a5d8f..a11542cb7 100644 --- a/include/event.php +++ b/include/event.php @@ -43,7 +43,7 @@ function format_event_html($ev) $o .= '

 ' . zidify_links(smilies(bbcode($ev['summary']))) . '

' . "\r\n"; $o .= '
' . t('Starts:') . ' ' . (($ev['adjust']) ? day_translate(datetime_convert( 'UTC', @@ -61,7 +61,7 @@ function format_event_html($ev) if (! $ev['nofinish']) { $o .= '
' . t('Finishes:') . ' ' . (($ev['adjust']) ? day_translate(datetime_convert( 'UTC', @@ -106,7 +106,7 @@ function format_event_obj($jobject) 'id' => z_root() . '/event/' . $r[0]['resource_id'], 'summary' => bbcode($arr['summary']), // RFC3339 Section 4.3 - 'startTime' => (($arr['adjust']) ? datetime_convert('UTC','UTC',$arr['dtstart'], ATOM_TIME) : datetime_convert('UTC','UTC',$arr['dtstart'],'Y-m-d\\TH:i:s-00:00')), + 'startTime' => (($arr['adjust']) ? datetime_convert('UTC','UTC',$arr['dtstart'], ISO8601) : datetime_convert('UTC','UTC',$arr['dtstart'],'Y-m-d\\TH:i:s-00:00')), 'content' => bbcode($arr['description']), 'location' => [ 'type' => 'Place', 'content' => $arr['location'] ], 'source' => [ 'content' => format_event_bbcode($arr), 'mediaType' => 'text/x-multicode' ], @@ -114,7 +114,7 @@ function format_event_obj($jobject) 'actor' => Activity::encode_person($r[0],false), ]; if(! $arr['nofinish']) { - $x['endTime'] = (($arr['adjust']) ? datetime_convert('UTC','UTC',$arr['dtend'], ATOM_TIME) : datetime_convert('UTC','UTC',$arr['dtend'],'Y-m-d\\TH:i:s-00:00')); + $x['endTime'] = (($arr['adjust']) ? datetime_convert('UTC','UTC',$arr['dtend'], ISO8601) : datetime_convert('UTC','UTC',$arr['dtend'],'Y-m-d\\TH:i:s-00:00')); } ******/ @@ -127,11 +127,11 @@ function format_event_obj($jobject) $event['header'] = replace_macros(Theme::get_template('event_item_header.tpl'), [ '$title' => $title, '$dtstart_label' => t('Starts:'), - '$dtstart_title' => datetime_convert('UTC', 'UTC', $object['startTime'], ((strpos($object['startTime'], 'Z')) ? ATOM_TIME : 'Y-m-d\TH:i:s' )), + '$dtstart_title' => datetime_convert('UTC', 'UTC', $object['startTime'], ((strpos($object['startTime'], 'Z')) ? ISO8601 : 'Y-m-d\TH:i:s' )), '$dtstart_dt' => ((strpos($object['startTime'], 'Z')) ? day_translate(datetime_convert('UTC', date_default_timezone_get(), $object['startTime'], $bd_format)) : day_translate(datetime_convert('UTC', 'UTC', $object['startTime'], $bd_format))), '$finish' => array_key_exists('endTime', $object), '$dtend_label' => t('Finishes:'), - '$dtend_title' => datetime_convert('UTC', 'UTC', $dtend, ((strpos($object['startTime'], 'Z')) ? ATOM_TIME : 'Y-m-d\TH:i:s' )), + '$dtend_title' => datetime_convert('UTC', 'UTC', $dtend, ((strpos($object['startTime'], 'Z')) ? ISO8601 : 'Y-m-d\TH:i:s' )), '$dtend_dt' => ((strpos($object['startTime'], 'Z')) ? day_translate(datetime_convert('UTC', date_default_timezone_get(), $dtend, $bd_format)) : day_translate(datetime_convert('UTC', 'UTC', $dtend, $bd_format))) ]); @@ -1211,7 +1211,7 @@ function event_store_item($arr, $event, $deliver = true, $addAndSync = true) 'id' => z_root() . '/event/' . $r[0]['resource_id'], 'name' => $arr['summary'], // RFC3339 Section 4.3 - 'startTime' => (($arr['adjust']) ? datetime_convert('UTC', 'UTC', $arr['dtstart'], ATOM_TIME) : datetime_convert('UTC', 'UTC', $arr['dtstart'], 'Y-m-d\\TH:i:s-00:00')), + 'startTime' => (($arr['adjust']) ? datetime_convert('UTC', 'UTC', $arr['dtstart'], ISO8601) : datetime_convert('UTC', 'UTC', $arr['dtstart'], 'Y-m-d\\TH:i:s-00:00')), 'content' => bbcode($arr['description']), 'location' => [ 'type' => 'Place', 'content' => $arr['location'] ], 'source' => [ 'content' => format_event_bbcode($arr), 'mediaType' => 'text/x-multicode' ], @@ -1222,7 +1222,7 @@ function event_store_item($arr, $event, $deliver = true, $addAndSync = true) ]; if (! $arr['nofinish']) { - $x['endTime'] = (($arr['adjust']) ? datetime_convert('UTC', 'UTC', $arr['dtend'], ATOM_TIME) : datetime_convert('UTC', 'UTC', $arr['dtend'], 'Y-m-d\\TH:i:s-00:00')); + $x['endTime'] = (($arr['adjust']) ? datetime_convert('UTC', 'UTC', $arr['dtend'], ISO8601) : datetime_convert('UTC', 'UTC', $arr['dtend'], 'Y-m-d\\TH:i:s-00:00')); } if ($event['event_repeat']) { $x['eventRepeat'] = $event['event_repeat']; @@ -1335,7 +1335,7 @@ function event_store_item($arr, $event, $deliver = true, $addAndSync = true) 'id' => z_root() . '/event/' . $event['event_hash'], 'name' => $arr['summary'], // RFC3339 Section 4.3 - 'startTime' => (($arr['adjust']) ? datetime_convert('UTC', 'UTC', $arr['dtstart'], ATOM_TIME) : datetime_convert('UTC', 'UTC', $arr['dtstart'], 'Y-m-d\\TH:i:s-00:00')), + 'startTime' => (($arr['adjust']) ? datetime_convert('UTC', 'UTC', $arr['dtstart'], ISO8601) : datetime_convert('UTC', 'UTC', $arr['dtstart'], 'Y-m-d\\TH:i:s-00:00')), 'content' => bbcode($arr['description']), 'location' => [ 'type' => 'Place', 'content' => bbcode($arr['location']) ], 'source' => [ 'content' => format_event_bbcode($arr), 'mediaType' => 'text/x-multicode' ], @@ -1346,7 +1346,7 @@ function event_store_item($arr, $event, $deliver = true, $addAndSync = true) ]; if (! $arr['nofinish']) { - $y['endTime'] = (($arr['adjust']) ? datetime_convert('UTC', 'UTC', $arr['dtend'], ATOM_TIME) : datetime_convert('UTC', 'UTC', $arr['dtend'], 'Y-m-d\\TH:i:s-00:00')); + $y['endTime'] = (($arr['adjust']) ? datetime_convert('UTC', 'UTC', $arr['dtend'], ISO8601) : datetime_convert('UTC', 'UTC', $arr['dtend'], 'Y-m-d\\TH:i:s-00:00')); } if ($arr['event_repeat']) { $y['eventRepeat'] = $arr['event_repeat']; diff --git a/include/feedutils.php b/include/feedutils.php index e36c2b8ee..4560e4741 100644 --- a/include/feedutils.php +++ b/include/feedutils.php @@ -104,7 +104,7 @@ function get_feed_for($channel, $observer_hash, $params) '$generator_uri' => z_root(), '$feed_id' => xmlify($channel['xchan_url']), '$feed_title' => xmlify($channel['channel_name']), - '$feed_updated' => xmlify(datetime_convert('UTC', 'UTC', 'now', ATOM_TIME)), + '$feed_updated' => xmlify(datetime_convert('UTC', 'UTC', 'now', ISO8601)), '$author' => $feed_author, '$profile_page' => xmlify($channel['xchan_url']), ]); @@ -305,7 +305,7 @@ function atom_entry($item, $type, $author, $owner, $comment = false, $cid = 0) } if ($item['deleted']) { - return '' . "\r\n"; + return '' . "\r\n"; } create_export_photo_body($item); @@ -338,8 +338,8 @@ function atom_entry($item, $type, $author, $owner, $comment = false, $cid = 0) } $o .= '' . xmlify(prepare_text($body, $item['mimetype'])) . '' . "\r\n"; $o .= '' . xmlify($item['mid']) . '' . "\r\n"; - $o .= '' . xmlify(datetime_convert('UTC', 'UTC', $item['created'] . '+00:00', ATOM_TIME)) . '' . "\r\n"; - $o .= '' . xmlify(datetime_convert('UTC', 'UTC', $item['edited'] . '+00:00', ATOM_TIME)) . '' . "\r\n"; + $o .= '' . xmlify(datetime_convert('UTC', 'UTC', $item['created'] . '+00:00', ISO8601)) . '' . "\r\n"; + $o .= '' . xmlify(datetime_convert('UTC', 'UTC', $item['edited'] . '+00:00', ISO8601)) . '' . "\r\n"; $o .= '' . "\r\n"; diff --git a/include/items.php b/include/items.php index 0599ee1c1..833aa555f 100644 --- a/include/items.php +++ b/include/items.php @@ -4679,8 +4679,8 @@ function send_profile_photo_activity($channel,$photo,$profile) { $arr['obj'] = [ 'type' => ACTIVITY_OBJ_NOTE, - 'published' => datetime_convert('UTC', 'UTC', 'now', ATOM_TIME), - 'updated' => datetime_convert('UTC', 'UTC', 'now', ATOM_TIME), + 'published' => datetime_convert('UTC', 'UTC', 'now', ISO8601), + 'updated' => datetime_convert('UTC', 'UTC', 'now', ISO8601), 'id' => $arr['mid'], 'url' => [ 'type' => 'Link', 'mediaType' => $photo['mimetype'], 'href' => z_root() . '/photo/profile/l/' . $channel['channel_id'] ], 'source' => [ 'content' => $arr['body'], 'mediaType' => 'text/x-multicode' ], diff --git a/include/misc.php b/include/misc.php index 36b16e098..becc5bc1c 100644 --- a/include/misc.php +++ b/include/misc.php @@ -733,7 +733,7 @@ function logger($msg, $level = LOGGER_NORMAL, $priority = LOG_INFO) $stack = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2); $where = basename($stack[0]['file']) . ':' . $stack[0]['line'] . ':' . $stack[1]['function'] . ': '; - $s = datetime_convert('UTC', 'UTC', 'now', ATOM_TIME) . ':' . log_priority_str($priority) . ':' . logid() . ':' . $where . $msg . PHP_EOL; + $s = datetime_convert('UTC', 'UTC', 'now', ISO8601) . ':' . log_priority_str($priority) . ':' . logid() . ':' . $where . $msg . PHP_EOL; $pluginfo = ['filename' => $logfile, 'loglevel' => $level, 'message' => $s,'priority' => $priority, 'logged' => false]; if (! (App::$module == 'setup')) { @@ -774,7 +774,7 @@ function btlogger($msg, $level = LOGGER_NORMAL, $priority = LOG_INFO) if (file_exists(BTLOGGER_DEBUG_FILE) && is_writable(BTLOGGER_DEBUG_FILE)) { $stack = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2); $where = basename($stack[0]['file']) . ':' . $stack[0]['line'] . ':' . $stack[1]['function'] . ': '; - $s = datetime_convert('UTC', 'UTC', 'now', ATOM_TIME) . ':' . log_priority_str($priority) . ':' . logid() . ':' . $where . $msg . PHP_EOL; + $s = datetime_convert('UTC', 'UTC', 'now', ISO8601) . ':' . log_priority_str($priority) . ':' . logid() . ':' . $where . $msg . PHP_EOL; @file_put_contents(BTLOGGER_DEBUG_FILE, $s, FILE_APPEND); } @@ -845,7 +845,7 @@ function dlogger($msg, $level = 0) $stack = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2); $where = basename($stack[0]['file']) . ':' . $stack[0]['line'] . ':' . $stack[1]['function'] . ': '; - @file_put_contents($logfile, datetime_convert('UTC', 'UTC', 'now', ATOM_TIME) . ':' . logid() . ' ' . $where . $msg . PHP_EOL, FILE_APPEND); + @file_put_contents($logfile, datetime_convert('UTC', 'UTC', 'now', ISO8601) . ':' . logid() . ' ' . $where . $msg . PHP_EOL, FILE_APPEND); } diff --git a/include/photos.php b/include/photos.php index ac7e2487e..57fefbea3 100644 --- a/include/photos.php +++ b/include/photos.php @@ -415,8 +415,8 @@ function photo_upload($channel, $observer, $args) 'type' => ACTIVITY_OBJ_PHOTO, 'name' => $title, 'summary' => $p['description'], - 'published' => datetime_convert('UTC', 'UTC', $p['created'], ATOM_TIME), - 'updated' => datetime_convert('UTC', 'UTC', $p['edited'], ATOM_TIME), + 'published' => datetime_convert('UTC', 'UTC', $p['created'], ISO8601), + 'updated' => datetime_convert('UTC', 'UTC', $p['edited'], ISO8601), 'attributedTo' => $attribution, // This is a placeholder and will get over-ridden by the item mid, which is critical for sharing as a conversational item over activitypub 'id' => z_root() . '/photo/' . $photo_hash, @@ -472,12 +472,12 @@ function photo_upload($channel, $observer, $args) if ($object['commentPolicy']) { $object['commentPolicy'] .= ' '; } - $object['commentPolicy'] .= 'until=' . datetime_convert('UTC', 'UTC', $item['created'], ATOM_TIME); + $object['commentPolicy'] .= 'until=' . datetime_convert('UTC', 'UTC', $item['created'], ISO8601); } elseif (array_key_exists('comments_closed', $item) && $item['comments_closed'] !== EMPTY_STR && $item['comments_closed'] > NULL_DATE) { if ($object['commentPolicy']) { $object['commentPolicy'] .= ' '; } - $object['commentPolicy'] .= 'until=' . datetime_convert('UTC', 'UTC', $item['comments_closed'], ATOM_TIME); + $object['commentPolicy'] .= 'until=' . datetime_convert('UTC', 'UTC', $item['comments_closed'], ISO8601); } if ($item['mid'] === $item['parent_mid']) {