Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-26010 Reformatting SQL of the previous Andrew's fix

I have reformatted the SQL according to the style used in Moodle code to
improve readability of the query. Added sql_compare_text() to the right
side of the comparison, even though the current callers provide integers
here (just in case).
  • Loading branch information...
commit ed79b89b85b918f6d6093cdc52eb5c26d75b61ba 1 parent 42291c6
@mudrd8mz mudrd8mz authored
Showing with 8 additions and 4 deletions.
  1. +8 −4 blog/lib.php
View
12 blog/lib.php
@@ -261,10 +261,14 @@ function blog_sync_external_entries($externalblog) {
}
}
- //Look at the posts we have in the database to check if any of them have been deleted from the feed.
- //Only checking posts within the time frame returned by the rss feed. Older items may have been deleted or
- //may just not be returned anymore. We cant tell the difference so we leave older posts alone.
- $sql = "SELECT id, uniquehash FROM {post} WHERE ".$DB->sql_compare_text('content')." = :blogid AND module = 'blog_external' AND created > :ts";
+ // Look at the posts we have in the database to check if any of them have been deleted from the feed.
+ // Only checking posts within the time frame returned by the rss feed. Older items may have been deleted or
+ // may just not be returned anymore. We can't tell the difference so we leave older posts alone.
+ $sql = "SELECT id, uniquehash
+ FROM {post}
+ WHERE module = 'blog_external'
+ AND " . $DB->sql_compare_text('content') . " = " . $DB->sql_compare_text(':blogid') . "
+ AND created > :ts";
$dbposts = $DB->get_records_sql($sql, array('blogid' => $externalblog->id, 'ts' => $oldesttimestamp));
$todelete = array();

0 comments on commit ed79b89

Please sign in to comment.
Something went wrong with that request. Please try again.