aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/Models/Feed.php5
-rw-r--r--app/install.php2
2 files changed, 4 insertions, 3 deletions
diff --git a/app/Models/Feed.php b/app/Models/Feed.php
index 0a45a1f4c..a467fda57 100644
--- a/app/Models/Feed.php
+++ b/app/Models/Feed.php
@@ -643,7 +643,8 @@ class FreshRSS_Feed extends Minz_Model {
public function pubSubHubbubPrepare() {
$key = '';
- if (FreshRSS_Context::$system_conf->base_url && $this->hubUrl && $this->selfUrl && @is_dir(PSHB_PATH)) {
+ if (Minz_Request::serverIsPublic(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)) {
@@ -690,7 +691,7 @@ class FreshRSS_Feed extends Minz_Model {
//Parameter true to subscribe, false to unsubscribe.
public function pubSubHubbubSubscribe($state) {
$url = $this->selfUrl ? $this->selfUrl : $this->url;
- if (FreshRSS_Context::$system_conf->base_url && $url) {
+ if ($url && (Minz_Request::serverIsPublic(FreshRSS_Context::$system_conf->base_url) || !$state)) {
$hubFilename = PSHB_PATH . '/feeds/' . base64url_encode($url) . '/!hub.json';
$hubFile = @file_get_contents($hubFilename);
if ($hubFile === false) {
diff --git a/app/install.php b/app/install.php
index 3737e2ccc..3158ffc6f 100644
--- a/app/install.php
+++ b/app/install.php
@@ -142,7 +142,7 @@ function saveStep2() {
'prefix' => $_SESSION['bd_prefix'],
'pdo_options' => [],
],
- 'pubsubhubbub_enabled' => server_is_public($base_url),
+ 'pubsubhubbub_enabled' => Minz_Request::serverIsPublic($base_url),
];
if (!empty($_SESSION['title'])) {
$config_array['title'] = $_SESSION['title'];