|
@@ -319,54 +319,54 @@ class RssParser
|
|
|
//var_dump($rss);
|
|
|
if (!empty($conf->global->EXTERNALRSS_USE_SIMPLEXML)) {
|
|
|
if (!empty($rss->channel->language)) {
|
|
|
- $this->_language = (string) $rss->channel->language;
|
|
|
+ $this->_language = sanitizeVal((string) $rss->channel->language);
|
|
|
}
|
|
|
if (!empty($rss->channel->generator)) {
|
|
|
- $this->_generator = (string) $rss->channel->generator;
|
|
|
+ $this->_generator = sanitizeVal((string) $rss->channel->generator);
|
|
|
}
|
|
|
if (!empty($rss->channel->copyright)) {
|
|
|
- $this->_copyright = (string) $rss->channel->copyright;
|
|
|
+ $this->_copyright = sanitizeVal((string) $rss->channel->copyright);
|
|
|
}
|
|
|
if (!empty($rss->channel->lastbuilddate)) {
|
|
|
- $this->_lastbuilddate = (string) $rss->channel->lastbuilddate;
|
|
|
+ $this->_lastbuilddate = sanitizeVal((string) $rss->channel->lastbuilddate);
|
|
|
}
|
|
|
if (!empty($rss->channel->image->url[0])) {
|
|
|
- $this->_imageurl = (string) $rss->channel->image->url[0];
|
|
|
+ $this->_imageurl = sanitizeVal((string) $rss->channel->image->url[0]);
|
|
|
}
|
|
|
if (!empty($rss->channel->link)) {
|
|
|
- $this->_link = (string) $rss->channel->link;
|
|
|
+ $this->_link = sanitizeVal((string) $rss->channel->link);
|
|
|
}
|
|
|
if (!empty($rss->channel->title)) {
|
|
|
- $this->_title = (string) $rss->channel->title;
|
|
|
+ $this->_title = sanitizeVal((string) $rss->channel->title);
|
|
|
}
|
|
|
if (!empty($rss->channel->description)) {
|
|
|
- $this->_description = (string) $rss->channel->description;
|
|
|
+ $this->_description = sanitizeVal((string) $rss->channel->description);
|
|
|
}
|
|
|
} else {
|
|
|
//var_dump($rss->channel);
|
|
|
if (!empty($rss->channel['language'])) {
|
|
|
- $this->_language = (string) $rss->channel['language'];
|
|
|
+ $this->_language = sanitizeVal((string) $rss->channel['language']);
|
|
|
}
|
|
|
if (!empty($rss->channel['generator'])) {
|
|
|
- $this->_generator = (string) $rss->channel['generator'];
|
|
|
+ $this->_generator = sanitizeVal((string) $rss->channel['generator']);
|
|
|
}
|
|
|
if (!empty($rss->channel['copyright'])) {
|
|
|
- $this->_copyright = (string) $rss->channel['copyright'];
|
|
|
+ $this->_copyright = sanitizeVal((string) $rss->channel['copyright']);
|
|
|
}
|
|
|
if (!empty($rss->channel['lastbuilddate'])) {
|
|
|
- $this->_lastbuilddate = (string) $rss->channel['lastbuilddate'];
|
|
|
+ $this->_lastbuilddate = sanitizeVal((string) $rss->channel['lastbuilddate']);
|
|
|
}
|
|
|
if (!empty($rss->image['url'])) {
|
|
|
- $this->_imageurl = (string) $rss->image['url'];
|
|
|
+ $this->_imageurl = sanitizeVal((string) $rss->image['url']);
|
|
|
}
|
|
|
if (!empty($rss->channel['link'])) {
|
|
|
- $this->_link = (string) $rss->channel['link'];
|
|
|
+ $this->_link = sanitizeVal((string) $rss->channel['link']);
|
|
|
}
|
|
|
if (!empty($rss->channel['title'])) {
|
|
|
- $this->_title = (string) $rss->channel['title'];
|
|
|
+ $this->_title = sanitizeVal((string) $rss->channel['title']);
|
|
|
}
|
|
|
if (!empty($rss->channel['description'])) {
|
|
|
- $this->_description = (string) $rss->channel['description'];
|
|
|
+ $this->_description = sanitizeVal((string) $rss->channel['description']);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -380,40 +380,40 @@ class RssParser
|
|
|
//var_dump($rss);
|
|
|
if (!empty($conf->global->EXTERNALRSS_USE_SIMPLEXML)) {
|
|
|
if (!empty($rss->generator)) {
|
|
|
- $this->_generator = (string) $rss->generator;
|
|
|
+ $this->_generator = sanitizeVal((string) $rss->generator);
|
|
|
}
|
|
|
if (!empty($rss->lastbuilddate)) {
|
|
|
- $this->_lastbuilddate = (string) $rss->modified;
|
|
|
+ $this->_lastbuilddate = sanitizeVal((string) $rss->modified);
|
|
|
}
|
|
|
if (!empty($rss->link->href)) {
|
|
|
- $this->_link = (string) $rss->link->href;
|
|
|
+ $this->_link = sanitizeVal((string) $rss->link->href);
|
|
|
}
|
|
|
if (!empty($rss->title)) {
|
|
|
- $this->_title = (string) $rss->title;
|
|
|
+ $this->_title = sanitizeVal((string) $rss->title);
|
|
|
}
|
|
|
if (!empty($rss->description)) {
|
|
|
- $this->_description = (string) $rss->description;
|
|
|
+ $this->_description = sanitizeVal((string) $rss->description);
|
|
|
}
|
|
|
} else {
|
|
|
//if (!empty($rss->channel['rss_language'])) $this->_language = (string) $rss->channel['rss_language'];
|
|
|
if (!empty($rss->channel['generator'])) {
|
|
|
- $this->_generator = (string) $rss->channel['generator'];
|
|
|
+ $this->_generator = sanitizeVal((string) $rss->channel['generator']);
|
|
|
}
|
|
|
//if (!empty($rss->channel['rss_copyright'])) $this->_copyright = (string) $rss->channel['rss_copyright'];
|
|
|
if (!empty($rss->channel['modified'])) {
|
|
|
- $this->_lastbuilddate = (string) $rss->channel['modified'];
|
|
|
+ $this->_lastbuilddate = sanitizeVal((string) $rss->channel['modified']);
|
|
|
}
|
|
|
//if (!empty($rss->image['rss_url'])) $this->_imageurl = (string) $rss->image['rss_url'];
|
|
|
if (!empty($rss->channel['link'])) {
|
|
|
- $this->_link = (string) $rss->channel['link'];
|
|
|
+ $this->_link = sanitizeVal((string) $rss->channel['link']);
|
|
|
}
|
|
|
if (!empty($rss->channel['title'])) {
|
|
|
- $this->_title = (string) $rss->channel['title'];
|
|
|
+ $this->_title = sanitizeVal((string) $rss->channel['title']);
|
|
|
}
|
|
|
//if (!empty($rss->channel['rss_description'])) $this->_description = (string) $rss->channel['rss_description'];
|
|
|
|
|
|
if (!empty($rss->channel)) {
|
|
|
- $this->_imageurl = $this->getAtomImageUrl($rss->channel);
|
|
|
+ $this->_imageurl = sanitizeVal($this->getAtomImageUrl($rss->channel));
|
|
|
}
|
|
|
}
|
|
|
if (!empty($conf->global->EXTERNALRSS_USE_SIMPLEXML)) {
|
|
@@ -434,19 +434,19 @@ class RssParser
|
|
|
//var_dump($item);exit;
|
|
|
if ($rss->_format == 'rss') {
|
|
|
if (!empty($conf->global->EXTERNALRSS_USE_SIMPLEXML)) {
|
|
|
- $itemLink = (string) $item->link;
|
|
|
- $itemTitle = (string) $item->title;
|
|
|
- $itemDescription = (string) $item->description;
|
|
|
- $itemPubDate = (string) $item->pubDate;
|
|
|
+ $itemLink = sanitizeVal((string) $item->link);
|
|
|
+ $itemTitle = sanitizeVal((string) $item->title);
|
|
|
+ $itemDescription = sanitizeVal((string) $item->description);
|
|
|
+ $itemPubDate = sanitizeVal((string) $item->pubDate);
|
|
|
$itemId = '';
|
|
|
$itemAuthor = '';
|
|
|
} else {
|
|
|
- $itemLink = (string) $item['link'];
|
|
|
- $itemTitle = (string) $item['title'];
|
|
|
- $itemDescription = (string) $item['description'];
|
|
|
- $itemPubDate = (string) $item['pubdate'];
|
|
|
- $itemId = (string) $item['guid'];
|
|
|
- $itemAuthor = (string) $item['author'];
|
|
|
+ $itemLink = sanitizeVal((string) $item['link']);
|
|
|
+ $itemTitle = sanitizeVal((string) $item['title']);
|
|
|
+ $itemDescription = sanitizeVal((string) $item['description']);
|
|
|
+ $itemPubDate = sanitizeVal((string) $item['pubdate']);
|
|
|
+ $itemId = sanitizeVal((string) $item['guid']);
|
|
|
+ $itemAuthor = sanitizeVal((string) $item['author']);
|
|
|
}
|
|
|
|
|
|
// Loop on each category
|
|
@@ -458,19 +458,19 @@ class RssParser
|
|
|
}
|
|
|
} elseif ($rss->_format == 'atom') {
|
|
|
if (!empty($conf->global->EXTERNALRSS_USE_SIMPLEXML)) {
|
|
|
- $itemLink = (isset($item['link']) ? (string) $item['link'] : '');
|
|
|
- $itemTitle = (string) $item['title'];
|
|
|
- $itemDescription = $this->getAtomItemDescription($item);
|
|
|
- $itemPubDate = (string) $item['created'];
|
|
|
- $itemId = (string) $item['id'];
|
|
|
- $itemAuthor = (string) ($item['author'] ? $item['author'] : $item['author_name']);
|
|
|
+ $itemLink = (isset($item['link']) ? sanitizeVal((string) $item['link']) : '');
|
|
|
+ $itemTitle = sanitizeVal((string) $item['title']);
|
|
|
+ $itemDescription = sanitizeVal($this->getAtomItemDescription($item));
|
|
|
+ $itemPubDate = sanitizeVal((string) $item['created']);
|
|
|
+ $itemId = sanitizeVal((string) $item['id']);
|
|
|
+ $itemAuthor = sanitizeVal((string) ($item['author'] ? $item['author'] : $item['author_name']));
|
|
|
} else {
|
|
|
- $itemLink = (isset($item['link']) ? (string) $item['link'] : '');
|
|
|
- $itemTitle = (string) $item['title'];
|
|
|
- $itemDescription = $this->getAtomItemDescription($item);
|
|
|
- $itemPubDate = (string) $item['created'];
|
|
|
- $itemId = (string) $item['id'];
|
|
|
- $itemAuthor = (string) ($item['author'] ? $item['author'] : $item['author_name']);
|
|
|
+ $itemLink = (isset($item['link']) ? sanitizeVal((string) $item['link']) : '');
|
|
|
+ $itemTitle = sanitizeVal((string) $item['title']);
|
|
|
+ $itemDescription = sanitizeVal($this->getAtomItemDescription($item));
|
|
|
+ $itemPubDate = sanitizeVal((string) $item['created']);
|
|
|
+ $itemId = sanitizeVal((string) $item['id']);
|
|
|
+ $itemAuthor = sanitizeVal((string) ($item['author'] ? $item['author'] : $item['author_name']));
|
|
|
}
|
|
|
$itemCategory = array();
|
|
|
} else {
|