- Timestamp:
- 04/28/06 05:25:50 (3 years ago)
- Location:
- branches/magpie-hacks
- Files:
-
- 25 added
- 2 modified
-
MagpieTests/TestCases/WellFormed/atom/entry_summary.xml (added)
-
MagpieTests/TestCases/WellFormed/atom/entry_summary_base64.xml (added)
-
MagpieTests/TestCases/WellFormed/atom/entry_summary_base64_2.xml (added)
-
MagpieTests/TestCases/WellFormed/atom/entry_summary_content_mode_base64.xml (added)
-
MagpieTests/TestCases/WellFormed/atom/entry_summary_content_mode_escaped.xml (added)
-
MagpieTests/TestCases/WellFormed/atom/entry_summary_content_type_text_plain.xml (added)
-
MagpieTests/TestCases/WellFormed/atom/entry_summary_content_value.xml (added)
-
MagpieTests/TestCases/WellFormed/atom/entry_summary_escaped_markup.xml (added)
-
MagpieTests/TestCases/WellFormed/atom/entry_summary_inline_markup.xml (added)
-
MagpieTests/TestCases/WellFormed/atom/entry_summary_inline_markup_2.xml (added)
-
MagpieTests/TestCases/WellFormed/atom/entry_summary_naked_markup.xml (added)
-
MagpieTests/TestCases/WellFormed/atom/entry_summary_text_plain.xml (added)
-
MagpieTests/TestCases/WellFormed/atom/entry_title.xml (added)
-
MagpieTests/TestCases/WellFormed/atom/entry_title_base64.xml (added)
-
MagpieTests/TestCases/WellFormed/atom/entry_title_base64_2.xml (added)
-
MagpieTests/TestCases/WellFormed/atom/entry_title_content_mode_base64.xml (added)
-
MagpieTests/TestCases/WellFormed/atom/entry_title_content_mode_escaped.xml (added)
-
MagpieTests/TestCases/WellFormed/atom/entry_title_content_type_text_plain.xml (added)
-
MagpieTests/TestCases/WellFormed/atom/entry_title_content_value.xml (added)
-
MagpieTests/TestCases/WellFormed/atom/entry_title_escaped_markup.xml (added)
-
MagpieTests/TestCases/WellFormed/atom/entry_title_inline_markup.xml (added)
-
MagpieTests/TestCases/WellFormed/atom/entry_title_inline_markup_2.xml (added)
-
MagpieTests/TestCases/WellFormed/atom/entry_title_naked_markup.xml (added)
-
MagpieTests/TestCases/WellFormed/atom/entry_title_text_plain.xml (added)
-
MagpieTests/TestCases/WellFormed/atom/entry_title_text_plain_brackets.xml (added)
-
MagpieTests/runTests.php (modified) (1 diff)
-
rss_parse.inc (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/magpie-hacks/MagpieTests/runTests.php
r1455 r1457 1 1 <?php 2 2 /* vim: set expandtab tabstop=4 shiftwidth=4: */ 3 3 /* 4 4 * Project: MagpieRSS: a simple RSS integration tool -
branches/magpie-hacks/rss_parse.inc
r1415 r1457 65 65 66 66 var $incontent = array(); // non-empty if in namespaced XML content field 67 var $base64 = false; // true when Atom 1.0 mode="base64" 67 68 var $exclude_top = false; // true when Atom 1.0 type="xhtml" 68 69 … … 292 293 $this->exclude_top = false; 293 294 } 295 if (isset($attrs['mode']) and trim(strtolower($attrs['mode'])) == 'base64') { 296 $this->base64 = true; 297 } 294 298 } 295 299 # Handle inline XHTML body elements --CWJ … … 336 340 337 341 function feed_cdata ($p, $text) { 338 339 342 if ($this->incontent) { 340 $this->append_content( $text ); 341 } 342 else { 343 if ($this->base64) { 344 $this->append_content(base64_decode($text)); 345 } else { 346 $this->append_content( $text ); 347 } 348 } else { 343 349 $current_el = join('_', array_reverse($this->stack)); 344 350 $this->append($current_el, $text); … … 352 358 $opener = array_pop($this->incontent); 353 359 360 if ($this->base64) { 361 $this->base64 = false; 362 } 354 363 // Don't get bamboozled by namespace voodoo 355 364 if (strpos($el, ':')) { list($ns, $closer) = split(':', $el); } … … 653 662 $this->normalize_element($item, 'modified', $item, 'updated'); 654 663 $this->normalize_element($item, 'issued', $item, 'published'); 664 $this->normalize_element($item, 'id', $item, 'guid'); 655 665 } else { 656 666 $this->normalize_element($item, 'updated', $item, 'modified'); 657 $this->normalize_element($item, ' published', $item, 'issued');667 $this->normalize_element($item, 'id', $item, 'guid'); 658 668 } 659 669 … … 674 684 $author = "author"; 675 685 } 676 677 $item["author#"] = $source["{$author}#"]; 678 for ($au = 1; $au <= $item["author#"]; $au++) { 679 $id_to = $this->element_id('author', $au); 680 $id_from = $this->element_id($author, $au); 681 682 $item[$id_to] = $source[$id_from]; 683 foreach (array('name', 'email', 'uri', 'url') as $what) { 684 if (isset($source["{$id_from}_{$what}"])) { 685 $item["{$id_to}_{$what}"] = $source["{$id_from}_{$what}"]; 686 } 686 687 if (isset($source)) { 688 $item["author#"] = $source["{$author}#"]; 689 for ($au = 1; $au <= $item["author#"]; $au++) { 690 $id_to = $this->element_id('author', $au); 691 $id_from = $this->element_id($author, $au); 692 693 $item[$id_to] = $source[$id_from]; 694 foreach (array('name', 'email', 'uri', 'url') as $what) { 695 if (isset($source["{$id_from}_{$what}"])) { 696 $item["{$id_to}_{$what}"] = $source["{$id_from}_{$what}"]; 697 } 698 } 687 699 } 688 700 } … … 705 717 706 718 // Normalized item timestamp 707 $atom_date = (isset($item['published']) ) ? $item['published'] : $item['updated']; 719 $atom_date = (isset($item['published']) ) ? $item['published'] : 720 ((isset($item['updated']) ) ? $item['updated'] : ""); 708 721 if ( $atom_date ) { 709 722 $epoch = @parse_w3cdtf($atom_date);
