MDL-21876 fixed incorrect uses of bound parameters - patch by Ashley Holman, thanks!
authorPetr Skoda <skodak@moodle.org>
Sat, 20 Mar 2010 11:49:48 +0000 (11:49 +0000)
committerPetr Skoda <skodak@moodle.org>
Sat, 20 Mar 2010 11:49:48 +0000 (11:49 +0000)
admin/cron.php
mod/forum/rsslib.php

index e918f2c..b7bd969 100644 (file)
     if ($CFG->useexternalblogs) {
         require_once($CFG->dirroot . '/blog/lib.php');
         mtrace("Fetching external blog entries...", '');
-        $sql = "timefetched < ? - ? OR timefetched = 0";
-        $externalblogs = $DB->get_records_select('blog_external', $sql, array(mktime(), $CFG->externalblogcrontime));
+        $sql = "timefetched < ? OR timefetched = 0";
+        $externalblogs = $DB->get_records_select('blog_external', $sql, array(mktime() - $CFG->externalblogcrontime));
 
         foreach ($externalblogs as $eb) {
             blog_sync_external_entries($eb);
index b24d79c..ece126e 100644 (file)
                                            {user} u
                                       WHERE d.forum = ? AND
                                             p.discussion = d.id AND
-                                            u.id = p.userid ?
-                                      ORDER BY p.created desc", array($forum->id, $newsince), 0, $forum->rssarticles)) {
+                                            u.id = p.userid $newsince
+                                      ORDER BY p.created desc", array($forum->id), 0, $forum->rssarticles)) {
 
             $item = NULL;
             $user = NULL;