Skip to content

Commit

Permalink
Set default empty array, and check if $array is really an array
Browse files Browse the repository at this point in the history
  • Loading branch information
dixy committed Apr 18, 2012
1 parent 8066cd9 commit 4b9adcb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions system/helpers/array_helper.php
Expand Up @@ -115,11 +115,11 @@ function elements($items, $array, $default = FALSE)
*/
if ( ! function_exists('array_to_str'))
{
function array_to_str($array, $sep = ', ', $sep_last = '')
function array_to_str($array = array(), $sep = ', ', $sep_last = '')
{
$return = '';

if ( ! $array)
if (empty($array) OR ! is_array($array))
{
return '';
}
Expand Down

0 comments on commit 4b9adcb

Please sign in to comment.