From 2adc0e3eb6f1c82cfcc07aa685edd5876f163126 Mon Sep 17 00:00:00 2001 From: skodak Date: Fri, 30 May 2008 12:36:07 +0000 Subject: [PATCH] MDL-14679 prevent fatal delete_records() problems if $DB forgotten --- lib/dmllib.php | 4 ++++ 1 file changed, 4 insertions(+) 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); -- 2.39.5