diff --git a/library/ZendAfi/View/Helper/Avis.php b/library/ZendAfi/View/Helper/Avis.php index 60a8e2f28e60a8b4100f1bf5c5946b7f4c84f523..315ba30fbeace3e4dad9d00ffbd3ff4bfd858e93 100644 --- a/library/ZendAfi/View/Helper/Avis.php +++ b/library/ZendAfi/View/Helper/Avis.php @@ -284,30 +284,19 @@ class ZendAfi_View_Helper_Avis extends ZendAfi_View_Helper_BaseHelper { protected function _formatTextAvis($avis) { - return $avis->getAbonOuBib() ? - $this->_formatAdminText($avis) : - $this->_formatWithTruncate($this->view->escape($avis->getAvis())); - } - - - protected function _formatAdminText($avis) { - $value = $avis->getAvis(); - if ($this->_is_html($value) && $this->_limit_nb_word) { - $value = str_replace(['<br>', '<br/>', '<br />'], "\n", $value); - return $this->_formatWithTruncate(strip_tags($value)); - } - - return ['text_avis' => nl2br($value), 'lire_la_suite' => false]; + return $this->_formatWithTruncate($this->view->escape(strip_tags($avis->getAvis()))); } protected function _formatWithTruncate($txt_avis) { if (($this->_limit_nb_word <= 0) || count($words = explode(' ', $txt_avis)) <= $this->_limit_nb_word) - return ['text_avis' => nl2br($txt_avis), 'lire_la_suite' => false]; + return ['text_avis' => nl2br($txt_avis), + 'lire_la_suite' => false]; $txt_avis = implode(' ', array_slice($words, 0, $this->_limit_nb_word)); - return ['text_avis' => nl2br($txt_avis) . ' [...]', 'lire_la_suite' => true]; + return ['text_avis' => nl2br($txt_avis) . ' [...]', + 'lire_la_suite' => true]; }