Commit 6e45b2f9 authored by Dries's avatar Dries
Browse files

- Patch #42029 by drumm: correct post times for administrators posting using a blogapi client.

parent 47ae354e
......@@ -223,6 +223,9 @@ function blogapi_blogger_new_post($appkey, $blogid, $username, $password, $conte
return blogapi_error(t('You do not have permission to create the type of post you wanted to create.'));
}
if (user_access('administer nodes') && !isset($edit['date'])) {
$edit['date'] = format_date(time(), 'custom', 'Y-m-d H:i:s O');
}
$node = node_submit($edit);
node_save($node);
if ($node->nid) {
......@@ -274,6 +277,9 @@ function blogapi_blogger_edit_post($appkey, $postid, $username, $password, $cont
return blogapi_error(implode("\n", $errors));
}
if (user_access('administer nodes') && !isset($edit['date'])) {
$node->date = format_date($node->created, 'custom', 'Y-m-d H:i:s O');
}
$node = node_submit($node);
node_save($node);
if ($node->nid) {
......
......@@ -223,6 +223,9 @@ function blogapi_blogger_new_post($appkey, $blogid, $username, $password, $conte
return blogapi_error(t('You do not have permission to create the type of post you wanted to create.'));
}
if (user_access('administer nodes') && !isset($edit['date'])) {
$edit['date'] = format_date(time(), 'custom', 'Y-m-d H:i:s O');
}
$node = node_submit($edit);
node_save($node);
if ($node->nid) {
......@@ -274,6 +277,9 @@ function blogapi_blogger_edit_post($appkey, $postid, $username, $password, $cont
return blogapi_error(implode("\n", $errors));
}
if (user_access('administer nodes') && !isset($edit['date'])) {
$node->date = format_date($node->created, 'custom', 'Y-m-d H:i:s O');
}
$node = node_submit($node);
node_save($node);
if ($node->nid) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment