diff options
Diffstat (limited to '')
5 files changed, 35 insertions, 2 deletions
diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index e46b1bc..81122a1 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml | |||
| @@ -11,6 +11,7 @@ jobs: | |||
| 11 | strategy: | 11 | strategy: |
| 12 | matrix: | 12 | matrix: |
| 13 | container: | 13 | container: |
| 14 | - php:8.5.0beta2 | ||
| 14 | - php:8.4 | 15 | - php:8.4 |
| 15 | - php:8.3 | 16 | - php:8.3 |
| 16 | - php:8.2 | 17 | - php:8.2 |
diff --git a/src/sp_cookie_encryption.c b/src/sp_cookie_encryption.c index c833f94..34b1e8f 100644 --- a/src/sp_cookie_encryption.c +++ b/src/sp_cookie_encryption.c | |||
| @@ -45,10 +45,24 @@ static zend_string *encrypt_data(zend_string *data) { | |||
| 45 | return z; | 45 | return z; |
| 46 | } | 46 | } |
| 47 | 47 | ||
| 48 | /* | ||
| 49 | /__w/snuffleupagus/snuffleupagus/src/sp_cookie_encryption.c: In function 'zif_sp_setcookie': | ||
| 50 | /__w/snuffleupagus/snuffleupagus/src/sp_cookie_encryption.c:135:7: error: too many arguments to function 'php_head_parse_cookie_options_array' | ||
| 51 | 135 | php_head_parse_cookie_options_array(expires_or_options, &expires, &path, | ||
| 52 | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
| 53 | /__w/snuffleupagus/snuffleupagus/src/sp_cookie_encryption.c:49:13: note: declared here | ||
| 54 | 49 | static void php_head_parse_cookie_options_array( | ||
| 55 | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
| 56 | */ | ||
| 57 | |||
| 48 | #if PHP_VERSION_ID >= 70300 | 58 | #if PHP_VERSION_ID >= 70300 |
| 49 | static void php_head_parse_cookie_options_array( | 59 | static void php_head_parse_cookie_options_array( |
| 50 | zval *options, zend_long *expires, zend_string **path, zend_string **domain, | 60 | zval *options, zend_long *expires, zend_string **path, zend_string **domain, |
| 51 | zend_bool *secure, zend_bool *httponly, zend_string **samesite) { | 61 | zend_bool *secure, zend_bool *httponly, zend_string **samesite |
| 62 | #if PHP_VERSION_ID >= 80500 | ||
| 63 | ,bool *partitioned | ||
| 64 | #endif | ||
| 65 | ) { | ||
| 52 | int found = 0; | 66 | int found = 0; |
| 53 | zend_string *key; | 67 | zend_string *key; |
| 54 | zval *value; | 68 | zval *value; |
| @@ -73,6 +87,11 @@ static void php_head_parse_cookie_options_array( | |||
| 73 | } else if (zend_string_equals_literal_ci(key, "samesite")) { | 87 | } else if (zend_string_equals_literal_ci(key, "samesite")) { |
| 74 | *samesite = zval_get_string(value); | 88 | *samesite = zval_get_string(value); |
| 75 | found++; | 89 | found++; |
| 90 | #if PHP_VERSION_ID >= 80500 | ||
| 91 | } else if (zend_string_equals_literal_ci(key, "partitioned")) { | ||
| 92 | *partitioned = zval_is_true(value); | ||
| 93 | found++; | ||
| 94 | #endif | ||
| 76 | } else { | 95 | } else { |
| 77 | php_error_docref(NULL, E_WARNING, | 96 | php_error_docref(NULL, E_WARNING, |
| 78 | "Unrecognized key '%s' found in the options array", | 97 | "Unrecognized key '%s' found in the options array", |
| @@ -94,6 +113,9 @@ static void php_head_parse_cookie_options_array( | |||
| 94 | #endif | 113 | #endif |
| 95 | 114 | ||
| 96 | PHP_FUNCTION(sp_setcookie) { | 115 | PHP_FUNCTION(sp_setcookie) { |
| 116 | #if PHP_VERSION_ID >= 80500 | ||
| 117 | zend_bool partitioned; | ||
| 118 | #endif | ||
| 97 | zend_string *name = NULL, *value = NULL, *path = NULL, *domain = NULL, | 119 | zend_string *name = NULL, *value = NULL, *path = NULL, *domain = NULL, |
| 98 | *value_enc = NULL, | 120 | *value_enc = NULL, |
| 99 | #if PHP_VERSION_ID < 70300 | 121 | #if PHP_VERSION_ID < 70300 |
| @@ -133,7 +155,11 @@ PHP_FUNCTION(sp_setcookie) { | |||
| 133 | } | 155 | } |
| 134 | php_head_parse_cookie_options_array(expires_or_options, &expires, &path, | 156 | php_head_parse_cookie_options_array(expires_or_options, &expires, &path, |
| 135 | &domain, &secure, &httponly, | 157 | &domain, &secure, &httponly, |
| 158 | #if PHP_VERSION_ID < 80500 | ||
| 136 | &samesite); | 159 | &samesite); |
| 160 | #else | ||
| 161 | &samesite, &partitioned); | ||
| 162 | #endif | ||
| 137 | } else { | 163 | } else { |
| 138 | expires = zval_get_long(expires_or_options); | 164 | expires = zval_get_long(expires_or_options); |
| 139 | } | 165 | } |
| @@ -194,9 +220,12 @@ PHP_FUNCTION(sp_setcookie) { | |||
| 194 | if (php_setcookie(name, (value_enc ? value_enc : value), expires, | 220 | if (php_setcookie(name, (value_enc ? value_enc : value), expires, |
| 195 | (path_samesite ? path_samesite : path), domain, secure, 1, | 221 | (path_samesite ? path_samesite : path), domain, secure, 1, |
| 196 | httponly) == SUCCESS) { | 222 | httponly) == SUCCESS) { |
| 197 | #else | 223 | #elif PHP_VERSION_ID < 80500 |
| 198 | if (php_setcookie(name, (value_enc ? value_enc : value), expires, path, | 224 | if (php_setcookie(name, (value_enc ? value_enc : value), expires, path, |
| 199 | domain, secure, httponly, samesite, 1) == SUCCESS) { | 225 | domain, secure, httponly, samesite, 1) == SUCCESS) { |
| 226 | #else | ||
| 227 | if (php_setcookie(name, (value_enc ? value_enc : value), expires, path, | ||
| 228 | domain, secure, httponly, samesite, partitioned, false) == SUCCESS) { | ||
| 200 | #endif | 229 | #endif |
| 201 | RETVAL_TRUE; | 230 | RETVAL_TRUE; |
| 202 | } else { | 231 | } else { |
diff --git a/src/tests/disable_function/disabled_functions_shell_exec_backtick.phpt b/src/tests/disable_function/disabled_functions_shell_exec_backtick.phpt index aeb64c2..6f53cea 100644 --- a/src/tests/disable_function/disabled_functions_shell_exec_backtick.phpt +++ b/src/tests/disable_function/disabled_functions_shell_exec_backtick.phpt | |||
| @@ -4,6 +4,7 @@ Disable functions - shell_exec via backtick operator | |||
| 4 | <?php if (!extension_loaded("snuffleupagus")) print "skip"; ?> | 4 | <?php if (!extension_loaded("snuffleupagus")) print "skip"; ?> |
| 5 | --INI-- | 5 | --INI-- |
| 6 | sp.configuration_file={PWD}/config/disabled_functions_extra.ini | 6 | sp.configuration_file={PWD}/config/disabled_functions_extra.ini |
| 7 | error_reporting = E_ALL & ~E_DEPRECATED | ||
| 7 | --FILE-- | 8 | --FILE-- |
| 8 | <?php | 9 | <?php |
| 9 | echo `ls`; | 10 | echo `ls`; |
diff --git a/src/tests/disable_function/disabled_functions_shell_exec_backtick_var.phpt b/src/tests/disable_function/disabled_functions_shell_exec_backtick_var.phpt index a312acf..6ea5865 100644 --- a/src/tests/disable_function/disabled_functions_shell_exec_backtick_var.phpt +++ b/src/tests/disable_function/disabled_functions_shell_exec_backtick_var.phpt | |||
| @@ -4,6 +4,7 @@ Disable functions - shell_exec via backtick operator in context of a var name | |||
| 4 | <?php if (!extension_loaded("snuffleupagus")) print "skip"; ?> | 4 | <?php if (!extension_loaded("snuffleupagus")) print "skip"; ?> |
| 5 | --INI-- | 5 | --INI-- |
| 6 | sp.configuration_file={PWD}/config/disabled_functions_extra.ini | 6 | sp.configuration_file={PWD}/config/disabled_functions_extra.ini |
| 7 | error_reporting = E_ALL & ~E_DEPRECATED | ||
| 7 | --FILE-- | 8 | --FILE-- |
| 8 | <?php | 9 | <?php |
| 9 | echo ${`ls`}; | 10 | echo ${`ls`}; |
diff --git a/src/tests/disable_function/disabled_functions_shell_exec_backtick_var_string.phpt b/src/tests/disable_function/disabled_functions_shell_exec_backtick_var_string.phpt index ea77a7d..f117568 100644 --- a/src/tests/disable_function/disabled_functions_shell_exec_backtick_var_string.phpt +++ b/src/tests/disable_function/disabled_functions_shell_exec_backtick_var_string.phpt | |||
| @@ -4,6 +4,7 @@ Disable functions - shell_exec via backtick operator in context of a var name in | |||
| 4 | <?php if (!extension_loaded("snuffleupagus")) print "skip"; ?> | 4 | <?php if (!extension_loaded("snuffleupagus")) print "skip"; ?> |
| 5 | --INI-- | 5 | --INI-- |
| 6 | sp.configuration_file={PWD}/config/disabled_functions_extra.ini | 6 | sp.configuration_file={PWD}/config/disabled_functions_extra.ini |
| 7 | error_reporting = E_ALL & ~E_DEPRECATED | ||
| 7 | --FILE-- | 8 | --FILE-- |
| 8 | <?php | 9 | <?php |
| 9 | echo "{${`ls`}}"; | 10 | echo "{${`ls`}}"; |
