From 0de3caf6163b9777b3ddd0e9947a628f07c856e4 Mon Sep 17 00:00:00 2001 From: Simey Lameze Date: Mon, 2 May 2016 11:45:59 +0800 Subject: [PATCH] MDL-54006 tool_uploaduser: check validation result before display warning --- admin/tool/uploaduser/index.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/admin/tool/uploaduser/index.php b/admin/tool/uploaduser/index.php index aaab4611c69..ed5e303092a 100644 --- a/admin/tool/uploaduser/index.php +++ b/admin/tool/uploaduser/index.php @@ -1119,8 +1119,10 @@ if ($formdata = $mform2->is_cancelled()) { } $upt->close(); // close table if (!empty($validation)) { - foreach ($validation as $username => $error) { - \core\notification::warning(get_string('invaliduserdata', 'tool_uploaduser', s($username))); + foreach ($validation as $username => $result) { + if ($result !== true) { + \core\notification::warning(get_string('invaliduserdata', 'tool_uploaduser', s($username))); + } } } $cir->close();