Browse Source

fixed str::words php notice.

Taylor Otwell 12 years ago
parent
commit
a994c30ab3
1 changed files with 2 additions and 0 deletions
  1. 2 0
      laravel/str.php

+ 2 - 0
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]))