Browse Source

SimplePie : Corrige le cas des </body> et </html>

Corrige https://github.com/marienfressinaud/FreshRSS/issues/159
Les balises fermantes /body et /html n'étaient pas nettoyées par SimplePie.
À tester un moment puis proposer en amont à SimplePie.
Alexandre Alapetite 12 years ago
parent
commit
5923e1a640
1 changed files with 1 additions and 0 deletions
  1. 1 0
      lib/SimplePie/SimplePie/Sanitize.php

+ 1 - 0
lib/SimplePie/SimplePie/Sanitize.php

@@ -379,6 +379,7 @@ class SimplePie_Sanitize
 	protected function preprocess($html, $type)
 	protected function preprocess($html, $type)
 	{
 	{
 		$ret = '';
 		$ret = '';
+		$html = preg_replace('%</?(?:html|body)[^>]*?'.'>%is', '', $html);
 		if ($type & ~SIMPLEPIE_CONSTRUCT_XHTML)
 		if ($type & ~SIMPLEPIE_CONSTRUCT_XHTML)
 		{
 		{
 			// Atom XHTML constructs are wrapped with a div by default
 			// Atom XHTML constructs are wrapped with a div by default