@@ -57,7 +57,7 @@ protected function getPostDataForRssItem(SimpleXMLElement $item): array
5757 {
5858 $ date = DateTime::createFromFormat (DateTime::RSS , $ item ->pubDate ?? '' );
5959 $ item = [
60- 'title ' => substr (strval ($ item ->title ?? '' ), 0 , 250 ),
60+ 'title ' => mb_substr (strval ($ item ->title ?? '' ), 0 , 250 ),
6161 'description ' => $ this ->formatDescription (strval ($ item ->description ) ?: '' ),
6262 'url ' => strval ($ item ->link ?? '' ),
6363 'guid ' => strval ($ item ->guid ?? '' ),
@@ -77,7 +77,7 @@ protected function formatDescription(string $description): string
7777 $ decoded = preg_replace ('/\s+/ ' , ' ' , $ decoded );
7878
7979 if (strlen ($ decoded ) > 200 ) {
80- return substr ($ decoded , 0 , 200 ) . '... ' ;
80+ return mb_substr ($ decoded , 0 , 200 ) . '... ' ;
8181 }
8282
8383 return $ decoded ;
@@ -87,7 +87,7 @@ protected function getPostDataForAtomItem(SimpleXMLElement $item): array
8787 {
8888 $ date = new DateTime (strval ($ item ->published ?? $ item ->updated ?? '' ));
8989 return [
90- 'title ' => html_entity_decode (substr (strval ($ item ->title ?? '' ), 0 , 250 )),
90+ 'title ' => html_entity_decode (mb_substr (strval ($ item ->title ?? '' ), 0 , 250 )),
9191 'description ' => $ this ->formatDescription (strval ($ item ->summary ) ?: strval ($ item ->content ) ?: '' ),
9292 'url ' => $ item ->link ? strval ($ item ->link ->attributes ()['href ' ]) : '' ,
9393 'guid ' => strval ($ item ->id ?? '' ),
0 commit comments