hotline#123841 : fixing RSS Export Format
1 unresolved thread
1 unresolved thread
Merge request reports
Activity
Filter activity
- Resolved by Arthur Suzuki
- Resolved by Arthur Suzuki
- Resolved by Henri-Damien LAURENT
74 . $this->_removeTags($data->getFullContent(),['script', 'style']))); 75 } 76 77 78 protected function _removeTags($html_content,$tags_to_remove){ 79 foreach ($tags_to_remove as $tag_to_remove) 80 $html_content = preg_replace("#\<$tag_to_remove.*\<\/$tag_to_remove\>#", "", $html_content); 81 return $html_content; 77 82 } 78 83 79 84 80 85 protected function getUrlLink($data) { 81 return $this->action->getRequest()->getScheme() . '://' 82 . $this->action->getRequest()->getServer('HTTP_HOST') 83 . $this->_view->url($data->getUrl()); 86 return urlencode($this->action->getRequest()->getScheme() . '://' Pour virer les caractères spéciaux qui pourraient se retrouver interprétés (genre & dans une url) Ca pête le xml du coup
Edited by Henri-Damien LAURENTalors c'est pas urlencode, mais htmlspecialchars:
bokeh>echo urlencode('http://test.fr?g=pouet&p=tutu'); echo urlencode('http://test.fr?g=pouet&p=tutu'); http%3A%2F%2Ftest.fr%3Fg%3Dpouet%26p%3Dtutu bokeh>echo htmlspecialchars('http://test.fr?g=pouet&p=tutu', ENT_XML1); echo htmlspecialchars('http://test.fr?g=pouet&p=tutu', ENT_XML1); http://test.fr?g=pouet&p=tutu
mais ce qui me semble encore plus étrange c'est que ça a l'air déjà géré par Zend_Feed / DOMDocument non ?
class Zend_Feed_Atom .... public function saveXml() { // Return a complete document including XML prologue. $doc = new DOMDocument($this->_element->ownerDocument->version, $this->_element->ownerDocument->actualEncoding); $doc->appendChild($doc->importNode($this->_element, true)); $doc->formatOutput = true; return $doc->saveXML(); }
changed this line in version 6 of the diff
mentioned in commit 5aea854b