From d1dc877fd6081b147c4fdcb94d9b0e54e1902047 Mon Sep 17 00:00:00 2001 From: Emanuele Panzeri Date: Wed, 3 Jan 2024 15:25:11 +0100 Subject: [PATCH] Fix setrawcookie() deprecation on null parameter (#304) --- lib/response/sfWebResponse.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/response/sfWebResponse.class.php b/lib/response/sfWebResponse.class.php index e1a78c9a3..675b02993 100644 --- a/lib/response/sfWebResponse.class.php +++ b/lib/response/sfWebResponse.class.php @@ -359,7 +359,8 @@ public function sendHttpHeaders() // cookies foreach ($this->cookies as $cookie) { $expire = isset($cookie['expire']) ? $cookie['expire'] : 0; - setrawcookie($cookie['name'], $cookie['value'], $expire, $cookie['path'], $cookie['domain'], $cookie['secure'], $cookie['httpOnly']); + $domain = isset($cookie['domain']) ? $cookie['domain'] : ''; + setrawcookie($cookie['name'], $cookie['value'], $expire, $cookie['path'], $domain, $cookie['secure'], $cookie['httpOnly']); if ($this->options['logging']) { $this->dispatcher->notify(new sfEvent($this, 'application.log', array(sprintf('Send cookie "%s": "%s"', $cookie['name'], $cookie['value']))));