Skip to content

Commit

Permalink
MDL-19823 Fixed un-handled case of emty array in foreach loop
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasconnault committed Sep 11, 2009
1 parent 0fd3556 commit 0f09723
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tag/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 0f09723

Please sign in to comment.