diff options
| -rw-r--r-- | app/Controllers/configureController.php | 7 | ||||
| -rw-r--r-- | app/Models/UserConfiguration.php | 3 | ||||
| -rw-r--r-- | app/views/configure/queries.phtml | 4 | ||||
| -rw-r--r-- | lib/lib_rss.php | 6 |
4 files changed, 14 insertions, 6 deletions
diff --git a/app/Controllers/configureController.php b/app/Controllers/configureController.php index bcda947ff..aedb7a2e6 100644 --- a/app/Controllers/configureController.php +++ b/app/Controllers/configureController.php @@ -346,7 +346,8 @@ class FreshRSS_configure_Controller extends FreshRSS_ActionController { FreshRSS_View::appendScript(Minz_Url::display('/scripts/draggable.js?' . @filemtime(PUBLIC_PATH . '/scripts/draggable.js'))); if (Minz_Request::isPost()) { - /** @var array<int,array{get?:string,name?:string,order?:string,search?:string,state?:int,url?:string,token?:string}> $params */ + /** @var array<int,array{get?:string,name?:string,order?:string,search?:string,state?:int,url?:string,token?:string, + * shareRss?:bool|numeric-string,shareOpml?:bool|numeric-string,description?:string,imageUrl?:string}> $params */ $params = Minz_Request::paramArray('queries'); $queries = []; @@ -358,6 +359,10 @@ class FreshRSS_configure_Controller extends FreshRSS_ActionController { if (!empty($query['search'])) { $query['search'] = urldecode($query['search']); } + $shareRss = $query['shareRss'] ?? null; + $query['shareRss'] = (is_string($shareRss) && ctype_digit($shareRss)) ? (bool)$shareRss : false; + $shareOpml = $query['shareOpml'] ?? null; + $query['shareOpml'] = (is_string($shareOpml) && ctype_digit($shareOpml)) ? (bool)$shareOpml : false; $queries[$key] = (new FreshRSS_UserQuery($query, FreshRSS_Context::categories(), FreshRSS_Context::labels()))->toArray(); } FreshRSS_Context::userConf()->queries = $queries; diff --git a/app/Models/UserConfiguration.php b/app/Models/UserConfiguration.php index 2cb11bbe4..88263e1ad 100644 --- a/app/Models/UserConfiguration.php +++ b/app/Models/UserConfiguration.php @@ -44,7 +44,8 @@ declare(strict_types=1); * @property bool $onread_jump_next * @property string $passwordHash * @property int $posts_per_page - * @property array<int,array{get?:string,name?:string,order?:string,search?:string,state?:int,url?:string,token?:string}> $queries + * @property array<int,array{get?:string,name?:string,order?:string,search?:string,state?:int,url?:string,token?:string, + * shareRss?:bool,shareOpml?:bool,description?:string,imageUrl?:string}> $queries * @property bool $reading_confirm * @property int $since_hours_posts_per_rss * @property bool $show_fav_unread diff --git a/app/views/configure/queries.phtml b/app/views/configure/queries.phtml index 1e925d19c..bd1e0b370 100644 --- a/app/views/configure/queries.phtml +++ b/app/views/configure/queries.phtml @@ -21,8 +21,8 @@ <a class="configure open-slider" href="<?= _url('configure', 'query', 'id', '' . $key) ?>"><?= _i('configure') ?></a><h2><?= $query->getName() ?></h2> <input type="hidden" id="queries_<?= $key ?>_name" name="queries[<?= $key ?>][name]" value="<?= $query->getName() ?>"/> <input type="hidden" id="queries_<?= $key ?>_token" name="queries[<?= $key ?>][token]" value="<?= $query->getToken() ?>"/> - <input type="hidden" id="queries_<?= $key ?>_shareRss" name="queries[<?= $key ?>][token]" value="<?= $query->shareRss() ?>"/> - <input type="hidden" id="queries_<?= $key ?>_shareOpml" name="queries[<?= $key ?>][token]" value="<?= $query->shareOpml() ?>"/> + <input type="hidden" id="queries_<?= $key ?>_shareRss" name="queries[<?= $key ?>][shareRss]" value="<?= $query->shareRss() ? '1' : '0' ?>"/> + <input type="hidden" id="queries_<?= $key ?>_shareOpml" name="queries[<?= $key ?>][shareOpml]" value="<?= $query->shareOpml() ? '1' : '0' ?>"/> <input type="hidden" id="queries_<?= $key ?>_url" name="queries[<?= $key ?>][url]" value="<?= $query->getUrl() ?>"/> <input type="hidden" id="queries_<?= $key ?>_search" name="queries[<?= $key ?>][search]" value="<?= urlencode($query->getSearch()->getRawInput()) ?>"/> <input type="hidden" id="queries_<?= $key ?>_state" name="queries[<?= $key ?>][state]" value="<?= $query->getState() ?>"/> diff --git a/lib/lib_rss.php b/lib/lib_rss.php index 6779a4560..266e95b65 100644 --- a/lib/lib_rss.php +++ b/lib/lib_rss.php @@ -1057,8 +1057,10 @@ function recursive_unlink(string $dir): bool { /** * Remove queries where $get is appearing. * @param string $get the get attribute which should be removed. - * @param array<int,array{get?:string,name?:string,order?:string,search?:string,state?:int,url?:string}> $queries an array of queries. - * @return array<int,array{get?:string,name?:string,order?:string,search?:string,state?:int,url?:string}> without queries where $get is appearing. + * @param array<int,array{get?:string,name?:string,order?:string,search?:string,state?:int,url?:string,token?:string, + * shareRss?:bool,shareOpml?:bool,description?:string,imageUrl?:string}> $queries an array of queries. + * @return array<int,array{get?:string,name?:string,order?:string,search?:string,state?:int,url?:string,token?:string, + * shareRss?:bool,shareOpml?:bool,description?:string,imageUrl?:string}> without queries where $get is appearing. */ function remove_query_by_get(string $get, array $queries): array { $final_queries = []; |
