@@ -515,7 +515,8 @@ public function getShortFilteredContent($len = null, $endСharacters = null)
515
515
/* Skip <style> tags at the begining of string in calculations */
516
516
$ sp1 = mb_strpos ($ content , '<style> ' );
517
517
if (false !== $ sp1 ) {
518
- $ cc = preg_replace ("~\<style(.*)\>(.*)\<\/style\>~ " , " " , $ content ); /* remove style tag */
518
+ $ stylePattern = "~\<style(.*)\>(.*)\<\/style\>~ " ;
519
+ $ cc = preg_replace ($ stylePattern , '' , $ content ); /* remove style tag */
519
520
$ sp2 = mb_strpos ($ content , '</style> ' );
520
521
521
522
while (false !== $ sp1 && false !== $ sp2 && $ sp1 < $ sp2 && $ sp2 > $ len && $ sp1 < $ len ) {
@@ -536,16 +537,16 @@ public function getShortFilteredContent($len = null, $endСharacters = null)
536
537
$ cc = $ content ;
537
538
}
538
539
539
- /* Skip long Html */
540
+ /* Skip long HTML */
540
541
$ stcc = trim (strip_tags ($ cc ));
541
- if ($ stcc && strlen ($ stcc ) < strlen ($ cc ) / 3 ) {
542
+ // if ($stcc && strlen($stcc) < strlen($cc) / 3) {
542
543
$ str = '' ;
543
544
$ start = false ;
544
545
foreach (explode (' ' , $ stcc ) as $ s ) {
545
546
$ str .= ($ str ? ' ' : '' ) . $ s ;
546
547
547
548
548
- $ pos = mb_strpos ($ content , $ str , $ len );
549
+ $ pos = mb_strpos ($ content , $ str , $ len );
549
550
if (false !== $ pos ) {
550
551
$ start = $ pos ;
551
552
} else {
@@ -558,10 +559,9 @@ public function getShortFilteredContent($len = null, $endСharacters = null)
558
559
$ len = $ start + $ oLen ;
559
560
}
560
561
}
561
- }
562
+ // }
562
563
}
563
564
564
-
565
565
/* Do not cut words */
566
566
while ($ len < strlen ($ content )
567
567
&& !in_array ($ content [$ len ], [' ' , '< ' , "\t" , "\r" , "\n" ]) ) {
0 commit comments