Răsfoiți Sursa

Merge branch 'FreshRSS/dev' into PostgreSQL

Alexandre Alapetite 9 ani în urmă
părinte
comite
e098119441
6 a modificat fișierele cu 11 adăugiri și 4 ștergeri
  1. 5 1
      CHANGELOG.md
  2. 2 2
      app/Models/Feed.php
  3. 1 0
      app/Models/StatsDAO.php
  4. 1 1
      constants.php
  5. 1 0
      lib/SimplePie/SimplePie.php
  6. 1 0
      p/api/pshb.php

+ 5 - 1
CHANGELOG.md

@@ -1,6 +1,9 @@
 # Changelog
 
-## 2016-08-XX FreshRSS 1.5.0-dev
+## 2016-XX-XX FreshRSS 1.6.0-dev
+
+
+## 2016-08-29 FreshRSS 1.5.0
 
 * Compatibility
 	* Require at least MySQL 5.5.3+ [#1153](https://github.com/FreshRSS/FreshRSS/issues/1153)
@@ -20,6 +23,7 @@
 	* Fixed JavaScript bug when articles were not always marked as read [#1123](https://github.com/FreshRSS/FreshRSS/issues/1123)
 	* Fixed Apache Etag issue that prevented caching [#1199](https://github.com/FreshRSS/FreshRSS/pull/1199)
 	* Fixed OPML import of categories [#1202](https://github.com/FreshRSS/FreshRSS/issues/1202)
+	* Fixed PubSubHubbub callback address bug on some configurations [1229](https://github.com/FreshRSS/FreshRSS/pull/1229)
 * UI
 	* Use sticky category column [#1172](https://github.com/FreshRSS/FreshRSS/pull/1172)
 	* Updated to jQuery 3.1.0 and several JavaScript fixes (e.g. drag & drop) [#1197](https://github.com/FreshRSS/FreshRSS/pull/1197)

+ 2 - 2
app/Models/Feed.php

@@ -241,7 +241,7 @@ class FreshRSS_Feed extends Minz_Model {
 
 				if ((!$mtime) || $feed->error()) {
 					$errorMessage = $feed->error();
-					throw new FreshRSS_Feed_Exception(($errorMessage == '' ? 'Feed error' : $errorMessage) . ' [' . $url . ']');
+					throw new FreshRSS_Feed_Exception(($errorMessage == '' ? 'Unknown error for feed' : $errorMessage) . ' [' . $url . ']');
 				}
 
 				$links = $feed->get_links('self');
@@ -446,7 +446,7 @@ class FreshRSS_Feed extends Minz_Model {
 				Minz_Log::warning('Invalid JSON for PubSubHubbub: ' . $this->url);
 				return false;
 			}
-			$callbackUrl = checkUrl(FreshRSS_Context::$system_conf->base_url . 'api/pshb.php?k=' . $hubJson['key']);
+			$callbackUrl = checkUrl(Minz_Request::getBaseUrl() . '/api/pshb.php?k=' . $hubJson['key']);
 			if ($callbackUrl == '') {
 				Minz_Log::warning('Invalid callback for PubSubHubbub: ' . $this->url);
 				return false;

+ 1 - 0
app/Models/StatsDAO.php

@@ -168,6 +168,7 @@ SQL;
 		$stm->execute();
 		$res = $stm->fetchAll(PDO::FETCH_NAMED);
 
+		$repartition = array();
 		foreach ($res as $value) {
 			$repartition[(int) $value['period']] = (int) $value['count'];
 		}

+ 1 - 1
constants.php

@@ -1,5 +1,5 @@
 <?php
-define('FRESHRSS_VERSION', '1.5.0-dev');
+define('FRESHRSS_VERSION', '1.6.0-dev');
 define('FRESHRSS_WEBSITE', 'http://freshrss.org');
 define('FRESHRSS_WIKI', 'http://doc.freshrss.org');
 

+ 1 - 0
lib/SimplePie/SimplePie.php

@@ -1304,6 +1304,7 @@ class SimplePie
 		// Check absolute bare minimum requirements.
 		if (!extension_loaded('xml') || !extension_loaded('pcre'))
 		{
+			$this->error = 'XML or PCRE extensions not loaded!';
 			return false;
 		}
 		// Then check the xml extension is sane (i.e., libxml 2.7.x issue on PHP < 5.2.9 and libxml 2.7.0 to 2.7.2 on any version) if we don't have xmlreader.

+ 1 - 0
p/api/pshb.php

@@ -5,6 +5,7 @@ require(LIB_PATH . '/lib_rss.php');	//Includes class autoloader
 define('MAX_PAYLOAD', 3145728);
 
 header('Content-Type: text/plain; charset=UTF-8');
+header('X-Content-Type-Options: nosniff');
 
 function logMe($text) {
 	file_put_contents(USERS_PATH . '/_/log_pshb.txt', date('c') . "\t" . $text . "\n", FILE_APPEND);