@@ -72,7 +72,7 @@ public static function truncateHtml($text, $length = 100, $ending = '...', $exac
7272 // delete tag from $open_tags list
7373 $ pos = array_search ($ tag_matchings [1 ], $ open_tags );
7474 if ($ pos !== false ) {
75- unset($ open_tags [$ pos ]);
75+ unset($ open_tags [$ pos ]);
7676 }
7777 // if tag is an opening tag
7878 } else if (preg_match ('/^<\s*([^\s>!]+).*?>$/s ' , $ line_matchings [1 ], $ tag_matchings )) {
@@ -102,14 +102,14 @@ public static function truncateHtml($text, $length = 100, $ending = '...', $exac
102102 }
103103 }
104104 $ truncate .= substr ($ line_matchings [2 ], 0 , $ left +$ entities_length );
105- // maximum lenght is reached, so get off the loop
105+ // maximum length is reached, so get off the loop
106106 break ;
107107 } else {
108108 $ truncate .= $ line_matchings [2 ];
109109 $ total_length += $ content_length ;
110110 }
111111 // if the maximum length is reached, get off the loop
112- if ($ total_length >= $ length ) {
112+ if ($ total_length >= $ length ) {
113113 break ;
114114 }
115115 }
@@ -131,7 +131,7 @@ public static function truncateHtml($text, $length = 100, $ending = '...', $exac
131131 }
132132 // add the defined ending to the text
133133 $ truncate .= $ ending ;
134- if ($ considerHtml ) {
134+ if ($ considerHtml ) {
135135 // close all unclosed html-tags
136136 foreach ($ open_tags as $ tag ) {
137137 $ truncate .= '</ ' . $ tag . '> ' ;
0 commit comments