Skip to content

Commit

Permalink
blog MDL-20617 adding checking for deleted blog posts
Browse files Browse the repository at this point in the history
  • Loading branch information
andyjdavis committed Dec 20, 2010
1 parent afce96f commit cc52e53
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions blog/lib.php
Expand Up @@ -163,6 +163,8 @@ function blog_sync_external_entries($externalblog) {
if (empty($rss->data)) {
return null;
}

$oldesttimestamp = null;

foreach ($rss->get_items() as $entry) {
// If filtertags are defined, use them to filter the entries by RSS category
Expand Down Expand Up @@ -220,6 +222,11 @@ function blog_sync_external_entries($externalblog) {
$newentry->created = $timestamp;
}
$newentry->lastmodified = $timestamp;

if (empty($oldesttimestamp) || $timestamp<$oldesttimestamp) {
//found an older post
$oldesttimestamp = $timestamp;
}

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

0 comments on commit cc52e53

Please sign in to comment.