MDL-52141 backup: Ensure we don't alter the log record when parsing it.
authorRussell Smith <mr-russ@smith2001.net>
Mon, 16 Nov 2015 01:50:55 +0000 (12:50 +1100)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Thu, 3 Dec 2015 10:11:07 +0000 (11:11 +0100)
backup/util/helper/restore_log_rule.class.php

index bb7d4e3..6e182c0 100644 (file)
@@ -97,7 +97,10 @@ class restore_log_rule implements processable {
         return $this->module . '-' . $this->action;
     }
 
-    public function process($log) {
+    public function process($inputlog) {
+
+        // There might be multiple rules that process this log, we can't alter it in the process of checking it.
+        $log = clone($inputlog);
 
         // Reset the allpairs array
         $this->allpairs = array();