function validation($data, $files) { $errors = parent::validation($data, $files); $rss = new moodle_simplepie(); // set timeout for longer than normal to try and grab the feed $rss->set_timeout(10); $rss->set_feed_url($data['url']); $rss->set_autodiscovery_cache_duration(0); $rss->set_autodiscovery_level(SIMPLEPIE_LOCATOR_NONE); $rss->init(); if ($rss->error()) { $errors['url'] = get_string('errorloadingfeed', 'block_rss_client', $rss->error()); } else { $this->title = $rss->get_title(); $this->description = $rss->get_description(); } return $errors; }