Convert &#[0-9]+ entities to UTF-8
This commit is contained in:
@@ -135,10 +135,13 @@ foreach ( $events as $event):
|
|||||||
$summary = $event->post_title;
|
$summary = $event->post_title;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Convert &#[0-9]+ entities to UTF-8
|
||||||
|
$summary = preg_replace_callback("/(&#[0-9]+;)/", function($m) { return mb_convert_encoding($m[1], "UTF-8", "HTML-ENTITIES"); }, $summary);
|
||||||
|
|
||||||
// Append to output string
|
// Append to output string
|
||||||
$output .=
|
$output .=
|
||||||
"BEGIN:VEVENT\r\n" .
|
"BEGIN:VEVENT\r\n" .
|
||||||
"SUMMARY:" . preg_replace('/([\,;])/','\\\$1', $summary) . "\r\n" .
|
"SUMMARY:" . preg_replace( '/([\,;])/','\\\$1', $summary ) . "\r\n" .
|
||||||
"UID:$event->ID\r\n" .
|
"UID:$event->ID\r\n" .
|
||||||
"STATUS:CONFIRMED\r\n" .
|
"STATUS:CONFIRMED\r\n" .
|
||||||
"DTSTAMP:19700101T000000\r\n".
|
"DTSTAMP:19700101T000000\r\n".
|
||||||
|
|||||||
Reference in New Issue
Block a user