]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-14679 prevent fatal delete_records() problems if $DB forgotten
authorskodak <skodak>
Fri, 30 May 2008 12:36:07 +0000 (12:36 +0000)
committerskodak <skodak>
Fri, 30 May 2008 12:36:07 +0000 (12:36 +0000)
lib/dmllib.php

index f646c56e343bd5abc99aaef9fd8b8da883cf9e05..c7af985d26bc65c77e39765f461bb3b355fa5fca 100644 (file)
@@ -344,6 +344,10 @@ function record_exists($table, $field1='', $value1='', $field2='', $value2='', $
 function delete_records($table, $field1='', $value1='', $field2='', $value2='', $field3='', $value3='') {
     global $DB;
 
+    if (is_array($field1)) {
+        error('Incorrect parameter! (probably missing $DB->)');
+    }
+
     $conditions = array();
     if ($field1) {
         $conditions[$field1] = stripslashes_recursive($value1);