From 0f097239c4b2456d4abca7571902e58e1028b04a Mon Sep 17 00:00:00 2001 From: nicolasconnault Date: Fri, 11 Sep 2009 06:59:30 +0000 Subject: [PATCH] MDL-19823 Fixed un-handled case of emty array in foreach loop --- tag/lib.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tag/lib.php b/tag/lib.php index e5f1ac1ea2..9e9b2fffed 100644 --- a/tag/lib.php +++ b/tag/lib.php @@ -92,6 +92,10 @@ function tag_set($record_type, $record_id, $tags) { } } + if (empty($tags)) { + return true; + } + foreach($tags as $ordering => $tag) { $tag = trim($tag); if (!$tag) { -- 2.39.5