From 4f5d1c5cbf04ac38a825c4356c3b8463aa4bd15e Mon Sep 17 00:00:00 2001 From: "Eloy Lafuente (stronk7)" Date: Fri, 19 Jan 2018 00:59:16 +0100 Subject: [PATCH] MDL-61240 dml: php72 compatibility, avoid counting on non-countables This was not detected earlier because we have been unable to run sqlsrv + php72 till now (not available). --- lib/dml/sqlsrv_native_moodle_database.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dml/sqlsrv_native_moodle_database.php b/lib/dml/sqlsrv_native_moodle_database.php index 08f27357748..d1d27f128ca 100644 --- a/lib/dml/sqlsrv_native_moodle_database.php +++ b/lib/dml/sqlsrv_native_moodle_database.php @@ -443,7 +443,7 @@ class sqlsrv_native_moodle_database extends moodle_database { * @return array of table names in lowercase and without prefix */ public function get_tables($usecache = true) { - if ($usecache and count($this->tables) > 0) { + if ($usecache and $this->tables !== null) { return $this->tables; } $this->tables = array ();