PubSubHubbub: remove white list

The tests so far are good. Ready to test more broadly.
https://github.com/FreshRSS/FreshRSS/pull/831
https://github.com/FreshRSS/FreshRSS/issues/312
pull/831/head
Alexandre Alapetite 10 years ago
parent 6c2bebaff2
commit 694dfa1f8b
  1. 11
      app/Controllers/feedController.php
  2. 2
      app/Models/Feed.php

@ -442,13 +442,10 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
}
$feed->faviconPrepare();
if (in_array($feed->url(), array('http://push-pub.appspot.com/feed'))) { //TODO: Remove white-list after testing
Minz_Log::debug('PubSubHubbub match ' . $feed->url());
if ($feed->pubSubHubbubPrepare()) {
Minz_Log::notice('PubSubHubbub subscribe ' . $feed->url());
if (!$feed->pubSubHubbubSubscribe(true)) { //Subscribe
Minz_Log::warning('Error while PubSubHubbub subscribing to ' . $feed->url());
}
if ($feed->pubSubHubbubPrepare()) {
Minz_Log::notice('PubSubHubbub subscribe ' . $feed->url());
if (!$feed->pubSubHubbubSubscribe(true)) { //Subscribe
Minz_Log::warning('Error while PubSubHubbub subscribing to ' . $feed->url());
}
}
$feed->unlock();

@ -388,7 +388,7 @@ class FreshRSS_Feed extends Minz_Model {
function pubSubHubbubPrepare() {
$key = '';
if (FreshRSS_Context::$system_conf->base_url && $this->hubUrl && $this->selfUrl) {
if (FreshRSS_Context::$system_conf->base_url && $this->hubUrl && $this->selfUrl && @is_dir(PSHB_PATH)) {
$path = PSHB_PATH . '/feeds/' . base64url_encode($this->selfUrl);
$hubFilename = $path . '/!hub.json';
if ($hubFile = @file_get_contents($hubFilename)) {

Loading…
Cancel
Save