diff options
| author | 2019-11-22 18:30:09 +0100 | |
|---|---|---|
| committer | 2019-11-22 18:30:09 +0100 | |
| commit | 90c7292326538522a5df97b3f0a847b8a28f759f (patch) | |
| tree | 3e667d2cb629a6ff16db4196e8622d37bf10cf4e /app/Controllers | |
| parent | 09c088c62ece3b17615fb4e2addfa16663bb334f (diff) | |
| parent | 996b49f1d8fba327f24b5859f3bacb85edb79da9 (diff) | |
Merge pull request #2683 from FreshRSS/dev
FreshRSS 1.15.3
Diffstat (limited to 'app/Controllers')
| -rwxr-xr-x | app/Controllers/feedController.php | 4 | ||||
| -rw-r--r-- | app/Controllers/userController.php | 24 |
2 files changed, 18 insertions, 10 deletions
diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php index aabeb80ff..3eb2316b8 100755 --- a/app/Controllers/feedController.php +++ b/app/Controllers/feedController.php @@ -415,8 +415,8 @@ class FreshRSS_feed_Controller extends Minz_ActionController { $entryDAO->commit(); } - if ($feed->hubUrl() && $feed->selfUrl()) { //selfUrl has priority for WebSub - if ($feed->selfUrl() !== $url) { //https://code.google.com/p/pubsubhubbub/wiki/MovingFeedsOrChangingHubs + if ($pubSubHubbubEnabled && $feed->hubUrl() && $feed->selfUrl()) { //selfUrl has priority for WebSub + if ($feed->selfUrl() !== $url) { // https://github.com/pubsubhubbub/PubSubHubbub/wiki/Moving-Feeds-or-changing-Hubs $selfUrl = checkUrl($feed->selfUrl()); if ($selfUrl) { Minz_Log::debug('WebSub unsubscribe ' . $feed->url(false)); diff --git a/app/Controllers/userController.php b/app/Controllers/userController.php index 7ce6b298a..5209edc84 100644 --- a/app/Controllers/userController.php +++ b/app/Controllers/userController.php @@ -59,14 +59,22 @@ class FreshRSS_user_Controller extends Minz_ActionController { $apiPasswordHash = self::hashPassword($apiPasswordPlain); $userConfig->apiPasswordHash = $apiPasswordHash; - @mkdir(DATA_PATH . '/fever/', 0770, true); - self::deleteFeverKey($user); - $userConfig->feverKey = strtolower(md5($user . ':' . $apiPasswordPlain)); - $ok = file_put_contents(DATA_PATH . '/fever/.key-' . sha1(FreshRSS_Context::$system_conf->salt) . '-' . $userConfig->feverKey . '.txt', $user) !== false; - - if (!$ok) { - Minz_Log::warning('Could not save API credentials for fever API', ADMIN_LOG); - return $ok; + $feverPath = DATA_PATH . '/fever/'; + + if (!file_exists($feverPath)) { + @mkdir($feverPath, 0770, true); + } + + if (!is_writable($feverPath)) { + Minz_Log::error("Could not save Fever API credentials. The directory does not have write access."); + } else { + self::deleteFeverKey($user); + $userConfig->feverKey = strtolower(md5("{$user}:{$apiPasswordPlain}")); + $ok = file_put_contents($feverPath . '.key-' . sha1(FreshRSS_Context::$system_conf->salt) . '-' . $userConfig->feverKey . '.txt', $user) !== false; + + if (!$ok) { + Minz_Log::warning('Could not save Fever API credentials. Unknown error.', ADMIN_LOG); + } } } |
