| Línea 1... |
Línea 1... |
| 1 |
<?php
|
1 |
<?php
|
| Línea 2... |
Línea -... |
| 2 |
|
- |
|
| 3 |
declare(strict_types=1);
|
2 |
|
| 4 |
/**
|
3 |
/**
|
| 5 |
* SimplePie
|
4 |
* SimplePie
|
| 6 |
*
|
5 |
*
|
| 7 |
* A PHP-Based RSS and Atom Feed Framework.
|
6 |
* A PHP-Based RSS and Atom Feed Framework.
|
| Línea 149... |
Línea 148... |
| 149 |
// Create the parser
|
148 |
// Create the parser
|
| 150 |
if ($xml_is_sane) {
|
149 |
if ($xml_is_sane) {
|
| 151 |
$xml = xml_parser_create_ns($this->encoding, $this->separator);
|
150 |
$xml = xml_parser_create_ns($this->encoding, $this->separator);
|
| 152 |
xml_parser_set_option($xml, XML_OPTION_SKIP_WHITE, 1);
|
151 |
xml_parser_set_option($xml, XML_OPTION_SKIP_WHITE, 1);
|
| 153 |
xml_parser_set_option($xml, XML_OPTION_CASE_FOLDING, 0);
|
152 |
xml_parser_set_option($xml, XML_OPTION_CASE_FOLDING, 0);
|
| 154 |
xml_set_object($xml, $this);
|
- |
|
| 155 |
xml_set_character_data_handler($xml, 'cdata');
|
153 |
xml_set_character_data_handler($xml, [$this, 'cdata']);
|
| 156 |
xml_set_element_handler($xml, 'tag_open', 'tag_close');
|
154 |
xml_set_element_handler($xml, [$this, 'tag_open'], [$this, 'tag_close']);
|
| Línea 157... |
Línea 155... |
| 157 |
|
155 |
|
| 158 |
// Parse!
|
156 |
// Parse!
|
| 159 |
$wrapper = @is_writable(sys_get_temp_dir()) ? 'php://temp' : 'php://memory';
|
157 |
$wrapper = @is_writable(sys_get_temp_dir()) ? 'php://temp' : 'php://memory';
|
| 160 |
if (($stream = fopen($wrapper, 'r+')) &&
|
158 |
if (($stream = fopen($wrapper, 'r+')) &&
|
| Línea 301... |
Línea 299... |
| 301 |
}
|
299 |
}
|
| 302 |
}
|
300 |
}
|
| 303 |
$this->data['data'] .= '>';
|
301 |
$this->data['data'] .= '>';
|
| 304 |
}
|
302 |
}
|
| 305 |
} else {
|
303 |
} else {
|
| 306 |
$this->datas[] =& $this->data;
|
304 |
$this->datas[] = &$this->data;
|
| 307 |
$this->data =& $this->data['child'][end($this->namespace)][end($this->element)][];
|
305 |
$this->data = &$this->data['child'][end($this->namespace)][end($this->element)][];
|
| 308 |
$this->data = ['data' => '', 'attribs' => $attribs, 'xml_base' => end($this->xml_base), 'xml_base_explicit' => end($this->xml_base_explicit), 'xml_lang' => end($this->xml_lang)];
|
306 |
$this->data = ['data' => '', 'attribs' => $attribs, 'xml_base' => end($this->xml_base), 'xml_base_explicit' => end($this->xml_base_explicit), 'xml_lang' => end($this->xml_lang)];
|
| 309 |
if ((end($this->namespace) === \SimplePie\SimplePie::NAMESPACE_ATOM_03 && in_array(end($this->element), ['title', 'tagline', 'copyright', 'info', 'summary', 'content']) && isset($attribs['']['mode']) && $attribs['']['mode'] === 'xml')
|
307 |
if ((end($this->namespace) === \SimplePie\SimplePie::NAMESPACE_ATOM_03 && in_array(end($this->element), ['title', 'tagline', 'copyright', 'info', 'summary', 'content']) && isset($attribs['']['mode']) && $attribs['']['mode'] === 'xml')
|
| 310 |
|| (end($this->namespace) === \SimplePie\SimplePie::NAMESPACE_ATOM_10 && in_array(end($this->element), ['rights', 'subtitle', 'summary', 'info', 'title', 'content']) && isset($attribs['']['type']) && $attribs['']['type'] === 'xhtml')
|
308 |
|| (end($this->namespace) === \SimplePie\SimplePie::NAMESPACE_ATOM_10 && in_array(end($this->element), ['rights', 'subtitle', 'summary', 'info', 'title', 'content']) && isset($attribs['']['type']) && $attribs['']['type'] === 'xhtml')
|
| 311 |
|| (end($this->namespace) === \SimplePie\SimplePie::NAMESPACE_RSS_20 && in_array(end($this->element), ['title']))
|
309 |
|| (end($this->namespace) === \SimplePie\SimplePie::NAMESPACE_RSS_20 && in_array(end($this->element), ['title']))
|
| 312 |
|| (end($this->namespace) === \SimplePie\SimplePie::NAMESPACE_RSS_090 && in_array(end($this->element), ['title']))
|
310 |
|| (end($this->namespace) === \SimplePie\SimplePie::NAMESPACE_RSS_090 && in_array(end($this->element), ['title']))
|
| Línea 332... |
Línea 330... |
| 332 |
if (end($this->namespace) === \SimplePie\SimplePie::NAMESPACE_XHTML && !in_array(end($this->element), ['area', 'base', 'basefont', 'br', 'col', 'frame', 'hr', 'img', 'input', 'isindex', 'link', 'meta', 'param'])) {
|
330 |
if (end($this->namespace) === \SimplePie\SimplePie::NAMESPACE_XHTML && !in_array(end($this->element), ['area', 'base', 'basefont', 'br', 'col', 'frame', 'hr', 'img', 'input', 'isindex', 'link', 'meta', 'param'])) {
|
| 333 |
$this->data['data'] .= '</' . end($this->element) . '>';
|
331 |
$this->data['data'] .= '</' . end($this->element) . '>';
|
| 334 |
}
|
332 |
}
|
| 335 |
}
|
333 |
}
|
| 336 |
if ($this->current_xhtml_construct === -1) {
|
334 |
if ($this->current_xhtml_construct === -1) {
|
| 337 |
$this->data =& $this->datas[count($this->datas) - 1];
|
335 |
$this->data = &$this->datas[count($this->datas) - 1];
|
| 338 |
array_pop($this->datas);
|
336 |
array_pop($this->datas);
|
| 339 |
}
|
337 |
}
|
| Línea 340... |
Línea 338... |
| 340 |
|
338 |
|
| 341 |
array_pop($this->element);
|
339 |
array_pop($this->element);
|