MDL-52605 phpunit: Prevent querying database metadata

This commit is contained in:
Mark Nielsen
2016-01-04 07:52:49 +08:00
committed by Rajesh Taneja
parent 69b2e68d27
commit 7de2aa1a95
2 changed files with 8 additions and 6 deletions
+5 -3
View File
@@ -577,6 +577,11 @@ abstract class moodle_database {
protected function where_clause($table, array $conditions=null) {
// We accept nulls in conditions
$conditions = is_null($conditions) ? array() : $conditions;
if (empty($conditions)) {
return array('', array());
}
// Some checks performed under debugging only
if (debugging()) {
$columns = $this->get_columns($table);
@@ -600,9 +605,6 @@ abstract class moodle_database {
}
$allowed_types = $this->allowed_param_types();
if (empty($conditions)) {
return array('', array());
}
$where = array();
$params = array();