summaryrefslogtreecommitdiff
path: root/src/sp_cookie_encryption.c
diff options
context:
space:
mode:
authorxXx-caillou-xXx2017-12-18 16:27:00 +0100
committerjvoisin2017-12-18 16:27:00 +0100
commitf70bd2eafc2fdac9fa528a3e649db0178c601b41 (patch)
tree5bde4b106b3e24a49bdb061c9eca2ecfe68b9bbc /src/sp_cookie_encryption.c
parent75f876fca7587218fdbad9bd10bbe52825591ccc (diff)
Fix cookie encryption
Previously, when a cookie was set with the `httpOnly` flag, it was automatically encrypted, due to a logic flaw. This is now fixed and tested.
Diffstat (limited to 'src/sp_cookie_encryption.c')
-rw-r--r--src/sp_cookie_encryption.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/sp_cookie_encryption.c b/src/sp_cookie_encryption.c
index 08be9a6..5189c20 100644
--- a/src/sp_cookie_encryption.c
+++ b/src/sp_cookie_encryption.c
@@ -180,7 +180,7 @@ PHP_FUNCTION(sp_setcookie) {
180 } 180 }
181 181
182 /* Shall we encrypt the cookie's value? */ 182 /* Shall we encrypt the cookie's value? */
183 if (httponly && value) { 183 if (cookie_node && cookie_node->encrypt && value) {
184 zend_string *encrypted_data = encrypt_data(value->val, value->len); 184 zend_string *encrypted_data = encrypt_data(value->val, value->len);
185 ZVAL_STR_COPY(&params[1], encrypted_data); 185 ZVAL_STR_COPY(&params[1], encrypted_data);
186 zend_string_release(encrypted_data); 186 zend_string_release(encrypted_data);