aports/testing/php85-pecl-xdebug/fix-setcookie.patch

27 lines
1.1 KiB
Diff

Patch-Source: https://github.com/xdebug/xdebug/commit/0e52f8ae66029c16bd38e540336f84c36b47ef17
From 0e52f8ae66029c16bd38e540336f84c36b47ef17 Mon Sep 17 00:00:00 2001
From: Derick Rethans <github@derickrethans.nl>
Date: Thu, 21 Aug 2025 15:41:20 +0100
Subject: [PATCH] PHP 8.5: php_setcookie API change
---
src/lib/compat.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/lib/compat.c b/src/lib/compat.c
index 73b1add8c..e4193ce39 100644
--- a/src/lib/compat.c
+++ b/src/lib/compat.c
@@ -371,7 +371,11 @@ void xdebug_setcookie(const char *name, int name_len, char *value, int value_len
zend_string *domain_s = domain ? zend_string_init(domain, domain_len, 0) : NULL;
zend_string *samesite_s = zend_string_init("Lax", sizeof("Lax") - 1, 0);
+#if PHP_VERSION_ID >= 80500
+ php_setcookie(name_s, value_s, expires, path_s, domain_s, secure, httponly, samesite_s, false, url_encode);
+#else
php_setcookie(name_s, value_s, expires, path_s, domain_s, secure, httponly, samesite_s, url_encode);
+#endif
zend_string_release(samesite_s);
name ? zend_string_release(name_s) : 0;