From: skodak Date: Fri, 30 May 2008 12:36:07 +0000 (+0000) Subject: MDL-14679 prevent fatal delete_records() problems if $DB forgotten X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=2adc0e3eb6f1c82cfcc07aa685edd5876f163126;p=moodle.git MDL-14679 prevent fatal delete_records() problems if $DB forgotten --- diff --git a/lib/dmllib.php b/lib/dmllib.php index f646c56e34..c7af985d26 100644 --- a/lib/dmllib.php +++ b/lib/dmllib.php @@ -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);