Skip to content

Commit

Permalink
blog MDL-25217 now checking for null creation and modified timestamps…
Browse files Browse the repository at this point in the history
… when importing external blog entries
  • Loading branch information
Andrew Davis committed Nov 15, 2010
1 parent 675e7a4 commit 99cd408
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions blog/lib.php
Expand Up @@ -196,8 +196,16 @@ function blog_sync_external_entries($externalblog) {
$newentry->format = FORMAT_HTML;
$newentry->subject = $entry->get_title();
$newentry->summary = $entry->get_description();
$newentry->created = $entry->get_date('U');
$newentry->lastmodified = $entry->get_date('U');

//our DB doesnt allow null creation or modified timestamps so check the external blog didnt supply one
$entrydate = $entry->get_date('U');
if (empty($entrydate)) {
$newentry->created = time();
$newentry->lastmodified = time();
} else {
$newentry->created = $entrydate;
$newentry->lastmodified = $entrydate;
}

$textlib = textlib_get_instance();
if ($textlib->strlen($newentry->uniquehash) > 255) {
Expand Down

0 comments on commit 99cd408

Please sign in to comment.