Просмотр исходного кода

Merge remote-tracking branch 'origin/PubSubHubbub' into dev

Alexandre Alapetite 11 лет назад
Родитель
Сommit
e3ce10b38a
2 измененных файлов с 5 добавлено и 8 удалено
  1. 4 7
      app/Controllers/feedController.php
  2. 1 1
      app/Models/Feed.php

+ 4 - 7
app/Controllers/feedController.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();

+ 1 - 1
app/Models/Feed.php

@@ -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)) {