File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -766,8 +766,6 @@ public static function ConvertHtmlToPlain($sText)
766766 '/<th[^>]*>(.+?)<\/th>/i ' ,
767767 '/ /i ' ,
768768 '/"/i ' ,
769- '/>/i ' ,
770- '/</i ' ,
771769 '/&/i ' ,
772770 '/©/i ' ,
773771 '/™/i ' ,
@@ -810,8 +808,6 @@ public static function ConvertHtmlToPlain($sText)
810808 "\t\\1 \n" ,
811809 ' ' ,
812810 '" ' ,
813- '> ' ,
814- '< ' ,
815811 '& ' ,
816812 '(c) ' ,
817813 '(tm) ' ,
@@ -835,9 +831,18 @@ public static function ConvertHtmlToPlain($sText)
835831
836832 $ sText = str_ireplace ('<div> ' ,"\n<div> " , $ sText );
837833 $ sText = strip_tags ($ sText , '' );
834+
835+ // angle brackets must be replaced after the strip_tags function call to prevent replacing some text after < symbol
836+ $ sText = preg_replace (array (
837+ '/>/i ' ,
838+ '/</i ' ,
839+ ), array (
840+ '> ' ,
841+ '< ' ,
842+ ), $ sText );
843+
838844 $ sText = preg_replace ("/ \n\\s+ \n/ " , "\n" , $ sText );
839845 $ sText = preg_replace ("/[ \n]{3,}/ " , "\n\n" , $ sText );
840-
841846 return trim ($ sText );
842847 }
843848
You can’t perform that action at this time.
0 commit comments