From d525ca256a4033c25b1f2c7021a838ece3cd89e9 Mon Sep 17 00:00:00 2001 From: skodak Date: Wed, 11 Apr 2007 08:51:01 +0000 Subject: [PATCH] MDL-9287 missing resultset check in mnet config_form(); merged from MOODLE_18_STABLE --- auth/mnet/auth.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/auth/mnet/auth.php b/auth/mnet/auth.php index 47f7e52d02a..f8baa0758e5 100644 --- a/auth/mnet/auth.php +++ b/auth/mnet/auth.php @@ -673,15 +673,16 @@ class auth_plugin_mnet extends auth_plugin_base { ORDER BY h.name ASC"; - $resultset = get_records_sql($query); $id_providers = array(); $service_providers = array(); - foreach($resultset as $hostservice) { - if(!empty($hostservice->idppublish) && !empty($hostservice->spsubscribe)) { - $service_providers[]= array('id' => $hostservice->id, 'name' => $hostservice->hostname, 'wwwroot' => $hostservice->wwwroot); - } - if(!empty($hostservice->idpsubscribe) && !empty($hostservice->sppublish)) { - $id_providers[]= array('id' => $hostservice->id, 'name' => $hostservice->hostname, 'wwwroot' => $hostservice->wwwroot); + if ($resultset = get_records_sql($query)) { + foreach($resultset as $hostservice) { + if(!empty($hostservice->idppublish) && !empty($hostservice->spsubscribe)) { + $service_providers[]= array('id' => $hostservice->id, 'name' => $hostservice->hostname, 'wwwroot' => $hostservice->wwwroot); + } + if(!empty($hostservice->idpsubscribe) && !empty($hostservice->sppublish)) { + $id_providers[]= array('id' => $hostservice->id, 'name' => $hostservice->hostname, 'wwwroot' => $hostservice->wwwroot); + } } }