Browse files

Set default empty array, and check if $array is really an array

  • Loading branch information...
1 parent 7d2d390 commit fe90076adc663e1779c99427b753f037734b51b2 @dixy committed Oct 5, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 system/helpers/array_helper.php
View
4 system/helpers/array_helper.php
@@ -128,11 +128,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 '';
}

0 comments on commit fe90076

Please sign in to comment.