diff options
| author | xXx-caillou-xXx | 2017-12-20 18:05:54 +0100 |
|---|---|---|
| committer | jvoisin | 2017-12-20 18:05:54 +0100 |
| commit | 8d6cc4f2b63c3f0dc31fe6cecd34ac023ea1cccb (patch) | |
| tree | d2ddfd648c6c613308928bf340baf7787cfc7b42 /src/sp_cookie_encryption.c | |
| parent | a1675cd79b0df2478026573b0fac52464ef3c1b7 (diff) | |
Improve the previous commit
We can simply use the return value of the original `setcookie` :>
Diffstat (limited to 'src/sp_cookie_encryption.c')
| -rw-r--r-- | src/sp_cookie_encryption.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/sp_cookie_encryption.c b/src/sp_cookie_encryption.c index 0e279ed..b7050da 100644 --- a/src/sp_cookie_encryption.c +++ b/src/sp_cookie_encryption.c | |||
| @@ -137,7 +137,6 @@ PHP_FUNCTION(sp_setcookie) { | |||
| 137 | zend_string *name = NULL, *value = NULL, *path = NULL, *domain = NULL, *samesite = NULL; | 137 | zend_string *name = NULL, *value = NULL, *path = NULL, *domain = NULL, *samesite = NULL; |
| 138 | zend_long expires = 0; | 138 | zend_long expires = 0; |
| 139 | zend_bool secure = 0, httponly = 0; | 139 | zend_bool secure = 0, httponly = 0; |
| 140 | zval ret_val; | ||
| 141 | const sp_cookie *cookie_node = NULL; | 140 | const sp_cookie *cookie_node = NULL; |
| 142 | zval func_name; | 141 | zval func_name; |
| 143 | char *cookie_samesite; | 142 | char *cookie_samesite; |
| @@ -229,7 +228,7 @@ PHP_FUNCTION(sp_setcookie) { | |||
| 229 | CG(function_table), "setcookie", strlen("setcookie")); | 228 | CG(function_table), "setcookie", strlen("setcookie")); |
| 230 | func->handler = handler; | 229 | func->handler = handler; |
| 231 | 230 | ||
| 232 | call_user_function(CG(function_table), NULL, &func_name, &ret_val, 7, params); | 231 | call_user_function(CG(function_table), NULL, &func_name, return_value, 7, params); |
| 233 | 232 | ||
| 234 | func->handler = PHP_FN(sp_setcookie); | 233 | func->handler = PHP_FN(sp_setcookie); |
| 235 | RETURN_TRUE; | 234 | RETURN_TRUE; |
