MDL-61836 core_blog: Prevent randomness in comments order
authorFrédéric Massart <fred@branchup.tech>
Thu, 19 Apr 2018 08:05:12 +0000 (16:05 +0800)
committerAndrew Nicols <andrew@nicols.co.uk>
Fri, 20 Apr 2018 00:56:05 +0000 (08:56 +0800)
blog/classes/privacy/provider.php

index 7ec3696..6c58586 100644 (file)
@@ -212,7 +212,7 @@ class provider implements
                     // Loop over each blog entry in context.
                     $sql = "userid = :userid AND module IN (:blog, :blogext) AND id $insql";
                     $params = array_merge($inparams, ['userid' => $contextuserid, 'blog' => 'blog', 'blogext' => 'blog_external']);
-                    $recordset = $DB->get_recordset_select('post', $sql, $params);
+                    $recordset = $DB->get_recordset_select('post', $sql, $params, 'id');
                     foreach ($recordset as $record) {
 
                         $subject = format_string($record->subject);