Difference between
modified post 27ebe7 by Anonymous on Mon 9th Apr 2012 13:49
original post 616fc4 by Anonymous on Fri 9th Mar 2012 18:09
Download diff
Show
old version |
new version |
both versions
| 1 | 1 | --- a/execute.c | |
| 2 | 2 | +++ b/execute.c | |
| 3 | 3 | @@ -35,6 +35,7 @@ | |
| 4 | 4 | #include "zend_compile.h" | |
| 5 | 5 | #include "zend_llist.h" | |
| 6 | 6 | #include "SAPI.h" | |
| 7 | 7 | +#include "main/php_version.h" | |
| 8 | 8 | ||
| 9 | 9 | #include "sha256.h" | |
| 10 | 10 | ||
| 11 | 11 | @@ -1031,7 +1032,9 @@ | |
| 12 | 12 | ||
| 13 | 13 | if ((str_length == sizeof("</head>\n")-1) && (strcmp(str, "</head>\n")==0)) { | |
| 14 | 14 | SUHOSIN_G(old_php_body_write)(S_META_ROBOTS, sizeof(S_META_ROBOTS)-1 TSRMLS_CC); | |
| 15 | 15 | +#if PHP_VERSION_ID < 50400 | |
| 16 | 16 | OG(php_body_write) = SUHOSIN_G(old_php_body_write); | |
| 17 | 17 | +#endif | |
| 18 | 18 | return SUHOSIN_G(old_php_body_write)(str, str_length TSRMLS_CC); | |
| 19 | 19 | } else if ((str_length == sizeof(P_META_ROBOTS)-1) && (strcmp(str, P_META_ROBOTS)==0)) { | |
| 20 | 20 | return str_length; | |
| 21 | 21 | @@ -1054,6 +1057,7 @@ | |
| 22 | 22 | } | |
| 23 | 23 | ||
| 24 | 24 | /* Andale! Andale! Yee-Hah! */ | |
| 25 | 25 | +#if PHP_VERSION_ID < 50400 | |
| 26 | 26 | php_start_ob_buffer(NULL, 4096, 0 TSRMLS_CC); | |
| 27 | 27 | if (!sapi_module.phpinfo_as_text) { | |
| 28 | 28 | SUHOSIN_G(old_php_body_write) = OG(php_body_write); | |
| 29 | 29 | @@ -1061,6 +1065,11 @@ | |
| 30 | 30 | } | |
| 31 | 31 | php_print_info(flag TSRMLS_CC); | |
| 32 | 32 | php_end_ob_buffer(1, 0 TSRMLS_CC); | |
| 33 | 33 | +#else | |
| 34 | 34 | + php_output_start_default(TSRMLS_CC); | |
| 35 | 35 | + php_print_info(flag TSRMLS_CC); | |
| 36 | 36 | + php_output_end(); | |
| 37 | 37 | +#endif | |
| 38 | 38 | ||
| 39 | 39 | RETVAL_TRUE; | |
| 40 | 40 | return (1); | |
| 41 | - | @@ -1606,8 +1615,14 @@ | |
| 41 | + | @@ -1133,7 +1142,6 @@ | |
| 42 | + | retval = 0; | |
| 42 | 43 | } | |
| 44 | + | } | |
| 43 | 52 | ||
| 53 | + | +#if PHP_VERSION_ID < 50400 // Disabled due to segfault | |
| 50 | 55 | +#endif | |
| 56 | + | ||
| 51 | 63 | + | |
| 64 | + | +#if PHP_VERSION_ID < 50400 | |
| 52 | 70 | +#else | |
| 53 | 71 | return_value = execute_data_ptr->Ts[execute_data_ptr->opline->result.u.var].var.ptr; | |
| 54 | 72 | #endif | |
| 55 | 73 | ht = execute_data_ptr->opline->extended_value; | |
| 56 | 74 | --- a/rfc1867.c | |
| 57 | 75 | +++ b/rfc1867.c | |
| 58 | 76 | @@ -35,6 +35,7 @@ | |
| 59 | 77 | #include "suhosin_rfc1867.h" | |
| 60 | 78 | #include "php_ini.h" | |
| 61 | 79 | #include "ext/standard/php_string.h" | |
| 62 | 80 | +#include "main/php_version.h" | |
| 63 | 81 | ||
| 64 | 82 | #define DEBUG_FILE_UPLOAD ZEND_DEBUG | |
| 65 | 83 | ||
| 66 | 84 | @@ -244,21 +245,29 @@ | |
| 67 | 85 | ||
| 68 | 86 | static void register_http_post_files_variable(char *strvar, char *val, zval *http_post_files, zend_bool override_protection TSRMLS_DC) | |
| 69 | 87 | { | |
| 70 | 88 | +#if PHP_VERSION_ID < 50400 | |
| 71 | 89 | int register_globals = PG(register_globals); | |
| 72 | 90 | ||
| 73 | 91 | PG(register_globals) = 0; | |
| 74 | 92 | +#endif | |
| 75 | 93 | safe_php_register_variable(strvar, val, http_post_files, override_protection TSRMLS_CC); | |
| 76 | 94 | +#if PHP_VERSION_ID < 50400 | |
| 77 | 95 | PG(register_globals) = register_globals; | |
| 78 | 96 | +#endif | |
| 79 | 97 | } | |
| 80 | 98 | ||
| 81 | 99 | ||
| 82 | 100 | static void register_http_post_files_variable_ex(char *var, zval *val, zval *http_post_files, zend_bool override_protection TSRMLS_DC) | |
| 83 | 101 | { | |
| 84 | 102 | +#if PHP_VERSION_ID < 50400 | |
| 85 | 103 | int register_globals = PG(register_globals); | |
| 86 | 104 | ||
| 87 | 105 | PG(register_globals) = 0; | |
| 88 | 106 | +#endif | |
| 89 | 107 | safe_php_register_variable_ex(var, val, http_post_files, override_protection TSRMLS_CC); | |
| 90 | 108 | +#if PHP_VERSION_ID < 50400 | |
| 91 | 109 | PG(register_globals) = register_globals; | |
| 92 | 110 | +#endif | |
| 93 | 111 | } | |
| 94 | 112 | ||
| 95 | 113 | /* | |
| 96 | 114 | --- a/session.c | |
| 97 | 115 | +++ b/session.c | |
| 98 | 116 | @@ -33,6 +33,7 @@ | |
| 99 | 117 | #include "ext/standard/php_smart_str.h" | |
| 100 | 118 | #include "ext/standard/php_var.h" | |
| 101 | 119 | #include "sha256.h" | |
| 102 | 120 | +#include "main/php_version.h" | |
| 103 | 121 | ||
| 104 | 122 | #include <fcntl.h> | |
| 105 | 123 | ||
| 106 | 124 | @@ -294,6 +295,7 @@ | |
| 107 | 125 | if (SESSION_G(http_session_vars) && SESSION_G(http_session_vars)->type == IS_ARRAY) { | |
| 108 | 126 | ret = zend_hash_find(Z_ARRVAL_P(SESSION_G(http_session_vars)), name, namelen + 1, (void **) state_var); | |
| 109 | 127 | ||
| 110 | 128 | +#if PHP_VERSION_ID < 50400 | |
| 111 | 129 | /* If register_globals is enabled, and | |
| 112 | 130 | * if there is an entry for the slot in $_SESSION, and | |
| 113 | 131 | * if that entry is still set to NULL, and | |
| 114 | 132 | @@ -307,6 +309,7 @@ | |
| 115 | 133 | *state_var = tmp; | |
| 116 | 134 | } | |
| 117 | 135 | } | |
| 118 | 136 | +#endif | |
| 119 | 137 | } | |
| 120 | 138 | return ret; | |
| 121 | 139 | } | |
| 122 | 140 | --- a/log.c | |
| 123 | 141 | +++ b/log.c | |
| 124 | 142 | @@ -31,6 +31,7 @@ | |
| 125 | 143 | #include "SAPI.h" | |
| 126 | 144 | #include "ext/standard/datetime.h" | |
| 127 | 145 | #include "ext/standard/flock_compat.h" | |
| 128 | 146 | +#include "main/php_version.h" | |
| 129 | 147 | ||
| 130 | 148 | #ifdef HAVE_SYS_SOCKET_H | |
| 131 | 149 | #include <sys/socket.h> | |
| 132 | 150 | @@ -317,7 +318,9 @@ | |
| 133 | 151 | zval *result = NULL; | |
| 134 | 152 | ||
| 135 | 153 | long orig_execution_depth = SUHOSIN_G(execution_depth); | |
| 136 | 154 | +#if PHP_VERSION_ID < 50400 | |
| 137 | 155 | zend_bool orig_safe_mode = PG(safe_mode); | |
| 138 | 156 | +#endif | |
| 139 | 157 | char *orig_basedir = PG(open_basedir); | |
| 140 | 158 | ||
| 141 | 159 | char *phpscript = SUHOSIN_G(log_phpscriptname); | |
| 142 | 160 | @@ -354,14 +357,18 @@ | |
| 143 | 161 | ||
| 144 | 162 | SUHOSIN_G(execution_depth) = 0; | |
| 145 | 163 | if (SUHOSIN_G(log_phpscript_is_safe)) { | |
| 146 | 164 | +#if PHP_VERSION_ID < 50400 | |
| 147 | 165 | PG(safe_mode) = 0; | |
| 148 | 166 | +#endif | |
| 149 | 167 | PG(open_basedir) = NULL; | |
| 150 | 168 | } | |
| 151 | 169 | ||
| 152 | 170 | zend_execute(new_op_array TSRMLS_CC); | |
| 153 | 171 | ||
| 154 | 172 | SUHOSIN_G(execution_depth) = orig_execution_depth; | |
| 155 | 173 | +#if PHP_VERSION_ID < 50400 | |
| 156 | 174 | PG(safe_mode) = orig_safe_mode; | |
| 157 | 175 | +#endif | |
| 158 | 176 | PG(open_basedir) = orig_basedir; | |
| 159 | 177 | ||
| 160 | 178 | #ifdef ZEND_ENGINE_2 | |
| 161 | 179 | --- a/sha256.c | |
| 162 | 180 | +++ b/sha256.c | |
| 163 | 181 | @@ -86,9 +86,11 @@ | |
| 164 | 182 | return; | |
| 165 | 183 | } | |
| 166 | 184 | ||
| 167 | 185 | +#if PHP_VERSION_ID < 50400 | |
| 168 | 186 | if (PG(safe_mode) && (!php_checkuid(arg, NULL, CHECKUID_CHECK_FILE_AND_DIR))) { | |
| 169 | 187 | RETURN_FALSE; | |
| 170 | 188 | } | |
| 171 | 189 | +#endif | |
| 172 | 190 | ||
| 173 | 191 | if (php_check_open_basedir(arg TSRMLS_CC)) { | |
| 174 | 192 | RETURN_FALSE; | |
| 175 | - | @@ -392,7 +394,11 @@ | |
| 193 | + | @@ -392,7 +394,7 @@ | |
| 176 | 194 | ||
| 177 | 195 | /* {{{ suhosin_sha256_functions[] | |
| 178 | 196 | */ | |
| 179 | - | +#if PHP_VERSION_ID < 50400 | |
| 197 | + | -static function_entry suhosin_sha256_functions[] = { | |
| 182 | 198 | +static zend_function_entry suhosin_sha256_functions[] = { | |
| 184 | 199 | PHP_NAMED_FE(sha256, PHP_FN(suhosin_sha256), NULL) | |
| 185 | 200 | PHP_NAMED_FE(sha256_file, PHP_FN(suhosin_sha256_file), NULL) | |
| 186 | 201 | {NULL, NULL, NULL} | |
| 187 | 202 | --- a/suhosin.c | |
| 188 | 203 | +++ b/suhosin.c | |
| 189 | 204 | @@ -646,12 +646,16 @@ | |
| 190 | 205 | array_init(gpc_element); | |
| 191 | 206 | zend_hash_next_index_insert(symtable1, &gpc_element, sizeof(zval *), (void **) &gpc_element_p); | |
| 192 | 207 | } else { | |
| 193 | 208 | +#if PHP_VERSION_ID < 50400 | |
| 194 | 209 | if (PG(magic_quotes_gpc) && (index != var)) { | |
| 195 | 210 | /* no need to addslashes() the index if it's the main variable name */ | |
| 196 | 211 | escaped_index = php_addslashes(index, index_len, &index_len, 0 TSRMLS_CC); | |
| 197 | 212 | } else { | |
| 198 | 213 | +#endif | |
| 199 | 214 | escaped_index = index; | |
| 200 | 215 | +#if PHP_VERSION_ID < 50400 | |
| 201 | 216 | } | |
| 202 | 217 | +#endif | |
| 203 | 218 | if (zend_symtable_find(symtable1, escaped_index, index_len + 1, (void **) &gpc_element_p) == FAILURE | |
| 204 | 219 | || Z_TYPE_PP(gpc_element_p) != IS_ARRAY) { | |
| 205 | 220 | MAKE_STD_ZVAL(gpc_element); | |
| 206 | 221 | @@ -683,11 +687,15 @@ | |
| 207 | 222 | if (!index) { | |
| 208 | 223 | zend_hash_next_index_insert(symtable1, &gpc_element, sizeof(zval *), (void **) &gpc_element_p); | |
| 209 | 224 | } else { | |
| 210 | 225 | +#if PHP_VERSION_ID < 50400 | |
| 211 | 226 | if (PG(magic_quotes_gpc)) { | |
| 212 | 227 | escaped_index = php_addslashes(index, index_len, &index_len, 0 TSRMLS_CC); | |
| 213 | 228 | } else { | |
| 214 | 229 | +#endif | |
| 215 | 230 | escaped_index = index; | |
| 216 | 231 | +#if PHP_VERSION_ID < 50400 | |
| 217 | 232 | } | |
| 218 | 233 | +#endif | |
| 219 | 234 | /* | |
| 220 | 235 | * According to rfc2965, more specific paths are listed above the less specific ones. | |
| 221 | 236 | * If we encounter a duplicate cookie name, we should skip it, since it is not possible | |
| 222 | 237 | @@ -714,11 +722,15 @@ | |
| 223 | 238 | ||
| 224 | 239 | /* Prepare value */ | |
| 225 | 240 | Z_STRLEN(new_entry) = str_len; | |
| 226 | 241 | +#if PHP_VERSION_ID < 50400 | |
| 227 | 242 | if (PG(magic_quotes_gpc)) { | |
| 228 | 243 | Z_STRVAL(new_entry) = php_addslashes(strval, Z_STRLEN(new_entry), &Z_STRLEN(new_entry), 0 TSRMLS_CC); | |
| 229 | 244 | } else { | |
| 230 | 245 | +#endif | |
| 231 | 246 | Z_STRVAL(new_entry) = estrndup(strval, Z_STRLEN(new_entry)); | |
| 232 | 247 | +#if PHP_VERSION_ID < 50400 | |
| 233 | 248 | } | |
| 234 | 249 | +#endif | |
| 235 | 250 | Z_TYPE(new_entry) = IS_STRING; | |
| 236 | 251 | ||
| 237 | 252 | suhosin_register_cookie_variable(var, &new_entry, track_vars_array TSRMLS_CC); | |
| 238 | 253 | --- a/ex_imp.c | |
| 239 | 254 | +++ b/ex_imp.c | |
| 240 | - | @@ -727,7 +727,11 @@ | |
| 255 | + | @@ -727,7 +727,7 @@ | |
| 241 | 256 | ||
| 242 | 257 | /* {{{ suhosin_ex_imp_functions[] | |
| 243 | 258 | */ | |
| 244 | - | +#if PHP_VERSION_ID < 50400 | |
| 259 | + | -function_entry suhosin_ex_imp_functions[] = { | |
| 247 | 260 | +zend_function_entry suhosin_ex_imp_functions[] = { | |
| 249 | 261 | PHP_NAMED_FE(extract, PHP_FN(suhosin_extract), suhosin_arginfo_extract) | |
| 250 | 262 | PHP_NAMED_FE(import_request_variables, PHP_FN(suhosin_import_request_variables), suhosin_arginfo_import_request_variables) | |
| 251 | 263 | {NULL, NULL, NULL} | |
| 252 | 264 |
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.
kpaste.net RSS