summaryrefslogtreecommitdiff
path: root/ext/standard/head.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/standard/head.c')
-rw-r--r--ext/standard/head.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/ext/standard/head.c b/ext/standard/head.c
index e8b5d5b171..f1b2fa4e8b 100644
--- a/ext/standard/head.c
+++ b/ext/standard/head.c
@@ -258,10 +258,12 @@ PHP_FUNCTION(setcookie)
}
}
- if (php_setcookie(name, value, expires, path, domain, secure, httponly, samesite, 1) == SUCCESS) {
- RETVAL_TRUE;
- } else {
- RETVAL_FALSE;
+ if (!EG(exception)) {
+ if (php_setcookie(name, value, expires, path, domain, secure, httponly, samesite, 1) == SUCCESS) {
+ RETVAL_TRUE;
+ } else {
+ RETVAL_FALSE;
+ }
}
if (expires_or_options && Z_TYPE_P(expires_or_options) == IS_ARRAY) {
@@ -311,10 +313,12 @@ PHP_FUNCTION(setrawcookie)
}
}
- if (php_setcookie(name, value, expires, path, domain, secure, httponly, samesite, 0) == SUCCESS) {
- RETVAL_TRUE;
- } else {
- RETVAL_FALSE;
+ if (!EG(exception)) {
+ if (php_setcookie(name, value, expires, path, domain, secure, httponly, samesite, 0) == SUCCESS) {
+ RETVAL_TRUE;
+ } else {
+ RETVAL_FALSE;
+ }
}
if (expires_or_options && Z_TYPE_P(expires_or_options) == IS_ARRAY) {