diff --git a/CHANGELOG.md b/CHANGELOG.md index 41b939f1..a442b0b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/adminer/include/functions.inc.php b/adminer/include/functions.inc.php index 75859f7f..3177dcc3 100644 --- a/adminer/include/functions.inc.php +++ b/adminer/include/functions.inc.php @@ -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" : "")