diff options
| author | 2019-11-22 18:30:09 +0100 | |
|---|---|---|
| committer | 2019-11-22 18:30:09 +0100 | |
| commit | 90c7292326538522a5df97b3f0a847b8a28f759f (patch) | |
| tree | 3e667d2cb629a6ff16db4196e8622d37bf10cf4e /app | |
| parent | 09c088c62ece3b17615fb4e2addfa16663bb334f (diff) | |
| parent | 996b49f1d8fba327f24b5859f3bacb85edb79da9 (diff) | |
Merge pull request #2683 from FreshRSS/dev
FreshRSS 1.15.3
Diffstat (limited to 'app')
| -rwxr-xr-x | app/Controllers/feedController.php | 4 | ||||
| -rw-r--r-- | app/Controllers/userController.php | 24 | ||||
| -rw-r--r-- | app/Models/CategoryDAO.php | 2 | ||||
| -rw-r--r-- | app/Models/TagDAO.php | 4 | ||||
| -rw-r--r-- | app/views/configure/integration.phtml | 2 | ||||
| -rw-r--r-- | app/views/feed/add.phtml | 2 | ||||
| -rw-r--r-- | app/views/helpers/feed/update.phtml | 2 | ||||
| -rw-r--r-- | app/views/helpers/index/normal/entry_header.phtml | 2 | ||||
| -rw-r--r-- | app/views/index/normal.phtml | 2 | ||||
| -rw-r--r-- | app/views/index/reader.phtml | 2 |
10 files changed, 27 insertions, 19 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); + } } } diff --git a/app/Models/CategoryDAO.php b/app/Models/CategoryDAO.php index 08dc4eef0..4bba23d9c 100644 --- a/app/Models/CategoryDAO.php +++ b/app/Models/CategoryDAO.php @@ -81,7 +81,7 @@ class FreshRSS_CategoryDAO extends Minz_ModelPdo implements FreshRSS_Searchable public function addCategory($valuesTmp) { $sql = 'INSERT INTO `_category`(name, attributes) ' - . 'SELECT * FROM (SELECT TRIM(?), ?) c2 ' //TRIM() to provide a type hint as text for PostgreSQL + . 'SELECT * FROM (SELECT TRIM(?) AS name, TRIM(?) AS attributes) c2 ' //TRIM() to provide a type hint as text . 'WHERE NOT EXISTS (SELECT 1 FROM `_tag` WHERE name = TRIM(?))'; //No tag of the same name $stm = $this->pdo->prepare($sql); diff --git a/app/Models/TagDAO.php b/app/Models/TagDAO.php index 5882eee76..09397c6a1 100644 --- a/app/Models/TagDAO.php +++ b/app/Models/TagDAO.php @@ -106,9 +106,9 @@ class FreshRSS_TagDAO extends Minz_ModelPdo implements FreshRSS_Searchable { public function updateTagAttribute($tag, $key, $value) { if ($tag instanceof FreshRSS_Tag) { $tag->_attributes($key, $value); - return $this->updateFeed( + return $this->updateTag( $tag->id(), - array('attributes' => $feed->attributes()) + [ 'attributes' => $tag->attributes() ] ); } return false; diff --git a/app/views/configure/integration.phtml b/app/views/configure/integration.phtml index 32ef11716..9c83a5dc7 100644 --- a/app/views/configure/integration.phtml +++ b/app/views/configure/integration.phtml @@ -3,7 +3,7 @@ <div class="post"> <a href="<?= _url('index', 'index') ?>"><?= _t('gen.action.back_to_rss_feeds') ?></a> - <form method="post" action="<?= _url('configure', 'sharing') ?>" + <form method="post" action="<?= _url('configure', 'integration') ?>" data-simple='<div class="form-group" id="group-share-##key##"><label class="group-name">##label##</label><div class="group-controls"><div class="stick"><input type="text" id="share_##key##_name" name="share[##key##][name]" class="extend" value="##label##" placeholder="<?= _t('conf.sharing.share_name') ?>" size="64" /> <input type="url" id="share_##key##_url" name="share[##key##][url]" class="extend" value="" placeholder="<?= _t('gen.short.not_applicable') ?>" size="64" disabled /><a href="#" class="remove btn btn-attention" data-remove="group-share-##key##"><?= _i('close') ?></a></div> <input type="hidden" id="share_##key##_type" name="share[##key##][type]" value="##type##" /></div></div>' diff --git a/app/views/feed/add.phtml b/app/views/feed/add.phtml index e39f45a86..9cfe024fc 100644 --- a/app/views/feed/add.phtml +++ b/app/views/feed/add.phtml @@ -42,7 +42,7 @@ <input type="text" name="url_rss" id="url" class="extend" value="<?= $this->feed->url() ?>" /> <a class="btn" target="_blank" rel="noreferrer" href="<?= $this->feed->url() ?>"><?= _i('link') ?></a> </div> - <a class="btn" target="_blank" rel="noreferrer" href="http://validator.w3.org/feed/check.cgi?url=<?= $this->feed->url() ?>"><?= _t('sub.feed.validator') ?></a> + <a class="btn" target="_blank" rel="noreferrer" href="https://validator.w3.org/feed/check.cgi?url=<?= $this->feed->url() ?>"><?= _t('sub.feed.validator') ?></a> </div> </div> <div class="form-group"> diff --git a/app/views/helpers/feed/update.phtml b/app/views/helpers/feed/update.phtml index e5f186956..4bc9d62a8 100644 --- a/app/views/helpers/feed/update.phtml +++ b/app/views/helpers/feed/update.phtml @@ -49,7 +49,7 @@ <a class="btn" target="_blank" rel="noreferrer" href="<?= $this->feed->url() ?>"><?= _i('link') ?></a> </div> - <a class="btn" target="_blank" rel="noreferrer" href="http://validator.w3.org/feed/check.cgi?url=<?= rawurlencode(htmlspecialchars_decode($this->feed->url(), ENT_QUOTES)) ?>"><?= _t('sub.feed.validator') ?></a> + <a class="btn" target="_blank" rel="noreferrer" href="https://validator.w3.org/feed/check.cgi?url=<?= rawurlencode(htmlspecialchars_decode($this->feed->url(), ENT_QUOTES)) ?>"><?= _t('sub.feed.validator') ?></a> </div> </div> <div class="form-group"> diff --git a/app/views/helpers/index/normal/entry_header.phtml b/app/views/helpers/index/normal/entry_header.phtml index d22cf5036..3d25301fa 100644 --- a/app/views/helpers/index/normal/entry_header.phtml +++ b/app/views/helpers/index/normal/entry_header.phtml @@ -28,7 +28,7 @@ } } ?><li class="item website"><a href="<?= _url('index', 'index', 'get', 'f_' . $this->feed->id()) ?>"><img class="favicon" src="<?= $this->feed->favicon() ?>" alt="✇" /> <span><?= $this->feed->name() ?></span></a></li> - <li class="item title"><a target="_blank" rel="noreferrer" href="<?= $this->entry->link() ?>"><?= $this->entry->title() ?></a><?php + <li class="item title" dir="auto"><a target="_blank" rel="noreferrer" href="<?= $this->entry->link() ?>"><?= $this->entry->title() ?></a><?php if ($topline_display_authors): ?><div class="item author"><?php $authors = $this->entry->authors(); diff --git a/app/views/index/normal.phtml b/app/views/index/normal.phtml index f556df201..23105df5c 100644 --- a/app/views/index/normal.phtml +++ b/app/views/index/normal.phtml @@ -64,7 +64,7 @@ if (!empty($this->entries)) { $this->renderHelper('index/normal/entry_header'); - ?><div class="flux_content"> + ?><div class="flux_content" dir="auto"> <div class="content <?= $content_width ?>"> <h1 class="title"><a target="_blank" rel="noreferrer" class="go_website" href="<?= $this->entry->link() ?>"><?= $this->entry->title() ?></a></h1> <div class="author"><?php diff --git a/app/views/index/reader.phtml b/app/views/index/reader.phtml index bbb6bd22b..e935db4a8 100644 --- a/app/views/index/reader.phtml +++ b/app/views/index/reader.phtml @@ -17,7 +17,7 @@ if (!empty($this->entries)) { continue; } ?><div class="flux<?= !$item->isRead() ? ' not_read' : '' ?><?= $item->isFavorite() ? ' favorite' : '' ?>" id="flux_<?= $item->id() ?>"> - <div class="flux_content"> + <div class="flux_content" dir="auto"> <div class="content <?= $content_width ?>"> <?php $feed = FreshRSS_CategoryDAO::findFeed($this->categories, $item->feed()); //We most likely already have the feed object in cache |
