mirror of
https://github.com/silverstripe/silverstripe-blog
synced 2024-10-22 11:05:58 +02:00
BUGFIX Check if SimplePie exists before attempting to create a new instance of it, since it's a 3rd party class
This commit is contained in:
parent
d3c7ad41fd
commit
16736e25a4
@ -44,6 +44,8 @@ class RSSWidget extends Widget {
|
|||||||
|
|
||||||
function FeedItems() {
|
function FeedItems() {
|
||||||
$output = new DataObjectSet();
|
$output = new DataObjectSet();
|
||||||
|
|
||||||
|
if(class_exists('SimplePie')) {
|
||||||
$this->feed = new SimplePie($this->AbsoluteRssUrl);
|
$this->feed = new SimplePie($this->AbsoluteRssUrl);
|
||||||
$this->feed->init();
|
$this->feed->init();
|
||||||
if($items = $this->feed->get_items(0, $this->NumberToShow)) {
|
if($items = $this->feed->get_items(0, $this->NumberToShow)) {
|
||||||
@ -57,5 +59,6 @@ class RSSWidget extends Widget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
Loading…
Reference in New Issue
Block a user