diff --git a/bl-plugins/rss/plugin.php b/bl-plugins/rss/plugin.php index 207dafe5..f91ebe0a 100644 --- a/bl-plugins/rss/plugin.php +++ b/bl-plugins/rss/plugin.php @@ -32,6 +32,11 @@ class pluginRSS extends Plugin { return $html; } + + private function encodeURL($url) + { + return preg_replace_callback('/[^\x20-\x7f]/', function($match) { return urlencode($match[0]); }, $url); + } private function createXML() { @@ -54,10 +59,11 @@ class pluginRSS extends Plugin { ); $xml = ''; - $xml .= ''; + $xml .= ''; $xml .= ''; + $xml .= ''; $xml .= ''.$site->title().''; - $xml .= ''.$site->url().''; + $xml .= ''.$this->encodeURL($site->url()).''; $xml .= ''.$site->description().''; $xml .= ''.date(DATE_RSS).''; @@ -68,9 +74,9 @@ class pluginRSS extends Plugin { $page = new Page($pageKey); $xml .= ''; $xml .= ''.$page->title().''; - $xml .= ''.$page->permalink().''; + $xml .= ''.$this->encodeURL($page->permalink()).''; $xml .= ''.Sanitize::html($page->contentBreak()).''; - $xml .= ''.$page->date(DATE_RSS).''; + $xml .= ''.date(DATE_RSS,strtotime($page->getValue('dateRaw'))).''; $xml .= ''.$page->uuid().''; $xml .= ''; } catch (Exception $e) {