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. 3
      app/Controllers/feedController.php
  2. 2
      app/Models/Feed.php

@ -442,15 +442,12 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
} }
$feed->faviconPrepare(); $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()) { if ($feed->pubSubHubbubPrepare()) {
Minz_Log::notice('PubSubHubbub subscribe ' . $feed->url()); Minz_Log::notice('PubSubHubbub subscribe ' . $feed->url());
if (!$feed->pubSubHubbubSubscribe(true)) { //Subscribe if (!$feed->pubSubHubbubSubscribe(true)) { //Subscribe
Minz_Log::warning('Error while PubSubHubbub subscribing to ' . $feed->url()); Minz_Log::warning('Error while PubSubHubbub subscribing to ' . $feed->url());
} }
} }
}
$feed->unlock(); $feed->unlock();
$updated_feeds++; $updated_feeds++;
unset($feed); unset($feed);

@ -388,7 +388,7 @@ class FreshRSS_Feed extends Minz_Model {
function pubSubHubbubPrepare() { function pubSubHubbubPrepare() {
$key = ''; $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); $path = PSHB_PATH . '/feeds/' . base64url_encode($this->selfUrl);
$hubFilename = $path . '/!hub.json'; $hubFilename = $path . '/!hub.json';
if ($hubFile = @file_get_contents($hubFilename)) { if ($hubFile = @file_get_contents($hubFilename)) {

Loading…
Cancel
Save