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

git-svn-id: https://develop.svn.wordpress.org/trunk@6010 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Mark Jaquith 2007-09-02 20:42:00 +00:00
parent 187574db35
commit 2c6bb0bd0e
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);
if (!$code) {
$data = "<div xmlns='http://www.w3.org/1999/xhtml'>$data</div>";
return array('xhtml', $data);
if (strpos($data, '<') === false) {
return array('text', $data);
} else {
$data = "<div xmlns='http://www.w3.org/1999/xhtml'>$data</div>";
return array('xhtml', $data);
}
}
if (strpos($data, ']]>') == false) {

View File

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