mirror of
https://github.com/fenom-template/fenom.git
synced 2023-08-10 21:13:07 +03:00
Fix #116
This commit is contained in:
parent
e310236745
commit
0339a12b3d
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user