Browse code

Fix another teaser is null issue

Benjamin Roth authored on08/09/2023 10:06:36
Showing2 changed files
... ...
@@ -101,7 +101,7 @@ class SendNewsNotificationJob
101 101
                                     'date' => date('d.m.Y',$item['date']),
102 102
                                     'headline' => $item['headline'],
103 103
                                     'teaser' => $item['teaser'] ? StringUtil::substr(strip_tags(str_ireplace(array('<br />','<br>','<br/>','</p>','<p>'),' ',$item['teaser'])),128) : '',
104
-                                    'text_plain' => $strText ? strip_tags(str_ireplace(array('<br />','<br>','<br/>','</p>','<p>'),' ',$strText)) : strip_tags(str_ireplace(array('<br />','<br>','<br/>','</p>','<p>'),' ',$item['teaser'])),
104
+                                    'text_plain' => $strText ? strip_tags(str_ireplace(array('<br />','<br>','<br/>','</p>','<p>'),' ',$strText)) : ($item['teaser'] ? strip_tags(str_ireplace(array('<br />','<br>','<br/>','</p>','<p>'),' ',$item['teaser'])) : ''),
105 105
                                     'text_html' => $strText ?: $item['teaser']
106 106
                                 );
107 107
 
... ...
@@ -62,7 +62,7 @@ class NewsSendTestmailListener
62 62
                     'date' => date('d.m.Y',$News->date),
63 63
                     'headline' => $News->headline,
64 64
                     'teaser' => $News->teaser ? StringUtil::substr(strip_tags(str_ireplace(array('<br />','<br>','<br/>','</p>','<p>'),' ',$News->teaser)),128) : '',
65
-                    'text_plain' => $strText ? strip_tags(str_ireplace(array('<br />','<br>','<br/>','</p>','<p>'),' ',$strText)) : strip_tags(str_ireplace(array('<br />','<br>','<br/>','</p>','<p>'),' ',$News->teaser)),
65
+                    'text_plain' => $strText ? strip_tags(str_ireplace(array('<br />','<br>','<br/>','</p>','<p>'),' ',$strText)) : ($News->teaser ? strip_tags(str_ireplace(array('<br />','<br>','<br/>','</p>','<p>'),' ',$News->teaser)) : ''),
66 66
                     'text_html' => $strText ?: $News->teaser
67 67
                 );
68 68