From 0339a12b3d010e237046263052d33527b027398e Mon Sep 17 00:00:00 2001 From: bzick Date: Sat, 31 Jan 2015 19:16:43 +0300 Subject: [PATCH] Fix #116 --- src/Fenom/Modifier.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Fenom/Modifier.php b/src/Fenom/Modifier.php index cf9fc57..8d9439b 100644 --- a/src/Fenom/Modifier.php +++ b/src/Fenom/Modifier.php @@ -107,9 +107,9 @@ class Modifier if (preg_match('#^(.{' . $length . '}).*?(.{' . $length . '})?$#usS', $string, $match)) { if (count($match) == 3) { if ($by_words) { - return preg_replace('#\s.*$#usS', "", $match[1]) . + return preg_replace('#\s\S*$#usS', "", $match[1]) . $etc . - preg_replace('#.*\s#usS', "", $match[2]); + preg_replace('#\s\S*$#usS', "", $match[2]); } else { return $match[1] . $etc . $match[2]; } @@ -118,7 +118,7 @@ class Modifier } else { if (preg_match('#^(.{' . $length . '})#usS', $string, $match)) { if ($by_words) { - return preg_replace('#\s.*$#usS', "", $match[1]) . $etc; + return preg_replace('#\s\S*$#usS', "", $match[1]) . $etc; } else { return $match[1] . $etc; }