Remove noise parameters in query URL (#6371)

* Remove noise parameters in query URL
Remove undeeded `name` and `rid` parameters from saved user query

* Fix logic
This commit is contained in:
Alexandre Alapetite 2024-04-23 10:59:09 +02:00 committed by GitHub
parent 90fbb524ce
commit 5e66adcc51
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -374,7 +374,6 @@ class FreshRSS_configure_Controller extends FreshRSS_ActionController {
if ('' === $name) {
$name = _t('conf.query.number', $id + 1);
}
$queryParams['name'] = $name;
if (!empty($params['get']) && is_string($params['get'])) {
$queryParams['get'] = htmlspecialchars_decode($params['get'], ENT_QUOTES);
}
@ -399,6 +398,7 @@ class FreshRSS_configure_Controller extends FreshRSS_ActionController {
$queryParams['shareOpml'] = (bool)$params['shareOpml'];
}
$queryParams['url'] = Minz_Url::display(['params' => $queryParams]);
$queryParams['name'] = $name;
$queries = FreshRSS_Context::userConf()->queries;
$queries[$id] = (new FreshRSS_UserQuery($queryParams, FreshRSS_Context::categories(), FreshRSS_Context::labels()))->toArray();
@ -442,6 +442,7 @@ class FreshRSS_configure_Controller extends FreshRSS_ActionController {
$queries[$key] = (new FreshRSS_UserQuery($query, FreshRSS_Context::categories(), FreshRSS_Context::labels()))->toArray();
}
$params = $_GET;
unset($params['name']);
unset($params['rid']);
$params['url'] = Minz_Url::display(['params' => $params]);
$params['name'] = _t('conf.query.number', count($queries) + 1);

View File

@ -50,7 +50,6 @@ class FreshRSS_BooleanSearch {
$all_matches = [];
if (preg_match_all('/\bsearch:(?P<delim>[\'"])(?P<search>.*)(?P=delim)/U', $input, $matchesFound)) {
$all_matches[] = $matchesFound;
}
if (preg_match_all('/\bsearch:(?P<search>[^\s"]*)/', $input, $matchesFound)) {
$all_matches[] = $matchesFound;