From d723ff00d89fe85228bcc5a0d2a261444105985e Mon Sep 17 00:00:00 2001 From: markjaquith Date: Sun, 2 Sep 2007 20:42:00 +0000 Subject: [PATCH] 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 --- wp-app.php | 8 ++++++-- wp-includes/atomlib.php | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/wp-app.php b/wp-app.php index 911d5aa3fe..1eb0418ca4 100644 --- a/wp-app.php +++ b/wp-app.php @@ -828,8 +828,12 @@ list($content_type, $content) = $this->prep_content(get_the_content()); ?> xml_parser_free($parser); if (!$code) { - $data = "
$data
"; - return array('xhtml', $data); + if (strpos($data, '<') === false) { + return array('text', $data); + } else { + $data = "
$data
"; + return array('xhtml', $data); + } } if (strpos($data, ']]>') == false) { diff --git a/wp-includes/atomlib.php b/wp-includes/atomlib.php index 352e04e52a..020f0bfcba 100644 --- a/wp-includes/atomlib.php +++ b/wp-includes/atomlib.php @@ -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);