Skip to content

Commit 768ae0e

Browse files
authored
Update ShortContentExtractor.php
1 parent 50fbd63 commit 768ae0e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Model/ShortContentExtractor.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,11 @@ public function execute($content, $len = null, $endCharacters = null)
131131

132132
/* Do not cut words */
133133
while ($len < mb_strlen($content)
134-
&& !in_array($content[$len], [' ', '<', "\t", "\r", "\n"])) {
134+
&& !in_array(mb_substr($content, $len, 1), [' ', '<', "\t", "\r", "\n"])) {
135135
$len++;
136136
}
137137

138-
$content = mb_strcut($content, 0, $len);
138+
$content = mb_substr($content, 0, $len);
139139
try {
140140
$previousErrorState = libxml_use_internal_errors(true);
141141
$dom = new \DOMDocument();

0 commit comments

Comments
 (0)