Escape text titles in AtomParser. Props Sam Ruby. fixes #4892

git-svn-id: http://svn.automattic.com/wordpress/trunk@6010 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
markjaquith 2007-09-02 20:42:00 +00:00
parent 2662be2098
commit d723ff00d8
2 changed files with 7 additions and 3 deletions

View File

@ -828,8 +828,12 @@ list($content_type, $content) = $this->prep_content(get_the_content()); ?>
xml_parser_free($parser); xml_parser_free($parser);
if (!$code) { if (!$code) {
$data = "<div xmlns='http://www.w3.org/1999/xhtml'>$data</div>"; if (strpos($data, '<') === false) {
return array('xhtml', $data); return array('text', $data);
} else {
$data = "<div xmlns='http://www.w3.org/1999/xhtml'>$data</div>";
return array('xhtml', $data);
}
} }
if (strpos($data, ']]>') == false) { if (strpos($data, ']]>') == false) {

View File

@ -203,7 +203,7 @@ class AtomParser {
if(count($c) == 3) { if(count($c) == 3) {
array_push($newcontent, $c[2]); array_push($newcontent, $c[2]);
} else { } else {
if($this->is_xhtml) { if($this->is_xhtml || $this->is_text) {
array_push($newcontent, $this->xml_escape($c)); array_push($newcontent, $this->xml_escape($c));
} else { } else {
array_push($newcontent, $c); array_push($newcontent, $c);