Skip to content

Commit

Permalink
Ensure all $args to csvToArray() are strings (#5223)
Browse files Browse the repository at this point in the history
  • Loading branch information
claudiu-cristea committed Sep 7, 2022
1 parent 8e4b72a commit 0e332eb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Utils/StringUtils.php
Expand Up @@ -22,7 +22,8 @@ public static function csvToArray($args): array
// Step 4: array_map(...) trims extra whitespace from each item
// (handles csv strings with extra whitespace, e.g. 'a, b, c')
//
return array_map('trim', array_filter(explode(',', is_array($args) ? implode(',', $args) : $args)));
$args = is_array($args) ? implode(',', array_map('strval', $args)) : (string) $args;
return array_map('trim', array_filter(explode(',', $args)));
}

/**
Expand Down

0 comments on commit 0e332eb

Please sign in to comment.