From c5031139ebb46ce4994d3bd62059ae4eaba71359 Mon Sep 17 00:00:00 2001 From: Mike Macgirvin Date: Mon, 13 Sep 2010 22:57:31 -0700 Subject: abstractify items, check photos for birthday paradox --- include/items.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'include/items.php') diff --git a/include/items.php b/include/items.php index dbe6493d4..f85a0e64b 100644 --- a/include/items.php +++ b/include/items.php @@ -308,7 +308,7 @@ function get_atom_elements($item) { return $res; } -function post_remote($a,$arr) { +function item_store($arr) { //print_r($arr); @@ -330,14 +330,14 @@ function post_remote($a,$arr) { $arr['owner-name'] = notags(trim($arr['owner-name'])); $arr['owner-link'] = notags(trim($arr['owner-link'])); $arr['owner-avatar'] = notags(trim($arr['owner-avatar'])); - $arr['created'] = datetime_convert('UTC','UTC',$arr['created'],'Y-m-d H:i:s'); - $arr['edited'] = datetime_convert('UTC','UTC',$arr['edited'],'Y-m-d H:i:s'); + $arr['created'] = ((x($arr,'created') !== false) ? datetime_convert('UTC','UTC',$arr['created']) : datetime_convert()); + $arr['edited'] = ((x($arr,'edited') !== false) ? datetime_convert('UTC','UTC',$arr['edited']) : datetime_convert()); $arr['changed'] = datetime_convert(); $arr['title'] = notags(trim($arr['title'])); $arr['location'] = notags(trim($arr['location'])); $arr['body'] = escape_tags(trim($arr['body'])); $arr['last-child'] = intval($arr['last-child']); - $arr['visible'] = 1; + $arr['visible'] = ((x($arr,'visible') !== false) ? intval($arr['visible']) : 1); $arr['deleted'] = 0; $arr['parent-uri'] = notags(trim($arr['parent-uri'])); $arr['verb'] = notags(trim($arr['verb'])); -- cgit v1.2.3