mirror of
https://github.com/vrana/adminer.git
synced 2026-02-08 07:40:16 +01:00
Fix escaping spaces in cookie value
`urlencode` encodes space into `+`, which breaks `adminer_permanent`, which is space-separated.
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
- Hide sort links on unsortable columns
|
||||
- Display uneditable fields in edit form
|
||||
- Shorten all but numeric and date types in select
|
||||
- Fix escaping spaces in cookie value
|
||||
- PostgreSQL: Offer foreign keys in create table
|
||||
- PostgreSQL: Add missing parentheses to CHECK export
|
||||
- PostgreSQL: Allow creating NOT DEFERRABLE foreign keys
|
||||
|
||||
@@ -334,7 +334,7 @@ function convert_fields(array $columns, array $fields, array $select = array()):
|
||||
*/
|
||||
function cookie(string $name, ?string $value, int $lifetime = 2592000): void {
|
||||
header(
|
||||
"Set-Cookie: $name=" . urlencode($value)
|
||||
"Set-Cookie: $name=" . rawurlencode($value)
|
||||
. ($lifetime ? "; expires=" . gmdate("D, d M Y H:i:s", time() + $lifetime) . " GMT" : "")
|
||||
. "; path=" . preg_replace('~\?.*~', '', $_SERVER["REQUEST_URI"])
|
||||
. (HTTPS ? "; secure" : "")
|
||||
|
||||
Reference in New Issue
Block a user