@@ -40,18 +40,13 @@ function tootpress_paint_toot( $mastodon_id, $date, $content, $media , $instance
4040 $ toot_html .=tootpress_paint_elephant ( $ instance , $ account , $ mastodon_id ,$ backlink );
4141
4242 // Toot Date
43- if (tootpress_is_language_german ()) {
44- $ date =tootpress_convert_mysqldate_to_german_format ($ date );
45- } else {
46- $ date =tootpress_convert_mysqldate_to_international_format ($ date );
47- }
48-
49- $ toot_html .='<div class="toot-date"><p> ' .esc_html ($ date ).'</p></div> ' ;
43+ $ toot_html .=tootpress_paint_date ($ date );
5044
5145 // Toot Content
5246 $ content =tootpress_remove_target_blank ($ content );
47+ $ content =wp_kses ($ content , tootpress_escaping_allowed_html () );
5348 $ content =tootpress_toot_content_filter_apply ($ content );
54- $ toot_html .='<div class="toot-content"> ' .wp_kses ( $ content, tootpress_escaping_allowed_html () ) .'</div> ' ;
49+ $ toot_html .='<div class="toot-content"> ' .$ content .'</div> ' ;
5550
5651 // Toot Image
5752 if ($ media ){
@@ -157,6 +152,38 @@ function tootpress_paint_elephant( $instance, $account, $mastodon_id, $backlink)
157152
158153}
159154
155+ /**
156+ * Paint the Date
157+ *
158+ * @since 0.5
159+ *
160+ * @param string Date (Format: )
161+ * @return string html
162+ */
163+
164+ function tootpress_paint_date ($ date ) {
165+
166+ // 2023-05-30 22:40:28
167+
168+ $ mysqldate =$ date ;
169+
170+ $ date =tootpress_date_filter_apply ($ date );
171+
172+ if ($ mysqldate ==$ date ) {
173+
174+ if (tootpress_is_language_german ()) {
175+ $ date =tootpress_convert_mysqldate_to_german_format ($ date );
176+ } else {
177+ $ date =tootpress_convert_mysqldate_to_international_format ($ date );
178+ }
179+
180+ }
181+
182+ $ date_html .='<div class="toot-date"><p> ' .esc_html ($ date ).'</p></div> ' ;
183+ return $ date_html ;
184+
185+ }
186+
160187/**
161188 * Creates the Preamble
162189 *
0 commit comments