Commit 184e7619 authored by bgm's avatar bgm Committed by Aegir user

ops#807: Remove empty tags from the feed, causes fatal errors with the News dashlet.

parent d0a3ff33
......@@ -28,6 +28,13 @@ function civicrm_org_newsfeed_rss_page() {
foreach ($view->display as $display) {
if ($display->display_plugin == 'feed' && (!isset($display->display_options['enabled']) || $display->display_options['enabled'])) {
$content = views_embed_view($view_name, $display->id);
// Remove empty tags
// See: https://lab.civicrm.org/infrastructure/ops/issues/807
$content = preg_replace('/<pubDate \/>/', '', $content);
$content = preg_replace('/<dc:creator \/>/', '', $content);
$content = preg_replace('/<guid isPermaLink="false" \/>/', '', $content);
// Omit the outer wrappers
$content = substr($content, strpos($content, '<channel'));
$output .= substr($content, 0, strpos($content, '</rss'));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment