Ver Fonte

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
Alexandre Alapetite há 1 ano atrás
pai
commit
5e66adcc51
2 ficheiros alterados com 2 adições e 2 exclusões
  1. 2 1
      app/Controllers/configureController.php
  2. 0 1
      app/Models/BooleanSearch.php

+ 2 - 1
app/Controllers/configureController.php

@@ -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);

+ 0 - 1
app/Models/BooleanSearch.php

@@ -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;