Changeset 6273 for trunk/wp-app.php
- Timestamp:
- 10/19/2007 03:42:30 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/wp-app.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-app.php
r6229 r6273 13 13 require_once(ABSPATH . WPINC . '/post-template.php'); 14 14 require_once(ABSPATH . WPINC . '/atomlib.php'); 15 require_once(ABSPATH . WPINC . '/feed.php'); 15 16 16 17 $_SERVER['PATH_INFO'] = preg_replace( '/.*\/wp-app\.php/', '', $_SERVER['REQUEST_URI'] ); … … 785 786 xmlns:app="<?php echo $this->ATOMPUB_NS ?>" xml:lang="<?php echo get_option('rss_language'); ?>"> 786 787 <id><?php the_guid($GLOBALS['post']->ID); ?></id> 787 <?php list($content_type, $content) = $this->prep_content(get_the_title()); ?>788 <?php list($content_type, $content) = prep_atom_text_construct(get_the_title()); ?> 788 789 <title type="<?php echo $content_type ?>"><?php echo $content ?></title> 789 790 <updated><?php echo get_post_modified_time('Y-m-d\TH:i:s\Z', true); ?></updated> … … 806 807 <link href="<?php the_permalink_rss() ?>" /> 807 808 <?php if ( strlen( $GLOBALS['post']->post_content ) ) : 808 list($content_type, $content) = $this->prep_content(get_the_content()); ?>809 list($content_type, $content) = prep_atom_text_construct(get_the_content()); ?> 809 810 <content type="<?php echo $content_type ?>"><?php echo $content ?></content> 810 811 <?php endif; ?> … … 814 815 <category scheme="<?php bloginfo_rss('home') ?>" term="<?php echo $category->name?>" /> 815 816 <?php } ?> 816 <?php list($content_type, $content) = $this->prep_content(get_the_excerpt()); ?>817 <?php list($content_type, $content) = prep_atom_text_construct(get_the_excerpt()); ?> 817 818 <summary type="<?php echo $content_type ?>"><?php echo $content ?></summary> 818 819 </entry> 819 820 <?php } 820 821 function prep_content($data) {822 if (strpos($data, '<') === false && strpos($data, '&') === false) {823 return array('text', $data);824 }825 826 $parser = xml_parser_create();827 xml_parse($parser, '<div>' . $data . '</div>', true);828 $code = xml_get_error_code($parser);829 xml_parser_free($parser);830 831 if (!$code) {832 if (strpos($data, '<') === false) {833 return array('text', $data);834 } else {835 $data = "<div xmlns='http://www.w3.org/1999/xhtml'>$data</div>";836 return array('xhtml', $data);837 }838 }839 840 if (strpos($data, ']]>') == false) {841 return array('html', "<![CDATA[$data]]>");842 } else {843 return array('html', htmlspecialchars($data));844 }845 }846 821 847 822 function ok() {
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)