Skip to content
Snippets Groups Projects
Commit e1114bea authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Patch #127753 by ChrisKennedy and GreenMother: regex error with session.cookie_domain settings.

parent 23e36f7b
Branches
Tags
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -140,7 +140,7 @@ ...@@ -140,7 +140,7 @@
* We try to set the correct cookie domain. * We try to set the correct cookie domain.
*/ */
if (isset($_SERVER['HTTP_HOST'])) { if (isset($_SERVER['HTTP_HOST'])) {
$domain = '.'. preg_replace('`^www.`', '', $_SERVER['HTTP_HOST']); $domain = '.'. preg_replace('`^www\.`', '', $_SERVER['HTTP_HOST']);
// Per RFC 2109, cookie domains must contain at least one dot other than the // Per RFC 2109, cookie domains must contain at least one dot other than the
// first. For hosts such as 'localhost', we don't set a cookie domain. // first. For hosts such as 'localhost', we don't set a cookie domain.
if (count(explode('.', $domain)) > 2) { if (count(explode('.', $domain)) > 2) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment