Skip to content

Commit 30d911c

Browse files
committed
Fix php8.2 deprecation
- mb_strwidth(): Passing null to parameter laravel#1 ($string) of type string is deprecated
1 parent 1a02051 commit 30d911c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Illuminate/Support/Str.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -713,6 +713,10 @@ public static function length($value, $encoding = null)
713713
*/
714714
public static function limit($value, $limit = 100, $end = '...', $preserveWords = false)
715715
{
716+
if ($value === null) {
717+
return $value;
718+
}
719+
716720
if (mb_strwidth($value, 'UTF-8') <= $limit) {
717721
return $value;
718722
}

0 commit comments

Comments
 (0)