浏览代码

Merge pull request #813 from Alkarex/SimplePieDecodeMaybeHTML

SimplePie: decode special chars for MAYBE_HTML
Alexis Degrugillier 11 年之前
父节点
当前提交
2a0d04dd0e
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      lib/SimplePie/SimplePie/Sanitize.php

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

@@ -249,6 +249,7 @@ class SimplePie_Sanitize
 		{
 		{
 			if ($type & SIMPLEPIE_CONSTRUCT_MAYBE_HTML)
 			if ($type & SIMPLEPIE_CONSTRUCT_MAYBE_HTML)
 			{
 			{
+				$data = htmlspecialchars_decode($data, ENT_QUOTES);	//FreshRSS 
 				if (preg_match('/(&(#(x[0-9a-fA-F]+|[0-9]+)|[a-zA-Z0-9]+)|<\/[A-Za-z][^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3E]*' . SIMPLEPIE_PCRE_HTML_ATTRIBUTE . '>)/', $data))
 				if (preg_match('/(&(#(x[0-9a-fA-F]+|[0-9]+)|[a-zA-Z0-9]+)|<\/[A-Za-z][^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3E]*' . SIMPLEPIE_PCRE_HTML_ATTRIBUTE . '>)/', $data))
 				{
 				{
 					$type |= SIMPLEPIE_CONSTRUCT_HTML;
 					$type |= SIMPLEPIE_CONSTRUCT_HTML;