From a994c30ab3a04f14e88b6d9bcf0cdad805ac9bd6 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 24 Apr 2012 10:40:20 -0500 Subject: [PATCH] fixed str::words php notice. --- laravel/str.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/laravel/str.php b/laravel/str.php index dd6a12ac..9bdc9b1c 100644 --- a/laravel/str.php +++ b/laravel/str.php @@ -148,6 +148,8 @@ class Str { */ public static function words($value, $words = 100, $end = '...') { + if (trim((string) $value) == '') return ''; + preg_match('/^\s*+(?:\S++\s*+){1,'.$words.'}/', $value, $matches); if (static::length($value) == static::length($matches[0]))