Commit ddddc3fb authored by Leksat's avatar Leksat Committed by borisson_
Browse files

Issue #2850771 by Leksat: Clone request object if there is a chance it can be modified

parent 8735390c
......@@ -61,7 +61,7 @@ class CoreNodeSearchFacetSource extends FacetSourcePluginBase implements CoreSea
protected $facetQueryExtender;
/**
* The master request.
* The clone of the master request.
*
* @var \Symfony\Component\HttpFoundation\Request
*/
......@@ -86,7 +86,7 @@ class CoreNodeSearchFacetSource extends FacetSourcePluginBase implements CoreSea
public function __construct(array $configuration, $plugin_id, $plugin_definition, QueryTypePluginManager $query_type_plugin_manager, SearchPluginManager $search_manager, Request $request) {
parent::__construct($configuration, $plugin_id, $plugin_definition, $query_type_plugin_manager);
$this->searchManager = $search_manager;
$this->request = $request;
$this->request = clone $request;
$this->setSearchKeys($this->request->query->get('keys'));
}
......
......@@ -50,7 +50,7 @@ class SearchApiDisplay extends FacetSourcePluginBase {
protected $searchApiQueryHelper;
/**
* The current request.
* The clone of the current request.
*
* @var \Symfony\Component\HttpFoundation\Request
*/
......@@ -79,7 +79,7 @@ class SearchApiDisplay extends FacetSourcePluginBase {
$this->searchApiQueryHelper = $search_results_cache;
$this->displayPluginManager = $display_plugin_manager;
$this->request = $request;
$this->request = clone $request;
}
/**
......
......@@ -22,10 +22,9 @@ abstract class UrlProcessorPluginBase extends ProcessorPluginBase implements Url
protected $filterKey = 'f';
/**
* The current request object.
* The clone of the current.
*
* @var Request
* The current request object.
* @var \Symfony\Component\HttpFoundation\Request
*/
protected $request;
......@@ -52,7 +51,7 @@ abstract class UrlProcessorPluginBase extends ProcessorPluginBase implements Url
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition, Request $request) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->request = $request;
$this->request = clone $request;
if (!isset($configuration['facet'])) {
throw new InvalidProcessorException("The url processor doesn't have the required 'facet' in the configuration array.");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment