mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-07-11 03:32:12 +00:00
Merge branch 'v4-development' of github.com:skipperbent/simple-php-router into v4-development
This commit is contained in:
@@ -303,13 +303,22 @@ class InputHandler
|
||||
// Append any PHP-input json
|
||||
if (strpos(trim($contents), '{') === 0) {
|
||||
$post = json_decode($contents, true);
|
||||
|
||||
if ($post !== false) {
|
||||
$output += $post;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return (\count($filter) > 0) ? array_intersect_key($output, array_flip($filter)) : $output;
|
||||
$output = (\count($filter) > 0) ? array_intersect_key($output, array_flip($filter)) : $output;
|
||||
|
||||
foreach ($filter as $filterKey) {
|
||||
if (array_key_exists($filterKey, $output) === false) {
|
||||
$output[$filterKey] = null;
|
||||
}
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -345,4 +354,4 @@ class InputHandler
|
||||
$this->file[$key] = $item;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ class CookieTokenProvider implements ITokenProvider
|
||||
public function setToken(string $token): void
|
||||
{
|
||||
$this->token = $token;
|
||||
setcookie(static::CSRF_KEY, $token, (time() + 60) * $this->cookieTimeoutMinutes, '/', ini_get('session.cookie_domain'), ini_get('session.cookie_secure'), ini_get('session.cookie_httponly'));
|
||||
setcookie(static::CSRF_KEY, $token, time() + (60 * $this->cookieTimeoutMinutes), '/', ini_get('session.cookie_domain'), ini_get('session.cookie_secure'), ini_get('session.cookie_httponly'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user