diff options
author | Stanislav Malyshev <stas@php.net> | 2015-01-03 01:22:58 -0800 |
---|---|---|
committer | Stanislav Malyshev <stas@php.net> | 2015-01-10 15:07:38 -0800 |
commit | b7a7b1a624c97945c0aaa49d46ae996fc0bdb6bc (patch) | |
tree | 0e09490075ee4f9a75a77ef4168d8ee254c52e5b /ext/standard | |
parent | 773c8b0c092a0e9ad5c5548815bcb9991d54d5c1 (diff) | |
download | php-git-b7a7b1a624c97945c0aaa49d46ae996fc0bdb6bc.tar.gz |
trailing whitespace removal
Diffstat (limited to 'ext/standard')
78 files changed, 1007 insertions, 1007 deletions
diff --git a/ext/standard/array.c b/ext/standard/array.c index 05098f52ad..0dba75c9e5 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -1,4 +1,4 @@ -/* +/* +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ @@ -322,7 +322,7 @@ PHP_FUNCTION(count) ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(array), element) { ZVAL_DEREF(element); cnt += php_count_recursive(element, COUNT_RECURSIVE); - } ZEND_HASH_FOREACH_END(); + } ZEND_HASH_FOREACH_END(); } RETURN_LONG(cnt); break; @@ -647,7 +647,7 @@ PHP_FUNCTION(usort) RETVAL_TRUE; } } - + PHP_ARRAY_CMP_FUNC_RESTORE(); } /* }}} */ @@ -976,13 +976,13 @@ PHP_FUNCTION(min) if (zend_parse_parameters(ZEND_NUM_ARGS(), "+", &args, &argc) == FAILURE) { return; } - + php_set_compare_func(PHP_SORT_REGULAR); - + /* mixed min ( array $values ) */ if (argc == 1) { zval *result; - + if (Z_TYPE(args[0]) != IS_ARRAY) { php_error_docref(NULL, E_WARNING, "When only one parameter is given, it must be an array"); RETVAL_NULL(); @@ -1019,13 +1019,13 @@ PHP_FUNCTION(max) { zval *args = NULL; int argc; - + if (zend_parse_parameters(ZEND_NUM_ARGS(), "+", &args, &argc) == FAILURE) { return; } php_set_compare_func(PHP_SORT_REGULAR); - + /* mixed max ( array $values ) */ if (argc == 1) { zval *result; @@ -1077,7 +1077,7 @@ static int php_array_walk(HashTable *target_hash, zval *userdata, int recursive) BG(array_walk_fci).param_count = userdata ? 3 : 2; BG(array_walk_fci).params = args; BG(array_walk_fci).no_separation = 0; - + /* Iterate through hash */ zend_hash_internal_pointer_reset(target_hash); while (!EG(exception) && (zv = zend_hash_get_current_data(target_hash)) != NULL) { @@ -1350,7 +1350,7 @@ static int php_valid_var_name(char *var_name, size_t var_name_len) /* {{{ */ if (!var_name || !var_name_len) { return 0; } - + /* These are allowed as first char: [a-zA-Z_\x7f-\xff] */ ch = (int)((unsigned char *)var_name)[0]; if (var_name[0] != '_' && @@ -2176,7 +2176,7 @@ PHP_FUNCTION(array_shift) q->h = k; q->key = NULL; ZVAL_COPY_VALUE(&q->val, &p->val); - ZVAL_UNDEF(&p->val); + ZVAL_UNDEF(&p->val); } k++; } @@ -2219,7 +2219,7 @@ PHP_FUNCTION(array_unshift) int i; zend_string *key; zval *value; - + if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/+", &stack, &args, &argc) == FAILURE) { return; } @@ -2308,10 +2308,10 @@ PHP_FUNCTION(array_splice) PHP_FUNCTION(array_slice) { zval *input, /* Input array */ - *z_length = NULL, /* How many elements to get */ + *z_length = NULL, /* How many elements to get */ *entry; /* An array entry */ zend_long offset, /* Offset to get elements from */ - length = 0; + length = 0; zend_bool preserve_keys = 0; /* Whether to preserve keys while copying to the new array or not */ int num_in, /* Number of elements in the input array */ pos; /* Current position in the array */ @@ -2402,7 +2402,7 @@ PHPAPI int php_array_merge_recursive(HashTable *dest, HashTable *src) /* {{{ */ HashTable *thash; zval tmp; int ret; - + ZVAL_DEREF(src_zval); ZVAL_DEREF(dest_zval); thash = Z_TYPE_P(dest_zval) == IS_ARRAY ? Z_ARRVAL_P(dest_zval) : NULL; @@ -2544,7 +2544,7 @@ PHPAPI int php_array_replace_recursive(HashTable *dest, HashTable *src) /* {{{ * } if (ZEND_HASH_APPLY_PROTECTION(Z_ARRVAL_P(src_zval))) { Z_ARRVAL_P(src_zval)->u.v.nApplyCount++; - } + } ret = php_array_replace_recursive(Z_ARRVAL_P(dest_zval), Z_ARRVAL_P(src_zval)); @@ -2738,7 +2738,7 @@ PHP_FUNCTION(array_keys) /* Initialize return array */ if (search_value != NULL) { array_init(return_value); - + if (strict) { ZEND_HASH_FOREACH_KEY_VAL_IND(Z_ARRVAL_P(input), num_idx, str_idx, entry) { fast_is_identical_function(&res, search_value, entry); @@ -3002,8 +3002,8 @@ PHP_FUNCTION(array_pad) php_error_docref(NULL, E_WARNING, "You may only pad up to 1048576 elements at a time"); RETURN_FALSE; } - - if (input_size >= pad_size_abs) { + + if (input_size >= pad_size_abs) { /* Copy the original array */ ZVAL_COPY(return_value, input); return; @@ -3018,9 +3018,9 @@ PHP_FUNCTION(array_pad) if (pad_size < 0) { for (i = 0; i < num_pads; i++) { zend_hash_next_index_insert_new(Z_ARRVAL_P(return_value), pad_value); - } + } } - + ZEND_HASH_FOREACH_STR_KEY_VAL_IND(Z_ARRVAL_P(input), key, value) { if (Z_REFCOUNTED_P(value)) { Z_ADDREF_P(value); @@ -3031,11 +3031,11 @@ PHP_FUNCTION(array_pad) zend_hash_next_index_insert_new(Z_ARRVAL_P(return_value), value); } } ZEND_HASH_FOREACH_END(); - + if (pad_size > 0) { for (i = 0; i < num_pads; i++) { zend_hash_next_index_insert_new(Z_ARRVAL_P(return_value), pad_value); - } + } } } /* }}} */ @@ -3264,12 +3264,12 @@ static void php_array_intersect_key(INTERNAL_FUNCTION_PARAMETERS, int data_compa INTERSECT_COMP_DATA_INTERNAL - array_intersect_assoc() */ req_args = 2; param_spec = "+"; - + if (data_compare_type == INTERSECT_COMP_DATA_INTERNAL) { intersect_data_compare_func = zval_compare; } } - + if (argc < req_args) { php_error_docref(NULL, E_WARNING, "at least %d parameters are required, %d given", req_args, argc); return; @@ -4603,7 +4603,7 @@ PHP_FUNCTION(array_filter) if (zend_call_function(&fci, &fci_cache) == SUCCESS) { zval_ptr_dtor(&args[0]); if (use_type == ARRAY_FILTER_USE_BOTH) { - zval_ptr_dtor(&args[1]); + zval_ptr_dtor(&args[1]); } if (!Z_ISUNDEF(retval)) { int retval_true = zend_is_true(&retval); @@ -4618,7 +4618,7 @@ PHP_FUNCTION(array_filter) } else { zval_ptr_dtor(&args[0]); if (use_type == ARRAY_FILTER_USE_BOTH) { - zval_ptr_dtor(&args[1]); + zval_ptr_dtor(&args[1]); } return; } @@ -4685,7 +4685,7 @@ PHP_FUNCTION(array_map) fci.param_count = 1; fci.params = &arg; fci.no_separation = 0; - + ZVAL_COPY(&arg, zv); if (zend_call_function(&fci, &fci_cache) != SUCCESS || Z_TYPE(result) == IS_UNDEF) { @@ -4701,7 +4701,7 @@ PHP_FUNCTION(array_map) zend_hash_index_add_new(Z_ARRVAL_P(return_value), num_key, &result); } } ZEND_HASH_FOREACH_END(); - } else { + } else { uint32_t *array_pos = (HashPosition *)ecalloc(n_arrays, sizeof(HashPosition)); for (i = 0; i < n_arrays; i++) { @@ -4748,7 +4748,7 @@ PHP_FUNCTION(array_map) zend_hash_next_index_insert_new(Z_ARRVAL_P(return_value), &result); } - } else { + } else { zval *params = (zval *)safe_emalloc(n_arrays, sizeof(zval), 0); /* We iterate through all the arrays at once. */ @@ -4774,7 +4774,7 @@ PHP_FUNCTION(array_map) fci.param_count = n_arrays; fci.params = params; fci.no_separation = 0; - + if (zend_call_function(&fci, &fci_cache) != SUCCESS || Z_TYPE(result) == IS_UNDEF) { efree(array_pos); zval_dtor(return_value); diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 02001f5433..f26e6f7e23 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -2090,7 +2090,7 @@ ZEND_BEGIN_ARG_INFO(arginfo_stream_set_write_buffer, 0) ZEND_ARG_INFO(0, fp) ZEND_ARG_INFO(0, buffer) ZEND_END_ARG_INFO() - + ZEND_BEGIN_ARG_INFO(arginfo_stream_set_chunk_size, 0) ZEND_ARG_INFO(0, fp) ZEND_ARG_INFO(0, chunk_size) @@ -2285,7 +2285,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO(arginfo_lcfirst, 0) ZEND_ARG_INFO(0, str) ZEND_END_ARG_INFO() - + ZEND_BEGIN_ARG_INFO_EX(arginfo_ucwords, 0, 0, 1) ZEND_ARG_INFO(0, str) ZEND_ARG_INFO(0, delimiters) @@ -3434,7 +3434,7 @@ static void basic_globals_ctor(php_basic_globals *basic_globals_p) /* {{{ */ BG(user_tick_functions) = NULL; BG(user_filter_map) = NULL; BG(serialize_lock) = 0; - + memset(&BG(serialize), 0, sizeof(BG(serialize))); memset(&BG(unserialize), 0, sizeof(BG(unserialize))); @@ -3503,7 +3503,7 @@ PHPAPI double php_get_inf(void) /* {{{ */ #define BASIC_ADD_SUBMODULE(module) \ zend_hash_str_add_empty_element(&basic_submodules, #module, strlen(#module)); - + #define BASIC_RINIT_SUBMODULE(module) \ if (zend_hash_str_exists(&basic_submodules, #module, strlen(#module))) { \ PHP_RINIT(module)(INIT_FUNC_ARGS_PASSTHRU); \ @@ -4004,8 +4004,8 @@ PHP_FUNCTION(getenv) int size; SetLastError(0); - /*If the given bugger is not large enough to hold the data, the return value is - the buffer size, in characters, required to hold the string and its terminating + /*If the given bugger is not large enough to hold the data, the return value is + the buffer size, in characters, required to hold the string and its terminating null character. We use this return value to alloc the final buffer. */ size = GetEnvironmentVariableA(str, &dummybuf, 0); if (GetLastError() == ERROR_ENVVAR_NOT_FOUND) { @@ -4059,7 +4059,7 @@ PHP_FUNCTION(putenv) if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &setting, &setting_len) == FAILURE) { return; } - + if(setting_len == 0 || setting[0] == '=') { php_error_docref(NULL, E_WARNING, "Invalid parameter syntax"); RETURN_FALSE; @@ -4581,7 +4581,7 @@ PHP_FUNCTION(set_magic_quotes_runtime) if (zend_parse_parameters(ZEND_NUM_ARGS(), "b", &new_setting) == FAILURE) { return; } - + if (new_setting) { php_error_docref(NULL, E_CORE_ERROR, "magic_quotes_runtime is not supported anymore"); } @@ -4798,7 +4798,7 @@ PHP_FUNCTION(forward_static_call) instanceof_function(EX(called_scope), fci_cache.calling_scope)) { fci_cache.called_scope = EX(called_scope); } - + if (zend_call_function(&fci, &fci_cache) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) { ZVAL_COPY_VALUE(return_value, &retval); } @@ -5507,7 +5507,7 @@ PHP_FUNCTION(getservbyname) } -/* empty string behaves like NULL on windows implementation of +/* empty string behaves like NULL on windows implementation of getservbyname. Let be portable instead. */ #ifdef PHP_WIN32 if (proto_len == 0) { @@ -5789,12 +5789,12 @@ static void php_simple_ini_parser_cb(zval *arg1, zval *arg2, zval *arg3, int cal if ((find_hash = zend_hash_index_find(Z_ARRVAL_P(arr), key)) == NULL) { array_init(&hash); find_hash = zend_hash_index_update(Z_ARRVAL_P(arr), key, &hash); - } + } } else { if ((find_hash = zend_hash_find(Z_ARRVAL_P(arr), Z_STR_P(arg1))) == NULL) { array_init(&hash); find_hash = zend_hash_update(Z_ARRVAL_P(arr), Z_STR_P(arg1), &hash); - } + } } if (Z_TYPE_P(find_hash) != IS_ARRAY) { @@ -5921,7 +5921,7 @@ PHP_FUNCTION(parse_ini_string) /* }}} */ #if ZEND_DEBUG -/* This function returns an array of ALL valid ini options with values and +/* This function returns an array of ALL valid ini options with values and * is not the same as ini_get_all() which returns only registered ini options. Only useful for devs to debug php.ini scanner/parser! */ PHP_FUNCTION(config_get_hash) /* {{{ */ { diff --git a/ext/standard/basic_functions.h b/ext/standard/basic_functions.h index 8820148a63..ebb2bde288 100644 --- a/ext/standard/basic_functions.h +++ b/ext/standard/basic_functions.h @@ -181,7 +181,7 @@ typedef struct _php_basic_globals { zend_llist *user_tick_functions; zval active_ini_file_section; - + /* pageinfo.c */ zend_long page_uid; zend_long page_gid; @@ -201,7 +201,7 @@ typedef struct _php_basic_globals { zend_bool rand_is_seeded; /* Whether rand() has been seeded */ zend_bool mt_rand_is_seeded; /* Whether mt_rand() has been seeded */ - + /* syslog.c */ char *syslog_device; diff --git a/ext/standard/browscap.c b/ext/standard/browscap.c index 19d340a9d8..557bea9c8e 100644 --- a/ext/standard/browscap.c +++ b/ext/standard/browscap.c @@ -140,7 +140,7 @@ static void php_browscap_parser_cb(zval *arg1, zval *arg2, zval *arg3, int callb { browser_data *bdata = arg; int persistent = bdata->htab->u.flags & HASH_FLAG_PERSISTENT; - + if (!arg1) { return; } @@ -152,7 +152,7 @@ static void php_browscap_parser_cb(zval *arg1, zval *arg2, zval *arg3, int callb zend_string *new_key; /* parent entry can not be same as current section -> causes infinite loop! */ - if (!strcasecmp(Z_STRVAL_P(arg1), "parent") && + if (!strcasecmp(Z_STRVAL_P(arg1), "parent") && bdata->current_section_name != NULL && !strcasecmp(bdata->current_section_name, Z_STRVAL_P(arg2)) ) { @@ -222,11 +222,11 @@ static void php_browscap_parser_cb(zval *arg1, zval *arg2, zval *arg3, int callb static int browscap_read_file(char *filename, browser_data *browdata, int persistent) /* {{{ */ { zend_file_handle fh = {{0}}; - + if (filename == NULL || filename[0] == '\0') { return FAILURE; } - + browdata->htab = pemalloc(sizeof *browdata->htab, persistent); if (browdata->htab == NULL) { return FAILURE; @@ -256,7 +256,7 @@ static int browscap_read_file(char *filename, browser_data *browdata, int persis pefree(browdata->current_section_name, persistent); browdata->current_section_name = NULL; } - + return SUCCESS; } /* }}} */ @@ -301,7 +301,7 @@ PHP_INI_MH(OnChangeBrowscap) } return SUCCESS; } - + return FAILURE; } /* }}} */ @@ -332,7 +332,7 @@ PHP_RSHUTDOWN_FUNCTION(browscap) /* {{{ */ if (bdata->filename[0] != '\0') { browscap_bdata_dtor(bdata, 0); } - + return SUCCESS; } /* }}} */ @@ -340,7 +340,7 @@ PHP_RSHUTDOWN_FUNCTION(browscap) /* {{{ */ PHP_MSHUTDOWN_FUNCTION(browscap) /* {{{ */ { browscap_bdata_dtor(&global_bdata, 1); - + return SUCCESS; } /* }}} */ diff --git a/ext/standard/credits.c b/ext/standard/credits.c index 27cfac37a5..ff17d548ed 100644 --- a/ext/standard/credits.c +++ b/ext/standard/credits.c @@ -1,4 +1,4 @@ -/* +/* +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ diff --git a/ext/standard/credits.h b/ext/standard/credits.h index 6ec57da58e..f88b6afa0f 100644 --- a/ext/standard/credits.h +++ b/ext/standard/credits.h @@ -1,4 +1,4 @@ -/* +/* +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ diff --git a/ext/standard/credits_ext.h b/ext/standard/credits_ext.h index fa1b1325e0..092a89b833 100644 --- a/ext/standard/credits_ext.h +++ b/ext/standard/credits_ext.h @@ -1,11 +1,11 @@ -/* +/* DO NOT EDIT THIS FILE! - it has been automaticaly created by php7/scripts/credits from + it has been automaticaly created by php7/scripts/credits from the information found in the various php7/ext/.../CREDITS and - php7/sapi/.../CREDITS files - - if you want to change an entry you have to edit the appropriate + php7/sapi/.../CREDITS files + + if you want to change an entry you have to edit the appropriate CREDITS file instead */ diff --git a/ext/standard/credits_sapi.h b/ext/standard/credits_sapi.h index 8f0b8264ce..5465c4ddba 100644 --- a/ext/standard/credits_sapi.h +++ b/ext/standard/credits_sapi.h @@ -1,11 +1,11 @@ -/* +/* DO NOT EDIT THIS FILE! - it has been automaticaly created by php7/scripts/credits from + it has been automaticaly created by php7/scripts/credits from the information found in the various php7/ext/.../CREDITS and - php7/sapi/.../CREDITS files - - if you want to change an entry you have to edit the appropriate + php7/sapi/.../CREDITS files + + if you want to change an entry you have to edit the appropriate CREDITS file instead */ diff --git a/ext/standard/crypt.c b/ext/standard/crypt.c index 439d3e0d07..014c7a6feb 100644 --- a/ext/standard/crypt.c +++ b/ext/standard/crypt.c @@ -149,7 +149,7 @@ PHPAPI zend_string *php_crypt(const char *password, const int pass_len, const ch { char *crypt_res; zend_string *result; -/* Windows (win32/crypt) has a stripped down version of libxcrypt and +/* Windows (win32/crypt) has a stripped down version of libxcrypt and a CryptoApi md5_crypt implementation */ #if PHP_USE_PHP_CRYPT_R { diff --git a/ext/standard/crypt_blowfish.h b/ext/standard/crypt_blowfish.h index da374730e9..34316854c8 100644 --- a/ext/standard/crypt_blowfish.h +++ b/ext/standard/crypt_blowfish.h @@ -1,32 +1,32 @@ -/* $Id$ */
-/*
- * Written by Solar Designer <solar at openwall.com> in 2000-2011.
- * No copyright is claimed, and the software is hereby placed in the public
- * domain. In case this attempt to disclaim copyright and place the software
- * in the public domain is deemed null and void, then the software is
- * Copyright (c) 2000-2011 Solar Designer and it is hereby released to the
- * general public under the following terms:
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted.
- *
- * There's ABSOLUTELY NO WARRANTY, express or implied.
- *
- * See crypt_blowfish.c for more information.
- */
-
-#ifndef _CRYPT_BLOWFISH_H
-#define _CRYPT_BLOWFISH_H
-
-#if 0
-extern int _crypt_output_magic(const char *setting, char *output, int size);
-#endif
-extern char *php_crypt_blowfish_rn(const char *key, const char *setting,
- char *output, int size);
-#if 0
-extern char *_crypt_gensalt_blowfish_rn(const char *prefix,
- unsigned long count,
- const char *input, int size, char *output, int output_size);
-#endif
-
-#endif
+/* $Id$ */ +/* + * Written by Solar Designer <solar at openwall.com> in 2000-2011. + * No copyright is claimed, and the software is hereby placed in the public + * domain. In case this attempt to disclaim copyright and place the software + * in the public domain is deemed null and void, then the software is + * Copyright (c) 2000-2011 Solar Designer and it is hereby released to the + * general public under the following terms: + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted. + * + * There's ABSOLUTELY NO WARRANTY, express or implied. + * + * See crypt_blowfish.c for more information. + */ + +#ifndef _CRYPT_BLOWFISH_H +#define _CRYPT_BLOWFISH_H + +#if 0 +extern int _crypt_output_magic(const char *setting, char *output, int size); +#endif +extern char *php_crypt_blowfish_rn(const char *key, const char *setting, + char *output, int size); +#if 0 +extern char *_crypt_gensalt_blowfish_rn(const char *prefix, + unsigned long count, + const char *input, int size, char *output, int output_size); +#endif + +#endif diff --git a/ext/standard/crypt_freesec.c b/ext/standard/crypt_freesec.c index 0a5c3ba5fa..b7de5a4c02 100644 --- a/ext/standard/crypt_freesec.c +++ b/ext/standard/crypt_freesec.c @@ -1,5 +1,5 @@ /* - $Id$ + $Id$ */ /* * This version is derived from the original implementation of FreeSec diff --git a/ext/standard/cyr_convert.c b/ext/standard/cyr_convert.c index 073d9d206f..5f2ffcf5af 100644 --- a/ext/standard/cyr_convert.c +++ b/ext/standard/cyr_convert.c @@ -32,7 +32,7 @@ #include <stdio.h> /***************************************************************************** -* This is codetables for different Cyrillic charsets (relative to koi8-r). +* This is codetables for different Cyrillic charsets (relative to koi8-r). * Each table contains data for 128-255 symbols from ASCII table. * First 256 symbols are for conversion from koi8-r to corresponding charset, * second 256 symbols are for reverse conversion, from charset to koi8-r. @@ -83,7 +83,7 @@ static const _cyr_charset_table _cyr_win1251 = { 222,192,193,214,196,197,212,195,213,200,201,202,203,204,205,206, 207,223,208,209,210,211,198,194,220,219,199,216,221,217,215,218, }, -_cyr_cp866 = { +_cyr_cp866 = { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15, 16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31, 32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47, @@ -188,8 +188,8 @@ _cyr_mac = { /* }}} */ /* {{{ static char * php_convert_cyr_string(unsigned char *str, int length, char from, char to) -* This is the function that performs real in-place conversion of the string -* between charsets. +* This is the function that performs real in-place conversion of the string +* between charsets. * Parameters: * str - string to be converted * from,to - one-symbol label of source and destination charset @@ -209,7 +209,7 @@ static char * php_convert_cyr_string(unsigned char *str, size_t length, char fro from_table = NULL; to_table = NULL; - + switch (toupper((int)(unsigned char)from)) { case 'W': @@ -257,7 +257,7 @@ static char * php_convert_cyr_string(unsigned char *str, size_t length, char fro if (!str) return (char *)str; - + for (i = 0; i < length; i++) { tmp = (from_table == NULL)? str[i] : from_table[ str[i] ]; str[i] = (to_table == NULL) ? tmp : to_table[tmp + 256]; diff --git a/ext/standard/datetime.h b/ext/standard/datetime.h index 7b8ced8e67..dcaa163ffd 100644 --- a/ext/standard/datetime.h +++ b/ext/standard/datetime.h @@ -1,4 +1,4 @@ -/* +/* +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ @@ -24,7 +24,7 @@ #if HAVE_STRPTIME PHP_FUNCTION(strptime); -#endif +#endif PHPAPI char *php_std_date(time_t t); diff --git a/ext/standard/dir.c b/ext/standard/dir.c index ec4e7045d7..baf41541a0 100644 --- a/ext/standard/dir.c +++ b/ext/standard/dir.c @@ -93,8 +93,8 @@ static zend_class_entry *dir_class_entry_ptr; dirp = (php_stream *) zend_fetch_resource(id, -1, "Directory", NULL, 1, php_file_le_stream()); \ if (!dirp) \ RETURN_FALSE; \ - } - + } + /* {{{ arginfo */ ZEND_BEGIN_ARG_INFO_EX(arginfo_dir, 0, 0, 0) ZEND_ARG_INFO(0, dir_handle) @@ -118,7 +118,7 @@ static void php_set_default_dir(zend_resource *res) if (res) { GC_REFCOUNT(res)++; } - + DIRG(default_dir) = res; } @@ -168,25 +168,25 @@ PHP_MINIT_FUNCTION(dir) #ifdef GLOB_NOSORT REGISTER_LONG_CONSTANT("GLOB_NOSORT", GLOB_NOSORT, CONST_CS | CONST_PERSISTENT); -#else +#else # define GLOB_NOSORT 0 #endif #ifdef GLOB_NOCHECK REGISTER_LONG_CONSTANT("GLOB_NOCHECK", GLOB_NOCHECK, CONST_CS | CONST_PERSISTENT); -#else +#else # define GLOB_NOCHECK 0 #endif #ifdef GLOB_NOESCAPE REGISTER_LONG_CONSTANT("GLOB_NOESCAPE", GLOB_NOESCAPE, CONST_CS | CONST_PERSISTENT); -#else +#else # define GLOB_NOESCAPE 0 #endif #ifdef GLOB_ERR REGISTER_LONG_CONSTANT("GLOB_ERR", GLOB_ERR, CONST_CS | CONST_PERSISTENT); -#else +#else # define GLOB_ERR 0 #endif @@ -224,7 +224,7 @@ static void _php_do_opendir(INTERNAL_FUNCTION_PARAMETERS, int createobject) } context = php_stream_context_from_zval(zcontext, 0); - + dirp = php_stream_opendir(dirname, REPORT_ERRORS, context); if (dirp == NULL) { @@ -232,7 +232,7 @@ static void _php_do_opendir(INTERNAL_FUNCTION_PARAMETERS, int createobject) } dirp->flags |= PHP_STREAM_FLAG_NO_FCLOSE; - + php_set_default_dir(dirp->res); if (createobject) { @@ -294,11 +294,11 @@ PHP_FUNCTION(chroot) char *str; int ret; size_t str_len; - + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &str, &str_len) == FAILURE) { RETURN_FALSE; } - + ret = chroot(str); if (ret != 0) { php_error_docref(NULL, E_WARNING, "%s (errno %d)", strerror(errno), errno); @@ -306,9 +306,9 @@ PHP_FUNCTION(chroot) } php_clear_stat_cache(1, NULL, 0); - + ret = chdir("/"); - + if (ret != 0) { php_error_docref(NULL, E_WARNING, "%s (errno %d)", strerror(errno), errno); RETURN_FALSE; @@ -326,7 +326,7 @@ PHP_FUNCTION(chdir) char *str; int ret; size_t str_len; - + if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &str, &str_len) == FAILURE) { RETURN_FALSE; } @@ -335,7 +335,7 @@ PHP_FUNCTION(chdir) RETURN_FALSE; } ret = VCWD_CHDIR(str); - + if (ret != 0) { php_error_docref(NULL, E_WARNING, "%s (errno %d)", strerror(errno), errno); RETURN_FALSE; @@ -360,7 +360,7 @@ PHP_FUNCTION(getcwd) { char path[MAXPATHLEN]; char *ret=NULL; - + if (zend_parse_parameters_none() == FAILURE) { return; } @@ -385,7 +385,7 @@ PHP_FUNCTION(rewinddir) { zval *id = NULL, *tmp, *myself; php_stream *dirp; - + FETCH_DIRP(); if (!(dirp->flags & PHP_STREAM_FLAG_IS_DIR)) { @@ -452,9 +452,9 @@ PHP_FUNCTION(glob) RETURN_FALSE; } -#ifdef ZTS +#ifdef ZTS if (!IS_ABSOLUTE_PATH(pattern, pattern_len)) { - result = VCWD_GETCWD(cwd, MAXPATHLEN); + result = VCWD_GETCWD(cwd, MAXPATHLEN); if (!result) { cwd[0] = '\0'; } @@ -467,10 +467,10 @@ PHP_FUNCTION(glob) snprintf(work_pattern, MAXPATHLEN, "%s%c%s", cwd, DEFAULT_SLASH, pattern); pattern = work_pattern; - } + } #endif - + memset(&globbuf, 0, sizeof(glob_t)); globbuf.gl_offs = 0; if (0 != (ret = glob(pattern, flags & GLOB_FLAGMASK, NULL, &globbuf))) { @@ -479,7 +479,7 @@ PHP_FUNCTION(glob) /* Some glob implementation simply return no data if no matches were found, others return the GLOB_NOMATCH error code. We don't want to treat GLOB_NOMATCH as an error condition - so that PHP glob() behaves the same on both types of + so that PHP glob() behaves the same on both types of implementations and so that 'foreach (glob() as ...' can be used for simple glob() calls without further error checking. @@ -519,11 +519,11 @@ no_results: } /* we need to do this every time since GLOB_ONLYDIR does not guarantee that * all directories will be filtered. GNU libc documentation states the - * following: - * If the information about the type of the file is easily available - * non-directories will be rejected but no extra work will be done to - * determine the information for each file. I.e., the caller must still be - * able to filter directories out. + * following: + * If the information about the type of the file is easily available + * non-directories will be rejected but no extra work will be done to + * determine the information for each file. I.e., the caller must still be + * able to filter directories out. */ if (flags & GLOB_ONLYDIR) { zend_stat_t s; @@ -547,7 +547,7 @@ no_results: } } /* }}} */ -#endif +#endif /* {{{ proto array scandir(string dir [, int sorting_order [, resource context]]) List files & directories inside the specified path */ @@ -585,7 +585,7 @@ PHP_FUNCTION(scandir) php_error_docref(NULL, E_WARNING, "(errno %d): %s", errno, strerror(errno)); RETURN_FALSE; } - + array_init(return_value); for (i = 0; i < n; i++) { diff --git a/ext/standard/dl.h b/ext/standard/dl.h index 75fa0dd0f0..05b22cbe8c 100644 --- a/ext/standard/dl.h +++ b/ext/standard/dl.h @@ -1,4 +1,4 @@ -/* +/* +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ diff --git a/ext/standard/dns.c b/ext/standard/dns.c index ad085376b1..843de2414d 100644 --- a/ext/standard/dns.c +++ b/ext/standard/dns.c @@ -294,7 +294,7 @@ static zend_string *php_gethostbyname(char *name) /* Note: These functions are defined in ext/standard/dns_win32.c for Windows! */ #if !defined(PHP_WIN32) && (HAVE_DNS_SEARCH_FUNC && !(defined(__BEOS__) || defined(NETWARE))) - + #ifndef HFIXEDSZ #define HFIXEDSZ 12 /* fixed data in header <arpa/nameser.h> */ #endif /* HFIXEDSZ */ @@ -524,9 +524,9 @@ static u_char *php_parserr(u_char *cp, u_char *end, querybuf *answer, int type_t add_assoc_string(subarray, "type", "TXT"); tp = zend_string_alloc(dlen, 0); - + array_init(&entries); - + while (l1 < dlen) { n = cp[l1]; if ((l1 + n) >= dlen) { diff --git a/ext/standard/dns_win32.c b/ext/standard/dns_win32.c index fda264a3a8..75b3d84af7 100644 --- a/ext/standard/dns_win32.c +++ b/ext/standard/dns_win32.c @@ -212,9 +212,9 @@ static void php_parserr(PDNS_RECORD pRec, int type_to_fetch, int store, int raw, zval entries; add_assoc_string(subarray, "type", "TXT"); - + array_init(&entries); - + for (i = 0; i < count; i++) { txt_len += strlen(data_txt->pStringArray[i]) + 1; } diff --git a/ext/standard/exec.c b/ext/standard/exec.c index bd65d60656..6b6c3fff2d 100644 --- a/ext/standard/exec.c +++ b/ext/standard/exec.c @@ -91,7 +91,7 @@ PHPAPI int php_exec(int type, char *cmd, zval *array, zval *return_value) if (type != 3) { b = buf; - + while (php_stream_get_line(stream, b, EXEC_INPUT_BUF, &bufl)) { /* no new line found, let's read some more */ if (b[bufl - 1] != '\n' && !php_stream_eof(stream)) { @@ -278,7 +278,7 @@ PHPAPI zend_string *php_escape_shell_cmd(char *str) cmd->val[y++] = str[x]; break; #else - /* % is Windows specific for environmental variables, ^%PATH% will + /* % is Windows specific for environmental variables, ^%PATH% will output PATH whil ^%PATH^% not. escapeshellcmd->val will escape all %. */ case '%': diff --git a/ext/standard/exec.h b/ext/standard/exec.h index a14efe3601..ded9eed477 100644 --- a/ext/standard/exec.h +++ b/ext/standard/exec.h @@ -1,4 +1,4 @@ -/* +/* +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ diff --git a/ext/standard/file.c b/ext/standard/file.c index f7c6e3acb9..d96b70e5ee 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -1040,7 +1040,7 @@ PHPAPI PHP_FUNCTION(fgets) /* resize buffer if it's much larger than the result. * Only needed if the user requested a buffer size. */ //?? if (argc > 1 && line_len < len / 2) { -//??? +//??? ZVAL_STRINGL(return_value, buf, line_len); efree(buf); //?? } else { diff --git a/ext/standard/filters.c b/ext/standard/filters.c index 912d2b1394..794b56d2e0 100644 --- a/ext/standard/filters.c +++ b/ext/standard/filters.c @@ -47,17 +47,17 @@ static php_stream_filter_status_t strfilter_rot13_filter( while (buckets_in->head) { bucket = php_stream_bucket_make_writeable(buckets_in->head); - + php_strtr(bucket->buf, bucket->buflen, rot13_from, rot13_to, 52); consumed += bucket->buflen; - + php_stream_bucket_append(buckets_out, bucket); } if (bytes_consumed) { *bytes_consumed = consumed; } - + return PSFS_PASS_ON; } @@ -95,10 +95,10 @@ static php_stream_filter_status_t strfilter_toupper_filter( while (buckets_in->head) { bucket = php_stream_bucket_make_writeable(buckets_in->head); - + php_strtr(bucket->buf, bucket->buflen, lowercase, uppercase, 26); consumed += bucket->buflen; - + php_stream_bucket_append(buckets_out, bucket); } @@ -123,10 +123,10 @@ static php_stream_filter_status_t strfilter_tolower_filter( while (buckets_in->head) { bucket = php_stream_bucket_make_writeable(buckets_in->head); - + php_strtr(bucket->buf, bucket->buflen, uppercase, lowercase, 26); consumed += bucket->buflen; - + php_stream_bucket_append(buckets_out, bucket); } @@ -183,7 +183,7 @@ static int php_strip_tags_filter_ctor(php_strip_tags_filter *inst, const char *a return FAILURE; } memcpy((char *)inst->allowed_tags, allowed_tags, allowed_tags_len); - inst->allowed_tags_len = (int)allowed_tags_len; + inst->allowed_tags_len = (int)allowed_tags_len; } else { inst->allowed_tags = NULL; } @@ -191,7 +191,7 @@ static int php_strip_tags_filter_ctor(php_strip_tags_filter *inst, const char *a inst->persistent = persistent; return SUCCESS; -} +} static void php_strip_tags_filter_dtor(php_strip_tags_filter *inst) { @@ -216,16 +216,16 @@ static php_stream_filter_status_t strfilter_strip_tags_filter( while (buckets_in->head) { bucket = php_stream_bucket_make_writeable(buckets_in->head); consumed = bucket->buflen; - + bucket->buflen = php_strip_tags(bucket->buf, bucket->buflen, &(inst->state), (char *)inst->allowed_tags, inst->allowed_tags_len); - + php_stream_bucket_append(buckets_out, bucket); } if (bytes_consumed) { *bytes_consumed = consumed; } - + return PSFS_PASS_ON; } @@ -248,14 +248,14 @@ static php_stream_filter *strfilter_strip_tags_create(const char *filtername, zv { php_strip_tags_filter *inst; smart_str tags_ss = {0}; - + inst = pemalloc(sizeof(php_strip_tags_filter), persistent); if (inst == NULL) { /* it's possible pemalloc returns NULL instead of causing it to bail out */ return NULL; } - + if (filterparams != NULL) { if (Z_TYPE_P(filterparams) == IS_ARRAY) { zval *tmp; @@ -419,7 +419,7 @@ static php_conv_err_t php_conv_base64_encode_flush(php_conv_base64_encode *inst, line_ccnt -= 4; break; - case 2: + case 2: if (line_ccnt < 4 && inst->lbchars != NULL) { if (ocnt < inst->lbchars_len) { return PHP_CONV_ERR_TOO_BIG; @@ -461,7 +461,7 @@ static php_conv_err_t php_conv_base64_encode_convert(php_conv_base64_encode *ins register unsigned char *ps, *pd; register unsigned int line_ccnt; - if (in_pp == NULL || in_left_p == NULL) { + if (in_pp == NULL || in_left_p == NULL) { return php_conv_base64_encode_flush(inst, in_pp, in_left_p, out_pp, out_left_p); } @@ -500,7 +500,7 @@ static php_conv_err_t php_conv_base64_encode_convert(php_conv_base64_encode *ins } break; - case 2: + case 2: if (icnt >= 1) { if (inst->line_ccnt < 4 && inst->lbchars != NULL) { if (ocnt < inst->lbchars_len) { @@ -632,7 +632,7 @@ static php_conv_err_t php_conv_base64_decode_convert(php_conv_base64_decode *ins static const unsigned int nbitsof_pack = 8; if (in_pp == NULL || in_left_p == NULL) { - if (inst->eos || inst->urem_nbits == 0) { + if (inst->eos || inst->urem_nbits == 0) { return PHP_CONV_ERR_SUCCESS; } return PHP_CONV_ERR_UNEXPECTED_EOS; @@ -995,7 +995,7 @@ typedef struct _php_conv_qprint_decode { int lbchars_dup; int persistent; unsigned int lb_ptr; - unsigned int lb_cnt; + unsigned int lb_cnt; } php_conv_qprint_decode; static void php_conv_qprint_decode_dtor(php_conv_qprint_decode *inst) @@ -1080,7 +1080,7 @@ static php_conv_err_t php_conv_qprint_decode_convert(php_conv_qprint_decode *ins } } /* break is missing intentionally */ - case 2: { + case 2: { if (icnt <= 0) { goto out; } @@ -1206,7 +1206,7 @@ typedef struct _php_convert_filter { #define PHP_CONV_BASE64_ENCODE 1 #define PHP_CONV_BASE64_DECODE 2 -#define PHP_CONV_QPRINT_ENCODE 3 +#define PHP_CONV_QPRINT_ENCODE 3 #define PHP_CONV_QPRINT_DECODE 4 static php_conv_err_t php_conv_get_string_prop_ex(const HashTable *ht, char **pretval, size_t *pretval_len, char *field_name, size_t field_name_len, int persistent) @@ -1215,7 +1215,7 @@ static php_conv_err_t php_conv_get_string_prop_ex(const HashTable *ht, char **pr *pretval = NULL; *pretval_len = 0; - + if ((tmpval = zend_hash_str_find((HashTable *)ht, field_name, field_name_len-1)) != NULL) { zend_string *str = zval_get_string(tmpval); @@ -1251,7 +1251,7 @@ static php_conv_err_t php_conv_get_long_prop_ex(const HashTable *ht, zend_long * *pretval = Z_LVAL_P(ztval); } else { return PHP_CONV_ERR_NOT_FOUND; - } + } return PHP_CONV_ERR_SUCCESS; } #endif @@ -1277,7 +1277,7 @@ static php_conv_err_t php_conv_get_ulong_prop_ex(const HashTable *ht, zend_ulong } } else { return PHP_CONV_ERR_NOT_FOUND; - } + } return PHP_CONV_ERR_SUCCESS; } @@ -1299,7 +1299,7 @@ static php_conv_err_t php_conv_get_bool_prop_ex(const HashTable *ht, int *pretva *pretval = (Z_TYPE_P(tmpval) == IS_TRUE); } else { return PHP_CONV_ERR_NOT_FOUND; - } + } return PHP_CONV_ERR_SUCCESS; } @@ -1334,7 +1334,7 @@ static int php_conv_get_uint_prop_ex(const HashTable *ht, unsigned int *pretval, } #define GET_STR_PROP(ht, var, var_len, fldname, persistent) \ - php_conv_get_string_prop_ex(ht, &var, &var_len, fldname, sizeof(fldname), persistent) + php_conv_get_string_prop_ex(ht, &var, &var_len, fldname, sizeof(fldname), persistent) #define GET_INT_PROP(ht, var, fldname) \ php_conv_get_int_prop_ex(ht, &var, fldname, sizeof(fldname)) @@ -1348,7 +1348,7 @@ static int php_conv_get_uint_prop_ex(const HashTable *ht, unsigned int *pretval, static php_conv *php_conv_open(int conv_mode, const HashTable *options, int persistent) { /* FIXME: I'll have to replace this ugly code by something neat - (factories?) in the near future. */ + (factories?) in the near future. */ php_conv *retval = NULL; switch (conv_mode) { @@ -1407,8 +1407,8 @@ static php_conv *php_conv_open(int conv_mode, const HashTable *options, int pers GET_STR_PROP(options, lbchars, lbchars_len, "line-break-chars", 0); GET_UINT_PROP(options, line_len, "line-length"); - GET_BOOL_PROP(options, opt_binary, "binary"); - GET_BOOL_PROP(options, opt_force_encode_first, "force-encode-first"); + GET_BOOL_PROP(options, opt_binary, "binary"); + GET_BOOL_PROP(options, opt_force_encode_first, "force-encode-first"); if (line_len < 4) { if (lbchars != NULL) { @@ -1437,7 +1437,7 @@ static php_conv *php_conv_open(int conv_mode, const HashTable *options, int pers } } } break; - + case PHP_CONV_QPRINT_DECODE: { char *lbchars = NULL; size_t lbchars_len; @@ -1471,7 +1471,7 @@ out_failure: if (retval != NULL) { pefree(retval, persistent); } - return NULL; + return NULL; } #undef GET_STR_PROP @@ -1532,7 +1532,7 @@ static int strfilter_convert_append_bucket( const char *pt; size_t ocnt, icnt, tcnt; size_t initial_out_buf_size; - + if (ps == NULL) { initial_out_buf_size = 64; icnt = 1; @@ -1541,7 +1541,7 @@ static int strfilter_convert_append_bucket( icnt = buf_len; } - out_buf_size = ocnt = initial_out_buf_size; + out_buf_size = ocnt = initial_out_buf_size; if (NULL == (out_buf = pemalloc(out_buf_size, persistent))) { return FAILURE; } @@ -1810,12 +1810,12 @@ static php_stream_filter *strfilter_convert_create(const char *filtername, zval } else if (strcasecmp(dot, "quoted-printable-decode") == 0) { conv_mode = PHP_CONV_QPRINT_DECODE; } - + if (php_convert_filter_ctor(inst, conv_mode, (filterparams != NULL ? Z_ARRVAL_P(filterparams) : NULL), filtername, persistent) != SUCCESS) { goto out; - } + } retval = php_stream_filter_alloc(&strfilter_convert_ops, inst, persistent); out: @@ -1866,7 +1866,7 @@ static php_stream_filter_status_t consumed_filter_filter( php_stream_seek(stream, data->offset + data->consumed, SEEK_SET); } data->consumed += consumed; - + return PSFS_PASS_ON; } @@ -2045,7 +2045,7 @@ static size_t php_dechunk(char *buf, size_t len, php_chunked_filter_data *data) memmove(out, p, end - p); } out_len += end - p; - return out_len; + return out_len; } } return out_len; @@ -2067,14 +2067,14 @@ static php_stream_filter_status_t php_chunked_filter( while (buckets_in->head) { bucket = php_stream_bucket_make_writeable(buckets_in->head); consumed += bucket->buflen; - bucket->buflen = php_dechunk(bucket->buf, bucket->buflen, data); + bucket->buflen = php_dechunk(bucket->buf, bucket->buflen, data); php_stream_bucket_append(buckets_out, bucket); } if (bytes_consumed) { *bytes_consumed = consumed; } - + return PSFS_PASS_ON; } diff --git a/ext/standard/flock_compat.c b/ext/standard/flock_compat.c index d5d73f4c36..80d9f87972 100644 --- a/ext/standard/flock_compat.c +++ b/ext/standard/flock_compat.c @@ -52,7 +52,7 @@ PHPAPI int php_flock(int fd, int operation) flck.l_start = flck.l_len = 0; flck.l_whence = SEEK_SET; - + if (operation & LOCK_SH) flck.l_type = F_RDLCK; else if (operation & LOCK_EX) @@ -66,7 +66,7 @@ PHPAPI int php_flock(int fd, int operation) ret = fcntl(fd, operation & LOCK_NB ? F_SETLK : F_SETLKW, &flck); - if (operation & LOCK_NB && ret == -1 && + if (operation & LOCK_NB && ret == -1 && (errno == EACCES || errno == EAGAIN)) errno = EWOULDBLOCK; @@ -223,7 +223,7 @@ int inet_aton(const char *cp, struct in_addr *ap) ap->s_addr = htonl(addr); } - return 1; + return 1; } /* }}} */ #endif /* !HAVE_INET_ATON */ diff --git a/ext/standard/flock_compat.h b/ext/standard/flock_compat.h index ac3f52697b..e5b05f5c6c 100644 --- a/ext/standard/flock_compat.h +++ b/ext/standard/flock_compat.h @@ -59,7 +59,7 @@ PHPAPI int flock(int fd, int operation); #endif #ifndef PHP_WIN32 -extern int inet_aton(const char *, struct in_addr *); +extern int inet_aton(const char *, struct in_addr *); #endif #endif diff --git a/ext/standard/formatted_print.c b/ext/standard/formatted_print.c index 22fd1a8798..46336595ff 100644 --- a/ext/standard/formatted_print.c +++ b/ext/standard/formatted_print.c @@ -96,7 +96,7 @@ php_sprintf_appendstring(zend_string **buffer, size_t *pos, char *add, size_t size = (*buffer)->len; while (req_size > size) { if (size > ZEND_SIZE_MAX/2) { - zend_error_noreturn(E_ERROR, "Field width %zd is too long", req_size); + zend_error_noreturn(E_ERROR, "Field width %zd is too long", req_size); } size <<= 1; } @@ -128,7 +128,7 @@ php_sprintf_appendstring(zend_string **buffer, size_t *pos, char *add, /* php_spintf_appendint() {{{ */ inline static void php_sprintf_appendint(zend_string **buffer, size_t *pos, zend_long number, - size_t width, char padding, size_t alignment, + size_t width, char padding, size_t alignment, int always_sign) { char numbuf[NUM_BUF_SIZE]; @@ -231,7 +231,7 @@ php_sprintf_appenddouble(zend_string **buffer, size_t *pos, php_error_docref(NULL, E_NOTICE, "Requested precision of %d digits was truncated to PHP maximum of %d digits", precision, MAX_FLOAT_PRECISION); precision = MAX_FLOAT_PRECISION; } - + if (zend_isnan(number)) { is_negative = (number<0); php_sprintf_appendstring(buffer, pos, "NaN", 3, 0, padding, @@ -246,7 +246,7 @@ php_sprintf_appenddouble(zend_string **buffer, size_t *pos, return; } - switch (fmt) { + switch (fmt) { case 'e': case 'E': case 'f': @@ -400,11 +400,11 @@ php_formatted_print(int param_count, int use_array, int format_offset) } /* verify the number of args */ - if ((use_array && argc != (2 + format_offset)) + if ((use_array && argc != (2 + format_offset)) || (!use_array && argc < (1 + format_offset))) { WRONG_PARAM_COUNT_WITH_RETVAL(NULL); } - + convert_to_string_ex(&args[format_offset]); if (use_array) { int i = 1; @@ -417,11 +417,11 @@ php_formatted_print(int param_count, int use_array, int format_offset) SEPARATE_ZVAL(array); convert_to_array(array); } - + argc = 1 + zend_hash_num_elements(Z_ARRVAL_P(array)); newargs = (zval *)safe_emalloc(argc, sizeof(zval), 0); ZVAL_COPY_VALUE(&newargs[0], z_format); - + ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(array), zv) { ZVAL_COPY_VALUE(&newargs[i], zv); i++; @@ -429,7 +429,7 @@ php_formatted_print(int param_count, int use_array, int format_offset) args = newargs; format_offset = 0; } - + format = Z_STRVAL(args[format_offset]); format_len = Z_STRLEN(args[format_offset]); result = zend_string_alloc(size, 0); @@ -608,7 +608,7 @@ php_formatted_print(int param_count, int use_array, int format_offset) format[inpos], always_sign ); break; - + case 'c': php_sprintf_appendchar(&result, &outpos, (char) zval_get_long(tmp)); @@ -659,7 +659,7 @@ php_formatted_print(int param_count, int use_array, int format_offset) /* possibly, we have to make sure we have room for the terminating null? */ result->val[outpos]=0; - result->len = outpos; + result->len = outpos; return result; } /* }}} */ @@ -669,7 +669,7 @@ php_formatted_print(int param_count, int use_array, int format_offset) PHP_FUNCTION(user_sprintf) { zend_string *result; - + if ((result=php_formatted_print(ZEND_NUM_ARGS(), 0, 0))==NULL) { RETURN_FALSE; } @@ -682,7 +682,7 @@ PHP_FUNCTION(user_sprintf) PHP_FUNCTION(vsprintf) { zend_string *result; - + if ((result=php_formatted_print(ZEND_NUM_ARGS(), 1, 0))==NULL) { RETURN_FALSE; } @@ -696,7 +696,7 @@ PHP_FUNCTION(user_printf) { zend_string *result; size_t rlen; - + if ((result=php_formatted_print(ZEND_NUM_ARGS(), 0, 0))==NULL) { RETURN_FALSE; } @@ -712,7 +712,7 @@ PHP_FUNCTION(vprintf) { zend_string *result; size_t rlen; - + if ((result=php_formatted_print(ZEND_NUM_ARGS(), 1, 0))==NULL) { RETURN_FALSE; } @@ -729,15 +729,15 @@ PHP_FUNCTION(fprintf) php_stream *stream; zval *arg1; zend_string *result; - + if (ZEND_NUM_ARGS() < 2) { WRONG_PARAM_COUNT; } - + if (zend_parse_parameters(1, "r", &arg1) == FAILURE) { RETURN_FALSE; } - + php_stream_from_zval(stream, arg1); if ((result=php_formatted_print(ZEND_NUM_ARGS(), 0, 1))==NULL) { @@ -758,15 +758,15 @@ PHP_FUNCTION(vfprintf) php_stream *stream; zval *arg1; zend_string *result; - + if (ZEND_NUM_ARGS() != 3) { WRONG_PARAM_COUNT; } - + if (zend_parse_parameters(1, "r", &arg1) == FAILURE) { RETURN_FALSE; } - + php_stream_from_zval(stream, arg1); if ((result=php_formatted_print(ZEND_NUM_ARGS(), 1, 1))==NULL) { diff --git a/ext/standard/fsock.c b/ext/standard/fsock.c index df7ceae079..bf588ec956 100644 --- a/ext/standard/fsock.c +++ b/ext/standard/fsock.c @@ -50,7 +50,7 @@ static void php_fsockopen_stream(INTERNAL_FUNCTION_PARAMETERS, int persistent) zend_string *errstr = NULL; RETVAL_FALSE; - + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|lz/z/d", &host, &host_len, &port, &zerrno, &zerrstr, &timeout) == FAILURE) { RETURN_FALSE; } @@ -65,7 +65,7 @@ static void php_fsockopen_stream(INTERNAL_FUNCTION_PARAMETERS, int persistent) hostname_len = host_len; hostname = host; } - + /* prepare the timeout value for use */ #ifndef PHP_WIN32 conv = (time_t) (timeout * 1000000.0); @@ -98,7 +98,7 @@ static void php_fsockopen_stream(INTERNAL_FUNCTION_PARAMETERS, int persistent) if (hashkey) { efree(hashkey); } - + if (stream == NULL) { if (zerrno) { zval_dtor(zerrno); @@ -110,7 +110,7 @@ static void php_fsockopen_stream(INTERNAL_FUNCTION_PARAMETERS, int persistent) ZVAL_STR(zerrstr, errstr); } else if (!zerrstr && errstr) { zend_string_release(errstr); - } + } RETURN_FALSE; } @@ -118,7 +118,7 @@ static void php_fsockopen_stream(INTERNAL_FUNCTION_PARAMETERS, int persistent) if (errstr) { zend_string_release(errstr); } - + php_stream_to_zval(stream, return_value); } diff --git a/ext/standard/ftok.c b/ext/standard/ftok.c index e74fd6b65e..6ea90ad50d 100644 --- a/ext/standard/ftok.c +++ b/ext/standard/ftok.c @@ -1,4 +1,4 @@ -/* +/* +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ @@ -20,7 +20,7 @@ #include "php.h" -#include <sys/types.h> +#include <sys/types.h> #ifdef HAVE_SYS_IPC_H #include <sys/ipc.h> diff --git a/ext/standard/ftp_fopen_wrapper.c b/ext/standard/ftp_fopen_wrapper.c index 361019382e..e370217751 100644 --- a/ext/standard/ftp_fopen_wrapper.c +++ b/ext/standard/ftp_fopen_wrapper.c @@ -105,7 +105,7 @@ static int php_stream_ftp_stream_close(php_stream_wrapper *wrapper, php_stream * { php_stream *controlstream = stream->wrapperthis; int ret = 0; - + if (controlstream) { if (strpbrk(stream->mode, "wa+")) { char tmp_line[512]; @@ -154,7 +154,7 @@ static php_stream *php_ftp_fopen_connect(php_stream_wrapper *wrapper, const char /* use port 21 if one wasn't specified */ if (resource->port == 0) resource->port = 21; - + transport_len = (int)spprintf(&transport, 0, "tcp://%s:%d", resource->host, resource->port); stream = php_stream_xport_create(transport, transport_len, REPORT_ERRORS, STREAM_XPORT_CLIENT | STREAM_XPORT_CONNECT, NULL, NULL, context, NULL, NULL); efree(transport); @@ -174,7 +174,7 @@ static php_stream *php_ftp_fopen_connect(php_stream_wrapper *wrapper, const char } if (use_ssl) { - + /* send the AUTH TLS request name */ php_stream_write_string(stream, "AUTH TLS\r\n"); @@ -183,7 +183,7 @@ static php_stream *php_ftp_fopen_connect(php_stream_wrapper *wrapper, const char if (result != 234) { /* AUTH TLS not supported try AUTH SSL */ php_stream_write_string(stream, "AUTH SSL\r\n"); - + /* get the response */ result = GET_FTP_RESULT(stream); if (result != 334) { @@ -200,7 +200,7 @@ static php_stream *php_ftp_fopen_connect(php_stream_wrapper *wrapper, const char } } - + if (use_ssl) { if (php_stream_xport_crypto_setup(stream, STREAM_CRYPTO_METHOD_SSLv23_CLIENT, NULL) < 0 @@ -210,13 +210,13 @@ static php_stream *php_ftp_fopen_connect(php_stream_wrapper *wrapper, const char stream = NULL; goto connect_errexit; } - + /* set PBSZ to 0 */ php_stream_write_string(stream, "PBSZ 0\r\n"); /* ignore the response */ result = GET_FTP_RESULT(stream); - + /* set data connection protection level */ #if FTPS_ENCRYPT_DATA php_stream_write_string(stream, "PROT P\r\n"); @@ -241,7 +241,7 @@ static php_stream *php_ftp_fopen_connect(php_stream_wrapper *wrapper, const char } \ s++; \ } \ -} +} /* send the user name */ if (resource->user != NULL) { @@ -253,10 +253,10 @@ static php_stream *php_ftp_fopen_connect(php_stream_wrapper *wrapper, const char } else { php_stream_write_string(stream, "USER anonymous\r\n"); } - + /* get the response */ result = GET_FTP_RESULT(stream); - + /* if a password is required, send it */ if (result >= 300 && result <= 399) { php_stream_notify_info(context, PHP_STREAM_NOTIFY_AUTH_REQUIRED, tmp_line, 0); @@ -307,7 +307,7 @@ static php_stream *php_ftp_fopen_connect(php_stream_wrapper *wrapper, const char connect_errexit: if (resource) { - php_url_free(resource); + php_url_free(resource); } if (stream) { @@ -338,7 +338,7 @@ static unsigned short php_fopen_do_pasv(php_stream *stream, char *ip, size_t ip_ /* EPSV failed, let's try PASV */ php_stream_write_string(stream, "PASV\r\n"); result = GET_FTP_RESULT(stream); - + /* make sure we got a 227 response */ if (result != 227) { return 0; @@ -358,14 +358,14 @@ static unsigned short php_fopen_do_pasv(php_stream *stream, char *ip, size_t ip_ if (*tpath != ',') { return 0; } - *tpath='.'; + *tpath='.'; tpath++; } tpath[-1] = '\0'; memcpy(ip, hoststart, ip_size); ip[ip_size-1] = '\0'; hoststart = ip; - + /* pull out the MSB of the port */ portno = (unsigned short) strtoul(tpath, &ttpath, 10) * 256; if (ttpath == NULL) { @@ -395,7 +395,7 @@ static unsigned short php_fopen_do_pasv(php_stream *stream, char *ip, size_t ip_ /* pull out the port */ portno = (unsigned short) strtoul(tpath + 1, &ttpath, 10); } -#endif +#endif if (ttpath == NULL) { /* didn't get correct response from EPSV/PASV */ return 0; @@ -403,7 +403,7 @@ static unsigned short php_fopen_do_pasv(php_stream *stream, char *ip, size_t ip_ if (phoststart) { *phoststart = hoststart; - } + } return portno; } @@ -473,28 +473,28 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *pa result = GET_FTP_RESULT(stream); if (result > 299 || result < 200) goto errexit; - + /* find out the size of the file (verifying it exists) */ php_stream_printf(stream, "SIZE %s\r\n", resource->path); - + /* read the response */ result = GET_FTP_RESULT(stream); if (read_write == 1) { /* Read Mode */ char *sizestr; - + /* when reading file, it must exist */ if (result > 299 || result < 200) { errno = ENOENT; goto errexit; } - + sizestr = strchr(tmp_line, ' '); if (sizestr) { sizestr++; file_size = atoi(sizestr); php_stream_notify_file_size(context, file_size, tmp_line, result); - } + } } else if (read_write == 2) { /* when writing file (but not appending), it must NOT exist, unless a context option exists which allows it */ if (context && (tmpzval = php_stream_context_get_option(context, "ftp", "overwrite")) != NULL) { @@ -502,7 +502,7 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *pa } if (result <= 299 && result >= 200) { if (allow_overwrite) { - /* Context permits overwriting file, + /* Context permits overwriting file, so we just delete whatever's there in preparation */ php_stream_printf(stream, "DELE %s\r\n", resource->path); result = GET_FTP_RESULT(stream); @@ -533,7 +533,7 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *pa Z_LVAL_P(tmpzval) > 0) { php_stream_printf(stream, "REST %pd\r\n", Z_LVAL_P(tmpzval)); result = GET_FTP_RESULT(stream); - if (result < 300 || result > 399) { + if (result < 300 || result > 399) { php_stream_wrapper_log_error(wrapper, options, "Unable to resume from offset %pd", Z_LVAL_P(tmpzval)); goto errexit; } @@ -547,9 +547,9 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *pa } else { /* Append */ memcpy(tmp_line, "APPE", sizeof("APPE")); - } + } php_stream_printf(stream, "%s %s\r\n", tmp_line, (resource->path != NULL ? resource->path : "/")); - + /* open the data channel */ if (hoststart == NULL) { hoststart = resource->host; @@ -563,14 +563,14 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *pa result = GET_FTP_RESULT(stream); if (result != 150 && result != 125) { - /* Could not retrieve or send the file + /* Could not retrieve or send the file * this data will only be sent to us after connection on the data port was initiated. */ php_stream_close(datastream); datastream = NULL; - goto errexit; + goto errexit; } - + php_stream_context_set(datastream, context); php_stream_notify_progress_init(context, 0, file_size); @@ -584,7 +584,7 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *pa goto errexit; } - /* remember control stream */ + /* remember control stream */ datastream->wrapperthis = stream; php_url_free(resource); @@ -659,7 +659,7 @@ static int php_ftp_dirstream_close(php_stream *stream, int close_handle) /* close data connection */ php_stream_close(data->datastream); data->datastream = NULL; - + efree(data); stream->abstract = NULL; @@ -698,7 +698,7 @@ php_stream * php_stream_ftp_opendir(php_stream_wrapper *wrapper, const char *pat stream = php_ftp_fopen_connect(wrapper, path, mode, options, opened_path, context, &reuseid, &resource, &use_ssl, &use_ssl_on_data); if (!stream) { - goto opendir_errexit; + goto opendir_errexit; } /* set the connection to be ascii */ @@ -715,7 +715,7 @@ php_stream * php_stream_ftp_opendir(php_stream_wrapper *wrapper, const char *pat } php_stream_printf(stream, "NLST %s\r\n", (resource->path != NULL ? resource->path : "/")); - + /* open the data channel */ if (hoststart == NULL) { hoststart = resource->host; @@ -727,14 +727,14 @@ php_stream * php_stream_ftp_opendir(php_stream_wrapper *wrapper, const char *pat result = GET_FTP_RESULT(stream); if (result != 150 && result != 125) { - /* Could not retrieve or send the file + /* Could not retrieve or send the file * this data will only be sent to us after connection on the data port was initiated. */ php_stream_close(datastream); datastream = NULL; - goto opendir_errexit; + goto opendir_errexit; } - + php_stream_context_set(datastream, context); if (use_ssl_on_data && (php_stream_xport_crypto_setup(stream, @@ -798,17 +798,17 @@ static int php_stream_ftp_url_stat(php_stream_wrapper *wrapper, const char *url, } php_stream_write_string(stream, "TYPE I\r\n"); /* we need this since some servers refuse to accept SIZE command in ASCII mode */ - + result = GET_FTP_RESULT(stream); if(result < 200 || result > 299) { goto stat_errexit; } - + php_stream_printf(stream, "SIZE %s\r\n", (resource->path != NULL ? resource->path : "/")); result = GET_FTP_RESULT(stream); if (result < 200 || result > 299) { - /* Failure either means it doesn't exist + /* Failure either means it doesn't exist or it's a directory and this server fails on listing directory sizes */ if (ssb->sb.st_mode & S_IFDIR) { @@ -955,8 +955,8 @@ static int php_stream_ftp_rename(php_stream_wrapper *wrapper, const char *url_fr resource_from = php_url_parse(url_from); resource_to = php_url_parse(url_to); - /* Must be same scheme (ftp/ftp or ftps/ftps), same host, and same port - (or a 21/0 0/21 combination which is also "same") + /* Must be same scheme (ftp/ftp or ftps/ftps), same host, and same port + (or a 21/0 0/21 combination which is also "same") Also require paths to/from */ if (!resource_from || !resource_to || @@ -966,8 +966,8 @@ static int php_stream_ftp_rename(php_stream_wrapper *wrapper, const char *url_fr !resource_from->host || !resource_to->host || strcmp(resource_from->host, resource_to->host) || - (resource_from->port != resource_to->port && - resource_from->port * resource_to->port != 0 && + (resource_from->port != resource_to->port && + resource_from->port * resource_to->port != 0 && resource_from->port + resource_to->port != 21) || !resource_from->path || !resource_to->path) { diff --git a/ext/standard/html.c b/ext/standard/html.c index 18bab7d090..ec73ae5ea8 100644 --- a/ext/standard/html.c +++ b/ext/standard/html.c @@ -175,7 +175,7 @@ static inline unsigned int get_next_char( else MB_FAILURE(pos, 4); } - + this_char = ((c & 0x07) << 18) | ((str[pos + 1] & 0x3f) << 12) | ((str[pos + 2] & 0x3f) << 6) | (str[pos + 3] & 0x3f); if (this_char < 0x10000 || this_char > 0x10FFFF) { /* non-shortest form or outside range */ MB_FAILURE(pos, 4); @@ -449,7 +449,7 @@ det_charset: if (charset_hint) { int found = 0; - + /* now walk the charset map and look for the codeset */ for (i = 0; charset_map[i].codeset; i++) { if (len == strlen(charset_map[i].codeset) && strncasecmp(charset_hint, charset_map[i].codeset, len) == 0) { @@ -557,7 +557,7 @@ static inline unsigned char unimap_bsearch(const uni_to_enc *table, unsigned cod return 0; code_key = (unsigned short) code_key_a; - + while (l <= h) { m = l + (h - l) / 2; if (code_key < m->un_code_point) @@ -583,7 +583,7 @@ static inline int map_from_unicode(unsigned code, enum entity_charset charset, u /* identity mapping of code points to unicode */ if (code > 0xFF) { return FAILURE; - } + } *res = code; break; @@ -602,7 +602,7 @@ static inline int map_from_unicode(unsigned code, enum entity_charset charset, u return FAILURE; } break; - + case cs_8859_15: if (code < 0xA4 || (code > 0xBE && code <= 0xFF)) { *res = code; @@ -646,7 +646,7 @@ static inline int map_from_unicode(unsigned code, enum entity_charset charset, u case cs_cp866: table = unimap_cp866; table_size = sizeof(unimap_cp866) / sizeof(*unimap_cp866); - + table_over_7F: if (code <= 0x7F) { *res = code; @@ -722,7 +722,7 @@ static inline int unicode_cp_is_allowed(unsigned uni_cp, int document_type) * Not sure this is the relevant part for HTML 5, though. I opted to * disallow the characters that would result in a parse error when * preprocessing of the input stream. See also section 8.1.3. - * + * * It's unclear if XHTML 1.0 allows C1 characters. I'll opt to apply to * XHTML 1.0 the same rules as for XML 1.0. * See <http://cmsmcq.com/2007/C1.xml>. @@ -786,7 +786,7 @@ static inline int numeric_entity_is_allowed(unsigned uni_cp, int document_type) /* {{{ process_numeric_entity * Auxiliary function to traverse_for_entities. * On input, *buf should point to the first character after # and on output, it's the last - * byte read, no matter if there was success or insuccess. + * byte read, no matter if there was success or insuccess. */ static inline int process_numeric_entity(const char **buf, unsigned *code_point) { @@ -796,7 +796,7 @@ static inline int process_numeric_entity(const char **buf, unsigned *code_point) if (hexadecimal && (**buf != '\0')) (*buf)++; - + /* strtol allows whitespace and other stuff in the beginning * we're not interested */ if ((hexadecimal && !isxdigit(**buf)) || @@ -980,7 +980,7 @@ static void traverse_for_entities( goto invalid_code; /* are we allowed to decode this entity in this document type? - * HTML 5 is the only that has a character that cannot be used in + * HTML 5 is the only that has a character that cannot be used in * a numeric entity but is allowed literally (U+000D). The * unoptimized version would be ... || !numeric_entity_is_allowed(code) */ if (!unicode_cp_is_allowed(code, doctype) || @@ -1007,9 +1007,9 @@ static void traverse_for_entities( } } } - + assert(*next == ';'); - + if (((code == '\'' && !(flags & ENT_HTML_QUOTE_SINGLE)) || (code == '"' && !(flags & ENT_HTML_QUOTE_DOUBLE))) /* && code2 == '\0' always true for current maps */) @@ -1037,7 +1037,7 @@ invalid_code: *(q++) = *p; } } - + *q = '\0'; ret->len = (size_t)(q - ret->val); } @@ -1077,7 +1077,7 @@ static entity_table_opt determine_entity_table(int all, int doctype) entity_table_opt retval = {NULL}; assert(!(doctype == ENT_HTML_DOC_XML1 && all)); - + if (all) { retval.ms_table = (doctype == ENT_HTML_DOC_HTML5) ? entity_ms_table_html5 : entity_ms_table_html4; @@ -1123,13 +1123,13 @@ PHPAPI zend_string *php_unescape_html_entities(unsigned char *old, size_t oldlen if (retlen == 0) { goto empty_source; } - + inverse_map = unescape_inverse_map(all, flags); - + /* replace numeric entities */ traverse_for_entities((char*)old, oldlen, ret, all, flags, inverse_map, charset); -empty_source: +empty_source: return ret; } /* }}} */ @@ -1152,7 +1152,7 @@ static inline void find_entity_for_char( { unsigned stage1_idx = ENT_STAGE1_INDEX(k); const entity_stage3_row *c; - + if (stage1_idx > 0x1D) { *entity = NULL; *entity_len = 0; @@ -1173,7 +1173,7 @@ static inline void find_entity_for_char( if (!(*cursor < oldlen)) goto no_suitable_2nd; - next_char = get_next_char(charset, old, oldlen, cursor, &status); + next_char = get_next_char(charset, old, oldlen, cursor, &status); if (status == FAILURE) goto no_suitable_2nd; @@ -1198,7 +1198,7 @@ no_suitable_2nd: *entity = (const unsigned char *) c->data.multicodepoint_table[0].leading_entry.default_entity; *entity_len = c->data.multicodepoint_table[0].leading_entry.default_entity_len; - } + } } /* }}} */ @@ -1266,7 +1266,7 @@ PHPAPI zend_string *php_escape_html_entities_ex(unsigned char *old, size_t oldle /* initial estimate */ if (oldlen < 64) { - maxlen = 128; + maxlen = 128; } else { maxlen = 2 * oldlen; if (maxlen < oldlen) { @@ -1610,7 +1610,7 @@ static inline void write_s3row_data( } else { spe_cp = uni_cp; } - + written_k2 = write_octet_sequence((unsigned char*)&key[written_k1], charset, spe_cp); memcpy(&entity[1], mcpr[i].normal_entry.entity, l); entity[l + 1] = ';'; @@ -1648,7 +1648,7 @@ PHP_FUNCTION(get_html_translation_table) LIMIT_ALL(all, doctype, charset); array_init(return_value); - + entity_table = determine_entity_table((int)all, doctype); if (all && !CHARSET_UNICODE_COMPAT(charset)) { to_uni_table = enc_to_uni_index[charset]; diff --git a/ext/standard/html.h b/ext/standard/html.h index 6fcea6b380..f93b868005 100644 --- a/ext/standard/html.h +++ b/ext/standard/html.h @@ -1,4 +1,4 @@ -/* +/* +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ diff --git a/ext/standard/html_tables.h b/ext/standard/html_tables.h index 4680343f2c..23a4a33623 100644 --- a/ext/standard/html_tables.h +++ b/ext/standard/html_tables.h @@ -48,7 +48,7 @@ static const struct { { "utf-8", cs_utf_8 }, { "cp1252", cs_cp1252 }, { "Windows-1252", cs_cp1252 }, - { "1252", cs_cp1252 }, + { "1252", cs_cp1252 }, { "BIG5", cs_big5 }, { "950", cs_big5 }, { "GB2312", cs_gb2312 }, @@ -71,7 +71,7 @@ static const struct { { "iso8859-5", cs_8859_5 }, { "iso-8859-5", cs_8859_5 }, { "cp866", cs_cp866 }, - { "866", cs_cp866 }, + { "866", cs_cp866 }, { "ibm866", cs_cp866 }, { "MacRoman", cs_macroman }, { NULL } @@ -1129,7 +1129,7 @@ typedef const entity_stage3_row *const *entity_stage1_row; /* 64 elements */ /* For stage 1, Calculate k & 0xFFF000 >> 3*4. * If larger than 1D, we have no mapping. Otherwise lookup that index */ - + typedef struct { const entity_stage1_row *ms_table; /* for tables with only basic entities, this member is to be accessed diff --git a/ext/standard/http.c b/ext/standard/http.c index 4b454476f2..ba6f2fb07b 100644 --- a/ext/standard/http.c +++ b/ext/standard/http.c @@ -177,7 +177,7 @@ PHPAPI int php_url_encode_hash_ex(HashTable *ht, smart_str *formstr, if (enc_type == PHP_QUERY_RFC3986) { ekey = php_raw_url_encode(Z_STRVAL_P(zdata), Z_STRLEN_P(zdata)); } else { - ekey = php_url_encode(Z_STRVAL_P(zdata), Z_STRLEN_P(zdata)); + ekey = php_url_encode(Z_STRVAL_P(zdata), Z_STRLEN_P(zdata)); } smart_str_append(formstr, ekey); zend_string_free(ekey); @@ -255,7 +255,7 @@ PHP_FUNCTION(http_build_query) } smart_str_0(&formstr); - + RETURN_STR(formstr.s); } /* }}} */ diff --git a/ext/standard/http_fopen_wrapper.c b/ext/standard/http_fopen_wrapper.c index 01e3b2cfe4..ab64946cf9 100644 --- a/ext/standard/http_fopen_wrapper.c +++ b/ext/standard/http_fopen_wrapper.c @@ -19,7 +19,7 @@ | Sara Golemon <pollita@php.net> | +----------------------------------------------------------------------+ */ -/* $Id$ */ +/* $Id$ */ #include "php.h" #include "php_globals.h" @@ -109,8 +109,8 @@ static inline void strip_header(char *header_bag, char *lc_header_bag, } } -php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, - const char *path, const char *mode, int options, char **opened_path, +php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, + const char *path, const char *mode, int options, char **opened_path, php_stream_context *context, int redirect_max, int flags STREAMS_DC) /* {{{ */ { php_stream *stream = NULL; @@ -159,7 +159,7 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, } if (strncasecmp(resource->scheme, "http", sizeof("http")) && strncasecmp(resource->scheme, "https", sizeof("https"))) { - if (!context || + if (!context || (tmpzval = php_stream_context_get_option(context, wrapper->wops->label, "proxy")) == NULL || Z_TYPE_P(tmpzval) != IS_STRING || Z_STRLEN_P(tmpzval) <= 0) { @@ -175,7 +175,7 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, transport_string = estrndup(Z_STRVAL_P(tmpzval), Z_STRLEN_P(tmpzval)); } else { /* Normal http request (possibly with proxy) */ - + if (strpbrk(mode, "awx+")) { php_stream_wrapper_log_error(wrapper, options, "HTTP wrapper does not support writeable connections"); php_url_free(resource); @@ -222,11 +222,11 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, stream = php_stream_xport_create(transport_string, transport_len, options, STREAM_XPORT_CLIENT | STREAM_XPORT_CONNECT, NULL, &timeout, context, &errstr, NULL); - + if (stream) { php_stream_set_option(stream, PHP_STREAM_OPTION_READ_TIMEOUT, 0, &timeout); } - + if (errstr) { php_stream_wrapper_log_error(wrapper, options, "%s", errstr->val); zend_string_release(errstr); @@ -346,7 +346,7 @@ finish: /* avoid buffering issues while reading header */ if (options & STREAM_WILL_CAST) chunk_size = php_stream_set_chunk_size(stream, 1); - + /* avoid problems with auto-detecting when reading the headers -> the headers * are always in canonical \r\n format */ eol_detect = stream->flags & (PHP_STREAM_FLAG_DETECT_EOL | PHP_STREAM_FLAG_EOL_MAC); @@ -375,7 +375,7 @@ finish: } } } - + if (context && (tmpzval = php_stream_context_get_option(context, "http", "protocol_version")) != NULL) { protocol_version_len = (int)spprintf(&protocol_version, 0, "%.1F", zval_get_double(tmpzval)); } @@ -426,7 +426,7 @@ finish: if (context && (tmpzval = php_stream_context_get_option(context, "http", "header")) != NULL) { tmp = NULL; - + if (Z_TYPE_P(tmpzval) == IS_ARRAY) { zval *tmpheader = NULL; smart_str tmpstr = {0}; @@ -470,47 +470,47 @@ finish: strip_header(user_headers, t, "content-type:"); } - if ((s = strstr(t, "user-agent:")) && - (s == t || *(s-1) == '\r' || *(s-1) == '\n' || + if ((s = strstr(t, "user-agent:")) && + (s == t || *(s-1) == '\r' || *(s-1) == '\n' || *(s-1) == '\t' || *(s-1) == ' ')) { have_header |= HTTP_HEADER_USER_AGENT; } if ((s = strstr(t, "host:")) && - (s == t || *(s-1) == '\r' || *(s-1) == '\n' || + (s == t || *(s-1) == '\r' || *(s-1) == '\n' || *(s-1) == '\t' || *(s-1) == ' ')) { have_header |= HTTP_HEADER_HOST; } if ((s = strstr(t, "from:")) && - (s == t || *(s-1) == '\r' || *(s-1) == '\n' || + (s == t || *(s-1) == '\r' || *(s-1) == '\n' || *(s-1) == '\t' || *(s-1) == ' ')) { have_header |= HTTP_HEADER_FROM; } if ((s = strstr(t, "authorization:")) && - (s == t || *(s-1) == '\r' || *(s-1) == '\n' || + (s == t || *(s-1) == '\r' || *(s-1) == '\n' || *(s-1) == '\t' || *(s-1) == ' ')) { have_header |= HTTP_HEADER_AUTH; } if ((s = strstr(t, "content-length:")) && - (s == t || *(s-1) == '\r' || *(s-1) == '\n' || + (s == t || *(s-1) == '\r' || *(s-1) == '\n' || *(s-1) == '\t' || *(s-1) == ' ')) { have_header |= HTTP_HEADER_CONTENT_LENGTH; } if ((s = strstr(t, "content-type:")) && - (s == t || *(s-1) == '\r' || *(s-1) == '\n' || + (s == t || *(s-1) == '\r' || *(s-1) == '\n' || *(s-1) == '\t' || *(s-1) == ' ')) { have_header |= HTTP_HEADER_TYPE; } if ((s = strstr(t, "connection:")) && - (s == t || *(s-1) == '\r' || *(s-1) == '\n' || + (s == t || *(s-1) == '\r' || *(s-1) == '\n' || *(s-1) == '\t' || *(s-1) == ' ')) { have_header |= HTTP_HEADER_CONNECTION; } /* remove Proxy-Authorization header */ if (use_proxy && use_ssl && (s = strstr(t, "proxy-authorization:")) && - (s == t || *(s-1) == '\r' || *(s-1) == '\n' || + (s == t || *(s-1) == '\r' || *(s-1) == '\n' || *(s-1) == '\t' || *(s-1) == ' ')) { char *p = s + sizeof("proxy-authorization:") - 1; - + while (s > t && (*(s-1) == ' ' || *(s-1) == '\t')) s--; while (*p != 0 && *p != '\r' && *p != '\n') p++; while (*p == '\r' || *p == '\n') p++; @@ -550,7 +550,7 @@ finish: } stmp = php_base64_encode((unsigned char*)scratch, strlen(scratch)); - + if (snprintf(scratch, scratch_len, "Authorization: Basic %s\r\n", stmp->val) > 0) { php_stream_write(stream, scratch, strlen(scratch)); php_stream_notify_info(context, PHP_STREAM_NOTIFY_AUTH_REQUIRED, NULL, 0); @@ -567,7 +567,7 @@ finish: /* Send Host: header so name-based virtual hosts work */ if ((have_header & HTTP_HEADER_HOST) == 0) { - if ((use_ssl && resource->port != 443 && resource->port != 0) || + if ((use_ssl && resource->port != 443 && resource->port != 0) || (!use_ssl && resource->port != 80 && resource->port != 0)) { if (snprintf(scratch, scratch_len, "Host: %s:%i\r\n", resource->host, resource->port) > 0) php_stream_write(stream, scratch, strlen(scratch)); @@ -588,7 +588,7 @@ finish: php_stream_write_string(stream, "Connection: close\r\n"); } - if (context && + if (context && (ua_zval = php_stream_context_get_option(context, "http", "user_agent")) != NULL && Z_TYPE_P(ua_zval) == IS_STRING) { ua_str = Z_STRVAL_P(ua_zval); @@ -600,9 +600,9 @@ finish: #define _UA_HEADER "User-Agent: %s\r\n" char *ua; size_t ua_len; - + ua_len = sizeof(_UA_HEADER) + strlen(ua_str); - + /* ensure the header is only sent if user_agent is not blank */ if (ua_len > sizeof(_UA_HEADER)) { ua = emalloc(ua_len + 1); @@ -616,7 +616,7 @@ finish: if (ua) { efree(ua); } - } + } } if (user_headers) { @@ -723,9 +723,9 @@ finish: php_stream_wrapper_log_error(wrapper, options, "HTTP request failed, unexpected end of socket!"); goto out; } - + /* read past HTTP headers */ - + http_header_line = emalloc(HTTP_HEADER_BLOCK_SIZE); while (!body && !php_stream_eof(stream)) { @@ -753,7 +753,7 @@ finish: follow_location = zval_is_true(tmpzval); } else if (!(response_code >= 300 && response_code < 304 || 307 == response_code || 308 == response_code)) { /* we shouldn't redirect automatically - if follow_location isn't set and response_code not in (300, 301, 302, 303 and 307) + if follow_location isn't set and response_code not in (300, 301, 302, 303 and 307) see http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.1 RFC 7238 defines 308: http://tools.ietf.org/html/rfc7238 */ follow_location = 0; @@ -789,7 +789,7 @@ finish: zval http_header; ZVAL_STRINGL(&http_header, http_header_line, http_header_line_length); - + zend_hash_next_index_insert(Z_ARRVAL_P(response_header), &http_header); } } else { @@ -814,10 +814,10 @@ finish: char loc_path[HTTP_HEADER_BLOCK_SIZE]; *new_path='\0'; - if (strlen(location)<8 || (strncasecmp(location, "http://", sizeof("http://")-1) && - strncasecmp(location, "https://", sizeof("https://")-1) && - strncasecmp(location, "ftp://", sizeof("ftp://")-1) && - strncasecmp(location, "ftps://", sizeof("ftps://")-1))) + if (strlen(location)<8 || (strncasecmp(location, "http://", sizeof("http://")-1) && + strncasecmp(location, "https://", sizeof("https://")-1) && + strncasecmp(location, "ftp://", sizeof("ftp://")-1) && + strncasecmp(location, "ftps://", sizeof("ftps://")-1))) { if (*location != '/') { if (*(location+1) != '\0' && resource->path) { @@ -831,7 +831,7 @@ finish: *s = '/'; } } - s[1] = '\0'; + s[1] = '\0'; if (resource->path && *(resource->path) == '/' && *(resource->path + 1) == '\0') { snprintf(loc_path, sizeof(loc_path) - 1, "%s%s", resource->path, location); } else { @@ -907,14 +907,14 @@ out: ZVAL_COPY(&stream->wrapperdata, response_header); } php_stream_notify_progress_init(context, 0, file_size); - + /* Restore original chunk size now that we're done with headers */ if (options & STREAM_WILL_CAST) php_stream_set_chunk_size(stream, (int)chunk_size); /* restore the users auto-detect-line-endings setting */ stream->flags |= eol_detect; - + /* as far as streams are concerned, we are now at the start of * the stream */ stream->position = 0; diff --git a/ext/standard/image.c b/ext/standard/image.c index 4828a48623..250e815488 100644 --- a/ext/standard/image.c +++ b/ext/standard/image.c @@ -86,7 +86,7 @@ PHP_MINIT_FUNCTION(imagetypes) REGISTER_LONG_CONSTANT("IMAGETYPE_JB2", IMAGE_FILETYPE_JB2, CONST_CS | CONST_PERSISTENT); #if HAVE_ZLIB && !defined(COMPILE_DL_ZLIB) REGISTER_LONG_CONSTANT("IMAGETYPE_SWC", IMAGE_FILETYPE_SWC, CONST_CS | CONST_PERSISTENT); -#endif +#endif REGISTER_LONG_CONSTANT("IMAGETYPE_IFF", IMAGE_FILETYPE_IFF, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("IMAGETYPE_WBMP", IMAGE_FILETYPE_WBMP, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("IMAGETYPE_JPEG2000",IMAGE_FILETYPE_JPC, CONST_CS | CONST_PERSISTENT); /* keep alias */ @@ -221,7 +221,7 @@ static struct gfxinfo *php_handle_swc(php_stream * stream) return NULL; bufz = php_stream_copy_to_mem(stream, PHP_STREAM_COPY_ALL, 0); - + /* * zlib::uncompress() wants to know the output data length * if none was given as a parameter @@ -229,26 +229,26 @@ static struct gfxinfo *php_handle_swc(php_stream * stream) * doubling it whenever it wasn't big enough * that should be eneugh for all real life cases */ - + do { szlength = bufz->len * (1<<factor++); buf = (char *) erealloc(buf, szlength); status = uncompress(buf, &szlength, bufz->val, bufz->len); } while ((status==Z_BUF_ERROR)&&(factor<maxfactor)); - + if (bufz) { zend_string_release(bufz); - } - + } + if (status == Z_OK) { memcpy(b, buf, len); } - - if (buf) { + + if (buf) { efree(buf); - } + } } - + if (!status) { result = (struct gfxinfo *) ecalloc (1, sizeof (struct gfxinfo)); bits = php_swf_get_bits (b, 0, 5); @@ -258,8 +258,8 @@ static struct gfxinfo *php_handle_swc(php_stream * stream) php_swf_get_bits (b, 5 + (2 * bits), bits)) / 20; } else { result = NULL; - } - + } + efree (b); return result; } @@ -472,7 +472,7 @@ static int php_read_APP(php_stream * stream, unsigned int marker, zval *info) /* {{{ php_handle_jpeg main loop to parse JPEG structure */ -static struct gfxinfo *php_handle_jpeg (php_stream * stream, zval *info) +static struct gfxinfo *php_handle_jpeg (php_stream * stream, zval *info) { struct gfxinfo *result = NULL; unsigned int marker = M_PSEUDO; @@ -546,7 +546,7 @@ static struct gfxinfo *php_handle_jpeg (php_stream * stream, zval *info) case M_SOS: case M_EOI: return result; /* we're about to hit image data, or are at EOF. stop processing. */ - + default: if (!php_skip_variable(stream)) { /* anything else isn't interesting */ return result; @@ -582,7 +582,7 @@ static unsigned int php_read4(php_stream * stream) #define JPEG2000_MARKER_SOD 0x93 /* Start of Data */ #define JPEG2000_MARKER_EOC 0xD9 /* End of Codestream */ #define JPEG2000_MARKER_SIZ 0x51 /* Image and tile size */ -#define JPEG2000_MARKER_COD 0x52 /* Coding style default */ +#define JPEG2000_MARKER_COD 0x52 /* Coding style default */ #define JPEG2000_MARKER_COC 0x53 /* Coding style component */ #define JPEG2000_MARKER_RGN 0x5E /* Region of interest */ #define JPEG2000_MARKER_QCD 0x5C /* Quantization default */ @@ -971,7 +971,7 @@ static int php_get_wbmp(php_stream *stream, struct gfxinfo **result, int check) } width = (width << 7) | (i & 0x7f); } while (i & 0x80); - + /* get height */ do { i = php_stream_getc(stream); @@ -985,7 +985,7 @@ static int php_get_wbmp(php_stream *stream, struct gfxinfo **result, int check) if (!height || !width || height > 2048 || width > 2048) { return 0; } - + if (!check) { (*result)->width = width; (*result)->height = height; @@ -1034,7 +1034,7 @@ static int php_get_xbm(php_stream *stream, struct gfxinfo **result) } else { type++; } - + if (!strcmp("width", type)) { width = (unsigned int) value; if (height) { diff --git a/ext/standard/info.c b/ext/standard/info.c index 71d09af6cd..8439e791e8 100644 --- a/ext/standard/info.c +++ b/ext/standard/info.c @@ -201,7 +201,7 @@ static void php_print_gpcse_array(char *name, uint name_length) zend_string *string_key; zend_ulong num_key; zend_string *key; - + key = zend_string_init(name, name_length, 0); zend_is_auto_global(key); @@ -349,7 +349,7 @@ char* php_get_windows_name() VER_SET_CONDITION(dwlConditionMask, VER_MINORVERSION, op); VER_SET_CONDITION(dwlConditionMask, VER_SERVICEPACKMAJOR, op); - if (VerifyVersionInfo(&osvi81, + if (VerifyVersionInfo(&osvi81, VER_MAJORVERSION | VER_MINORVERSION | VER_SERVICEPACKMAJOR, dwlConditionMask)) { osvi.dwMinorVersion = 3; /* Windows 8.1/Windows Server 2012 R2 */ @@ -364,7 +364,7 @@ char* php_get_windows_name() } else { major = "Windows Server 2012"; } - } + } } else { major = "Unknown Windows version"; } @@ -593,14 +593,14 @@ PHPAPI zend_string *php_get_uname(char mode) php_get_windows_cpu(wincpu, sizeof(wincpu)); dwBuild = (DWORD)(HIWORD(dwVersion)); - + /* Windows "version" 6.2 could be Windows 8/Windows Server 2012, but also Windows 8.1/Windows Server 2012 R2 */ if (dwWindowsMajorVersion == 6 && dwWindowsMinorVersion == 2) { if (strncmp(winver, "Windows 8.1", 11) == 0 || strncmp(winver, "Windows Server 2012 R2", 22) == 0) { dwWindowsMinorVersion = 3; } } - + snprintf(tmp_uname, sizeof(tmp_uname), "%s %s %d.%d build %d (%s) %s", "Windows NT", ComputerName, dwWindowsMajorVersion, dwWindowsMinorVersion, dwBuild, winver?winver:"unknown", wincpu); diff --git a/ext/standard/iptc.c b/ext/standard/iptc.c index c536f4b19f..3883bbf550 100644 --- a/ext/standard/iptc.c +++ b/ext/standard/iptc.c @@ -22,8 +22,8 @@ * Functions to parse & compse IPTC data. * PhotoShop >= 3.0 can read and write textual data to JPEG files. * ... more to come ..... - * - * i know, parts of this is now duplicated in image.c + * + * i know, parts of this is now duplicated in image.c * but in this case i think it's okay! */ @@ -31,7 +31,7 @@ * TODO: * - add IPTC translation table */ - + #include "php.h" #include "php_iptc.h" #include "ext/standard/head.h" @@ -76,7 +76,7 @@ /* {{{ php_iptc_put1 */ static int php_iptc_put1(FILE *fp, int spool, unsigned char c, unsigned char **spoolbuf) -{ +{ if (spool > 0) PUTC(c); @@ -89,7 +89,7 @@ static int php_iptc_put1(FILE *fp, int spool, unsigned char c, unsigned char **s /* {{{ php_iptc_get1 */ static int php_iptc_get1(FILE *fp, int spool, unsigned char **spoolbuf) -{ +{ int c; char cc; @@ -121,7 +121,7 @@ static int php_iptc_read_remaining(FILE *fp, int spool, unsigned char **spoolbuf /* {{{ php_iptc_skip_variable */ static int php_iptc_skip_variable(FILE *fp, int spool, unsigned char **spoolbuf) -{ +{ unsigned int length; int c1, c2; @@ -205,7 +205,7 @@ PHP_FUNCTION(iptcembed) poi = spoolbuf = safe_emalloc(1, iptcdata_len + sizeof(psheader) + sb.st_size + 1024, 1); memset(poi, 0, iptcdata_len + sizeof(psheader) + sb.st_size + 1024 + 1); - } + } if (php_iptc_get1(fp, spool, poi?&poi:0) != 0xFF) { fclose(fp); @@ -228,14 +228,14 @@ PHP_FUNCTION(iptcembed) if (marker == M_EOI) { /* EOF */ break; - } else if (marker != M_APP13) { + } else if (marker != M_APP13) { php_iptc_put1(fp, spool, (unsigned char)marker, poi?&poi:0); } switch (marker) { case M_APP13: /* we are going to write a new APP13 marker, so don't output the old one */ - php_iptc_skip_variable(fp, 0, 0); + php_iptc_skip_variable(fp, 0, 0); php_iptc_read_remaining(fp, spool, poi?&poi:0); done = 1; break; @@ -270,7 +270,7 @@ PHP_FUNCTION(iptcembed) } break; - case M_SOS: + case M_SOS: /* we hit data, no more marker-inserting can be done! */ php_iptc_read_remaining(fp, spool, poi?&poi:0); done = 1; @@ -312,7 +312,7 @@ PHP_FUNCTION(iptcparse) buffer = (unsigned char *)str; while (inx < str_len) { /* find 1st tag */ - if ((buffer[inx] == 0x1c) && ((buffer[inx+1] == 0x01) || (buffer[inx+1] == 0x02))){ + if ((buffer[inx] == 0x1c) && ((buffer[inx+1] == 0x01) || (buffer[inx+1] == 0x02))){ break; } else { inx++; @@ -322,8 +322,8 @@ PHP_FUNCTION(iptcparse) while (inx < str_len) { if (buffer[ inx++ ] != 0x1c) { break; /* we ran against some data which does not conform to IPTC - stop parsing! */ - } - + } + if ((inx + 4) >= str_len) break; @@ -334,14 +334,14 @@ PHP_FUNCTION(iptcparse) if((inx+6) >= str_len) { break; } - len = (((zend_long) buffer[ inx + 2 ]) << 24) + (((zend_long) buffer[ inx + 3 ]) << 16) + + len = (((zend_long) buffer[ inx + 2 ]) << 24) + (((zend_long) buffer[ inx + 3 ]) << 16) + (((zend_long) buffer[ inx + 4 ]) << 8) + (((zend_long) buffer[ inx + 5 ])); inx += 6; } else { /* short tag */ len = (((unsigned short) buffer[ inx ])<<8) | (unsigned short)buffer[ inx+1 ]; inx += 2; } - + if ((len < 0) || (len > str_len) || (inx + len) > str_len) { break; } @@ -354,10 +354,10 @@ PHP_FUNCTION(iptcparse) if ((element = zend_hash_str_find(Z_ARRVAL_P(return_value), key, strlen(key))) == NULL) { array_init(&values); - + element = zend_hash_str_update(Z_ARRVAL_P(return_value), key, strlen(key), &values); - } - + } + add_next_index_stringl(element, buffer+inx, len); inx += len; tagsfound++; diff --git a/ext/standard/link.c b/ext/standard/link.c index 7bdb48e973..6d262d4de0 100644 --- a/ext/standard/link.c +++ b/ext/standard/link.c @@ -129,7 +129,7 @@ PHP_FUNCTION(symlink) if (zend_parse_parameters(ZEND_NUM_ARGS(), "pp", &topath, &topath_len, &frompath, &frompath_len) == FAILURE) { return; } - + if (!expand_filepath(frompath, source_p)) { php_error_docref(NULL, E_WARNING, "No such file or directory"); RETURN_FALSE; @@ -144,7 +144,7 @@ PHP_FUNCTION(symlink) } if (php_stream_locate_url_wrapper(source_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY) || - php_stream_locate_url_wrapper(dest_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY) ) + php_stream_locate_url_wrapper(dest_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY) ) { php_error_docref(NULL, E_WARNING, "Unable to symlink to a URL"); RETURN_FALSE; @@ -192,7 +192,7 @@ PHP_FUNCTION(link) } if (php_stream_locate_url_wrapper(source_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY) || - php_stream_locate_url_wrapper(dest_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY) ) + php_stream_locate_url_wrapper(dest_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY) ) { php_error_docref(NULL, E_WARNING, "Unable to link to a URL"); RETURN_FALSE; @@ -208,9 +208,9 @@ PHP_FUNCTION(link) #ifndef ZTS ret = link(topath, frompath); -#else - ret = link(dest_p, source_p); -#endif +#else + ret = link(dest_p, source_p); +#endif if (ret == -1) { php_error_docref(NULL, E_WARNING, "%s", strerror(errno)); RETURN_FALSE; diff --git a/ext/standard/link_win32.c b/ext/standard/link_win32.c index 9fa60a1c3d..57e92c5d94 100644 --- a/ext/standard/link_win32.c +++ b/ext/standard/link_win32.c @@ -137,7 +137,7 @@ PHP_FUNCTION(symlink) if (zend_parse_parameters(ZEND_NUM_ARGS(), "pp", &topath, &topath_len, &frompath, &frompath_len) == FAILURE) { return; } - + if (!expand_filepath(frompath, source_p)) { php_error_docref(NULL, E_WARNING, "No such file or directory"); RETURN_FALSE; @@ -152,7 +152,7 @@ PHP_FUNCTION(symlink) } if (php_stream_locate_url_wrapper(source_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY) || - php_stream_locate_url_wrapper(dest_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY) ) + php_stream_locate_url_wrapper(dest_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY) ) { php_error_docref(NULL, E_WARNING, "Unable to symlink to a URL"); RETURN_FALSE; @@ -207,7 +207,7 @@ PHP_FUNCTION(link) } if (php_stream_locate_url_wrapper(source_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY) || - php_stream_locate_url_wrapper(dest_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY) ) + php_stream_locate_url_wrapper(dest_p, NULL, STREAM_LOCATE_WRAPPERS_ONLY) ) { php_error_docref(NULL, E_WARNING, "Unable to link to a URL"); RETURN_FALSE; @@ -223,9 +223,9 @@ PHP_FUNCTION(link) #ifndef ZTS ret = CreateHardLinkA(topath, frompath, NULL); -#else - ret = CreateHardLinkA(dest_p, source_p, NULL); -#endif +#else + ret = CreateHardLinkA(dest_p, source_p, NULL); +#endif if (ret == 0) { php_error_docref(NULL, E_WARNING, "%s", strerror(errno)); diff --git a/ext/standard/mail.c b/ext/standard/mail.c index e752c042fe..e3ba905cb8 100644 --- a/ext/standard/mail.c +++ b/ext/standard/mail.c @@ -387,7 +387,7 @@ PHPAPI int php_mail(char *to, char *subject, char *message, char *headers, char php_error_docref(NULL, E_WARNING, "Could not execute mail delivery program '%s'", sendmail_path); #if PHP_SIGCHILD if (sig_handler) { - signal(SIGCHLD, sig_handler); + signal(SIGCHLD, sig_handler); } #endif MAIL_RET(0); diff --git a/ext/standard/math.c b/ext/standard/math.c index 0704195e51..486850c190 100644 --- a/ext/standard/math.c +++ b/ext/standard/math.c @@ -144,7 +144,7 @@ PHPAPI double _php_math_round(double value, int places, int mode) { if (!php_math_is_finite(value)) { return value; } - + precision_places = 14 - php_intlog10abs(value); f1 = php_intpow10(abs(places)); @@ -181,7 +181,7 @@ PHPAPI double _php_math_round(double value, int places, int mode) { /* round the temp value */ tmp_value = php_round_helper(tmp_value, mode); - + /* see if it makes sense to use simple division to round the value */ if (abs(places) < 23) { if (places > 0) { @@ -291,22 +291,22 @@ static double php_expm1(double x) /* {{{ proto int abs(int number) Return the absolute value of the number */ -PHP_FUNCTION(abs) +PHP_FUNCTION(abs) { zval *value; - + #ifndef FAST_ZPP if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &value) == FAILURE) { return; } -#else +#else ZEND_PARSE_PARAMETERS_START(1, 1) Z_PARAM_ZVAL(value) ZEND_PARSE_PARAMETERS_END(); #endif convert_scalar_to_number_ex(value); - + if (Z_TYPE_P(value) == IS_DOUBLE) { RETURN_DOUBLE(fabs(Z_DVAL_P(value))); } else if (Z_TYPE_P(value) == IS_LONG) { @@ -318,14 +318,14 @@ PHP_FUNCTION(abs) } RETURN_FALSE; } -/* }}} */ +/* }}} */ /* {{{ proto float ceil(float number) Returns the next highest integer value of the number */ -PHP_FUNCTION(ceil) +PHP_FUNCTION(ceil) { zval *value; - + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &value) == FAILURE) { return; } @@ -345,7 +345,7 @@ PHP_FUNCTION(ceil) PHP_FUNCTION(floor) { zval *value; - + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &value) == FAILURE) { return; } @@ -369,7 +369,7 @@ PHP_FUNCTION(round) zend_long precision = 0; zend_long mode = PHP_ROUND_HALF_UP; double return_val; - + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z|ll", &value, &precision, &mode) == FAILURE) { return; } @@ -424,7 +424,7 @@ PHP_FUNCTION(sin) PHP_FUNCTION(cos) { double num; - + #ifndef FAST_ZPP if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) { return; @@ -615,7 +615,7 @@ PHP_FUNCTION(asinh) PHP_FUNCTION(acosh) { double num; - + #ifndef FAST_ZPP if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &num) == FAILURE) { return; @@ -750,7 +750,7 @@ PHP_FUNCTION(exp) /* {{{ proto float expm1(float number) Returns exp(number) - 1, computed in a way that accurate even when the value of number is close to zero */ /* - WARNING: this function is expermental: it could change its name or + WARNING: this function is expermental: it could change its name or disappear in the next version of PHP! */ PHP_FUNCTION(expm1) @@ -772,9 +772,9 @@ PHP_FUNCTION(expm1) /* }}} */ /* {{{ proto float log1p(float number) - Returns log(1 + number), computed in a way that accurate even when the value of number is close to zero */ + Returns log(1 + number), computed in a way that accurate even when the value of number is close to zero */ /* - WARNING: this function is expermental: it could change its name or + WARNING: this function is expermental: it could change its name or disappear in the next version of PHP! */ PHP_FUNCTION(log1p) @@ -800,7 +800,7 @@ PHP_FUNCTION(log1p) PHP_FUNCTION(log) { double num, base = 0; - + #ifndef FAST_ZPP if (zend_parse_parameters(ZEND_NUM_ARGS(), "d|d", &num, &base) == FAILURE) { return; @@ -881,7 +881,7 @@ PHP_FUNCTION(sqrt) /* }}} */ /* {{{ proto float hypot(float num1, float num2) - Returns sqrt(num1*num1 + num2*num2) */ + Returns sqrt(num1*num1 + num2*num2) */ PHP_FUNCTION(hypot) { double num1, num2; @@ -964,12 +964,12 @@ PHPAPI zend_long _php_math_basetolong(zval *arg, int base) for (i = Z_STRLEN_P(arg); i > 0; i--) { c = *s++; - + digit = (c >= '0' && c <= '9') ? c - '0' : (c >= 'A' && c <= 'Z') ? c - 'A' + 10 : (c >= 'a' && c <= 'z') ? c - 'a' + 10 : base; - + if (digit >= base) { continue; } @@ -980,7 +980,7 @@ PHPAPI zend_long _php_math_basetolong(zval *arg, int base) continue; { - + php_error_docref(NULL, E_WARNING, "Number '%s' is too big to fit in long", s); return ZEND_LONG_MAX; } @@ -1012,23 +1012,23 @@ PHPAPI int _php_math_basetozval(zval *arg, int base, zval *ret) cutoff = ZEND_LONG_MAX / base; cutlim = ZEND_LONG_MAX % base; - + for (i = Z_STRLEN_P(arg); i > 0; i--) { c = *s++; /* might not work for EBCDIC */ - if (c >= '0' && c <= '9') + if (c >= '0' && c <= '9') c -= '0'; - else if (c >= 'A' && c <= 'Z') + else if (c >= 'A' && c <= 'Z') c -= 'A' - 10; - else if (c >= 'a' && c <= 'z') + else if (c >= 'a' && c <= 'z') c -= 'a' - 10; else continue; if (c >= base) continue; - + switch (mode) { case 0: /* Integer */ if (num < cutoff || (num == cutoff && c <= cutlim)) { @@ -1041,7 +1041,7 @@ PHPAPI int _php_math_basetozval(zval *arg, int base, zval *ret) /* fall-through */ case 1: /* Float */ fnum = fnum * base + c; - } + } } if (mode == 1) { @@ -1117,9 +1117,9 @@ PHPAPI zend_string * _php_math_zvaltobase(zval *arg, int base) return zend_string_init(ptr, end - ptr, 0); } - + return _php_math_longtobase(arg, base); -} +} /* }}} */ /* {{{ proto int bindec(string binary_number) @@ -1127,7 +1127,7 @@ PHPAPI zend_string * _php_math_zvaltobase(zval *arg, int base) PHP_FUNCTION(bindec) { zval *arg; - + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &arg) == FAILURE) { return; } @@ -1143,7 +1143,7 @@ PHP_FUNCTION(bindec) PHP_FUNCTION(hexdec) { zval *arg; - + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &arg) == FAILURE) { return; } @@ -1159,7 +1159,7 @@ PHP_FUNCTION(hexdec) PHP_FUNCTION(octdec) { zval *arg; - + if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &arg) == FAILURE) { return; } @@ -1230,7 +1230,7 @@ PHP_FUNCTION(base_convert) return; } convert_to_string_ex(number); - + if (frombase < 2 || frombase > 36) { php_error_docref(NULL, E_WARNING, "Invalid `from base' (%pd)", frombase); RETURN_FALSE; @@ -1245,10 +1245,10 @@ PHP_FUNCTION(base_convert) } result = _php_math_zvaltobase(&temp, (int)tobase); RETVAL_STR(result); -} +} /* }}} */ -/* {{{ _php_math_number_format +/* {{{ _php_math_number_format */ PHPAPI zend_string *_php_math_number_format(double d, int dec, char dec_point, char thousand_sep) { @@ -1300,9 +1300,9 @@ PHPAPI zend_string *_php_math_number_format_ex(double d, int dec, char *dec_poin if (thousand_sep) { integral += (int)(thousand_sep_len * ((integral-1) / 3)); } - + reslen = integral; - + if (dec) { reslen += dec; @@ -1332,7 +1332,7 @@ PHPAPI zend_string *_php_math_number_format_ex(double d, int dec, char *dec_poin while (topad--) { *t-- = '0'; } - + if (dp) { s -= declen + 1; /* +1 to skip the point */ t -= declen; @@ -1377,7 +1377,7 @@ PHP_FUNCTION(number_format) char *thousand_sep = NULL, *dec_point = NULL; char thousand_sep_chr = ',', dec_point_chr = '.'; size_t thousand_sep_len = 0, dec_point_len = 0; - + #ifndef FAST_ZPP if (zend_parse_parameters(ZEND_NUM_ARGS(), "d|ls!s!", &num, &dec, &dec_point, &dec_point_len, &thousand_sep, &thousand_sep_len) == FAILURE) { return; @@ -1443,26 +1443,26 @@ PHP_FUNCTION(fmod) /* {{{ proto int intdiv(int numerator, int divisor) Returns the integer division of the numerator by the divisor */ -PHP_FUNCTION(intdiv) +PHP_FUNCTION(intdiv) { zend_long numerator, divisor; - + if (zend_parse_parameters(ZEND_NUM_ARGS(), "ll", &numerator, &divisor) == FAILURE) { return; } - + if (divisor == 0) { php_error_docref(NULL, E_WARNING, "Division by zero"); RETURN_BOOL(0); } else if (divisor == -1 && numerator == ZEND_LONG_MIN) { - /* Prevent overflow error/crash + /* Prevent overflow error/crash We don't return a float here as that violates function contract */ RETURN_LONG(0); } - + RETURN_LONG(numerator/divisor); } -/* }}} */ +/* }}} */ /* * Local variables: diff --git a/ext/standard/md5.c b/ext/standard/md5.c index 1a06e95b40..22b67a23ba 100644 --- a/ext/standard/md5.c +++ b/ext/standard/md5.c @@ -51,11 +51,11 @@ PHP_NAMED_FUNCTION(php_if_md5) char md5str[33]; PHP_MD5_CTX context; unsigned char digest[16]; - + if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|b", &arg, &raw_output) == FAILURE) { return; } - + md5str[0] = '\0'; PHP_MD5Init(&context); PHP_MD5Update(&context, arg->val, arg->len); @@ -87,7 +87,7 @@ PHP_NAMED_FUNCTION(php_if_md5_file) if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|b", &arg, &arg_len, &raw_output) == FAILURE) { return; } - + stream = php_stream_open_wrapper(arg, "rb", REPORT_ERRORS, NULL); if (!stream) { RETURN_FALSE; diff --git a/ext/standard/metaphone.c b/ext/standard/metaphone.c index 8ce43c6710..faaa9215f6 100644 --- a/ext/standard/metaphone.c +++ b/ext/standard/metaphone.c @@ -19,7 +19,7 @@ /* $Id$ */ /* - Based on CPANs "Text-Metaphone-1.96" by Michael G Schwern <schwern@pobox.com> + Based on CPANs "Text-Metaphone-1.96" by Michael G Schwern <schwern@pobox.com> */ #include "php.h" @@ -50,10 +50,10 @@ PHP_FUNCTION(metaphone) } /* }}} */ -/* +/* this is now the original code by Michael G Schwern: - i've changed it just a slightly bit (use emalloc, - get rid of includes etc) + i've changed it just a slightly bit (use emalloc, + get rid of includes etc) - thies - 13.09.1999 */ @@ -226,8 +226,8 @@ static int metaphone(unsigned char *word, size_t word_len, zend_long max_phoneme w_idx += 2; } break; - /* WH becomes W, - WR becomes R + /* WH becomes W, + WR becomes R W if followed by a vowel */ case 'W': if (Next_Letter == 'R') { @@ -267,7 +267,7 @@ static int metaphone(unsigned char *word, size_t word_len, zend_long max_phoneme for (; Curr_Letter != '\0' && (max_phonemes == 0 || Phone_Len < max_phonemes); w_idx++) { - /* How many letters to skip because an eariler encoding handled + /* How many letters to skip because an eariler encoding handled * multiple letters */ unsigned short int skip_letter = 0; @@ -335,7 +335,7 @@ static int metaphone(unsigned char *word, size_t word_len, zend_long max_phoneme Phonize('T'); break; /* F if in -GH and not B--GH, D--GH, -H--GH, -H---GH - * else dropped if -GNED, -GN, + * else dropped if -GNED, -GN, * else dropped if -DGE-, -DGI- or -DGY- (handled in D) * else J if in -GE-, -GI, -GY and not GG * else K diff --git a/ext/standard/microtime.c b/ext/standard/microtime.c index d8f72b20d4..48dd449cbd 100644 --- a/ext/standard/microtime.c +++ b/ext/standard/microtime.c @@ -71,7 +71,7 @@ static void _php_gettimeofday(INTERNAL_FUNCTION_PARAMETERS, int mode) timelib_time_offset *offset; offset = timelib_get_time_zone_info(tp.tv_sec, get_timezone_info()); - + array_init(return_value); add_assoc_long(return_value, "sec", tp.tv_sec); add_assoc_long(return_value, "usec", tp.tv_usec); @@ -117,7 +117,7 @@ PHP_FUNCTION(getrusage) if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &pwho) == FAILURE) { return; } - + if (pwho == 1) { who = RUSAGE_CHILDREN; } diff --git a/ext/standard/pack.c b/ext/standard/pack.c index 5578604b66..0e39d2c8e3 100644 --- a/ext/standard/pack.c +++ b/ext/standard/pack.c @@ -154,7 +154,7 @@ PHP_FUNCTION(pack) } else if (c >= '0' && c <= '9') { arg = atoi(&format[i]); - + while (format[i] >= '0' && format[i] <= '9' && i < formatlen) { i++; } @@ -164,8 +164,8 @@ PHP_FUNCTION(pack) /* Handle special arg '*' for all codes and check argv overflows */ switch ((int) code) { /* Never uses any args */ - case 'x': - case 'X': + case 'x': + case 'X': case '@': if (arg < 0) { php_error_docref(NULL, E_WARNING, "Type %c: '*' ignored", code); @@ -174,10 +174,10 @@ PHP_FUNCTION(pack) break; /* Always uses one arg */ - case 'a': - case 'A': - case 'Z': - case 'h': + case 'a': + case 'A': + case 'Z': + case 'h': case 'H': if (currentarg >= num_args) { efree(formatcodes); @@ -214,20 +214,20 @@ PHP_FUNCTION(pack) php_error_docref(NULL, E_WARNING, "64-bit format codes are not available for 32-bit versions of PHP"); RETURN_FALSE; #endif - case 'c': - case 'C': - case 's': - case 'S': - case 'i': + case 'c': + case 'C': + case 's': + case 'S': + case 'i': case 'I': - case 'l': - case 'L': - case 'n': - case 'N': - case 'v': + case 'l': + case 'L': + case 'n': + case 'N': + case 'v': case 'V': - case 'f': - case 'd': + case 'f': + case 'd': if (arg < 0) { arg = num_args - currentarg; } @@ -263,35 +263,35 @@ PHP_FUNCTION(pack) int arg = formatargs[i]; switch ((int) code) { - case 'h': - case 'H': + case 'h': + case 'H': INC_OUTPUTPOS((arg + (arg % 2)) / 2,1) /* 4 bit per arg */ break; - case 'a': + case 'a': case 'A': case 'Z': - case 'c': + case 'c': case 'C': case 'x': INC_OUTPUTPOS(arg,1) /* 8 bit per arg */ break; - case 's': - case 'S': - case 'n': + case 's': + case 'S': + case 'n': case 'v': INC_OUTPUTPOS(arg,2) /* 16 bit per arg */ break; - case 'i': + case 'i': case 'I': INC_OUTPUTPOS(arg,sizeof(int)) break; - case 'l': - case 'L': - case 'N': + case 'l': + case 'L': + case 'N': case 'V': INC_OUTPUTPOS(arg,4) /* 32 bit per arg */ break; @@ -342,8 +342,8 @@ PHP_FUNCTION(pack) int arg = formatargs[i]; switch ((int) code) { - case 'a': - case 'A': + case 'a': + case 'A': case 'Z': { int arg_cp = (code != 'Z') ? arg : MAX(0, arg - 1); @@ -358,13 +358,13 @@ PHP_FUNCTION(pack) break; } - case 'h': + case 'h': case 'H': { int nibbleshift = (code == 'h') ? 0 : 4; int first = 1; zend_string *str = zval_get_string(&argv[currentarg++]); - char *v = str->val; + char *v = str->val; outputpos--; if(arg > str->len) { @@ -401,7 +401,7 @@ PHP_FUNCTION(pack) break; } - case 'c': + case 'c': case 'C': while (arg-- > 0) { php_pack(&argv[currentarg++], 1, byte_map, &output[outputpos]); @@ -409,9 +409,9 @@ PHP_FUNCTION(pack) } break; - case 's': - case 'S': - case 'n': + case 's': + case 'S': + case 'n': case 'v': { int *map = machine_endian_short_map; @@ -428,17 +428,17 @@ PHP_FUNCTION(pack) break; } - case 'i': - case 'I': + case 'i': + case 'I': while (arg-- > 0) { php_pack(&argv[currentarg++], sizeof(int), int_map, &output[outputpos]); outputpos += sizeof(int); } break; - case 'l': - case 'L': - case 'N': + case 'l': + case 'L': + case 'N': case 'V': { int *map = machine_endian_long_map; @@ -544,7 +544,7 @@ static zend_long php_unpack(char *data, size_t size, int issigned, int *map) /* unpack() is based on Perl's unpack(), but is modified a bit from there. * Rather than depending on error-prone ordered lists or syntactically - * unpleasant pass-by-reference, we return an object with named parameters + * unpleasant pass-by-reference, we return an object with named parameters * (like *_fetch_object()). Syntax is "f[repeat]name/...", where "f" is the * formatter char (like pack()), "[repeat]" is the optional repeater argument, * and "name" is the name of the variable to use. @@ -563,7 +563,7 @@ PHP_FUNCTION(unpack) zend_long formatlen, inputpos, inputlen; int i; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS", &formatarg, + if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS", &formatarg, &inputarg) == FAILURE) { return; } @@ -618,7 +618,7 @@ PHP_FUNCTION(unpack) switch ((int) type) { /* Never use any input */ - case 'X': + case 'X': size = -1; break; @@ -626,44 +626,44 @@ PHP_FUNCTION(unpack) size = 0; break; - case 'a': + case 'a': case 'A': case 'Z': size = arg; arg = 1; break; - case 'h': - case 'H': + case 'h': + case 'H': size = (arg > 0) ? (arg + (arg % 2)) / 2 : arg; arg = 1; break; /* Use 1 byte of input */ - case 'c': + case 'c': case 'C': case 'x': size = 1; break; /* Use 2 bytes of input */ - case 's': - case 'S': - case 'n': + case 's': + case 'S': + case 'n': case 'v': size = 2; break; /* Use sizeof(int) bytes of input */ - case 'i': + case 'i': case 'I': size = sizeof(int); break; /* Use 4 bytes of input */ - case 'l': - case 'L': - case 'N': + case 'l': + case 'L': + case 'N': case 'V': size = 4; break; @@ -784,8 +784,8 @@ PHP_FUNCTION(unpack) break; } - - case 'h': + + case 'h': case 'H': { size_t len = (inputlen - inputpos) * 2; /* Remaining */ int nibbleshift = (type == 'h') ? 0 : 4; @@ -796,9 +796,9 @@ PHP_FUNCTION(unpack) /* If size was given take minimum of len and size */ if (size >= 0 && len > (size * 2)) { len = size * 2; - } + } - if (argb > 0) { + if (argb > 0) { len -= argb % 2; } @@ -828,7 +828,7 @@ PHP_FUNCTION(unpack) break; } - case 'c': + case 'c': case 'C': { int issigned = (type == 'c') ? (input[inputpos] & 0x80) : 0; zend_long v = php_unpack(&input[inputpos], 1, issigned, byte_map); @@ -836,9 +836,9 @@ PHP_FUNCTION(unpack) break; } - case 's': - case 'S': - case 'n': + case 's': + case 'S': + case 'n': case 'v': { zend_long v; int issigned = 0; @@ -857,7 +857,7 @@ PHP_FUNCTION(unpack) break; } - case 'i': + case 'i': case 'I': { zend_long v; int issigned = 0; @@ -871,9 +871,9 @@ PHP_FUNCTION(unpack) break; } - case 'l': - case 'L': - case 'N': + case 'l': + case 'L': + case 'N': case 'V': { int issigned = 0; int *map = machine_endian_long_map; @@ -896,7 +896,7 @@ PHP_FUNCTION(unpack) v |= php_unpack(&input[inputpos], 4, issigned, map); if (SIZEOF_ZEND_LONG > 4) { if (type == 'l') { - v = (signed int) v; + v = (signed int) v; } else { v = (unsigned int) v; } diff --git a/ext/standard/pageinfo.c b/ext/standard/pageinfo.c index de13dd399f..ab4ca190fa 100644 --- a/ext/standard/pageinfo.c +++ b/ext/standard/pageinfo.c @@ -101,7 +101,7 @@ PHP_FUNCTION(getmyuid) if (zend_parse_parameters_none() == FAILURE) { return; } - + uid = php_getuid(); if (uid < 0) { RETURN_FALSE; @@ -120,7 +120,7 @@ PHP_FUNCTION(getmygid) if (zend_parse_parameters_none() == FAILURE) { return; } - + gid = php_getgid(); if (gid < 0) { RETURN_FALSE; @@ -139,7 +139,7 @@ PHP_FUNCTION(getmypid) if (zend_parse_parameters_none() == FAILURE) { return; } - + pid = getpid(); if (pid < 0) { RETURN_FALSE; diff --git a/ext/standard/password.c b/ext/standard/password.c index 5e1c26de54..3be8104df5 100644 --- a/ext/standard/password.c +++ b/ext/standard/password.c @@ -57,7 +57,7 @@ static char* php_password_get_algo_name(const php_password_algo algo) } } -static php_password_algo php_password_determine_algo(const char *hash, const size_t len) +static php_password_algo php_password_determine_algo(const char *hash, const size_t len) { if (len > 3 && hash[0] == '$' && hash[1] == '2' && hash[2] == 'y' && len == 60) { return PHP_PASSWORD_BCRYPT; @@ -156,7 +156,7 @@ static int php_password_make_salt(size_t length, char *ret) /* {{{ */ } } - result = safe_emalloc(length, 1, 1); + result = safe_emalloc(length, 1, 1); if (php_password_salt_to64(buffer, raw_length, length, result) == FAILURE) { php_error_docref(NULL, E_WARNING, "Generated salt too short"); efree(buffer); @@ -186,7 +186,7 @@ PHP_FUNCTION(password_get_info) algo = php_password_determine_algo(hash, (size_t) hash_len); algo_name = php_password_get_algo_name(algo); - + switch (algo) { case PHP_PASSWORD_BCRYPT: { @@ -201,10 +201,10 @@ PHP_FUNCTION(password_get_info) } array_init(return_value); - + add_assoc_long(return_value, "algo", algo); add_assoc_string(return_value, "algoName", algo_name); - add_assoc_zval(return_value, "options", &options); + add_assoc_zval(return_value, "options", &options); } PHP_FUNCTION(password_needs_rehash) @@ -215,13 +215,13 @@ PHP_FUNCTION(password_needs_rehash) char *hash; HashTable *options = 0; zval *option_buffer; - + if (zend_parse_parameters(ZEND_NUM_ARGS(), "sl|H", &hash, &hash_len, &new_algo, &options) == FAILURE) { return; } algo = php_password_determine_algo(hash, (size_t) hash_len); - + if (algo != new_algo) { RETURN_TRUE; } @@ -230,7 +230,7 @@ PHP_FUNCTION(password_needs_rehash) case PHP_PASSWORD_BCRYPT: { zend_long new_cost = PHP_PASSWORD_BCRYPT_COST, cost = 0; - + if (options && (option_buffer = zend_symtable_str_find(options, "cost", sizeof("cost")-1)) != NULL) { if (Z_TYPE_P(option_buffer) != IS_LONG) { zval cast_option_buffer; @@ -264,7 +264,7 @@ PHP_FUNCTION(password_verify) size_t password_len, hash_len; char *password, *hash; zend_string *ret; - + if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &password, &password_len, &hash, &hash_len) == FAILURE) { RETURN_FALSE; } @@ -276,7 +276,7 @@ PHP_FUNCTION(password_verify) zend_string_free(ret); RETURN_FALSE; } - + /* We're using this method instead of == in order to provide * resistance towards timing attacks. This is a constant time * equality check that will always check every byte of both @@ -288,7 +288,7 @@ PHP_FUNCTION(password_verify) zend_string_free(ret); RETURN_BOOL(status == 0); - + } /* }}} */ @@ -313,7 +313,7 @@ PHP_FUNCTION(password_hash) case PHP_PASSWORD_BCRYPT: { zend_long cost = PHP_PASSWORD_BCRYPT_COST; - + if (options && (option_buffer = zend_symtable_str_find(options, "cost", sizeof("cost")-1)) != NULL) { if (Z_TYPE_P(option_buffer) != IS_LONG) { zval cast_option_buffer; @@ -325,12 +325,12 @@ PHP_FUNCTION(password_hash) cost = Z_LVAL_P(option_buffer); } } - + if (cost < 4 || cost > 31) { php_error_docref(NULL, E_WARNING, "Invalid bcrypt cost parameter specified: " ZEND_LONG_FMT, cost); RETURN_NULL(); } - + required_salt_len = 22; hash_format = emalloc(8); sprintf(hash_format, "$2y$%02ld$", (long) cost); @@ -415,7 +415,7 @@ PHP_FUNCTION(password_hash) } salt_len = required_salt_len; } - + salt[salt_len] = 0; hash = safe_emalloc(salt_len + hash_format_len, 1, 1); diff --git a/ext/standard/php_array.h b/ext/standard/php_array.h index f8479e2700..6c06be983e 100644 --- a/ext/standard/php_array.h +++ b/ext/standard/php_array.h @@ -1,4 +1,4 @@ -/* +/* +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ @@ -124,10 +124,10 @@ PHPAPI zend_long php_count_recursive(zval *array, zend_long mode); #define ARRAY_FILTER_USE_BOTH 1 #define ARRAY_FILTER_USE_KEY 2 -ZEND_BEGIN_MODULE_GLOBALS(array) +ZEND_BEGIN_MODULE_GLOBALS(array) int *multisort_flags[2]; int (*compare_func)(zval *result, zval *op1, zval *op2); -ZEND_END_MODULE_GLOBALS(array) +ZEND_END_MODULE_GLOBALS(array) #ifdef ZTS #define ARRAYG(v) ZEND_TSRMG(array_globals_id, zend_array_globals *, v) diff --git a/ext/standard/php_browscap.h b/ext/standard/php_browscap.h index 467809dbf5..1be9527f3a 100644 --- a/ext/standard/php_browscap.h +++ b/ext/standard/php_browscap.h @@ -1,4 +1,4 @@ -/* +/* +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ diff --git a/ext/standard/php_crypt_r.c b/ext/standard/php_crypt_r.c index dc4e27b112..a3d0242e21 100644 --- a/ext/standard/php_crypt_r.c +++ b/ext/standard/php_crypt_r.c @@ -62,7 +62,7 @@ MUTEX_T php_crypt_extended_init_lock; #if 0 CONDITION_VARIABLE initialized; #endif - + void php_init_crypt_r() { #ifdef ZTS @@ -294,7 +294,7 @@ char * php_md5_crypt_r(const char *pw, const char *salt, char *out) { _destroyCtx1: if (ctx1) { if (!CryptDestroyHash(ctx1)) { - + } } @@ -325,9 +325,9 @@ char * php_md5_crypt_r(const char *pw, const char *salt, char *out) PHP_MD5_CTX ctx, ctx1; php_uint32 l; int pl; - + pwl = strlen(pw); - + /* Refine the salt first */ sp = salt; diff --git a/ext/standard/php_dns.h b/ext/standard/php_dns.h index af6c091881..679b21420c 100644 --- a/ext/standard/php_dns.h +++ b/ext/standard/php_dns.h @@ -1,4 +1,4 @@ -/* +/* +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ diff --git a/ext/standard/php_fopen_wrapper.c b/ext/standard/php_fopen_wrapper.c index dc52ade5c8..af8e5b60aa 100644 --- a/ext/standard/php_fopen_wrapper.c +++ b/ext/standard/php_fopen_wrapper.c @@ -322,7 +322,7 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, const char *pa "The file descriptors must be non-negative numbers smaller than %d", dtablesize); return NULL; } - + fd = dup((int)fildes_ori); if (fd == -1) { php_stream_wrapper_log_error(wrapper, options, diff --git a/ext/standard/php_fopen_wrappers.h b/ext/standard/php_fopen_wrappers.h index b82a1f8913..22273f6ba5 100644 --- a/ext/standard/php_fopen_wrappers.h +++ b/ext/standard/php_fopen_wrappers.h @@ -1,4 +1,4 @@ -/* +/* +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ diff --git a/ext/standard/php_http.h b/ext/standard/php_http.h index 81a5b45bb6..1ef1dd7357 100644 --- a/ext/standard/php_http.h +++ b/ext/standard/php_http.h @@ -27,7 +27,7 @@ PHPAPI int php_url_encode_hash_ex(HashTable *ht, smart_str *formstr, const char *num_prefix, size_t num_prefix_len, const char *key_prefix, size_t key_prefix_len, - const char *key_suffix, size_t key_suffix_len, + const char *key_suffix, size_t key_suffix_len, zval *type, char *arg_sep, int enc_type); #define php_url_encode_hash(ht, formstr) php_url_encode_hash_ex((ht), (formstr), NULL, 0, NULL, 0, NULL, 0, NULL) diff --git a/ext/standard/php_iptc.h b/ext/standard/php_iptc.h index af0269ce78..ce23577c33 100644 --- a/ext/standard/php_iptc.h +++ b/ext/standard/php_iptc.h @@ -1,4 +1,4 @@ -/* +/* +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ diff --git a/ext/standard/php_lcg.h b/ext/standard/php_lcg.h index c89f4f3034..3863d9fc8b 100644 --- a/ext/standard/php_lcg.h +++ b/ext/standard/php_lcg.h @@ -1,4 +1,4 @@ -/* +/* +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ diff --git a/ext/standard/php_mail.h b/ext/standard/php_mail.h index 68f806db5d..5c8fa199d1 100644 --- a/ext/standard/php_mail.h +++ b/ext/standard/php_mail.h @@ -1,4 +1,4 @@ -/* +/* +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ diff --git a/ext/standard/php_metaphone.h b/ext/standard/php_metaphone.h index 100b1a8bc2..7f3b55f9d0 100644 --- a/ext/standard/php_metaphone.h +++ b/ext/standard/php_metaphone.h @@ -15,7 +15,7 @@ | Author: Thies C. Arntzen <thies@thieso.net> | +----------------------------------------------------------------------+ */ - + /* $Id$ */ #ifndef PHP_METAPHONE_H diff --git a/ext/standard/php_rand.h b/ext/standard/php_rand.h index e775d1b465..1c037f4cff 100644 --- a/ext/standard/php_rand.h +++ b/ext/standard/php_rand.h @@ -45,7 +45,7 @@ (__n) = (__min) + (zend_long) ((double) ( (double) (__max) - (__min) + 1.0) * ((__n) / ((__tmax) + 1.0))) /* MT Rand */ -#define PHP_MT_RAND_MAX ((zend_long) (0x7FFFFFFF)) /* (1<<31) - 1 */ +#define PHP_MT_RAND_MAX ((zend_long) (0x7FFFFFFF)) /* (1<<31) - 1 */ #ifdef PHP_WIN32 #define GENERATE_SEED() (((zend_long) (time(0) * GetCurrentProcessId())) ^ ((zend_long) (1000000.0 * php_combined_lcg()))) diff --git a/ext/standard/php_smart_string.h b/ext/standard/php_smart_string.h index e052574a34..68518357f6 100644 --- a/ext/standard/php_smart_string.h +++ b/ext/standard/php_smart_string.h @@ -122,7 +122,7 @@ char *__t = zend_print##func##_to_buf(__b + sizeof(__b) - 1, (num)); \ smart_string_appendl_ex((dest), __t, __b + sizeof(__b) - 1 - __t, (type)); \ } while (0) - + #define smart_string_append_unsigned_ex(dest, num, type) \ smart_string_append_generic_ex((dest), (num), (type), zend_ulong, _ulong) diff --git a/ext/standard/php_var.h b/ext/standard/php_var.h index a3b0dbf94f..623224933d 100644 --- a/ext/standard/php_var.h +++ b/ext/standard/php_var.h @@ -1,4 +1,4 @@ -/* +/* +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ @@ -119,5 +119,5 @@ PHPAPI void var_replace(php_unserialize_data_t *var_hash, zval *ozval, zval *nzv PHPAPI void var_push_dtor(php_unserialize_data_t *var_hash, zval *val); PHPAPI void var_push_dtor_no_addref(php_unserialize_data_t *var_hashx, zval *rval); PHPAPI void var_destroy(php_unserialize_data_t *var_hash); - + #endif /* PHP_VAR_H */ diff --git a/ext/standard/proc_open.c b/ext/standard/proc_open.c index 6f2516bca6..30e0e7c138 100644 --- a/ext/standard/proc_open.c +++ b/ext/standard/proc_open.c @@ -878,7 +878,7 @@ PHP_FUNCTION(proc_open) if (pipes != NULL) { zval_dtor(pipes); - } + } array_init(pipes); diff --git a/ext/standard/quot_print.c b/ext/standard/quot_print.c index 6699566863..548f886d25 100644 --- a/ext/standard/quot_print.c +++ b/ext/standard/quot_print.c @@ -144,7 +144,7 @@ PHPAPI zend_string *php_quot_print_decode(const unsigned char *str, size_t lengt /* }}} */ #define PHP_QPRINT_MAXL 75 - + PHPAPI zend_string *php_quot_print_encode(const unsigned char *str, size_t length) /* {{{ */ { zend_ulong lp = 0; @@ -163,9 +163,9 @@ PHPAPI zend_string *php_quot_print_encode(const unsigned char *str, size_t lengt lp = 0; } else { if (iscntrl (c) || (c == 0x7f) || (c & 0x80) || (c == '=') || ((c == ' ') && (*str == '\015'))) { - if ((((lp+= 3) > PHP_QPRINT_MAXL) && (c <= 0x7f)) - || ((c > 0x7f) && (c <= 0xdf) && ((lp + 3) > PHP_QPRINT_MAXL)) - || ((c > 0xdf) && (c <= 0xef) && ((lp + 6) > PHP_QPRINT_MAXL)) + if ((((lp+= 3) > PHP_QPRINT_MAXL) && (c <= 0x7f)) + || ((c > 0x7f) && (c <= 0xdf) && ((lp + 3) > PHP_QPRINT_MAXL)) + || ((c > 0xdf) && (c <= 0xef) && ((lp + 6) > PHP_QPRINT_MAXL)) || ((c > 0xef) && (c <= 0xf4) && ((lp + 9) > PHP_QPRINT_MAXL))) { *d++ = '='; *d++ = '\015'; @@ -209,7 +209,7 @@ PHP_FUNCTION(quoted_printable_decode) if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &arg1) == FAILURE) { return; } - + if (arg1->len == 0) { /* shortcut */ RETURN_EMPTY_STRING(); @@ -220,11 +220,11 @@ PHP_FUNCTION(quoted_printable_decode) while (str_in[i]) { switch (str_in[i]) { case '=': - if (str_in[i + 1] && str_in[i + 2] && - isxdigit((int) str_in[i + 1]) && + if (str_in[i + 1] && str_in[i + 2] && + isxdigit((int) str_in[i + 1]) && isxdigit((int) str_in[i + 2])) { - str_out->val[j++] = (php_hex2int((int) str_in[i + 1]) << 4) + str_out->val[j++] = (php_hex2int((int) str_in[i + 1]) << 4) + php_hex2int((int) str_in[i + 2]); i += 3; } else /* check for soft line break according to RFC 2045*/ { @@ -256,7 +256,7 @@ PHP_FUNCTION(quoted_printable_decode) } str_out->val[j] = '\0'; str_out->len = j; - + RETVAL_NEW_STR(str_out); } /* }}} */ diff --git a/ext/standard/rand.c b/ext/standard/rand.c index 528b38fd41..c725514413 100644 --- a/ext/standard/rand.c +++ b/ext/standard/rand.c @@ -109,7 +109,7 @@ PHPAPI zend_long php_rand(void) Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura, Copyright (C) 2000 - 2003, Richard J. Wagner - All rights reserved. + All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -122,8 +122,8 @@ PHPAPI zend_long php_rand(void) notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - 3. The names of its contributors may not be used to endorse or promote - products derived from this software without specific prior written + 3. The names of its contributors may not be used to endorse or promote + products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS @@ -209,14 +209,14 @@ PHPAPI php_uint32 php_mt_rand(void) { /* Pull a 32-bit integer from the generator state Every other access function simply transforms the numbers extracted here */ - + register php_uint32 s1; if (BG(left) == 0) { php_mt_reload(); } --BG(left); - + s1 = *BG(next)++; s1 ^= (s1 >> 11); s1 ^= (s1 << 7) & 0x9d2c5680U; @@ -247,7 +247,7 @@ PHP_FUNCTION(mt_srand) { zend_long seed = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &seed) == FAILURE) + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &seed) == FAILURE) return; if (ZEND_NUM_ARGS() == 0) @@ -279,10 +279,10 @@ PHP_FUNCTION(mt_srand) # number of b+1 which would be bad. So we bump M up by one to make sure # this will never happen, and the final algorithm looks like this: # - # n' = a + n(b-a+1)/(M+1) + # n' = a + n(b-a+1)/(M+1) * * -RL - */ + */ /* {{{ proto int rand([int min, int max]) Returns a random number */ @@ -331,8 +331,8 @@ PHP_FUNCTION(mt_rand) * Melo: hmms.. randomMT() returns 32 random bits... * Yet, the previous php_rand only returns 31 at most. * So I put a right shift to loose the lsb. It *seems* - * better than clearing the msb. - * Update: + * better than clearing the msb. + * Update: * I talked with Cokus via email and it won't ruin the algorithm */ number = (zend_long) (php_mt_rand() >> 1); diff --git a/ext/standard/scanf.h b/ext/standard/scanf.h index a94e8006de..6f7177011b 100644 --- a/ext/standard/scanf.h +++ b/ext/standard/scanf.h @@ -1,4 +1,4 @@ -/* +/* +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ @@ -27,7 +27,7 @@ /* upper limit to keep resources in check and */ /* minimize the possibility of exploits */ -#define SCAN_SUCCESS SUCCESS +#define SCAN_SUCCESS SUCCESS #define SCAN_ERROR_EOF -1 /* indicates premature termination of scan */ /* can be caused by bad parameters or format*/ /* string. */ @@ -37,7 +37,7 @@ #define SCAN_ERROR_INTERNAL (SCAN_ERROR_WRONG_PARAM_COUNT - 1) -/* +/* * The following are here solely for the benefit of the scanf type functions * e.g. fscanf */ diff --git a/ext/standard/sha1.c b/ext/standard/sha1.c index e966149e76..e7fb07fb6a 100644 --- a/ext/standard/sha1.c +++ b/ext/standard/sha1.c @@ -20,7 +20,7 @@ #include "php.h" -/* This code is heavily based on the PHP md5 implementation */ +/* This code is heavily based on the PHP md5 implementation */ #include "sha1.h" #include "md5.h" @@ -39,7 +39,7 @@ PHP_FUNCTION(sha1) char sha1str[41]; PHP_SHA1_CTX context; unsigned char digest[20]; - + if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|b", &arg, &raw_output) == FAILURE) { return; } @@ -77,7 +77,7 @@ PHP_FUNCTION(sha1_file) if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|b", &arg, &arg_len, &raw_output) == FAILURE) { return; } - + stream = php_stream_open_wrapper(arg, "rb", REPORT_ERRORS, NULL); if (!stream) { RETURN_FALSE; @@ -128,7 +128,7 @@ static unsigned char PADDING[64] = /* W[i] */ #define W(i) ( tmp=x[(i-3)&15]^x[(i-8)&15]^x[(i-14)&15]^x[i&15], \ - (x[i&15]=ROTATE_LEFT(tmp, 1)) ) + (x[i&15]=ROTATE_LEFT(tmp, 1)) ) /* FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4. */ @@ -152,7 +152,7 @@ static unsigned char PADDING[64] = (e) += ROTATE_LEFT ((a), 5); \ (b) = ROTATE_LEFT((b), 30); \ } - + /* {{{ PHP_SHA1Init * SHA1 initialization. Begins an SHA1 operation, writing a new context. @@ -230,7 +230,7 @@ PHPAPI void PHP_SHA1Final(unsigned char digest[20], PHP_SHA1_CTX * context) bits[2] = (context->count[1] >> 8) & 0xFF; bits[1] = (context->count[1] >> 16) & 0xFF; bits[0] = (context->count[1] >> 24) & 0xFF; - + /* Pad out to 56 mod 64. */ index = (unsigned int) ((context->count[0] >> 3) & 0x3f); diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c index 3a28a2d576..6782a254ae 100644 --- a/ext/standard/streamsfuncs.c +++ b/ext/standard/streamsfuncs.c @@ -646,7 +646,7 @@ static int stream_array_from_fd_set(zval *stream_array, fd_set *fds) } else { dest_elem = zend_hash_update(Z_ARRVAL(new_array), key, elem); } - + if (dest_elem) { zval_add_ref(dest_elem); } @@ -1389,7 +1389,7 @@ PHP_FUNCTION(stream_set_chunk_size) php_error_docref(NULL, E_WARNING, "The chunk size must be a positive integer, given " ZEND_LONG_FMT, csize); RETURN_FALSE; } - /* stream.chunk_size is actually a size_t, but php_stream_set_option + /* stream.chunk_size is actually a size_t, but php_stream_set_option * can only use an int to accept the new value and return the old one. * In any case, values larger than INT_MAX for a chunk size make no sense. */ @@ -1397,11 +1397,11 @@ PHP_FUNCTION(stream_set_chunk_size) php_error_docref(NULL, E_WARNING, "The chunk size cannot be larger than %d", INT_MAX); RETURN_FALSE; } - + php_stream_from_zval(stream, zstream); ret = php_stream_set_option(stream, PHP_STREAM_OPTION_SET_CHUNK_SIZE, (int)csize, NULL); - + RETURN_LONG(ret > 0 ? (zend_long)ret : (zend_long)EOF); } /* }}} */ diff --git a/ext/standard/string.c b/ext/standard/string.c index 483e8b4f1d..197c363ce3 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -1518,7 +1518,7 @@ PHPAPI zend_string *php_basename(const char *s, size_t len, char *suffix, size_t } #if defined(PHP_WIN32) || defined(NETWARE) /* Catch relative paths in c:file.txt style. They're not to confuse - with the NTFS streams. This part ensures also, that no drive + with the NTFS streams. This part ensures also, that no drive letter traversing happens. */ } else if ((*c == ':' && (c - comp == 1))) { if (state == 0) { @@ -2995,7 +2995,7 @@ static void php_strtr_array(zval *return_value, char *str, size_t slen, HashTabl found = 1; zend_string_release(str); break; - } + } } ZEND_HASH_FOREACH_END(); if (!found) { smart_str_appendc(&result, str[pos++]); @@ -3020,7 +3020,7 @@ static void php_strtr_array(zval *return_value, char *str, size_t slen, HashTabl found = 1; zend_string_release(str); break; - } + } } if (!found) { smart_str_appendc(&result, str[pos++]); diff --git a/ext/standard/strnatcmp.c b/ext/standard/strnatcmp.c index 0decda3df9..a272be8a29 100644 --- a/ext/standard/strnatcmp.c +++ b/ext/standard/strnatcmp.c @@ -92,7 +92,7 @@ compare_left(char const **a, char const *aend, char const **b, char const *bend) else if (**a > **b) return +1; } - + return 0; } /* }}} */ diff --git a/ext/standard/type.c b/ext/standard/type.c index 2aa5c49f87..a260c436cb 100644 --- a/ext/standard/type.c +++ b/ext/standard/type.c @@ -48,11 +48,11 @@ PHP_FUNCTION(gettype) case IS_DOUBLE: RETVAL_STRING("double"); break; - + case IS_STRING: RETVAL_STRING("string"); break; - + case IS_ARRAY: RETVAL_STRING("array"); break; @@ -220,7 +220,7 @@ static inline void php_is_type(INTERNAL_FUNCTION_PARAMETERS, int type) if (Z_TYPE_P(arg) == type) { if (type == IS_OBJECT) { zend_class_entry *ce = Z_OBJCE_P(arg); - if (ce->name->len == sizeof(INCOMPLETE_CLASS) - 1 + if (ce->name->len == sizeof(INCOMPLETE_CLASS) - 1 && !strncmp(ce->name->val, INCOMPLETE_CLASS, ce->name->len)) { RETURN_FALSE; } @@ -379,7 +379,7 @@ PHP_FUNCTION(is_scalar) } /* }}} */ -/* {{{ proto bool is_callable(mixed var [, bool syntax_only [, string callable_name]]) +/* {{{ proto bool is_callable(mixed var [, bool syntax_only [, string callable_name]]) Returns true if var is callable. */ PHP_FUNCTION(is_callable) { @@ -394,7 +394,7 @@ PHP_FUNCTION(is_callable) &syntax_only, &callable_name) == FAILURE) { return; } - + if (syntax_only) { check_flags |= IS_CALLABLE_CHECK_SYNTAX_ONLY; } diff --git a/ext/standard/url.c b/ext/standard/url.c index ebd2c4108e..d867e1221b 100644 --- a/ext/standard/url.c +++ b/ext/standard/url.c @@ -65,27 +65,27 @@ PHPAPI char *php_replace_controlchars_ex(char *str, size_t len) { unsigned char *s = (unsigned char *)str; unsigned char *e = (unsigned char *)str + len; - + if (!str) { return (NULL); } - + while (s < e) { - + if (iscntrl(*s)) { *s='_'; - } + } s++; } - + return (str); -} +} /* }}} */ PHPAPI char *php_replace_controlchars(char *str) { return php_replace_controlchars_ex(str, strlen(str)); -} +} PHPAPI php_url *php_url_parse(char const *str) { @@ -99,7 +99,7 @@ PHPAPI php_url *php_url_parse_ex(char const *str, size_t length) char port_buf[6]; php_url *ret = ecalloc(1, sizeof(php_url)); char const *s, *e, *p, *pp, *ue; - + s = str; ue = s + length; @@ -118,40 +118,40 @@ PHPAPI php_url *php_url_parse_ex(char const *str, size_t length) } p++; } - + if (*(e + 1) == '\0') { /* only scheme is available */ ret->scheme = estrndup(s, (e - s)); php_replace_controlchars_ex(ret->scheme, (e - s)); goto end; } - /* + /* * certain schemas like mailto: and zlib: may not have any / after them * this check ensures we support those. */ if (*(e+1) != '/') { - /* check if the data we get is a port this allows us to + /* check if the data we get is a port this allows us to * correctly parse things like a.com:80 */ p = e + 1; while (isdigit(*p)) { p++; } - + if ((*p == '\0' || *p == '/') && (p - e) < 7) { goto parse_port; } - + ret->scheme = estrndup(s, (e-s)); php_replace_controlchars_ex(ret->scheme, (e - s)); - + length -= ++e - s; s = e; goto just_path; } else { ret->scheme = estrndup(s, (e-s)); php_replace_controlchars_ex(ret->scheme, (e - s)); - + if (*(e+2) == '/') { s = e + 3; if (!strncasecmp("file", ret->scheme, sizeof("file"))) { @@ -173,9 +173,9 @@ PHPAPI php_url *php_url_parse_ex(char const *str, size_t length) length -= ++e - s; s = e; goto just_path; - } + } } - } + } } else if (e) { /* no scheme; starts with colon: look for port */ parse_port: p = e + 1; @@ -213,9 +213,9 @@ PHPAPI php_url *php_url_parse_ex(char const *str, size_t length) ue = s + length; goto nohost; } - + e = ue; - + if (!(p = memchr(s, '/', (ue - s)))) { char *query, *fragment; @@ -235,14 +235,14 @@ PHPAPI php_url *php_url_parse_ex(char const *str, size_t length) } } else { e = p; - } - + } + /* check for login and password */ if ((p = zend_memrchr(s, '@', (e-s)))) { if ((pp = memchr(s, ':', (p-s)))) { ret->user = estrndup(s, (pp-s)); php_replace_controlchars_ex(ret->user, (pp - s)); - + pp++; ret->pass = estrndup(pp, (p-pp)); php_replace_controlchars_ex(ret->pass, (p-pp)); @@ -250,14 +250,14 @@ PHPAPI php_url *php_url_parse_ex(char const *str, size_t length) ret->user = estrndup(s, (p-s)); php_replace_controlchars_ex(ret->user, (p-s)); } - + s = p + 1; } /* check for port */ if (*s == '[' && *(e-1) == ']') { - /* Short circuit portscan, - we're dealing with an + /* Short circuit portscan, + we're dealing with an IPv6 embedded address */ p = s; } else { @@ -291,11 +291,11 @@ PHPAPI php_url *php_url_parse_ex(char const *str, size_t length) } } p--; - } + } } else { p = e; } - + /* check if we have a valid host, if we don't reject the string as url */ if ((p-s) < 1) { if (ret->scheme) efree(ret->scheme); @@ -307,15 +307,15 @@ PHPAPI php_url *php_url_parse_ex(char const *str, size_t length) ret->host = estrndup(s, (p-s)); php_replace_controlchars_ex(ret->host, (p - s)); - + if (e == ue) { return ret; } - + s = e; - + nohost: - + if ((p = memchr(s, '?', (ue - s)))) { pp = strchr(s, '#'); @@ -327,14 +327,14 @@ PHPAPI php_url *php_url_parse_ex(char const *str, size_t length) p = pp; goto label_parse; } - + if (p - s) { ret->path = estrndup(s, (p-s)); php_replace_controlchars_ex(ret->path, (p - s)); - } - + } + if (pp) { - if (pp - ++p) { + if (pp - ++p) { ret->query = estrndup(p, (pp-p)); php_replace_controlchars_ex(ret->query, (pp - p)); } @@ -348,15 +348,15 @@ PHPAPI php_url *php_url_parse_ex(char const *str, size_t length) if (p - s) { ret->path = estrndup(s, (p-s)); php_replace_controlchars_ex(ret->path, (p - s)); - } - + } + label_parse: p++; - + if (ue - p) { ret->fragment = estrndup(p, (ue-p)); php_replace_controlchars_ex(ret->fragment, (ue - p)); - } + } } else { ret->path = estrndup(s, (ue-s)); php_replace_controlchars_ex(ret->path, (ue - s)); @@ -438,7 +438,7 @@ PHP_FUNCTION(parse_url) add_assoc_string(return_value, "query", resource->query); if (resource->fragment != NULL) add_assoc_string(return_value, "fragment", resource->fragment); -done: +done: php_url_free(resource); } /* }}} */ @@ -487,7 +487,7 @@ PHPAPI zend_string *php_url_encode(char const *s, size_t len) unsigned char *to; unsigned char const *from, *end; zend_string *start; - + from = (unsigned char *)s; end = (unsigned char *)s + len; start = zend_string_alloc(3 * len, 0); @@ -581,7 +581,7 @@ PHPAPI size_t php_url_decode(char *str, size_t len) if (*data == '+') { *dest = ' '; } - else if (*data == '%' && len >= 2 && isxdigit((int) *(data + 1)) + else if (*data == '%' && len >= 2 && isxdigit((int) *(data + 1)) && isxdigit((int) *(data + 2))) { #ifndef CHARSET_EBCDIC *dest = (char) php_htoi(data + 1); @@ -685,7 +685,7 @@ PHPAPI size_t php_raw_url_decode(char *str, size_t len) char *data = str; while (len--) { - if (*data == '%' && len >= 2 && isxdigit((int) *(data + 1)) + if (*data == '%' && len >= 2 && isxdigit((int) *(data + 1)) && isxdigit((int) *(data + 2))) { #ifndef CHARSET_EBCDIC *dest = (char) php_htoi(data + 1); @@ -716,7 +716,7 @@ PHP_FUNCTION(get_headers) zval *prev_val, *hdr = NULL, *h; HashTable *hashT; zend_long format = 0; - + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &url, &url_len, &format) == FAILURE) { return; } @@ -735,12 +735,12 @@ PHP_FUNCTION(get_headers) /* check for curl-wrappers that provide headers via a special "headers" element */ if ((h = zend_hash_str_find(HASH_OF(&stream->wrapperdata), "headers", sizeof("headers")-1)) != NULL && Z_TYPE_P(h) == IS_ARRAY) { - /* curl-wrappers don't load data until the 1st read */ + /* curl-wrappers don't load data until the 1st read */ if (!Z_ARRVAL_P(h)->nNumOfElements) { php_stream_getc(stream); } h = zend_hash_str_find(HASH_OF(&stream->wrapperdata), "headers", sizeof("headers")-1); - hashT = Z_ARRVAL_P(h); + hashT = Z_ARRVAL_P(h); } else { hashT = HASH_OF(&stream->wrapperdata); } diff --git a/ext/standard/url_scanner_ex.c b/ext/standard/url_scanner_ex.c index 878af57813..7bb08d5c4d 100644 --- a/ext/standard/url_scanner_ex.c +++ b/ext/standard/url_scanner_ex.c @@ -55,11 +55,11 @@ static PHP_INI_MH(OnUpdateTags) char *key; char *tmp; char *lasts = NULL; - + ctx = &BG(url_adapt_state_ex); - + tmp = estrndup(new_value->val, new_value->len); - + if (ctx->tags) zend_hash_destroy(ctx->tags); else { @@ -70,7 +70,7 @@ static PHP_INI_MH(OnUpdateTags) } zend_hash_init(ctx->tags, 0, NULL, tag_dtor, 1); - + for (key = php_strtok_r(tmp, ",", &lasts); key; key = php_strtok_r(NULL, ",", &lasts)) { @@ -80,7 +80,7 @@ static PHP_INI_MH(OnUpdateTags) if (val) { char *q; size_t keylen; - + *val++ = '\0'; for (q = key; *q; q++) *q = tolower(*q); @@ -108,13 +108,13 @@ PHP_INI_END() #define YYCURSOR p #define YYLIMIT q #define YYMARKER r - + static inline void append_modified_url(smart_str *url, smart_str *dest, smart_str *url_app, const char *separator) { register const char *p, *q; const char *bash = NULL; const char *sep = "?"; - + q = (p = url->s->val) + url->s->len; scan: @@ -123,38 +123,38 @@ scan: { YYCTYPE yych; static const unsigned char yybm[] = { - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 0, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 0, 128, 128, 128, 128, 0, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 0, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 0, 128, 128, 128, 128, 0, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, }; if (YYLIMIT <= YYCURSOR) YYFILL(1); @@ -192,7 +192,7 @@ yy8: #line 129 "ext/standard/url_scanner_ex.re" done: - + /* Don't modify URLs of the format "#mark" */ if (bash && bash - url->s->val == 0) { smart_str_append_smart_str(dest, url); @@ -261,7 +261,7 @@ enum { #define scdebug(x) #endif -static inline void passthru(STD_PARA) +static inline void passthru(STD_PARA) { scdebug(("appending %d chars, starting with %c\n", YYCURSOR-start, *start)); smart_str_appendl(&ctx->result, start, YYCURSOR - start); @@ -272,7 +272,7 @@ static inline void passthru(STD_PARA) * <fieldset>. The latter is important for XHTML. */ -static void handle_form(STD_PARA) +static void handle_form(STD_PARA) { int doit = 0; @@ -280,7 +280,7 @@ static void handle_form(STD_PARA) switch (ctx->tag.s->len) { case sizeof("form") - 1: if (!strncasecmp(ctx->tag.s->val, "form", sizeof("form") - 1)) { - doit = 1; + doit = 1; } if (doit && ctx->val.s && ctx->lookup_data && *ctx->lookup_data) { char *e, *p = (char *)zend_memnstr(ctx->val.s->val, "://", sizeof("://") - 1, ctx->val.s->val + ctx->val.s->len); @@ -298,7 +298,7 @@ static void handle_form(STD_PARA) case sizeof("fieldset") - 1: if (!strncasecmp(ctx->tag.s->val, "fieldset", sizeof("fieldset") - 1)) { - doit = 1; + doit = 1; } break; } @@ -309,13 +309,13 @@ static void handle_form(STD_PARA) } /* - * HANDLE_TAG copies the HTML Tag and checks whether we + * HANDLE_TAG copies the HTML Tag and checks whether we * have that tag in our table. If we might modify it, * we continue to scan the tag, otherwise we simply copy the complete * HTML stuff to the result buffer. */ -static inline void handle_tag(STD_PARA) +static inline void handle_tag(STD_PARA) { int ok = 0; unsigned int i; @@ -332,7 +332,7 @@ static inline void handle_tag(STD_PARA) STATE = ok ? STATE_NEXT_ARG : STATE_PLAIN; } -static inline void handle_arg(STD_PARA) +static inline void handle_arg(STD_PARA) { if (ctx->arg.s) { ctx->arg.s->len = 0; @@ -340,7 +340,7 @@ static inline void handle_arg(STD_PARA) smart_str_appendl(&ctx->arg, start, YYCURSOR - start); } -static inline void handle_val(STD_PARA, char quotes, char type) +static inline void handle_val(STD_PARA, char quotes, char type) { smart_str_setl(&ctx->val, start + quotes, YYCURSOR - start - quotes * 2); tag_arg(ctx, quotes, type); @@ -354,7 +354,7 @@ static inline void xx_mainloop(url_adapt_state_ex_t *ctx, const char *newdata, s size_t rest; smart_str_appendl(&ctx->buf, newdata, newlen); - + YYCURSOR = ctx->buf.s->val; YYLIMIT = ctx->buf.s->val + ctx->buf.s->len; @@ -366,11 +366,11 @@ static inline void xx_mainloop(url_adapt_state_ex_t *ctx, const char *newdata, s case STATE_BEFORE_VAL: goto state_before_val; case STATE_VAL: goto state_val; } - + state_plain_begin: STATE = STATE_PLAIN; - + state_plain: start = YYCURSOR; @@ -378,38 +378,38 @@ state_plain: { YYCTYPE yych; static const unsigned char yybm[] = { - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 0, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 0, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, }; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; @@ -434,45 +434,45 @@ yy15: #line 315 "ext/standard/url_scanner_ex.re" -state_tag: +state_tag: start = YYCURSOR; #line 441 "ext/standard/url_scanner_ex.c" { YYCTYPE yych; static const unsigned char yybm[] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 128, 0, 0, 0, 0, 0, - 0, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 0, 0, 0, 0, 0, - 0, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 128, 0, 0, 0, 0, 0, + 0, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 0, 0, 0, 0, 0, + 0, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, }; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = *YYCURSOR; @@ -511,7 +511,7 @@ yy25: state_next_arg_begin: STATE = STATE_NEXT_ARG; - + state_next_arg: start = YYCURSOR; @@ -519,38 +519,38 @@ state_next_arg: { YYCTYPE yych; static const unsigned char yybm[] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 128, 128, 128, 0, 128, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 128, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 128, 128, 128, 0, 128, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 128, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, }; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = *YYCURSOR; @@ -629,38 +629,38 @@ state_arg: { YYCTYPE yych; static const unsigned char yybm[] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 128, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 0, 0, 0, 0, 0, - 0, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 128, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 0, 0, 0, 0, 0, + 0, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 128, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, }; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = *YYCURSOR; @@ -701,38 +701,38 @@ state_before_val: { YYCTYPE yych; static const unsigned char yybm[] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 128, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 128, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, }; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = *YYCURSOR; @@ -787,38 +787,38 @@ state_val: { YYCTYPE yych; static const unsigned char yybm[] = { - 224, 224, 224, 224, 224, 224, 224, 224, - 224, 192, 192, 224, 224, 192, 224, 224, - 224, 224, 224, 224, 224, 224, 224, 224, - 224, 224, 224, 224, 224, 224, 224, 224, - 192, 224, 64, 224, 224, 224, 224, 128, - 224, 224, 224, 224, 224, 224, 224, 224, - 224, 224, 224, 224, 224, 224, 224, 224, - 224, 224, 224, 224, 224, 224, 0, 224, - 224, 224, 224, 224, 224, 224, 224, 224, - 224, 224, 224, 224, 224, 224, 224, 224, - 224, 224, 224, 224, 224, 224, 224, 224, - 224, 224, 224, 224, 224, 224, 224, 224, - 224, 224, 224, 224, 224, 224, 224, 224, - 224, 224, 224, 224, 224, 224, 224, 224, - 224, 224, 224, 224, 224, 224, 224, 224, - 224, 224, 224, 224, 224, 224, 224, 224, - 224, 224, 224, 224, 224, 224, 224, 224, - 224, 224, 224, 224, 224, 224, 224, 224, - 224, 224, 224, 224, 224, 224, 224, 224, - 224, 224, 224, 224, 224, 224, 224, 224, - 224, 224, 224, 224, 224, 224, 224, 224, - 224, 224, 224, 224, 224, 224, 224, 224, - 224, 224, 224, 224, 224, 224, 224, 224, - 224, 224, 224, 224, 224, 224, 224, 224, - 224, 224, 224, 224, 224, 224, 224, 224, - 224, 224, 224, 224, 224, 224, 224, 224, - 224, 224, 224, 224, 224, 224, 224, 224, - 224, 224, 224, 224, 224, 224, 224, 224, - 224, 224, 224, 224, 224, 224, 224, 224, - 224, 224, 224, 224, 224, 224, 224, 224, - 224, 224, 224, 224, 224, 224, 224, 224, - 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, + 224, 192, 192, 224, 224, 192, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, + 192, 224, 64, 224, 224, 224, 224, 128, + 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 0, 224, + 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 224, 224, 224, 224, 224, }; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = *YYCURSOR; @@ -907,13 +907,13 @@ yy76: stop: if (YYLIMIT < start) { - /* XXX: Crash avoidance. Need to work with reporter to figure out what goes wrong */ + /* XXX: Crash avoidance. Need to work with reporter to figure out what goes wrong */ rest = 0; } else { rest = YYLIMIT - start; scdebug(("stopped in state %d at pos %d (%d:%c) %d\n", STATE, YYCURSOR - ctx->buf.c, *YYCURSOR, *YYCURSOR, rest)); } - + if (rest) memmove(ctx->buf.s->val, start, rest); ctx->buf.s->len = rest; } @@ -974,7 +974,7 @@ static char *url_adapt_ext(const char *src, size_t srclen, size_t *newlen, zend_ static int php_url_scanner_ex_activate(void) { url_adapt_state_ex_t *ctx; - + ctx = &BG(url_adapt_state_ex); memset(ctx, 0, ((size_t) &((url_adapt_state_ex_t *)0)->tags)); @@ -985,7 +985,7 @@ static int php_url_scanner_ex_activate(void) static int php_url_scanner_ex_deactivate(void) { url_adapt_state_ex_t *ctx; - + ctx = &BG(url_adapt_state_ex); smart_str_free(&ctx->result); @@ -1030,7 +1030,7 @@ PHPAPI int php_url_scanner_add_var(char *name, size_t name_len, char *value, siz { smart_str val = {0}; zend_string *encoded; - + if (!BG(url_adapt_state_ex).active) { php_url_scanner_ex_activate(); php_output_start_internal(ZEND_STRL("URL-Rewriter"), php_url_scanner_output_handler, 0, PHP_OUTPUT_HANDLER_STDFLAGS); @@ -1048,12 +1048,12 @@ PHPAPI int php_url_scanner_add_var(char *name, size_t name_len, char *value, siz } else { smart_str_setl(&val, value, value_len); } - + smart_str_appendl(&BG(url_adapt_state_ex).url_app, name, name_len); smart_str_appendc(&BG(url_adapt_state_ex).url_app, '='); smart_str_append_smart_str(&BG(url_adapt_state_ex).url_app, &val); - smart_str_appends(&BG(url_adapt_state_ex).form_app, "<input type=\"hidden\" name=\""); + smart_str_appends(&BG(url_adapt_state_ex).form_app, "<input type=\"hidden\" name=\""); smart_str_appendl(&BG(url_adapt_state_ex).form_app, name, name_len); smart_str_appends(&BG(url_adapt_state_ex).form_app, "\" value=\""); smart_str_append_smart_str(&BG(url_adapt_state_ex).form_app, &val); @@ -1099,7 +1099,7 @@ PHP_MSHUTDOWN_FUNCTION(url_scanner) PHP_RINIT_FUNCTION(url_scanner) { BG(url_adapt_state_ex).active = 0; - + return SUCCESS; } diff --git a/ext/standard/url_scanner_ex.h b/ext/standard/url_scanner_ex.h index ff0e644d01..211d48e643 100644 --- a/ext/standard/url_scanner_ex.h +++ b/ext/standard/url_scanner_ex.h @@ -50,7 +50,7 @@ typedef struct { char *lookup_data; int state; - + /* Everything above is zeroed in RINIT */ HashTable *tags; } url_adapt_state_ex_t; diff --git a/ext/standard/url_scanner_ex.re b/ext/standard/url_scanner_ex.re index 7d4f42a7cf..42ca3ee8a7 100644 --- a/ext/standard/url_scanner_ex.re +++ b/ext/standard/url_scanner_ex.re @@ -53,11 +53,11 @@ static PHP_INI_MH(OnUpdateTags) char *key; char *tmp; char *lasts = NULL; - + ctx = &BG(url_adapt_state_ex); - + tmp = estrndup(new_value->val, new_value->len); - + if (ctx->tags) zend_hash_destroy(ctx->tags); else { @@ -68,7 +68,7 @@ static PHP_INI_MH(OnUpdateTags) } zend_hash_init(ctx->tags, 0, NULL, tag_dtor, 1); - + for (key = php_strtok_r(tmp, ",", &lasts); key; key = php_strtok_r(NULL, ",", &lasts)) { @@ -78,7 +78,7 @@ static PHP_INI_MH(OnUpdateTags) if (val) { char *q; size_t keylen; - + *val++ = '\0'; for (q = key; *q; q++) *q = tolower(*q); @@ -111,13 +111,13 @@ alphadash = ([a-zA-Z] | "-"); #define YYCURSOR p #define YYLIMIT q #define YYMARKER r - + static inline void append_modified_url(smart_str *url, smart_str *dest, smart_str *url_app, const char *separator) { register const char *p, *q; const char *bash = NULL; const char *sep = "?"; - + q = (p = url->s->val) + url->s->len; scan: @@ -128,7 +128,7 @@ scan: (any\[:?#])+ { goto scan; } */ done: - + /* Don't modify URLs of the format "#mark" */ if (bash && bash - url->s->val == 0) { smart_str_append_smart_str(dest, url); @@ -197,7 +197,7 @@ enum { #define scdebug(x) #endif -static inline void passthru(STD_PARA) +static inline void passthru(STD_PARA) { scdebug(("appending %d chars, starting with %c\n", YYCURSOR-start, *start)); smart_str_appendl(&ctx->result, start, YYCURSOR - start); @@ -208,7 +208,7 @@ static inline void passthru(STD_PARA) * <fieldset>. The latter is important for XHTML. */ -static void handle_form(STD_PARA) +static void handle_form(STD_PARA) { int doit = 0; @@ -216,7 +216,7 @@ static void handle_form(STD_PARA) switch (ctx->tag.s->len) { case sizeof("form") - 1: if (!strncasecmp(ctx->tag.s->val, "form", sizeof("form") - 1)) { - doit = 1; + doit = 1; } if (doit && ctx->val.s && ctx->lookup_data && *ctx->lookup_data) { char *e, *p = (char *)zend_memnstr(ctx->val.s->val, "://", sizeof("://") - 1, ctx->val.s->val + ctx->val.s->len); @@ -234,7 +234,7 @@ static void handle_form(STD_PARA) case sizeof("fieldset") - 1: if (!strncasecmp(ctx->tag.s->val, "fieldset", sizeof("fieldset") - 1)) { - doit = 1; + doit = 1; } break; } @@ -245,13 +245,13 @@ static void handle_form(STD_PARA) } /* - * HANDLE_TAG copies the HTML Tag and checks whether we + * HANDLE_TAG copies the HTML Tag and checks whether we * have that tag in our table. If we might modify it, * we continue to scan the tag, otherwise we simply copy the complete * HTML stuff to the result buffer. */ -static inline void handle_tag(STD_PARA) +static inline void handle_tag(STD_PARA) { int ok = 0; unsigned int i; @@ -268,7 +268,7 @@ static inline void handle_tag(STD_PARA) STATE = ok ? STATE_NEXT_ARG : STATE_PLAIN; } -static inline void handle_arg(STD_PARA) +static inline void handle_arg(STD_PARA) { if (ctx->arg.s) { ctx->arg.s->len = 0; @@ -276,7 +276,7 @@ static inline void handle_arg(STD_PARA) smart_str_appendl(&ctx->arg, start, YYCURSOR - start); } -static inline void handle_val(STD_PARA, char quotes, char type) +static inline void handle_val(STD_PARA, char quotes, char type) { smart_str_setl(&ctx->val, start + quotes, YYCURSOR - start - quotes * 2); tag_arg(ctx, quotes, type); @@ -290,7 +290,7 @@ static inline void xx_mainloop(url_adapt_state_ex_t *ctx, const char *newdata, s size_t rest; smart_str_appendl(&ctx->buf, newdata, newlen); - + YYCURSOR = ctx->buf.s->val; YYLIMIT = ctx->buf.s->val + ctx->buf.s->len; @@ -302,11 +302,11 @@ static inline void xx_mainloop(url_adapt_state_ex_t *ctx, const char *newdata, s case STATE_BEFORE_VAL: goto state_before_val; case STATE_VAL: goto state_val; } - + state_plain_begin: STATE = STATE_PLAIN; - + state_plain: start = YYCURSOR; /*!re2c @@ -314,7 +314,7 @@ state_plain: N+ { passthru(STD_ARGS); goto state_plain; } */ -state_tag: +state_tag: start = YYCURSOR; /*!re2c alphanamespace+ { handle_tag(STD_ARGS); /* Sets STATE */; passthru(STD_ARGS); if (STATE == STATE_PLAIN) goto state_plain; else goto state_next_arg; } @@ -323,7 +323,7 @@ state_tag: state_next_arg_begin: STATE = STATE_NEXT_ARG; - + state_next_arg: start = YYCURSOR; /*!re2c @@ -359,13 +359,13 @@ state_val: stop: if (YYLIMIT < start) { - /* XXX: Crash avoidance. Need to work with reporter to figure out what goes wrong */ + /* XXX: Crash avoidance. Need to work with reporter to figure out what goes wrong */ rest = 0; } else { rest = YYLIMIT - start; scdebug(("stopped in state %d at pos %d (%d:%c) %d\n", STATE, YYCURSOR - ctx->buf.c, *YYCURSOR, *YYCURSOR, rest)); } - + if (rest) memmove(ctx->buf.s->val, start, rest); ctx->buf.s->len = rest; } @@ -426,7 +426,7 @@ static char *url_adapt_ext(const char *src, size_t srclen, size_t *newlen, zend_ static int php_url_scanner_ex_activate(void) { url_adapt_state_ex_t *ctx; - + ctx = &BG(url_adapt_state_ex); memset(ctx, 0, ((size_t) &((url_adapt_state_ex_t *)0)->tags)); @@ -437,7 +437,7 @@ static int php_url_scanner_ex_activate(void) static int php_url_scanner_ex_deactivate(void) { url_adapt_state_ex_t *ctx; - + ctx = &BG(url_adapt_state_ex); smart_str_free(&ctx->result); @@ -482,7 +482,7 @@ PHPAPI int php_url_scanner_add_var(char *name, size_t name_len, char *value, siz { smart_str val = {0}; zend_string *encoded; - + if (!BG(url_adapt_state_ex).active) { php_url_scanner_ex_activate(); php_output_start_internal(ZEND_STRL("URL-Rewriter"), php_url_scanner_output_handler, 0, PHP_OUTPUT_HANDLER_STDFLAGS); @@ -500,12 +500,12 @@ PHPAPI int php_url_scanner_add_var(char *name, size_t name_len, char *value, siz } else { smart_str_setl(&val, value, value_len); } - + smart_str_appendl(&BG(url_adapt_state_ex).url_app, name, name_len); smart_str_appendc(&BG(url_adapt_state_ex).url_app, '='); smart_str_append_smart_str(&BG(url_adapt_state_ex).url_app, &val); - smart_str_appends(&BG(url_adapt_state_ex).form_app, "<input type=\"hidden\" name=\""); + smart_str_appends(&BG(url_adapt_state_ex).form_app, "<input type=\"hidden\" name=\""); smart_str_appendl(&BG(url_adapt_state_ex).form_app, name, name_len); smart_str_appends(&BG(url_adapt_state_ex).form_app, "\" value=\""); smart_str_append_smart_str(&BG(url_adapt_state_ex).form_app, &val); @@ -551,7 +551,7 @@ PHP_MSHUTDOWN_FUNCTION(url_scanner) PHP_RINIT_FUNCTION(url_scanner) { BG(url_adapt_state_ex).active = 0; - + return SUCCESS; } diff --git a/ext/standard/user_filters.c b/ext/standard/user_filters.c index 225381ffd5..d66643697e 100644 --- a/ext/standard/user_filters.c +++ b/ext/standard/user_filters.c @@ -108,7 +108,7 @@ PHP_MINIT_FUNCTION(user_filters) le_bucket_brigade = zend_register_list_destructors_ex(NULL, NULL, PHP_STREAM_BRIGADE_RES_NAME, module_number); /* Brigades will dispose of their buckets */ le_bucket = zend_register_list_destructors_ex(php_bucket_dtor, NULL, PHP_STREAM_BUCKET_RES_NAME, module_number); - + if (le_bucket_brigade == FAILURE) { return FAILURE; } @@ -120,7 +120,7 @@ PHP_MINIT_FUNCTION(user_filters) REGISTER_LONG_CONSTANT("PSFS_FLAG_NORMAL", PSFS_FLAG_NORMAL, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("PSFS_FLAG_FLUSH_INC", PSFS_FLAG_FLUSH_INC, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("PSFS_FLAG_FLUSH_CLOSE", PSFS_FLAG_FLUSH_CLOSE, CONST_CS | CONST_PERSISTENT); - + return SUCCESS; } @@ -279,7 +279,7 @@ static php_stream_filter *user_filter_factory_create(const char *filtername, zval func_name; zval retval; int len; - + /* some sanity checks */ if (persistent) { php_error_docref(NULL, E_WARNING, @@ -295,7 +295,7 @@ static php_stream_filter *user_filter_factory_create(const char *filtername, /* Userspace Filters using ambiguous wildcards could cause problems. i.e.: myfilter.foo.bar will always call into myfilter.foo.* - never seeing myfilter.* + never seeing myfilter.* TODO: Allow failed userfilter creations to continue scanning through the list */ if ((period = strrchr(filtername, '.'))) { @@ -343,7 +343,7 @@ static php_stream_filter *user_filter_factory_create(const char *filtername, /* filtername */ add_property_string(&obj, "filtername", (char*)filtername); - + /* and the parameters, if any */ if (filterparams) { add_property_zval(&obj, "params", filterparams); @@ -375,7 +375,7 @@ static php_stream_filter *user_filter_factory_create(const char *filtername, /* Report failure to filter_alloc */ return NULL; - } + } zval_ptr_dtor(&retval); } zval_ptr_dtor(&func_name); @@ -413,7 +413,7 @@ PHP_FUNCTION(stream_bucket_make_writeable) RETURN_FALSE; } - ZEND_FETCH_RESOURCE(brigade, php_stream_bucket_brigade *, zbrigade, -1, PHP_STREAM_BRIGADE_RES_NAME, le_bucket_brigade); + ZEND_FETCH_RESOURCE(brigade, php_stream_bucket_brigade *, zbrigade, -1, PHP_STREAM_BRIGADE_RES_NAME, le_bucket_brigade); ZVAL_NULL(return_value); @@ -514,7 +514,7 @@ PHP_FUNCTION(stream_bucket_new) memcpy(pbuffer, buffer, buffer_len); bucket = php_stream_bucket_new(stream, pbuffer, buffer_len, 1, php_stream_is_persistent(stream)); - + if (bucket == NULL) { RETURN_FALSE; } @@ -553,7 +553,7 @@ PHP_FUNCTION(stream_get_filters) } /* It's okay to return an empty array if no filters are registered */ } -/* }}} */ +/* }}} */ /* {{{ proto bool stream_filter_register(string filtername, string classname) Registers a custom filter handler class */ @@ -561,7 +561,7 @@ PHP_FUNCTION(stream_filter_register) { zend_string *filtername, *classname; struct php_user_filter_data *fdat; - + if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS", &filtername, &classname) == FAILURE) { RETURN_FALSE; } diff --git a/ext/standard/uuencode.c b/ext/standard/uuencode.c index 0a25b770f6..6e6fddad44 100644 --- a/ext/standard/uuencode.c +++ b/ext/standard/uuencode.c @@ -158,7 +158,7 @@ PHPAPI zend_string *php_uudecode(char *src, size_t src_len) /* {{{ */ while (s < ee) { if(s+4 > e) { goto err; - } + } *p++ = PHP_UU_DEC(*s) << 2 | PHP_UU_DEC(*(s + 1)) >> 4; *p++ = PHP_UU_DEC(*(s + 1)) << 4 | PHP_UU_DEC(*(s + 2)) >> 2; *p++ = PHP_UU_DEC(*(s + 2)) << 6 | PHP_UU_DEC(*(s + 3)); @@ -196,7 +196,7 @@ err: } /* }}} */ -/* {{{ proto string convert_uuencode(string data) +/* {{{ proto string convert_uuencode(string data) uuencode a string */ PHP_FUNCTION(convert_uuencode) { diff --git a/ext/standard/var.c b/ext/standard/var.c index 1342b13b47..3458cfd8a4 100644 --- a/ext/standard/var.c +++ b/ext/standard/var.c @@ -48,7 +48,7 @@ static uint zend_obj_num_elements(HashTable *ht) if (Z_TYPE(p->val) == IS_INDIRECT) { if (Z_TYPE_P(Z_INDIRECT(p->val)) == IS_UNDEF) { num--; - } + } } } return num; @@ -430,7 +430,7 @@ static void php_object_element_export(zval *zv, zend_ulong index, zend_string *k const char *class_name, *prop_name; size_t prop_name_len; zend_string *pname_esc; - + zend_unmangle_property_name_ex(key, &class_name, &prop_name, &prop_name_len); pname_esc = php_addcslashes(prop_name, prop_name_len, 0, "'\\", 2); @@ -511,7 +511,7 @@ again: buffer_append_spaces(buf, level - 1); } smart_str_appendc(buf, ')'); - + break; case IS_OBJECT: @@ -864,7 +864,7 @@ again: res = call_user_function_ex(CG(function_table), struc, &fname, &retval, 0, 0, 1, NULL); BG(serialize_lock)--; zval_dtor(&fname); - + if (EG(exception)) { zval_ptr_dtor(&retval); return; diff --git a/ext/standard/var_unserializer.c b/ext/standard/var_unserializer.c index 54155e3168..f7b946990f 100644 --- a/ext/standard/var_unserializer.c +++ b/ext/standard/var_unserializer.c @@ -130,7 +130,7 @@ PHPAPI void var_replace(php_unserialize_data_t *var_hashx, zval *ozval, zval *nz #if VAR_ENTRIES_DBG fprintf(stderr, "var_replace(%ld): %d\n", var_hash?var_hash->used_slots:-1L, Z_TYPE_PP(nzval)); #endif - + while (var_hash) { for (i = 0; i < var_hash->used_slots; i++) { if (var_hash->data[i] == ozval) { @@ -148,7 +148,7 @@ static zval *var_access(php_unserialize_data_t *var_hashx, zend_long id) #if VAR_ENTRIES_DBG fprintf(stderr, "var_access(%ld): %ld\n", var_hash?var_hash->used_slots:-1L, id); #endif - + while (id >= VAR_ENTRIES_MAX && var_hash && var_hash->used_slots == VAR_ENTRIES_MAX) { var_hash = var_hash->next; id -= VAR_ENTRIES_MAX; @@ -170,7 +170,7 @@ PHPAPI void var_destroy(php_unserialize_data_t *var_hashx) #if VAR_ENTRIES_DBG fprintf(stderr, "var_destroy(%ld)\n", var_hash?var_hash->used_slots:-1L); #endif - + while (var_hash) { next = var_hash->next; efree(var_hash); @@ -277,7 +277,7 @@ static inline zend_long parse_iv2(const unsigned char *p, const unsigned char ** case '+': p++; } - + while (1) { cursor = (char)*p; if (cursor >= '0' && cursor <= '9') { @@ -306,7 +306,7 @@ static inline size_t parse_uiv(const unsigned char *p) if (*p == '+') { p++; } - + while (1) { cursor = *p; if (cursor >= '0' && cursor <= '9') { @@ -351,7 +351,7 @@ numeric_key: } } else if (Z_TYPE(key) == IS_STRING) { if (UNEXPECTED(ZEND_HANDLE_NUMERIC(Z_STR(key), idx))) { - goto numeric_key; + goto numeric_key; } if (UNEXPECTED((old_data = zend_hash_find(ht, Z_STR(key))) != NULL)) { //??? update hash @@ -385,7 +385,7 @@ string_key: return 0; } } - + zval_dtor(&key); if (!php_var_unserialize_ex(data, p, max, var_hash, classes)) { @@ -440,11 +440,11 @@ static inline int object_custom(UNSERIALIZE_PARAMETER, zend_class_entry *ce) static inline zend_long object_common1(UNSERIALIZE_PARAMETER, zend_class_entry *ce) { zend_long elements; - + elements = parse_iv2((*p) + 2, p); (*p) += 2; - + if (ce->serialize == NULL) { object_init_ex(rval, ce); } else { @@ -510,11 +510,11 @@ PHPAPI int php_var_unserialize_ex(UNSERIALIZE_PARAMETER) limit = max; cursor = *p; - + if (YYCURSOR >= YYLIMIT) { return 0; } - + if (var_hash && (*p)[0] != 'R') { var_push(var_hash, rval); } @@ -526,38 +526,38 @@ PHPAPI int php_var_unserialize_ex(UNSERIALIZE_PARAMETER) { YYCTYPE yych; static const unsigned char yybm[] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, }; if ((YYLIMIT - YYCURSOR) < 7) YYFILL(7); @@ -681,7 +681,7 @@ yy20: if (*start == 'C') { custom_object = 1; } - + //??? INIT_PZVAL(rval); len2 = len = parse_uiv(start + 2); maxlen = max - YYCURSOR; @@ -736,17 +736,17 @@ yy20: zend_string_release(class_name); return 0; } - + /* Check for unserialize callback */ if ((PG(unserialize_callback_func) == NULL) || (PG(unserialize_callback_func)[0] == '\0')) { incomplete_class = 1; ce = PHP_IC_ENTRY; break; } - + /* Call unserialize callback */ ZVAL_STRING(&user_func, PG(unserialize_callback_func)); - + ZVAL_STR_COPY(&args[0], class_name); BG(serialize_lock)++; if (call_user_function_ex(CG(function_table), NULL, &user_func, &retval, 1, args, 0, NULL) != SUCCESS) { @@ -772,7 +772,7 @@ yy20: zval_ptr_dtor(&args[0]); return 0; } - + /* The callback function may have defined the class */ if ((ce = zend_lookup_class(class_name)) == NULL) { php_error_docref(NULL, E_WARNING, "Function %s() hasn't defined the class it was called for", Z_STRVAL(user_func)); @@ -798,7 +798,7 @@ yy20: zend_string_release(class_name); return ret; } - + elements = object_common1(UNSERIALIZE_PASSTHRU, ce); if (incomplete_class) { @@ -837,7 +837,7 @@ yy27: { //??? INIT_PZVAL(rval); - + return object_common2(UNSERIALIZE_PASSTHRU, object_common1(UNSERIALIZE_PASSTHRU, ZEND_STANDARD_CLASS_DEF_PTR)); } @@ -1271,7 +1271,7 @@ yy91: //??? } ZVAL_COPY(rval, rval_ref); //??? Z_UNSET_ISREF_PP(rval); - + return 1; } #line 1278 "ext/standard/var_unserializer.c" @@ -1316,7 +1316,7 @@ yy97: ZVAL_NEW_REF(rval_ref, rval_ref); ZVAL_COPY(rval, rval_ref); } - + return 1; } #line 1323 "ext/standard/var_unserializer.c" diff --git a/ext/standard/var_unserializer.re b/ext/standard/var_unserializer.re index 50d5949a2e..49be916434 100644 --- a/ext/standard/var_unserializer.re +++ b/ext/standard/var_unserializer.re @@ -128,7 +128,7 @@ PHPAPI void var_replace(php_unserialize_data_t *var_hashx, zval *ozval, zval *nz #if VAR_ENTRIES_DBG fprintf(stderr, "var_replace(%ld): %d\n", var_hash?var_hash->used_slots:-1L, Z_TYPE_PP(nzval)); #endif - + while (var_hash) { for (i = 0; i < var_hash->used_slots; i++) { if (var_hash->data[i] == ozval) { @@ -146,7 +146,7 @@ static zval *var_access(php_unserialize_data_t *var_hashx, zend_long id) #if VAR_ENTRIES_DBG fprintf(stderr, "var_access(%ld): %ld\n", var_hash?var_hash->used_slots:-1L, id); #endif - + while (id >= VAR_ENTRIES_MAX && var_hash && var_hash->used_slots == VAR_ENTRIES_MAX) { var_hash = var_hash->next; id -= VAR_ENTRIES_MAX; @@ -168,7 +168,7 @@ PHPAPI void var_destroy(php_unserialize_data_t *var_hashx) #if VAR_ENTRIES_DBG fprintf(stderr, "var_destroy(%ld)\n", var_hash?var_hash->used_slots:-1L); #endif - + while (var_hash) { next = var_hash->next; efree(var_hash); @@ -281,7 +281,7 @@ static inline zend_long parse_iv2(const unsigned char *p, const unsigned char ** case '+': p++; } - + while (1) { cursor = (char)*p; if (cursor >= '0' && cursor <= '9') { @@ -310,7 +310,7 @@ static inline size_t parse_uiv(const unsigned char *p) if (*p == '+') { p++; } - + while (1) { cursor = *p; if (cursor >= '0' && cursor <= '9') { @@ -355,7 +355,7 @@ numeric_key: } } else if (Z_TYPE(key) == IS_STRING) { if (UNEXPECTED(ZEND_HANDLE_NUMERIC(Z_STR(key), idx))) { - goto numeric_key; + goto numeric_key; } if (UNEXPECTED((old_data = zend_hash_find(ht, Z_STR(key))) != NULL)) { //??? update hash @@ -389,7 +389,7 @@ string_key: return 0; } } - + zval_dtor(&key); if (!php_var_unserialize_ex(data, p, max, var_hash, classes)) { @@ -444,11 +444,11 @@ static inline int object_custom(UNSERIALIZE_PARAMETER, zend_class_entry *ce) static inline zend_long object_common1(UNSERIALIZE_PARAMETER, zend_class_entry *ce) { zend_long elements; - + elements = parse_iv2((*p) + 2, p); (*p) += 2; - + if (ce->serialize == NULL) { object_init_ex(rval, ce); } else { @@ -514,11 +514,11 @@ PHPAPI int php_var_unserialize_ex(UNSERIALIZE_PARAMETER) limit = max; cursor = *p; - + if (YYCURSOR >= YYLIMIT) { return 0; } - + if (var_hash && (*p)[0] != 'R') { var_push(var_hash, rval); } @@ -545,7 +545,7 @@ PHPAPI int php_var_unserialize_ex(UNSERIALIZE_PARAMETER) ZVAL_NEW_REF(rval_ref, rval_ref); ZVAL_COPY(rval, rval_ref); } - + return 1; } @@ -568,7 +568,7 @@ PHPAPI int php_var_unserialize_ex(UNSERIALIZE_PARAMETER) //??? } ZVAL_COPY(rval, rval_ref); //??? Z_UNSET_ISREF_PP(rval); - + return 1; } @@ -714,7 +714,7 @@ use_double: "o:" iv ":" ["] { //??? INIT_PZVAL(rval); - + return object_common2(UNSERIALIZE_PASSTHRU, object_common1(UNSERIALIZE_PASSTHRU, ZEND_STANDARD_CLASS_DEF_PTR)); } @@ -736,7 +736,7 @@ object ":" uiv ":" ["] { if (*start == 'C') { custom_object = 1; } - + //??? INIT_PZVAL(rval); len2 = len = parse_uiv(start + 2); maxlen = max - YYCURSOR; @@ -791,17 +791,17 @@ object ":" uiv ":" ["] { zend_string_release(class_name); return 0; } - + /* Check for unserialize callback */ if ((PG(unserialize_callback_func) == NULL) || (PG(unserialize_callback_func)[0] == '\0')) { incomplete_class = 1; ce = PHP_IC_ENTRY; break; } - + /* Call unserialize callback */ ZVAL_STRING(&user_func, PG(unserialize_callback_func)); - + ZVAL_STR_COPY(&args[0], class_name); BG(serialize_lock)++; if (call_user_function_ex(CG(function_table), NULL, &user_func, &retval, 1, args, 0, NULL) != SUCCESS) { @@ -827,7 +827,7 @@ object ":" uiv ":" ["] { zval_ptr_dtor(&args[0]); return 0; } - + /* The callback function may have defined the class */ if ((ce = zend_lookup_class(class_name)) == NULL) { php_error_docref(NULL, E_WARNING, "Function %s() hasn't defined the class it was called for", Z_STRVAL(user_func)); @@ -853,7 +853,7 @@ object ":" uiv ":" ["] { zend_string_release(class_name); return ret; } - + elements = object_common1(UNSERIALIZE_PASSTHRU, ce); if (incomplete_class) { diff --git a/ext/standard/winver.h b/ext/standard/winver.h index 7152d60811..4c3019b14b 100644 --- a/ext/standard/winver.h +++ b/ext/standard/winver.h @@ -86,7 +86,7 @@ typedef struct _php_win_OSVERSIONINFOEXA { DWORD dwMinorVersion; DWORD dwBuildNumber; DWORD dwPlatformId; - CHAR szCSDVersion[128]; + CHAR szCSDVersion[128]; WORD wServicePackMajor; WORD wServicePackMinor; WORD wSuiteMask; @@ -94,4 +94,4 @@ typedef struct _php_win_OSVERSIONINFOEXA { BYTE wReserved; } php_win_OSVERSIONINFOEX; -#endif
\ No newline at end of file +#endif |