Skip to content

Commit

Permalink
Added second $encoding parameter to length (#19047)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashley Meadows authored and taylorotwell committed May 5, 2017
1 parent b9aae31 commit 6dfdb4d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Illuminate/Support/Str.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,12 @@ public static function kebab($value)
* Return the length of the given string.
*
* @param string $value
* @param string $encoding
* @return int
*/
public static function length($value)
public static function length($value, $encoding = null)
{
return mb_strlen($value);
return mb_strlen($value, $encoding ?: mb_internal_encoding());
}

/**
Expand Down

0 comments on commit 6dfdb4d

Please sign in to comment.