diff --git a/VERSIONS_HOTLINE/17453_decode_html_entities_in_rss_feed.txt b/VERSIONS_HOTLINE/17453_decode_html_entities_in_rss_feed.txt new file mode 100644 index 0000000000000000000000000000000000000000..cc4f2d172b67b07374543c3ba50f49cabc44bff4 --- /dev/null +++ b/VERSIONS_HOTLINE/17453_decode_html_entities_in_rss_feed.txt @@ -0,0 +1 @@ +- ticket #17453: compatibilité lecteurs RSS - les flux RSS des boîtes articles et calendrier décodent les entités HTML (rend é au lieu de é). diff --git a/application/modules/opac/controllers/CmsController.php b/application/modules/opac/controllers/CmsController.php index 28c8c460eb4996df382567a060a6dbcafa7d2c93..f018035928860a15952bb9a9121e745daef4eee9 100644 --- a/application/modules/opac/controllers/CmsController.php +++ b/application/modules/opac/controllers/CmsController.php @@ -319,16 +319,17 @@ class CmsController extends Zend_Controller_Action { * @param array $rss_array */ private function _renderRSS($articles, $rss_array) { - $entries = array(); + $entries = []; foreach ($articles as $article) { - $entries[] = array( - 'title' => $article->getTitre(), - 'link' => $this->_request->getScheme() . '://' - . $this->_request->getServer('HTTP_HOST') - . $this->view->url($article->getUrl()), - 'description' => Class_CmsUrlTransformer::imgUrlRelativeToAbsolute($article->getFullContent()), - 'lastUpdate' => strtotime($article->getDateMaj()) - ); + $entries[] = + [ + 'title' => html_entity_decode($article->getTitre()), + 'link' => $this->_request->getScheme() . '://' + . $this->_request->getServer('HTTP_HOST') + . $this->view->url($article->getUrl()), + 'description' => html_entity_decode(Class_CmsUrlTransformer::imgUrlRelativeToAbsolute($article->getFullContent())), + 'lastUpdate' => strtotime($article->getDateMaj()) + ]; } $rss_array['entries'] = $entries; diff --git a/tests/application/modules/opac/controllers/CmsControllerTest.php b/tests/application/modules/opac/controllers/CmsControllerTest.php index b17807535e7e56968b0d11696ec161a5dbb86507..c450b1f1de5f0e2361d72b9ac234da252e754b70 100644 --- a/tests/application/modules/opac/controllers/CmsControllerTest.php +++ b/tests/application/modules/opac/controllers/CmsControllerTest.php @@ -159,8 +159,8 @@ class CmsControllerRssWithProfileAndArticle extends AbstractControllerTestCase { ->answers(array( Class_Article::getLoader() ->newInstanceWithId(1) - ->setTitre('La fête de la banane') - ->setContenu('Une fête qui glisse !'), + ->setTitre('La fête de la banane') + ->setContenu('Une fête qui glisse !'), Class_Article::getLoader() ->newInstanceWithId(2) ->setTitre('La fête de la frite')