Skip to content

Commit

Permalink
MDL-48496 block_rss_client: Do not display curl error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Frederic Massart authored and stronk7 committed Dec 10, 2014
1 parent 4920ba4 commit 81fd67f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
5 changes: 2 additions & 3 deletions blocks/rss_client/block_rss_client.php
Expand Up @@ -142,7 +142,7 @@ function get_feed_html($feedrecord, $maxentries, $showtitle){
$feed->set_cache_duration($CFG->block_rss_client_timeout*60);
}

if(debugging() && $feed->error()){
if ($CFG->debugdeveloper && $feed->error()) {
return '<p>'. $feedrecord->url .' Failed with code: '.$feed->error().'</p>';
}

Expand Down Expand Up @@ -314,8 +314,7 @@ function cron() {
$feed->init();

if ($feed->error()) {
mtrace ('error');
mtrace ('SimplePie failed with error:'.$feed->error());
mtrace('Error: could not load/find the RSS feed');
$status = false;
} else {
mtrace ('ok');
Expand Down
2 changes: 1 addition & 1 deletion blocks/rss_client/editfeed.php
Expand Up @@ -89,7 +89,7 @@ function validation($data, $files) {
$rss->init();

if ($rss->error()) {
$errors['url'] = get_string('errorloadingfeed', 'block_rss_client', $rss->error());
$errors['url'] = get_string('couldnotfindloadrssfeed', 'block_rss_client');
} else {
$this->title = $rss->get_title();
$this->description = $rss->get_description();
Expand Down
1 change: 1 addition & 0 deletions blocks/rss_client/lang/en/block_rss_client.php
Expand Up @@ -33,6 +33,7 @@
$string['clientshowimagelabel'] = 'Show channel image if available :';
$string['configblock'] = 'Configure this block';
$string['couldnotfindfeed'] = 'Could not find feed with id';
$string['couldnotfindloadrssfeed'] = 'Could not find or load the RSS feed.';
$string['customtitlelabel'] = 'Custom title (leave blank to use title supplied by feed):';
$string['deletefeedconfirm'] = 'Are you sure you want to delete this feed?';
$string['disabledrssfeeds'] = 'RSS feeds are disabled';
Expand Down

0 comments on commit 81fd67f

Please sign in to comment.