Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/HuasoFoundries/phpPgAdmin6.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/middleware/PopulateRequestResponse.php')
-rw-r--r--src/middleware/PopulateRequestResponse.php14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/middleware/PopulateRequestResponse.php b/src/middleware/PopulateRequestResponse.php
index d3a7f5c6..92940334 100644
--- a/src/middleware/PopulateRequestResponse.php
+++ b/src/middleware/PopulateRequestResponse.php
@@ -54,24 +54,16 @@ class PopulateRequestResponse extends Middleware
$requestPath = $uri->getPath();
$view->offsetSet('query_string', $query_string);
- $path = $requestPath . ($query_string ? '?' . $query_string : '');
+ $path = $requestPath . ($query_string !== '' ? '?' . $query_string : '');
$view->offsetSet('path', $path);
$params = $request->getParams();
$viewparams = [];
- foreach ($params as $key => $value) {
- if (\is_scalar($value)) {
- $viewparams[$key] = $value;
- }
- }
+ $viewparams = array_filter($params, 'is_scalar');
- if (isset($_COOKIE['IN_TEST'])) {
- $in_test = (string) $_COOKIE['IN_TEST'];
- } else {
- $in_test = '0';
- }
+ $in_test = isset($_COOKIE['IN_TEST']) ? (string) $_COOKIE['IN_TEST'] : '0';
// remove tabs and linebreaks from query
if (isset($params['query'])) {