1 |
diff -r -c library/magpierss-clean/rss_parse.inc library/magpierss-local/rss_parse.inc |
2 |
*** library/magpierss-clean/rss_parse.inc Tue Nov 23 17:15:20 2004 |
3 |
--- library/magpierss-local/rss_parse.inc Wed Dec 14 22:12:22 2005 |
4 |
*************** |
5 |
*** 63,68 **** |
6 |
--- 63,72 ---- |
7 |
var $current_field = ''; |
8 |
var $current_namespace = false; |
9 |
|
10 |
+ // accumulated XML source |
11 |
+ var $channel_xml = ''; |
12 |
+ var $current_item_xml = ''; |
13 |
+ |
14 |
|
15 |
/** |
16 |
* Set up XML parser, parse source, and return populated RSS object.. |
17 |
*************** |
18 |
*** 254,265 **** |
19 |
--- 258,295 ---- |
20 |
else { |
21 |
array_unshift($this->stack, $el); |
22 |
} |
23 |
+ |
24 |
+ if($this->initem) { |
25 |
+ $this->current_item_xml .= '<'.$element; |
26 |
+ |
27 |
+ foreach($attrs as $name => $value) |
28 |
+ $this->current_item_xml .= ' '.$name.'="'.htmlspecialchars($value).'"'; |
29 |
+ |
30 |
+ $this->current_item_xml .= '>'; |
31 |
+ |
32 |
+ } elseif($this->inchannel) { |
33 |
+ $this->channel_xml .= '<'.$element; |
34 |
+ |
35 |
+ foreach($attrs as $name => $value) |
36 |
+ $this->channel_xml .= ' '.$name.'="'.htmlspecialchars($value).'"'; |
37 |
+ |
38 |
+ $this->channel_xml .= '>'; |
39 |
+ |
40 |
+ } |
41 |
} |
42 |
|
43 |
|
44 |
|
45 |
function feed_cdata ($p, $text) { |
46 |
|
47 |
+ if($this->initem) { |
48 |
+ $this->current_item_xml .= htmlspecialchars($text); |
49 |
+ |
50 |
+ } elseif($this->inchannel) { |
51 |
+ $this->channel_xml .= htmlspecialchars($text); |
52 |
+ |
53 |
+ } |
54 |
+ |
55 |
if ($this->feed_type == ATOM and $this->incontent) |
56 |
{ |
57 |
$this->append_content( $text ); |
58 |
*************** |
59 |
*** 273,280 **** |
60 |
--- 303,320 ---- |
61 |
function feed_end_element ($p, $el) { |
62 |
$el = strtolower($el); |
63 |
|
64 |
+ if($this->initem) { |
65 |
+ $this->current_item_xml .= "</{$el}>"; |
66 |
+ |
67 |
+ } elseif($this->inchannel) { |
68 |
+ $this->channel_xml .= "</{$el}>"; |
69 |
+ |
70 |
+ } |
71 |
+ |
72 |
if ( $el == 'item' or $el == 'entry' ) |
73 |
{ |
74 |
+ $this->current_item['xml'] = $this->current_item_xml; |
75 |
+ $this->current_item_xml = ''; |
76 |
$this->items[] = $this->current_item; |
77 |
$this->current_item = array(); |
78 |
$this->initem = false; |
79 |
*************** |
80 |
*** 293,298 **** |
81 |
--- 333,340 ---- |
82 |
} |
83 |
elseif ($el == 'channel' or $el == 'feed' ) |
84 |
{ |
85 |
+ $this->channel['xml'] = $this->channel_xml; |
86 |
+ $this->channel_xml = ''; |
87 |
$this->inchannel = false; |
88 |
} |
89 |
elseif ($this->feed_type == ATOM and $this->incontent ) { |