From d85d717aedbc7690e2a450e40dab8fcebd94b38c Mon Sep 17 00:00:00 2001 From: donncha Date: Tue, 30 Oct 2007 16:49:38 +0000 Subject: Merge with WordPress 2.3.1 git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1139 7be80a69-a1ef-0310-a953-fb0f7c49ff36 --- wp-app.php | 40 +++++++++++++++++++++++++++++++++------- 1 file changed, 33 insertions(+), 7 deletions(-) (limited to 'wp-app.php') diff --git a/wp-app.php b/wp-app.php index dee5cb0..44846a7 100644 --- a/wp-app.php +++ b/wp-app.php @@ -12,7 +12,6 @@ define('APP_REQUEST', true); require_once('./wp-config.php'); require_once(ABSPATH . WPINC . '/post-template.php'); require_once(ABSPATH . WPINC . '/atomlib.php'); -require_once(ABSPATH . WPINC . '/feed.php'); $_SERVER['PATH_INFO'] = preg_replace( '/.*\/wp-app\.php/', '', $_SERVER['REQUEST_URI'] ); @@ -697,7 +696,7 @@ EOD; } function get_feed($page = 1, $post_type = 'post') { - global $post, $wp, $wp_query, $posts, $wpdb, $blog_id; + global $post, $wp, $wp_query, $posts, $wpdb, $blog_id, $post_cache; log_app('function',"get_feed($page, '$post_type')"); ob_start(); @@ -716,6 +715,7 @@ EOD; $wp_query = $GLOBALS['wp_query']; $wpdb = $GLOBALS['wpdb']; $blog_id = (int) $GLOBALS['blog_id']; + $post_cache = $GLOBALS['post_cache']; log_app('function',"query_posts(# " . print_r($wp_query, true) . "#)"); log_app('function',"total_count(# $wp_query->max_num_pages #)"); @@ -739,7 +739,7 @@ EOD; Copyright - +WordPress.com Atom API ATOM_NS ?>" xmlns:app="ATOMPUB_NS ?>" xml:lang=""> ID); ?> - +prep_content(get_the_title()); ?> <?php echo $content ?> @@ -806,7 +806,7 @@ EOD; post_content ) ) : -list($content_type, $content) = prep_atom_text_construct(get_the_content()); ?> +list($content_type, $content) = $this->prep_content(get_the_content()); ?> @@ -814,11 +814,37 @@ list($content_type, $content) = prep_atom_text_construct(get_the_content()); ?> - +prep_content(get_the_excerpt()); ?> ' . $data . '', true); + $code = xml_get_error_code($parser); + xml_parser_free($parser); + + if (!$code) { + if (strpos($data, '<') === false) { + return array('text', $data); + } else { + $data = "
$data
"; + return array('xhtml', $data); + } + } + + if (strpos($data, ']]>') == false) { + return array('html', ""); + } else { + return array('html', htmlspecialchars($data)); + } + } + function ok() { log_app('Status','200: OK'); header('Content-Type: text/plain'); -- cgit