diff options
Diffstat (limited to 'main')
66 files changed, 165 insertions, 149 deletions
diff --git a/main/SAPI.c b/main/SAPI.c index e80dcb01ec..50ea8c0a16 100644 --- a/main/SAPI.c +++ b/main/SAPI.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -739,7 +739,7 @@ SAPI_API int sapi_header_op(sapi_header_op_enum op, void *arg TSRMLS_DC) return SUCCESS; } else { /* new line/NUL character safety check */ - int i; + uint i; for (i = 0; i < header_line_len; i++) { /* RFC 2616 allows new lines if followed by SP or HT */ int illegal_break = @@ -790,7 +790,7 @@ SAPI_API int sapi_header_op(sapi_header_op_enum op, void *arg TSRMLS_DC) /* Disable possible output compression for images */ if (!strncmp(ptr, "image/", sizeof("image/")-1)) { zend_string *key = zend_string_init("zlib.output_compression", sizeof("zlib.output_compression")-1, 0); - zend_alter_ini_entry(key, "0", sizeof("0") - 1, PHP_INI_USER, PHP_INI_STAGE_RUNTIME); + zend_alter_ini_entry_chars(key, "0", sizeof("0") - 1, PHP_INI_USER, PHP_INI_STAGE_RUNTIME); zend_string_release(key); } @@ -818,7 +818,7 @@ SAPI_API int sapi_header_op(sapi_header_op_enum op, void *arg TSRMLS_DC) * portable between setups that have and don't have zlib compression * enabled globally. See req #44164 */ zend_string *key = zend_string_init("zlib.output_compression", sizeof("zlib.output_compression")-1, 0); - zend_alter_ini_entry(key, + zend_alter_ini_entry_chars(key, "0", sizeof("0") - 1, PHP_INI_USER, PHP_INI_STAGE_RUNTIME); zend_string_release(key); } else if (!STRCASECMP(header_line, "Location")) { diff --git a/main/SAPI.h b/main/SAPI.h index 9172a3e4dd..79661371d9 100644 --- a/main/SAPI.h +++ b/main/SAPI.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/build-defs.h.in b/main/build-defs.h.in index aa1fbf0321..6821b631f5 100644 --- a/main/build-defs.h.in +++ b/main/build-defs.h.in @@ -1,6 +1,6 @@ /* -*- C -*- +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2007 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/fopen_wrappers.c b/main/fopen_wrappers.c index 981c5c5a15..8d6bf3d0bc 100644 --- a/main/fopen_wrappers.c +++ b/main/fopen_wrappers.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -94,24 +94,24 @@ PHPAPI ZEND_INI_MH(OnUpdateBaseDir) if (stage == PHP_INI_STAGE_STARTUP || stage == PHP_INI_STAGE_SHUTDOWN || stage == PHP_INI_STAGE_ACTIVATE || stage == PHP_INI_STAGE_DEACTIVATE) { /* We're in a PHP_INI_SYSTEM context, no restrictions */ - *p = new_value; + *p = new_value ? new_value->val : NULL; return SUCCESS; } /* Otherwise we're in runtime */ if (!*p || !**p) { /* open_basedir not set yet, go ahead and give it a value */ - *p = new_value; + *p = new_value->val; return SUCCESS; } /* Shortcut: When we have a open_basedir and someone tries to unset, we know it'll fail */ - if (!new_value || !*new_value) { + if (!new_value || !*new_value->val) { return FAILURE; } /* Is the proposed open_basedir at least as restrictive as the current setting? */ - ptr = pathbuf = estrdup(new_value); + ptr = pathbuf = estrdup(new_value->val); while (ptr && *ptr) { end = strchr(ptr, DEFAULT_DIR_SEPARATOR); if (end != NULL) { @@ -128,7 +128,7 @@ PHPAPI ZEND_INI_MH(OnUpdateBaseDir) efree(pathbuf); /* Everything checks out, set it */ - *p = new_value; + *p = new_value->val; return SUCCESS; } @@ -226,12 +226,13 @@ PHPAPI int php_check_specific_open_basedir(const char *basedir, const char *path /* Resolve open_basedir to resolved_basedir */ if (expand_filepath(local_open_basedir, resolved_basedir TSRMLS_CC) != NULL) { + int basedir_len = (int)strlen(basedir); /* Handler for basedirs that end with a / */ - resolved_basedir_len = strlen(resolved_basedir); + resolved_basedir_len = (int)strlen(resolved_basedir); #if defined(PHP_WIN32) || defined(NETWARE) - if (basedir[strlen(basedir) - 1] == PHP_DIR_SEPARATOR || basedir[strlen(basedir) - 1] == '/') { + if (basedir[basedir_len - 1] == PHP_DIR_SEPARATOR || basedir[basedir_len - 1] == '/') { #else - if (basedir[strlen(basedir) - 1] == PHP_DIR_SEPARATOR) { + if (basedir[basedir_len - 1] == PHP_DIR_SEPARATOR) { #endif if (resolved_basedir[resolved_basedir_len - 1] != PHP_DIR_SEPARATOR) { resolved_basedir[resolved_basedir_len] = PHP_DIR_SEPARATOR; @@ -758,10 +759,15 @@ PHPAPI char *expand_filepath_with_mode(const char *filepath, char *real_path, co cwd_state new_state; char cwd[MAXPATHLEN]; int copy_len; + int path_len; if (!filepath[0]) { return NULL; - } else if (IS_ABSOLUTE_PATH(filepath, strlen(filepath))) { + } + + path_len = (int)strlen(filepath); + + if (IS_ABSOLUTE_PATH(filepath, path_len)) { cwd[0] = '\0'; } else { const char *iam = SG(request_info).path_translated; @@ -784,7 +790,7 @@ PHPAPI char *expand_filepath_with_mode(const char *filepath, char *real_path, co /* return a relative file path if for any reason * we cannot cannot getcwd() and the requested, * relatively referenced file is accessible */ - copy_len = strlen(filepath) > MAXPATHLEN - 1 ? MAXPATHLEN - 1 : strlen(filepath); + copy_len = path_len > MAXPATHLEN - 1 ? MAXPATHLEN - 1 : path_len; if (real_path) { memcpy(real_path, filepath, copy_len); real_path[copy_len] = '\0'; diff --git a/main/fopen_wrappers.h b/main/fopen_wrappers.h index 4dde0e35eb..b58f54dce8 100644 --- a/main/fopen_wrappers.h +++ b/main/fopen_wrappers.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/getopt.c b/main/getopt.c index 315467a095..8126d577b4 100644 --- a/main/getopt.c +++ b/main/getopt.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/internal_functions.c.in b/main/internal_functions.c.in index f1e66b160a..3f02921ddf 100644 --- a/main/internal_functions.c.in +++ b/main/internal_functions.c.in @@ -1,6 +1,6 @@ /* -*- C -*- +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2007 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/internal_functions_nw.c b/main/internal_functions_nw.c index 86ba57d486..dcb84c346c 100644 --- a/main/internal_functions_nw.c +++ b/main/internal_functions_nw.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/internal_functions_win32.c b/main/internal_functions_win32.c index 8b5518ca90..355013f501 100644 --- a/main/internal_functions_win32.c +++ b/main/internal_functions_win32.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/main.c b/main/main.c index 9338fee8d2..63144de418 100644 --- a/main/main.c +++ b/main/main.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -163,7 +163,7 @@ static PHP_INI_MH(OnSetPrecision) { zend_long i; - ZEND_ATOL(i, new_value); + ZEND_ATOL(i, new_value->val); if (i >= 0) { EG(precision) = i; return SUCCESS; @@ -178,7 +178,7 @@ static PHP_INI_MH(OnSetPrecision) static PHP_INI_MH(OnChangeMemoryLimit) { if (new_value) { - PG(memory_limit) = zend_atol(new_value, new_value_length); + PG(memory_limit) = zend_atol(new_value->val, new_value->len); } else { PG(memory_limit) = 1<<30; /* effectively, no limit */ } @@ -319,11 +319,11 @@ static PHP_INI_MH(OnUpdateTimeout) { if (stage==PHP_INI_STAGE_STARTUP) { /* Don't set a timeout on startup, only per-request */ - ZEND_ATOL(EG(timeout_seconds), new_value); + ZEND_ATOL(EG(timeout_seconds), new_value->val); return SUCCESS; } zend_unset_timeout(TSRMLS_C); - ZEND_ATOL(EG(timeout_seconds), new_value); + ZEND_ATOL(EG(timeout_seconds), new_value->val); zend_set_timeout(EG(timeout_seconds), 0); return SUCCESS; } @@ -364,7 +364,7 @@ static int php_get_display_errors_mode(char *value, int value_length) */ static PHP_INI_MH(OnUpdateDisplayErrors) { - PG(display_errors) = (zend_bool) php_get_display_errors_mode(new_value, new_value_length); + PG(display_errors) = (zend_bool) php_get_display_errors_mode(new_value->val, new_value->len); return SUCCESS; } @@ -379,11 +379,11 @@ static PHP_INI_DISP(display_errors_mode) TSRMLS_FETCH(); if (type == ZEND_INI_DISPLAY_ORIG && ini_entry->modified) { - tmp_value = (ini_entry->orig_value ? ini_entry->orig_value : NULL ); - tmp_value_length = ini_entry->orig_value_length; + tmp_value = (ini_entry->orig_value ? ini_entry->orig_value->val : NULL ); + tmp_value_length = ini_entry->orig_value->len; } else if (ini_entry->value) { - tmp_value = ini_entry->value; - tmp_value_length = ini_entry->value_length; + tmp_value = ini_entry->value->val; + tmp_value_length = ini_entry->value->len; } else { tmp_value = NULL; tmp_value_length = 0; @@ -423,9 +423,9 @@ static PHP_INI_DISP(display_errors_mode) static PHP_INI_MH(OnUpdateInternalEncoding) { if (new_value) { - OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); + OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); } else { - OnUpdateString(entry, SG(default_charset), strlen(SG(default_charset))+1, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); + PG(internal_encoding) = SG(default_charset); } return SUCCESS; } @@ -436,9 +436,9 @@ static PHP_INI_MH(OnUpdateInternalEncoding) static PHP_INI_MH(OnUpdateInputEncoding) { if (new_value) { - OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); + OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); } else { - OnUpdateString(entry, SG(default_charset), strlen(SG(default_charset))+1, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); + PG(input_encoding) = SG(default_charset); } return SUCCESS; } @@ -449,9 +449,9 @@ static PHP_INI_MH(OnUpdateInputEncoding) static PHP_INI_MH(OnUpdateOutputEncoding) { if (new_value) { - OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); + OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); } else { - OnUpdateString(entry, SG(default_charset), strlen(SG(default_charset))+1, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); + PG(output_encoding) = SG(default_charset); } return SUCCESS; } @@ -462,12 +462,12 @@ static PHP_INI_MH(OnUpdateOutputEncoding) static PHP_INI_MH(OnUpdateErrorLog) { /* Only do the safemode/open_basedir check at runtime */ - if ((stage == PHP_INI_STAGE_RUNTIME || stage == PHP_INI_STAGE_HTACCESS) && new_value && strcmp(new_value, "syslog")) { - if (PG(open_basedir) && php_check_open_basedir(new_value TSRMLS_CC)) { + if ((stage == PHP_INI_STAGE_RUNTIME || stage == PHP_INI_STAGE_HTACCESS) && new_value && strcmp(new_value->val, "syslog")) { + if (PG(open_basedir) && php_check_open_basedir(new_value->val TSRMLS_CC)) { return FAILURE; } } - OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); + OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); return SUCCESS; } /* }}} */ @@ -478,11 +478,11 @@ static PHP_INI_MH(OnUpdateMailLog) { /* Only do the safemode/open_basedir check at runtime */ if ((stage == PHP_INI_STAGE_RUNTIME || stage == PHP_INI_STAGE_HTACCESS) && new_value) { - if (PG(open_basedir) && php_check_open_basedir(new_value TSRMLS_CC)) { + if (PG(open_basedir) && php_check_open_basedir(new_value->val TSRMLS_CC)) { return FAILURE; } } - OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); + OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); return SUCCESS; } /* }}} */ @@ -1130,7 +1130,7 @@ static void php_error_cb(int type, const char *error_filename, const uint error_ if (PG(display_errors) && ((module_initialized && !PG(during_request_startup)) || (PG(display_startup_errors)))) { if (PG(xmlrpc_errors)) { - php_printf("<?xml version=\"1.0\"?><methodResponse><fault><value><struct><member><name>faultCode</name><value><int>%ld</int></value></member><member><name>faultString</name><value><string>%s:%s in %s on line %d</string></value></member></struct></value></fault></methodResponse>", PG(xmlrpc_error_number), error_type_str, buffer, error_filename, error_lineno); + php_printf("<?xml version=\"1.0\"?><methodResponse><fault><value><struct><member><name>faultCode</name><value><int>%pd</int></value></member><member><name>faultString</name><value><string>%s:%s in %s on line %d</string></value></member></struct></value></fault></methodResponse>", PG(xmlrpc_error_number), error_type_str, buffer, error_filename, error_lineno); } else { char *prepend_string = INI_STR("error_prepend_string"); char *append_string = INI_STR("error_append_string"); @@ -1149,10 +1149,10 @@ static void php_error_cb(int type, const char *error_filename, const uint error_ PG(display_errors) == PHP_DISPLAY_ERRORS_STDERR ) { #ifdef PHP_WIN32 - fprintf(stderr, "%s: %s in %s on line %d\n", error_type_str, buffer, error_filename, error_lineno); + fprintf(stderr, "%s: %s in %s on line %u\n", error_type_str, buffer, error_filename, error_lineno); fflush(stderr); #else - fprintf(stderr, "%s: %s in %s on line %d\n", error_type_str, buffer, error_filename, error_lineno); + fprintf(stderr, "%s: %s in %s on line %u\n", error_type_str, buffer, error_filename, error_lineno); #endif } else { php_printf("%s\n%s: %s in %s on line %d\n%s", STR_PRINT(prepend_string), error_type_str, buffer, error_filename, error_lineno, STR_PRINT(append_string)); @@ -1341,7 +1341,7 @@ PHP_FUNCTION(set_time_limit) new_timeout_strlen = zend_spprintf(&new_timeout_str, 0, ZEND_LONG_FMT, new_timeout); key = zend_string_init("max_execution_time", sizeof("max_execution_time")-1, 0); - if (zend_alter_ini_entry_ex(key, new_timeout_str, new_timeout_strlen, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0 TSRMLS_CC) == SUCCESS) { + if (zend_alter_ini_entry_chars_ex(key, new_timeout_str, new_timeout_strlen, PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0 TSRMLS_CC) == SUCCESS) { RETVAL_TRUE; } else { RETVAL_FALSE; @@ -1439,16 +1439,9 @@ static char *php_resolve_path_for_zend(const char *filename, int filename_len TS /* {{{ php_get_configuration_directive_for_zend */ -static int php_get_configuration_directive_for_zend(const char *name, uint name_length, zval *contents) +static zval *php_get_configuration_directive_for_zend(zend_string *name) { - zval *retval = cfg_get_entry(name, name_length); - - if (retval) { - *contents = *retval; - return SUCCESS; - } else { - return FAILURE; - } + return cfg_get_entry_ex(name); } /* }}} */ @@ -2030,7 +2023,7 @@ void dummy_invalid_parameter_handler( called = 1; if (function) { if (file) { - len = _snprintf(buf, sizeof(buf)-1, "Invalid parameter detected in CRT function '%ws' (%ws:%d)", function, file, line); + len = _snprintf(buf, sizeof(buf)-1, "Invalid parameter detected in CRT function '%ws' (%ws:%u)", function, file, line); } else { len = _snprintf(buf, sizeof(buf)-1, "Invalid parameter detected in CRT function '%ws'", function); } diff --git a/main/network.c b/main/network.c index 0b018c2e87..bb21f0ffe4 100644 --- a/main/network.c +++ b/main/network.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/output.c b/main/output.c index b51892c140..f44ae178b4 100644 --- a/main/output.c +++ b/main/output.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/php.h b/main/php.h index 47e1e10733..2a683e1924 100644 --- a/main/php.h +++ b/main/php.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -281,9 +281,12 @@ ssize_t pread(int, void *, size_t, off64_t); BEGIN_EXTERN_C() void phperror(char *error); PHPAPI size_t php_write(void *buf, size_t size TSRMLS_DC); -PHPAPI size_t php_printf(const char *format, ...); +PHPAPI size_t php_printf(const char *format, ...) PHP_ATTRIBUTE_FORMAT(printf, 1, + 2); PHPAPI int php_get_module_initialized(void); PHPAPI void php_log_err(char *log_message TSRMLS_DC); +int Debug(char *format, ...) PHP_ATTRIBUTE_FORMAT(printf, 1, 2); +int cfgparse(void); END_EXTERN_C() #define php_error zend_error @@ -305,9 +308,12 @@ PHPAPI void php_verror(const char *docref, const char *params, int type, const c #endif /* PHPAPI void php_error(int type, const char *format, ...); */ -PHPAPI void php_error_docref0(const char *docref TSRMLS_DC, int type, const char *format, ...); -PHPAPI void php_error_docref1(const char *docref TSRMLS_DC, const char *param1, int type, const char *format, ...); -PHPAPI void php_error_docref2(const char *docref TSRMLS_DC, const char *param1, const char *param2, int type, const char *format, ...); +PHPAPI void php_error_docref0(const char *docref TSRMLS_DC, int type, const char *format, ...) + PHP_ATTRIBUTE_FORMAT(printf, PHP_ATTR_FMT_OFFSET + 3, PHP_ATTR_FMT_OFFSET + 4); +PHPAPI void php_error_docref1(const char *docref TSRMLS_DC, const char *param1, int type, const char *format, ...) + PHP_ATTRIBUTE_FORMAT(printf, PHP_ATTR_FMT_OFFSET + 4, PHP_ATTR_FMT_OFFSET + 5); +PHPAPI void php_error_docref2(const char *docref TSRMLS_DC, const char *param1, const char *param2, int type, const char *format, ...) + PHP_ATTRIBUTE_FORMAT(printf, PHP_ATTR_FMT_OFFSET + 5, PHP_ATTR_FMT_OFFSET + 6); #ifdef PHP_WIN32 PHPAPI void php_win32_docref2_from_error(DWORD error, const char *param1, const char *param2 TSRMLS_DC); #endif diff --git a/main/php_compat.h b/main/php_compat.h index 20951ba427..5e6af03c59 100644 --- a/main/php_compat.h +++ b/main/php_compat.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/php_content_types.c b/main/php_content_types.c index c8db921421..8765a507bc 100644 --- a/main/php_content_types.c +++ b/main/php_content_types.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/php_content_types.h b/main/php_content_types.h index ed5346c843..0a49d1e2cd 100644 --- a/main/php_content_types.h +++ b/main/php_content_types.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/php_getopt.h b/main/php_getopt.h index f536ac8a96..8f70181786 100644 --- a/main/php_getopt.h +++ b/main/php_getopt.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/php_globals.h b/main/php_globals.h index 14d0a03868..a60efe69de 100644 --- a/main/php_globals.h +++ b/main/php_globals.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/php_ini.c b/main/php_ini.c index 783802c806..c90dc9f29f 100644 --- a/main/php_ini.c +++ b/main/php_ini.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -83,9 +83,9 @@ static void php_ini_displayer_cb(zend_ini_entry *ini_entry, int type TSRMLS_DC) uint display_string_length, esc_html=0; if (type == ZEND_INI_DISPLAY_ORIG && ini_entry->modified) { - if (ini_entry->orig_value && ini_entry->orig_value[0]) { - display_string = ini_entry->orig_value; - display_string_length = ini_entry->orig_value_length; + if (ini_entry->orig_value && ini_entry->orig_value->val[0]) { + display_string = ini_entry->orig_value->val; + display_string_length = ini_entry->orig_value->len; esc_html = !sapi_module.phpinfo_as_text; } else { if (!sapi_module.phpinfo_as_text) { @@ -96,9 +96,9 @@ static void php_ini_displayer_cb(zend_ini_entry *ini_entry, int type TSRMLS_DC) display_string_length = sizeof("no value") - 1; } } - } else if (ini_entry->value && ini_entry->value[0]) { - display_string = ini_entry->value; - display_string_length = ini_entry->value_length; + } else if (ini_entry->value && ini_entry->value->val[0]) { + display_string = ini_entry->value->val; + display_string_length = ini_entry->value->len; esc_html = !sapi_module.phpinfo_as_text; } else { if (!sapi_module.phpinfo_as_text) { @@ -132,14 +132,14 @@ static int php_ini_displayer(zval *el, void *arg TSRMLS_DC) if (!sapi_module.phpinfo_as_text) { PUTS("<tr>"); PUTS("<td class=\"e\">"); - PHPWRITE(ini_entry->name, ini_entry->name_length); + PHPWRITE(ini_entry->name->val, ini_entry->name->len); PUTS("</td><td class=\"v\">"); php_ini_displayer_cb(ini_entry, ZEND_INI_DISPLAY_ACTIVE TSRMLS_CC); PUTS("</td><td class=\"v\">"); php_ini_displayer_cb(ini_entry, ZEND_INI_DISPLAY_ORIG TSRMLS_CC); PUTS("</td></tr>\n"); } else { - PHPWRITE(ini_entry->name, ini_entry->name_length); + PHPWRITE(ini_entry->name->val, ini_entry->name->len); PUTS(" => "); php_ini_displayer_cb(ini_entry, ZEND_INI_DISPLAY_ACTIVE TSRMLS_CC); PUTS(" => "); @@ -786,7 +786,7 @@ PHPAPI void php_ini_activate_config(HashTable *source_hash, int modify_type, int zend_hash_move_forward(source_hash) ) { data = zend_hash_get_current_data(source_hash); - zend_alter_ini_entry_ex(str, Z_STRVAL_P(data), Z_STRLEN_P(data), modify_type, stage, 0 TSRMLS_CC); + zend_alter_ini_entry_ex(str, Z_STR_P(data), modify_type, stage, 0 TSRMLS_CC); } } /* }}} */ @@ -867,6 +867,14 @@ PHPAPI void php_ini_activate_per_host_config(const char *host, uint host_len TSR /* {{{ cfg_get_entry */ +PHPAPI zval *cfg_get_entry_ex(zend_string *name) +{ + return zend_hash_find(&configuration_hash, name); +} +/* }}} */ + +/* {{{ cfg_get_entry + */ PHPAPI zval *cfg_get_entry(const char *name, uint name_length) { return zend_hash_str_find(&configuration_hash, name, name_length); diff --git a/main/php_ini.h b/main/php_ini.h index 5e6f03680a..99f6a07a07 100644 --- a/main/php_ini.h +++ b/main/php_ini.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -28,6 +28,7 @@ PHPAPI void config_zval_dtor(zval *zvalue); int php_init_config(TSRMLS_D); int php_shutdown_config(void); void php_ini_register_extensions(TSRMLS_D); +PHPAPI zval *cfg_get_entry_ex(zend_string *name); PHPAPI zval *cfg_get_entry(const char *name, uint name_length); PHPAPI int cfg_get_long(const char *varname, zend_long *result); PHPAPI int cfg_get_double(const char *varname, double *result); diff --git a/main/php_main.h b/main/php_main.h index 92dafde4d8..07d7dc2280 100644 --- a/main/php_main.h +++ b/main/php_main.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/php_memory_streams.h b/main/php_memory_streams.h index 229ed1902e..a7823817bc 100644 --- a/main/php_memory_streams.h +++ b/main/php_memory_streams.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/php_network.h b/main/php_network.h index 1528447c73..b0b1787ea5 100644 --- a/main/php_network.h +++ b/main/php_network.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/php_open_temporary_file.c b/main/php_open_temporary_file.c index ebe5350ef2..a52619ed47 100644 --- a/main/php_open_temporary_file.c +++ b/main/php_open_temporary_file.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/php_open_temporary_file.h b/main/php_open_temporary_file.h index 873bffcb0a..a11cb79014 100644 --- a/main/php_open_temporary_file.h +++ b/main/php_open_temporary_file.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/php_output.h b/main/php_output.h index f8b961c7c3..02b2b85d13 100644 --- a/main/php_output.h +++ b/main/php_output.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -143,12 +143,12 @@ typedef struct _php_output_handler { } php_output_handler; ZEND_BEGIN_MODULE_GLOBALS(output) - int flags; zend_stack handlers; php_output_handler *active; php_output_handler *running; const char *output_start_filename; int output_start_lineno; + int flags; ZEND_END_MODULE_GLOBALS(output) /* there should not be a need to use OG() from outside of output.c */ diff --git a/main/php_reentrancy.h b/main/php_reentrancy.h index 2f2e99c0b4..5aac0262a8 100644 --- a/main/php_reentrancy.h +++ b/main/php_reentrancy.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/php_scandir.c b/main/php_scandir.c index 36c0c648e1..7dfec7bff7 100644 --- a/main/php_scandir.c +++ b/main/php_scandir.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/php_scandir.h b/main/php_scandir.h index 90708c6872..848f525732 100644 --- a/main/php_scandir.h +++ b/main/php_scandir.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/php_sprintf.c b/main/php_sprintf.c index e9f956f8dd..f93c16e9aa 100644 --- a/main/php_sprintf.c +++ b/main/php_sprintf.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/php_stdint.h b/main/php_stdint.h index 527ee3493d..4d0d723af6 100644 --- a/main/php_stdint.h +++ b/main/php_stdint.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/php_streams.h b/main/php_streams.h index ecc6557f63..34d7676f09 100644 --- a/main/php_streams.h +++ b/main/php_streams.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -299,9 +299,9 @@ PHPAPI void _php_stream_fill_read_buffer(php_stream *stream, size_t size TSRMLS_ #define php_stream_fill_read_buffer(stream, size) _php_stream_fill_read_buffer((stream), (size) TSRMLS_CC) #ifdef ZTS -PHPAPI size_t _php_stream_printf(php_stream *stream TSRMLS_DC, const char *fmt, ...); +PHPAPI size_t _php_stream_printf(php_stream *stream TSRMLS_DC, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 3, 4); #else -PHPAPI size_t _php_stream_printf(php_stream *stream TSRMLS_DC, const char *fmt, ...); +PHPAPI size_t _php_stream_printf(php_stream *stream TSRMLS_DC, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 2, 3); #endif /* php_stream_printf macro & function require TSRMLS_CC */ @@ -560,9 +560,9 @@ PHPAPI const char *php_stream_locate_eol(php_stream *stream, zend_string *buf TS /* pushes an error message onto the stack for a wrapper instance */ #ifdef ZTS -PHPAPI void php_stream_wrapper_log_error(php_stream_wrapper *wrapper, int options TSRMLS_DC, const char *fmt, ...); +PHPAPI void php_stream_wrapper_log_error(php_stream_wrapper *wrapper, int options TSRMLS_DC, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 4, 5); #else -PHPAPI void php_stream_wrapper_log_error(php_stream_wrapper *wrapper, int options TSRMLS_DC, const char *fmt, ...); +PHPAPI void php_stream_wrapper_log_error(php_stream_wrapper *wrapper, int options TSRMLS_DC, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 3, 4); #endif #define PHP_STREAM_UNCHANGED 0 /* orig stream was seekable anyway */ diff --git a/main/php_syslog.h b/main/php_syslog.h index f8280a8a50..d39fc9b5b2 100644 --- a/main/php_syslog.h +++ b/main/php_syslog.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/php_ticks.c b/main/php_ticks.c index 248b5a9e04..daa6cde6ff 100644 --- a/main/php_ticks.c +++ b/main/php_ticks.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/php_ticks.h b/main/php_ticks.h index b511949d80..0f8277cc7f 100644 --- a/main/php_ticks.h +++ b/main/php_ticks.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/php_variables.c b/main/php_variables.c index 37af78b98d..c1d69532e0 100644 --- a/main/php_variables.c +++ b/main/php_variables.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -243,7 +243,7 @@ typedef struct post_var_data { static zend_bool add_post_var(zval *arr, post_var_data_t *var, zend_bool eof TSRMLS_DC) { - char *ksep, *vsep; + char *ksep, *vsep, *val; size_t klen, vlen; /* FIXME: string-size_t */ size_t new_vlen; @@ -274,15 +274,17 @@ static zend_bool add_post_var(zval *arr, post_var_data_t *var, zend_bool eof TSR vlen = 0; } - php_url_decode(var->ptr, klen); + + val = estrndup(ksep, vlen); if (vlen) { - vlen = php_url_decode(ksep, vlen); + vlen = php_url_decode(val, vlen); } - if (sapi_module.input_filter(PARSE_POST, var->ptr, &ksep, vlen, &new_vlen TSRMLS_CC)) { - php_register_variable_safe(var->ptr, ksep, new_vlen, arr TSRMLS_CC); + if (sapi_module.input_filter(PARSE_POST, var->ptr, &val, vlen, &new_vlen TSRMLS_CC)) { + php_register_variable_safe(var->ptr, val, new_vlen, arr TSRMLS_CC); } + efree(val); var->ptr = vsep + (vsep != var->end); return 1; diff --git a/main/php_variables.h b/main/php_variables.h index 70f5e1dc7f..08abeb5267 100644 --- a/main/php_variables.h +++ b/main/php_variables.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/reentrancy.c b/main/reentrancy.c index dd411f478b..4aca23eb1a 100644 --- a/main/reentrancy.c +++ b/main/reentrancy.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/rfc1867.c b/main/rfc1867.c index 0f2941ef98..0eacf896c3 100644 --- a/main/rfc1867.c +++ b/main/rfc1867.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/rfc1867.h b/main/rfc1867.h index b76e3598f5..ab5f50f8d6 100644 --- a/main/rfc1867.h +++ b/main/rfc1867.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/snprintf.c b/main/snprintf.c index 0675538ac5..062ccc4eee 100644 --- a/main/snprintf.c +++ b/main/snprintf.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/snprintf.h b/main/snprintf.h index 98742e00b0..d133ad7aaa 100644 --- a/main/snprintf.h +++ b/main/snprintf.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -84,7 +84,7 @@ PHPAPI int ap_php_snprintf(char *, size_t, const char *, ...); PHPAPI int ap_php_vsnprintf(char *, size_t, const char *, va_list ap); PHPAPI int ap_php_vasprintf(char **buf, const char *format, va_list ap); PHPAPI int ap_php_asprintf(char **buf, const char *format, ...); -PHPAPI int php_sprintf (char* s, const char* format, ...); +PHPAPI int php_sprintf (char* s, const char* format, ...) PHP_ATTRIBUTE_FORMAT(printf, 2, 3); PHPAPI char * php_gcvt(double value, int ndigit, char dec_point, char exponent, char *buf); PHPAPI char * php_conv_fp(register char format, register double num, boolean_e add_dp, int precision, char dec_point, bool_int * is_negative, char *buf, size_t *len); diff --git a/main/spprintf.c b/main/spprintf.c index 67ab15dce5..12443a7769 100644 --- a/main/spprintf.c +++ b/main/spprintf.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/spprintf.h b/main/spprintf.h index 70e4b0df7a..1e7c034cfa 100644 --- a/main/spprintf.h +++ b/main/spprintf.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -37,9 +37,9 @@ There is also snprintf: See difference explained in snprintf.h #include "snprintf.h" BEGIN_EXTERN_C() -PHPAPI size_t spprintf( char **pbuf, size_t max_len, const char *format, ...); +PHPAPI size_t spprintf( char **pbuf, size_t max_len, const char *format, ...) PHP_ATTRIBUTE_FORMAT(printf, 3, 4); -PHPAPI size_t vspprintf(char **pbuf, size_t max_len, const char *format, va_list ap); +PHPAPI size_t vspprintf(char **pbuf, size_t max_len, const char *format, va_list ap) PHP_ATTRIBUTE_FORMAT(printf, 3, 0); PHPAPI zend_string *vstrpprintf(size_t max_len, const char *format, va_list ap); diff --git a/main/streams/cast.c b/main/streams/cast.c index cb4f081655..3291a9ca8f 100644 --- a/main/streams/cast.c +++ b/main/streams/cast.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/streams/filter.c b/main/streams/filter.c index a74802eb14..36585fa9bf 100644 --- a/main/streams/filter.c +++ b/main/streams/filter.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/streams/glob_wrapper.c b/main/streams/glob_wrapper.c index f0c8a347f0..e62fbfb662 100644 --- a/main/streams/glob_wrapper.c +++ b/main/streams/glob_wrapper.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/streams/memory.c b/main/streams/memory.c index f08c192581..9788954988 100644 --- a/main/streams/memory.c +++ b/main/streams/memory.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/streams/mmap.c b/main/streams/mmap.c index a99c8994aa..8746959bbe 100644 --- a/main/streams/mmap.c +++ b/main/streams/mmap.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/streams/php_stream_context.h b/main/streams/php_stream_context.h index c0b70934c6..ac90a0ba3c 100644 --- a/main/streams/php_stream_context.h +++ b/main/streams/php_stream_context.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/streams/php_stream_filter_api.h b/main/streams/php_stream_filter_api.h index 31e73ff6e4..dfa4ae2937 100644 --- a/main/streams/php_stream_filter_api.h +++ b/main/streams/php_stream_filter_api.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/streams/php_stream_glob_wrapper.h b/main/streams/php_stream_glob_wrapper.h index b6746b72ed..69b67d4c85 100644 --- a/main/streams/php_stream_glob_wrapper.h +++ b/main/streams/php_stream_glob_wrapper.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/streams/php_stream_mmap.h b/main/streams/php_stream_mmap.h index 5d200d729a..a25c4ac6b9 100644 --- a/main/streams/php_stream_mmap.h +++ b/main/streams/php_stream_mmap.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/streams/php_stream_plain_wrapper.h b/main/streams/php_stream_plain_wrapper.h index 4370867995..7d5278c620 100644 --- a/main/streams/php_stream_plain_wrapper.h +++ b/main/streams/php_stream_plain_wrapper.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/streams/php_stream_transport.h b/main/streams/php_stream_transport.h index a6797ed898..9674314c49 100644 --- a/main/streams/php_stream_transport.h +++ b/main/streams/php_stream_transport.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -142,21 +142,21 @@ typedef struct _php_stream_xport_param { struct { char *name; size_t namelen; - int backlog; struct timeval *timeout; struct sockaddr *addr; - socklen_t addrlen; char *buf; size_t buflen; - long flags; + zend_long flags; + socklen_t addrlen; + int backlog; } inputs; struct { php_stream *client; - int returncode; struct sockaddr *addr; socklen_t addrlen; zend_string *textaddr; zend_string *error_text; + int returncode; int error_code; } outputs; } php_stream_xport_param; @@ -191,18 +191,18 @@ PHPAPI int php_stream_xport_crypto_enable(php_stream *stream, int activate TSRML END_EXTERN_C() typedef struct _php_stream_xport_crypto_param { - enum { - STREAM_XPORT_CRYPTO_OP_SETUP, - STREAM_XPORT_CRYPTO_OP_ENABLE - } op; struct { + php_stream *session; int activate; php_stream_xport_crypt_method_t method; - php_stream *session; } inputs; struct { int returncode; } outputs; + enum { + STREAM_XPORT_CRYPTO_OP_SETUP, + STREAM_XPORT_CRYPTO_OP_ENABLE + } op; } php_stream_xport_crypto_param; BEGIN_EXTERN_C() diff --git a/main/streams/php_stream_userspace.h b/main/streams/php_stream_userspace.h index 28985a5e1e..7a03690a8f 100644 --- a/main/streams/php_stream_userspace.h +++ b/main/streams/php_stream_userspace.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/streams/php_streams_int.h b/main/streams/php_streams_int.h index 489e18b26f..d8799fcefb 100644 --- a/main/streams/php_streams_int.h +++ b/main/streams/php_streams_int.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/streams/plain_wrapper.c b/main/streams/plain_wrapper.c index 36b56645c2..2b8dcc478e 100644 --- a/main/streams/plain_wrapper.c +++ b/main/streams/plain_wrapper.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ @@ -1336,7 +1336,7 @@ static int php_plain_files_metadata(php_stream_wrapper *wrapper, const char *url break; #endif case PHP_STREAM_META_ACCESS: - mode = (mode_t)*(long *)value; + mode = (mode_t)*(zend_long *)value; ret = VCWD_CHMOD(url, mode); break; default: diff --git a/main/streams/streams.c b/main/streams/streams.c index 5cce2c66bf..bc84d52655 100644 --- a/main/streams/streams.c +++ b/main/streams/streams.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/streams/transports.c b/main/streams/transports.c index b1f0acfa73..a75f77c5bd 100644 --- a/main/streams/transports.c +++ b/main/streams/transports.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/streams/userspace.c b/main/streams/userspace.c index a286104e29..1ff80cdfa6 100644 --- a/main/streams/userspace.c +++ b/main/streams/userspace.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/streams/xp_socket.c b/main/streams/xp_socket.c index 12111511d6..bce6a09fb0 100644 --- a/main/streams/xp_socket.c +++ b/main/streams/xp_socket.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/strlcat.c b/main/strlcat.c index b7aa06e8a2..65811e90c2 100644 --- a/main/strlcat.c +++ b/main/strlcat.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/strlcpy.c b/main/strlcpy.c index 7738238bd5..737036c4a1 100644 --- a/main/strlcpy.c +++ b/main/strlcpy.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/win32_internal_function_disabled.h b/main/win32_internal_function_disabled.h index 7365262772..a412305ea3 100644 --- a/main/win32_internal_function_disabled.h +++ b/main/win32_internal_function_disabled.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ diff --git a/main/win95nt.h b/main/win95nt.h index ce2b002f38..76bec05ea5 100644 --- a/main/win95nt.h +++ b/main/win95nt.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ |