diff options
| author | Ondřej Surý <ondrej@sury.org> | 2010-03-09 11:57:54 +0100 |
|---|---|---|
| committer | Ondřej Surý <ondrej@sury.org> | 2010-03-09 11:57:54 +0100 |
| commit | 855a09f4eded707941180c9d90acd17c25e29447 (patch) | |
| tree | a40947efaa9876f31b6ee3956c3f3775768143bb /ext/standard | |
| parent | c852c28a88fccf6e34a2cb091fdfa72bce2b59c7 (diff) | |
| download | php-upstream/5.3.2.tar.gz | |
Imported Upstream version 5.3.2upstream/5.3.2
Diffstat (limited to 'ext/standard')
225 files changed, 8753 insertions, 977 deletions
diff --git a/ext/standard/array.c b/ext/standard/array.c index 457f8b1ce..e4156e89d 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -21,7 +21,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: array.c 287275 2009-08-14 06:20:21Z dmitry $ */ +/* $Id: array.c 293982 2010-01-25 14:11:32Z johannes $ */ #include "php.h" #include "php_ini.h" @@ -768,6 +768,7 @@ static int php_array_user_key_compare(const void *a, const void *b TSRMLS_DC) /* PHP_FUNCTION(uksort) { zval *array; + int refcount; PHP_ARRAY_CMP_FUNC_VARS; PHP_ARRAY_CMP_FUNC_BACKUP(); @@ -777,13 +778,31 @@ PHP_FUNCTION(uksort) return; } + /* Clear the is_ref flag, so the attemts to modify the array in user + * comaprison function will create a copy of array and won't affect the + * original array. The fact of modification is detected using refcount + * comparison. The result of sorting in such case is undefined and the + * function returns FALSE. + */ + Z_UNSET_ISREF_P(array); + refcount = Z_REFCOUNT_P(array); + if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_user_key_compare, 0 TSRMLS_CC) == FAILURE) { - PHP_ARRAY_CMP_FUNC_RESTORE(); - RETURN_FALSE; + RETVAL_FALSE; + } else { + if (refcount > Z_REFCOUNT_P(array)) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Array was modified by the user comparison function"); + RETVAL_FALSE; + } else { + RETVAL_TRUE; + } + } + + if (Z_REFCOUNT_P(array) > 1) { + Z_SET_ISREF_P(array); } PHP_ARRAY_CMP_FUNC_RESTORE(); - RETURN_TRUE; } /* }}} */ @@ -1364,6 +1383,9 @@ PHP_FUNCTION(extract) if (var_exists && var_name_len == sizeof("GLOBALS") && !strcmp(var_name, "GLOBALS")) { break; } + if (var_exists && var_name_len == sizeof("this") && !strcmp(var_name, "this") && EG(scope) && EG(scope)->name_length != 0) { + break; + } ZVAL_STRINGL(&final_name, var_name, var_name_len, 1); break; @@ -1445,9 +1467,7 @@ static void php_compact_var(HashTable *eg_active_symbol_table, zval *return_valu if (zend_hash_find(eg_active_symbol_table, Z_STRVAL_P(entry), Z_STRLEN_P(entry) + 1, (void **)&value_ptr) != FAILURE) { value = *value_ptr; ALLOC_ZVAL(data); - *data = *value; - zval_copy_ctor(data); - INIT_PZVAL(data); + MAKE_COPY_ZVAL(&value, data); zend_hash_update(Z_ARRVAL_P(return_value), Z_STRVAL_P(entry), Z_STRLEN_P(entry) + 1, &data, sizeof(zval *), NULL); } @@ -4070,9 +4090,7 @@ PHP_FUNCTION(array_reduce) if (ZEND_NUM_ARGS() > 2) { ALLOC_ZVAL(result); - *result = *initial; - zval_copy_ctor(result); - INIT_PZVAL(result); + MAKE_COPY_ZVAL(&initial, result); } else { MAKE_STD_ZVAL(result); ZVAL_NULL(result); diff --git a/ext/standard/assert.c b/ext/standard/assert.c index af5ffff85..1730e417b 100644 --- a/ext/standard/assert.c +++ b/ext/standard/assert.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: assert.c 284153 2009-07-15 23:55:50Z stas $ */ +/* $Id: assert.c 293036 2010-01-03 09:23:27Z sebastian $ */ /* {{{ includes */ #include "php.h" diff --git a/ext/standard/base64.c b/ext/standard/base64.c index 42f5c5302..dff905547 100644 --- a/ext/standard/base64.c +++ b/ext/standard/base64.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -15,7 +15,7 @@ | Author: Jim Winstead <jimw@php.net> | +----------------------------------------------------------------------+ */ -/* $Id: base64.c 274569 2009-01-25 18:27:12Z iliaa $ */ +/* $Id: base64.c 293036 2010-01-03 09:23:27Z sebastian $ */ #include <string.h> diff --git a/ext/standard/base64.h b/ext/standard/base64.h index 4f43dbb69..89760959a 100644 --- a/ext/standard/base64.h +++ b/ext/standard/base64.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: base64.h 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: base64.h 293036 2010-01-03 09:23:27Z sebastian $ */ #ifndef BASE64_H #define BASE64_H diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index f7b394a04..cd722db29 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: basic_functions.c 289669 2009-10-15 14:10:03Z pajoye $ */ +/* $Id: basic_functions.c 294503 2010-02-04 09:08:57Z pajoye $ */ #include "php.h" #include "php_streams.h" @@ -1301,6 +1301,12 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_clearstatcache, 0, 0, 0) ZEND_ARG_INFO(0, filename) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_INFO(arginfo_realpath_cache_size, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO(arginfo_realpath_cache_get, 0) +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO(arginfo_fileperms, 0) ZEND_ARG_INFO(0, filename) ZEND_END_ARG_INFO() @@ -2004,6 +2010,10 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO(arginfo_stream_get_wrappers, 0) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_INFO(arginfo_stream_resolve_include_path, 0) + ZEND_ARG_INFO(0, filename) +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO(arginfo_stream_is_local, 0) ZEND_ARG_INFO(0, stream) ZEND_END_ARG_INFO() @@ -3109,6 +3119,7 @@ const zend_function_entry basic_functions[] = { /* {{{ */ PHP_FE(stream_wrapper_restore, arginfo_stream_wrapper_restore) PHP_FE(stream_get_wrappers, arginfo_stream_get_wrappers) PHP_FE(stream_get_transports, arginfo_stream_get_transports) + PHP_FE(stream_resolve_include_path, arginfo_stream_resolve_include_path) PHP_FE(stream_is_local, arginfo_stream_is_local) PHP_FE(get_headers, arginfo_get_headers) @@ -3198,6 +3209,8 @@ const zend_function_entry basic_functions[] = { /* {{{ */ PHP_FE(disk_total_space, arginfo_disk_total_space) PHP_FE(disk_free_space, arginfo_disk_free_space) PHP_FALIAS(diskfreespace, disk_free_space, arginfo_disk_free_space) + PHP_FE(realpath_cache_size, arginfo_realpath_cache_size) + PHP_FE(realpath_cache_get, arginfo_realpath_cache_get) /* functions from mail.c */ PHP_FE(mail, arginfo_mail) @@ -4043,7 +4056,7 @@ PHP_FUNCTION(putenv) pe.key_len = strlen(pe.key); #ifdef PHP_WIN32 if (equals) { - if (pe.key_len < setting_len - 2) { + if (pe.key_len < setting_len - 1) { value = p + 1; } else { /* empty string*/ @@ -4652,7 +4665,7 @@ PHP_FUNCTION(error_log) opt_err = erropt; } - if (_php_error_log(opt_err, message, opt, headers TSRMLS_CC) == FAILURE) { + if (_php_error_log_ex(opt_err, message, message_len, opt, headers TSRMLS_CC) == FAILURE) { RETURN_FALSE; } @@ -4660,17 +4673,22 @@ PHP_FUNCTION(error_log) } /* }}} */ +/* For BC (not binary-safe!) */ PHPAPI int _php_error_log(int opt_err, char *message, char *opt, char *headers TSRMLS_DC) /* {{{ */ { - php_stream *stream = NULL; + return _php_error_log_ex(opt_err, message, (opt_err == 3) ? strlen(message) : 0, opt, headers TSRMLS_CC); +} +/* }}} */ - switch (opt_err) { +PHPAPI int _php_error_log_ex(int opt_err, char *message, int message_len, char *opt, char *headers TSRMLS_DC) /* {{{ */ +{ + php_stream *stream = NULL; + switch (opt_err) + { case 1: /*send an email */ - { - if (!php_mail(opt, "PHP error_log message", message, headers, NULL TSRMLS_CC)) { - return FAILURE; - } + if (!php_mail(opt, "PHP error_log message", message, headers, NULL TSRMLS_CC)) { + return FAILURE; } break; @@ -4681,11 +4699,13 @@ PHPAPI int _php_error_log(int opt_err, char *message, char *opt, char *headers T case 3: /*save to a file */ stream = php_stream_open_wrapper(opt, "a", IGNORE_URL_WIN | ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL); - if (!stream) + if (!stream) { return FAILURE; - php_stream_write(stream, message, strlen(message)); + } + php_stream_write(stream, message, message_len); php_stream_close(stream); break; + case 4: /* send to SAPI */ if (sapi_module.log_message) { sapi_module.log_message(message); @@ -4693,6 +4713,7 @@ PHPAPI int _php_error_log(int opt_err, char *message, char *opt, char *headers T return FAILURE; } break; + default: php_log_err(message TSRMLS_CC); break; @@ -5561,6 +5582,15 @@ PHP_FUNCTION(getservbyname) return; } + +/* empty string behaves like NULL on windows implementation of + getservbyname. Let be portable instead. */ +#ifdef PHP_WIN32 + if (proto_len == 0) { + RETURN_FALSE; + } +#endif + serv = getservbyname(name, proto); if (serv == NULL) { @@ -5821,9 +5851,7 @@ static void php_simple_ini_parser_cb(zval *arg1, zval *arg2, zval *arg3, int cal break; } ALLOC_ZVAL(element); - *element = *arg2; - zval_copy_ctor(element); - INIT_PZVAL(element); + MAKE_COPY_ZVAL(&arg2, element); zend_symtable_update(Z_ARRVAL_P(arr), Z_STRVAL_P(arg1), Z_STRLEN_P(arg1) + 1, &element, sizeof(zval *), NULL); break; @@ -5866,9 +5894,7 @@ static void php_simple_ini_parser_cb(zval *arg1, zval *arg2, zval *arg3, int cal } ALLOC_ZVAL(element); - *element = *arg2; - zval_copy_ctor(element); - INIT_PZVAL(element); + MAKE_COPY_ZVAL(&arg2, element); if (arg3 && Z_STRLEN_P(arg3) > 0) { add_assoc_zval_ex(hash, Z_STRVAL_P(arg3), Z_STRLEN_P(arg3) + 1, element); diff --git a/ext/standard/basic_functions.h b/ext/standard/basic_functions.h index bc18f073b..acd17e5b3 100644 --- a/ext/standard/basic_functions.h +++ b/ext/standard/basic_functions.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: basic_functions.h 286378 2009-07-26 22:59:46Z jani $ */ +/* $Id: basic_functions.h 293036 2010-01-03 09:23:27Z sebastian $ */ #ifndef BASIC_FUNCTIONS_H #define BASIC_FUNCTIONS_H @@ -141,7 +141,9 @@ PHP_FUNCTION(stream_bucket_new); PHP_MINIT_FUNCTION(user_filters); PHP_RSHUTDOWN_FUNCTION(user_filters); +/* Left for BC (not binary safe!) */ PHPAPI int _php_error_log(int opt_err, char *message, char *opt, char *headers TSRMLS_DC); +PHPAPI int _php_error_log_ex(int opt_err, char *message, int message_len, char *opt, char *headers TSRMLS_DC); PHPAPI int php_prefix_varname(zval *result, zval *prefix, char *var_name, int var_name_len, zend_bool add_underscore TSRMLS_DC); #if SIZEOF_INT == 4 diff --git a/ext/standard/browscap.c b/ext/standard/browscap.c index c0b202979..9106727a0 100644 --- a/ext/standard/browscap.c +++ b/ext/standard/browscap.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: browscap.c 281742 2009-06-06 02:40:49Z mattwil $ */ +/* $Id: browscap.c 293036 2010-01-03 09:23:27Z sebastian $ */ #include "php.h" #include "php_browscap.h" @@ -328,7 +328,7 @@ PHP_FUNCTION(get_browser) char *agent_name = NULL; int agent_name_len = 0; zend_bool return_array = 0; - zval **agent, **z_agent_name; + zval **agent, **z_agent_name, **http_user_agent; zval *found_browser_entry, *tmp_copy; char *lookup_browser_name; char *browscap = INI_STR("browscap"); @@ -344,11 +344,14 @@ PHP_FUNCTION(get_browser) if (agent_name == NULL) { zend_is_auto_global("_SERVER", sizeof("_SERVER") - 1 TSRMLS_CC); - if (!PG(http_globals)[TRACK_VARS_SERVER] - || zend_hash_find(PG(http_globals)[TRACK_VARS_SERVER]->value.ht, "HTTP_USER_AGENT", sizeof("HTTP_USER_AGENT"), (void **) &agent_name) == FAILURE) { + if (!PG(http_globals)[TRACK_VARS_SERVER] || + zend_hash_find(HASH_OF(PG(http_globals)[TRACK_VARS_SERVER]), "HTTP_USER_AGENT", sizeof("HTTP_USER_AGENT"), (void **) &http_user_agent) == FAILURE + ) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "HTTP_USER_AGENT variable is not set, cannot determine user agent name"); RETURN_FALSE; } + agent_name = Z_STRVAL_PP(http_user_agent); + agent_name_len = Z_STRLEN_PP(http_user_agent); } lookup_browser_name = estrndup(agent_name, agent_name_len); diff --git a/ext/standard/config.m4 b/ext/standard/config.m4 index 7ccec319b..98912a165 100644 --- a/ext/standard/config.m4 +++ b/ext/standard/config.m4 @@ -1,4 +1,4 @@ -dnl $Id: config.m4 287120 2009-08-11 22:07:35Z scottmac $ -*- autoconf -*- +dnl $Id: config.m4 295350 2010-02-22 00:34:22Z pajoye $ -*- autoconf -*- divert(3)dnl @@ -172,17 +172,112 @@ main() { ac_cv_crypt_blowfish=no ])]) +AC_CACHE_CHECK(for SHA512 crypt, ac_cv_crypt_SHA512,[ +AC_TRY_RUN([ +#if HAVE_UNISTD_H +#include <unistd.h> +#endif + +#if HAVE_CRYPT_H +#include <crypt.h> +#endif + +main() { +#if HAVE_CRYPT + char salt[30], answer[80]; + + salt[0]='$'; salt[1]='6'; salt[2]='$'; salt[3]='$'; salt[4]='b'; salt[5]='a'; salt[6]='r'; salt[7]='\0'; + strcpy(answer, salt); + strcpy(&answer[29],"$6$$QMXjqd7rHQZPQ1yHsXkQqC1FBzDiVfTHXL.LaeDAeVV.IzMaV9VU4MQ8kPuZa2SOP1A0RPm772EaFYjpEJtdu."); + exit (strcmp((char *)crypt("foo",salt),answer)); +#else + exit(0); +#endif +}],[ + ac_cv_crypt_SHA512=yes +],[ + ac_cv_crypt_SHA512=no +],[ + ac_cv_crypt_SHA512=no +])]) + +AC_CACHE_CHECK(for SHA256 crypt, ac_cv_crypt_SHA256,[ +AC_TRY_RUN([ +#if HAVE_UNISTD_H +#include <unistd.h> +#endif + +#if HAVE_CRYPT_H +#include <crypt.h> +#endif + +main() { +#if HAVE_CRYPT + char salt[30], answer[80]; + salt[0]='$'; salt[1]='5'; salt[2]='$'; salt[3]='$'; salt[4]='s'; salt[5]='a'; salt[6]='l'; salt[7]='t'; salt[8]='s'; salt[9]='t'; salt[10]='r'; salt[11]='i'; salt[12]='n'; salt[13]='g'; salt[14]='\0'; + strcat(salt,""); + strcpy(answer, salt); + strcpy(&answer[29], "$5$saltstring$5B8vYYiY.CVt1RlTTf8KbXBH3hsxY/GNooZaBBGWEc5"); + exit (strcmp((char *)crypt("foo",salt),answer)); +#else + exit(0); +#endif +}],[ + ac_cv_crypt_SHA256=yes +],[ + ac_cv_crypt_SHA256=no +],[ + ac_cv_crypt_SHA256=no +])]) + + dnl dnl If one of them is missing, use our own implementation, portable code is then possible dnl if test "$ac_cv_crypt_blowfish" = "no" || test "$ac_cv_crypt_des" = "no" || test "$ac_cv_crypt_ext_des" = "no" || test "x$php_crypt_r" = "x0"; then + + dnl + dnl Check for __alignof__ support in the compiler + dnl + AC_CACHE_CHECK(whether the compiler supports __alignof__, ac_cv_alignof_exists,[ + AC_TRY_COMPILE([ + ],[ + int align = __alignof__(int); + ],[ + ac_cv_alignof_exists=yes + ],[ + ac_cv_alignof_exists=no + ])]) + if test "$ac_cv_alignof_exists" = "yes"; then + AC_DEFINE([HAVE_ALIGNOF], 1, [whether the compiler supports __alignof__]) + fi + + dnl + dnl Check for __attribute__ ((__aligned__)) support in the compiler + dnl + AC_CACHE_CHECK(whether the compiler supports aligned attribute, ac_cv_attribute_aligned,[ + AC_TRY_COMPILE([ + ],[ + unsigned char test[32] __attribute__ ((__aligned__ (__alignof__ (int)))); + ],[ + ac_cv_attribute_aligned=yes + ],[ + ac_cv_attribute_aligned=no + ])]) + if test "$ac_cv_attribute_aligned" = "yes"; then + AC_DEFINE([HAVE_ATTRIBUTE_ALIGNED], 1, [whether the compiler supports __attribute__ ((__aligned__))]) + fi + + AC_DEFINE_UNQUOTED(PHP_USE_PHP_CRYPT_R, 1, [Whether PHP has to use its own crypt_r for blowfish, des, ext des and md5]) AC_DEFINE_UNQUOTED(PHP_STD_DES_CRYPT, 1, [Whether the system supports standard DES salt]) AC_DEFINE_UNQUOTED(PHP_BLOWFISH_CRYPT, 1, [Whether the system supports BlowFish salt]) AC_DEFINE_UNQUOTED(PHP_EXT_DES_CRYPT, 1, [Whether the system supports extended DES salt]) - AC_DEFINE_UNQUOTED(PHP_MD5_CRYPT, 1, [Whether the system supports extended DES salt]) + AC_DEFINE_UNQUOTED(PHP_MD5_CRYPT, 1, [Whether the system supports MD5 salt]) + AC_DEFINE_UNQUOTED(PHP_SHA512_CRYPT, 1, [Whether the system supports SHA512 salt]) + AC_DEFINE_UNQUOTED(PHP_SHA256_CRYPT, 1, [Whether the system supports SHA256 salt]) - PHP_ADD_SOURCES(PHP_EXT_DIR(standard), crypt_freesec.c crypt_blowfish.c php_crypt_r.c) + PHP_ADD_SOURCES(PHP_EXT_DIR(standard), crypt_freesec.c crypt_blowfish.c crypt_sha512.c crypt_sha256.c php_crypt_r.c) else if test "$ac_cv_crypt_des" = "yes"; then ac_result=1 @@ -211,13 +306,31 @@ else fi AC_DEFINE_UNQUOTED(PHP_EXT_DES_CRYPT, $ac_result, [Whether the system supports extended DES salt]) + if test "$ac_cv_crypt_sha512" = "yes"; then + ac_result=1 + ac_crypt_sha512=1 + else + ac_result=0 + ac_crypt_sha512=0 + fi + AC_DEFINE_UNQUOTED(PHP_EXT_SHA512_CRYPT, $ac_result, [Whether the system supports SHA512 salt]) + + if test "$ac_cv_crypt_sha256" = "yes"; then + ac_result=1 + ac_crypt_sha256=1 + else + ac_result=0 + ac_crypt_sha256=0 + fi + AC_DEFINE_UNQUOTED(PHP_EXT_SHA256_CRYPT, $ac_result, [Whether the system supports SHA256 salt]) + AC_DEFINE_UNQUOTED(PHP_USE_PHP_CRYPT_R, 0, [Whether PHP has to use its own crypt_r for blowfish, des and ext des]) fi dnl dnl Check for available functions dnl -AC_CHECK_FUNCS(getcwd getwd asinh acosh atanh log1p hypot glob strfmon nice fpclass isinf isnan) +AC_CHECK_FUNCS(getcwd getwd asinh acosh atanh log1p hypot glob strfmon nice fpclass isinf isnan mempcpy strpncpy) AC_FUNC_FNMATCH divert(5)dnl @@ -226,13 +339,12 @@ dnl dnl Check if there is a support means of creating a new process dnl and defining which handles it receives dnl -AC_CACHE_VAL(php_can_support_proc_open,[ AC_CHECK_FUNCS(fork CreateProcess, [ php_can_support_proc_open=yes break ],[ php_can_support_proc_open=no -])]) +]) AC_MSG_CHECKING([if your OS can spawn processes with inherited handles]) if test "$php_can_support_proc_open" = "yes"; then AC_MSG_RESULT(yes) diff --git a/ext/standard/config.w32 b/ext/standard/config.w32 index c72a8aa85..44dea72d3 100644 --- a/ext/standard/config.w32 +++ b/ext/standard/config.w32 @@ -1,5 +1,5 @@ // vim:ft=javascript -// $Id: config.w32 286378 2009-07-26 22:59:46Z jani $ +// $Id: config.w32 291899 2009-12-09 00:20:14Z pajoye $ ARG_WITH("config-file-scan-dir", "Dir to check for additional php ini files", ""); @@ -9,8 +9,8 @@ AC_DEFINE("PHP_USE_PHP_CRYPT_R", 1); CHECK_HEADER_ADD_INCLUDE("timelib_config.h", "CFLAGS_STANDARD", "ext/date/lib"); EXTENSION("standard", "array.c base64.c basic_functions.c browscap.c \ - crc32.c crypt.c \ - crypt_freesec.c crypt_blowfish.c php_crypt_r.c \ + crc32.c crypt.c crypt_freesec.c crypt_blowfish.c crypt_sha256.c \ + crypt_sha512.c php_crypt_r.c \ cyr_convert.c datetime.c dir.c dl.c dns.c dns_win32.c exec.c \ file.c filestat.c formatted_print.c fsock.c head.c html.c image.c \ info.c iptc.c lcg.c link_win32.c mail.c math.c md5.c metaphone.c microtime.c \ diff --git a/ext/standard/crc32.c b/ext/standard/crc32.c index 9afb56bf0..1504dabcd 100644 --- a/ext/standard/crc32.c +++ b/ext/standard/crc32.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: crc32.c 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: crc32.c 293036 2010-01-03 09:23:27Z sebastian $ */ #include "php.h" #include "basic_functions.h" diff --git a/ext/standard/crc32.h b/ext/standard/crc32.h index 140d04e9b..50ac1162d 100644 --- a/ext/standard/crc32.h +++ b/ext/standard/crc32.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: crc32.h 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: crc32.h 293036 2010-01-03 09:23:27Z sebastian $ */ /* * This code implements the AUTODIN II polynomial diff --git a/ext/standard/credits.c b/ext/standard/credits.c index 71998b8da..eaf9d5428 100644 --- a/ext/standard/credits.c +++ b/ext/standard/credits.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: credits.c 289420 2009-10-09 14:34:18Z pajoye $ */ +/* $Id: credits.c 293036 2010-01-03 09:23:27Z sebastian $ */ #include "php.h" #include "info.h" diff --git a/ext/standard/credits.h b/ext/standard/credits.h index 3fff960f1..2451c7724 100644 --- a/ext/standard/credits.h +++ b/ext/standard/credits.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: credits.h 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: credits.h 293036 2010-01-03 09:23:27Z sebastian $ */ #ifndef CREDITS_H #define CREDITS_H diff --git a/ext/standard/crypt.c b/ext/standard/crypt.c index 3743e1eb9..b4a5167b9 100644 --- a/ext/standard/crypt.c +++ b/ext/standard/crypt.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -15,10 +15,11 @@ | Authors: Stig Bakken <ssb@php.net> | | Zeev Suraski <zeev@zend.com> | | Rasmus Lerdorf <rasmus@php.net> | + | Pierre Joye <pierre@php.net> | +----------------------------------------------------------------------+ */ -/* $Id: crypt.c 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: crypt.c 295421 2010-02-23 17:49:00Z pajoye $ */ #include <stdlib.h> @@ -82,6 +83,12 @@ #define PHP_MAX_SALT_LEN 60 #endif +#if PHP_SHA512_CRYPT +#undef PHP_MAX_SALT_LEN +#define PHP_MAX_SALT_LEN 123 +#endif + + /* If the configure-time checks fail, we provide DES. * XXX: This is a hack. Fix the real problem! */ @@ -100,6 +107,9 @@ PHP_MINIT_FUNCTION(crypt) /* {{{ */ REGISTER_LONG_CONSTANT("CRYPT_EXT_DES", PHP_EXT_DES_CRYPT, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("CRYPT_MD5", PHP_MD5_CRYPT, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("CRYPT_BLOWFISH", PHP_BLOWFISH_CRYPT, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("CRYPT_SHA256", PHP_SHA256_CRYPT, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("CRYPT_SHA512", PHP_SHA512_CRYPT, CONST_CS | CONST_PERSISTENT); + #ifdef PHP_USE_PHP_CRYPT_R php_init_crypt_r(); @@ -137,7 +147,7 @@ PHP_FUNCTION(crypt) char salt[PHP_MAX_SALT_LEN + 1]; char *str, *salt_in = NULL; int str_len, salt_in_len = 0; - + char *crypt_res; salt[0] = salt[PHP_MAX_SALT_LEN] = '\0'; /* This will produce suitable results if people depend on DES-encryption @@ -163,6 +173,7 @@ PHP_FUNCTION(crypt) php_to64(&salt[0], PHP_CRYPT_RAND, 2); salt[2] = '\0'; #endif + salt_in_len = strlen(salt); } /* Windows (win32/crypt) has a stripped down version of libxcrypt and @@ -175,7 +186,53 @@ PHP_FUNCTION(crypt) char output[MD5_HASH_MAX_LEN]; RETURN_STRING(php_md5_crypt_r(str, salt, output), 1); - } else if ( + } else if (salt[0]=='$' && salt[1]=='6' && salt[2]=='$') { + const char sha512_salt_prefix[] = "$6$"; + const char sha512_rounds_prefix[] = "rounds="; + char *output; + int needed = (sizeof(sha512_salt_prefix) - 1 + + sizeof(sha512_rounds_prefix) + 9 + 1 + + strlen(salt) + 1 + 43 + 1); + output = emalloc(needed * sizeof(char *)); + salt[salt_in_len] = '\0'; + + crypt_res = php_sha512_crypt_r(str, salt, output, needed); + if (!crypt_res) { + if (salt[0]=='*' && salt[1]=='0') { + RETVAL_STRING("*1", 1); + } else { + RETVAL_STRING("*0", 1); + } + } else { + RETVAL_STRING(output, 1); + } + + memset(output, 0, PHP_MAX_SALT_LEN + 1); + efree(output); + } else if (salt[0]=='$' && salt[1]=='5' && salt[2]=='$') { + const char sha256_salt_prefix[] = "$5$"; + const char sha256_rounds_prefix[] = "rounds="; + char *output; + int needed = (sizeof(sha256_salt_prefix) - 1 + + sizeof(sha256_rounds_prefix) + 9 + 1 + + strlen(salt) + 1 + 43 + 1); + output = emalloc(needed * sizeof(char *)); + salt[salt_in_len] = '\0'; + + crypt_res = php_sha256_crypt_r(str, salt, output, needed); + if (!crypt_res) { + if (salt[0]=='*' && salt[1]=='0') { + RETVAL_STRING("*1", 1); + } else { + RETVAL_STRING("*0", 1); + } + } else { + RETVAL_STRING(output, 1); + } + + memset(output, 0, PHP_MAX_SALT_LEN + 1); + efree(output); + } else if ( salt[0] == '$' && salt[1] == '2' && salt[2] == 'a' && @@ -186,14 +243,33 @@ PHP_FUNCTION(crypt) char output[PHP_MAX_SALT_LEN + 1]; memset(output, 0, PHP_MAX_SALT_LEN + 1); - php_crypt_blowfish_rn(str, salt, output, sizeof(output)); - RETVAL_STRING(output, 1); + crypt_res = php_crypt_blowfish_rn(str, salt, output, sizeof(output)); + if (!crypt_res) { + if (salt[0]=='*' && salt[1]=='0') { + RETVAL_STRING("*1", 1); + } else { + RETVAL_STRING("*0", 1); + } + } else { + RETVAL_STRING(output, 1); + } + memset(output, 0, PHP_MAX_SALT_LEN + 1); } else { memset(&buffer, 0, sizeof(buffer)); _crypt_extended_init_r(); - RETURN_STRING(_crypt_extended_r(str, salt, &buffer), 1); + + crypt_res = _crypt_extended_r(str, salt, &buffer); + if (!crypt_res) { + if (salt[0]=='*' && salt[1]=='0') { + RETURN_STRING("*1", 1); + } else { + RETURN_STRING("*0", 1); + } + } else { + RETURN_STRING(crypt_res, 1); + } } } #else @@ -208,8 +284,16 @@ PHP_FUNCTION(crypt) # else # error Data struct used by crypt_r() is unknown. Please report. # endif - - RETURN_STRING(crypt_r(str, salt, &buffer), 1); + crypt_res = crypt_r(str, salt, &buffer); + if (!crypt_res) { + if (salt[0]=='*' && salt[1]=='0') { + RETURN_STRING("*1", 1); + } else { + RETURN_STRING("*0", 1); + } + } else { + RETURN_STRING(crypt_res, 1); + } } # endif #endif diff --git a/ext/standard/crypt_blowfish.c b/ext/standard/crypt_blowfish.c index a345fc0d8..c88c699c5 100644 --- a/ext/standard/crypt_blowfish.c +++ b/ext/standard/crypt_blowfish.c @@ -1,5 +1,5 @@ /* - $Id: crypt_blowfish.c 281805 2009-06-08 08:44:15Z pajoye $ + $Id: crypt_blowfish.c 295350 2010-02-22 00:34:22Z pajoye $ */ /* * This code comes from John the Ripper password cracker, with reentrant @@ -606,6 +606,7 @@ char *php_crypt_blowfish_rn(__CONST char *key, __CONST char *setting, setting[3] != '$' || setting[4] < '0' || setting[4] > '3' || setting[5] < '0' || setting[5] > '9' || + (setting[4] == '3' && setting[5] > '1') || setting[6] != '$') { __set_errno(EINVAL); return NULL; diff --git a/ext/standard/crypt_freesec.c b/ext/standard/crypt_freesec.c index 0d70772ad..bb9c032c0 100644 --- a/ext/standard/crypt_freesec.c +++ b/ext/standard/crypt_freesec.c @@ -1,12 +1,13 @@ /* - $Id: crypt_freesec.c 265468 2008-08-25 13:42:55Z jani $ + $Id: crypt_freesec.c 295350 2010-02-22 00:34:22Z pajoye $ */ /* * This version is derived from the original implementation of FreeSec * (release 1.1) by David Burren. I've reviewed the changes made in * OpenBSD (as of 2.7) and modified the original code in a similar way - * where applicable. I've also made it reentrant and did a number of - * other changes -- SD. + * where applicable. I've also made it reentrant and made a number of + * other changes. + * - Solar Designer <solar at openwall.com> */ /* @@ -40,7 +41,7 @@ * SUCH DAMAGE. * * $Owl: Owl/packages/glibc/crypt_freesec.c,v 1.4 2005/11/16 13:08:32 solar Exp $ - * $Id: crypt_freesec.c 265468 2008-08-25 13:42:55Z jani $ + * $Id: crypt_freesec.c 295350 2010-02-22 00:34:22Z pajoye $ * * This is an original implementation of the DES and the crypt(3) interfaces * by David Burren <davidb at werj.com.au>. @@ -57,14 +58,17 @@ * posted to the sci.crypt newsgroup by the author and is available for FTP. * * ARCHITECTURE ASSUMPTIONS: - * This code used to have some nasty ones, but I believe these have - * been removed by now. The code isn't very portable and requires a - * 32-bit integer type, though -- SD. + * This code used to have some nasty ones, but these have been removed + * by now. The code requires a 32-bit integer type, though. */ #include <sys/types.h> #include <string.h> +#ifdef TEST +#include <stdio.h> +#endif + #include "crypt_freesec.h" #define _PASSWORD_EFMT1 '_' @@ -183,19 +187,28 @@ static uint32_t comp_maskl[8][128], comp_maskr[8][128]; static inline int ascii_to_bin(char ch) { - if (ch > 'z') - return(0); - if (ch >= 'a') - return(ch - 'a' + 38); - if (ch > 'Z') - return(0); - if (ch >= 'A') - return(ch - 'A' + 12); - if (ch > '9') - return(0); - if (ch >= '.') - return(ch - '.'); - return(0); + signed char sch = ch; + int retval; + + retval = sch - '.'; + if (sch >= 'A') { + retval = sch - ('A' - 12); + if (sch >= 'a') + retval = sch - ('a' - 38); + } + retval &= 0x3f; + + return(retval); +} + +/* + * When we choose to "support" invalid salts, nevertheless disallow those + * containing characters that would violate the passwd file format. + */ +static inline int +ascii_is_unsafe(char ch) +{ + return !ch || ch == '\n' || ch == ':'; } void @@ -625,14 +638,24 @@ _crypt_extended_r(const char *key, const char *setting, if (*setting == _PASSWORD_EFMT1) { /* * "new"-style: - * setting - underscore, 4 bytes of count, 4 bytes of salt + * setting - underscore, 4 chars of count, 4 chars of salt * key - unlimited characters */ - for (i = 1, count = 0; i < 5; i++) - count |= ascii_to_bin(setting[i]) << (i - 1) * 6; + for (i = 1, count = 0; i < 5; i++) { + int value = ascii_to_bin(setting[i]); + if (ascii64[value] != setting[i]) + return(NULL); + count |= value << (i - 1) * 6; + } + if (!count) + return(NULL); - for (i = 5, salt = 0; i < 9; i++) - salt |= ascii_to_bin(setting[i]) << (i - 5) * 6; + for (i = 5, salt = 0; i < 9; i++) { + int value = ascii_to_bin(setting[i]); + if (ascii64[value] != setting[i]) + return(NULL); + salt |= value << (i - 5) * 6; + } while (*key) { /* @@ -651,35 +674,25 @@ _crypt_extended_r(const char *key, const char *setting, if (des_setkey((u_char *) keybuf, data)) return(NULL); } - strncpy(data->output, setting, 9); - /* - * Double check that we weren't given a short setting. - * If we were, the above code will probably have created - * wierd values for count and salt, but we don't really care. - * Just make sure the output string doesn't have an extra - * NUL in it. - */ + memcpy(data->output, setting, 9); data->output[9] = '\0'; - p = (u_char *) data->output + strlen(data->output); + p = (u_char *) data->output + 9; } else { /* * "old"-style: - * setting - 2 bytes of salt + * setting - 2 chars of salt * key - up to 8 characters */ count = 25; + if (ascii_is_unsafe(setting[0]) || ascii_is_unsafe(setting[1])) + return(NULL); + salt = (ascii_to_bin(setting[1]) << 6) | ascii_to_bin(setting[0]); data->output[0] = setting[0]; - /* - * If the encrypted password that the salt was extracted from - * is only 1 character long, the salt will be corrupted. We - * need to ensure that the output string doesn't have an extra - * NUL in it! - */ - data->output[1] = setting[1] ? setting[1] : data->output[0]; + data->output[1] = setting[1]; p = (u_char *) data->output + 2; } setup_salt(salt, data); @@ -733,6 +746,7 @@ static struct { char *hash; char *pw; } tests[] = { +/* "new"-style */ {"_J9..CCCCXBrJUJV154M", "U*U*U*U*"}, {"_J9..CCCCXUhOBTXzaiE", "U*U***U"}, {"_J9..CCCC4gQ.mB/PffM", "U*U***U*"}, @@ -745,6 +759,30 @@ static struct { {"_J9..SDizxmRI1GjnQuE", "zxyDPWgydbQjgq"}, {"_K9..SaltNrQgIYUAeoY", "726 even"}, {"_J9..SDSD5YGyRCr4W4c", ""}, +/* "old"-style, valid salts */ + {"CCNf8Sbh3HDfQ", "U*U*U*U*"}, + {"CCX.K.MFy4Ois", "U*U***U"}, + {"CC4rMpbg9AMZ.", "U*U***U*"}, + {"XXxzOu6maQKqQ", "*U*U*U*U"}, + {"SDbsugeBiC58A", ""}, + {"./xZjzHv5vzVE", "password"}, + {"0A2hXM1rXbYgo", "password"}, + {"A9RXdR23Y.cY6", "password"}, + {"ZziFATVXHo2.6", "password"}, + {"zZDDIZ0NOlPzw", "password"}, +/* "old"-style, "reasonable" invalid salts, UFC-crypt behavior expected */ + {"\001\002wyd0KZo65Jo", "password"}, + {"a_C10Dk/ExaG.", "password"}, + {"~\377.5OTsRVjwLo", "password"}, +/* The below are erroneous inputs, so NULL return is expected/required */ + {"", ""}, /* no salt */ + {" ", ""}, /* setting string is too short */ + {"a:", ""}, /* unsafe character */ + {"\na", ""}, /* unsafe character */ + {"_/......", ""}, /* setting string is too short for its type */ + {"_........", ""}, /* zero iteration count */ + {"_/!......", ""}, /* invalid character in count */ + {"_/......!", ""}, /* invalid character in salt */ {NULL} }; @@ -752,8 +790,12 @@ int main(void) { int i; - for (i = 0; tests[i].hash; i++) - if (strcmp(crypt(tests[i].pw, tests[i].hash), tests[i].hash)) { + for (i = 0; tests[i].hash; i++) { + char *hash = crypt(tests[i].pw, tests[i].hash); + if (!hash && strlen(tests[i].hash) < 13) + continue; /* expected failure */ + if (!strcmp(hash, tests[i].hash)) + continue; /* expected success */ puts("FAILED"); return 1; } diff --git a/ext/standard/crypt_sha256.c b/ext/standard/crypt_sha256.c new file mode 100644 index 000000000..3e234cee9 --- /dev/null +++ b/ext/standard/crypt_sha256.c @@ -0,0 +1,759 @@ +/* SHA256-based Unix crypt implementation. + Released into the Public Domain by Ulrich Drepper <drepper@redhat.com>. */ +/* Windows VC++ port by Pierre Joye <pierre@php.net> */ + +#include "php.h" +#include "php_main.h" + +#include <errno.h> +#include <limits.h> + +#ifdef PHP_WIN32 +# include "win32/php_stdint.h" +# define __alignof__ __alignof +# define alloca _alloca +#else +# if HAVE_INTTYPES_H +# include <inttypes.h> +# elif HAVE_STDINT_H +# include <stdint.h> +# endif +# ifndef HAVE_ALIGNOF +# include <stddef.h> +# define __alignof__(type) offsetof (struct { char c; type member;}, member) +# endif +# if HAVE_ATTRIBUTE_ALIGNED +# define ALIGNED(size) __attribute__ ((__aligned__ (size))) +# else +# define ALIGNED(size) +# endif +#endif + +#include <stdio.h> +#include <stdlib.h> + +#ifdef PHP_WIN32 +# include <string.h> +#else +# include <sys/param.h> +# include <sys/types.h> +# if HAVE_STRING_H +//# define __USE_GNU 1 +# include <string.h> +# else +# include <strings.h> +# endif +#endif + +char * __php_stpncpy(char *dst, const char *src, size_t len) +{ + size_t n = strlen(src); + if (n > len) { + n = len; + } + return strncpy(dst, src, len) + n; +} + +void * __php_mempcpy(void * dst, const void * src, size_t len) +{ + return (((char *)memcpy(dst, src, len)) + len); +} + +#ifndef MIN +# define MIN(a, b) (((a) < (b)) ? (a) : (b)) +#endif +#ifndef MAX +# define MAX(a, b) (((a) > (b)) ? (a) : (b)) +#endif + +/* Structure to save state of computation between the single steps. */ +struct sha256_ctx { + uint32_t H[8]; + + uint32_t total[2]; + uint32_t buflen; + char buffer[128]; /* NB: always correctly aligned for uint32_t. */ +}; + +#if PHP_WIN32 || (!defined(WORDS_BIGENDIAN)) +# define SWAP(n) \ + (((n) << 24) | (((n) & 0xff00) << 8) | (((n) >> 8) & 0xff00) | ((n) >> 24)) +#else +# define SWAP(n) (n) +#endif + +/* This array contains the bytes used to pad the buffer to the next + 64-byte boundary. (FIPS 180-2:5.1.1) */ +static const unsigned char fillbuf[64] = { 0x80, 0 /* , 0, 0, ... */ }; + + +/* Constants for SHA256 from FIPS 180-2:4.2.2. */ +static const uint32_t K[64] = { + 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, + 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, + 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, + 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, + 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, + 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, + 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, + 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, + 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, + 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, + 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, + 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, + 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, + 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, + 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, + 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 +}; + + +/* Process LEN bytes of BUFFER, accumulating context into CTX. + It is assumed that LEN % 64 == 0. */ +static void sha256_process_block (const void *buffer, size_t len, struct sha256_ctx *ctx) { + const uint32_t *words = buffer; + size_t nwords = len / sizeof (uint32_t); + unsigned int t; + + uint32_t a = ctx->H[0]; + uint32_t b = ctx->H[1]; + uint32_t c = ctx->H[2]; + uint32_t d = ctx->H[3]; + uint32_t e = ctx->H[4]; + uint32_t f = ctx->H[5]; + uint32_t g = ctx->H[6]; + uint32_t h = ctx->H[7]; + + /* First increment the byte count. FIPS 180-2 specifies the possible + length of the file up to 2^64 bits. Here we only compute the + number of bytes. Do a double word increment. */ + ctx->total[0] += len; + if (ctx->total[0] < len) { + ++ctx->total[1]; + } + + /* Process all bytes in the buffer with 64 bytes in each round of + the loop. */ + while (nwords > 0) { + uint32_t W[64]; + uint32_t a_save = a; + uint32_t b_save = b; + uint32_t c_save = c; + uint32_t d_save = d; + uint32_t e_save = e; + uint32_t f_save = f; + uint32_t g_save = g; + uint32_t h_save = h; + + /* Operators defined in FIPS 180-2:4.1.2. */ +#define Ch(x, y, z) ((x & y) ^ (~x & z)) +#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z)) +#define S0(x) (CYCLIC (x, 2) ^ CYCLIC (x, 13) ^ CYCLIC (x, 22)) +#define S1(x) (CYCLIC (x, 6) ^ CYCLIC (x, 11) ^ CYCLIC (x, 25)) +#define R0(x) (CYCLIC (x, 7) ^ CYCLIC (x, 18) ^ (x >> 3)) +#define R1(x) (CYCLIC (x, 17) ^ CYCLIC (x, 19) ^ (x >> 10)) + + /* It is unfortunate that C does not provide an operator for + cyclic rotation. Hope the C compiler is smart enough. */ +#define CYCLIC(w, s) ((w >> s) | (w << (32 - s))) + + /* Compute the message schedule according to FIPS 180-2:6.2.2 step 2. */ + for (t = 0; t < 16; ++t) { + W[t] = SWAP (*words); + ++words; + } + for (t = 16; t < 64; ++t) + W[t] = R1 (W[t - 2]) + W[t - 7] + R0 (W[t - 15]) + W[t - 16]; + + /* The actual computation according to FIPS 180-2:6.2.2 step 3. */ + for (t = 0; t < 64; ++t) { + uint32_t T1 = h + S1 (e) + Ch (e, f, g) + K[t] + W[t]; + uint32_t T2 = S0 (a) + Maj (a, b, c); + h = g; + g = f; + f = e; + e = d + T1; + d = c; + c = b; + b = a; + a = T1 + T2; + } + + /* Add the starting values of the context according to FIPS 180-2:6.2.2 + step 4. */ + a += a_save; + b += b_save; + c += c_save; + d += d_save; + e += e_save; + f += f_save; + g += g_save; + h += h_save; + + /* Prepare for the next round. */ + nwords -= 16; + } + + /* Put checksum in context given as argument. */ + ctx->H[0] = a; + ctx->H[1] = b; + ctx->H[2] = c; + ctx->H[3] = d; + ctx->H[4] = e; + ctx->H[5] = f; + ctx->H[6] = g; + ctx->H[7] = h; +} + + +/* Initialize structure containing state of computation. + (FIPS 180-2:5.3.2) */ +static void sha256_init_ctx(struct sha256_ctx *ctx) { + ctx->H[0] = 0x6a09e667; + ctx->H[1] = 0xbb67ae85; + ctx->H[2] = 0x3c6ef372; + ctx->H[3] = 0xa54ff53a; + ctx->H[4] = 0x510e527f; + ctx->H[5] = 0x9b05688c; + ctx->H[6] = 0x1f83d9ab; + ctx->H[7] = 0x5be0cd19; + + ctx->total[0] = ctx->total[1] = 0; + ctx->buflen = 0; +} + + +/* Process the remaining bytes in the internal buffer and the usual + prolog according to the standard and write the result to RESBUF. + + IMPORTANT: On some systems it is required that RESBUF is correctly + aligned for a 32 bits value. */ +static void * sha256_finish_ctx(struct sha256_ctx *ctx, void *resbuf) { + /* Take yet unprocessed bytes into account. */ + uint32_t bytes = ctx->buflen; + size_t pad; + unsigned int i; + + /* Now count remaining bytes. */ + ctx->total[0] += bytes; + if (ctx->total[0] < bytes) { + ++ctx->total[1]; + } + + pad = bytes >= 56 ? 64 + 56 - bytes : 56 - bytes; + memcpy(&ctx->buffer[bytes], fillbuf, pad); + + /* Put the 64-bit file length in *bits* at the end of the buffer. */ + *(uint32_t *) &ctx->buffer[bytes + pad + 4] = SWAP (ctx->total[0] << 3); + *(uint32_t *) &ctx->buffer[bytes + pad] = SWAP ((ctx->total[1] << 3) | + (ctx->total[0] >> 29)); + + /* Process last bytes. */ + sha256_process_block(ctx->buffer, bytes + pad + 8, ctx); + + /* Put result from CTX in first 32 bytes following RESBUF. */ + for (i = 0; i < 8; ++i) { + ((uint32_t *) resbuf)[i] = SWAP(ctx->H[i]); + } + + return resbuf; +} + + +static void sha256_process_bytes(const void *buffer, size_t len, struct sha256_ctx *ctx) { + /* When we already have some bits in our internal buffer concatenate + both inputs first. */ + if (ctx->buflen != 0) { + size_t left_over = ctx->buflen; + size_t add = 128 - left_over > len ? len : 128 - left_over; + + memcpy(&ctx->buffer[left_over], buffer, add); + ctx->buflen += add; + + if (ctx->buflen > 64) { + sha256_process_block(ctx->buffer, ctx->buflen & ~63, ctx); + ctx->buflen &= 63; + /* The regions in the following copy operation cannot overlap. */ + memcpy(ctx->buffer, &ctx->buffer[(left_over + add) & ~63], ctx->buflen); + } + + buffer = (const char *) buffer + add; + len -= add; + } + + /* Process available complete blocks. */ + if (len >= 64) { +/* To check alignment gcc has an appropriate operator. Other +compilers don't. */ +#if __GNUC__ >= 2 +# define UNALIGNED_P(p) (((uintptr_t) p) % __alignof__ (uint32_t) != 0) +#else +# define UNALIGNED_P(p) (((uintptr_t) p) % sizeof (uint32_t) != 0) +#endif + if (UNALIGNED_P (buffer)) + while (len > 64) { + sha256_process_block(memcpy(ctx->buffer, buffer, 64), 64, ctx); + buffer = (const char *) buffer + 64; + len -= 64; + } else { + sha256_process_block(buffer, len & ~63, ctx); + buffer = (const char *) buffer + (len & ~63); + len &= 63; + } + } + + /* Move remaining bytes into internal buffer. */ + if (len > 0) { + size_t left_over = ctx->buflen; + + memcpy(&ctx->buffer[left_over], buffer, len); + left_over += len; + if (left_over >= 64) { + sha256_process_block(ctx->buffer, 64, ctx); + left_over -= 64; + memcpy(ctx->buffer, &ctx->buffer[64], left_over); + } + ctx->buflen = left_over; + } +} + + +/* Define our magic string to mark salt for SHA256 "encryption" + replacement. */ +static const char sha256_salt_prefix[] = "$5$"; + +/* Prefix for optional rounds specification. */ +static const char sha256_rounds_prefix[] = "rounds="; + +/* Maximum salt string length. */ +#define SALT_LEN_MAX 16 +/* Default number of rounds if not explicitly specified. */ +#define ROUNDS_DEFAULT 5000 +/* Minimum number of rounds. */ +#define ROUNDS_MIN 1000 +/* Maximum number of rounds. */ +#define ROUNDS_MAX 999999999 + +/* Table with characters for base64 transformation. */ +static const char b64t[64] = +"./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; + +char * php_sha256_crypt_r(const char *key, const char *salt, char *buffer, int buflen) +{ +#ifdef PHP_WIN32 +# if _MSC <= 1300 +# pragma pack(push, 16) + unsigned char alt_result[32]; + unsigned char temp_result[32]; +# pragma pack(pop) +# else + __declspec(align(32)) unsigned char alt_result[32]; + __declspec(align(32)) unsigned char temp_result[32]; +# endif +#else + unsigned char alt_result[32] ALIGNED(__alignof__ (uint32_t)); + unsigned char temp_result[32] ALIGNED(__alignof__ (uint32_t)); +#endif + + struct sha256_ctx ctx; + struct sha256_ctx alt_ctx; + size_t salt_len; + size_t key_len; + size_t cnt; + char *cp; + char *copied_key = NULL; + char *copied_salt = NULL; + char *p_bytes; + char *s_bytes; + /* Default number of rounds. */ + size_t rounds = ROUNDS_DEFAULT; + zend_bool rounds_custom = 0; + + /* Find beginning of salt string. The prefix should normally always + be present. Just in case it is not. */ + if (strncmp(sha256_salt_prefix, salt, sizeof(sha256_salt_prefix) - 1) == 0) { + /* Skip salt prefix. */ + salt += sizeof(sha256_salt_prefix) - 1; + } + + if (strncmp(salt, sha256_rounds_prefix, sizeof(sha256_rounds_prefix) - 1) == 0) { + const char *num = salt + sizeof(sha256_rounds_prefix) - 1; + char *endp; + unsigned long int srounds = strtoul(num, &endp, 10); + if (*endp == '$') { + salt = endp + 1; + rounds = MAX(ROUNDS_MIN, MIN(srounds, ROUNDS_MAX)); + rounds_custom = 1; + } + } + + salt_len = MIN(strcspn(salt, "$"), SALT_LEN_MAX); + key_len = strlen(key); + + if ((key - (char *) 0) % __alignof__ (uint32_t) != 0) { + char *tmp = (char *) alloca(key_len + __alignof__(uint32_t)); + key = copied_key = memcpy(tmp + __alignof__(uint32_t) - (tmp - (char *) 0) % __alignof__(uint32_t), key, key_len); + } + + if ((salt - (char *) 0) % __alignof__(uint32_t) != 0) { + char *tmp = (char *) alloca(salt_len + __alignof__(uint32_t)); + salt = copied_salt = + memcpy(tmp + __alignof__(uint32_t) - (tmp - (char *) 0) % __alignof__ (uint32_t), salt, salt_len); + } + + /* Prepare for the real work. */ + sha256_init_ctx(&ctx); + + /* Add the key string. */ + sha256_process_bytes(key, key_len, &ctx); + + /* The last part is the salt string. This must be at most 16 + characters and it ends at the first `$' character (for + compatibility with existing implementations). */ + sha256_process_bytes(salt, salt_len, &ctx); + + + /* Compute alternate SHA256 sum with input KEY, SALT, and KEY. The + final result will be added to the first context. */ + sha256_init_ctx(&alt_ctx); + + /* Add key. */ + sha256_process_bytes(key, key_len, &alt_ctx); + + /* Add salt. */ + sha256_process_bytes(salt, salt_len, &alt_ctx); + + /* Add key again. */ + sha256_process_bytes(key, key_len, &alt_ctx); + + /* Now get result of this (32 bytes) and add it to the other + context. */ + sha256_finish_ctx(&alt_ctx, alt_result); + + /* Add for any character in the key one byte of the alternate sum. */ + for (cnt = key_len; cnt > 32; cnt -= 32) { + sha256_process_bytes(alt_result, 32, &ctx); + } + sha256_process_bytes(alt_result, cnt, &ctx); + + /* Take the binary representation of the length of the key and for every + 1 add the alternate sum, for every 0 the key. */ + for (cnt = key_len; cnt > 0; cnt >>= 1) { + if ((cnt & 1) != 0) { + sha256_process_bytes(alt_result, 32, &ctx); + } else { + sha256_process_bytes(key, key_len, &ctx); + } + } + + /* Create intermediate result. */ + sha256_finish_ctx(&ctx, alt_result); + + /* Start computation of P byte sequence. */ + sha256_init_ctx(&alt_ctx); + + /* For every character in the password add the entire password. */ + for (cnt = 0; cnt < key_len; ++cnt) { + sha256_process_bytes(key, key_len, &alt_ctx); + } + + /* Finish the digest. */ + sha256_finish_ctx(&alt_ctx, temp_result); + + /* Create byte sequence P. */ + cp = p_bytes = alloca(key_len); + for (cnt = key_len; cnt >= 32; cnt -= 32) { + cp = __php_mempcpy((void *)cp, (const void *)temp_result, 32); + } + memcpy(cp, temp_result, cnt); + + /* Start computation of S byte sequence. */ + sha256_init_ctx(&alt_ctx); + + /* For every character in the password add the entire password. */ + for (cnt = 0; cnt < 16 + alt_result[0]; ++cnt) { + sha256_process_bytes(salt, salt_len, &alt_ctx); + } + + /* Finish the digest. */ + sha256_finish_ctx(&alt_ctx, temp_result); + + /* Create byte sequence S. */ + cp = s_bytes = alloca(salt_len); + for (cnt = salt_len; cnt >= 32; cnt -= 32) { + cp = __php_mempcpy(cp, temp_result, 32); + } + memcpy(cp, temp_result, cnt); + + /* Repeatedly run the collected hash value through SHA256 to burn + CPU cycles. */ + for (cnt = 0; cnt < rounds; ++cnt) { + /* New context. */ + sha256_init_ctx(&ctx); + + /* Add key or last result. */ + if ((cnt & 1) != 0) { + sha256_process_bytes(p_bytes, key_len, &ctx); + } else { + sha256_process_bytes(alt_result, 32, &ctx); + } + + /* Add salt for numbers not divisible by 3. */ + if (cnt % 3 != 0) { + sha256_process_bytes(s_bytes, salt_len, &ctx); + } + + /* Add key for numbers not divisible by 7. */ + if (cnt % 7 != 0) { + sha256_process_bytes(p_bytes, key_len, &ctx); + } + + /* Add key or last result. */ + if ((cnt & 1) != 0) { + sha256_process_bytes(alt_result, 32, &ctx); + } else { + sha256_process_bytes(p_bytes, key_len, &ctx); + } + + /* Create intermediate result. */ + sha256_finish_ctx(&ctx, alt_result); + } + + /* Now we can construct the result string. It consists of three + parts. */ + cp = __php_stpncpy(buffer, sha256_salt_prefix, MAX(0, buflen)); + buflen -= sizeof(sha256_salt_prefix) - 1; + + if (rounds_custom) { +#ifdef PHP_WIN32 + int n = _snprintf(cp, MAX(0, buflen), "%s%u$", sha256_rounds_prefix, rounds); +#else + int n = snprintf(cp, MAX(0, buflen), "%s%zu$", sha256_rounds_prefix, rounds); +#endif + cp += n; + buflen -= n; + } + + cp = __php_stpncpy(cp, salt, MIN ((size_t) MAX (0, buflen), salt_len)); + buflen -= MIN((size_t) MAX (0, buflen), salt_len); + + if (buflen > 0) { + *cp++ = '$'; + --buflen; + } + +#define b64_from_24bit(B2, B1, B0, N) \ + do { \ + unsigned int w = ((B2) << 16) | ((B1) << 8) | (B0); \ + int n = (N); \ + while (n-- > 0 && buflen > 0) \ + { \ + *cp++ = b64t[w & 0x3f]; \ + --buflen; \ + w >>= 6; \ + } \ + } while (0) + + b64_from_24bit(alt_result[0], alt_result[10], alt_result[20], 4); + b64_from_24bit(alt_result[21], alt_result[1], alt_result[11], 4); + b64_from_24bit(alt_result[12], alt_result[22], alt_result[2], 4); + b64_from_24bit(alt_result[3], alt_result[13], alt_result[23], 4); + b64_from_24bit(alt_result[24], alt_result[4], alt_result[14], 4); + b64_from_24bit(alt_result[15], alt_result[25], alt_result[5], 4); + b64_from_24bit(alt_result[6], alt_result[16], alt_result[26], 4); + b64_from_24bit(alt_result[27], alt_result[7], alt_result[17], 4); + b64_from_24bit(alt_result[18], alt_result[28], alt_result[8], 4); + b64_from_24bit(alt_result[9], alt_result[19], alt_result[29], 4); + b64_from_24bit(0, alt_result[31], alt_result[30], 3); + if (buflen <= 0) { + errno = ERANGE; + buffer = NULL; + } else + *cp = '\0'; /* Terminate the string. */ + + /* Clear the buffer for the intermediate result so that people + attaching to processes or reading core dumps cannot get any + information. We do it in this way to clear correct_words[] + inside the SHA256 implementation as well. */ + sha256_init_ctx(&ctx); + sha256_finish_ctx(&ctx, alt_result); + memset(temp_result, '\0', sizeof(temp_result)); + memset(p_bytes, '\0', key_len); + memset(s_bytes, '\0', salt_len); + memset(&ctx, '\0', sizeof(ctx)); + memset(&alt_ctx, '\0', sizeof(alt_ctx)); + + if (copied_key != NULL) { + memset(copied_key, '\0', key_len); + + } + if (copied_salt != NULL) { + memset(copied_salt, '\0', salt_len); + } + + return buffer; +} + + +/* This entry point is equivalent to the `crypt' function in Unix + libcs. */ +char * php_sha256_crypt(const char *key, const char *salt) +{ + /* We don't want to have an arbitrary limit in the size of the + password. We can compute an upper bound for the size of the + result in advance and so we can prepare the buffer we pass to + `sha256_crypt_r'. */ + static char *buffer; + static int buflen; + int needed = (sizeof(sha256_salt_prefix) - 1 + + sizeof(sha256_rounds_prefix) + 9 + 1 + + strlen(salt) + 1 + 43 + 1); + + if (buflen < needed) { + char *new_buffer = (char *) realloc(buffer, needed); + if (new_buffer == NULL) { + return NULL; + } + + buffer = new_buffer; + buflen = needed; + } + + return php_sha256_crypt_r(key, salt, buffer, buflen); +} + + +#ifdef TEST +static const struct +{ + const char *input; + const char result[32]; +} tests[] = + { + /* Test vectors from FIPS 180-2: appendix B.1. */ + { "abc", + "\xba\x78\x16\xbf\x8f\x01\xcf\xea\x41\x41\x40\xde\x5d\xae\x22\x23" + "\xb0\x03\x61\xa3\x96\x17\x7a\x9c\xb4\x10\xff\x61\xf2\x00\x15\xad" }, + /* Test vectors from FIPS 180-2: appendix B.2. */ + { "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", + "\x24\x8d\x6a\x61\xd2\x06\x38\xb8\xe5\xc0\x26\x93\x0c\x3e\x60\x39" + "\xa3\x3c\xe4\x59\x64\xff\x21\x67\xf6\xec\xed\xd4\x19\xdb\x06\xc1" }, + /* Test vectors from the NESSIE project. */ + { "", + "\xe3\xb0\xc4\x42\x98\xfc\x1c\x14\x9a\xfb\xf4\xc8\x99\x6f\xb9\x24" + "\x27\xae\x41\xe4\x64\x9b\x93\x4c\xa4\x95\x99\x1b\x78\x52\xb8\x55" }, + { "a", + "\xca\x97\x81\x12\xca\x1b\xbd\xca\xfa\xc2\x31\xb3\x9a\x23\xdc\x4d" + "\xa7\x86\xef\xf8\x14\x7c\x4e\x72\xb9\x80\x77\x85\xaf\xee\x48\xbb" }, + { "message digest", + "\xf7\x84\x6f\x55\xcf\x23\xe1\x4e\xeb\xea\xb5\xb4\xe1\x55\x0c\xad" + "\x5b\x50\x9e\x33\x48\xfb\xc4\xef\xa3\xa1\x41\x3d\x39\x3c\xb6\x50" }, + { "abcdefghijklmnopqrstuvwxyz", + "\x71\xc4\x80\xdf\x93\xd6\xae\x2f\x1e\xfa\xd1\x44\x7c\x66\xc9\x52" + "\x5e\x31\x62\x18\xcf\x51\xfc\x8d\x9e\xd8\x32\xf2\xda\xf1\x8b\x73" }, + { "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", + "\x24\x8d\x6a\x61\xd2\x06\x38\xb8\xe5\xc0\x26\x93\x0c\x3e\x60\x39" + "\xa3\x3c\xe4\x59\x64\xff\x21\x67\xf6\xec\xed\xd4\x19\xdb\x06\xc1" }, + { "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", + "\xdb\x4b\xfc\xbd\x4d\xa0\xcd\x85\xa6\x0c\x3c\x37\xd3\xfb\xd8\x80" + "\x5c\x77\xf1\x5f\xc6\xb1\xfd\xfe\x61\x4e\xe0\xa7\xc8\xfd\xb4\xc0" }, + { "123456789012345678901234567890123456789012345678901234567890" + "12345678901234567890", + "\xf3\x71\xbc\x4a\x31\x1f\x2b\x00\x9e\xef\x95\x2d\xd8\x3c\xa8\x0e" + "\x2b\x60\x02\x6c\x8e\x93\x55\x92\xd0\xf9\xc3\x08\x45\x3c\x81\x3e" } + }; +#define ntests (sizeof (tests) / sizeof (tests[0])) + + +static const struct +{ + const char *salt; + const char *input; + const char *expected; +} tests2[] = +{ + { "$5$saltstring", "Hello world!", + "$5$saltstring$5B8vYYiY.CVt1RlTTf8KbXBH3hsxY/GNooZaBBGWEc5" }, + { "$5$rounds=10000$saltstringsaltstring", "Hello world!", + "$5$rounds=10000$saltstringsaltst$3xv.VbSHBb41AL9AvLeujZkZRBAwqFMz2." + "opqey6IcA" }, + { "$5$rounds=5000$toolongsaltstring", "This is just a test", + "$5$rounds=5000$toolongsaltstrin$Un/5jzAHMgOGZ5.mWJpuVolil07guHPvOW8" + "mGRcvxa5" }, + { "$5$rounds=1400$anotherlongsaltstring", + "a very much longer text to encrypt. This one even stretches over more" + "than one line.", + "$5$rounds=1400$anotherlongsalts$Rx.j8H.h8HjEDGomFU8bDkXm3XIUnzyxf12" + "oP84Bnq1" }, + { "$5$rounds=77777$short", + "we have a short salt string but not a short password", + "$5$rounds=77777$short$JiO1O3ZpDAxGJeaDIuqCoEFysAe1mZNJRs3pw0KQRd/" }, + { "$5$rounds=123456$asaltof16chars..", "a short string", + "$5$rounds=123456$asaltof16chars..$gP3VQ/6X7UUEW3HkBn2w1/Ptq2jxPyzV/" + "cZKmF/wJvD" }, + { "$5$rounds=10$roundstoolow", "the minimum number is still observed", + "$5$rounds=1000$roundstoolow$yfvwcWrQ8l/K0DAWyuPMDNHpIVlTQebY9l/gL97" + "2bIC" }, +}; +#define ntests2 (sizeof (tests2) / sizeof (tests2[0])) + + +int main(void) { + struct sha256_ctx ctx; + char sum[32]; + int result = 0; + int cnt, i; + char buf[1000]; + static const char expected[32] = + "\xcd\xc7\x6e\x5c\x99\x14\xfb\x92\x81\xa1\xc7\xe2\x84\xd7\x3e\x67" + "\xf1\x80\x9a\x48\xa4\x97\x20\x0e\x04\x6d\x39\xcc\xc7\x11\x2c\xd0"; + + for (cnt = 0; cnt < (int) ntests; ++cnt) { + sha256_init_ctx(&ctx); + sha256_process_bytes(tests[cnt].input, strlen(tests[cnt].input), &ctx); + sha256_finish_ctx(&ctx, sum); + if (memcmp(tests[cnt].result, sum, 32) != 0) { + printf("test %d run %d failed\n", cnt, 1); + result = 1; + } + + sha256_init_ctx(&ctx); + for (i = 0; tests[cnt].input[i] != '\0'; ++i) { + sha256_process_bytes(&tests[cnt].input[i], 1, &ctx); + } + sha256_finish_ctx(&ctx, sum); + if (memcmp(tests[cnt].result, sum, 32) != 0) { + printf("test %d run %d failed\n", cnt, 2); + result = 1; + } + } + + /* Test vector from FIPS 180-2: appendix B.3. */ + + memset(buf, 'a', sizeof(buf)); + sha256_init_ctx(&ctx); + for (i = 0; i < 1000; ++i) { + sha256_process_bytes (buf, sizeof (buf), &ctx); + } + + sha256_finish_ctx(&ctx, sum); + + if (memcmp(expected, sum, 32) != 0) { + printf("test %d failed\n", cnt); + result = 1; + } + + for (cnt = 0; cnt < ntests2; ++cnt) { + char *cp = php_sha256_crypt(tests2[cnt].input, tests2[cnt].salt); + if (strcmp(cp, tests2[cnt].expected) != 0) { + printf("test %d: expected \"%s\", got \"%s\"\n", cnt, tests2[cnt].expected, cp); + result = 1; + } + } + + if (result == 0) + puts("all tests OK"); + + return result; +} +#endif diff --git a/ext/standard/crypt_sha512.c b/ext/standard/crypt_sha512.c new file mode 100644 index 000000000..ba9a63918 --- /dev/null +++ b/ext/standard/crypt_sha512.c @@ -0,0 +1,823 @@ +/* SHA512-based Unix crypt implementation. + Released into the Public Domain by Ulrich Drepper <drepper@redhat.com>. */ +/* Windows VC++ port by Pierre Joye <pierre@php.net> */ + +#include "php.h" +#include "php_main.h" + +#include <errno.h> +#include <limits.h> +#ifdef PHP_WIN32 +# include "win32/php_stdint.h" +# define __alignof__ __alignof +# define alloca _alloca +#else +# if HAVE_INTTYPES_H +# include <inttypes.h> +# elif HAVE_STDINT_H +# include <stdint.h> +# endif +# ifndef HAVE_ALIGNOF +# include <stddef.h> +# define __alignof__(type) offsetof (struct { char c; type member;}, member) +# endif +# if HAVE_ATTRIBUTE_ALIGNED +# define ALIGNED(size) __attribute__ ((__aligned__ (size))) +# else +# define ALIGNED(size) +# endif +#endif + +#include <stdio.h> +#include <stdlib.h> + +#ifdef PHP_WIN32 +# include <string.h> +#else +# include <sys/param.h> +# include <sys/types.h> +# if HAVE_STRING_H +# include <string.h> +# else +# include <strings.h> +# endif +#endif + +extern void * __php_mempcpy(void * dst, const void * src, size_t len); +extern char * __php_stpncpy(char *dst, const char *src, size_t len); + +#ifndef MIN +# define MIN(a, b) (((a) < (b)) ? (a) : (b)) +#endif +#ifndef MAX +# define MAX(a, b) (((a) > (b)) ? (a) : (b)) +#endif + +/* Structure to save state of computation between the single steps. */ +struct sha512_ctx +{ + uint64_t H[8]; + + uint64_t total[2]; + uint64_t buflen; + char buffer[256]; /* NB: always correctly aligned for uint64_t. */ +}; + + +#if PHP_WIN32 || (!defined(WORDS_BIGENDIAN)) +# define SWAP(n) \ + (((n) << 56) \ + | (((n) & 0xff00) << 40) \ + | (((n) & 0xff0000) << 24) \ + | (((n) & 0xff000000) << 8) \ + | (((n) >> 8) & 0xff000000) \ + | (((n) >> 24) & 0xff0000) \ + | (((n) >> 40) & 0xff00) \ + | ((n) >> 56)) +#else +# define SWAP(n) (n) +#endif + +/* This array contains the bytes used to pad the buffer to the next + 64-byte boundary. (FIPS 180-2:5.1.2) */ +static const unsigned char fillbuf[128] = { 0x80, 0 /* , 0, 0, ... */ }; + +/* Constants for SHA512 from FIPS 180-2:4.2.3. */ +static const uint64_t K[80] = { + UINT64_C (0x428a2f98d728ae22), UINT64_C (0x7137449123ef65cd), + UINT64_C (0xb5c0fbcfec4d3b2f), UINT64_C (0xe9b5dba58189dbbc), + UINT64_C (0x3956c25bf348b538), UINT64_C (0x59f111f1b605d019), + UINT64_C (0x923f82a4af194f9b), UINT64_C (0xab1c5ed5da6d8118), + UINT64_C (0xd807aa98a3030242), UINT64_C (0x12835b0145706fbe), + UINT64_C (0x243185be4ee4b28c), UINT64_C (0x550c7dc3d5ffb4e2), + UINT64_C (0x72be5d74f27b896f), UINT64_C (0x80deb1fe3b1696b1), + UINT64_C (0x9bdc06a725c71235), UINT64_C (0xc19bf174cf692694), + UINT64_C (0xe49b69c19ef14ad2), UINT64_C (0xefbe4786384f25e3), + UINT64_C (0x0fc19dc68b8cd5b5), UINT64_C (0x240ca1cc77ac9c65), + UINT64_C (0x2de92c6f592b0275), UINT64_C (0x4a7484aa6ea6e483), + UINT64_C (0x5cb0a9dcbd41fbd4), UINT64_C (0x76f988da831153b5), + UINT64_C (0x983e5152ee66dfab), UINT64_C (0xa831c66d2db43210), + UINT64_C (0xb00327c898fb213f), UINT64_C (0xbf597fc7beef0ee4), + UINT64_C (0xc6e00bf33da88fc2), UINT64_C (0xd5a79147930aa725), + UINT64_C (0x06ca6351e003826f), UINT64_C (0x142929670a0e6e70), + UINT64_C (0x27b70a8546d22ffc), UINT64_C (0x2e1b21385c26c926), + UINT64_C (0x4d2c6dfc5ac42aed), UINT64_C (0x53380d139d95b3df), + UINT64_C (0x650a73548baf63de), UINT64_C (0x766a0abb3c77b2a8), + UINT64_C (0x81c2c92e47edaee6), UINT64_C (0x92722c851482353b), + UINT64_C (0xa2bfe8a14cf10364), UINT64_C (0xa81a664bbc423001), + UINT64_C (0xc24b8b70d0f89791), UINT64_C (0xc76c51a30654be30), + UINT64_C (0xd192e819d6ef5218), UINT64_C (0xd69906245565a910), + UINT64_C (0xf40e35855771202a), UINT64_C (0x106aa07032bbd1b8), + UINT64_C (0x19a4c116b8d2d0c8), UINT64_C (0x1e376c085141ab53), + UINT64_C (0x2748774cdf8eeb99), UINT64_C (0x34b0bcb5e19b48a8), + UINT64_C (0x391c0cb3c5c95a63), UINT64_C (0x4ed8aa4ae3418acb), + UINT64_C (0x5b9cca4f7763e373), UINT64_C (0x682e6ff3d6b2b8a3), + UINT64_C (0x748f82ee5defb2fc), UINT64_C (0x78a5636f43172f60), + UINT64_C (0x84c87814a1f0ab72), UINT64_C (0x8cc702081a6439ec), + UINT64_C (0x90befffa23631e28), UINT64_C (0xa4506cebde82bde9), + UINT64_C (0xbef9a3f7b2c67915), UINT64_C (0xc67178f2e372532b), + UINT64_C (0xca273eceea26619c), UINT64_C (0xd186b8c721c0c207), + UINT64_C (0xeada7dd6cde0eb1e), UINT64_C (0xf57d4f7fee6ed178), + UINT64_C (0x06f067aa72176fba), UINT64_C (0x0a637dc5a2c898a6), + UINT64_C (0x113f9804bef90dae), UINT64_C (0x1b710b35131c471b), + UINT64_C (0x28db77f523047d84), UINT64_C (0x32caab7b40c72493), + UINT64_C (0x3c9ebe0a15c9bebc), UINT64_C (0x431d67c49c100d4c), + UINT64_C (0x4cc5d4becb3e42b6), UINT64_C (0x597f299cfc657e2a), + UINT64_C (0x5fcb6fab3ad6faec), UINT64_C (0x6c44198c4a475817) + }; + + +/* Process LEN bytes of BUFFER, accumulating context into CTX. + It is assumed that LEN % 128 == 0. */ +static void +sha512_process_block(const void *buffer, size_t len, struct sha512_ctx *ctx) { + const uint64_t *words = buffer; + size_t nwords = len / sizeof(uint64_t); + uint64_t a = ctx->H[0]; + uint64_t b = ctx->H[1]; + uint64_t c = ctx->H[2]; + uint64_t d = ctx->H[3]; + uint64_t e = ctx->H[4]; + uint64_t f = ctx->H[5]; + uint64_t g = ctx->H[6]; + uint64_t h = ctx->H[7]; + + /* First increment the byte count. FIPS 180-2 specifies the possible + length of the file up to 2^128 bits. Here we only compute the + number of bytes. Do a double word increment. */ + ctx->total[0] += len; + if (ctx->total[0] < len) { + ++ctx->total[1]; + } + + /* Process all bytes in the buffer with 128 bytes in each round of + the loop. */ + while (nwords > 0) { + uint64_t W[80]; + uint64_t a_save = a; + uint64_t b_save = b; + uint64_t c_save = c; + uint64_t d_save = d; + uint64_t e_save = e; + uint64_t f_save = f; + uint64_t g_save = g; + uint64_t h_save = h; + unsigned int t; + +/* Operators defined in FIPS 180-2:4.1.2. */ +#define Ch(x, y, z) ((x & y) ^ (~x & z)) +#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z)) +#define S0(x) (CYCLIC (x, 28) ^ CYCLIC (x, 34) ^ CYCLIC (x, 39)) +#define S1(x) (CYCLIC (x, 14) ^ CYCLIC (x, 18) ^ CYCLIC (x, 41)) +#define R0(x) (CYCLIC (x, 1) ^ CYCLIC (x, 8) ^ (x >> 7)) +#define R1(x) (CYCLIC (x, 19) ^ CYCLIC (x, 61) ^ (x >> 6)) + + /* It is unfortunate that C does not provide an operator for + cyclic rotation. Hope the C compiler is smart enough. */ +#define CYCLIC(w, s) ((w >> s) | (w << (64 - s))) + + /* Compute the message schedule according to FIPS 180-2:6.3.2 step 2. */ + for (t = 0; t < 16; ++t) { + W[t] = SWAP (*words); + ++words; + } + + for (t = 16; t < 80; ++t) { + W[t] = R1 (W[t - 2]) + W[t - 7] + R0 (W[t - 15]) + W[t - 16]; + } + + /* The actual computation according to FIPS 180-2:6.3.2 step 3. */ + for (t = 0; t < 80; ++t) { + uint64_t T1 = h + S1 (e) + Ch (e, f, g) + K[t] + W[t]; + uint64_t T2 = S0 (a) + Maj (a, b, c); + h = g; + g = f; + f = e; + e = d + T1; + d = c; + c = b; + b = a; + a = T1 + T2; + } + + /* Add the starting values of the context according to FIPS 180-2:6.3.2 + step 4. */ + a += a_save; + b += b_save; + c += c_save; + d += d_save; + e += e_save; + f += f_save; + g += g_save; + h += h_save; + + /* Prepare for the next round. */ + nwords -= 16; + } + + /* Put checksum in context given as argument. */ + ctx->H[0] = a; + ctx->H[1] = b; + ctx->H[2] = c; + ctx->H[3] = d; + ctx->H[4] = e; + ctx->H[5] = f; + ctx->H[6] = g; + ctx->H[7] = h; +} + + +/* Initialize structure containing state of computation. + (FIPS 180-2:5.3.3) */ +static void sha512_init_ctx (struct sha512_ctx *ctx) { + ctx->H[0] = UINT64_C (0x6a09e667f3bcc908); + ctx->H[1] = UINT64_C (0xbb67ae8584caa73b); + ctx->H[2] = UINT64_C (0x3c6ef372fe94f82b); + ctx->H[3] = UINT64_C (0xa54ff53a5f1d36f1); + ctx->H[4] = UINT64_C (0x510e527fade682d1); + ctx->H[5] = UINT64_C (0x9b05688c2b3e6c1f); + ctx->H[6] = UINT64_C (0x1f83d9abfb41bd6b); + ctx->H[7] = UINT64_C (0x5be0cd19137e2179); + + ctx->total[0] = ctx->total[1] = 0; + ctx->buflen = 0; +} + + +/* Process the remaining bytes in the internal buffer and the usual + prolog according to the standard and write the result to RESBUF. + + IMPORTANT: On some systems it is required that RESBUF is correctly + aligned for a 32 bits value. */ +static void * sha512_finish_ctx (struct sha512_ctx *ctx, void *resbuf) { + /* Take yet unprocessed bytes into account. */ + uint64_t bytes = ctx->buflen; + size_t pad; + unsigned int i; + + /* Now count remaining bytes. */ + ctx->total[0] += bytes; + if (ctx->total[0] < bytes) { + ++ctx->total[1]; + } + + pad = bytes >= 112 ? 128 + 112 - (size_t)bytes : 112 - (size_t)bytes; + memcpy(&ctx->buffer[bytes], fillbuf, pad); + + /* Put the 128-bit file length in *bits* at the end of the buffer. */ + *(uint64_t *) &ctx->buffer[bytes + pad + 8] = SWAP(ctx->total[0] << 3); + *(uint64_t *) &ctx->buffer[bytes + pad] = SWAP((ctx->total[1] << 3) | + (ctx->total[0] >> 61)); + + /* Process last bytes. */ + sha512_process_block(ctx->buffer, (size_t)(bytes + pad + 16), ctx); + + /* Put result from CTX in first 64 bytes following RESBUF. */ + for (i = 0; i < 8; ++i) { + ((uint64_t *) resbuf)[i] = SWAP(ctx->H[i]); + } + + return resbuf; +} + +static void +sha512_process_bytes(const void *buffer, size_t len, struct sha512_ctx *ctx) { + /* When we already have some bits in our internal buffer concatenate + both inputs first. */ + if (ctx->buflen != 0) { + size_t left_over = (size_t)ctx->buflen; + size_t add = (size_t)(256 - left_over > len ? len : 256 - left_over); + + memcpy(&ctx->buffer[left_over], buffer, add); + ctx->buflen += add; + + if (ctx->buflen > 128) { + sha512_process_block(ctx->buffer, ctx->buflen & ~127, ctx); + + ctx->buflen &= 127; + /* The regions in the following copy operation cannot overlap. */ + memcpy(ctx->buffer, &ctx->buffer[(left_over + add) & ~127], + (size_t)ctx->buflen); + } + + buffer = (const char *) buffer + add; + len -= add; + } + + /* Process available complete blocks. */ + if (len >= 128) { +#if !_STRING_ARCH_unaligned +/* To check alignment gcc has an appropriate operator. Other + compilers don't. */ +# if __GNUC__ >= 2 +# define UNALIGNED_P(p) (((uintptr_t) p) % __alignof__ (uint64_t) != 0) +# else +# define UNALIGNED_P(p) (((uintptr_t) p) % sizeof(uint64_t) != 0) +# endif + if (UNALIGNED_P(buffer)) + while (len > 128) { + sha512_process_block(memcpy(ctx->buffer, buffer, 128), 128, ctx); + buffer = (const char *) buffer + 128; + len -= 128; + } + else +#endif + { + sha512_process_block(buffer, len & ~127, ctx); + buffer = (const char *) buffer + (len & ~127); + len &= 127; + } + } + + /* Move remaining bytes into internal buffer. */ + if (len > 0) { + size_t left_over = (size_t)ctx->buflen; + + memcpy(&ctx->buffer[left_over], buffer, len); + left_over += len; + if (left_over >= 128) { + sha512_process_block(ctx->buffer, 128, ctx); + left_over -= 128; + memcpy(ctx->buffer, &ctx->buffer[128], left_over); + } + ctx->buflen = left_over; + } +} + + +/* Define our magic string to mark salt for SHA512 "encryption" + replacement. */ +static const char sha512_salt_prefix[] = "$6$"; + +/* Prefix for optional rounds specification. */ +static const char sha512_rounds_prefix[] = "rounds="; + +/* Maximum salt string length. */ +#define SALT_LEN_MAX 16 +/* Default number of rounds if not explicitly specified. */ +#define ROUNDS_DEFAULT 5000 +/* Minimum number of rounds. */ +#define ROUNDS_MIN 1000 +/* Maximum number of rounds. */ +#define ROUNDS_MAX 999999999 + +/* Table with characters for base64 transformation. */ +static const char b64t[64] = +"./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; + + +char * +php_sha512_crypt_r(const char *key, const char *salt, char *buffer, int buflen) { +#ifdef PHP_WIN32 +# if _MSC <= 1300 +# pragma pack(push, 16) + unsigned char alt_result[64]; + unsigned char temp_result[64]; +# pragma pack(pop) +# else + __declspec(align(64)) unsigned char alt_result[64]; + __declspec(align(64)) unsigned char temp_result[64]; +# endif +#else + unsigned char alt_result[64] ALIGNED(__alignof__ (uint64_t)); + unsigned char temp_result[64] ALIGNED(__alignof__ (uint64_t)); +#endif + struct sha512_ctx ctx; + struct sha512_ctx alt_ctx; + size_t salt_len; + size_t key_len; + size_t cnt; + char *cp; + char *copied_key = NULL; + char *copied_salt = NULL; + char *p_bytes; + char *s_bytes; + /* Default number of rounds. */ + size_t rounds = ROUNDS_DEFAULT; + zend_bool rounds_custom = 0; + + /* Find beginning of salt string. The prefix should normally always + be present. Just in case it is not. */ + if (strncmp(sha512_salt_prefix, salt, sizeof(sha512_salt_prefix) - 1) == 0) { + /* Skip salt prefix. */ + salt += sizeof(sha512_salt_prefix) - 1; + } + + if (strncmp(salt, sha512_rounds_prefix, sizeof(sha512_rounds_prefix) - 1) == 0) { + const char *num = salt + sizeof(sha512_rounds_prefix) - 1; + char *endp; + unsigned long int srounds = strtoul(num, &endp, 10); + + if (*endp == '$') { + salt = endp + 1; + rounds = MAX(ROUNDS_MIN, MIN(srounds, ROUNDS_MAX)); + rounds_custom = 1; + } + } + + salt_len = MIN(strcspn(salt, "$"), SALT_LEN_MAX); + key_len = strlen(key); + + if ((key - (char *) 0) % __alignof__ (uint64_t) != 0) { + char *tmp = (char *) alloca (key_len + __alignof__ (uint64_t)); + key = copied_key = + memcpy(tmp + __alignof__(uint64_t) - (tmp - (char *) 0) % __alignof__(uint64_t), key, key_len); + } + + if ((salt - (char *) 0) % __alignof__ (uint64_t) != 0) { + char *tmp = (char *) alloca(salt_len + __alignof__(uint64_t)); + + salt = copied_salt = memcpy(tmp + __alignof__(uint64_t) - (tmp - (char *) 0) % __alignof__(uint64_t), salt, salt_len); + } + + /* Prepare for the real work. */ + sha512_init_ctx(&ctx); + + /* Add the key string. */ + sha512_process_bytes(key, key_len, &ctx); + + /* The last part is the salt string. This must be at most 16 + characters and it ends at the first `$' character (for + compatibility with existing implementations). */ + sha512_process_bytes(salt, salt_len, &ctx); + + + /* Compute alternate SHA512 sum with input KEY, SALT, and KEY. The + final result will be added to the first context. */ + sha512_init_ctx(&alt_ctx); + + /* Add key. */ + sha512_process_bytes(key, key_len, &alt_ctx); + + /* Add salt. */ + sha512_process_bytes(salt, salt_len, &alt_ctx); + + /* Add key again. */ + sha512_process_bytes(key, key_len, &alt_ctx); + + /* Now get result of this (64 bytes) and add it to the other + context. */ + sha512_finish_ctx(&alt_ctx, alt_result); + + /* Add for any character in the key one byte of the alternate sum. */ + for (cnt = key_len; cnt > 64; cnt -= 64) { + sha512_process_bytes(alt_result, 64, &ctx); + } + sha512_process_bytes(alt_result, cnt, &ctx); + + /* Take the binary representation of the length of the key and for every + 1 add the alternate sum, for every 0 the key. */ + for (cnt = key_len; cnt > 0; cnt >>= 1) { + if ((cnt & 1) != 0) { + sha512_process_bytes(alt_result, 64, &ctx); + } else { + sha512_process_bytes(key, key_len, &ctx); + } + } + + /* Create intermediate result. */ + sha512_finish_ctx(&ctx, alt_result); + + /* Start computation of P byte sequence. */ + sha512_init_ctx(&alt_ctx); + + /* For every character in the password add the entire password. */ + for (cnt = 0; cnt < key_len; ++cnt) { + sha512_process_bytes(key, key_len, &alt_ctx); + } + + /* Finish the digest. */ + sha512_finish_ctx(&alt_ctx, temp_result); + + /* Create byte sequence P. */ + cp = p_bytes = alloca(key_len); + for (cnt = key_len; cnt >= 64; cnt -= 64) { + cp = __php_mempcpy((void *) cp, (const void *)temp_result, 64); + } + + memcpy(cp, temp_result, cnt); + + /* Start computation of S byte sequence. */ + sha512_init_ctx(&alt_ctx); + + /* For every character in the password add the entire password. */ + for (cnt = 0; cnt < 16 + alt_result[0]; ++cnt) { + sha512_process_bytes(salt, salt_len, &alt_ctx); + } + + /* Finish the digest. */ + sha512_finish_ctx(&alt_ctx, temp_result); + + /* Create byte sequence S. */ + cp = s_bytes = alloca(salt_len); + for (cnt = salt_len; cnt >= 64; cnt -= 64) { + cp = __php_mempcpy(cp, temp_result, 64); + } + memcpy(cp, temp_result, cnt); + + /* Repeatedly run the collected hash value through SHA512 to burn + CPU cycles. */ + for (cnt = 0; cnt < rounds; ++cnt) { + /* New context. */ + sha512_init_ctx(&ctx); + + /* Add key or last result. */ + if ((cnt & 1) != 0) { + sha512_process_bytes(p_bytes, key_len, &ctx); + } else { + sha512_process_bytes(alt_result, 64, &ctx); + } + + /* Add salt for numbers not divisible by 3. */ + if (cnt % 3 != 0) { + sha512_process_bytes(s_bytes, salt_len, &ctx); + } + + /* Add key for numbers not divisible by 7. */ + if (cnt % 7 != 0) { + sha512_process_bytes(p_bytes, key_len, &ctx); + } + + /* Add key or last result. */ + if ((cnt & 1) != 0) { + sha512_process_bytes(alt_result, 64, &ctx); + } else { + sha512_process_bytes(p_bytes, key_len, &ctx); + } + + /* Create intermediate result. */ + sha512_finish_ctx(&ctx, alt_result); + } + + /* Now we can construct the result string. It consists of three + parts. */ + cp = __php_stpncpy(buffer, sha512_salt_prefix, MAX(0, buflen)); + buflen -= sizeof(sha512_salt_prefix) - 1; + + if (rounds_custom) { +#ifdef PHP_WIN32 + int n = _snprintf(cp, MAX(0, buflen), "%s%u$", sha512_rounds_prefix, rounds); +#else + int n = snprintf(cp, MAX(0, buflen), "%s%zu$", sha512_rounds_prefix, rounds); +#endif + cp += n; + buflen -= n; + } + + cp = __php_stpncpy(cp, salt, MIN((size_t) MAX(0, buflen), salt_len)); + buflen -= (int) MIN((size_t) MAX(0, buflen), salt_len); + + if (buflen > 0) { + *cp++ = '$'; + --buflen; + } + +#define b64_from_24bit(B2, B1, B0, N) \ + do { \ + unsigned int w = ((B2) << 16) | ((B1) << 8) | (B0); \ + int n = (N); \ + while (n-- > 0 && buflen > 0) \ + { \ + *cp++ = b64t[w & 0x3f]; \ + --buflen; \ + w >>= 6; \ + } \ + } while (0) + + b64_from_24bit(alt_result[0], alt_result[21], alt_result[42], 4); + b64_from_24bit(alt_result[22], alt_result[43], alt_result[1], 4); + b64_from_24bit(alt_result[44], alt_result[2], alt_result[23], 4); + b64_from_24bit(alt_result[3], alt_result[24], alt_result[45], 4); + b64_from_24bit(alt_result[25], alt_result[46], alt_result[4], 4); + b64_from_24bit(alt_result[47], alt_result[5], alt_result[26], 4); + b64_from_24bit(alt_result[6], alt_result[27], alt_result[48], 4); + b64_from_24bit(alt_result[28], alt_result[49], alt_result[7], 4); + b64_from_24bit(alt_result[50], alt_result[8], alt_result[29], 4); + b64_from_24bit(alt_result[9], alt_result[30], alt_result[51], 4); + b64_from_24bit(alt_result[31], alt_result[52], alt_result[10], 4); + b64_from_24bit(alt_result[53], alt_result[11], alt_result[32], 4); + b64_from_24bit(alt_result[12], alt_result[33], alt_result[54], 4); + b64_from_24bit(alt_result[34], alt_result[55], alt_result[13], 4); + b64_from_24bit(alt_result[56], alt_result[14], alt_result[35], 4); + b64_from_24bit(alt_result[15], alt_result[36], alt_result[57], 4); + b64_from_24bit(alt_result[37], alt_result[58], alt_result[16], 4); + b64_from_24bit(alt_result[59], alt_result[17], alt_result[38], 4); + b64_from_24bit(alt_result[18], alt_result[39], alt_result[60], 4); + b64_from_24bit(alt_result[40], alt_result[61], alt_result[19], 4); + b64_from_24bit(alt_result[62], alt_result[20], alt_result[41], 4); + b64_from_24bit(0, 0, alt_result[63], 2); + + if (buflen <= 0) { + errno = ERANGE; + buffer = NULL; + } else { + *cp = '\0'; /* Terminate the string. */ + } + + /* Clear the buffer for the intermediate result so that people + attaching to processes or reading core dumps cannot get any + information. We do it in this way to clear correct_words[] + inside the SHA512 implementation as well. */ + sha512_init_ctx(&ctx); + sha512_finish_ctx(&ctx, alt_result); + memset(temp_result, '\0', sizeof(temp_result)); + memset(p_bytes, '\0', key_len); + memset(s_bytes, '\0', salt_len); + memset(&ctx, '\0', sizeof(ctx)); + memset(&alt_ctx, '\0', sizeof(alt_ctx)); + if (copied_key != NULL) { + memset(copied_key, '\0', key_len); + } + if (copied_salt != NULL) { + memset(copied_salt, '\0', salt_len); + } + + return buffer; +} + + +/* This entry point is equivalent to the `crypt' function in Unix + libcs. */ +char * +php_sha512_crypt(const char *key, const char *salt) { + /* We don't want to have an arbitrary limit in the size of the + password. We can compute an upper bound for the size of the + result in advance and so we can prepare the buffer we pass to + `sha512_crypt_r'. */ + static char *buffer; + static int buflen; + int needed = (int)(sizeof(sha512_salt_prefix) - 1 + + sizeof(sha512_rounds_prefix) + 9 + 1 + + strlen(salt) + 1 + 86 + 1); + + if (buflen < needed) { + char *new_buffer = (char *) realloc(buffer, needed); + if (new_buffer == NULL) { + return NULL; + } + + buffer = new_buffer; + buflen = needed; + } + + return php_sha512_crypt_r (key, salt, buffer, buflen); +} + +#ifdef TEST +static const struct { + const char *input; + const char result[64]; +} tests[] = + { + /* Test vectors from FIPS 180-2: appendix C.1. */ + { "abc", + "\xdd\xaf\x35\xa1\x93\x61\x7a\xba\xcc\x41\x73\x49\xae\x20\x41\x31" + "\x12\xe6\xfa\x4e\x89\xa9\x7e\xa2\x0a\x9e\xee\xe6\x4b\x55\xd3\x9a" + "\x21\x92\x99\x2a\x27\x4f\xc1\xa8\x36\xba\x3c\x23\xa3\xfe\xeb\xbd" + "\x45\x4d\x44\x23\x64\x3c\xe8\x0e\x2a\x9a\xc9\x4f\xa5\x4c\xa4\x9f" }, + /* Test vectors from FIPS 180-2: appendix C.2. */ + { "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmn" + "hijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu", + "\x8e\x95\x9b\x75\xda\xe3\x13\xda\x8c\xf4\xf7\x28\x14\xfc\x14\x3f" + "\x8f\x77\x79\xc6\xeb\x9f\x7f\xa1\x72\x99\xae\xad\xb6\x88\x90\x18" + "\x50\x1d\x28\x9e\x49\x00\xf7\xe4\x33\x1b\x99\xde\xc4\xb5\x43\x3a" + "\xc7\xd3\x29\xee\xb6\xdd\x26\x54\x5e\x96\xe5\x5b\x87\x4b\xe9\x09" }, + /* Test vectors from the NESSIE project. */ + { "", + "\xcf\x83\xe1\x35\x7e\xef\xb8\xbd\xf1\x54\x28\x50\xd6\x6d\x80\x07" + "\xd6\x20\xe4\x05\x0b\x57\x15\xdc\x83\xf4\xa9\x21\xd3\x6c\xe9\xce" + "\x47\xd0\xd1\x3c\x5d\x85\xf2\xb0\xff\x83\x18\xd2\x87\x7e\xec\x2f" + "\x63\xb9\x31\xbd\x47\x41\x7a\x81\xa5\x38\x32\x7a\xf9\x27\xda\x3e" }, + { "a", + "\x1f\x40\xfc\x92\xda\x24\x16\x94\x75\x09\x79\xee\x6c\xf5\x82\xf2" + "\xd5\xd7\xd2\x8e\x18\x33\x5d\xe0\x5a\xbc\x54\xd0\x56\x0e\x0f\x53" + "\x02\x86\x0c\x65\x2b\xf0\x8d\x56\x02\x52\xaa\x5e\x74\x21\x05\x46" + "\xf3\x69\xfb\xbb\xce\x8c\x12\xcf\xc7\x95\x7b\x26\x52\xfe\x9a\x75" }, + { "message digest", + "\x10\x7d\xbf\x38\x9d\x9e\x9f\x71\xa3\xa9\x5f\x6c\x05\x5b\x92\x51" + "\xbc\x52\x68\xc2\xbe\x16\xd6\xc1\x34\x92\xea\x45\xb0\x19\x9f\x33" + "\x09\xe1\x64\x55\xab\x1e\x96\x11\x8e\x8a\x90\x5d\x55\x97\xb7\x20" + "\x38\xdd\xb3\x72\xa8\x98\x26\x04\x6d\xe6\x66\x87\xbb\x42\x0e\x7c" }, + { "abcdefghijklmnopqrstuvwxyz", + "\x4d\xbf\xf8\x6c\xc2\xca\x1b\xae\x1e\x16\x46\x8a\x05\xcb\x98\x81" + "\xc9\x7f\x17\x53\xbc\xe3\x61\x90\x34\x89\x8f\xaa\x1a\xab\xe4\x29" + "\x95\x5a\x1b\xf8\xec\x48\x3d\x74\x21\xfe\x3c\x16\x46\x61\x3a\x59" + "\xed\x54\x41\xfb\x0f\x32\x13\x89\xf7\x7f\x48\xa8\x79\xc7\xb1\xf1" }, + { "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", + "\x20\x4a\x8f\xc6\xdd\xa8\x2f\x0a\x0c\xed\x7b\xeb\x8e\x08\xa4\x16" + "\x57\xc1\x6e\xf4\x68\xb2\x28\xa8\x27\x9b\xe3\x31\xa7\x03\xc3\x35" + "\x96\xfd\x15\xc1\x3b\x1b\x07\xf9\xaa\x1d\x3b\xea\x57\x78\x9c\xa0" + "\x31\xad\x85\xc7\xa7\x1d\xd7\x03\x54\xec\x63\x12\x38\xca\x34\x45" }, + { "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", + "\x1e\x07\xbe\x23\xc2\x6a\x86\xea\x37\xea\x81\x0c\x8e\xc7\x80\x93" + "\x52\x51\x5a\x97\x0e\x92\x53\xc2\x6f\x53\x6c\xfc\x7a\x99\x96\xc4" + "\x5c\x83\x70\x58\x3e\x0a\x78\xfa\x4a\x90\x04\x1d\x71\xa4\xce\xab" + "\x74\x23\xf1\x9c\x71\xb9\xd5\xa3\xe0\x12\x49\xf0\xbe\xbd\x58\x94" }, + { "123456789012345678901234567890123456789012345678901234567890" + "12345678901234567890", + "\x72\xec\x1e\xf1\x12\x4a\x45\xb0\x47\xe8\xb7\xc7\x5a\x93\x21\x95" + "\x13\x5b\xb6\x1d\xe2\x4e\xc0\xd1\x91\x40\x42\x24\x6e\x0a\xec\x3a" + "\x23\x54\xe0\x93\xd7\x6f\x30\x48\xb4\x56\x76\x43\x46\x90\x0c\xb1" + "\x30\xd2\xa4\xfd\x5d\xd1\x6a\xbb\x5e\x30\xbc\xb8\x50\xde\xe8\x43" } + }; +#define ntests (sizeof (tests) / sizeof (tests[0])) + + +static const struct +{ + const char *salt; + const char *input; + const char *expected; +} tests2[] = { + { "$6$saltstring", "Hello world!", + "$6$saltstring$svn8UoSVapNtMuq1ukKS4tPQd8iKwSMHWjl/O817G3uBnIFNjnQJu" + "esI68u4OTLiBFdcbYEdFCoEOfaS35inz1"}, + { "$6$rounds=10000$saltstringsaltstring", "Hello world!", + "$6$rounds=10000$saltstringsaltst$OW1/O6BYHV6BcXZu8QVeXbDWra3Oeqh0sb" + "HbbMCVNSnCM/UrjmM0Dp8vOuZeHBy/YTBmSK6H9qs/y3RnOaw5v." }, + { "$6$rounds=5000$toolongsaltstring", "This is just a test", + "$6$rounds=5000$toolongsaltstrin$lQ8jolhgVRVhY4b5pZKaysCLi0QBxGoNeKQ" + "zQ3glMhwllF7oGDZxUhx1yxdYcz/e1JSbq3y6JMxxl8audkUEm0" }, + { "$6$rounds=1400$anotherlongsaltstring", + "a very much longer text to encrypt. This one even stretches over more" + "than one line.", + "$6$rounds=1400$anotherlongsalts$POfYwTEok97VWcjxIiSOjiykti.o/pQs.wP" + "vMxQ6Fm7I6IoYN3CmLs66x9t0oSwbtEW7o7UmJEiDwGqd8p4ur1" }, + { "$6$rounds=77777$short", + "we have a short salt string but not a short password", + "$6$rounds=77777$short$WuQyW2YR.hBNpjjRhpYD/ifIw05xdfeEyQoMxIXbkvr0g" + "ge1a1x3yRULJ5CCaUeOxFmtlcGZelFl5CxtgfiAc0" }, + { "$6$rounds=123456$asaltof16chars..", "a short string", + "$6$rounds=123456$asaltof16chars..$BtCwjqMJGx5hrJhZywWvt0RLE8uZ4oPwc" + "elCjmw2kSYu.Ec6ycULevoBK25fs2xXgMNrCzIMVcgEJAstJeonj1" }, + { "$6$rounds=10$roundstoolow", "the minimum number is still observed", + "$6$rounds=1000$roundstoolow$kUMsbe306n21p9R.FRkW3IGn.S9NPN0x50YhH1x" + "hLsPuWGsUSklZt58jaTfF4ZEQpyUNGc0dqbpBYYBaHHrsX." }, +}; +#define ntests2 (sizeof (tests2) / sizeof (tests2[0])) + + +int main (void) { + struct sha512_ctx ctx; + char sum[64]; + int result = 0; + int cnt; + int i; + char buf[1000]; + static const char expected[64] = + "\xe7\x18\x48\x3d\x0c\xe7\x69\x64\x4e\x2e\x42\xc7\xbc\x15\xb4\x63" + "\x8e\x1f\x98\xb1\x3b\x20\x44\x28\x56\x32\xa8\x03\xaf\xa9\x73\xeb" + "\xde\x0f\xf2\x44\x87\x7e\xa6\x0a\x4c\xb0\x43\x2c\xe5\x77\xc3\x1b" + "\xeb\x00\x9c\x5c\x2c\x49\xaa\x2e\x4e\xad\xb2\x17\xad\x8c\xc0\x9b"; + + for (cnt = 0; cnt < (int) ntests; ++cnt) { + sha512_init_ctx (&ctx); + sha512_process_bytes (tests[cnt].input, strlen (tests[cnt].input), &ctx); + sha512_finish_ctx (&ctx, sum); + if (memcmp (tests[cnt].result, sum, 64) != 0) { + printf ("test %d run %d failed\n", cnt, 1); + result = 1; + } + + sha512_init_ctx (&ctx); + for (i = 0; tests[cnt].input[i] != '\0'; ++i) { + sha512_process_bytes (&tests[cnt].input[i], 1, &ctx); + } + sha512_finish_ctx (&ctx, sum); + if (memcmp (tests[cnt].result, sum, 64) != 0) { + printf ("test %d run %d failed\n", cnt, 2); + result = 1; + } + } + + /* Test vector from FIPS 180-2: appendix C.3. */ + + memset (buf, 'a', sizeof (buf)); + sha512_init_ctx (&ctx); + for (i = 0; i < 1000; ++i) { + sha512_process_bytes (buf, sizeof (buf), &ctx); + } + + sha512_finish_ctx (&ctx, sum); + if (memcmp (expected, sum, 64) != 0) { + printf ("test %d failed\n", cnt); + result = 1; + } + + for (cnt = 0; cnt < ntests2; ++cnt) { + char *cp = php_sha512_crypt(tests2[cnt].input, tests2[cnt].salt); + + if (strcmp (cp, tests2[cnt].expected) != 0) { + printf ("test %d: expected \"%s\", got \"%s\"\n", + cnt, tests2[cnt].expected, cp); + result = 1; + } + } + + if (result == 0) { + puts ("all tests OK"); + } + + return result; +} +#endif diff --git a/ext/standard/css.c b/ext/standard/css.c index 5a62621e5..d4179538d 100644 --- a/ext/standard/css.c +++ b/ext/standard/css.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: css.c 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: css.c 293036 2010-01-03 09:23:27Z sebastian $ */ #include "php.h" #include "info.h" diff --git a/ext/standard/css.h b/ext/standard/css.h index 855c21eed..d7cc796fc 100644 --- a/ext/standard/css.h +++ b/ext/standard/css.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: css.h 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: css.h 293036 2010-01-03 09:23:27Z sebastian $ */ #ifndef CSS_H #define CSS_H diff --git a/ext/standard/cyr_convert.c b/ext/standard/cyr_convert.c index 3a847be18..be11cd02a 100644 --- a/ext/standard/cyr_convert.c +++ b/ext/standard/cyr_convert.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: cyr_convert.c 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: cyr_convert.c 293036 2010-01-03 09:23:27Z sebastian $ */ #include <stdlib.h> diff --git a/ext/standard/cyr_convert.h b/ext/standard/cyr_convert.h index 74a1a3628..3ff5c5904 100644 --- a/ext/standard/cyr_convert.h +++ b/ext/standard/cyr_convert.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: cyr_convert.h 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: cyr_convert.h 293036 2010-01-03 09:23:27Z sebastian $ */ #ifndef CYR_CONVERT_H #define CYR_CONVERT_H diff --git a/ext/standard/datetime.c b/ext/standard/datetime.c index 6afd94569..87fd1b674 100644 --- a/ext/standard/datetime.c +++ b/ext/standard/datetime.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: datetime.c 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: datetime.c 293036 2010-01-03 09:23:27Z sebastian $ */ #include "php.h" #include "zend_operators.h" diff --git a/ext/standard/datetime.h b/ext/standard/datetime.h index a944f270c..0ac21ea91 100644 --- a/ext/standard/datetime.h +++ b/ext/standard/datetime.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: datetime.h 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: datetime.h 293036 2010-01-03 09:23:27Z sebastian $ */ #ifndef DATETIME_H #define DATETIME_H diff --git a/ext/standard/dir.c b/ext/standard/dir.c index f2b8d24cb..fcaf1f0b2 100644 --- a/ext/standard/dir.c +++ b/ext/standard/dir.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: dir.c 286555 2009-07-30 12:06:40Z felipe $ */ +/* $Id: dir.c 293036 2010-01-03 09:23:27Z sebastian $ */ /* {{{ includes/startup/misc */ diff --git a/ext/standard/dl.c b/ext/standard/dl.c index 37eda68a5..04990075c 100644 --- a/ext/standard/dl.c +++ b/ext/standard/dl.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: dl.c 286859 2009-08-06 01:33:54Z scottmac $ */ +/* $Id: dl.c 293036 2010-01-03 09:23:27Z sebastian $ */ #include "php.h" #include "dl.h" @@ -146,8 +146,18 @@ PHPAPI int php_load_extension(char *filename, int type, int start_now TSRMLS_DC) /* load dynamic symbol */ handle = DL_LOAD(libpath); if (!handle) { +#if PHP_WIN32 + char *err = GET_DL_ERROR(); + if (err) { + php_error_docref(NULL TSRMLS_CC, error_type, "Unable to load dynamic library '%s' - %s", libpath, err); + LocalFree(err); + } else { + php_error_docref(NULL TSRMLS_CC, error_type, "Unable to load dynamic library '%s' - %s", libpath, "Unknown reason"); + } +#else php_error_docref(NULL TSRMLS_CC, error_type, "Unable to load dynamic library '%s' - %s", libpath, GET_DL_ERROR()); GET_DL_ERROR(); /* free the buffer storing the error */ +#endif efree(libpath); return FAILURE; } diff --git a/ext/standard/dl.h b/ext/standard/dl.h index 8d9ce1e84..6eb3fb632 100644 --- a/ext/standard/dl.h +++ b/ext/standard/dl.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: dl.h 272444 2008-12-31 18:55:22Z helly $ */ +/* $Id: dl.h 293036 2010-01-03 09:23:27Z sebastian $ */ #ifndef DL_H #define DL_H diff --git a/ext/standard/dns.c b/ext/standard/dns.c index 7507884e6..96d6fb77b 100644 --- a/ext/standard/dns.c +++ b/ext/standard/dns.c @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: dns.c 287120 2009-08-11 22:07:35Z scottmac $ */ +/* $Id: dns.c 292413 2009-12-21 15:22:40Z jani $ */ /* {{{ includes */ #include "php.h" @@ -44,10 +44,10 @@ #undef T_UNSPEC #endif #if HAVE_ARPA_NAMESER_H -#include <arpa/nameser.h> +#ifdef DARWIN +# define BIND_8_COMPAT 1 #endif -#if HAVE_ARPA_NAMESER_COMPAT_H -#include <arpa/nameser_compat.h> +#include <arpa/nameser.h> #endif #if HAVE_RESOLV_H #include <resolv.h> @@ -810,14 +810,8 @@ PHP_FUNCTION(dns_get_record) n = php_dns_search(handle, hostname, C_IN, type_to_fetch, answer.qb2, sizeof answer); if (n < 0) { - if (php_dns_errno(handle) == NO_DATA) { - php_dns_free_handle(handle); - continue; - } - php_dns_free_handle(handle); - zval_dtor(return_value); - RETURN_FALSE; + continue; } cp = answer.qb2 + HFIXEDSZ; diff --git a/ext/standard/exec.c b/ext/standard/exec.c index 6c2dd6000..54c25f2ef 100644 --- a/ext/standard/exec.c +++ b/ext/standard/exec.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ | Ilia Alshanetsky <iliaa@php.net> | +----------------------------------------------------------------------+ */ -/* $Id: exec.c 289688 2009-10-15 21:36:42Z pajoye $ */ +/* $Id: exec.c 294429 2010-02-03 18:11:24Z pajoye $ */ #include <stdio.h> #include "php.h" @@ -121,7 +121,7 @@ PHPAPI int php_exec(int type, char *cmd, zval *array, zval *return_value TSRMLS_ 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)) { @@ -157,7 +157,7 @@ PHPAPI int php_exec(int type, char *cmd, zval *array, zval *return_value TSRMLS_ } if (bufl) { /* strip trailing whitespaces if we have not done so already */ - if ((type == 2 && bufl && !l) || type != 2) { + if ((type == 2 && buf != b) || type != 2) { l = bufl; while (l-- && isspace(((unsigned char *)buf)[l])); if (l != (int)(bufl - 1)) { diff --git a/ext/standard/exec.h b/ext/standard/exec.h index 669fa1b19..18ba00836 100644 --- a/ext/standard/exec.h +++ b/ext/standard/exec.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: exec.h 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: exec.h 293036 2010-01-03 09:23:27Z sebastian $ */ #ifndef EXEC_H #define EXEC_H diff --git a/ext/standard/file.c b/ext/standard/file.c index 61eb06c11..0bfe060f2 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -21,7 +21,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: file.c 289422 2009-10-09 14:37:45Z pajoye $ */ +/* $Id: file.c 294896 2010-02-11 18:03:57Z johannes $ */ /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */ @@ -50,16 +50,6 @@ # include "win32/param.h" # include "win32/winutil.h" # include "win32/fnmatch.h" -#elif defined(NETWARE) -# include <sys/param.h> -# include <sys/select.h> -# ifdef USE_WINSOCK -# include <novsock2.h> -# else -# include <sys/socket.h> -# include <netinet/in.h> -# include <netdb.h> -# endif #else # if HAVE_SYS_PARAM_H # include <sys/param.h> @@ -846,7 +836,7 @@ PHP_FUNCTION(tempnam) return; } - if (PG(safe_mode) &&(!php_checkuid(dir, NULL, CHECKUID_ALLOW_ONLY_DIR))) { + if (PG(safe_mode) &&(!php_checkuid(dir, NULL, CHECKUID_CHECK_FILE_AND_DIR))) { RETURN_FALSE; } @@ -1636,16 +1626,9 @@ PHP_NAMED_FUNCTION(php_if_fstat) MAKE_LONG_ZVAL_INCREF(stat_rdev, -1); #endif MAKE_LONG_ZVAL_INCREF(stat_size, stat_ssb.sb.st_size); -#ifdef NETWARE - MAKE_LONG_ZVAL_INCREF(stat_atime, stat_ssb.sb.st_atime.tv_sec); - MAKE_LONG_ZVAL_INCREF(stat_mtime, stat_ssb.sb.st_mtime.tv_sec); - MAKE_LONG_ZVAL_INCREF(stat_ctime, stat_ssb.sb.st_ctime.tv_sec); -#else MAKE_LONG_ZVAL_INCREF(stat_atime, stat_ssb.sb.st_atime); MAKE_LONG_ZVAL_INCREF(stat_mtime, stat_ssb.sb.st_mtime); MAKE_LONG_ZVAL_INCREF(stat_ctime, stat_ssb.sb.st_ctime); -#endif - #ifdef HAVE_ST_BLKSIZE MAKE_LONG_ZVAL_INCREF(stat_blksize, stat_ssb.sb.st_blksize); #else diff --git a/ext/standard/file.h b/ext/standard/file.h index d3720f9f1..63804b72b 100644 --- a/ext/standard/file.h +++ b/ext/standard/file.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: file.h 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: file.h 293036 2010-01-03 09:23:27Z sebastian $ */ /* Synced with php 3.0 revision 1.30 1999-06-16 [ssb] */ diff --git a/ext/standard/filestat.c b/ext/standard/filestat.c index 031422f7a..72aaf98b0 100644 --- a/ext/standard/filestat.c +++ b/ext/standard/filestat.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: filestat.c 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: filestat.c 293036 2010-01-03 09:23:27Z sebastian $ */ #include "php.h" #include "safe_mode.h" @@ -386,7 +386,7 @@ PHP_FUNCTION(disk_free_space) } /* }}} */ -#if !defined(WINDOWS) +#if !defined(WINDOWS) && !defined(NETWARE) static void php_do_chgrp(INTERNAL_FUNCTION_PARAMETERS, int do_lchgrp) /* {{{ */ { char *filename; @@ -487,7 +487,7 @@ PHP_FUNCTION(lchgrp) /* }}} */ #endif /* !NETWARE */ -#if !defined(WINDOWS) +#if !defined(WINDOWS) && !defined(NETWARE) static void php_do_chown(INTERNAL_FUNCTION_PARAMETERS, int do_lchown) /* {{{ */ { char *filename; @@ -899,23 +899,11 @@ PHPAPI void php_stat(const char *filename, php_stat_len filename_length, int typ case FS_GROUP: RETURN_LONG((long)ssb.sb.st_gid); case FS_ATIME: -#ifdef NETWARE - RETURN_LONG((long)ssb.sb.st_atime.tv_sec); -#else RETURN_LONG((long)ssb.sb.st_atime); -#endif case FS_MTIME: -#ifdef NETWARE - RETURN_LONG((long)ssb.sb.st_mtime.tv_sec); -#else RETURN_LONG((long)ssb.sb.st_mtime); -#endif case FS_CTIME: -#ifdef NETWARE - RETURN_LONG((long)ssb.sb.st_ctime.tv_sec); -#else RETURN_LONG((long)ssb.sb.st_ctime); -#endif case FS_TYPE: if (S_ISLNK(ssb.sb.st_mode)) { RETURN_STRING("link", 1); @@ -963,15 +951,9 @@ PHPAPI void php_stat(const char *filename, php_stat_len filename_length, int typ MAKE_LONG_ZVAL_INCREF(stat_rdev, -1); #endif MAKE_LONG_ZVAL_INCREF(stat_size, stat_sb->st_size); -#ifdef NETWARE - MAKE_LONG_ZVAL_INCREF(stat_atime, (stat_sb->st_atime).tv_sec); - MAKE_LONG_ZVAL_INCREF(stat_mtime, (stat_sb->st_mtime).tv_sec); - MAKE_LONG_ZVAL_INCREF(stat_ctime, (stat_sb->st_ctime).tv_sec); -#else MAKE_LONG_ZVAL_INCREF(stat_atime, stat_sb->st_atime); MAKE_LONG_ZVAL_INCREF(stat_mtime, stat_sb->st_mtime); MAKE_LONG_ZVAL_INCREF(stat_ctime, stat_sb->st_ctime); -#endif #ifdef HAVE_ST_BLKSIZE MAKE_LONG_ZVAL_INCREF(stat_blksize, stat_sb->st_blksize); #else @@ -1125,6 +1107,51 @@ FileFunction(php_if_lstat, FS_LSTAT) FileFunction(php_if_stat, FS_STAT) /* }}} */ +/* {{{ proto bool realpath_cache_size() + Get current size of realpath cache */ +PHP_FUNCTION(realpath_cache_size) +{ + if (zend_parse_parameters_none() == FAILURE) { + return; + } + RETURN_LONG(realpath_cache_size(TSRMLS_C)); +} + +/* {{{ proto bool realpath_cache_get() + Get current size of realpath cache */ +PHP_FUNCTION(realpath_cache_get) +{ + realpath_cache_bucket **buckets = realpath_cache_get_buckets(TSRMLS_C), **end = buckets + realpath_cache_max_buckets(TSRMLS_C); + + if (zend_parse_parameters_none() == FAILURE) { + return; + } + + array_init(return_value); + while(buckets < end) { + realpath_cache_bucket *bucket = *buckets; + while(bucket) { + zval *entry; + MAKE_STD_ZVAL(entry); + array_init(entry); + + add_assoc_long(entry, "key", bucket->key); + add_assoc_bool(entry, "is_dir", bucket->is_dir); + add_assoc_stringl(entry, "realpath", bucket->realpath, bucket->realpath_len, 1); + add_assoc_long(entry, "expires", bucket->expires); +#ifdef PHP_WIN32 + add_assoc_bool(entry, "is_rvalid", bucket->is_rvalid); + add_assoc_bool(entry, "is_wvalid", bucket->is_wvalid); + add_assoc_bool(entry, "is_readable", bucket->is_readable); + add_assoc_bool(entry, "is_writable", bucket->is_writable); +#endif + zend_hash_update(Z_ARRVAL_P(return_value), bucket->path, bucket->path_len+1, &entry, sizeof(zval *), NULL); + bucket = bucket->next; + } + buckets++; + } +} + /* * Local variables: * tab-width: 4 diff --git a/ext/standard/filters.c b/ext/standard/filters.c index 888b14e35..c534cc4b4 100644 --- a/ext/standard/filters.c +++ b/ext/standard/filters.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -20,7 +20,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: filters.c 284646 2009-07-23 12:18:40Z iliaa $ */ +/* $Id: filters.c 293036 2010-01-03 09:23:27Z sebastian $ */ #include "php.h" #include "php_globals.h" diff --git a/ext/standard/flock_compat.c b/ext/standard/flock_compat.c index a01423cc9..696e972a4 100644 --- a/ext/standard/flock_compat.c +++ b/ext/standard/flock_compat.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: flock_compat.c 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: flock_compat.c 293036 2010-01-03 09:23:27Z sebastian $ */ #include "php.h" #include <errno.h> diff --git a/ext/standard/flock_compat.h b/ext/standard/flock_compat.h index a2d347fae..c7265fc2e 100644 --- a/ext/standard/flock_compat.h +++ b/ext/standard/flock_compat.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: flock_compat.h 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: flock_compat.h 293036 2010-01-03 09:23:27Z sebastian $ */ #ifndef FLOCK_COMPAT_H #define FLOCK_COMPAT_H @@ -42,9 +42,12 @@ PHPAPI int flock(int fd, int operation); #define PHP_LOCK_NB 4 #ifdef PHP_WIN32 -#define EWOULDBLOCK WSAEWOULDBLOCK -# define fsync _commit -# define ftruncate(a, b) chsize(a, b) +# ifdef EWOULDBLOCK +# undef EWOULDBLOCK +# endif +# define EWOULDBLOCK WSAEWOULDBLOCK +# define fsync _commit +# define ftruncate(a, b) chsize(a, b) #endif /* defined(PHP_WIN32) */ #if !HAVE_INET_ATON diff --git a/ext/standard/formatted_print.c b/ext/standard/formatted_print.c index d44aae543..5f5f2a66f 100644 --- a/ext/standard/formatted_print.c +++ b/ext/standard/formatted_print.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: formatted_print.c 284649 2009-07-23 14:54:04Z jani $ */ +/* $Id: formatted_print.c 293036 2010-01-03 09:23:27Z sebastian $ */ #include <math.h> /* modf() */ #include "php.h" @@ -232,14 +232,14 @@ php_sprintf_appenddouble(char **buffer, int *pos, if (zend_isnan(number)) { is_negative = (number<0); php_sprintf_appendstring(buffer, pos, size, "NaN", 3, 0, padding, - alignment, precision, is_negative, 0, always_sign); + alignment, 3, is_negative, 0, always_sign); return; } if (zend_isinf(number)) { is_negative = (number<0); php_sprintf_appendstring(buffer, pos, size, "INF", 3, 0, padding, - alignment, precision, is_negative, 0, always_sign); + alignment, 3, is_negative, 0, always_sign); return; } diff --git a/ext/standard/fsock.c b/ext/standard/fsock.c index 270e4d529..87e3e52e0 100644 --- a/ext/standard/fsock.c +++ b/ext/standard/fsock.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: fsock.c 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: fsock.c 293036 2010-01-03 09:23:27Z sebastian $ */ #include "php.h" #include "php_globals.h" diff --git a/ext/standard/fsock.h b/ext/standard/fsock.h index 8c5db51d2..377661300 100644 --- a/ext/standard/fsock.h +++ b/ext/standard/fsock.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: fsock.h 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: fsock.h 293036 2010-01-03 09:23:27Z sebastian $ */ /* Synced with php 3.0 revision 1.24 1999-06-18 [ssb] */ diff --git a/ext/standard/ftok.c b/ext/standard/ftok.c index 3c768a8e0..a41c12679 100644 --- a/ext/standard/ftok.c +++ b/ext/standard/ftok.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: ftok.c 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: ftok.c 293036 2010-01-03 09:23:27Z sebastian $ */ #include "php.h" diff --git a/ext/standard/ftp_fopen_wrapper.c b/ext/standard/ftp_fopen_wrapper.c index b2175e8a2..6e20d5a48 100644 --- a/ext/standard/ftp_fopen_wrapper.c +++ b/ext/standard/ftp_fopen_wrapper.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -18,7 +18,7 @@ | Sara Golemon <pollita@php.net> | +----------------------------------------------------------------------+ */ -/* $Id: ftp_fopen_wrapper.c 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: ftp_fopen_wrapper.c 293036 2010-01-03 09:23:27Z sebastian $ */ #include "php.h" #include "php_globals.h" @@ -834,32 +834,19 @@ static int php_stream_ftp_url_stat(php_stream_wrapper *wrapper, char *url, int f tm.tm_sec += stamp - mktime(gmt); tm.tm_isdst = gmt->tm_isdst; -#ifdef NETWARE - ssb->sb.st_mtime.tv_sec = mktime(&tm); -#else ssb->sb.st_mtime = mktime(&tm); -#endif } else { /* error or unsupported command */ mdtm_error: -#ifdef NETWARE - ssb->sb.st_mtime.tv_sec = -1; -#else ssb->sb.st_mtime = -1; -#endif } ssb->sb.st_ino = 0; /* Unknown values */ ssb->sb.st_dev = 0; ssb->sb.st_uid = 0; ssb->sb.st_gid = 0; -#ifdef NETWARE - ssb->sb.st_atime.tv_sec = -1; - ssb->sb.st_ctime.tv_sec = -1; -#else ssb->sb.st_atime = -1; ssb->sb.st_ctime = -1; -#endif ssb->sb.st_nlink = 1; ssb->sb.st_rdev = -1; diff --git a/ext/standard/head.c b/ext/standard/head.c index 9e9d9d54e..807d30b10 100644 --- a/ext/standard/head.c +++ b/ext/standard/head.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -15,7 +15,7 @@ | Author: Rasmus Lerdorf <rasmus@lerdorf.on.ca> | +----------------------------------------------------------------------+ */ -/* $Id: head.c 286508 2009-07-29 13:44:16Z iliaa $ */ +/* $Id: head.c 293036 2010-01-03 09:23:27Z sebastian $ */ #include <stdio.h> #include "php.h" diff --git a/ext/standard/head.h b/ext/standard/head.h index 1eef0f290..7d7f6ca1c 100644 --- a/ext/standard/head.h +++ b/ext/standard/head.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: head.h 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: head.h 293036 2010-01-03 09:23:27Z sebastian $ */ #ifndef HEAD_H #define HEAD_H diff --git a/ext/standard/html.c b/ext/standard/html.c index 6f1bab29a..c9c7a7555 100644 --- a/ext/standard/html.c +++ b/ext/standard/html.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: html.c 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: html.c 293036 2010-01-03 09:23:27Z sebastian $ */ /* * HTML entity resources: @@ -144,7 +144,7 @@ static entity_table_t ent_uni_greek[] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, "thetasym", "upsih", NULL, NULL, NULL, - "piv" + "piv" }; static entity_table_t ent_uni_punct[] = { @@ -154,7 +154,7 @@ static entity_table_t ent_uni_punct[] = { NULL, NULL, NULL, "ndash", "mdash", NULL, NULL, NULL, /* 8216 */ "lsquo", "rsquo", "sbquo", NULL, "ldquo", "rdquo", "bdquo", NULL, - "dagger", "Dagger", "bull", NULL, NULL, NULL, "hellip", + "dagger", "Dagger", "bull", NULL, NULL, NULL, "hellip", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "permil", NULL, /* 8242 */ "prime", "Prime", NULL, NULL, NULL, NULL, NULL, "lsaquo", "rsaquo", NULL, @@ -194,39 +194,39 @@ static entity_table_t ent_uni_8592_9002[] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 8656 (0x21d0) */ - "lArr", "uArr", "rArr", "dArr", "hArr", "vArr", NULL, NULL, - NULL, NULL, "lAarr", "rAarr", NULL, "rarrw", NULL, NULL, + "lArr", "uArr", "rArr", "dArr", "hArr", NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 8672 (0x21e0) */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 8704 (0x2200) */ - "forall", "comp", "part", "exist", "nexist", "empty", NULL, "nabla", - "isin", "notin", "epsis", "ni", "notni", "bepsi", NULL, "prod", + "forall", NULL, "part", "exist", NULL, "empty", NULL, "nabla", + "isin", "notin", NULL, "ni", NULL, NULL, NULL, "prod", /* 8720 (0x2210) */ - "coprod", "sum", "minus", "mnplus", "plusdo", NULL, "setmn", "lowast", - "compfn", NULL, "radic", NULL, NULL, "prop", "infin", "ang90", + NULL, "sum", "minus", NULL, NULL, NULL, NULL, "lowast", + NULL, NULL, "radic", NULL, NULL, "prop", "infin", NULL, /* 8736 (0x2220) */ - "ang", "angmsd", "angsph", "mid", "nmid", "par", "npar", "and", - "or", "cap", "cup", "int", NULL, NULL, "conint", NULL, + "ang", NULL, NULL, NULL, NULL, NULL, NULL, "and", + "or", "cap", "cup", "int", NULL, NULL, NULL, NULL, /* 8752 (0x2230) */ - NULL, NULL, NULL, NULL, "there4", "becaus", NULL, NULL, - NULL, NULL, NULL, NULL, "sim", "bsim", NULL, NULL, + NULL, NULL, NULL, NULL, "there4", NULL, NULL, NULL, + NULL, NULL, NULL, NULL, "sim", NULL, NULL, NULL, /* 8768 (0x2240) */ - "wreath", "nsim", NULL, "sime", "nsime", "cong", NULL, "ncong", - "asymp", "nap", "ape", NULL, "bcong", "asymp", "bump", "bumpe", + NULL, NULL, NULL, NULL, NULL, "cong", NULL, NULL, + "asymp", NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 8784 (0x2250) */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 8800 (0x2260) */ - "ne", "equiv", NULL, NULL, "le", "ge", "lE", "gE", - "lnE", "gnE", "Lt", "Gt", "twixt", NULL, "nlt", "ngt", + "ne", "equiv", NULL, NULL, "le", "ge", NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 8816 (0x2270) */ - "nles", "nges", "lsim", "gsim", NULL, NULL, "lg", "gl", - NULL, NULL, "pr", "sc", "cupre", "sscue", "prsim", "scsim", + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 8832 (0x2280) */ - "npr", "nsc", "sub", "sup", "nsub", "nsup", "sube", "supe", + NULL, NULL, "sub", "sup", "nsub", NULL, "sube", "supe", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 8848 (0x2290) */ NULL, NULL, NULL, NULL, NULL, "oplus", NULL, "otimes", @@ -380,8 +380,8 @@ static entity_table_t ent_macroman[] = { struct html_entity_map { enum entity_charset charset; /* charset identifier */ - unsigned short basechar; /* char code at start of table */ - unsigned short endchar; /* last char code in the table */ + unsigned int basechar; /* char code at start of table */ + unsigned int endchar; /* last char code in the table */ entity_table_t *table; /* the table of mappings */ }; @@ -483,16 +483,31 @@ struct basic_entities_dec { } \ mbseq[mbpos++] = (mbchar); } +/* skip one byte and return */ +#define MB_FAILURE(pos) do { \ + *newpos = pos + 1; \ + *status = FAILURE; \ + return 0; \ +} while (0) + #define CHECK_LEN(pos, chars_need) \ - if((str_len - (pos)) < chars_need) { \ - *newpos = pos; \ - *status = FAILURE; \ - return 0; \ + if (chars_need < 1) { \ + if((str_len - (pos)) < chars_need) { \ + *newpos = pos; \ + *status = FAILURE; \ + return 0; \ + } \ + } else { \ + if((str_len - (pos)) < chars_need) { \ + *newpos = pos + 1; \ + *status = FAILURE; \ + return 0; \ + } \ } /* {{{ get_next_char */ -inline static unsigned short get_next_char(enum entity_charset charset, +inline static unsigned int get_next_char(enum entity_charset charset, unsigned char * str, int str_len, int * newpos, @@ -503,206 +518,191 @@ inline static unsigned short get_next_char(enum entity_charset charset, int pos = *newpos; int mbpos = 0; int mbspace = *mbseqlen; - unsigned short this_char = str[pos++]; + unsigned int this_char = 0; unsigned char next_char; *status = SUCCESS; - + if (mbspace <= 0) { *mbseqlen = 0; - return this_char; + CHECK_LEN(pos, 1); + *newpos = pos + 1; + return str[pos]; } - - MB_WRITE((unsigned char)this_char); - + switch (charset) { case cs_utf_8: { - unsigned long utf = 0; - int stat = 0; - int more = 1; - - /* unpack utf-8 encoding into a wide char. - * Code stolen from the mbstring extension */ - - do { + unsigned char c; + CHECK_LEN(pos, 1); + c = str[pos]; + if (c < 0x80) { + MB_WRITE(c); + this_char = c; + pos++; + } else if (c < 0xc0) { + MB_FAILURE(pos); + } else if (c < 0xe0) { + CHECK_LEN(pos, 2); + if (str[pos + 1] < 0x80 || str[pos + 1] > 0xbf) { + MB_FAILURE(pos); + } + this_char = ((c & 0x1f) << 6) | (str[pos + 1] & 0x3f); if (this_char < 0x80) { - more = 0; - if(stat) { - /* we didn't finish the UTF sequence correctly */ - --pos; - *status = FAILURE; - } - break; - } else if (this_char < 0xc0) { - switch (stat) { - case 0x10: /* 2, 2nd */ - case 0x21: /* 3, 3rd */ - case 0x32: /* 4, 4th */ - case 0x43: /* 5, 5th */ - case 0x54: /* 6, 6th */ - /* last byte in sequence */ - more = 0; - utf |= (this_char & 0x3f); - this_char = (unsigned short)utf; - break; - case 0x20: /* 3, 2nd */ - case 0x31: /* 4, 3rd */ - case 0x42: /* 5, 4th */ - case 0x53: /* 6, 5th */ - /* penultimate char */ - utf |= ((this_char & 0x3f) << 6); - stat++; - break; - case 0x30: /* 4, 2nd */ - case 0x41: /* 5, 3rd */ - case 0x52: /* 6, 4th */ - utf |= ((this_char & 0x3f) << 12); - stat++; - break; - case 0x40: /* 5, 2nd */ - case 0x51: - utf |= ((this_char & 0x3f) << 18); - stat++; - break; - case 0x50: /* 6, 2nd */ - utf |= ((this_char & 0x3f) << 24); - stat++; - break; - default: - /* invalid */ - *status = FAILURE; - more = 0; - } + MB_FAILURE(pos); } - /* lead byte */ - else if (this_char < 0xe0) { - stat = 0x10; /* 2 byte */ - utf = (this_char & 0x1f) << 6; - CHECK_LEN(pos, 1); - } else if (this_char < 0xf0) { - stat = 0x20; /* 3 byte */ - utf = (this_char & 0xf) << 12; - CHECK_LEN(pos, 2); - } else if (this_char < 0xf8) { - stat = 0x30; /* 4 byte */ - utf = (this_char & 0x7) << 18; - CHECK_LEN(pos, 3); - } else if (this_char < 0xfc) { - stat = 0x40; /* 5 byte */ - utf = (this_char & 0x3) << 24; - CHECK_LEN(pos, 4); - } else if (this_char < 0xfe) { - stat = 0x50; /* 6 byte */ - utf = (this_char & 0x1) << 30; - CHECK_LEN(pos, 5); - } else { - /* invalid; bail */ - more = 0; - *status = FAILURE; - break; + MB_WRITE((unsigned char)c); + MB_WRITE((unsigned char)str[pos + 1]); + pos += 2; + } else if (c < 0xf0) { + CHECK_LEN(pos, 3); + if (str[pos + 1] < 0x80 || str[pos + 1] > 0xbf) { + MB_FAILURE(pos); } - - if (more) { - this_char = str[pos++]; - MB_WRITE((unsigned char)this_char); + if (str[pos + 2] < 0x80 || str[pos + 2] > 0xbf) { + MB_FAILURE(pos); + } + this_char = ((c & 0x0f) << 12) | ((str[pos + 1] & 0x3f) << 6) | (str[pos + 2] & 0x3f); + if (this_char < 0x800) { + MB_FAILURE(pos); + } else if (this_char >= 0xd800 && this_char <= 0xdfff) { + MB_FAILURE(pos); } - } while (more); + MB_WRITE((unsigned char)c); + MB_WRITE((unsigned char)str[pos + 1]); + MB_WRITE((unsigned char)str[pos + 2]); + pos += 3; + } else if (c < 0xf8) { + CHECK_LEN(pos, 4); + if (str[pos + 1] < 0x80 || str[pos + 1] > 0xbf) { + MB_FAILURE(pos); + } + if (str[pos + 2] < 0x80 || str[pos + 2] > 0xbf) { + MB_FAILURE(pos); + } + if (str[pos + 3] < 0x80 || str[pos + 3] > 0xbf) { + MB_FAILURE(pos); + } + this_char = ((c & 0x07) << 18) | ((str[pos + 1] & 0x3f) << 12) | ((str[pos + 2] & 0x3f) << 6) | (str[pos + 3] & 0x3f); + if (this_char < 0x10000) { + MB_FAILURE(pos); + } + MB_WRITE((unsigned char)c); + MB_WRITE((unsigned char)str[pos + 1]); + MB_WRITE((unsigned char)str[pos + 2]); + MB_WRITE((unsigned char)str[pos + 3]); + pos += 4; + } else { + MB_FAILURE(pos); + } } break; case cs_big5: case cs_gb2312: case cs_big5hkscs: { + CHECK_LEN(pos, 1); + this_char = str[pos++]; /* check if this is the first of a 2-byte sequence */ - if (this_char >= 0xa1 && this_char <= 0xfe) { + if (this_char >= 0x81 && this_char <= 0xfe) { /* peek at the next char */ CHECK_LEN(pos, 1); - next_char = str[pos]; + next_char = str[pos++]; if ((next_char >= 0x40 && next_char <= 0x7e) || (next_char >= 0xa1 && next_char <= 0xfe)) { /* yes, this a wide char */ - this_char <<= 8; + MB_WRITE(this_char); MB_WRITE(next_char); - this_char |= next_char; - pos++; + this_char = (this_char << 8) | next_char; + } else { + MB_FAILURE(pos); } - + } else { + MB_WRITE(this_char); } - break; } + break; case cs_sjis: { + CHECK_LEN(pos, 1); + this_char = str[pos++]; /* check if this is the first of a 2-byte sequence */ - if ( (this_char >= 0x81 && this_char <= 0x9f) || - (this_char >= 0xe0 && this_char <= 0xef) - ) { + if ((this_char >= 0x81 && this_char <= 0x9f) || + (this_char >= 0xe0 && this_char <= 0xfc)) { /* peek at the next char */ CHECK_LEN(pos, 1); - next_char = str[pos]; + next_char = str[pos++]; if ((next_char >= 0x40 && next_char <= 0x7e) || (next_char >= 0x80 && next_char <= 0xfc)) { /* yes, this a wide char */ - this_char <<= 8; + MB_WRITE(this_char); MB_WRITE(next_char); - this_char |= next_char; - pos++; + this_char = (this_char << 8) | next_char; + } else { + MB_FAILURE(pos); } - + } else { + MB_WRITE(this_char); } break; } case cs_eucjp: { + CHECK_LEN(pos, 1); + this_char = str[pos++]; /* check if this is the first of a multi-byte sequence */ if (this_char >= 0xa1 && this_char <= 0xfe) { /* peek at the next char */ CHECK_LEN(pos, 1); - next_char = str[pos]; + next_char = str[pos++]; if (next_char >= 0xa1 && next_char <= 0xfe) { /* yes, this a jis kanji char */ - this_char <<= 8; + MB_WRITE(this_char); MB_WRITE(next_char); - this_char |= next_char; - pos++; + this_char = (this_char << 8) | next_char; + } else { + MB_FAILURE(pos); } - } else if (this_char == 0x8e) { /* peek at the next char */ CHECK_LEN(pos, 1); - next_char = str[pos]; + next_char = str[pos++]; if (next_char >= 0xa1 && next_char <= 0xdf) { /* JIS X 0201 kana */ - this_char <<= 8; + MB_WRITE(this_char); MB_WRITE(next_char); - this_char |= next_char; - pos++; + this_char = (this_char << 8) | next_char; + } else { + MB_FAILURE(pos); } - } else if (this_char == 0x8f) { /* peek at the next two char */ unsigned char next2_char; CHECK_LEN(pos, 2); next_char = str[pos]; - next2_char = str[pos+1]; + next2_char = str[pos + 1]; + pos += 2; if ((next_char >= 0xa1 && next_char <= 0xfe) && (next2_char >= 0xa1 && next2_char <= 0xfe)) { /* JIS X 0212 hojo-kanji */ - this_char <<= 8; + MB_WRITE(this_char); MB_WRITE(next_char); - this_char |= next_char; - pos++; - this_char <<= 8; MB_WRITE(next2_char); - this_char |= next2_char; - pos++; + this_char = (this_char << 16) | (next_char << 8) | next2_char; + } else { + MB_FAILURE(pos); } - + } else { + MB_WRITE(this_char); } break; } default: + /* single-byte charsets */ + CHECK_LEN(pos, 1); + this_char = str[pos++]; + MB_WRITE(this_char); break; } MB_RETURN; @@ -1133,7 +1133,7 @@ PHPAPI char *php_escape_html_entities_ex(unsigned char *old, int oldlen, int *ne unsigned char mbsequence[16]; /* allow up to 15 characters in a multibyte sequence */ int mbseqlen = sizeof(mbsequence); int status = SUCCESS; - unsigned short this_char = get_next_char(charset, old, oldlen, &i, mbsequence, &mbseqlen, &status); + unsigned int this_char = get_next_char(charset, old, oldlen, &i, mbsequence, &mbseqlen, &status); if(status == FAILURE) { /* invalid MB sequence */ diff --git a/ext/standard/html.h b/ext/standard/html.h index 9cd9e8b04..86bae2d20 100644 --- a/ext/standard/html.h +++ b/ext/standard/html.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: html.h 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: html.h 293036 2010-01-03 09:23:27Z sebastian $ */ #ifndef HTML_H #define HTML_H diff --git a/ext/standard/http.c b/ext/standard/http.c index e3ee24ff0..3f57bbeb5 100644 --- a/ext/standard/http.c +++ b/ext/standard/http.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: http.c 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: http.c 293036 2010-01-03 09:23:27Z sebastian $ */ #include "php_http.h" #include "php_ini.h" diff --git a/ext/standard/http_fopen_wrapper.c b/ext/standard/http_fopen_wrapper.c index c1757d114..5a30d7fa2 100644 --- a/ext/standard/http_fopen_wrapper.c +++ b/ext/standard/http_fopen_wrapper.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -19,7 +19,7 @@ | Sara Golemon <pollita@php.net> | +----------------------------------------------------------------------+ */ -/* $Id: http_fopen_wrapper.c 286790 2009-08-04 09:24:48Z tony2001 $ */ +/* $Id: http_fopen_wrapper.c 294506 2010-02-04 09:17:20Z pajoye $ */ #include "php.h" #include "php_globals.h" @@ -416,15 +416,19 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path, } /* auth header if it was specified */ - if (((have_header & HTTP_HEADER_AUTH) == 0) && resource->user && resource->pass) { + if (((have_header & HTTP_HEADER_AUTH) == 0) && resource->user) { /* decode the strings first */ php_url_decode(resource->user, strlen(resource->user)); - php_url_decode(resource->pass, strlen(resource->pass)); /* scratch is large enough, since it was made large enough for the whole URL */ strcpy(scratch, resource->user); strcat(scratch, ":"); - strcat(scratch, resource->pass); + + /* Note: password is optional! */ + if (resource->pass) { + php_url_decode(resource->pass, strlen(resource->pass)); + strcat(scratch, resource->pass); + } tmp = (char*)php_base64_encode((unsigned char*)scratch, strlen(scratch), NULL); @@ -610,6 +614,13 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path, size_t http_header_line_length; if (php_stream_get_line(stream, http_header_line, HTTP_HEADER_BLOCK_SIZE, &http_header_line_length) && *http_header_line != '\n' && *http_header_line != '\r') { char *e = http_header_line + http_header_line_length - 1; + if (*e != '\n') { + do { /* partial header */ + php_stream_get_line(stream, http_header_line, HTTP_HEADER_BLOCK_SIZE, &http_header_line_length); + e = http_header_line + http_header_line_length - 1; + } while (*e != '\n'); + continue; + } while (*e == '\n' || *e == '\r') { e--; } @@ -739,7 +750,7 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path, s++; \ } \ } \ -} \ +} /* check for control characters in login, password & path */ if (strncasecmp(new_path, "http://", sizeof("http://") - 1) || strncasecmp(new_path, "https://", sizeof("https://") - 1)) { CHECK_FOR_CNTRL_CHARS(resource->user) diff --git a/ext/standard/image.c b/ext/standard/image.c index b6d41f43b..689f4a85a 100644 --- a/ext/standard/image.c +++ b/ext/standard/image.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: image.c 277324 2009-03-17 03:25:57Z scottmac $ */ +/* $Id: image.c 293036 2010-01-03 09:23:27Z sebastian $ */ #include "php.h" #include <stdio.h> diff --git a/ext/standard/incomplete_class.c b/ext/standard/incomplete_class.c index d66921e83..e64365f3f 100644 --- a/ext/standard/incomplete_class.c +++ b/ext/standard/incomplete_class.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: incomplete_class.c 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: incomplete_class.c 293036 2010-01-03 09:23:27Z sebastian $ */ #include "php.h" #include "basic_functions.h" diff --git a/ext/standard/info.c b/ext/standard/info.c index fd5eeacfd..7746d0658 100644 --- a/ext/standard/info.c +++ b/ext/standard/info.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: info.c 289430 2009-10-09 17:15:46Z pajoye $ */ +/* $Id: info.c 293036 2010-01-03 09:23:27Z sebastian $ */ #include "php.h" #include "php_ini.h" diff --git a/ext/standard/info.h b/ext/standard/info.h index 173415b58..4eaf06e1f 100644 --- a/ext/standard/info.h +++ b/ext/standard/info.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: info.h 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: info.h 293036 2010-01-03 09:23:27Z sebastian $ */ #ifndef INFO_H #define INFO_H diff --git a/ext/standard/iptc.c b/ext/standard/iptc.c index 93b144ce8..b5c0b2507 100644 --- a/ext/standard/iptc.c +++ b/ext/standard/iptc.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: iptc.c 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: iptc.c 293036 2010-01-03 09:23:27Z sebastian $ */ /* * Functions to parse & compse IPTC data. diff --git a/ext/standard/lcg.c b/ext/standard/lcg.c index 385015191..ae94f48e5 100644 --- a/ext/standard/lcg.c +++ b/ext/standard/lcg.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: lcg.c 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: lcg.c 294448 2010-02-03 20:10:35Z pajoye $ */ #include "php.h" #include "php_lcg.h" @@ -78,7 +78,7 @@ static void lcg_seed(TSRMLS_D) /* {{{ */ struct timeval tv; if (gettimeofday(&tv, NULL) == 0) { - LCG(s1) = tv.tv_sec ^ (~tv.tv_usec); + LCG(s1) = tv.tv_sec ^ (tv.tv_usec<<11); } else { LCG(s1) = 1; } @@ -88,6 +88,11 @@ static void lcg_seed(TSRMLS_D) /* {{{ */ LCG(s2) = (long) getpid(); #endif + /* Add entropy to s2 by calling gettimeofday() again */ + if (gettimeofday(&tv, NULL) == 0) { + LCG(s2) ^= (tv.tv_usec<<11); + } + LCG(seeded) = 1; } /* }}} */ diff --git a/ext/standard/levenshtein.c b/ext/standard/levenshtein.c index b02dcc5cb..8a3b74702 100644 --- a/ext/standard/levenshtein.c +++ b/ext/standard/levenshtein.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -15,7 +15,7 @@ | Author: Hartmut Holzgraefe <hholzgra@php.net> | +----------------------------------------------------------------------+ */ -/* $Id: levenshtein.c 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: levenshtein.c 293036 2010-01-03 09:23:27Z sebastian $ */ #include "php.h" #include <stdlib.h> diff --git a/ext/standard/link.c b/ext/standard/link.c index 923622147..ac45b4bde 100644 --- a/ext/standard/link.c +++ b/ext/standard/link.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: link.c 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: link.c 293036 2010-01-03 09:23:27Z sebastian $ */ #include "php.h" #include "php_filestat.h" diff --git a/ext/standard/link_win32.c b/ext/standard/link_win32.c index 97c7cb718..f7f58039e 100644 --- a/ext/standard/link_win32.c +++ b/ext/standard/link_win32.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: link_win32.c 287813 2009-08-27 14:45:41Z pajoye $ */ +/* $Id: link_win32.c 293036 2010-01-03 09:23:27Z sebastian $ */ #ifdef PHP_WIN32 #include "php.h" diff --git a/ext/standard/mail.c b/ext/standard/mail.c index 2825881b4..09fa2ef94 100644 --- a/ext/standard/mail.c +++ b/ext/standard/mail.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: mail.c 282504 2009-06-21 15:29:16Z iliaa $ */ +/* $Id: mail.c 294548 2010-02-05 00:19:32Z pajoye $ */ #include <stdlib.h> #include <ctype.h> @@ -241,7 +241,7 @@ PHPAPI int php_mail(char *to, char *subject, char *message, char *headers, char php_basename(tmp, strlen(tmp), NULL, 0,&f, &f_len TSRMLS_CC); if (headers != NULL) { - spprintf(&hdr, 0, "X-PHP-Originating-Script: %ld:%s\r\n%s", php_getuid(), f, headers); + spprintf(&hdr, 0, "X-PHP-Originating-Script: %ld:%s\n%s", php_getuid(), f, headers); } else { spprintf(&hdr, 0, "X-PHP-Originating-Script: %ld:%s\n", php_getuid(), f); } diff --git a/ext/standard/math.c b/ext/standard/math.c index 89b7fcfb2..8a3949e20 100644 --- a/ext/standard/math.c +++ b/ext/standard/math.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -19,7 +19,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: math.c 277398 2009-03-18 10:18:10Z dmitry $ */ +/* $Id: math.c 293036 2010-01-03 09:23:27Z sebastian $ */ #include "php.h" #include "php_math.h" diff --git a/ext/standard/md5.c b/ext/standard/md5.c index 5ddd40f8a..e84fe4b7e 100644 --- a/ext/standard/md5.c +++ b/ext/standard/md5.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: md5.c 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: md5.c 293036 2010-01-03 09:23:27Z sebastian $ */ #include "php.h" #include "md5.h" diff --git a/ext/standard/md5.h b/ext/standard/md5.h index f9d55aba1..b976752b7 100644 --- a/ext/standard/md5.h +++ b/ext/standard/md5.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: md5.h 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: md5.h 293036 2010-01-03 09:23:27Z sebastian $ */ #ifndef MD5_H #define MD5_H diff --git a/ext/standard/metaphone.c b/ext/standard/metaphone.c index 06186d07f..bf1067130 100644 --- a/ext/standard/metaphone.c +++ b/ext/standard/metaphone.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: metaphone.c 283127 2009-06-30 11:46:20Z felipe $ */ +/* $Id: metaphone.c 293036 2010-01-03 09:23:27Z sebastian $ */ /* Based on CPANs "Text-Metaphone-1.96" by Michael G Schwern <schwern@pobox.com> diff --git a/ext/standard/microtime.c b/ext/standard/microtime.c index 9a7c179f5..116fb02a1 100644 --- a/ext/standard/microtime.c +++ b/ext/standard/microtime.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: microtime.c 280906 2009-05-21 14:21:40Z lbarnaud $ */ +/* $Id: microtime.c 293036 2010-01-03 09:23:27Z sebastian $ */ #include "php.h" diff --git a/ext/standard/microtime.h b/ext/standard/microtime.h index 8838d2ca2..419150d8b 100644 --- a/ext/standard/microtime.h +++ b/ext/standard/microtime.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: microtime.h 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: microtime.h 293036 2010-01-03 09:23:27Z sebastian $ */ #ifndef MICROTIME_H #define MICROTIME_H diff --git a/ext/standard/pack.c b/ext/standard/pack.c index 4aa4d5649..0723ece75 100644 --- a/ext/standard/pack.c +++ b/ext/standard/pack.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -15,7 +15,7 @@ | Author: Chris Schneider <cschneid@relog.ch> | +----------------------------------------------------------------------+ */ -/* $Id: pack.c 287647 2009-08-24 18:40:13Z iliaa $ */ +/* $Id: pack.c 293036 2010-01-03 09:23:27Z sebastian $ */ #include "php.h" diff --git a/ext/standard/pack.h b/ext/standard/pack.h index 70d37151e..ba5899727 100644 --- a/ext/standard/pack.h +++ b/ext/standard/pack.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: pack.h 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: pack.h 293036 2010-01-03 09:23:27Z sebastian $ */ #ifndef PACK_H #define PACK_H diff --git a/ext/standard/pageinfo.c b/ext/standard/pageinfo.c index 89022c7c1..a1b323b08 100644 --- a/ext/standard/pageinfo.c +++ b/ext/standard/pageinfo.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: pageinfo.c 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: pageinfo.c 293036 2010-01-03 09:23:27Z sebastian $ */ #include "php.h" #include "pageinfo.h" @@ -68,11 +68,7 @@ PHPAPI void php_statpage(TSRMLS_D) BG(page_uid) = pstat->st_uid; BG(page_gid) = pstat->st_gid; BG(page_inode) = pstat->st_ino; -#ifdef NETWARE - BG(page_mtime) = (pstat->st_mtime).tv_sec; -#else BG(page_mtime) = pstat->st_mtime; -#endif } else { /* handler for situations where there is no source file, ex. php -r */ BG(page_uid) = getuid(); BG(page_gid) = getgid(); diff --git a/ext/standard/pageinfo.h b/ext/standard/pageinfo.h index 5722beded..0405de23f 100644 --- a/ext/standard/pageinfo.h +++ b/ext/standard/pageinfo.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: pageinfo.h 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: pageinfo.h 293036 2010-01-03 09:23:27Z sebastian $ */ #ifndef PAGEINFO_H #define PAGEINFO_H diff --git a/ext/standard/php_array.h b/ext/standard/php_array.h index 76a5a66d0..92a4f2267 100644 --- a/ext/standard/php_array.h +++ b/ext/standard/php_array.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -19,7 +19,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_array.h 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: php_array.h 293036 2010-01-03 09:23:27Z sebastian $ */ #ifndef PHP_ARRAY_H #define PHP_ARRAY_H diff --git a/ext/standard/php_assert.h b/ext/standard/php_assert.h index f8a634a16..bf4de1a86 100644 --- a/ext/standard/php_assert.h +++ b/ext/standard/php_assert.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_assert.h 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: php_assert.h 293036 2010-01-03 09:23:27Z sebastian $ */ #ifndef PHP_ASSERT_H #define PHP_ASSERT_H diff --git a/ext/standard/php_browscap.h b/ext/standard/php_browscap.h index 4107a4bd2..c26098a93 100644 --- a/ext/standard/php_browscap.h +++ b/ext/standard/php_browscap.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_browscap.h 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: php_browscap.h 293036 2010-01-03 09:23:27Z sebastian $ */ #ifndef PHP_BROWSCAP_H #define PHP_BROWSCAP_H diff --git a/ext/standard/php_crypt.h b/ext/standard/php_crypt.h index 8b06dadc3..c0dafe631 100644 --- a/ext/standard/php_crypt.h +++ b/ext/standard/php_crypt.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_crypt.h 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: php_crypt.h 293036 2010-01-03 09:23:27Z sebastian $ */ #ifndef PHP_CRYPT_H #define PHP_CRYPT_H diff --git a/ext/standard/php_crypt_r.c b/ext/standard/php_crypt_r.c index d1e0cda7f..3d9d0229d 100644 --- a/ext/standard/php_crypt_r.c +++ b/ext/standard/php_crypt_r.c @@ -1,9 +1,9 @@ -/* $Id: php_crypt_r.c 290154 2009-11-02 20:46:52Z pajoye $ */ +/* $Id: php_crypt_r.c 293036 2010-01-03 09:23:27Z sebastian $ */ /* +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/standard/php_crypt_r.h b/ext/standard/php_crypt_r.h index 57143dbcc..e5fbf2601 100644 --- a/ext/standard/php_crypt_r.h +++ b/ext/standard/php_crypt_r.h @@ -1,9 +1,9 @@ -/* $Id: php_crypt_r.h 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: php_crypt_r.h 293036 2010-01-03 09:23:27Z sebastian $ */ /* +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -49,6 +49,8 @@ PHPAPI char *php_crypt_r (const char *__key, const char *__salt, struct php_cryp extern char * php_md5_crypt_r(const char *pw, const char *salt, char *out); extern char * php_crypt_blowfish_rn(__CONST char *key, __CONST char *setting, char *output, int size); +extern char * php_sha512_crypt_r (const char *key, const char *salt, char *buffer, int buflen); +extern char * php_sha256_crypt_r (const char *key, const char *salt, char *buffer, int buflen); #ifdef __cplusplus } diff --git a/ext/standard/php_dir.h b/ext/standard/php_dir.h index edc76158d..5e80f3e6d 100644 --- a/ext/standard/php_dir.h +++ b/ext/standard/php_dir.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_dir.h 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: php_dir.h 293036 2010-01-03 09:23:27Z sebastian $ */ #ifndef PHP_DIR_H #define PHP_DIR_H diff --git a/ext/standard/php_dns.h b/ext/standard/php_dns.h index 2fa6746b0..95900ae64 100644 --- a/ext/standard/php_dns.h +++ b/ext/standard/php_dns.h @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_dns.h 287120 2009-08-11 22:07:35Z scottmac $ */ +/* $Id: php_dns.h 289691 2009-10-16 02:10:52Z scottmac $ */ #ifndef PHP_DNS_H #define PHP_DNS_H @@ -28,8 +28,6 @@ ((int)dns_search(res, dname, class, type, answer, anslen, (struct sockaddr *)&from, &fromsize)) #define php_dns_free_handle(res) \ dns_free(res) -#define php_dns_errno(_res) \ - (NO_DATA) #elif defined(HAVE_RES_NSEARCH) #define php_dns_search(res, dname, class, type, answer, anslen) \ @@ -37,15 +35,11 @@ #define php_dns_free_handle(res) \ res_nclose(res); \ php_dns_free_res(*res) -#define php_dns_errno(res) \ - (res->res_h_errno) #elif defined(HAVE_RES_SEARCH) #define php_dns_search(res, dname, class, type, answer, anslen) \ res_search(dname, class, type, answer, anslen) #define php_dns_free_handle(res) /* noop */ -#define php_dns_errno(res) \ - (_res.res_h_errno) #endif diff --git a/ext/standard/php_ext_syslog.h b/ext/standard/php_ext_syslog.h index 0b6e3af03..353c24e81 100644 --- a/ext/standard/php_ext_syslog.h +++ b/ext/standard/php_ext_syslog.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_ext_syslog.h 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: php_ext_syslog.h 293036 2010-01-03 09:23:27Z sebastian $ */ #ifndef PHP_EXT_SYSLOG_H #define PHP_EXT_SYSLOG_H diff --git a/ext/standard/php_filestat.h b/ext/standard/php_filestat.h index 49810550f..7eee0fa2c 100644 --- a/ext/standard/php_filestat.h +++ b/ext/standard/php_filestat.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_filestat.h 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: php_filestat.h 293036 2010-01-03 09:23:27Z sebastian $ */ #ifndef PHP_FILESTAT_H #define PHP_FILESTAT_H @@ -24,6 +24,8 @@ PHP_RINIT_FUNCTION(filestat); PHP_RSHUTDOWN_FUNCTION(filestat); +PHP_FUNCTION(realpath_cache_size); +PHP_FUNCTION(realpath_cache_get); PHP_FUNCTION(clearstatcache); PHP_FUNCTION(fileatime); PHP_FUNCTION(filectime); diff --git a/ext/standard/php_fopen_wrapper.c b/ext/standard/php_fopen_wrapper.c index f3dbf91ad..808a973a9 100644 --- a/ext/standard/php_fopen_wrapper.c +++ b/ext/standard/php_fopen_wrapper.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -17,7 +17,7 @@ | Hartmut Holzgraefe <hholzgra@php.net> | +----------------------------------------------------------------------+ */ -/* $Id: php_fopen_wrapper.c 287507 2009-08-20 12:40:15Z jani $ */ +/* $Id: php_fopen_wrapper.c 293036 2010-01-03 09:23:27Z sebastian $ */ #include <stdio.h> #include <stdlib.h> diff --git a/ext/standard/php_fopen_wrappers.h b/ext/standard/php_fopen_wrappers.h index 7709e3e0b..d9dee9494 100644 --- a/ext/standard/php_fopen_wrappers.h +++ b/ext/standard/php_fopen_wrappers.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_fopen_wrappers.h 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: php_fopen_wrappers.h 293036 2010-01-03 09:23:27Z sebastian $ */ #ifndef PHP_FOPEN_WRAPPERS_H #define PHP_FOPEN_WRAPPERS_H diff --git a/ext/standard/php_ftok.h b/ext/standard/php_ftok.h index c7e4018d7..ac023b778 100644 --- a/ext/standard/php_ftok.h +++ b/ext/standard/php_ftok.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_ftok.h 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: php_ftok.h 293036 2010-01-03 09:23:27Z sebastian $ */ #ifndef PHP_FTOK_H #define PHP_FTOK_H diff --git a/ext/standard/php_http.h b/ext/standard/php_http.h index 6de68b4a1..f0ed15f20 100644 --- a/ext/standard/php_http.h +++ b/ext/standard/php_http.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_http.h 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: php_http.h 293036 2010-01-03 09:23:27Z sebastian $ */ #ifndef PHP_HTTP_H #define PHP_HTTP_H diff --git a/ext/standard/php_image.h b/ext/standard/php_image.h index f699dbbee..093980ae0 100644 --- a/ext/standard/php_image.h +++ b/ext/standard/php_image.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_image.h 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: php_image.h 293036 2010-01-03 09:23:27Z sebastian $ */ #ifndef PHP_IMAGE_H #define PHP_IMAGE_H diff --git a/ext/standard/php_incomplete_class.h b/ext/standard/php_incomplete_class.h index d84e7a530..3ec93c704 100644 --- a/ext/standard/php_incomplete_class.h +++ b/ext/standard/php_incomplete_class.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_incomplete_class.h 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: php_incomplete_class.h 293036 2010-01-03 09:23:27Z sebastian $ */ #ifndef PHP_INCOMPLETE_CLASS_H #define PHP_INCOMPLETE_CLASS_H diff --git a/ext/standard/php_iptc.h b/ext/standard/php_iptc.h index 7a4e3cedc..e47753c09 100644 --- a/ext/standard/php_iptc.h +++ b/ext/standard/php_iptc.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_iptc.h 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: php_iptc.h 293036 2010-01-03 09:23:27Z sebastian $ */ #ifndef PHP_IPTC_H #define PHP_IPTC_H diff --git a/ext/standard/php_lcg.h b/ext/standard/php_lcg.h index 58b7d3347..8ccd218f8 100644 --- a/ext/standard/php_lcg.h +++ b/ext/standard/php_lcg.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_lcg.h 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: php_lcg.h 293036 2010-01-03 09:23:27Z sebastian $ */ #ifndef PHP_LCG_H #define PHP_LCG_H diff --git a/ext/standard/php_link.h b/ext/standard/php_link.h index 8c63be632..916029da7 100644 --- a/ext/standard/php_link.h +++ b/ext/standard/php_link.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_link.h 273611 2009-01-16 01:00:22Z pajoye $ */ +/* $Id: php_link.h 293036 2010-01-03 09:23:27Z sebastian $ */ #ifndef PHP_LINK_H #define PHP_LINK_H diff --git a/ext/standard/php_mail.h b/ext/standard/php_mail.h index a3516dccb..e8d3875ec 100644 --- a/ext/standard/php_mail.h +++ b/ext/standard/php_mail.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_mail.h 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: php_mail.h 293036 2010-01-03 09:23:27Z sebastian $ */ #ifndef PHP_MAIL_H #define PHP_MAIL_H diff --git a/ext/standard/php_math.h b/ext/standard/php_math.h index f130e2f4e..1d124f0d0 100644 --- a/ext/standard/php_math.h +++ b/ext/standard/php_math.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_math.h 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: php_math.h 293036 2010-01-03 09:23:27Z sebastian $ */ #ifndef PHP_MATH_H #define PHP_MATH_H diff --git a/ext/standard/php_metaphone.h b/ext/standard/php_metaphone.h index 622aa31cc..da8c67b95 100644 --- a/ext/standard/php_metaphone.h +++ b/ext/standard/php_metaphone.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_metaphone.h 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: php_metaphone.h 293036 2010-01-03 09:23:27Z sebastian $ */ #ifndef PHP_METAPHONE_H #define PHP_METAPHONE_H diff --git a/ext/standard/php_rand.h b/ext/standard/php_rand.h index 220f436d5..887ac7058 100644 --- a/ext/standard/php_rand.h +++ b/ext/standard/php_rand.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -20,7 +20,7 @@ | Based on code from: Shawn Cokus <Cokus@math.washington.edu> | +----------------------------------------------------------------------+ */ -/* $Id: php_rand.h 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: php_rand.h 293036 2010-01-03 09:23:27Z sebastian $ */ #ifndef PHP_RAND_H #define PHP_RAND_H diff --git a/ext/standard/php_smart_str.h b/ext/standard/php_smart_str.h index 298997873..8dd964716 100644 --- a/ext/standard/php_smart_str.h +++ b/ext/standard/php_smart_str.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_smart_str.h 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: php_smart_str.h 293036 2010-01-03 09:23:27Z sebastian $ */ #ifndef PHP_SMART_STR_H #define PHP_SMART_STR_H diff --git a/ext/standard/php_smart_str_public.h b/ext/standard/php_smart_str_public.h index e189549fd..c851fac39 100644 --- a/ext/standard/php_smart_str_public.h +++ b/ext/standard/php_smart_str_public.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_smart_str_public.h 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: php_smart_str_public.h 293036 2010-01-03 09:23:27Z sebastian $ */ #ifndef PHP_SMART_STR_PUBLIC_H #define PHP_SMART_STR_PUBLIC_H diff --git a/ext/standard/php_standard.h b/ext/standard/php_standard.h index 005fa2972..447f6d7f1 100644 --- a/ext/standard/php_standard.h +++ b/ext/standard/php_standard.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_standard.h 286857 2009-08-05 23:20:17Z scottmac $ */ +/* $Id: php_standard.h 293036 2010-01-03 09:23:27Z sebastian $ */ #include "basic_functions.h" #include "php_math.h" diff --git a/ext/standard/php_string.h b/ext/standard/php_string.h index 4d85671a2..fd3c8b5e4 100644 --- a/ext/standard/php_string.h +++ b/ext/standard/php_string.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_string.h 287198 2009-08-13 06:44:50Z stas $ */ +/* $Id: php_string.h 293036 2010-01-03 09:23:27Z sebastian $ */ /* Synced with php 3.0 revision 1.43 1999-06-16 [ssb] */ diff --git a/ext/standard/php_type.h b/ext/standard/php_type.h index 9a8ae44fd..550d4d545 100644 --- a/ext/standard/php_type.h +++ b/ext/standard/php_type.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_type.h 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: php_type.h 293036 2010-01-03 09:23:27Z sebastian $ */ #ifndef PHP_TYPE_H #define PHP_TYPE_H diff --git a/ext/standard/php_uuencode.h b/ext/standard/php_uuencode.h index b722e1be3..d6432a6ce 100644 --- a/ext/standard/php_uuencode.h +++ b/ext/standard/php_uuencode.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_uuencode.h 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: php_uuencode.h 293036 2010-01-03 09:23:27Z sebastian $ */ #ifndef PHP_UUENCODE_H #define PHP_UUENCODE_H diff --git a/ext/standard/php_var.h b/ext/standard/php_var.h index 442762d40..76546f3bf 100644 --- a/ext/standard/php_var.h +++ b/ext/standard/php_var.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_var.h 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: php_var.h 293036 2010-01-03 09:23:27Z sebastian $ */ #ifndef PHP_VAR_H #define PHP_VAR_H diff --git a/ext/standard/php_versioning.h b/ext/standard/php_versioning.h index ecfd9483b..6a91e6152 100644 --- a/ext/standard/php_versioning.h +++ b/ext/standard/php_versioning.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_versioning.h 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: php_versioning.h 293036 2010-01-03 09:23:27Z sebastian $ */ #ifndef PHP_VERSIONING_H #define PHP_VERSIONING_H diff --git a/ext/standard/proc_open.c b/ext/standard/proc_open.c index d7dbccdf8..afb507144 100644 --- a/ext/standard/proc_open.c +++ b/ext/standard/proc_open.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -15,7 +15,7 @@ | Author: Wez Furlong <wez@thebrainroom.com> | +----------------------------------------------------------------------+ */ -/* $Id: proc_open.c 286752 2009-08-03 19:05:56Z felipe $ */ +/* $Id: proc_open.c 293036 2010-01-03 09:23:27Z sebastian $ */ #if 0 && (defined(__linux__) || defined(sun) || defined(__IRIX__)) # define _BSD_SOURCE /* linux wants this when XOPEN mode is on */ diff --git a/ext/standard/proc_open.h b/ext/standard/proc_open.h index 473c9f047..40249f211 100644 --- a/ext/standard/proc_open.h +++ b/ext/standard/proc_open.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -15,7 +15,7 @@ | Author: Wez Furlong <wez@thebrainroom.com> | +----------------------------------------------------------------------+ */ -/* $Id: proc_open.h 284431 2009-07-20 11:48:04Z gwynne $ */ +/* $Id: proc_open.h 293036 2010-01-03 09:23:27Z sebastian $ */ #ifdef PHP_WIN32 typedef HANDLE php_file_descriptor_t; diff --git a/ext/standard/quot_print.c b/ext/standard/quot_print.c index c24ed0bb2..7f0fae072 100644 --- a/ext/standard/quot_print.c +++ b/ext/standard/quot_print.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: quot_print.c 272979 2009-01-07 17:20:18Z felipe $ */ +/* $Id: quot_print.c 293036 2010-01-03 09:23:27Z sebastian $ */ #include <stdlib.h> diff --git a/ext/standard/quot_print.h b/ext/standard/quot_print.h index 8f25c0b8b..4a769e0dd 100644 --- a/ext/standard/quot_print.h +++ b/ext/standard/quot_print.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: quot_print.h 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: quot_print.h 293036 2010-01-03 09:23:27Z sebastian $ */ #ifndef QUOT_PRINT_H #define QUOT_PRINT_H diff --git a/ext/standard/rand.c b/ext/standard/rand.c index 4b1cac36b..db5523a7b 100644 --- a/ext/standard/rand.c +++ b/ext/standard/rand.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -23,7 +23,7 @@ | Shawn Cokus <Cokus@math.washington.edu> | +----------------------------------------------------------------------+ */ -/* $Id: rand.c 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: rand.c 293036 2010-01-03 09:23:27Z sebastian $ */ #include <stdlib.h> diff --git a/ext/standard/scanf.c b/ext/standard/scanf.c index 093c08a47..81a49e42b 100644 --- a/ext/standard/scanf.c +++ b/ext/standard/scanf.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: scanf.c 278157 2009-04-02 05:17:36Z kalle $ */ +/* $Id: scanf.c 293036 2010-01-03 09:23:27Z sebastian $ */ /* scanf.c -- diff --git a/ext/standard/scanf.h b/ext/standard/scanf.h index b1fbd49a7..46243bd33 100644 --- a/ext/standard/scanf.h +++ b/ext/standard/scanf.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: scanf.h 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: scanf.h 293036 2010-01-03 09:23:27Z sebastian $ */ #ifndef SCANF_H #define SCANF_H diff --git a/ext/standard/sha1.c b/ext/standard/sha1.c index 09c194353..084de7f1e 100644 --- a/ext/standard/sha1.c +++ b/ext/standard/sha1.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: sha1.c 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: sha1.c 293036 2010-01-03 09:23:27Z sebastian $ */ #include "php.h" diff --git a/ext/standard/sha1.h b/ext/standard/sha1.h index 885d98858..cd7e63106 100644 --- a/ext/standard/sha1.h +++ b/ext/standard/sha1.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: sha1.h 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: sha1.h 293036 2010-01-03 09:23:27Z sebastian $ */ #ifndef SHA1_H #define SHA1_H diff --git a/ext/standard/soundex.c b/ext/standard/soundex.c index aa42d9558..d22d36191 100644 --- a/ext/standard/soundex.c +++ b/ext/standard/soundex.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -15,7 +15,7 @@ | Author: Bjørn Borud - Guardian Networks AS <borud@guardian.no> | +----------------------------------------------------------------------+ */ -/* $Id: soundex.c 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: soundex.c 293036 2010-01-03 09:23:27Z sebastian $ */ #include "php.h" #include <stdlib.h> diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c index b57c7f9ae..a0300606f 100644 --- a/ext/standard/streamsfuncs.c +++ b/ext/standard/streamsfuncs.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: streamsfuncs.c 286744 2009-08-03 15:58:18Z felipe $ */ +/* $Id: streamsfuncs.c 293995 2010-01-25 15:57:24Z johannes $ */ #include "php.h" #include "php_globals.h" @@ -484,9 +484,7 @@ PHP_FUNCTION(stream_get_meta_data) if (stream->wrapperdata) { MAKE_STD_ZVAL(newval); - *newval = *(stream->wrapperdata); - zval_copy_ctor(newval); - INIT_PZVAL(newval); + MAKE_COPY_ZVAL(&stream->wrapperdata, newval); add_assoc_zval(return_value, "wrapper_data", newval); } @@ -1444,6 +1442,26 @@ PHP_FUNCTION(stream_socket_enable_crypto) } /* }}} */ +/* {{{ proto string stream_resolve_include_path(string filename) +Determine what file will be opened by calls to fopen() with a relative path */ +PHP_FUNCTION(stream_resolve_include_path) +{ + char *filename, *resolved_path; + int filename_len; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) { + return; + } + + resolved_path = zend_resolve_path(filename, filename_len TSRMLS_CC); + + if (resolved_path) { + RETURN_STRING(resolved_path, 0); + } + RETURN_FALSE; +} +/* }}} */ + /* {{{ proto bool stream_is_local(resource stream|string url) U */ PHP_FUNCTION(stream_is_local) diff --git a/ext/standard/streamsfuncs.h b/ext/standard/streamsfuncs.h index 4519520ac..e4e20e123 100644 --- a/ext/standard/streamsfuncs.h +++ b/ext/standard/streamsfuncs.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: streamsfuncs.h 274392 2009-01-23 15:49:49Z kalle $ */ +/* $Id: streamsfuncs.h 293995 2010-01-25 15:57:24Z johannes $ */ /* Flags for stream_socket_client */ #define PHP_STREAM_CLIENT_PERSISTENT 1 @@ -56,6 +56,7 @@ PHP_FUNCTION(stream_filter_append); PHP_FUNCTION(stream_filter_remove); PHP_FUNCTION(stream_socket_enable_crypto); PHP_FUNCTION(stream_socket_shutdown); +PHP_FUNCTION(stream_resolve_include_path); PHP_FUNCTION(stream_is_local); PHP_FUNCTION(stream_supports_lock); diff --git a/ext/standard/string.c b/ext/standard/string.c index 88d3add13..2ebd18a04 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: string.c 287916 2009-08-31 12:28:46Z iliaa $ */ +/* $Id: string.c 294517 2010-02-04 09:44:16Z pajoye $ */ /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */ @@ -3530,9 +3530,7 @@ static void php_str_replace_in_subject(zval *search, zval *replace, zval **subje /* If search is an array */ if (Z_TYPE_P(search) == IS_ARRAY) { /* Duplicate subject string for repeated replacement */ - *result = **subject; - zval_copy_ctor(result); - INIT_PZVAL(result); + MAKE_COPY_ZVAL(subject, result); zend_hash_internal_pointer_reset(Z_ARRVAL_P(search)); @@ -3616,9 +3614,7 @@ static void php_str_replace_in_subject(zval *search, zval *replace, zval **subje Z_STRVAL_P(search), Z_STRLEN_P(search), Z_STRVAL_P(replace), Z_STRLEN_P(replace), &Z_STRLEN_P(result), case_sensitivity, replace_count); } else { - *result = **subject; - zval_copy_ctor(result); - INIT_PZVAL(result); + MAKE_COPY_ZVAL(subject, result); } } } @@ -3918,7 +3914,7 @@ PHP_FUNCTION(nl2br) tmp = str; end = str + str_len; - /* it is really faster to scan twice and allocate mem once insted scanning once + /* it is really faster to scan twice and allocate mem once instead of scanning once and constantly reallocing */ while (tmp < end) { if (*tmp == '\r') { @@ -4247,7 +4243,7 @@ PHPAPI size_t php_strip_tags_ex(char *rbuf, int len, int *stateptr, char *allow, { char *tbuf, *buf, *p, *tp, *rp, c, lc; int br, i=0, depth=0, in_q = 0; - int state = 0; + int state = 0, pos; if (stateptr) state = *stateptr; @@ -4260,7 +4256,7 @@ PHPAPI size_t php_strip_tags_ex(char *rbuf, int len, int *stateptr, char *allow, br = 0; if (allow) { php_strtolower(allow, allow_len); - tbuf = emalloc(PHP_TAG_BUF_SIZE+1); + tbuf = emalloc(PHP_TAG_BUF_SIZE + 1); tp = tbuf; } else { tbuf = tp = NULL; @@ -4281,7 +4277,11 @@ PHPAPI size_t php_strip_tags_ex(char *rbuf, int len, int *stateptr, char *allow, lc = '<'; state = 1; if (allow) { - tp = ((tp-tbuf) >= PHP_TAG_BUF_SIZE ? tbuf: tp); + if (tp - tbuf >= PHP_TAG_BUF_SIZE) { + pos = tp - tbuf; + tbuf = erealloc(tbuf, (tp - tbuf) + PHP_TAG_BUF_SIZE + 1); + tp = tbuf + pos; + } *(tp++) = '<'; } } else if (state == 1) { @@ -4296,7 +4296,11 @@ PHPAPI size_t php_strip_tags_ex(char *rbuf, int len, int *stateptr, char *allow, br++; } } else if (allow && state == 1) { - tp = ((tp-tbuf) >= PHP_TAG_BUF_SIZE ? tbuf: tp); + if (tp - tbuf >= PHP_TAG_BUF_SIZE) { + pos = tp - tbuf; + tbuf = erealloc(tbuf, (tp - tbuf) + PHP_TAG_BUF_SIZE + 1); + tp = tbuf + pos; + } *(tp++) = c; } else if (state == 0) { *(rp++) = c; @@ -4310,7 +4314,11 @@ PHPAPI size_t php_strip_tags_ex(char *rbuf, int len, int *stateptr, char *allow, br--; } } else if (allow && state == 1) { - tp = ((tp-tbuf) >= PHP_TAG_BUF_SIZE ? tbuf: tp); + if (tp - tbuf >= PHP_TAG_BUF_SIZE) { + pos = tp - tbuf; + tbuf = erealloc(tbuf, (tp - tbuf) + PHP_TAG_BUF_SIZE + 1); + tp = tbuf + pos; + } *(tp++) = c; } else if (state == 0) { *(rp++) = c; @@ -4332,7 +4340,11 @@ PHPAPI size_t php_strip_tags_ex(char *rbuf, int len, int *stateptr, char *allow, lc = '>'; in_q = state = 0; if (allow) { - tp = ((tp-tbuf) >= PHP_TAG_BUF_SIZE ? tbuf: tp); + if (tp - tbuf >= PHP_TAG_BUF_SIZE) { + pos = tp - tbuf; + tbuf = erealloc(tbuf, (tp - tbuf) + PHP_TAG_BUF_SIZE + 1); + tp = tbuf + pos; + } *(tp++) = '>'; *tp='\0'; if (php_tag_find(tbuf, tp-tbuf, allow)) { @@ -4382,10 +4394,14 @@ PHPAPI size_t php_strip_tags_ex(char *rbuf, int len, int *stateptr, char *allow, } else if (state == 0) { *(rp++) = c; } else if (allow && state == 1) { - tp = ((tp-tbuf) >= PHP_TAG_BUF_SIZE ? tbuf: tp); + if (tp - tbuf >= PHP_TAG_BUF_SIZE) { + pos = tp - tbuf; + tbuf = erealloc(tbuf, (tp - tbuf) + PHP_TAG_BUF_SIZE + 1); + tp = tbuf + pos; + } *(tp++) = c; } - if (state && p != buf && *(p-1) != '\\' && (!in_q || *p == in_q)) { + if (state && p != buf && (state == 1 || *(p-1) != '\\') && (!in_q || *p == in_q)) { if (in_q) { in_q = 0; } else { @@ -4403,7 +4419,11 @@ PHPAPI size_t php_strip_tags_ex(char *rbuf, int len, int *stateptr, char *allow, if (state == 0) { *(rp++) = c; } else if (allow && state == 1) { - tp = ((tp-tbuf) >= PHP_TAG_BUF_SIZE ? tbuf: tp); + if (tp - tbuf >= PHP_TAG_BUF_SIZE) { + pos = tp - tbuf; + tbuf = erealloc(tbuf, (tp - tbuf) + PHP_TAG_BUF_SIZE + 1); + tp = tbuf + pos; + } *(tp++) = c; } } @@ -4458,7 +4478,11 @@ reg_char: if (state == 0) { *(rp++) = c; } else if (allow && state == 1) { - tp = ((tp-tbuf) >= PHP_TAG_BUF_SIZE ? tbuf: tp); + if (tp - tbuf >= PHP_TAG_BUF_SIZE) { + pos = tp - tbuf; + tbuf = erealloc(tbuf, (tp - tbuf) + PHP_TAG_BUF_SIZE + 1); + tp = tbuf + pos; + } *(tp++) = c; } break; diff --git a/ext/standard/strnatcmp.c b/ext/standard/strnatcmp.c index 3a60bc76e..e1c6960e9 100644 --- a/ext/standard/strnatcmp.c +++ b/ext/standard/strnatcmp.c @@ -38,7 +38,7 @@ #if 0 static char const *version UNUSED = - "$Id: strnatcmp.c 289419 2009-10-09 14:33:38Z pajoye $"; + "$Id: strnatcmp.c 288896 2009-09-28 13:29:53Z rasmus $"; #endif /* {{{ compare_right */ diff --git a/ext/standard/syslog.c b/ext/standard/syslog.c index aa8c47248..8208319dc 100644 --- a/ext/standard/syslog.c +++ b/ext/standard/syslog.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: syslog.c 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: syslog.c 293036 2010-01-03 09:23:27Z sebastian $ */ #include "php.h" diff --git a/ext/standard/tests/array/array_flip_variation2.phpt b/ext/standard/tests/array/array_flip_variation2.phpt Binary files differindex 1474a6955..997c39130 100644 --- a/ext/standard/tests/array/array_flip_variation2.phpt +++ b/ext/standard/tests/array/array_flip_variation2.phpt diff --git a/ext/standard/tests/array/bug50006.phpt b/ext/standard/tests/array/bug50006.phpt new file mode 100644 index 000000000..f03a00262 --- /dev/null +++ b/ext/standard/tests/array/bug50006.phpt @@ -0,0 +1,29 @@ +--TEST-- +Bug #50006 (Segfault caused by uksort()) +--FILE-- +<?php + +$data = array( + 'bar-bazbazbaz.' => 0, + 'bar-bazbazbaz-' => 0, + 'foo' => 0, +); +uksort($data, 'magic_sort_cmp'); +print_r($data); + +function magic_sort_cmp($a, $b) { + $a = substr($a, 1); + $b = substr($b, 1); + if (!$a) return $b ? -1 : 0; + if (!$b) return 1; + return magic_sort_cmp($a, $b); +} + +?> +--EXPECTF-- +Array +( + [foo] => 0 + [bar-bazbazbaz-] => 0 + [bar-bazbazbaz.] => 0 +) diff --git a/ext/standard/tests/array/bug50006_1.phpt b/ext/standard/tests/array/bug50006_1.phpt new file mode 100644 index 000000000..fbb7ddd59 --- /dev/null +++ b/ext/standard/tests/array/bug50006_1.phpt @@ -0,0 +1,29 @@ +--TEST-- +Bug #50006 (Segfault caused by uksort()) - usort variant +--FILE-- +<?php + +$data = array( + 'bar-bazbazbaz.', + 'bar-bazbazbaz-', + 'foo' +); +usort($data, 'magic_sort_cmp'); +print_r($data); + +function magic_sort_cmp($a, $b) { + $a = substr($a, 1); + $b = substr($b, 1); + if (!$a) return $b ? -1 : 0; + if (!$b) return 1; + return magic_sort_cmp($a, $b); +} + +?> +--EXPECTF-- +Array +( + [0] => foo + [1] => bar-bazbazbaz- + [2] => bar-bazbazbaz. +) diff --git a/ext/standard/tests/array/bug50006_2.phpt b/ext/standard/tests/array/bug50006_2.phpt new file mode 100644 index 000000000..19c0d1425 --- /dev/null +++ b/ext/standard/tests/array/bug50006_2.phpt @@ -0,0 +1,29 @@ +--TEST-- +Bug #50006 (Segfault caused by uksort()) - uasort variant +--FILE-- +<?php + +$data = array( + 'bar-bazbazbaz.', + 'bar-bazbazbaz-', + 'foo' +); +uasort($data, 'magic_sort_cmp'); +print_r($data); + +function magic_sort_cmp($a, $b) { + $a = substr($a, 1); + $b = substr($b, 1); + if (!$a) return $b ? -1 : 0; + if (!$b) return 1; + return magic_sort_cmp($a, $b); +} + +?> +--EXPECTF-- +Array +( + [2] => foo + [1] => bar-bazbazbaz- + [0] => bar-bazbazbaz. +) diff --git a/ext/standard/tests/array/uasort_variation5.phpt b/ext/standard/tests/array/uasort_variation5.phpt index 22d9da31c..e6996a55f 100644 --- a/ext/standard/tests/array/uasort_variation5.phpt +++ b/ext/standard/tests/array/uasort_variation5.phpt @@ -139,7 +139,7 @@ array(4) { [1]=> string(7) "Heredoc" [3]=> - string(43) "heredoc string with!@# and 123 + string(4%d) "heredoc string with!@# and 123 Test this!!!" } Done diff --git a/ext/standard/tests/bug49244.phpt b/ext/standard/tests/bug49244.phpt new file mode 100644 index 000000000..1ba24fb9b --- /dev/null +++ b/ext/standard/tests/bug49244.phpt @@ -0,0 +1,32 @@ +--TEST-- +Bug #49244 (Floating point NaN cause garbage characters) +--FILE-- +<?php + +for ($i = 0; $i < 10; $i++) { + printf("{%f} %1\$f\n", pow(-1.0, 0.3)); + printf(b"{%f} %1\$f\n", pow(-1.0, 0.3)); +} + +?> +--EXPECT-- +{NaN} NaN +{NaN} NaN +{NaN} NaN +{NaN} NaN +{NaN} NaN +{NaN} NaN +{NaN} NaN +{NaN} NaN +{NaN} NaN +{NaN} NaN +{NaN} NaN +{NaN} NaN +{NaN} NaN +{NaN} NaN +{NaN} NaN +{NaN} NaN +{NaN} NaN +{NaN} NaN +{NaN} NaN +{NaN} NaN diff --git a/ext/standard/tests/file/005_variation2-win32.phpt b/ext/standard/tests/file/005_variation2-win32.phpt index 513182dde..45dcbc5f0 100644 --- a/ext/standard/tests/file/005_variation2-win32.phpt +++ b/ext/standard/tests/file/005_variation2-win32.phpt @@ -108,18 +108,18 @@ Warning: filectime(): stat failed for | in %s on line %d *** testing touch *** -Warning: touch(): Unable to create file because %s in %s on line %d +Warning: touch(): %s in %s on line %d bool(false) -Warning: touch(): Unable to create file because %s in %s on line %d +Warning: touch(): %s in %s on line %d bool(false) -Warning: touch(): Unable to create file because %s in %s on line %d +Warning: touch(): %s in %s on line %d bool(false) -Warning: touch(): Unable to create file because %s in %s on line %d +Warning: touch(): %s in %s on line %d bool(false) -Warning: touch(): Unable to create file | because %s in %s on line %d +Warning: touch(): %s in %s on line %d bool(false) Done diff --git a/ext/standard/tests/file/bug26615.phpt b/ext/standard/tests/file/bug26615.phpt index 9fee92a69..3689fdfe1 100644 --- a/ext/standard/tests/file/bug26615.phpt +++ b/ext/standard/tests/file/bug26615.phpt @@ -1,6 +1,6 @@ --TEST-- Bug #26615 (exec crash on long input lines) ---INI--- +--INI-- variables_order=E --FILE-- <?php diff --git a/ext/standard/tests/file/bug47767.phpt b/ext/standard/tests/file/bug47767.phpt index 62388c28c..312476aa5 100644 --- a/ext/standard/tests/file/bug47767.phpt +++ b/ext/standard/tests/file/bug47767.phpt @@ -10,6 +10,11 @@ if(substr(PHP_OS, 0, 3) != 'WIN' ) { if(PHP_WINDOWS_VERSION_MAJOR < 6) { die('skip windows version 6.0+ only test'); } + +$ret = exec('mklink rename_variation13tmp.lnk ' . __FILE__ .' 2>&1', $out); +if (strpos($ret, 'privilege')) { + die('skip. SeCreateSymbolicLinkPrivilege not enable for this user.'); +} ?> --FILE-- <?php diff --git a/ext/standard/tests/file/chmod_variation3.phpt b/ext/standard/tests/file/chmod_variation3.phpt index c2dd607fe..df18ccf98 100644 --- a/ext/standard/tests/file/chmod_variation3.phpt +++ b/ext/standard/tests/file/chmod_variation3.phpt @@ -159,11 +159,11 @@ Error: 2 - chmod() expects parameter 1 to be string, array given, %s(%d) NULL --uppercase NULL-- -Error: 2 - chmod(): No such file or directory, %s(%d) +Error: 2 - chmod(): %s, %s(%d) bool(false) --lowercase null-- -Error: 2 - chmod(): No such file or directory, %s(%d) +Error: 2 - chmod(): %s, %s(%d) bool(false) --lowercase true-- @@ -171,7 +171,7 @@ Error: 2 - chmod(): No such file or directory, %s(%d) bool(false) --lowercase false-- -Error: 2 - chmod(): No such file or directory, %s(%d) +Error: 2 - chmod(): %s, %s(%d) bool(false) --uppercase TRUE-- @@ -179,15 +179,15 @@ Error: 2 - chmod(): No such file or directory, %s(%d) bool(false) --uppercase FALSE-- -Error: 2 - chmod(): No such file or directory, %s(%d) +Error: 2 - chmod(): %s, %s(%d) bool(false) --empty string DQ-- -Error: 2 - chmod(): No such file or directory, %s(%d) +Error: 2 - chmod(): %s, %s(%d) bool(false) --empty string SQ-- -Error: 2 - chmod(): No such file or directory, %s(%d) +Error: 2 - chmod(): %s, %s(%d) bool(false) --instance of classWithToString-- @@ -199,11 +199,11 @@ Error: 2 - chmod() expects parameter 1 to be string, object given, %s(%d) NULL --undefined var-- -Error: 2 - chmod(): No such file or directory, %s(%d) +Error: 2 - chmod(): %s, %s(%d) bool(false) --unset var-- -Error: 2 - chmod(): No such file or directory, %s(%d) +Error: 2 - chmod(): %s, %s(%d) bool(false) ===DONE=== diff --git a/ext/standard/tests/file/fflush_basic.phpt b/ext/standard/tests/file/fflush_basic.phpt index 5cd81d7aa..f375c4f07 100755 --- a/ext/standard/tests/file/fflush_basic.phpt +++ b/ext/standard/tests/file/fflush_basic.phpt @@ -21,6 +21,10 @@ $file_handle = fopen($filename, "w"); if($file_handle == false) exit("Error:failed to open file $filename"); +if(substr(PHP_OS, 0, 3) == "WIN") { + $data = str_replace("\r",'', $data); +} + // writing data to the file var_dump( fwrite($file_handle, $data) ); var_dump( fflush($file_handle) ); diff --git a/ext/standard/tests/file/fgetss_basic1.phpt b/ext/standard/tests/file/fgetss_basic1.phpt index ab9eae0be..4c5881d58 100644 --- a/ext/standard/tests/file/fgetss_basic1.phpt +++ b/ext/standard/tests/file/fgetss_basic1.phpt @@ -22,7 +22,9 @@ is a heredoc string. <pg>ksklnm@@$$&$&^%&^%&^%&</pg> <html> html </html> <?php echo "php"; ?> EOT; - +if(substr(PHP_OS, 0, 3) == "WIN") { + $string_with_tags = str_replace("\r",'', $string_with_tags); +} /* try reading the file opened in different modes of reading */ $file_modes = array("r","rb", "rt","r+", "r+b", "r+t"); @@ -62,7 +64,7 @@ for($mode_counter = 0; $mode_counter < count($file_modes); $mode_counter++) { echo "Done\n"; ?> ---EXPECTF-- +--EXPECT-- *** Testing fgetss() : Basic operations *** -- Testing fgetss() with file opened using r mode -- diff --git a/ext/standard/tests/file/fgetss_basic2-win32.phpt b/ext/standard/tests/file/fgetss_basic2-win32.phpt index 5a87b4c03..9187fe532 100644 --- a/ext/standard/tests/file/fgetss_basic2-win32.phpt +++ b/ext/standard/tests/file/fgetss_basic2-win32.phpt @@ -29,7 +29,9 @@ $string_with_tags = <<<EOT is a heredoc string. <pg>ksklnm@@$$&$&^%&^%&^%&</pg> <html> html </html> <?php echo "php"; ?> EOT; - +if(substr(PHP_OS, 0, 3) == "WIN") { + $string_with_tags = str_replace("\r",'', $string_with_tags); +} $filename = dirname(__FILE__)."/fgetss_basic2.tmp"; /* try reading the file opened in different modes of reading */ diff --git a/ext/standard/tests/file/fgetss_variation1-win32.phpt b/ext/standard/tests/file/fgetss_variation1-win32.phpt index dc3ee930c..0aca5d376 100644 --- a/ext/standard/tests/file/fgetss_variation1-win32.phpt +++ b/ext/standard/tests/file/fgetss_variation1-win32.phpt @@ -36,6 +36,10 @@ this text contains some html tags <body> body </body> <br> br </br> this is the line with \n character. EOT; +if(substr(PHP_OS, 0, 3) == "WIN") { + $string_with_tags = str_replace("\r",'', $string_with_tags); +} + $filename = dirname(__FILE__)."/fgetss_variation1.tmp"; /* try reading the file opened in different modes of reading */ @@ -73,7 +77,7 @@ for($mode_counter = 0; $mode_counter < count($file_modes); $mode_counter++) { echo "Done\n"; ?> ---EXPECTF-- +--EXPECT-- *** Testing fgetss() : usage variations *** -- Testing fgetss() with file opened using w mode -- diff --git a/ext/standard/tests/file/fgetss_variation3-win32.phpt b/ext/standard/tests/file/fgetss_variation3-win32.phpt index ea8ee2f8c..7539b3687 100644 --- a/ext/standard/tests/file/fgetss_variation3-win32.phpt +++ b/ext/standard/tests/file/fgetss_variation3-win32.phpt @@ -35,6 +35,10 @@ this text contains some html tags <body> body </body> <br> br </br> this is the line with \n character. EOT; +if(substr(PHP_OS, 0, 3) == "WIN") { + $string_with_tags = str_replace("\r",'', $string_with_tags); +} + $filename = dirname(__FILE__)."/fgetss_variation3.tmp"; /* try reading the file opened in different modes of reading */ @@ -76,7 +80,7 @@ for($mode_counter = 0; $mode_counter < count($file_modes); $mode_counter++) { echo "Done\n"; ?> ---EXPECTF-- +--EXPECT-- *** Testing fgetss() : usage variations *** -- Testing fgetss() with file opened using w+ mode -- diff --git a/ext/standard/tests/file/fgetss_variation4.phpt b/ext/standard/tests/file/fgetss_variation4.phpt index 134a9652a..6c201d1a9 100644 --- a/ext/standard/tests/file/fgetss_variation4.phpt +++ b/ext/standard/tests/file/fgetss_variation4.phpt @@ -1,5 +1,10 @@ --TEST-- Test fgetss() function : usage variations - read modes, file pointer at EOF +--SKIPIF-- +<?php +if(substr(PHP_OS, 0, 3) == "WIN") + die("skip not for Windows"); +?> --FILE-- <?php /* diff --git a/ext/standard/tests/file/fgetss_variation5-win32.phpt b/ext/standard/tests/file/fgetss_variation5-win32.phpt index d806ddd47..cedc7b98d 100644 --- a/ext/standard/tests/file/fgetss_variation5-win32.phpt +++ b/ext/standard/tests/file/fgetss_variation5-win32.phpt @@ -33,6 +33,9 @@ this is a line with more than eighty character,want to check line splitting corr this text contains some html tags <body> body </body> <br> br </br> this is the line with \n character. EOT; +if(substr(PHP_OS, 0, 3) == "WIN") { + $string_with_tags = str_replace("\r",'', $string_with_tags); +} $filename = dirname(__FILE__)."/fgetss_variation5.tmp"; @@ -77,7 +80,7 @@ for($mode_counter = 0; $mode_counter < count($file_modes); $mode_counter++) { echo "Done\n"; ?> ---EXPECTF-- +--EXPECT-- *** Testing fgetss() : usage variations *** -- Testing fgetss() with file opened using w+ mode -- diff --git a/ext/standard/tests/file/file.inc b/ext/standard/tests/file/file.inc index efb425ca4..c0f86e7c3 100644 --- a/ext/standard/tests/file/file.inc +++ b/ext/standard/tests/file/file.inc @@ -347,16 +347,16 @@ function create_files( $file_path, filled => total files filled, always returned as 1 perms_changed => total files permission changed */ -function create_links( $file_path, - $filename, - $link_count = 1, - $link_type = "soft", - $link_size = 1024, - $link_name_prefix = "link", - $link_name_suffix = 1, - $link_file_content = "text", - $link_perms = 0755, - $link_file_extension = ".tmp" +function create_links($file_path, + $filename, + $link_count = 1, + $link_type = "soft", + $link_size = 1024, + $link_name_prefix = "link", + $link_name_suffix = 1, + $link_file_content = "text", + $link_perms = 0755, + $link_file_extension = ".tmp" ) { $return_value = array('created' => 0, 'filled' => 0, 'perms_changed' => 0); diff --git a/ext/standard/tests/file/fopen_variation10-win32.phpt b/ext/standard/tests/file/fopen_variation10-win32.phpt index bf8d3889f..c949f86fa 100644 --- a/ext/standard/tests/file/fopen_variation10-win32.phpt +++ b/ext/standard/tests/file/fopen_variation10-win32.phpt @@ -6,6 +6,11 @@ Dave Kelsey <d_kelsey@uk.ibm.com> <?php if(substr(PHP_OS, 0, 3) != "WIN") die("skip Run only on Windows"); + +if (!is_writable('c:\\fopen_variation10.tmp')) { + die('skip. C:\\ not writable.'); +} + ?> --FILE-- <?php diff --git a/ext/standard/tests/file/fopen_variation11-win32.phpt b/ext/standard/tests/file/fopen_variation11-win32.phpt index cc33a4eb4..61a2f60ec 100644 --- a/ext/standard/tests/file/fopen_variation11-win32.phpt +++ b/ext/standard/tests/file/fopen_variation11-win32.phpt @@ -6,6 +6,10 @@ Dave Kelsey <d_kelsey@uk.ibm.com> <?php if(substr(PHP_OS, 0, 3) != "WIN") die("skip Run only on Windows"); +if (!is_writable('c:\\fopen_variation10.tmp')) { + die('skip. C:\\ not writable.'); +} + ?> --FILE-- <?php diff --git a/ext/standard/tests/file/fopen_variation17.phpt b/ext/standard/tests/file/fopen_variation17.phpt index 75f24b355..bc75c11c9 100644 --- a/ext/standard/tests/file/fopen_variation17.phpt +++ b/ext/standard/tests/file/fopen_variation17.phpt @@ -37,7 +37,7 @@ function runtest() { mkdir($dir1.'/'.$extraDir); mkdir($extraDir); - $tmpfile = $extraDir.'/ basename(__FILE__, ".php") . ".tmp"'; + $tmpfile = $extraDir . '/' . basename(__FILE__, ".php") . ".tmp"; $h = fopen($tmpfile, "w+", true); fwrite($h, (binary) "This is the test file"); fclose($h); diff --git a/ext/standard/tests/file/fpassthru_basic.phpt b/ext/standard/tests/file/fpassthru_basic.phpt index db03abc49..8924b27dd 100644 --- a/ext/standard/tests/file/fpassthru_basic.phpt +++ b/ext/standard/tests/file/fpassthru_basic.phpt @@ -13,7 +13,9 @@ $write_handle = fopen($file_name, "w"); $string = "Hello, world\n, abcdefg\tadsdsfdf\n8u2394723947\t$%$%#$%#$%#^#%^ Hello, world\n, abcdefg\tadsdsfdf\n8u2394723947\t$%$%#$%#$%#^#%^\n"; - +if(substr(PHP_OS, 0, 3) == "WIN") { + $string = str_replace("\r",'', $string); +} fwrite($write_handle, $string); fclose($write_handle); diff --git a/ext/standard/tests/file/mkdir_variation1-win32.phpt b/ext/standard/tests/file/mkdir_variation1-win32.phpt index 6dfe3be62..17f54926c 100644 --- a/ext/standard/tests/file/mkdir_variation1-win32.phpt +++ b/ext/standard/tests/file/mkdir_variation1-win32.phpt @@ -94,28 +94,28 @@ foreach($inputs as $key =>$value) { *** Testing mkdir() : usage variation *** --uppercase NULL-- -Error: 2 - mkdir(): No such file or directory, %s(%d) +Error: 2 - mkdir(): %s, %s(%d) --lowercase null-- -Error: 2 - mkdir(): No such file or directory, %s(%d) +Error: 2 - mkdir(): %s, %s(%d) --lowercase false-- -Error: 2 - mkdir(): No such file or directory, %s(%d) +Error: 2 - mkdir(): %s, %s(%d) --uppercase FALSE-- -Error: 2 - mkdir(): No such file or directory, %s(%d) +Error: 2 - mkdir(): %s, %s(%d) --empty string DQ-- -Error: 2 - mkdir(): No such file or directory, %s(%d) +Error: 2 - mkdir(): %s, %s(%d) --empty string SQ-- -Error: 2 - mkdir(): No such file or directory, %s(%d) +Error: 2 - mkdir(): %s, %s(%d) --undefined var-- -Error: 2 - mkdir(): No such file or directory, %s(%d) +Error: 2 - mkdir(): %s, %s(%d) --unset var-- -Error: 2 - mkdir(): No such file or directory, %s(%d) +Error: 2 - mkdir(): %s, %s(%d) --single space-- Error: 2 - mkdir(): %s, %s(%d) diff --git a/ext/standard/tests/file/realpath_cache.phpt b/ext/standard/tests/file/realpath_cache.phpt new file mode 100644 index 000000000..567f0e2c7 --- /dev/null +++ b/ext/standard/tests/file/realpath_cache.phpt @@ -0,0 +1,30 @@ +--TEST-- +realpath_cache_size() and realpath_cache_get() +--SKIPIF-- +<?php +if (substr(PHP_OS, 0, 3) == 'WIN') { + die('skip not on Windows'); +} +?> +--FILE-- +<?php + +var_dump(realpath_cache_size()); +$data = realpath_cache_get(); +var_dump($data[__DIR__]); + +echo "Done\n"; +?> +--EXPECTF-- +int(%d) +array(4) { + ["key"]=> + int(%d) + ["is_dir"]=> + bool(true) + ["realpath"]=> + string(%d) "%sfile" + ["expires"]=> + int(%d) +} +Done diff --git a/ext/standard/tests/file/realpath_cache_win32.phpt b/ext/standard/tests/file/realpath_cache_win32.phpt new file mode 100644 index 000000000..16fc412b0 --- /dev/null +++ b/ext/standard/tests/file/realpath_cache_win32.phpt @@ -0,0 +1,38 @@ +--TEST-- +realpath_cache_size() and realpath_cache_get() +--SKIPIF-- +<?php +if (substr(PHP_OS, 0, 3) != 'WIN') { + die('skip only on Windows'); +} +?> +--FILE-- +<?php + +var_dump(realpath_cache_size()); +$data = realpath_cache_get(); +var_dump($data[__DIR__]); + +echo "Done\n"; +?> +--EXPECTF-- +int(%d) +array(8) { + ["key"]=> + int(%d) + ["is_dir"]=> + bool(true) + ["realpath"]=> + string(%d) "%sfile" + ["expires"]=> + int(%d) + ["is_rvalid"]=> + bool(%s) + ["is_wvalid"]=> + bool(%s) + ["is_readable"]=> + bool(%s) + ["is_writable"]=> + bool(%s) +} +Done diff --git a/ext/standard/tests/file/rename_variation-win32.phpt b/ext/standard/tests/file/rename_variation-win32.phpt index cebf0334c..a10c6dfbe 100644 --- a/ext/standard/tests/file/rename_variation-win32.phpt +++ b/ext/standard/tests/file/rename_variation-win32.phpt @@ -69,7 +69,7 @@ bool(false) bool(true) -- Iteration 2 -- -Warning: rename(%s/rename_variation/rename_variation.tmp/,%s/rename_variation2.tmp): No such file or directory in %s on line %d +Warning: rename(%s/rename_variation/rename_variation.tmp/,%s/rename_variation2.tmp): The filename, directory name, or volume label syntax is incorrect. (code: 123) in %s on line %d bool(false) bool(false) bool(false) diff --git a/ext/standard/tests/file/rename_variation11-win32.phpt b/ext/standard/tests/file/rename_variation11-win32.phpt index d17b0d283..c13a09a95 100644 --- a/ext/standard/tests/file/rename_variation11-win32.phpt +++ b/ext/standard/tests/file/rename_variation11-win32.phpt @@ -92,12 +92,12 @@ bool(true) -- Iteration 5 -- -Warning: rename(%s\renameVar11\renameVar11Sub\..\\\renameVar11Sub\\..\\..\renameVar11Sub\renameMe.tmp,%s\renameVar11\renameVar11Sub\..\\\renameVar11Sub\\..\\..\renameVar11Sub\IwasRenamed.tmp): No such file or directory in %s on line %d +Warning: rename(%s\renameVar11\renameVar11Sub\..\\\renameVar11Sub\\..\\..\renameVar11Sub\renameMe.tmp,%s\renameVar11\renameVar11Sub\..\\\renameVar11Sub\\..\\..\renameVar11Sub\IwasRenamed.tmp): The system cannot find the path specified. (code: 3) in %s on line %d bool(false) -- Iteration 6 -- -Warning: rename(%s\renameVar11\renameVar11Sub\BADDIR\renameMe.tmp,%s\renameVar11\renameVar11Sub\BADDIR\IwasRenamed.tmp): No such file or directory in %s on line %d +Warning: rename(%s\renameVar11\renameVar11Sub\BADDIR\renameMe.tmp,%s\renameVar11\renameVar11Sub\BADDIR\IwasRenamed.tmp): The system cannot find the path specified. (code: 3) in %s on line %d bool(false) -- Iteration 7 -- @@ -118,7 +118,7 @@ bool(true) -- Iteration 11 -- -Warning: rename(BADDIR\renameMe.tmp,BADDIR\IwasRenamed.tmp): No such file or directory in %s on line %d +Warning: rename(BADDIR\renameMe.tmp,BADDIR\IwasRenamed.tmp): The system cannot find the path specified. (code: 3) in %s on line %d bool(false) -- Iteration 12 -- diff --git a/ext/standard/tests/file/rename_variation12-win32.phpt b/ext/standard/tests/file/rename_variation12-win32.phpt new file mode 100644 index 000000000..de5fc1400 --- /dev/null +++ b/ext/standard/tests/file/rename_variation12-win32.phpt @@ -0,0 +1,121 @@ +--TEST-- +Test rename() function : variation - various relative, absolute paths +--CREDITS-- +Dave Kelsey <d_kelsey@uk.ibm.com> +--SKIPIF-- +<?php +if (substr(PHP_OS, 0, 3) != 'WIN') die('skip.. for Windows'); +?> +--FILE-- +<?php +/* Prototype : bool rename(string old_name, string new_name[, resource context]) + * Description: Rename a file + * Source code: ext/standard/file.c + * Alias to functions: + */ + +/* Creating unique files in various dirs by passing relative paths to $dir arg */ + +echo "*** Testing rename() with absolute and relative paths ***\n"; +$mainDir = "renameVar11"; +$subDir = "renameVar11Sub"; +$absMainDir = dirname(__FILE__)."/".$mainDir; +mkdir($absMainDir); +$absSubDir = $absMainDir."/".$subDir; +mkdir($absSubDir); + +$fromFile = "renameMe.tmp"; +$toFile = "IwasRenamed.tmp"; + +$old_dir_path = getcwd(); +chdir(dirname(__FILE__)); + +$allDirs = array( + // absolute paths + "$absSubDir/", + "$absSubDir/../".$subDir, + "$absSubDir//.././".$subDir, + "$absSubDir/../../".$mainDir."/./".$subDir, + "$absSubDir/..///".$subDir."//..//../".$subDir, + "$absSubDir/BADDIR", + + + // relative paths + $mainDir."/".$subDir, + $mainDir."//".$subDir, + $mainDir."///".$subDir, + "./".$mainDir."/../".$mainDir."/".$subDir, + "BADDIR", +); + +for($i = 0; $i<count($allDirs); $i++) { + $j = $i+1; + $dir = $allDirs[$i]; + echo "\n-- Iteration $j --\n"; + touch($absSubDir."/".$fromFile); + $res = rename($dir."/".$fromFile, $dir."/".$toFile); + var_dump($res); + if ($res == true) { + $res = rename($dir."/".$toFile, $dir."/".$fromFile); + var_dump($res); + } + unlink($absSubDir."/".$fromFile); +} + +chdir($old_dir_path); +rmdir($absSubDir); +rmdir($absMainDir); + +echo "\n*** Done ***\n"; +?> +--EXPECTF-- +*** Testing rename() with absolute and relative paths *** + +-- Iteration 1 -- +bool(true) +bool(true) + +-- Iteration 2 -- +bool(true) +bool(true) + +-- Iteration 3 -- +bool(true) +bool(true) + +-- Iteration 4 -- +bool(true) +bool(true) + +-- Iteration 5 -- + +Warning: rename(%s/renameVar11/renameVar11Sub/..///renameVar11Sub//..//../renameVar11Sub/renameMe.tmp,%s/renameVar11/renameVar11Sub/..///renameVar11Sub//..//../renameVar11Sub/IwasRenamed.tmp): The system cannot find the path specified. (code: 3) in %s on line %d +bool(false) + +-- Iteration 6 -- + +Warning: rename(%s/renameVar11/renameVar11Sub/BADDIR/renameMe.tmp,%s/renameVar11/renameVar11Sub/BADDIR/IwasRenamed.tmp): The system cannot find the path specified. (code: 3) in %s on line %d +bool(false) + +-- Iteration 7 -- +bool(true) +bool(true) + +-- Iteration 8 -- +bool(true) +bool(true) + +-- Iteration 9 -- +bool(true) +bool(true) + +-- Iteration 10 -- +bool(true) +bool(true) + +-- Iteration 11 -- + +Warning: rename(BADDIR/renameMe.tmp,BADDIR/IwasRenamed.tmp): The system cannot find the path specified. (code: 3) in %s on line %d +bool(false) + +*** Done ***
\ No newline at end of file diff --git a/ext/standard/tests/file/rename_variation12.phpt b/ext/standard/tests/file/rename_variation12.phpt index 11274f03d..168beeffc 100644 --- a/ext/standard/tests/file/rename_variation12.phpt +++ b/ext/standard/tests/file/rename_variation12.phpt @@ -2,6 +2,10 @@ Test rename() function : variation - various relative, absolute paths --CREDITS-- Dave Kelsey <d_kelsey@uk.ibm.com> +--SKIPIF-- +<?php +if (substr(PHP_OS, 0, 3) == 'WIN') die('skip.. not for Windows'); +?> --FILE-- <?php /* Prototype : bool rename(string old_name, string new_name[, resource context]) @@ -85,12 +89,12 @@ bool(true) -- Iteration 5 -- -Warning: rename(%s/renameVar11/renameVar11Sub/..///renameVar11Sub//..//../renameVar11Sub/renameMe.tmp,%s/renameVar11/renameVar11Sub/..///renameVar11Sub//..//../renameVar11Sub/IwasRenamed.tmp): No such file or directory in %s on line %d +Warning: rename(%s/renameVar11/renameVar11Sub/..///renameVar11Sub//..//../renameVar11Sub/renameMe.tmp,%s/renameVar11/renameVar11Sub/..///renameVar11Sub//..//../renameVar11Sub/IwasRenamed.tmp): %s in %s on line %d bool(false) -- Iteration 6 -- -Warning: rename(%s/renameVar11/renameVar11Sub/BADDIR/renameMe.tmp,%s/renameVar11/renameVar11Sub/BADDIR/IwasRenamed.tmp): No such file or directory in %s on line %d +Warning: rename(%s/renameVar11/renameVar11Sub/BADDIR/renameMe.tmp,%s/renameVar11/renameVar11Sub/BADDIR/IwasRenamed.tmp): %s in %s on line %d bool(false) -- Iteration 7 -- @@ -111,7 +115,7 @@ bool(true) -- Iteration 11 -- -Warning: rename(BADDIR/renameMe.tmp,BADDIR/IwasRenamed.tmp): No such file or directory in %s on line %d +Warning: rename(BADDIR/renameMe.tmp,BADDIR/IwasRenamed.tmp): %s in %s on line %d bool(false) -*** Done ***
\ No newline at end of file +*** Done *** diff --git a/ext/standard/tests/file/rename_variation13-win32.phpt b/ext/standard/tests/file/rename_variation13-win32.phpt Binary files differindex 290095629..a86025889 100644 --- a/ext/standard/tests/file/rename_variation13-win32.phpt +++ b/ext/standard/tests/file/rename_variation13-win32.phpt diff --git a/ext/standard/tests/file/rename_variation13.phpt b/ext/standard/tests/file/rename_variation13.phpt index 123760432..24697d510 100644 --- a/ext/standard/tests/file/rename_variation13.phpt +++ b/ext/standard/tests/file/rename_variation13.phpt @@ -5,7 +5,7 @@ Dave Kelsey <d_kelsey@uk.ibm.com> --SKIPIF-- <?php if(substr(PHP_OS, 0, 3) == "WIN") - die("skip Not for Windows"); + die("skip. Not for Windows"); ?> --FILE-- <?php @@ -15,7 +15,6 @@ if(substr(PHP_OS, 0, 3) == "WIN") * Alias to functions: */ - echo "*** Testing rename() with obscure files ***\n"; $file_path = dirname(__FILE__)."/renameVar13"; $aFile = $file_path.'/afile.tmp'; @@ -74,24 +73,24 @@ Warning: rename(1,%s/renameVar13/afile.tmp): No such file or directory in %s on bool(false) -- testing '' -- -Warning: rename(%s/renameVar13/afile.tmp,): No such file or directory in %s on line %d +Warning: rename(%s/renameVar13/afile.tmp,): %s in %s on line %d bool(false) -Warning: rename(,%s/renameVar13/afile.tmp): No such file or directory in %s on line %d +Warning: rename(,%s/renameVar13/afile.tmp): %s in %s on line %d bool(false) -- testing '' -- -Warning: rename(%s/renameVar13/afile.tmp,): No such file or directory in %s on line %d +Warning: rename(%s/renameVar13/afile.tmp,): %s in %s on line %d bool(false) -Warning: rename(,%s/renameVar13/afile.tmp): No such file or directory in %s on line %d +Warning: rename(,%s/renameVar13/afile.tmp): %s in %s on line %d bool(false) -- testing '' -- -Warning: rename(%s/renameVar13/afile.tmp,): No such file or directory in %s on line %d +Warning: rename(%s/renameVar13/afile.tmp,): %s in %s on line %d bool(false) -Warning: rename(,%s/renameVar13/afile.tmp): No such file or directory in %s on line %d +Warning: rename(,%s/renameVar13/afile.tmp): %s in %s on line %d bool(false) -- testing ' ' -- bool(true) @@ -103,7 +102,7 @@ bool(false) Warning: rename(%s/renameVar13/afile.tmp,): %s in %s on line %d bool(false) -Warning: rename(,%s/renameVar13/afile.tmp): No such file or directory in %s on line %d +Warning: rename(,%s/renameVar13/afile.tmp): %s in %s on line %d bool(false) -- testing 'Array' -- @@ -129,4 +128,4 @@ bool(false) Warning: rename(php/php,%s/renameVar13/afile.tmp): %s directory in %s on line %d bool(false) -*** Done ***
\ No newline at end of file +*** Done *** diff --git a/ext/standard/tests/file/rename_variation3-win32.phpt b/ext/standard/tests/file/rename_variation3-win32.phpt index b251fc448..b5da58781 100644 --- a/ext/standard/tests/file/rename_variation3-win32.phpt +++ b/ext/standard/tests/file/rename_variation3-win32.phpt @@ -24,6 +24,9 @@ mkdir($dirname); $filename = "$file_path/rename_variation3.tmp"; $fp = fopen($filename, "w"); +if (!$fp) { + die("Cannot create $filename\n"); +} fclose($fp); echo "\n-- Renaming file to same file name --\n"; @@ -68,7 +71,7 @@ bool(true) -- Renaming existing file to existing directory name -- -Warning: rename(%s/rename_variation3.tmp,%s/rename_variation3_dir): No such file or directory in %s on line %d +Warning: rename(%s/rename_variation3.tmp,%s/rename_variation3_dir): Access is denied. (code: 5) in %s on line %d bool(false) bool(true) bool(true) diff --git a/ext/standard/tests/file/rename_variation6-win32.phpt b/ext/standard/tests/file/rename_variation6-win32.phpt index 6305447b9..14d59d0ad 100644 --- a/ext/standard/tests/file/rename_variation6-win32.phpt +++ b/ext/standard/tests/file/rename_variation6-win32.phpt @@ -4,6 +4,10 @@ Test rename() function: usage variations-6 <?php if (substr(PHP_OS, 0, 3) != 'WIN') die('skip.. for Windows'); if (!function_exists("symlink")) die("skip symlinks are not supported"); +$ret = exec('mklink rename_variation13tmp.lnk ' . __FILE__ .' 2>&1', $out); +if (strpos($ret, 'privilege')) { + die('skip. SeCreateSymbolicLinkPrivilege not enable for this user.'); +} ?> --FILE-- <?php diff --git a/ext/standard/tests/file/rename_variation8-win32.phpt b/ext/standard/tests/file/rename_variation8-win32.phpt new file mode 100644 index 000000000..1d25a12e0 --- /dev/null +++ b/ext/standard/tests/file/rename_variation8-win32.phpt @@ -0,0 +1,70 @@ +--TEST--
+Test rename() function: variation
+--SKIPIF--
+<?php
+if (substr(PHP_OS, 0, 3) != 'WIN') die('skip.. for Windows');
+?>
+--FILE--
+<?php
+/* Prototype: bool rename ( string $oldname, string $newname [, resource $context] );
+ Description: Renames a file or directory
+*/
+
+echo "\n*** Testing rename() on non-existing file ***\n";
+$file_path = dirname(__FILE__);
+
+// try renaming a non existing file
+$src_name = $file_path."/non_existent_file.tmp";
+$dest_name = $file_path."/rename_variation8_new.tmp";
+var_dump( rename($src_name, $dest_name) );
+
+// ensure that $dest_name didn't get created
+var_dump( file_exists($src_name) ); // expecting false
+var_dump( file_exists($dest_name) ); // expecting false
+
+// rename a existing dir to new name
+echo "\n*** Testing rename() on existing directory ***\n";
+$dir_name = $file_path."/rename_basic_dir";
+mkdir($dir_name);
+$new_dir_name = $file_path."/rename_basic_dir1";
+var_dump( rename($dir_name, $new_dir_name) );
+//ensure that $new_dir_name got created
+var_dump( file_exists($dir_name) ); // expecting false
+var_dump( file_exists($new_dir_name) ); // expecting true
+
+// try to rename an non_existing dir
+echo "\n*** Testing rename() on non-existing directory ***\n";
+$non_existent_dir_name = $file_path."/non_existent_dir";
+$new_dir_name = "$file_path/rename_basic_dir2";
+var_dump( rename($non_existent_dir_name, $new_dir_name) );
+// ensure that $new_dir_name didn't get created
+var_dump( file_exists($non_existent_dir_name) ); // expecting flase
+var_dump( file_exists($new_dir_name) ); // expecting false
+
+echo "Done\n";
+?>
+--CLEAN--
+<?php
+rmdir(dirname(__FILE__)."/rename_basic_dir1");
+?>
+--EXPECTF--
+*** Testing rename() on non-existing file ***
+
+Warning: rename(%s/non_existent_file.tmp,%s/rename_variation8_new.tmp): The system cannot find the file specified. (code: 2) in %s on line %d
+bool(false)
+bool(false)
+bool(false)
+
+*** Testing rename() on existing directory ***
+bool(true)
+bool(false)
+bool(true)
+
+*** Testing rename() on non-existing directory ***
+
+Warning: rename(%s/non_existent_dir,%s/rename_basic_dir2): The system cannot find the file specified. (code: 2) in %s on line %d
+bool(false)
+bool(false)
+bool(false)
+Done
+
diff --git a/ext/standard/tests/file/rename_variation8.phpt b/ext/standard/tests/file/rename_variation8.phpt index 6b3644aee..6e236c376 100644 --- a/ext/standard/tests/file/rename_variation8.phpt +++ b/ext/standard/tests/file/rename_variation8.phpt @@ -1,5 +1,9 @@ --TEST-- Test rename() function: variation +--SKIPIF-- +<?php +if (substr(PHP_OS, 0, 3) == 'WIN') die('skip.. not for Windows'); +?> --FILE-- <?php /* Prototype: bool rename ( string $oldname, string $newname [, resource $context] ); @@ -41,6 +45,7 @@ echo "Done\n"; ?> --CLEAN-- <?php +unlink(dirname(__FILE__)."/rename_basic_new2.tmp"); rmdir(dirname(__FILE__)."/rename_basic_dir1"); ?> --EXPECTF-- diff --git a/ext/standard/tests/file/rename_variation9.phpt b/ext/standard/tests/file/rename_variation9.phpt index d923e4a3d..272fa9402 100644 --- a/ext/standard/tests/file/rename_variation9.phpt +++ b/ext/standard/tests/file/rename_variation9.phpt @@ -41,7 +41,7 @@ echo "Done\n"; unlink(dirname(__FILE__)."/rename_variation9_new.tmp"); rmdir(dirname(__FILE__)."/rename_variation_dir9_new"); ?> ---EXPECTF-- +--EXPECT-- *** Testing rename() by giving stream context as third argument *** bool(true) bool(false) diff --git a/ext/standard/tests/file/rmdir_variation1-win32.phpt b/ext/standard/tests/file/rmdir_variation1-win32.phpt index 0732821c5..2516e6162 100644 --- a/ext/standard/tests/file/rmdir_variation1-win32.phpt +++ b/ext/standard/tests/file/rmdir_variation1-win32.phpt @@ -90,35 +90,35 @@ foreach($inputs as $key =>$value) { *** Testing rmdir() : usage variation *** --uppercase NULL-- -Error: 2 - rmdir(): No such file or directory, %s(%d) +Error: 2 - rmdir(): %s, %s(%d) bool(false) --lowercase null-- -Error: 2 - rmdir(): No such file or directory, %s(%d) +Error: 2 - rmdir(): %s, %s(%d) bool(false) --lowercase false-- -Error: 2 - rmdir(): No such file or directory, %s(%d) +Error: 2 - rmdir(): %s, %s(%d) bool(false) --uppercase FALSE-- -Error: 2 - rmdir(): No such file or directory, %s(%d) +Error: 2 - rmdir(): %s, %s(%d) bool(false) --empty string DQ-- -Error: 2 - rmdir(): No such file or directory, %s(%d) +Error: 2 - rmdir(): %s, %s(%d) bool(false) --empty string SQ-- -Error: 2 - rmdir(): No such file or directory, %s(%d) +Error: 2 - rmdir(): %s, %s(%d) bool(false) --undefined var-- -Error: 2 - rmdir(): No such file or directory, %s(%d) +Error: 2 - rmdir(): %s, %s(%d) bool(false) --unset var-- -Error: 2 - rmdir(): No such file or directory, %s(%d) +Error: 2 - rmdir(): %s, %s(%d) bool(false) --single space-- diff --git a/ext/standard/tests/file/rmdir_variation1.phpt b/ext/standard/tests/file/rmdir_variation1.phpt index a7a499007..04fee0ee2 100644 --- a/ext/standard/tests/file/rmdir_variation1.phpt +++ b/ext/standard/tests/file/rmdir_variation1.phpt @@ -81,7 +81,7 @@ $inputs = array( foreach($inputs as $key =>$value) { echo "\n--$key--\n"; - var_dump( rmdir($value) ); + var_dump(rmdir($value)); }; ?> diff --git a/ext/standard/tests/file/tempnam_variation3-win32.phpt b/ext/standard/tests/file/tempnam_variation3-win32.phpt index ec7718f97..fb457cb6a 100644 --- a/ext/standard/tests/file/tempnam_variation3-win32.phpt +++ b/ext/standard/tests/file/tempnam_variation3-win32.phpt @@ -3,7 +3,7 @@ Test tempnam() function: usage variations - obscure prefixes --SKIPIF-- <?php if(substr(PHP_OS, 0, 3) != "WIN") - die("skip run only on Windows"); + die("skip run only on Windows"); ?> --FILE-- <?php @@ -15,106 +15,101 @@ if(substr(PHP_OS, 0, 3) != "WIN") echo "*** Testing tempnam() with obscure prefixes ***\n"; $file_path = dirname(__FILE__)."/tempnamVar3"; -mkdir($file_path); +if (!mkdir($file_path)) { + echo "Failed, cannot create temp dir $filepath\n"; + exit(1); +} + +$file_path = realpath($file_path); /* An array of prefixes */ $names_arr = array( - /* Invalid args */ - -1, - TRUE, - FALSE, - NULL, - "", - " ", - "\0", - array(), + /* Valid args (casting)*/ + -1, + TRUE, + FALSE, + NULL, + "", + " ", + "\0", + /* Invalid args */ + array(), + + /* Valid args*/ + /* prefix with path separator of a non existing directory*/ + "/no/such/file/dir", + "php/php" +); - /* prefix with path separator of a non existing directory*/ - "/no/such/file/dir", - "php/php" +$res_arr = array( + /* Invalid args */ + true, + true, + true, + true, + true, + true, + true, + false, + /* prefix with path separator of a non existing directory*/ + true, + true ); for( $i=0; $i<count($names_arr); $i++ ) { - echo "-- Iteration $i --\n"; - $file_name = tempnam("$file_path", $names_arr[$i]); + echo "-- Iteration $i --\n"; + $file_name = tempnam($file_path, $names_arr[$i]); - /* creating the files in existing dir */ - if( file_exists($file_name) ) { - echo "File name is => "; - print($file_name); - echo "\n"; + /* creating the files in existing dir */ + if (file_exists($file_name) && !$res_arr[$i]) { + echo "Failed\n"; + } + if ($res_arr[$i]) { + $file_dir = dirname($file_name); + if (realpath($file_dir) == $file_path || realpath($file_dir . "\\") == $file_path) { + echo "OK\n"; + } else { + echo "Failed, not created in the correct directory " . realpath($file_dir) . ' vs ' . $file_path ."\n"; + } + + if (!is_writable($file_name)) { + printf("%o\n", fileperms($file_name) ); - echo "File permissions are => "; - printf("%o", fileperms($file_name) ); - echo "\n"; - - echo "File created in => "; - $file_dir = dirname($file_name); - if (realpath($file_dir) == realpath(sys_get_temp_dir()) || realpath($file_dir."\\") == realpath(sys_get_temp_dir())) { - echo "temp dir\n"; - } - else if (realpath($file_dir) == realpath($file_path) || realpath($file_dir."\\") == realpath($file_path)) { - echo "directory specified\n"; - } - else { - echo "unknown location\n"; - } - } - else { - echo "-- File is not created --\n"; - } - - unlink($file_name); + } + } else { + echo "OK\n"; + } + @unlink($file_name); } rmdir($file_path); -echo "\n*** Done ***\n"; +echo "\n*** Done. ***\n"; ?> --EXPECTF-- *** Testing tempnam() with obscure prefixes *** -- Iteration 0 -- -File name is => %s\%s -File permissions are => 100666 -File created in => directory specified +OK -- Iteration 1 -- -File name is => %s\%s -File permissions are => 100666 -File created in => directory specified +OK -- Iteration 2 -- -File name is => %s\%s -File permissions are => 100666 -File created in => directory specified +OK -- Iteration 3 -- -File name is => %s\%s -File permissions are => 100666 -File created in => directory specified +OK -- Iteration 4 -- -File name is => %s\%s -File permissions are => 100666 -File created in => directory specified +OK -- Iteration 5 -- -File name is => %s\%s -File permissions are => 100666 -File created in => directory specified +Failed, not created in the correct directory %s vs %s +0 -- Iteration 6 -- -File name is => %s\%s -File permissions are => 100666 -File created in => directory specified +OK -- Iteration 7 -- -Warning: tempnam() expects parameter 2 to be string, array given in %s on line %d --- File is not created -- - -Warning: unlink(): No such file or directory in %s on line %d +Warning: tempnam() expects parameter 2 to be string, array given in %s\ext\standard\tests\file\tempnam_variation3-win32.php on line %d +OK -- Iteration 8 -- -File name is => %s\di%s -File permissions are => 100666 -File created in => directory specified +OK -- Iteration 9 -- -File name is => %s\ph%s -File permissions are => 100666 -File created in => directory specified - -*** Done *** +OK +*** Done. *** diff --git a/ext/standard/tests/file/tempnam_variation3.phpt b/ext/standard/tests/file/tempnam_variation3.phpt index a0b9511b6..69ab16c89 100644 --- a/ext/standard/tests/file/tempnam_variation3.phpt +++ b/ext/standard/tests/file/tempnam_variation3.phpt @@ -108,7 +108,7 @@ File created in => directory specified Warning: tempnam() expects parameter 2 to be string, array given in %s on line %d -- File is not created -- -Warning: unlink(): No such file or directory in %s on line %d +Warning: unlink(): %s in %s on line %d -- Iteration 8 -- File name is => %s/dir%s File permissions are => 100600 diff --git a/ext/standard/tests/file/tempnam_variation7-win32.phpt b/ext/standard/tests/file/tempnam_variation7-win32.phpt index 5096934e0..34e352a49 100644 --- a/ext/standard/tests/file/tempnam_variation7-win32.phpt +++ b/ext/standard/tests/file/tempnam_variation7-win32.phpt @@ -17,50 +17,47 @@ if(substr(PHP_OS, 0, 3) != "WIN") echo "*** Testing tempnam() with invalid/non-existing directory names ***\n"; /* An array of names, which will be passed as a dir name */ $names_arr = array( - /* Invalid args */ - -1, - TRUE, - FALSE, - NULL, - "", - " ", - "\0", - array(), - - /* Non-existing dirs */ - "/no/such/file/dir", - "php" + /* Invalid args */ + -1, + TRUE, + FALSE, + NULL, + "", + " ", + "\0", + array(), + /* Non-existing dirs */ + "/no/such/file/dir", + "php" ); for( $i=0; $i<count($names_arr); $i++ ) { - echo "-- Iteration $i --\n"; - $file_name = tempnam($names_arr[$i], "tempnam_variation3.tmp"); + echo "-- Iteration $i --\n"; + $file_name = tempnam($names_arr[$i], "tempnam_variation3.tmp"); + + if( file_exists($file_name) ){ + + echo "File name is => "; + print($file_name); + echo "\n"; - if( file_exists($file_name) ){ + echo "File permissions are => "; + printf("%o", fileperms($file_name) ); + echo "\n"; - echo "File name is => "; - print($file_name); - echo "\n"; + echo "File created in => "; + $file_dir = dirname($file_name); + if (realpath($file_dir) == realpath(sys_get_temp_dir()) || realpath($file_dir."\\") == realpath(sys_get_temp_dir())) { + echo "temp dir\n"; + } else { + echo "unknown location\n"; + } + } else { + echo "-- File is not created --\n"; + } - echo "File permissions are => "; - printf("%o", fileperms($file_name) ); - echo "\n"; - - echo "File created in => "; - $file_dir = dirname($file_name); - if (realpath($file_dir) == realpath(sys_get_temp_dir()) || realpath($file_dir."\\") == realpath(sys_get_temp_dir())) { - echo "temp dir\n"; - } - else { - echo "unknown location\n"; - } - } - else { - echo "-- File is not created --\n"; - } - - unlink($file_name); + unlink($file_name); } echo "\n*** Done ***\n"; @@ -100,7 +97,7 @@ File created in => temp dir Warning: tempnam() expects parameter 1 to be string, array given in %s on line %d -- File is not created -- -Warning: unlink(): No such file or directory in %s on line %d +Warning: unlink(): %s in %s on line %d -- Iteration 8 -- File name is => %s%et%s File permissions are => 100666 diff --git a/ext/standard/tests/file/tempnam_variation7.phpt b/ext/standard/tests/file/tempnam_variation7.phpt index 0e314dabe..18d074d28 100644 --- a/ext/standard/tests/file/tempnam_variation7.phpt +++ b/ext/standard/tests/file/tempnam_variation7.phpt @@ -102,7 +102,7 @@ File created in => temp dir Warning: tempnam() expects parameter 1 to be string, array given in %s on line %d -- File is not created -- -Warning: unlink(): No such file or directory in %s on line %d +Warning: unlink(): %s in %s on line %d -- Iteration 8 -- File name is => %s%etempnam_variation3.tmp%s File permissions are => 100600 diff --git a/ext/standard/tests/file/unlink_error-win32.phpt b/ext/standard/tests/file/unlink_error-win32.phpt index 2c913aeb5..e55f6ed5c 100644 --- a/ext/standard/tests/file/unlink_error-win32.phpt +++ b/ext/standard/tests/file/unlink_error-win32.phpt @@ -77,15 +77,15 @@ bool(true) -- Testing unlink() on invalid arguments -- -Warning: unlink(): No such file or directory in %s on line %d +Warning: unlink(): %s in %s on line %d bool(false) bool(false) -Warning: unlink(): No such file or directory in %s on line %d +Warning: unlink(): %s in %s on line %d bool(false) bool(false) -Warning: unlink(): No such file or directory in %s on line %d +Warning: unlink(): %s in %s on line %d bool(false) bool(false) diff --git a/ext/standard/tests/file/userstreams_003.phpt b/ext/standard/tests/file/userstreams_003.phpt index b30636d20..01a8efbf5 100644 --- a/ext/standard/tests/file/userstreams_003.phpt +++ b/ext/standard/tests/file/userstreams_003.phpt @@ -101,7 +101,7 @@ bool(false) value: int(0) ptrparam: -int(8192) +int(%d) $option === 3 === 3: bool(true) $value === 0 === 0: diff --git a/ext/standard/tests/file/windows_acls/common.inc b/ext/standard/tests/file/windows_acls/common.inc index 2a1adeb0a..c4276014a 100644 --- a/ext/standard/tests/file/windows_acls/common.inc +++ b/ext/standard/tests/file/windows_acls/common.inc @@ -118,7 +118,7 @@ function create_dir($name, $perms) { function create_file($name, $perms) { if (empty($name)) { - echo "create_dir: Empty name is not allowed\n"; + echo "create_file: Empty name is not allowed\n"; return; } diff --git a/ext/standard/tests/file/windows_links/bug48746.phpt b/ext/standard/tests/file/windows_links/bug48746.phpt new file mode 100644 index 000000000..6c88c6319 --- /dev/null +++ b/ext/standard/tests/file/windows_links/bug48746.phpt @@ -0,0 +1,55 @@ +--TEST--
+Bug#48746 - Junction not working properly
+
+--CREDIT--
+Venkat Raman Don (don.raman@microsoft.com)
+
+--SKIPIF--
+<?php
+if(substr(PHP_OS, 0, 3) != 'WIN' ) {
+ die('skip windows only test');
+}
+$cmd = "mklink.exe /?";
+$ret = @exec($cmd, $output, $return_val);
+if (count($output) == 0) {
+ die("mklink.exe not found in PATH");
+}
+?>
+--FILE--
+<?php
+$old_dir = __DIR__;
+$dirname = __DIR__ . "\\mnt\\test\\directory";
+mkdir($dirname, 0700, true);
+chdir(__DIR__ . "\\mnt\\test");
+$drive = substr(__DIR__, 0, 2);
+$pathwithoutdrive = substr(__DIR__, 2);
+$ret = exec("mountvol " . $drive . " /L", $output, $ret_val);
+exec("mklink /j mounted_volume " . $ret, $output, $ret_val);
+$fullpath = "mounted_volume" . $pathwithoutdrive;
+exec("mklink /j mklink_junction directory", $output, $ret_val);
+var_dump(file_exists("directory"));
+var_dump(file_exists("mklink_junction"));
+var_dump(file_exists("mounted_volume"));
+var_dump(file_exists("$fullpath"));
+var_dump(is_dir("mklink_junction"));
+var_dump(is_dir("$fullpath"));
+var_dump(is_readable("mklink_junction"));
+var_dump(is_writeable("$fullpath"));
+chdir($old_dir);
+
+rmdir(__DIR__ . "\\mnt\\test\\directory");
+rmdir(__DIR__ . "\\mnt\\test\\mklink_junction");
+rmdir(__DIR__ . "\\mnt\\test\\mounted_volume");
+rmdir(__DIR__ . "\\mnt\\test");
+rmdir(__DIR__ . "\\mnt");
+
+?>
+--EXPECT--
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
diff --git a/ext/standard/tests/file/windows_links/bug48746_1.phpt b/ext/standard/tests/file/windows_links/bug48746_1.phpt new file mode 100644 index 000000000..ca8450a89 --- /dev/null +++ b/ext/standard/tests/file/windows_links/bug48746_1.phpt @@ -0,0 +1,56 @@ +--TEST--
+Bug#48746 - Junction not working properly
+
+--CREDIT--
+Venkat Raman Don (don.raman@microsoft.com)
+
+--SKIPIF--
+<?php
+if(substr(PHP_OS, 0, 3) != 'WIN' ) {
+ die('skip windows only test');
+}
+$cmd = "mklink.exe /?";
+$ret = @exec($cmd, $output, $return_val);
+if (count($output) == 0) {
+ die("mklink.exe not found in PATH");
+}
+?>
+--FILE--
+<?php
+$old_dir = __DIR__;
+$dirname = __DIR__ . "\\mnt\\test\\directory";
+exec("mkdir " . $dirname, $output, $ret_val);
+chdir(__DIR__ . "\\mnt\\test");
+$drive = substr(__DIR__, 0, 2);
+$pathwithoutdrive = substr(__DIR__, 2);
+$ret = exec("mountvol " . $drive . " /L", $output, $ret_val);
+exec("mklink /j mounted_volume " . $ret, $output, $ret_val);
+$fullpath = "mounted_volume" . $pathwithoutdrive;
+exec("mklink /j mklink_junction directory", $output, $ret_val);
+file_put_contents("mklink_junction\\a.php", "<?php echo \"I am included.\n\" ?>");
+include_once "mklink_junction\\a.php";
+file_put_contents("$fullpath\\mnt\\test\\directory\\b.php", "<?php echo \"I am included.\n\" ?>");
+require "$fullpath\\mnt\\test\\directory\\b.php";
+file_put_contents("$fullpath\\mnt\\test\\mklink_junction\\c.php", "<?php echo \"I am included.\n\" ?>");
+require_once "$fullpath\\mnt\\test\\mklink_junction\\c.php";
+var_dump(is_file("mklink_junction\\a.php"));
+var_dump(is_file("$fullpath\\mnt\\test\\directory\\b.php"));
+var_dump(is_file("$fullpath\\mnt\\test\\mklink_junction\\c.php"));
+unlink("$fullpath\\mnt\\test\\directory\\b.php");
+unlink("$fullpath\\mnt\\test\\mklink_junction\\c.php");
+unlink("mklink_junction\\a.php");
+chdir($old_dir);
+rmdir(__DIR__ . "\\mnt\\test\\directory");
+rmdir(__DIR__ . "\\mnt\\test\\mklink_junction");
+rmdir(__DIR__ . "\\mnt\\test\\mounted_volume");
+rmdir(__DIR__ . "\\mnt\\test");
+rmdir(__DIR__ . "\\mnt");
+
+?>
+--EXPECT--
+I am included.
+I am included.
+I am included.
+bool(true)
+bool(true)
+bool(true) diff --git a/ext/standard/tests/file/windows_links/bug48746_2.phpt b/ext/standard/tests/file/windows_links/bug48746_2.phpt new file mode 100644 index 000000000..7beed1691 --- /dev/null +++ b/ext/standard/tests/file/windows_links/bug48746_2.phpt @@ -0,0 +1,66 @@ +--TEST--
+Bug#48746 - Junction not working properly
+
+--CREDIT--
+Venkat Raman Don (don.raman@microsoft.com)
+
+--SKIPIF--
+<?php
+if(substr(PHP_OS, 0, 3) != 'WIN' ) {
+ die('skip windows only test');
+}
+$ret = exec('mklink bug48746_tmp.lnk ' . __FILE__ .' 2>&1', $out);
+if (strpos($ret, 'privilege')) {
+ die('skip. SeCreateSymbolicLinkPrivilege not enable for this user.');
+}
+unlink('mklink bug48746_tmp.lnk');
+?>
+--FILE--
+<?php
+$old_dir = __DIR__;
+$dirname = __DIR__ . "\\mnt\\test\\directory";
+exec("mkdir " . $dirname, $output, $ret_val);
+chdir(__DIR__ . "\\mnt\\test");
+$drive = substr(__DIR__, 0, 2);
+$pathwithoutdrive = substr(__DIR__, 2);
+$ret = exec("mountvol " . $drive . " /L", $output, $ret_val);
+exec("mklink /j mounted_volume " . $ret, $output, $ret_val);
+$fullpath = "mounted_volume" . $pathwithoutdrive;
+exec("mklink /j mklink_junction directory", $output, $ret_val);
+file_put_contents("mklink_junction\\a.php", "<?php echo \"I am included.\n\" ?>");
+file_put_contents("$fullpath\\mnt\\test\\directory\\b.php", "<?php echo \"I am included.\n\" ?>");
+print_r(scandir("mklink_junction"));
+print_r(scandir("$fullpath\\mnt\\test\\directory"));
+print_r(scandir("$fullpath\\mnt\\test\\mklink_junction"));
+unlink("$fullpath\\mnt\\test\\directory\\b.php");
+unlink("mklink_junction\\a.php");
+chdir($old_dir);
+rmdir(__DIR__ . "\\mnt\\test\\directory");
+rmdir(__DIR__ . "\\mnt\\test\\mklink_junction");
+rmdir(__DIR__ . "\\mnt\\test\\mounted_volume");
+rmdir(__DIR__ . "\\mnt\\test");
+rmdir(__DIR__ . "\\mnt");
+
+?>
+--EXPECT--
+Array
+(
+ [0] => .
+ [1] => ..
+ [2] => a.php
+ [3] => b.php
+)
+Array
+(
+ [0] => .
+ [1] => ..
+ [2] => a.php
+ [3] => b.php
+)
+Array
+(
+ [0] => .
+ [1] => ..
+ [2] => a.php
+ [3] => b.php
+) diff --git a/ext/standard/tests/file/windows_links/bug48746_3.phpt b/ext/standard/tests/file/windows_links/bug48746_3.phpt new file mode 100644 index 000000000..a0dcbdc02 --- /dev/null +++ b/ext/standard/tests/file/windows_links/bug48746_3.phpt @@ -0,0 +1,48 @@ +--TEST--
+Bug#48746 - Junction not working properly
+
+--CREDIT--
+Venkat Raman Don (don.raman@microsoft.com)
+
+--SKIPIF--
+<?php
+if(substr(PHP_OS, 0, 3) != 'WIN' ) {
+ die('skip windows only test');
+}
+$ret = exec('junction /? 2>&1', $out);
+if (strpos($out[0], 'recognized')) {
+ die('skip. junction.exe not found in PATH.');
+}
+
+?>
+--FILE--
+<?php
+$old_dir = __DIR__;
+$dirname = __DIR__ . "\\mnt\\test\\directory";
+exec("mkdir " . $dirname, $output, $ret_val);
+chdir(__DIR__ . "\\mnt\\test");
+exec("junction junction directory", $output, $ret_val);
+file_put_contents("junction\\a.php", "<?php echo \"I am included.\n\" ?>");
+file_put_contents("junction\\b.php", "<?php echo \"I am included.\n\" ?>");
+include "junction/a.php";
+require_once "junction\\b.php";
+print_r(scandir("junction"));
+unlink("junction\\a.php");
+unlink("junction\\b.php");
+chdir($old_dir);
+rmdir(__DIR__ . "\\mnt\\test\\directory");
+rmdir(__DIR__ . "\\mnt\\test\\junction");
+rmdir(__DIR__ . "\\mnt\\test");
+rmdir(__DIR__ . "\\mnt");
+
+?>
+--EXPECT--
+I am included.
+I am included.
+Array
+(
+ [0] => .
+ [1] => ..
+ [2] => a.php
+ [3] => b.php
+) diff --git a/ext/standard/tests/general_functions/.getservbyport_basic.phpt.swp b/ext/standard/tests/general_functions/.getservbyport_basic.phpt.swp Binary files differdeleted file mode 100644 index dc8000aa0..000000000 --- a/ext/standard/tests/general_functions/.getservbyport_basic.phpt.swp +++ /dev/null diff --git a/ext/standard/tests/general_functions/bug49692.ini b/ext/standard/tests/general_functions/bug49692.ini new file mode 100644 index 000000000..5def69a2b --- /dev/null +++ b/ext/standard/tests/general_functions/bug49692.ini @@ -0,0 +1,4 @@ +//my.ini file +[sitemap] +/home = default:index +/info = default:info diff --git a/ext/standard/tests/general_functions/bug49692.phpt b/ext/standard/tests/general_functions/bug49692.phpt new file mode 100644 index 000000000..80a1612d9 --- /dev/null +++ b/ext/standard/tests/general_functions/bug49692.phpt @@ -0,0 +1,20 @@ +--TEST-- +Bug #49692: parse_ini_file() throws errors when key contains '/' (forward slash) +--CREDITS-- +Rafael Dohms <rdohms [at] gmail [dot] com> +--FILE-- +<?php + +var_dump(parse_ini_file('bug49692.ini', true)); + +?> +--EXPECTF-- +array(1) { + ["sitemap"]=> + array(2) { + ["/home"]=> + string(13) "default:index" + ["/info"]=> + string(12) "default:info" + } +} diff --git a/ext/standard/tests/general_functions/bug49847.phpt b/ext/standard/tests/general_functions/bug49847.phpt new file mode 100644 index 000000000..8895202d0 --- /dev/null +++ b/ext/standard/tests/general_functions/bug49847.phpt @@ -0,0 +1,25 @@ +--TEST-- +Bug #49847 (exec() fails on lines larger then 4095 bytes) +--FILE-- +<?php +$iswin = substr(PHP_OS, 0, 3) == "WIN"; + +if ($iswin) { + $f = dirname(__FILE__) . '\\bug49847.tmp'; + $s = str_repeat(' ', 4097); + $s .= '1'; + file_put_contents($f, $s); + exec('more ' . $f, $output); +} else { + exec("printf %4098d 1", $output); +} +var_dump($output); +if ($iswin) { + unlink($f); +} +?> +--EXPECTF-- +array(1) { + [0]=> + string(4098) "%s 1" +} diff --git a/ext/standard/tests/general_functions/bug50690.phpt b/ext/standard/tests/general_functions/bug50690.phpt new file mode 100644 index 000000000..4d9f0dc5e --- /dev/null +++ b/ext/standard/tests/general_functions/bug50690.phpt @@ -0,0 +1,14 @@ +--TEST--
+Bug #23650 (putenv() does not assign values when the value is one character)
+--FILE--
+<?php
+putenv("foo=ab");
+putenv("bar=c");
+var_dump(getenv("foo"));
+var_dump(getenv("bar"));
+var_dump(getenv("thisvardoesnotexist"));
+?>
+--EXPECT--
+string(2) "ab"
+string(1) "c"
+bool(false)
diff --git a/ext/standard/tests/general_functions/bug50732.phpt b/ext/standard/tests/general_functions/bug50732.phpt new file mode 100644 index 000000000..ed8341dec --- /dev/null +++ b/ext/standard/tests/general_functions/bug50732.phpt @@ -0,0 +1,12 @@ +--TEST-- +Bug #50732 (exec() adds single byte twice to $output array) +--FILE-- +<?php +exec("echo x", $output); +var_dump($output); +?> +--EXPECT-- +array(1) { + [0]=> + string(1) "x" +} diff --git a/ext/standard/tests/general_functions/get_cfg_var_variation8.phpt b/ext/standard/tests/general_functions/get_cfg_var_variation8.phpt index 22188c7e6..31bcb80fc 100644 --- a/ext/standard/tests/general_functions/get_cfg_var_variation8.phpt +++ b/ext/standard/tests/general_functions/get_cfg_var_variation8.phpt @@ -14,7 +14,7 @@ var_dump(get_cfg_var( 'register_globals' ) ); ?> --EXPECTF-- -PHP Warning: Directive 'register_globals' is deprecated in PHP 5.3 and greater in %s on line 0 +Warning: Directive 'register_globals' is deprecated in PHP 5.3 and greater in %s on line 0 *** Test by calling method or function with deprecated option *** string(1) "1" diff --git a/ext/standard/tests/general_functions/import_request.phpt b/ext/standard/tests/general_functions/import_request.phpt index a1181471c..0f9e93bf0 100644 --- a/ext/standard/tests/general_functions/import_request.phpt +++ b/ext/standard/tests/general_functions/import_request.phpt @@ -30,24 +30,24 @@ echo "Done\n"; --EXPECTF-- Warning: import_request_variables() expects at least 1 parameter, 0 given in %s on line %d NULL -NULL +bool(false) Notice: import_request_variables(): No prefix specified - possible security hazard in %s on line %d -NULL +bool(false) Notice: import_request_variables(): No prefix specified - possible security hazard in %s on line %d Warning: import_request_variables(): Attempted GLOBALS variable overwrite in %s on line %d Warning: import_request_variables(): Numeric key detected - possible security hazard in %s on line %d -NULL +bool(true) Notice: Undefined variable: ap in %s on line %d string(1) "1" string(3) "heh" string(1) "3" NULL -NULL +bool(true) Notice: Undefined variable: g_ap in %s on line %d string(1) "1" @@ -55,7 +55,7 @@ string(3) "heh" string(1) "3" NULL string(2) "hm" -NULL +bool(true) string(1) "1" string(3) "heh" string(1) "3" @@ -66,7 +66,7 @@ array(1) { [0]=> string(2) "ar" } -NULL +bool(true) Notice: Undefined variable: r_ap in %s on line %d string(1) "1" diff --git a/ext/standard/tests/general_functions/is_callable_basic1.phpt b/ext/standard/tests/general_functions/is_callable_basic1.phpt index e836d734f..fe4d6e26e 100644 --- a/ext/standard/tests/general_functions/is_callable_basic1.phpt +++ b/ext/standard/tests/general_functions/is_callable_basic1.phpt @@ -64,7 +64,7 @@ check_iscallable($defined_functions); ?> ===DONE=== ---EXPECT--- +--EXPECT-- *** Testing is_callable() on defined functions *** -- Iteration 1 -- bool(true) @@ -106,4 +106,4 @@ Hello_World bool(true) bool(true) Hello_World -===DONE===
\ No newline at end of file +===DONE=== diff --git a/ext/standard/tests/general_functions/phpcredits.phpt b/ext/standard/tests/general_functions/phpcredits.phpt index 69515dfe6..0aff6142f 100644 --- a/ext/standard/tests/general_functions/phpcredits.phpt +++ b/ext/standard/tests/general_functions/phpcredits.phpt @@ -37,7 +37,7 @@ Language Design & Concept PHP Quality Assurance Team %a -PHP Website Team +%wWebsites and Infrastructure team%w %a bool(true) diff --git a/ext/standard/tests/general_functions/proc_nice_basic.phpt b/ext/standard/tests/general_functions/proc_nice_basic.phpt index 5a9575627..3a958901a 100644 --- a/ext/standard/tests/general_functions/proc_nice_basic.phpt +++ b/ext/standard/tests/general_functions/proc_nice_basic.phpt @@ -5,6 +5,10 @@ Italian PHP TestFest 2009 Cesena 19-20-21 june Fabio Fabbrucci (fabbrucci@grupporetina.com) Michele Orselli (mo@ideato.it) Simone Gentili (sensorario@gmail.com) +--SKIPIF-- +<?php +if(!function_exists('proc_nice')) die("skip. proc_nice not available "); +?> --FILE-- <?php function getNice($id) diff --git a/ext/standard/tests/general_functions/proc_nice_error.phpt b/ext/standard/tests/general_functions/proc_nice_error.phpt index c50812c86..09f84fa55 100644 --- a/ext/standard/tests/general_functions/proc_nice_error.phpt +++ b/ext/standard/tests/general_functions/proc_nice_error.phpt @@ -1,5 +1,9 @@ --TEST-- Test function proc_nice() by calling it more than or less than its expected arguments +--SKIPIF-- +<?php +if(!function_exists('proc_nice')) die("skip. proc_nice not available "); +?> --FILE-- <?php diff --git a/ext/standard/tests/general_functions/proc_nice_variation1.phpt b/ext/standard/tests/general_functions/proc_nice_variation1.phpt index b86155c4b..8c2bdf0df 100644 --- a/ext/standard/tests/general_functions/proc_nice_variation1.phpt +++ b/ext/standard/tests/general_functions/proc_nice_variation1.phpt @@ -5,6 +5,10 @@ Italian PHP TestFest 2009 Cesena 19-20-21 june Fabio Fabbrucci (fabbrucci@grupporetina.com) Michele Orselli (mo@ideato.it) Simone Gentili (sensorario@gmail.com) +--SKIPIF-- +<?php +if(!function_exists('proc_nice')) die("skip. proc_nice not available "); +?> --FILE-- <?php diff --git a/ext/standard/tests/general_functions/proc_nice_variation2.phpt b/ext/standard/tests/general_functions/proc_nice_variation2.phpt index 620fe9144..42cbf9e00 100644 --- a/ext/standard/tests/general_functions/proc_nice_variation2.phpt +++ b/ext/standard/tests/general_functions/proc_nice_variation2.phpt @@ -5,6 +5,10 @@ Italian PHP TestFest 2009 Cesena 19-20-21 june Fabio Fabbrucci (fabbrucci@grupporetina.com) Michele Orselli (mo@ideato.it) Simone Gentili (sensorario@gmail.com) +--SKIPIF-- +<?php +if(!function_exists('proc_nice')) die("skip. proc_nice not available "); +?> --FILE-- <?php diff --git a/ext/standard/tests/general_functions/proc_nice_variation3.phpt b/ext/standard/tests/general_functions/proc_nice_variation3.phpt index 458126db4..46b444358 100644 --- a/ext/standard/tests/general_functions/proc_nice_variation3.phpt +++ b/ext/standard/tests/general_functions/proc_nice_variation3.phpt @@ -5,6 +5,10 @@ Italian PHP TestFest 2009 Cesena 19-20-21 june Fabio Fabbrucci (fabbrucci@grupporetina.com) Michele Orselli (mo@ideato.it) Simone Gentili (sensorario@gmail.com) +--SKIPIF-- +<?php +if(!function_exists('proc_nice')) die("skip. proc_nice not available "); +?> --FILE-- <?php diff --git a/ext/standard/tests/general_functions/proc_nice_variation5.phpt b/ext/standard/tests/general_functions/proc_nice_variation5.phpt index d8325106b..c22ca56ca 100644 --- a/ext/standard/tests/general_functions/proc_nice_variation5.phpt +++ b/ext/standard/tests/general_functions/proc_nice_variation5.phpt @@ -5,6 +5,11 @@ Italian PHP TestFest 2009 Cesena 19-20-21 june Fabio Fabbrucci (fabbrucci@grupporetina.com) Michele Orselli (mo@ideato.it) Simone Gentili (sensorario@gmail.com) +--SKIPIF-- +<?php + if(!function_exists('proc_nice')) die("skip. proc_nice not available "); + if(posix_geteuid() == 0) print "skip - Cannot run test as root."; +?> --FILE-- <?php diff --git a/ext/standard/tests/general_functions/proc_nice_variation6.phpt b/ext/standard/tests/general_functions/proc_nice_variation6.phpt index b4babd593..d52c0c079 100644 --- a/ext/standard/tests/general_functions/proc_nice_variation6.phpt +++ b/ext/standard/tests/general_functions/proc_nice_variation6.phpt @@ -5,6 +5,10 @@ Italian PHP TestFest 2009 Cesena 19-20-21 june Fabio Fabbrucci (fabbrucci@grupporetina.com) Michele Orselli (mo@ideato.it) Simone Gentili (sensorario@gmail.com) +--SKIPIF-- +<?php +if(!function_exists('proc_nice')) die("skip. proc_nice not available "); +?> --FILE-- <?php diff --git a/ext/standard/tests/general_functions/proc_nice_variation7.phpt b/ext/standard/tests/general_functions/proc_nice_variation7.phpt index 70487dd09..26dbab503 100644 --- a/ext/standard/tests/general_functions/proc_nice_variation7.phpt +++ b/ext/standard/tests/general_functions/proc_nice_variation7.phpt @@ -5,6 +5,10 @@ Italian PHP TestFest 2009 Cesena 19-20-21 june Fabio Fabbrucci (fabbrucci@grupporetina.com) Michele Orselli (mo@ideato.it) Simone Gentili (sensorario@gmail.com) +--SKIPIF-- +<?php +if(!function_exists('proc_nice')) die("skip. proc_nice not available "); +?> --FILE-- <?php diff --git a/ext/standard/tests/general_functions/putenv_error1.phpt b/ext/standard/tests/general_functions/putenv_error1.phpt index c5af05a93..c4b49f3f8 100644 --- a/ext/standard/tests/general_functions/putenv_error1.phpt +++ b/ext/standard/tests/general_functions/putenv_error1.phpt @@ -16,7 +16,7 @@ print ($set ? 'it worked' : 'boo') . "\n"; ?> ==DONE== --EXPECTF-- -PHP Warning: Directive 'safe_mode' is deprecated in PHP 5.3 and greater in Unknown on line 0 +Warning: Directive 'safe_mode' is deprecated in PHP 5.3 and greater in Unknown on line 0 Warning: putenv(): Safe Mode warning: Cannot set environment variable 'FOO' - it's not in the allowed list in %s on line %d diff --git a/ext/standard/tests/general_functions/putenv_error2.phpt b/ext/standard/tests/general_functions/putenv_error2.phpt index 365f0e544..456a7ab69 100644 --- a/ext/standard/tests/general_functions/putenv_error2.phpt +++ b/ext/standard/tests/general_functions/putenv_error2.phpt @@ -12,7 +12,7 @@ putenv('BAZ=bop'); ?> ==DONE== --EXPECTF-- -PHP Warning: Directive 'safe_mode' is deprecated in PHP 5.3 and greater in Unknown on line 0 +Warning: Directive 'safe_mode' is deprecated in PHP 5.3 and greater in Unknown on line 0 Warning: putenv(): Safe Mode warning: Cannot override protected environment variable 'FOO' in %s on line %d diff --git a/ext/standard/tests/general_functions/strval.phpt b/ext/standard/tests/general_functions/strval.phpt index 1789e41d6..350678578 100644 --- a/ext/standard/tests/general_functions/strval.phpt +++ b/ext/standard/tests/general_functions/strval.phpt @@ -267,10 +267,10 @@ string(4) "true" -- Iteration 54 -- string(4) "true" -- Iteration 55 -- -string(54) "This is a multiline heredoc +string(5%d) "This is a multiline heredoc string. Numeric = 1232455." -- Iteration 56 -- -string(10) "12345 +string(1%d) "12345 2345" -- Iteration 57 -- string(0) "" diff --git a/ext/standard/tests/general_functions/sunfuncts.phpt b/ext/standard/tests/general_functions/sunfuncts.phpt deleted file mode 100644 index 59acb122c..000000000 --- a/ext/standard/tests/general_functions/sunfuncts.phpt +++ /dev/null @@ -1,42 +0,0 @@ ---TEST-- -date_sunrise() and date_sunset() functions ---INI-- -precision=13 ---FILE-- -<?php -date_default_timezone_set('Asia/Jerusalem'); -for($a=1;$a<=12;$a++){ - echo date_sunrise(mktime(1,1,1,$a,1,2003),SUNFUNCS_RET_TIMESTAMP,31.76670,35.23330,90.83,2)." "; - echo date_sunrise(mktime(1,1,1,$a,1,2003),SUNFUNCS_RET_STRING,31.76670,35.23330,90.83,2)." "; - echo date_sunrise(mktime(1,1,1,$a,1,2003),SUNFUNCS_RET_DOUBLE,31.76670,35.23330,90.83,2)."\n"; - - echo date_sunset(mktime(1,1,1,$a,1,2003),SUNFUNCS_RET_TIMESTAMP,31.76670,35.23330,90.83,2)." "; - echo date_sunset(mktime(1,1,1,$a,1,2003),SUNFUNCS_RET_STRING,31.76670,35.23330,90.83,2)." "; - echo date_sunset(mktime(1,1,1,$a,1,2003),SUNFUNCS_RET_DOUBLE,31.76670,35.23330,90.83,2)."\n"; -} -?> ---EXPECTF-- -1041395864 06:37 6.6290131458%d -1041432452 16:47 16.792451114%d -1044073855 06:30 6.5154089279%d -1044112463 17:14 17.239870289%d -1046491495 06:04 6.0822145033%d -1046533075 17:37 17.632011035%d -1049167581 05:26 5.4394438111%d -1049212774 17:59 17.993035729%d -1051757532 04:52 4.8701934126%d -1051806007 18:20 18.335390508%d -1054434776 04:32 4.5489827182%d -1054485647 18:40 18.679812949%d -1057026949 04:35 4.5971956372%d -1057078197 18:49 18.832563396%d -1059706409 04:53 4.8916575089%d -1059755837 18:37 18.621440704%d -1062385999 05:13 5.2220951121%d -1062432291 18:04 18.080957168%d -1064979098 05:31 5.5273199215%d -1065021952 17:25 17.431339135%d -1067658845 05:54 5.9016292870%d -1067698274 16:51 16.853902453%d -1070252387 06:19 6.3299242689%d -1070289382 16:36 16.606312600%d diff --git a/ext/standard/tests/mail/mail_basic.phpt b/ext/standard/tests/mail/mail_basic.phpt index 77ff3512d..fecb50f32 100644 --- a/ext/standard/tests/mail/mail_basic.phpt +++ b/ext/standard/tests/mail/mail_basic.phpt @@ -2,6 +2,7 @@ Test mail() function : basic functionality --INI-- sendmail_path=tee mailBasic.out >/dev/null +mail.add_x_header = Off --SKIPIF-- <?php if(substr(PHP_OS, 0, 3) == "WIN") diff --git a/ext/standard/tests/mail/mail_basic2.phpt b/ext/standard/tests/mail/mail_basic2.phpt index 8f9ef6413..2ac4d20b1 100644 --- a/ext/standard/tests/mail/mail_basic2.phpt +++ b/ext/standard/tests/mail/mail_basic2.phpt @@ -6,7 +6,8 @@ if(substr(PHP_OS, 0, 3) == "WIN") die("skip Won't run on Windows"); ?> --INI-- -sendmail_path="echo --- > /tmp/php_test_mailBasic2.out" +sendmail_path="sed > /tmp/php_test_mailBasic2.out" +mail.add_x_header = Off --FILE-- <?php /* Prototype : int mail(string to, string subject, string message [, string additional_headers [, string additional_parameters]]) @@ -23,7 +24,7 @@ $to = 'user@company.com'; $subject = 'Test Subject'; $message = 'A Message'; $additional_headers = 'KHeaders'; -$additional_parameters = "Extras"; +$additional_parameters = "-e '5 a--- Extras'"; $outFile = "/tmp/php_test_mailBasic2.out"; @unlink($outFile); @@ -31,11 +32,6 @@ echo "-- extra parameters --\n"; // Calling mail() with all possible arguments var_dump( mail($to, $subject, $message, $additional_headers, $additional_parameters) ); -//This test is just using a shell command (see the INI setting). The sleep() -//is used because that can take a while. If you see the test failing sometimes try -//increasing the length of the sleep. - -sleep(5); echo file_get_contents($outFile); unlink($outFile); ?> @@ -44,5 +40,10 @@ unlink($outFile); *** Testing mail() : basic functionality *** -- extra parameters -- bool(true) +To: user@company.com +Subject: Test Subject +KHeaders + +A Message --- Extras ===DONE=== diff --git a/ext/standard/tests/mail/mail_variation2.phpt b/ext/standard/tests/mail/mail_variation2.phpt index 59ef1d902..d6eafd2e5 100644 --- a/ext/standard/tests/mail/mail_variation2.phpt +++ b/ext/standard/tests/mail/mail_variation2.phpt @@ -1,8 +1,9 @@ --TEST-- Test mail() function : variation force extra parameters --INI-- -sendmail_path="echo --- > /tmp/php_test_mailVariation2.out" -mail.force_extra_parameters="forced params" +sendmail_path="sed > /tmp/php_test_mailVariation2.out" +mail.force_extra_parameters="-e4a---forced-params" +mail.add_x_header = Off --SKIPIF-- <?php if(substr(PHP_OS, 0, 3) == "WIN") @@ -35,5 +36,9 @@ unlink($outFile); --EXPECT-- *** Testing mail() : basic functionality *** bool(true) ---- forced params +To: user@company.com +Subject: Test Subject + +A Message +---forced-params ===DONE=== diff --git a/ext/standard/tests/misc/syslog_vars_variation1.phpt b/ext/standard/tests/misc/syslog_vars_variation1.phpt index c5b998527..ae53a57bc 100644 --- a/ext/standard/tests/misc/syslog_vars_variation1.phpt +++ b/ext/standard/tests/misc/syslog_vars_variation1.phpt @@ -7,5 +7,5 @@ define_syslog_variables=On var_dump(isset($LOG_ERR)); ?> --EXPECTF-- -PHP Warning: Directive 'define_syslog_variables' is deprecated in PHP 5.3 and greater in Unknown on line 0 +Warning: Directive 'define_syslog_variables' is deprecated in PHP 5.3 and greater in Unknown on line 0 bool(true) diff --git a/ext/standard/tests/misc/time_sleep_until_error2.phpt b/ext/standard/tests/misc/time_sleep_until_error2.phpt index 311dd72f6..d20c8ab65 100644 --- a/ext/standard/tests/misc/time_sleep_until_error2.phpt +++ b/ext/standard/tests/misc/time_sleep_until_error2.phpt @@ -1,5 +1,9 @@ --TEST-- time_sleep_until() function - error test for time_sleep_until() +--SKIPIF-- +<?php + function_exists('time_sleep_until') or die('skip time_sleep_until() is not supported in this build.'); +?> --CREDITS-- Filippo De Santis fd@ideato.it #PHPTestFest Cesena Italia on 2009-06-20 diff --git a/ext/standard/tests/network/define_syslog_variables_variation-win32.phpt b/ext/standard/tests/network/define_syslog_variables_variation-win32.phpt deleted file mode 100644 index ac7dac8ab..000000000 --- a/ext/standard/tests/network/define_syslog_variables_variation-win32.phpt +++ /dev/null @@ -1,97 +0,0 @@ ---TEST-- -Test define_syslog_variables() function : variation ---INI-- -define_syslog_variables = true ---SKIPIF-- -<?php -if(substr(PHP_OS, 0, 3) != "WIN") - die("skip Only run on Windows"); -?> ---FILE-- -<?php -/* Prototype : void define_syslog_variables(void) - * Description: Initializes all syslog-related variables - * Source code: ext/standard/syslog.c - * Alias to functions: - */ - -echo "*** Testing define_syslog_variables() : variation ***\n"; - -$log_constants = array( - LOG_EMERG, - LOG_ALERT, - LOG_CRIT, - LOG_ERR, - LOG_WARNING, - LOG_NOTICE, - LOG_INFO, - LOG_DEBUG, - LOG_KERN, - LOG_USER, - LOG_MAIL, - LOG_DAEMON, - LOG_AUTH, - LOG_SYSLOG, - LOG_LPR, - LOG_NEWS, - LOG_UUCP, - LOG_CRON, - LOG_AUTHPRIV, - LOG_PID, - LOG_CONS, - LOG_ODELAY, - LOG_NDELAY, - LOG_NOWAIT, - LOG_PERROR, -); - - -$log_variables = array( - "LOG_EMERG", - "LOG_ALERT", - "LOG_CRIT", - "LOG_ERR", - "LOG_WARNING", - "LOG_NOTICE", - "LOG_INFO", - "LOG_DEBUG", - "LOG_KERN", - "LOG_USER", - "LOG_MAIL", - "LOG_DAEMON", - "LOG_AUTH", - "LOG_SYSLOG", - "LOG_LPR", - "LOG_NEWS", - "LOG_UUCP", - "LOG_CRON", - "LOG_AUTHPRIV", - "LOG_PID", - "LOG_CONS", - "LOG_ODELAY", - "LOG_NDELAY", - "LOG_NOWAIT", - "LOG_PERROR", -); - -error_reporting(E_ALL); -$failed = false; - -// show variables defined -for ($t = 0; $t < count($log_variables); $t++) { - if (isset($$log_variables[$t]) === false || $$log_variables[$t] != $log_constants[$t]) { - $failed = true; - echo "FAILED: $log_variables[$t] doesn't contain the correct value\n"; - } -} - -if ($failed == false) { - echo "PASSED\n"; -} -?> -===DONE=== ---EXPECT-- -*** Testing define_syslog_variables() : variation *** -PASSED -===DONE=== -PHP Warning: Directive 'define_syslog_variables' is deprecated in PHP 5.3 and greater in Unknown on line 0 diff --git a/ext/standard/tests/network/define_syslog_variables_variation.phpt b/ext/standard/tests/network/define_syslog_variables_variation.phpt index 1e35633bc..e5842b036 100644 --- a/ext/standard/tests/network/define_syslog_variables_variation.phpt +++ b/ext/standard/tests/network/define_syslog_variables_variation.phpt @@ -1,12 +1,5 @@ --TEST-- Test define_syslog_variables() function : variation ---SKIPIF-- -<?php -if(substr(PHP_OS, 0, 3) == "WIN") - die("skip don't run on Windows"); -?> ---INI-- -define_syslog_variables = true --FILE-- <?php /* Prototype : void define_syslog_variables(void) @@ -15,6 +8,8 @@ define_syslog_variables = true * Alias to functions: */ +define_syslog_variables(); + echo "*** Testing define_syslog_variables() : variation ***\n"; $log_constants = array( @@ -90,8 +85,8 @@ if ($failed == false) { } ?> ===DONE=== ---EXPECT-- -PHP Warning: Directive 'define_syslog_variables' is deprecated in PHP 5.3 and greater in Unknown on line 0 +--EXPECTF-- +Deprecated: Function define_syslog_variables() is deprecated in %s on line %d *** Testing define_syslog_variables() : variation *** PASSED ===DONE=== diff --git a/ext/standard/tests/php_ini_loaded_file.phpt b/ext/standard/tests/php_ini_loaded_file.phpt index ab26953ea..b443c5f70 100644 --- a/ext/standard/tests/php_ini_loaded_file.phpt +++ b/ext/standard/tests/php_ini_loaded_file.phpt @@ -8,6 +8,5 @@ Testfest 2009 Munich <?php var_dump(php_ini_loaded_file()); ?> ---EXPECT-- -bool(false) - +--EXPECTF-- +string(%d) "%s/tmp-php.ini" diff --git a/ext/standard/tests/streams/bug49936.phpt b/ext/standard/tests/streams/bug49936.phpt new file mode 100644 index 000000000..d77e161c5 --- /dev/null +++ b/ext/standard/tests/streams/bug49936.phpt @@ -0,0 +1,26 @@ +--TEST-- +Bug #49936 (crash with ftp stream in php_stream_context_get_option()) +--SKIPIF-- +<?php +if( substr(PHP_OS, 0, 3) == "WIN" ) + die("skip. Do not run on Windows"); +?> +--FILE-- +<?php + +$dir = 'ftp://your:self@localhost/'; + +var_dump(opendir($dir)); +var_dump(opendir($dir)); + +?> +--EXPECTF-- +Warning: opendir(): connect() failed: Connection refused in %s on line %d + +Warning: opendir(ftp://...@localhost/): failed to open dir: operation failed in %s on line %d +bool(false) + +Warning: opendir(): connect() failed: Connection refused in %s on line %d + +Warning: opendir(ftp://...@localhost/): failed to open dir: operation failed in %s on line %d +bool(false) diff --git a/ext/standard/tests/streams/bug49936_win32.phpt b/ext/standard/tests/streams/bug49936_win32.phpt new file mode 100644 index 000000000..4db4a5044 --- /dev/null +++ b/ext/standard/tests/streams/bug49936_win32.phpt @@ -0,0 +1,30 @@ +--TEST--
+Bug #49936 (crash with ftp stream in php_stream_context_get_option())
+--SKIPIF--
+<?php
+if( substr(PHP_OS, 0, 3) != "WIN" )
+ die("skip. Do run on Windows only");
+?>
+--INI--
+default_socket_timeout=2
+--FILE--
+<?php
+
+$dir = 'ftp://your:self@localhost/';
+
+var_dump(opendir($dir));
+var_dump(opendir($dir));
+
+?>
+--EXPECTF--
+Warning: opendir(): connect() failed: %s
+ in %s on line %d
+
+Warning: opendir(ftp://...@localhost/): failed to open dir: operation failed in %s on line %d
+bool(false)
+
+Warning: opendir(): connect() failed: %s
+ in %s on line %d
+
+Warning: opendir(ftp://...@localhost/): failed to open dir: operation failed in %s on line %d
+bool(false)
diff --git a/ext/standard/tests/streams/stream_resolve_include_path.phpt b/ext/standard/tests/streams/stream_resolve_include_path.phpt new file mode 100644 index 000000000..aea5cdd96 --- /dev/null +++ b/ext/standard/tests/streams/stream_resolve_include_path.phpt @@ -0,0 +1,37 @@ +--TEST-- +stream_resolve_include_path(string path) +--FILE-- +<?php +$include_path = __DIR__ . '/test_path'; +$include_path_nested = $include_path . '/nested'; + +$include_path_file = $include_path . DIRECTORY_SEPARATOR . 'file'; +$include_path_nested_file = $include_path_nested . DIRECTORY_SEPARATOR . 'file'; + +mkdir($include_path); +mkdir($include_path_nested); + +file_put_contents($include_path_file, 'include_path'); +file_put_contents($include_path_nested_file, 'include_path'); + +var_dump(stream_resolve_include_path()); + +set_include_path($include_path . PATH_SEPARATOR . $include_path_nested); +var_dump(stream_resolve_include_path('file-does-not-exist')); + +set_include_path($include_path . PATH_SEPARATOR . $include_path_nested); +var_dump(stream_resolve_include_path('file')); +set_include_path($include_path_nested . PATH_SEPARATOR . $include_path); +var_dump(stream_resolve_include_path('file')); + +unlink($include_path_nested_file); +rmdir($include_path_nested); +unlink($include_path_file); +rmdir($include_path); +--EXPECTF-- +Warning: stream_resolve_include_path() expects exactly 1 parameter, 0 given in %s on line %d +NULL +bool(false) +string(%d) "%stest_path%sfile" +string(%d) "%stest_path%snested%sfile" + diff --git a/ext/standard/tests/strings/bug49785.phpt b/ext/standard/tests/strings/bug49785.phpt new file mode 100644 index 000000000..fa42dacd6 --- /dev/null +++ b/ext/standard/tests/strings/bug49785.phpt @@ -0,0 +1,4124 @@ +--TEST-- +Bug #49785 (insufficient input string validation of htmlspecialchars()) +--FILE-- +<?php +function _bin2hex($val) { + return is_string($val) ? bin2hex($val): $val; +} + +// UTF-8: basic tests +var_dump(_bin2hex(htmlentities("\xc1\xbf", ENT_QUOTES, "UTF-8"))); +var_dump(_bin2hex(htmlentities("\xc2\x80", ENT_QUOTES, "UTF-8"))); +var_dump(_bin2hex(htmlentities("\xc2\x00", ENT_QUOTES, "UTF-8"))); +var_dump(_bin2hex(htmlentities("\xc2\xc0", ENT_QUOTES, "UTF-8"))); +var_dump(_bin2hex(htmlentities("\xce\x91", ENT_QUOTES, "UTF-8"))); +var_dump(_bin2hex(htmlentities("\xce\xb1", ENT_QUOTES, "UTF-8"))); +var_dump(_bin2hex(htmlentities("\xdf\xbf", ENT_QUOTES, "UTF-8"))); +var_dump(_bin2hex(htmlentities("\xe0\xa0\x80", ENT_QUOTES, "UTF-8"))); +var_dump(_bin2hex(htmlentities("\xe0\x9f\xbf", ENT_QUOTES, "UTF-8"))); +var_dump(_bin2hex(htmlentities("\xe0\x9f\xbf", ENT_QUOTES, "UTF-8"))); +var_dump(_bin2hex(htmlentities("\xe0\x1f\xbf", ENT_QUOTES, "UTF-8"))); +var_dump(_bin2hex(htmlentities("\xe0\x9f\x3f", ENT_QUOTES, "UTF-8"))); +var_dump(_bin2hex(htmlentities("\xe0\x1f\x3f", ENT_QUOTES, "UTF-8"))); +var_dump(_bin2hex(htmlentities("\xe2\x99\xa5", ENT_QUOTES, "UTF-8"))); +var_dump(_bin2hex(htmlentities("\xef\xbf\xbf", ENT_QUOTES, "UTF-8"))); +var_dump(_bin2hex(htmlentities("\xef\xff\xbf", ENT_QUOTES, "UTF-8"))); +var_dump(_bin2hex(htmlentities("\xef\xbf\xff", ENT_QUOTES, "UTF-8"))); +var_dump(_bin2hex(htmlentities("\xf0\x8f\xbf\xbf", ENT_QUOTES, "UTF-8"))); +var_dump(_bin2hex(htmlentities("\xf0\x90\x80\x80", ENT_QUOTES, "UTF-8"))); +var_dump(_bin2hex(htmlentities("\xf7\xbf\xbf\xbf", ENT_QUOTES, "UTF-8"))); +var_dump(_bin2hex(htmlentities("\xf7\x3f\xbf\xbf", ENT_QUOTES, "UTF-8"))); +var_dump(_bin2hex(htmlentities("\xf7\xbf\x3f\xbf", ENT_QUOTES, "UTF-8"))); +var_dump(_bin2hex(htmlentities("\xf7\xbf\xbf\x3f", ENT_QUOTES, "UTF-8"))); +var_dump(_bin2hex(htmlentities("\xf7\xff\xbf\xbf", ENT_QUOTES, "UTF-8"))); +var_dump(_bin2hex(htmlentities("\xf7\xbf\xff\xbf", ENT_QUOTES, "UTF-8"))); +var_dump(_bin2hex(htmlentities("\xf7\xbf\xbf\xff", ENT_QUOTES, "UTF-8"))); +var_dump(_bin2hex(htmlentities("\xf8\x88\x80\x80\x80", ENT_QUOTES, "UTF-8"))); + +echo "--\n"; +// UTF-8: with ENT_IGNORE +var_dump(_bin2hex(htmlentities("\xc0\xa0\xc2\x80", ENT_QUOTES | ENT_IGNORE, "UTF-8"))); +var_dump(_bin2hex(htmlentities("\xe0\x80\x80\xe0\xa0\x80", ENT_QUOTES | ENT_IGNORE, "UTF-8"))); +var_dump(_bin2hex(htmlentities("\xf0\x80\x80\x80\xf0\x90\x80\x80", ENT_QUOTES | ENT_IGNORE, "UTF-8"))); + +echo "--\n"; +// UTF-8: alternative (invalid) UTF-8 sequence / surrogate pairs +var_dump(_bin2hex(htmlspecialchars("\xc0\xa6", ENT_QUOTES, 'UTF-8'))); +var_dump(_bin2hex(htmlspecialchars("\xe0\x80\xa6", ENT_QUOTES, 'UTF-8'))); +var_dump(_bin2hex(htmlspecialchars("\xf0\x80\x80\xa6", ENT_QUOTES, 'UTF-8'))); +var_dump(_bin2hex(htmlspecialchars("\xec\xbf\xbf", ENT_QUOTES, 'UTF-8'))); +var_dump(_bin2hex(htmlspecialchars("\xed\xa0\x80", ENT_QUOTES, 'UTF-8'))); +var_dump(_bin2hex(htmlspecialchars("\xed\xbf\xbf", ENT_QUOTES, 'UTF-8'))); +var_dump(_bin2hex(htmlspecialchars("\xee\x80\x80", ENT_QUOTES, 'UTF-8'))); + +// Shift_JIS: non-lead byte >= 0x80 +var_dump(_bin2hex(htmlspecialchars("\x80", ENT_QUOTES, 'Shift_JIS'))); +foreach (array_map('chr', range(0xa0, 0xdf)) as $c) { + var_dump(_bin2hex(htmlspecialchars($c, ENT_QUOTES, 'Shift_JIS'))); +} +var_dump(_bin2hex(htmlspecialchars("\xfd", ENT_QUOTES, 'Shift_JIS'))); +var_dump(_bin2hex(htmlspecialchars("\xfe", ENT_QUOTES, 'Shift_JIS'))); +var_dump(_bin2hex(htmlspecialchars("\xff", ENT_QUOTES, 'Shift_JIS'))); + +echo "--\n"; +// Shift_JIS: incomplete / invalid multibyte sequences +foreach (array_map('chr', array_merge(range(0x81, 0x9f), range(0xe0, 0xfc))) as $c) { + var_dump(_bin2hex(htmlspecialchars("$c", ENT_QUOTES, 'Shift_JIS'))); + var_dump(_bin2hex(htmlspecialchars("$c\x3f", ENT_QUOTES, 'Shift_JIS'))); + var_dump(_bin2hex(htmlspecialchars("$c\x40", ENT_QUOTES, 'Shift_JIS'))); + var_dump(_bin2hex(htmlspecialchars("$c\x7e", ENT_QUOTES, 'Shift_JIS'))); + var_dump(_bin2hex(htmlspecialchars("$c\x7f", ENT_QUOTES, 'Shift_JIS'))); + var_dump(_bin2hex(htmlspecialchars("$c\x80", ENT_QUOTES, 'Shift_JIS'))); + var_dump(_bin2hex(htmlspecialchars("$c\xfc", ENT_QUOTES, 'Shift_JIS'))); + var_dump(_bin2hex(htmlspecialchars("$c\xfd", ENT_QUOTES, 'Shift_JIS'))); + var_dump(_bin2hex(htmlspecialchars("$c\xfe", ENT_QUOTES, 'Shift_JIS'))); + var_dump(_bin2hex(htmlspecialchars("$c\xff", ENT_QUOTES, 'Shift_JIS'))); +} + +echo "--\n"; +// EUC-JP: non-lead byte >= 0x80 +foreach (array_map('chr', array_merge(range(0x80, 0x8d), range(0x90, 0x9f))) as $c) { + var_dump(_bin2hex(htmlspecialchars($c, ENT_QUOTES, 'EUC-JP'))); +} +var_dump(_bin2hex(htmlspecialchars("\xff", ENT_QUOTES, 'EUC-JP'))); + +// EUC-JP: control codes that are virtually lead bytes +var_dump(_bin2hex(htmlspecialchars("\x8e", ENT_QUOTES, 'EUC-JP'))); +var_dump(_bin2hex(htmlspecialchars("\x8f", ENT_QUOTES, 'EUC-JP'))); +var_dump(_bin2hex(htmlspecialchars("\x8e\xa1", ENT_QUOTES, 'EUC-JP'))); +var_dump(_bin2hex(htmlspecialchars("\x8f\xa1", ENT_QUOTES, 'EUC-JP'))); +var_dump(_bin2hex(htmlspecialchars("\x8e\xa1\xa3", ENT_QUOTES, 'EUC-JP'))); +var_dump(_bin2hex(htmlspecialchars("\x8f\xa1\xa3", ENT_QUOTES, 'EUC-JP'))); + +echo "--\n"; +// EUC-JP: incomplete / invalid multibyte sequences +foreach (array_map('chr', array_merge(range(0xa1, 0xfe))) as $c) { + var_dump(_bin2hex(htmlspecialchars("$c", ENT_QUOTES, 'EUC-JP'))); + var_dump(_bin2hex(htmlspecialchars("$c\x26", ENT_QUOTES, 'EUC-JP'))); + var_dump(_bin2hex(htmlspecialchars("$c\x80", ENT_QUOTES, 'EUC-JP'))); + var_dump(_bin2hex(htmlspecialchars("$c\xa0", ENT_QUOTES, 'EUC-JP'))); + var_dump(_bin2hex(htmlspecialchars("$c\xa1", ENT_QUOTES, 'EUC-JP'))); + var_dump(_bin2hex(htmlspecialchars("$c\xfe", ENT_QUOTES, 'EUC-JP'))); + var_dump(_bin2hex(htmlspecialchars("$c\xff", ENT_QUOTES, 'EUC-JP'))); + var_dump(_bin2hex(htmlspecialchars("\x8e$c", ENT_QUOTES, 'EUC-JP'))); + var_dump(_bin2hex(htmlspecialchars("\x8e$c\x26", ENT_QUOTES, 'EUC-JP'))); + var_dump(_bin2hex(htmlspecialchars("\x8e$c\x80", ENT_QUOTES, 'EUC-JP'))); + var_dump(_bin2hex(htmlspecialchars("\x8e$c\xa0", ENT_QUOTES, 'EUC-JP'))); + var_dump(_bin2hex(htmlspecialchars("\x8e$c\xa1", ENT_QUOTES, 'EUC-JP'))); + var_dump(_bin2hex(htmlspecialchars("\x8e$c\xfe", ENT_QUOTES, 'EUC-JP'))); + var_dump(_bin2hex(htmlspecialchars("\x8e$c\xff", ENT_QUOTES, 'EUC-JP'))); + var_dump(_bin2hex(htmlspecialchars("\x8f$c", ENT_QUOTES, 'EUC-JP'))); + var_dump(_bin2hex(htmlspecialchars("\x8f$c\x26", ENT_QUOTES, 'EUC-JP'))); + var_dump(_bin2hex(htmlspecialchars("\x8f$c\x80", ENT_QUOTES, 'EUC-JP'))); + var_dump(_bin2hex(htmlspecialchars("\x8f$c\xa0", ENT_QUOTES, 'EUC-JP'))); + var_dump(_bin2hex(htmlspecialchars("\x8f$c\xa1", ENT_QUOTES, 'EUC-JP'))); + var_dump(_bin2hex(htmlspecialchars("\x8f$c\xfe", ENT_QUOTES, 'EUC-JP'))); + var_dump(_bin2hex(htmlspecialchars("\x8f$c\xff", ENT_QUOTES, 'EUC-JP'))); +} + +echo "--\n"; +// BIG5: non-lead byte >= 0x80 +var_dump(_bin2hex(htmlspecialchars("\x80", ENT_QUOTES, 'BIG5'))); +var_dump(_bin2hex(htmlspecialchars("\xff", ENT_QUOTES, 'BIG5'))); + +echo "--\n"; +// BIG5: incomplete / invalid multibyte sequences +foreach (array_map('chr', range(0x81, 0xfe)) as $c) { + var_dump(_bin2hex(htmlspecialchars("$c", ENT_QUOTES, 'BIG5'))); + var_dump(_bin2hex(htmlspecialchars("$c\x3f", ENT_QUOTES, 'BIG5'))); + var_dump(_bin2hex(htmlspecialchars("$c\x40", ENT_QUOTES, 'BIG5'))); + var_dump(_bin2hex(htmlspecialchars("$c\x7e", ENT_QUOTES, 'BIG5'))); + var_dump(_bin2hex(htmlspecialchars("$c\x7f", ENT_QUOTES, 'BIG5'))); + var_dump(_bin2hex(htmlspecialchars("$c\x80", ENT_QUOTES, 'BIG5'))); + var_dump(_bin2hex(htmlspecialchars("$c\xa0", ENT_QUOTES, 'BIG5'))); + var_dump(_bin2hex(htmlspecialchars("$c\xa1", ENT_QUOTES, 'BIG5'))); + var_dump(_bin2hex(htmlspecialchars("$c\xfe", ENT_QUOTES, 'BIG5'))); + var_dump(_bin2hex(htmlspecialchars("$c\xff", ENT_QUOTES, 'BIG5'))); +} +?> +--EXPECT-- +string(0) "" +string(4) "c280" +string(0) "" +string(0) "" +string(14) "26416c7068613b" +string(14) "26616c7068613b" +string(4) "dfbf" +string(6) "e0a080" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(16) "266865617274733b" +string(6) "efbfbf" +string(0) "" +string(0) "" +string(0) "" +string(8) "f0908080" +string(8) "f7bfbfbf" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +-- +string(4) "c280" +string(6) "e0a080" +string(8) "f0908080" +-- +string(0) "" +string(0) "" +string(0) "" +string(6) "ecbfbf" +string(0) "" +string(0) "" +string(6) "ee8080" +string(2) "80" +string(2) "a0" +string(2) "a1" +string(2) "a2" +string(2) "a3" +string(2) "a4" +string(2) "a5" +string(2) "a6" +string(2) "a7" +string(2) "a8" +string(2) "a9" +string(2) "aa" +string(2) "ab" +string(2) "ac" +string(2) "ad" +string(2) "ae" +string(2) "af" +string(2) "b0" +string(2) "b1" +string(2) "b2" +string(2) "b3" +string(2) "b4" +string(2) "b5" +string(2) "b6" +string(2) "b7" +string(2) "b8" +string(2) "b9" +string(2) "ba" +string(2) "bb" +string(2) "bc" +string(2) "bd" +string(2) "be" +string(2) "bf" +string(2) "c0" +string(2) "c1" +string(2) "c2" +string(2) "c3" +string(2) "c4" +string(2) "c5" +string(2) "c6" +string(2) "c7" +string(2) "c8" +string(2) "c9" +string(2) "ca" +string(2) "cb" +string(2) "cc" +string(2) "cd" +string(2) "ce" +string(2) "cf" +string(2) "d0" +string(2) "d1" +string(2) "d2" +string(2) "d3" +string(2) "d4" +string(2) "d5" +string(2) "d6" +string(2) "d7" +string(2) "d8" +string(2) "d9" +string(2) "da" +string(2) "db" +string(2) "dc" +string(2) "dd" +string(2) "de" +string(2) "df" +string(2) "fd" +string(2) "fe" +string(2) "ff" +-- +string(0) "" +string(0) "" +string(4) "8140" +string(4) "817e" +string(0) "" +string(4) "8180" +string(4) "81fc" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "8240" +string(4) "827e" +string(0) "" +string(4) "8280" +string(4) "82fc" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "8340" +string(4) "837e" +string(0) "" +string(4) "8380" +string(4) "83fc" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "8440" +string(4) "847e" +string(0) "" +string(4) "8480" +string(4) "84fc" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "8540" +string(4) "857e" +string(0) "" +string(4) "8580" +string(4) "85fc" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "8640" +string(4) "867e" +string(0) "" +string(4) "8680" +string(4) "86fc" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "8740" +string(4) "877e" +string(0) "" +string(4) "8780" +string(4) "87fc" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "8840" +string(4) "887e" +string(0) "" +string(4) "8880" +string(4) "88fc" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "8940" +string(4) "897e" +string(0) "" +string(4) "8980" +string(4) "89fc" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "8a40" +string(4) "8a7e" +string(0) "" +string(4) "8a80" +string(4) "8afc" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "8b40" +string(4) "8b7e" +string(0) "" +string(4) "8b80" +string(4) "8bfc" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "8c40" +string(4) "8c7e" +string(0) "" +string(4) "8c80" +string(4) "8cfc" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "8d40" +string(4) "8d7e" +string(0) "" +string(4) "8d80" +string(4) "8dfc" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "8e40" +string(4) "8e7e" +string(0) "" +string(4) "8e80" +string(4) "8efc" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "8f40" +string(4) "8f7e" +string(0) "" +string(4) "8f80" +string(4) "8ffc" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "9040" +string(4) "907e" +string(0) "" +string(4) "9080" +string(4) "90fc" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "9140" +string(4) "917e" +string(0) "" +string(4) "9180" +string(4) "91fc" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "9240" +string(4) "927e" +string(0) "" +string(4) "9280" +string(4) "92fc" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "9340" +string(4) "937e" +string(0) "" +string(4) "9380" +string(4) "93fc" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "9440" +string(4) "947e" +string(0) "" +string(4) "9480" +string(4) "94fc" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "9540" +string(4) "957e" +string(0) "" +string(4) "9580" +string(4) "95fc" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "9640" +string(4) "967e" +string(0) "" +string(4) "9680" +string(4) "96fc" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "9740" +string(4) "977e" +string(0) "" +string(4) "9780" +string(4) "97fc" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "9840" +string(4) "987e" +string(0) "" +string(4) "9880" +string(4) "98fc" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "9940" +string(4) "997e" +string(0) "" +string(4) "9980" +string(4) "99fc" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "9a40" +string(4) "9a7e" +string(0) "" +string(4) "9a80" +string(4) "9afc" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "9b40" +string(4) "9b7e" +string(0) "" +string(4) "9b80" +string(4) "9bfc" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "9c40" +string(4) "9c7e" +string(0) "" +string(4) "9c80" +string(4) "9cfc" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "9d40" +string(4) "9d7e" +string(0) "" +string(4) "9d80" +string(4) "9dfc" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "9e40" +string(4) "9e7e" +string(0) "" +string(4) "9e80" +string(4) "9efc" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "9f40" +string(4) "9f7e" +string(0) "" +string(4) "9f80" +string(4) "9ffc" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "e040" +string(4) "e07e" +string(0) "" +string(4) "e080" +string(4) "e0fc" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "e140" +string(4) "e17e" +string(0) "" +string(4) "e180" +string(4) "e1fc" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "e240" +string(4) "e27e" +string(0) "" +string(4) "e280" +string(4) "e2fc" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "e340" +string(4) "e37e" +string(0) "" +string(4) "e380" +string(4) "e3fc" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "e440" +string(4) "e47e" +string(0) "" +string(4) "e480" +string(4) "e4fc" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "e540" +string(4) "e57e" +string(0) "" +string(4) "e580" +string(4) "e5fc" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "e640" +string(4) "e67e" +string(0) "" +string(4) "e680" +string(4) "e6fc" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "e740" +string(4) "e77e" +string(0) "" +string(4) "e780" +string(4) "e7fc" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "e840" +string(4) "e87e" +string(0) "" +string(4) "e880" +string(4) "e8fc" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "e940" +string(4) "e97e" +string(0) "" +string(4) "e980" +string(4) "e9fc" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "ea40" +string(4) "ea7e" +string(0) "" +string(4) "ea80" +string(4) "eafc" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "eb40" +string(4) "eb7e" +string(0) "" +string(4) "eb80" +string(4) "ebfc" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "ec40" +string(4) "ec7e" +string(0) "" +string(4) "ec80" +string(4) "ecfc" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "ed40" +string(4) "ed7e" +string(0) "" +string(4) "ed80" +string(4) "edfc" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "ee40" +string(4) "ee7e" +string(0) "" +string(4) "ee80" +string(4) "eefc" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "ef40" +string(4) "ef7e" +string(0) "" +string(4) "ef80" +string(4) "effc" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "f040" +string(4) "f07e" +string(0) "" +string(4) "f080" +string(4) "f0fc" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "f140" +string(4) "f17e" +string(0) "" +string(4) "f180" +string(4) "f1fc" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "f240" +string(4) "f27e" +string(0) "" +string(4) "f280" +string(4) "f2fc" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "f340" +string(4) "f37e" +string(0) "" +string(4) "f380" +string(4) "f3fc" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "f440" +string(4) "f47e" +string(0) "" +string(4) "f480" +string(4) "f4fc" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "f540" +string(4) "f57e" +string(0) "" +string(4) "f580" +string(4) "f5fc" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "f640" +string(4) "f67e" +string(0) "" +string(4) "f680" +string(4) "f6fc" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "f740" +string(4) "f77e" +string(0) "" +string(4) "f780" +string(4) "f7fc" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "f840" +string(4) "f87e" +string(0) "" +string(4) "f880" +string(4) "f8fc" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "f940" +string(4) "f97e" +string(0) "" +string(4) "f980" +string(4) "f9fc" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "fa40" +string(4) "fa7e" +string(0) "" +string(4) "fa80" +string(4) "fafc" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "fb40" +string(4) "fb7e" +string(0) "" +string(4) "fb80" +string(4) "fbfc" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "fc40" +string(4) "fc7e" +string(0) "" +string(4) "fc80" +string(4) "fcfc" +string(0) "" +string(0) "" +string(0) "" +-- +string(2) "80" +string(2) "81" +string(2) "82" +string(2) "83" +string(2) "84" +string(2) "85" +string(2) "86" +string(2) "87" +string(2) "88" +string(2) "89" +string(2) "8a" +string(2) "8b" +string(2) "8c" +string(2) "8d" +string(2) "90" +string(2) "91" +string(2) "92" +string(2) "93" +string(2) "94" +string(2) "95" +string(2) "96" +string(2) "97" +string(2) "98" +string(2) "99" +string(2) "9a" +string(2) "9b" +string(2) "9c" +string(2) "9d" +string(2) "9e" +string(2) "9f" +string(2) "ff" +string(0) "" +string(0) "" +string(4) "8ea1" +string(0) "" +string(0) "" +string(6) "8fa1a3" +-- +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "a1a1" +string(4) "a1fe" +string(0) "" +string(4) "8ea1" +string(14) "8ea126616d703b" +string(6) "8ea180" +string(6) "8ea1a0" +string(0) "" +string(0) "" +string(6) "8ea1ff" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fa1a1" +string(6) "8fa1fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "a2a1" +string(4) "a2fe" +string(0) "" +string(4) "8ea2" +string(14) "8ea226616d703b" +string(6) "8ea280" +string(6) "8ea2a0" +string(0) "" +string(0) "" +string(6) "8ea2ff" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fa2a1" +string(6) "8fa2fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "a3a1" +string(4) "a3fe" +string(0) "" +string(4) "8ea3" +string(14) "8ea326616d703b" +string(6) "8ea380" +string(6) "8ea3a0" +string(0) "" +string(0) "" +string(6) "8ea3ff" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fa3a1" +string(6) "8fa3fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "a4a1" +string(4) "a4fe" +string(0) "" +string(4) "8ea4" +string(14) "8ea426616d703b" +string(6) "8ea480" +string(6) "8ea4a0" +string(0) "" +string(0) "" +string(6) "8ea4ff" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fa4a1" +string(6) "8fa4fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "a5a1" +string(4) "a5fe" +string(0) "" +string(4) "8ea5" +string(14) "8ea526616d703b" +string(6) "8ea580" +string(6) "8ea5a0" +string(0) "" +string(0) "" +string(6) "8ea5ff" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fa5a1" +string(6) "8fa5fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "a6a1" +string(4) "a6fe" +string(0) "" +string(4) "8ea6" +string(14) "8ea626616d703b" +string(6) "8ea680" +string(6) "8ea6a0" +string(0) "" +string(0) "" +string(6) "8ea6ff" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fa6a1" +string(6) "8fa6fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "a7a1" +string(4) "a7fe" +string(0) "" +string(4) "8ea7" +string(14) "8ea726616d703b" +string(6) "8ea780" +string(6) "8ea7a0" +string(0) "" +string(0) "" +string(6) "8ea7ff" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fa7a1" +string(6) "8fa7fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "a8a1" +string(4) "a8fe" +string(0) "" +string(4) "8ea8" +string(14) "8ea826616d703b" +string(6) "8ea880" +string(6) "8ea8a0" +string(0) "" +string(0) "" +string(6) "8ea8ff" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fa8a1" +string(6) "8fa8fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "a9a1" +string(4) "a9fe" +string(0) "" +string(4) "8ea9" +string(14) "8ea926616d703b" +string(6) "8ea980" +string(6) "8ea9a0" +string(0) "" +string(0) "" +string(6) "8ea9ff" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fa9a1" +string(6) "8fa9fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "aaa1" +string(4) "aafe" +string(0) "" +string(4) "8eaa" +string(14) "8eaa26616d703b" +string(6) "8eaa80" +string(6) "8eaaa0" +string(0) "" +string(0) "" +string(6) "8eaaff" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8faaa1" +string(6) "8faafe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "aba1" +string(4) "abfe" +string(0) "" +string(4) "8eab" +string(14) "8eab26616d703b" +string(6) "8eab80" +string(6) "8eaba0" +string(0) "" +string(0) "" +string(6) "8eabff" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8faba1" +string(6) "8fabfe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "aca1" +string(4) "acfe" +string(0) "" +string(4) "8eac" +string(14) "8eac26616d703b" +string(6) "8eac80" +string(6) "8eaca0" +string(0) "" +string(0) "" +string(6) "8eacff" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8faca1" +string(6) "8facfe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "ada1" +string(4) "adfe" +string(0) "" +string(4) "8ead" +string(14) "8ead26616d703b" +string(6) "8ead80" +string(6) "8eada0" +string(0) "" +string(0) "" +string(6) "8eadff" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fada1" +string(6) "8fadfe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "aea1" +string(4) "aefe" +string(0) "" +string(4) "8eae" +string(14) "8eae26616d703b" +string(6) "8eae80" +string(6) "8eaea0" +string(0) "" +string(0) "" +string(6) "8eaeff" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8faea1" +string(6) "8faefe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "afa1" +string(4) "affe" +string(0) "" +string(4) "8eaf" +string(14) "8eaf26616d703b" +string(6) "8eaf80" +string(6) "8eafa0" +string(0) "" +string(0) "" +string(6) "8eafff" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fafa1" +string(6) "8faffe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "b0a1" +string(4) "b0fe" +string(0) "" +string(4) "8eb0" +string(14) "8eb026616d703b" +string(6) "8eb080" +string(6) "8eb0a0" +string(0) "" +string(0) "" +string(6) "8eb0ff" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fb0a1" +string(6) "8fb0fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "b1a1" +string(4) "b1fe" +string(0) "" +string(4) "8eb1" +string(14) "8eb126616d703b" +string(6) "8eb180" +string(6) "8eb1a0" +string(0) "" +string(0) "" +string(6) "8eb1ff" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fb1a1" +string(6) "8fb1fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "b2a1" +string(4) "b2fe" +string(0) "" +string(4) "8eb2" +string(14) "8eb226616d703b" +string(6) "8eb280" +string(6) "8eb2a0" +string(0) "" +string(0) "" +string(6) "8eb2ff" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fb2a1" +string(6) "8fb2fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "b3a1" +string(4) "b3fe" +string(0) "" +string(4) "8eb3" +string(14) "8eb326616d703b" +string(6) "8eb380" +string(6) "8eb3a0" +string(0) "" +string(0) "" +string(6) "8eb3ff" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fb3a1" +string(6) "8fb3fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "b4a1" +string(4) "b4fe" +string(0) "" +string(4) "8eb4" +string(14) "8eb426616d703b" +string(6) "8eb480" +string(6) "8eb4a0" +string(0) "" +string(0) "" +string(6) "8eb4ff" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fb4a1" +string(6) "8fb4fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "b5a1" +string(4) "b5fe" +string(0) "" +string(4) "8eb5" +string(14) "8eb526616d703b" +string(6) "8eb580" +string(6) "8eb5a0" +string(0) "" +string(0) "" +string(6) "8eb5ff" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fb5a1" +string(6) "8fb5fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "b6a1" +string(4) "b6fe" +string(0) "" +string(4) "8eb6" +string(14) "8eb626616d703b" +string(6) "8eb680" +string(6) "8eb6a0" +string(0) "" +string(0) "" +string(6) "8eb6ff" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fb6a1" +string(6) "8fb6fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "b7a1" +string(4) "b7fe" +string(0) "" +string(4) "8eb7" +string(14) "8eb726616d703b" +string(6) "8eb780" +string(6) "8eb7a0" +string(0) "" +string(0) "" +string(6) "8eb7ff" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fb7a1" +string(6) "8fb7fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "b8a1" +string(4) "b8fe" +string(0) "" +string(4) "8eb8" +string(14) "8eb826616d703b" +string(6) "8eb880" +string(6) "8eb8a0" +string(0) "" +string(0) "" +string(6) "8eb8ff" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fb8a1" +string(6) "8fb8fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "b9a1" +string(4) "b9fe" +string(0) "" +string(4) "8eb9" +string(14) "8eb926616d703b" +string(6) "8eb980" +string(6) "8eb9a0" +string(0) "" +string(0) "" +string(6) "8eb9ff" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fb9a1" +string(6) "8fb9fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "baa1" +string(4) "bafe" +string(0) "" +string(4) "8eba" +string(14) "8eba26616d703b" +string(6) "8eba80" +string(6) "8ebaa0" +string(0) "" +string(0) "" +string(6) "8ebaff" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fbaa1" +string(6) "8fbafe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "bba1" +string(4) "bbfe" +string(0) "" +string(4) "8ebb" +string(14) "8ebb26616d703b" +string(6) "8ebb80" +string(6) "8ebba0" +string(0) "" +string(0) "" +string(6) "8ebbff" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fbba1" +string(6) "8fbbfe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "bca1" +string(4) "bcfe" +string(0) "" +string(4) "8ebc" +string(14) "8ebc26616d703b" +string(6) "8ebc80" +string(6) "8ebca0" +string(0) "" +string(0) "" +string(6) "8ebcff" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fbca1" +string(6) "8fbcfe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "bda1" +string(4) "bdfe" +string(0) "" +string(4) "8ebd" +string(14) "8ebd26616d703b" +string(6) "8ebd80" +string(6) "8ebda0" +string(0) "" +string(0) "" +string(6) "8ebdff" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fbda1" +string(6) "8fbdfe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "bea1" +string(4) "befe" +string(0) "" +string(4) "8ebe" +string(14) "8ebe26616d703b" +string(6) "8ebe80" +string(6) "8ebea0" +string(0) "" +string(0) "" +string(6) "8ebeff" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fbea1" +string(6) "8fbefe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "bfa1" +string(4) "bffe" +string(0) "" +string(4) "8ebf" +string(14) "8ebf26616d703b" +string(6) "8ebf80" +string(6) "8ebfa0" +string(0) "" +string(0) "" +string(6) "8ebfff" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fbfa1" +string(6) "8fbffe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "c0a1" +string(4) "c0fe" +string(0) "" +string(4) "8ec0" +string(14) "8ec026616d703b" +string(6) "8ec080" +string(6) "8ec0a0" +string(0) "" +string(0) "" +string(6) "8ec0ff" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fc0a1" +string(6) "8fc0fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "c1a1" +string(4) "c1fe" +string(0) "" +string(4) "8ec1" +string(14) "8ec126616d703b" +string(6) "8ec180" +string(6) "8ec1a0" +string(0) "" +string(0) "" +string(6) "8ec1ff" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fc1a1" +string(6) "8fc1fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "c2a1" +string(4) "c2fe" +string(0) "" +string(4) "8ec2" +string(14) "8ec226616d703b" +string(6) "8ec280" +string(6) "8ec2a0" +string(0) "" +string(0) "" +string(6) "8ec2ff" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fc2a1" +string(6) "8fc2fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "c3a1" +string(4) "c3fe" +string(0) "" +string(4) "8ec3" +string(14) "8ec326616d703b" +string(6) "8ec380" +string(6) "8ec3a0" +string(0) "" +string(0) "" +string(6) "8ec3ff" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fc3a1" +string(6) "8fc3fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "c4a1" +string(4) "c4fe" +string(0) "" +string(4) "8ec4" +string(14) "8ec426616d703b" +string(6) "8ec480" +string(6) "8ec4a0" +string(0) "" +string(0) "" +string(6) "8ec4ff" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fc4a1" +string(6) "8fc4fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "c5a1" +string(4) "c5fe" +string(0) "" +string(4) "8ec5" +string(14) "8ec526616d703b" +string(6) "8ec580" +string(6) "8ec5a0" +string(0) "" +string(0) "" +string(6) "8ec5ff" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fc5a1" +string(6) "8fc5fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "c6a1" +string(4) "c6fe" +string(0) "" +string(4) "8ec6" +string(14) "8ec626616d703b" +string(6) "8ec680" +string(6) "8ec6a0" +string(0) "" +string(0) "" +string(6) "8ec6ff" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fc6a1" +string(6) "8fc6fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "c7a1" +string(4) "c7fe" +string(0) "" +string(4) "8ec7" +string(14) "8ec726616d703b" +string(6) "8ec780" +string(6) "8ec7a0" +string(0) "" +string(0) "" +string(6) "8ec7ff" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fc7a1" +string(6) "8fc7fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "c8a1" +string(4) "c8fe" +string(0) "" +string(4) "8ec8" +string(14) "8ec826616d703b" +string(6) "8ec880" +string(6) "8ec8a0" +string(0) "" +string(0) "" +string(6) "8ec8ff" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fc8a1" +string(6) "8fc8fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "c9a1" +string(4) "c9fe" +string(0) "" +string(4) "8ec9" +string(14) "8ec926616d703b" +string(6) "8ec980" +string(6) "8ec9a0" +string(0) "" +string(0) "" +string(6) "8ec9ff" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fc9a1" +string(6) "8fc9fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "caa1" +string(4) "cafe" +string(0) "" +string(4) "8eca" +string(14) "8eca26616d703b" +string(6) "8eca80" +string(6) "8ecaa0" +string(0) "" +string(0) "" +string(6) "8ecaff" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fcaa1" +string(6) "8fcafe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "cba1" +string(4) "cbfe" +string(0) "" +string(4) "8ecb" +string(14) "8ecb26616d703b" +string(6) "8ecb80" +string(6) "8ecba0" +string(0) "" +string(0) "" +string(6) "8ecbff" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fcba1" +string(6) "8fcbfe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "cca1" +string(4) "ccfe" +string(0) "" +string(4) "8ecc" +string(14) "8ecc26616d703b" +string(6) "8ecc80" +string(6) "8ecca0" +string(0) "" +string(0) "" +string(6) "8eccff" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fcca1" +string(6) "8fccfe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "cda1" +string(4) "cdfe" +string(0) "" +string(4) "8ecd" +string(14) "8ecd26616d703b" +string(6) "8ecd80" +string(6) "8ecda0" +string(0) "" +string(0) "" +string(6) "8ecdff" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fcda1" +string(6) "8fcdfe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "cea1" +string(4) "cefe" +string(0) "" +string(4) "8ece" +string(14) "8ece26616d703b" +string(6) "8ece80" +string(6) "8ecea0" +string(0) "" +string(0) "" +string(6) "8eceff" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fcea1" +string(6) "8fcefe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "cfa1" +string(4) "cffe" +string(0) "" +string(4) "8ecf" +string(14) "8ecf26616d703b" +string(6) "8ecf80" +string(6) "8ecfa0" +string(0) "" +string(0) "" +string(6) "8ecfff" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fcfa1" +string(6) "8fcffe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "d0a1" +string(4) "d0fe" +string(0) "" +string(4) "8ed0" +string(14) "8ed026616d703b" +string(6) "8ed080" +string(6) "8ed0a0" +string(0) "" +string(0) "" +string(6) "8ed0ff" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fd0a1" +string(6) "8fd0fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "d1a1" +string(4) "d1fe" +string(0) "" +string(4) "8ed1" +string(14) "8ed126616d703b" +string(6) "8ed180" +string(6) "8ed1a0" +string(0) "" +string(0) "" +string(6) "8ed1ff" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fd1a1" +string(6) "8fd1fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "d2a1" +string(4) "d2fe" +string(0) "" +string(4) "8ed2" +string(14) "8ed226616d703b" +string(6) "8ed280" +string(6) "8ed2a0" +string(0) "" +string(0) "" +string(6) "8ed2ff" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fd2a1" +string(6) "8fd2fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "d3a1" +string(4) "d3fe" +string(0) "" +string(4) "8ed3" +string(14) "8ed326616d703b" +string(6) "8ed380" +string(6) "8ed3a0" +string(0) "" +string(0) "" +string(6) "8ed3ff" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fd3a1" +string(6) "8fd3fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "d4a1" +string(4) "d4fe" +string(0) "" +string(4) "8ed4" +string(14) "8ed426616d703b" +string(6) "8ed480" +string(6) "8ed4a0" +string(0) "" +string(0) "" +string(6) "8ed4ff" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fd4a1" +string(6) "8fd4fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "d5a1" +string(4) "d5fe" +string(0) "" +string(4) "8ed5" +string(14) "8ed526616d703b" +string(6) "8ed580" +string(6) "8ed5a0" +string(0) "" +string(0) "" +string(6) "8ed5ff" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fd5a1" +string(6) "8fd5fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "d6a1" +string(4) "d6fe" +string(0) "" +string(4) "8ed6" +string(14) "8ed626616d703b" +string(6) "8ed680" +string(6) "8ed6a0" +string(0) "" +string(0) "" +string(6) "8ed6ff" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fd6a1" +string(6) "8fd6fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "d7a1" +string(4) "d7fe" +string(0) "" +string(4) "8ed7" +string(14) "8ed726616d703b" +string(6) "8ed780" +string(6) "8ed7a0" +string(0) "" +string(0) "" +string(6) "8ed7ff" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fd7a1" +string(6) "8fd7fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "d8a1" +string(4) "d8fe" +string(0) "" +string(4) "8ed8" +string(14) "8ed826616d703b" +string(6) "8ed880" +string(6) "8ed8a0" +string(0) "" +string(0) "" +string(6) "8ed8ff" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fd8a1" +string(6) "8fd8fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "d9a1" +string(4) "d9fe" +string(0) "" +string(4) "8ed9" +string(14) "8ed926616d703b" +string(6) "8ed980" +string(6) "8ed9a0" +string(0) "" +string(0) "" +string(6) "8ed9ff" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fd9a1" +string(6) "8fd9fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "daa1" +string(4) "dafe" +string(0) "" +string(4) "8eda" +string(14) "8eda26616d703b" +string(6) "8eda80" +string(6) "8edaa0" +string(0) "" +string(0) "" +string(6) "8edaff" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fdaa1" +string(6) "8fdafe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "dba1" +string(4) "dbfe" +string(0) "" +string(4) "8edb" +string(14) "8edb26616d703b" +string(6) "8edb80" +string(6) "8edba0" +string(0) "" +string(0) "" +string(6) "8edbff" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fdba1" +string(6) "8fdbfe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "dca1" +string(4) "dcfe" +string(0) "" +string(4) "8edc" +string(14) "8edc26616d703b" +string(6) "8edc80" +string(6) "8edca0" +string(0) "" +string(0) "" +string(6) "8edcff" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fdca1" +string(6) "8fdcfe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "dda1" +string(4) "ddfe" +string(0) "" +string(4) "8edd" +string(14) "8edd26616d703b" +string(6) "8edd80" +string(6) "8edda0" +string(0) "" +string(0) "" +string(6) "8eddff" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fdda1" +string(6) "8fddfe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "dea1" +string(4) "defe" +string(0) "" +string(4) "8ede" +string(14) "8ede26616d703b" +string(6) "8ede80" +string(6) "8edea0" +string(0) "" +string(0) "" +string(6) "8edeff" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fdea1" +string(6) "8fdefe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "dfa1" +string(4) "dffe" +string(0) "" +string(4) "8edf" +string(14) "8edf26616d703b" +string(6) "8edf80" +string(6) "8edfa0" +string(0) "" +string(0) "" +string(6) "8edfff" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fdfa1" +string(6) "8fdffe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "e0a1" +string(4) "e0fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fe0a1" +string(6) "8fe0fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "e1a1" +string(4) "e1fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fe1a1" +string(6) "8fe1fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "e2a1" +string(4) "e2fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fe2a1" +string(6) "8fe2fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "e3a1" +string(4) "e3fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fe3a1" +string(6) "8fe3fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "e4a1" +string(4) "e4fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fe4a1" +string(6) "8fe4fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "e5a1" +string(4) "e5fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fe5a1" +string(6) "8fe5fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "e6a1" +string(4) "e6fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fe6a1" +string(6) "8fe6fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "e7a1" +string(4) "e7fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fe7a1" +string(6) "8fe7fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "e8a1" +string(4) "e8fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fe8a1" +string(6) "8fe8fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "e9a1" +string(4) "e9fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fe9a1" +string(6) "8fe9fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "eaa1" +string(4) "eafe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8feaa1" +string(6) "8feafe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "eba1" +string(4) "ebfe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8feba1" +string(6) "8febfe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "eca1" +string(4) "ecfe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8feca1" +string(6) "8fecfe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "eda1" +string(4) "edfe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8feda1" +string(6) "8fedfe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "eea1" +string(4) "eefe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8feea1" +string(6) "8feefe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "efa1" +string(4) "effe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8fefa1" +string(6) "8feffe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "f0a1" +string(4) "f0fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8ff0a1" +string(6) "8ff0fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "f1a1" +string(4) "f1fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8ff1a1" +string(6) "8ff1fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "f2a1" +string(4) "f2fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8ff2a1" +string(6) "8ff2fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "f3a1" +string(4) "f3fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8ff3a1" +string(6) "8ff3fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "f4a1" +string(4) "f4fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8ff4a1" +string(6) "8ff4fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "f5a1" +string(4) "f5fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8ff5a1" +string(6) "8ff5fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "f6a1" +string(4) "f6fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8ff6a1" +string(6) "8ff6fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "f7a1" +string(4) "f7fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8ff7a1" +string(6) "8ff7fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "f8a1" +string(4) "f8fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8ff8a1" +string(6) "8ff8fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "f9a1" +string(4) "f9fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8ff9a1" +string(6) "8ff9fe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "faa1" +string(4) "fafe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8ffaa1" +string(6) "8ffafe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "fba1" +string(4) "fbfe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8ffba1" +string(6) "8ffbfe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "fca1" +string(4) "fcfe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8ffca1" +string(6) "8ffcfe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "fda1" +string(4) "fdfe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8ffda1" +string(6) "8ffdfe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(4) "fea1" +string(4) "fefe" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(0) "" +string(6) "8ffea1" +string(6) "8ffefe" +string(0) "" +-- +string(2) "80" +string(2) "ff" +-- +string(0) "" +string(0) "" +string(4) "8140" +string(4) "817e" +string(0) "" +string(0) "" +string(0) "" +string(4) "81a1" +string(4) "81fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "8240" +string(4) "827e" +string(0) "" +string(0) "" +string(0) "" +string(4) "82a1" +string(4) "82fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "8340" +string(4) "837e" +string(0) "" +string(0) "" +string(0) "" +string(4) "83a1" +string(4) "83fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "8440" +string(4) "847e" +string(0) "" +string(0) "" +string(0) "" +string(4) "84a1" +string(4) "84fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "8540" +string(4) "857e" +string(0) "" +string(0) "" +string(0) "" +string(4) "85a1" +string(4) "85fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "8640" +string(4) "867e" +string(0) "" +string(0) "" +string(0) "" +string(4) "86a1" +string(4) "86fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "8740" +string(4) "877e" +string(0) "" +string(0) "" +string(0) "" +string(4) "87a1" +string(4) "87fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "8840" +string(4) "887e" +string(0) "" +string(0) "" +string(0) "" +string(4) "88a1" +string(4) "88fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "8940" +string(4) "897e" +string(0) "" +string(0) "" +string(0) "" +string(4) "89a1" +string(4) "89fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "8a40" +string(4) "8a7e" +string(0) "" +string(0) "" +string(0) "" +string(4) "8aa1" +string(4) "8afe" +string(0) "" +string(0) "" +string(0) "" +string(4) "8b40" +string(4) "8b7e" +string(0) "" +string(0) "" +string(0) "" +string(4) "8ba1" +string(4) "8bfe" +string(0) "" +string(0) "" +string(0) "" +string(4) "8c40" +string(4) "8c7e" +string(0) "" +string(0) "" +string(0) "" +string(4) "8ca1" +string(4) "8cfe" +string(0) "" +string(0) "" +string(0) "" +string(4) "8d40" +string(4) "8d7e" +string(0) "" +string(0) "" +string(0) "" +string(4) "8da1" +string(4) "8dfe" +string(0) "" +string(0) "" +string(0) "" +string(4) "8e40" +string(4) "8e7e" +string(0) "" +string(0) "" +string(0) "" +string(4) "8ea1" +string(4) "8efe" +string(0) "" +string(0) "" +string(0) "" +string(4) "8f40" +string(4) "8f7e" +string(0) "" +string(0) "" +string(0) "" +string(4) "8fa1" +string(4) "8ffe" +string(0) "" +string(0) "" +string(0) "" +string(4) "9040" +string(4) "907e" +string(0) "" +string(0) "" +string(0) "" +string(4) "90a1" +string(4) "90fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "9140" +string(4) "917e" +string(0) "" +string(0) "" +string(0) "" +string(4) "91a1" +string(4) "91fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "9240" +string(4) "927e" +string(0) "" +string(0) "" +string(0) "" +string(4) "92a1" +string(4) "92fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "9340" +string(4) "937e" +string(0) "" +string(0) "" +string(0) "" +string(4) "93a1" +string(4) "93fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "9440" +string(4) "947e" +string(0) "" +string(0) "" +string(0) "" +string(4) "94a1" +string(4) "94fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "9540" +string(4) "957e" +string(0) "" +string(0) "" +string(0) "" +string(4) "95a1" +string(4) "95fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "9640" +string(4) "967e" +string(0) "" +string(0) "" +string(0) "" +string(4) "96a1" +string(4) "96fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "9740" +string(4) "977e" +string(0) "" +string(0) "" +string(0) "" +string(4) "97a1" +string(4) "97fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "9840" +string(4) "987e" +string(0) "" +string(0) "" +string(0) "" +string(4) "98a1" +string(4) "98fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "9940" +string(4) "997e" +string(0) "" +string(0) "" +string(0) "" +string(4) "99a1" +string(4) "99fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "9a40" +string(4) "9a7e" +string(0) "" +string(0) "" +string(0) "" +string(4) "9aa1" +string(4) "9afe" +string(0) "" +string(0) "" +string(0) "" +string(4) "9b40" +string(4) "9b7e" +string(0) "" +string(0) "" +string(0) "" +string(4) "9ba1" +string(4) "9bfe" +string(0) "" +string(0) "" +string(0) "" +string(4) "9c40" +string(4) "9c7e" +string(0) "" +string(0) "" +string(0) "" +string(4) "9ca1" +string(4) "9cfe" +string(0) "" +string(0) "" +string(0) "" +string(4) "9d40" +string(4) "9d7e" +string(0) "" +string(0) "" +string(0) "" +string(4) "9da1" +string(4) "9dfe" +string(0) "" +string(0) "" +string(0) "" +string(4) "9e40" +string(4) "9e7e" +string(0) "" +string(0) "" +string(0) "" +string(4) "9ea1" +string(4) "9efe" +string(0) "" +string(0) "" +string(0) "" +string(4) "9f40" +string(4) "9f7e" +string(0) "" +string(0) "" +string(0) "" +string(4) "9fa1" +string(4) "9ffe" +string(0) "" +string(0) "" +string(0) "" +string(4) "a040" +string(4) "a07e" +string(0) "" +string(0) "" +string(0) "" +string(4) "a0a1" +string(4) "a0fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "a140" +string(4) "a17e" +string(0) "" +string(0) "" +string(0) "" +string(4) "a1a1" +string(4) "a1fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "a240" +string(4) "a27e" +string(0) "" +string(0) "" +string(0) "" +string(4) "a2a1" +string(4) "a2fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "a340" +string(4) "a37e" +string(0) "" +string(0) "" +string(0) "" +string(4) "a3a1" +string(4) "a3fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "a440" +string(4) "a47e" +string(0) "" +string(0) "" +string(0) "" +string(4) "a4a1" +string(4) "a4fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "a540" +string(4) "a57e" +string(0) "" +string(0) "" +string(0) "" +string(4) "a5a1" +string(4) "a5fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "a640" +string(4) "a67e" +string(0) "" +string(0) "" +string(0) "" +string(4) "a6a1" +string(4) "a6fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "a740" +string(4) "a77e" +string(0) "" +string(0) "" +string(0) "" +string(4) "a7a1" +string(4) "a7fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "a840" +string(4) "a87e" +string(0) "" +string(0) "" +string(0) "" +string(4) "a8a1" +string(4) "a8fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "a940" +string(4) "a97e" +string(0) "" +string(0) "" +string(0) "" +string(4) "a9a1" +string(4) "a9fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "aa40" +string(4) "aa7e" +string(0) "" +string(0) "" +string(0) "" +string(4) "aaa1" +string(4) "aafe" +string(0) "" +string(0) "" +string(0) "" +string(4) "ab40" +string(4) "ab7e" +string(0) "" +string(0) "" +string(0) "" +string(4) "aba1" +string(4) "abfe" +string(0) "" +string(0) "" +string(0) "" +string(4) "ac40" +string(4) "ac7e" +string(0) "" +string(0) "" +string(0) "" +string(4) "aca1" +string(4) "acfe" +string(0) "" +string(0) "" +string(0) "" +string(4) "ad40" +string(4) "ad7e" +string(0) "" +string(0) "" +string(0) "" +string(4) "ada1" +string(4) "adfe" +string(0) "" +string(0) "" +string(0) "" +string(4) "ae40" +string(4) "ae7e" +string(0) "" +string(0) "" +string(0) "" +string(4) "aea1" +string(4) "aefe" +string(0) "" +string(0) "" +string(0) "" +string(4) "af40" +string(4) "af7e" +string(0) "" +string(0) "" +string(0) "" +string(4) "afa1" +string(4) "affe" +string(0) "" +string(0) "" +string(0) "" +string(4) "b040" +string(4) "b07e" +string(0) "" +string(0) "" +string(0) "" +string(4) "b0a1" +string(4) "b0fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "b140" +string(4) "b17e" +string(0) "" +string(0) "" +string(0) "" +string(4) "b1a1" +string(4) "b1fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "b240" +string(4) "b27e" +string(0) "" +string(0) "" +string(0) "" +string(4) "b2a1" +string(4) "b2fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "b340" +string(4) "b37e" +string(0) "" +string(0) "" +string(0) "" +string(4) "b3a1" +string(4) "b3fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "b440" +string(4) "b47e" +string(0) "" +string(0) "" +string(0) "" +string(4) "b4a1" +string(4) "b4fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "b540" +string(4) "b57e" +string(0) "" +string(0) "" +string(0) "" +string(4) "b5a1" +string(4) "b5fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "b640" +string(4) "b67e" +string(0) "" +string(0) "" +string(0) "" +string(4) "b6a1" +string(4) "b6fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "b740" +string(4) "b77e" +string(0) "" +string(0) "" +string(0) "" +string(4) "b7a1" +string(4) "b7fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "b840" +string(4) "b87e" +string(0) "" +string(0) "" +string(0) "" +string(4) "b8a1" +string(4) "b8fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "b940" +string(4) "b97e" +string(0) "" +string(0) "" +string(0) "" +string(4) "b9a1" +string(4) "b9fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "ba40" +string(4) "ba7e" +string(0) "" +string(0) "" +string(0) "" +string(4) "baa1" +string(4) "bafe" +string(0) "" +string(0) "" +string(0) "" +string(4) "bb40" +string(4) "bb7e" +string(0) "" +string(0) "" +string(0) "" +string(4) "bba1" +string(4) "bbfe" +string(0) "" +string(0) "" +string(0) "" +string(4) "bc40" +string(4) "bc7e" +string(0) "" +string(0) "" +string(0) "" +string(4) "bca1" +string(4) "bcfe" +string(0) "" +string(0) "" +string(0) "" +string(4) "bd40" +string(4) "bd7e" +string(0) "" +string(0) "" +string(0) "" +string(4) "bda1" +string(4) "bdfe" +string(0) "" +string(0) "" +string(0) "" +string(4) "be40" +string(4) "be7e" +string(0) "" +string(0) "" +string(0) "" +string(4) "bea1" +string(4) "befe" +string(0) "" +string(0) "" +string(0) "" +string(4) "bf40" +string(4) "bf7e" +string(0) "" +string(0) "" +string(0) "" +string(4) "bfa1" +string(4) "bffe" +string(0) "" +string(0) "" +string(0) "" +string(4) "c040" +string(4) "c07e" +string(0) "" +string(0) "" +string(0) "" +string(4) "c0a1" +string(4) "c0fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "c140" +string(4) "c17e" +string(0) "" +string(0) "" +string(0) "" +string(4) "c1a1" +string(4) "c1fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "c240" +string(4) "c27e" +string(0) "" +string(0) "" +string(0) "" +string(4) "c2a1" +string(4) "c2fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "c340" +string(4) "c37e" +string(0) "" +string(0) "" +string(0) "" +string(4) "c3a1" +string(4) "c3fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "c440" +string(4) "c47e" +string(0) "" +string(0) "" +string(0) "" +string(4) "c4a1" +string(4) "c4fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "c540" +string(4) "c57e" +string(0) "" +string(0) "" +string(0) "" +string(4) "c5a1" +string(4) "c5fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "c640" +string(4) "c67e" +string(0) "" +string(0) "" +string(0) "" +string(4) "c6a1" +string(4) "c6fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "c740" +string(4) "c77e" +string(0) "" +string(0) "" +string(0) "" +string(4) "c7a1" +string(4) "c7fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "c840" +string(4) "c87e" +string(0) "" +string(0) "" +string(0) "" +string(4) "c8a1" +string(4) "c8fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "c940" +string(4) "c97e" +string(0) "" +string(0) "" +string(0) "" +string(4) "c9a1" +string(4) "c9fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "ca40" +string(4) "ca7e" +string(0) "" +string(0) "" +string(0) "" +string(4) "caa1" +string(4) "cafe" +string(0) "" +string(0) "" +string(0) "" +string(4) "cb40" +string(4) "cb7e" +string(0) "" +string(0) "" +string(0) "" +string(4) "cba1" +string(4) "cbfe" +string(0) "" +string(0) "" +string(0) "" +string(4) "cc40" +string(4) "cc7e" +string(0) "" +string(0) "" +string(0) "" +string(4) "cca1" +string(4) "ccfe" +string(0) "" +string(0) "" +string(0) "" +string(4) "cd40" +string(4) "cd7e" +string(0) "" +string(0) "" +string(0) "" +string(4) "cda1" +string(4) "cdfe" +string(0) "" +string(0) "" +string(0) "" +string(4) "ce40" +string(4) "ce7e" +string(0) "" +string(0) "" +string(0) "" +string(4) "cea1" +string(4) "cefe" +string(0) "" +string(0) "" +string(0) "" +string(4) "cf40" +string(4) "cf7e" +string(0) "" +string(0) "" +string(0) "" +string(4) "cfa1" +string(4) "cffe" +string(0) "" +string(0) "" +string(0) "" +string(4) "d040" +string(4) "d07e" +string(0) "" +string(0) "" +string(0) "" +string(4) "d0a1" +string(4) "d0fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "d140" +string(4) "d17e" +string(0) "" +string(0) "" +string(0) "" +string(4) "d1a1" +string(4) "d1fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "d240" +string(4) "d27e" +string(0) "" +string(0) "" +string(0) "" +string(4) "d2a1" +string(4) "d2fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "d340" +string(4) "d37e" +string(0) "" +string(0) "" +string(0) "" +string(4) "d3a1" +string(4) "d3fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "d440" +string(4) "d47e" +string(0) "" +string(0) "" +string(0) "" +string(4) "d4a1" +string(4) "d4fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "d540" +string(4) "d57e" +string(0) "" +string(0) "" +string(0) "" +string(4) "d5a1" +string(4) "d5fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "d640" +string(4) "d67e" +string(0) "" +string(0) "" +string(0) "" +string(4) "d6a1" +string(4) "d6fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "d740" +string(4) "d77e" +string(0) "" +string(0) "" +string(0) "" +string(4) "d7a1" +string(4) "d7fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "d840" +string(4) "d87e" +string(0) "" +string(0) "" +string(0) "" +string(4) "d8a1" +string(4) "d8fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "d940" +string(4) "d97e" +string(0) "" +string(0) "" +string(0) "" +string(4) "d9a1" +string(4) "d9fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "da40" +string(4) "da7e" +string(0) "" +string(0) "" +string(0) "" +string(4) "daa1" +string(4) "dafe" +string(0) "" +string(0) "" +string(0) "" +string(4) "db40" +string(4) "db7e" +string(0) "" +string(0) "" +string(0) "" +string(4) "dba1" +string(4) "dbfe" +string(0) "" +string(0) "" +string(0) "" +string(4) "dc40" +string(4) "dc7e" +string(0) "" +string(0) "" +string(0) "" +string(4) "dca1" +string(4) "dcfe" +string(0) "" +string(0) "" +string(0) "" +string(4) "dd40" +string(4) "dd7e" +string(0) "" +string(0) "" +string(0) "" +string(4) "dda1" +string(4) "ddfe" +string(0) "" +string(0) "" +string(0) "" +string(4) "de40" +string(4) "de7e" +string(0) "" +string(0) "" +string(0) "" +string(4) "dea1" +string(4) "defe" +string(0) "" +string(0) "" +string(0) "" +string(4) "df40" +string(4) "df7e" +string(0) "" +string(0) "" +string(0) "" +string(4) "dfa1" +string(4) "dffe" +string(0) "" +string(0) "" +string(0) "" +string(4) "e040" +string(4) "e07e" +string(0) "" +string(0) "" +string(0) "" +string(4) "e0a1" +string(4) "e0fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "e140" +string(4) "e17e" +string(0) "" +string(0) "" +string(0) "" +string(4) "e1a1" +string(4) "e1fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "e240" +string(4) "e27e" +string(0) "" +string(0) "" +string(0) "" +string(4) "e2a1" +string(4) "e2fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "e340" +string(4) "e37e" +string(0) "" +string(0) "" +string(0) "" +string(4) "e3a1" +string(4) "e3fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "e440" +string(4) "e47e" +string(0) "" +string(0) "" +string(0) "" +string(4) "e4a1" +string(4) "e4fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "e540" +string(4) "e57e" +string(0) "" +string(0) "" +string(0) "" +string(4) "e5a1" +string(4) "e5fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "e640" +string(4) "e67e" +string(0) "" +string(0) "" +string(0) "" +string(4) "e6a1" +string(4) "e6fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "e740" +string(4) "e77e" +string(0) "" +string(0) "" +string(0) "" +string(4) "e7a1" +string(4) "e7fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "e840" +string(4) "e87e" +string(0) "" +string(0) "" +string(0) "" +string(4) "e8a1" +string(4) "e8fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "e940" +string(4) "e97e" +string(0) "" +string(0) "" +string(0) "" +string(4) "e9a1" +string(4) "e9fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "ea40" +string(4) "ea7e" +string(0) "" +string(0) "" +string(0) "" +string(4) "eaa1" +string(4) "eafe" +string(0) "" +string(0) "" +string(0) "" +string(4) "eb40" +string(4) "eb7e" +string(0) "" +string(0) "" +string(0) "" +string(4) "eba1" +string(4) "ebfe" +string(0) "" +string(0) "" +string(0) "" +string(4) "ec40" +string(4) "ec7e" +string(0) "" +string(0) "" +string(0) "" +string(4) "eca1" +string(4) "ecfe" +string(0) "" +string(0) "" +string(0) "" +string(4) "ed40" +string(4) "ed7e" +string(0) "" +string(0) "" +string(0) "" +string(4) "eda1" +string(4) "edfe" +string(0) "" +string(0) "" +string(0) "" +string(4) "ee40" +string(4) "ee7e" +string(0) "" +string(0) "" +string(0) "" +string(4) "eea1" +string(4) "eefe" +string(0) "" +string(0) "" +string(0) "" +string(4) "ef40" +string(4) "ef7e" +string(0) "" +string(0) "" +string(0) "" +string(4) "efa1" +string(4) "effe" +string(0) "" +string(0) "" +string(0) "" +string(4) "f040" +string(4) "f07e" +string(0) "" +string(0) "" +string(0) "" +string(4) "f0a1" +string(4) "f0fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "f140" +string(4) "f17e" +string(0) "" +string(0) "" +string(0) "" +string(4) "f1a1" +string(4) "f1fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "f240" +string(4) "f27e" +string(0) "" +string(0) "" +string(0) "" +string(4) "f2a1" +string(4) "f2fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "f340" +string(4) "f37e" +string(0) "" +string(0) "" +string(0) "" +string(4) "f3a1" +string(4) "f3fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "f440" +string(4) "f47e" +string(0) "" +string(0) "" +string(0) "" +string(4) "f4a1" +string(4) "f4fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "f540" +string(4) "f57e" +string(0) "" +string(0) "" +string(0) "" +string(4) "f5a1" +string(4) "f5fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "f640" +string(4) "f67e" +string(0) "" +string(0) "" +string(0) "" +string(4) "f6a1" +string(4) "f6fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "f740" +string(4) "f77e" +string(0) "" +string(0) "" +string(0) "" +string(4) "f7a1" +string(4) "f7fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "f840" +string(4) "f87e" +string(0) "" +string(0) "" +string(0) "" +string(4) "f8a1" +string(4) "f8fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "f940" +string(4) "f97e" +string(0) "" +string(0) "" +string(0) "" +string(4) "f9a1" +string(4) "f9fe" +string(0) "" +string(0) "" +string(0) "" +string(4) "fa40" +string(4) "fa7e" +string(0) "" +string(0) "" +string(0) "" +string(4) "faa1" +string(4) "fafe" +string(0) "" +string(0) "" +string(0) "" +string(4) "fb40" +string(4) "fb7e" +string(0) "" +string(0) "" +string(0) "" +string(4) "fba1" +string(4) "fbfe" +string(0) "" +string(0) "" +string(0) "" +string(4) "fc40" +string(4) "fc7e" +string(0) "" +string(0) "" +string(0) "" +string(4) "fca1" +string(4) "fcfe" +string(0) "" +string(0) "" +string(0) "" +string(4) "fd40" +string(4) "fd7e" +string(0) "" +string(0) "" +string(0) "" +string(4) "fda1" +string(4) "fdfe" +string(0) "" +string(0) "" +string(0) "" +string(4) "fe40" +string(4) "fe7e" +string(0) "" +string(0) "" +string(0) "" +string(4) "fea1" +string(4) "fefe" +string(0) "" diff --git a/ext/standard/tests/strings/bug50052.phpt b/ext/standard/tests/strings/bug50052.phpt index 24a5a201f..96d859992 100644 --- a/ext/standard/tests/strings/bug50052.phpt +++ b/ext/standard/tests/strings/bug50052.phpt @@ -1,5 +1,5 @@ --TEST--
-Bug #20934 (html_entity_decode() crash when "" is passed)
+Bug #50052 (Different Hashes on Windows and Linux on wrong Salt size)
--FILE--
<?php
$salt = '$1$f+uslYF01$';
diff --git a/ext/standard/tests/strings/bug50847.phpt b/ext/standard/tests/strings/bug50847.phpt new file mode 100644 index 000000000..28e83f511 --- /dev/null +++ b/ext/standard/tests/strings/bug50847.phpt @@ -0,0 +1,10 @@ +--TEST-- +Bug #50847 (strip_tags() removes all tags greater then 1023 bytes long) +--FILE-- +<?php +$var = '<param value="' . str_repeat("a", 2048) . '" />'; +var_dump(strip_tags($var, "<param>"), strip_tags($var)); +?> +--EXPECT-- +string(2066) "<param value="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" />" +string(0) "" diff --git a/ext/standard/tests/strings/bug51059.phpt b/ext/standard/tests/strings/bug51059.phpt new file mode 100644 index 000000000..f2cbe9def --- /dev/null +++ b/ext/standard/tests/strings/bug51059.phpt @@ -0,0 +1,11 @@ +--TEST-- +Bug #51059 crypt() segfaults on certain salts +--FILE-- +<?php +$res = crypt('a', '_'); +if ($res == '*0' || $res == '*1') echo 'OK'; +else echo 'Not OK'; + +?> +--EXPECT-- +OK diff --git a/ext/standard/tests/strings/crypt_blowfish_invalid_rounds.phpt b/ext/standard/tests/strings/crypt_blowfish_invalid_rounds.phpt new file mode 100644 index 000000000..6d40b0770 --- /dev/null +++ b/ext/standard/tests/strings/crypt_blowfish_invalid_rounds.phpt @@ -0,0 +1,22 @@ +--TEST-- +Test Blowfish crypt() with invalid rounds +--FILE-- +<?php + +foreach(range(32, 38) as $i) { + if (crypt('U*U', '$2a$'.$i.'$CCCCCCCCCCCCCCCCCCCCCC$') === FALSE) { + echo "$i. OK\n"; + } else { + echo "$i. Not OK\n"; + } +} + +?> +--EXPECT-- +32. OK +33. OK +34. OK +35. OK +36. OK +37. OK +38. OK diff --git a/ext/standard/tests/strings/crypt_sha256.phpt b/ext/standard/tests/strings/crypt_sha256.phpt new file mode 100644 index 000000000..86c7245fe --- /dev/null +++ b/ext/standard/tests/strings/crypt_sha256.phpt @@ -0,0 +1,64 @@ +--TEST-- +crypt() SHA-256 +--SKIPIF-- +<?php +if (!function_exists('crypt') || !defined("CRYPT_SHA256")) { + die("SKIP crypt()-sha256 is not available"); +} +?> +--FILE-- +<?php + +$tests = array( + 1 => array( + b'$5$saltstring', + b'Hello world!', + b'$5$saltstring$5B8vYYiY.CVt1RlTTf8KbXBH3hsxY/GNooZaBBGWEc5' + ), + 2 => array( + b'$5$rounds=10000$saltstringsaltstring', + b'Hello world!', + b'$5$rounds=10000$saltstringsaltst$3xv.VbSHBb41AL9AvLeujZkZRBAwqFMz2.opqey6IcA' + ), + 3 => array( + b'$5$rounds=10000$saltstringsaltstring', + b'Hello world!', + b'$5$rounds=10000$saltstringsaltst$3xv.VbSHBb41AL9AvLeujZkZRBAwqFMz2.opqey6IcA' + ), + 4 => array( + b'$5$rounds=5000$toolongsaltstring', + b'This is just a test', + b'$5$rounds=5000$toolongsaltstrin$Un/5jzAHMgOGZ5.mWJpuVolil07guHPvOW8mGRcvxa5' + ), + 5 => array( + b'$5$rounds=1400$anotherlongsaltstring', + b'a very much longer text to encrypt. This one even stretches over morethan one line.', + b'$5$rounds=1400$anotherlongsalts$Rx.j8H.h8HjEDGomFU8bDkXm3XIUnzyxf12oP84Bnq1' + ), + 6 => array( + b'$5$rounds=77777$short', + b'we have a short salt string but not a short password', + b'$5$rounds=77777$short$JiO1O3ZpDAxGJeaDIuqCoEFysAe1mZNJRs3pw0KQRd/' + ), + 7 => array( + b'$5$rounds=123456$asaltof16chars..', + b'a short string', + b'$5$rounds=123456$asaltof16chars..$gP3VQ/6X7UUEW3HkBn2w1/Ptq2jxPyzV/cZKmF/wJvD' + ), + 8 => array( + b'$5$rounds=10$roundstoolow', + b'the minimum number is still observed', + b'$5$rounds=1000$roundstoolow$yfvwcWrQ8l/K0DAWyuPMDNHpIVlTQebY9l/gL972bIC' + ) +); + +foreach ($tests as $iter => $t) { + $res = crypt($t[1], $t[0]); + if ($res != $t[2]) echo "Iteration $iter failed. +Expected: <$t[2]> +Got <$res>\n"; +} +echo "Passes.";?> +--EXPECTF-- +Passes. + diff --git a/ext/standard/tests/strings/crypt_sha512.phpt b/ext/standard/tests/strings/crypt_sha512.phpt new file mode 100644 index 000000000..d6f9df601 --- /dev/null +++ b/ext/standard/tests/strings/crypt_sha512.phpt @@ -0,0 +1,65 @@ +--TEST-- +crypt() SHA-512 +--SKIPIF-- +<?php +if (!function_exists('crypt') || !defined("CRYPT_SHA512")) { + die("SKIP crypt()-sha512 is not available"); +} +?> +--FILE-- +<?php + +$tests = array( + 1 => array( + b'$6$saltstring', + b'Hello world!', + b'$6$saltstring$svn8UoSVapNtMuq1ukKS4tPQd8iKwSMHWjl/O817G3uBnIFNjnQJuesI68u4OTLiBFdcbYEdFCoEOfaS35inz1' + ), + 2 => array( + b'$6$rounds=10000$saltstringsaltstring', + b'Hello world!', + b'$6$rounds=10000$saltstringsaltst$OW1/O6BYHV6BcXZu8QVeXbDWra3Oeqh0sbHbbMCVNSnCM/UrjmM0Dp8vOuZeHBy/YTBmSK6H9qs/y3RnOaw5v.' + ), + 3 => array( + b'$6$rounds=5000$toolongsaltstring', + b'This is just a test', + b'$6$rounds=5000$toolongsaltstrin$lQ8jolhgVRVhY4b5pZKaysCLi0QBxGoNeKQzQ3glMhwllF7oGDZxUhx1yxdYcz/e1JSbq3y6JMxxl8audkUEm0' + ), + 4 => array( + b'$6$rounds=1400$anotherlongsaltstring', + b'a very much longer text to encrypt. This one even stretches over morethan one line.', + b'$6$rounds=1400$anotherlongsalts$POfYwTEok97VWcjxIiSOjiykti.o/pQs.wPvMxQ6Fm7I6IoYN3CmLs66x9t0oSwbtEW7o7UmJEiDwGqd8p4ur1' + ), + 5 => array( + b'$6$rounds=77777$short', + b'we have a short salt string but not a short password', + b'$6$rounds=77777$short$WuQyW2YR.hBNpjjRhpYD/ifIw05xdfeEyQoMxIXbkvr0gge1a1x3yRULJ5CCaUeOxFmtlcGZelFl5CxtgfiAc0' + ), + 6 => array( + b'$6$rounds=123456$asaltof16chars..', + b'a short string', + b'$6$rounds=123456$asaltof16chars..$BtCwjqMJGx5hrJhZywWvt0RLE8uZ4oPwcelCjmw2kSYu.Ec6ycULevoBK25fs2xXgMNrCzIMVcgEJAstJeonj1' + ), + 7 => array( + b'$6$rounds=10$roundstoolow', + b'the minimum number is still observed', + b'$6$rounds=1000$roundstoolow$kUMsbe306n21p9R.FRkW3IGn.S9NPN0x50YhH1xhLsPuWGsUSklZt58jaTfF4ZEQpyUNGc0dqbpBYYBaHHrsX.' + ), + 8 => array( + b'$6$$bar$', + b'foo', + b'$6$$QMXjqd7rHQZPQ1yHsXkQqC1FBzDiVfTHXL.LaeDAeVV.IzMaV9VU4MQ8kPuZa2SOP1A0RPm772EaFYjpEJtdu.' + ), +); + +foreach ($tests as $iter => $t) { + $res = crypt($t[1], $t[0]); + if ($res != $t[2]) echo "Iteration $iter failed. +Expected: <$t[2]> +Got <$res>\n"; +} +echo "Passes."; +?> +--EXPECTF-- +Passes. + diff --git a/ext/standard/tests/strings/html_entity_decode_html4.phpt b/ext/standard/tests/strings/html_entity_decode_html4.phpt new file mode 100644 index 000000000..3c92bf6fb --- /dev/null +++ b/ext/standard/tests/strings/html_entity_decode_html4.phpt @@ -0,0 +1,516 @@ +--TEST-- +html_entity_decode() conformance check (HTML 4) +--FILE-- +<?php +$map = array( + """, + "&", + "<", + ">", + " ", + "¡", + "¢", + "£", + "¤", + "¥", + "¦", + "§", + "¨", + "©", + "ª", + "«", + "¬", + "­", + "®", + "¯", + "°", + "±", + "²", + "³", + "´", + "µ", + "¶", + "·", + "¸", + "¹", + "º", + "»", + "¼", + "½", + "¾", + "¿", + "À", + "Á", + "Â", + "Ã", + "Ä", + "Å", + "Æ", + "Ç", + "È", + "É", + "Ê", + "Ë", + "Ì", + "Í", + "Î", + "Ï", + "Ð", + "Ñ", + "Ò", + "Ó", + "Ô", + "Õ", + "Ö", + "×", + "Ø", + "Ù", + "Ú", + "Û", + "Ü", + "Ý", + "Þ", + "ß", + "à", + "á", + "â", + "ã", + "ä", + "å", + "æ", + "ç", + "è", + "é", + "ê", + "ë", + "ì", + "í", + "î", + "ï", + "ð", + "ñ", + "ò", + "ó", + "ô", + "õ", + "ö", + "÷", + "ø", + "ù", + "ú", + "û", + "ü", + "ý", + "þ", + "ÿ", + "Œ", + "œ", + "Š", + "š", + "Ÿ", + "ƒ", + "ˆ", + "˜", + "Α", + "Β", + "Γ", + "Δ", + "Ε", + "Ζ", + "Η", + "Θ", + "Ι", + "Κ", + "Λ", + "Μ", + "Ν", + "Ξ", + "Ο", + "Π", + "Ρ", + "Σ", + "Τ", + "Υ", + "Φ", + "Χ", + "Ψ", + "Ω", + "α", + "β", + "γ", + "δ", + "ε", + "ζ", + "η", + "θ", + "ι", + "κ", + "λ", + "μ", + "ν", + "ξ", + "ο", + "π", + "ρ", + "ς", + "σ", + "τ", + "υ", + "φ", + "χ", + "ψ", + "ω", + "ϑ", + "ϒ", + "ϖ", + " ", + " ", + " ", + "‌", + "‍", + "‎", + "‏", + "–", + "—", + "‘", + "’", + "‚", + "“", + "”", + "„", + "†", + "‡", + "•", + "…", + "‰", + "′", + "″", + "‹", + "›", + "‾", + "⁄", + "€", + "ℑ", + "℘", + "ℜ", + "™", + "ℵ", + "←", + "↑", + "→", + "↓", + "↔", + "↵", + "⇐", + "⇑", + "⇒", + "⇓", + "⇔", + "∀", + "∂", + "∃", + "∅", + "∇", + "∈", + "∉", + "∋", + "∏", + "∑", + "−", + "∗", + "√", + "∝", + "∞", + "∠", + "∧", + "∨", + "∩", + "∪", + "∫", + "∴", + "∼", + "≅", + "≈", + "≠", + "≡", + "≤", + "≥", + "⊂", + "⊃", + "⊄", + "⊆", + "⊇", + "⊕", + "⊗", + "⊥", + "⋅", + "⌈", + "⌉", + "⌊", + "⌋", + "⟨", + "⟩", + "◊", + "♠", + "♣", + "♥", + "♦", +); + +foreach ($map as $str) { + echo bin2hex(html_entity_decode($str, ENT_QUOTES, "UTF-8")), "\n"; +} +?> +--EXPECT-- +22 +26 +3c +3e +c2a0 +c2a1 +c2a2 +c2a3 +c2a4 +c2a5 +c2a6 +c2a7 +c2a8 +c2a9 +c2aa +c2ab +c2ac +c2ad +c2ae +c2af +c2b0 +c2b1 +c2b2 +c2b3 +c2b4 +c2b5 +c2b6 +c2b7 +c2b8 +c2b9 +c2ba +c2bb +c2bc +c2bd +c2be +c2bf +c380 +c381 +c382 +c383 +c384 +c385 +c386 +c387 +c388 +c389 +c38a +c38b +c38c +c38d +c38e +c38f +c390 +c391 +c392 +c393 +c394 +c395 +c396 +c397 +c398 +c399 +c39a +c39b +c39c +c39d +c39e +c39f +c3a0 +c3a1 +c3a2 +c3a3 +c3a4 +c3a5 +c3a6 +c3a7 +c3a8 +c3a9 +c3aa +c3ab +c3ac +c3ad +c3ae +c3af +c3b0 +c3b1 +c3b2 +c3b3 +c3b4 +c3b5 +c3b6 +c3b7 +c3b8 +c3b9 +c3ba +c3bb +c3bc +c3bd +c3be +c3bf +c592 +c593 +c5a0 +c5a1 +c5b8 +c692 +cb86 +cb9c +ce91 +ce92 +ce93 +ce94 +ce95 +ce96 +ce97 +ce98 +ce99 +ce9a +ce9b +ce9c +ce9d +ce9e +ce9f +cea0 +cea1 +cea3 +cea4 +cea5 +cea6 +cea7 +cea8 +cea9 +ceb1 +ceb2 +ceb3 +ceb4 +ceb5 +ceb6 +ceb7 +ceb8 +ceb9 +ceba +cebb +cebc +cebd +cebe +cebf +cf80 +cf81 +cf82 +cf83 +cf84 +cf85 +cf86 +cf87 +cf88 +cf89 +cf91 +cf92 +cf96 +e28082 +e28083 +e28089 +e2808c +e2808d +e2808e +e2808f +e28093 +e28094 +e28098 +e28099 +e2809a +e2809c +e2809d +e2809e +e280a0 +e280a1 +e280a2 +e280a6 +e280b0 +e280b2 +e280b3 +e280b9 +e280ba +e280be +e28184 +e282ac +e28491 +e28498 +e2849c +e284a2 +e284b5 +e28690 +e28691 +e28692 +e28693 +e28694 +e286b5 +e28790 +e28791 +e28792 +e28793 +e28794 +e28880 +e28882 +e28883 +e28885 +e28887 +e28888 +e28889 +e2888b +e2888f +e28891 +e28892 +e28897 +e2889a +e2889d +e2889e +e288a0 +e288a7 +e288a8 +e288a9 +e288aa +e288ab +e288b4 +e288bc +e28985 +e28988 +e289a0 +e289a1 +e289a4 +e289a5 +e28a82 +e28a83 +e28a84 +e28a86 +e28a87 +e28a95 +e28a97 +e28aa5 +e28b85 +e28c88 +e28c89 +e28c8a +e28c8b +e28ca9 +e28caa +e2978a +e299a0 +e299a3 +e299a5 +e299a6 diff --git a/ext/standard/tests/strings/htmlentities-utf-2.phpt b/ext/standard/tests/strings/htmlentities-utf-2.phpt index a80100cb1..c5f4ac4ea 100755 --- a/ext/standard/tests/strings/htmlentities-utf-2.phpt +++ b/ext/standard/tests/strings/htmlentities-utf-2.phpt @@ -36,8 +36,8 @@ foreach($strings as $string) { %unicode|string%(0) "" %unicode|string%(2) "79" %unicode|string%(2) "79" -%unicode|string%(8) "2667743b" -%unicode|string%(8) "2667743b" +%unicode|string%(0) "" +%unicode|string%(0) "" %unicode|string%(8) "566f696c" %unicode|string%(8) "566f696c" %unicode|string%(12) "436c69636873" @@ -52,10 +52,10 @@ foreach($strings as $string) { %unicode|string%(2) "79" %unicode|string%(8) "f7bfbfbf" %unicode|string%(8) "f7bfbfbf" -%unicode|string%(10) "fbbfbfbfbf" -%unicode|string%(10) "fbbfbfbfbf" -%unicode|string%(12) "fdbfbfbfbfbf" -%unicode|string%(12) "fdbfbfbfbfbf" +%unicode|string%(0) "" +%unicode|string%(0) "" +%unicode|string%(0) "" +%unicode|string%(0) "" %unicode|string%(4) "4142" %unicode|string%(4) "4142" %unicode|string%(4) "4242" diff --git a/ext/standard/tests/strings/htmlentities-utf.phpt b/ext/standard/tests/strings/htmlentities-utf.phpt index b85803a16..1daafc61d 100755 --- a/ext/standard/tests/strings/htmlentities-utf.phpt +++ b/ext/standard/tests/strings/htmlentities-utf.phpt @@ -36,8 +36,8 @@ foreach($strings as $string) { %unicode|string%(0) "" %unicode|string%(0) "" %unicode|string%(0) "" -%unicode|string%(8) "2667743b" -%unicode|string%(8) "2667743b" +%unicode|string%(0) "" +%unicode|string%(0) "" %unicode|string%(0) "" %unicode|string%(0) "" %unicode|string%(0) "" @@ -52,10 +52,10 @@ foreach($strings as $string) { %unicode|string%(0) "" %unicode|string%(8) "f7bfbfbf" %unicode|string%(8) "f7bfbfbf" -%unicode|string%(10) "fbbfbfbfbf" -%unicode|string%(10) "fbbfbfbfbf" -%unicode|string%(12) "fdbfbfbfbfbf" -%unicode|string%(12) "fdbfbfbfbfbf" +%unicode|string%(0) "" +%unicode|string%(0) "" +%unicode|string%(0) "" +%unicode|string%(0) "" %unicode|string%(0) "" %unicode|string%(0) "" %unicode|string%(0) "" diff --git a/ext/standard/tests/strings/htmlentities02.phpt b/ext/standard/tests/strings/htmlentities02.phpt index b8b9e6315..5d708c21c 100644 --- a/ext/standard/tests/strings/htmlentities02.phpt +++ b/ext/standard/tests/strings/htmlentities02.phpt @@ -10,7 +10,7 @@ if (!$result) { --INI-- output_handler= default_charset= -mbstring.internal_encoding=none +mbstring.internal_encoding=pass --FILE-- <?php setlocale(LC_CTYPE, "fr_FR.ISO-8859-15", "fr_FR.ISO8859-15", 'fr_FR@euro'); diff --git a/ext/standard/tests/strings/htmlentities03.phpt b/ext/standard/tests/strings/htmlentities03.phpt index 7e933544f..9f40ff3bc 100644 --- a/ext/standard/tests/strings/htmlentities03.phpt +++ b/ext/standard/tests/strings/htmlentities03.phpt @@ -10,7 +10,7 @@ if (!$result || preg_match('/ISO/i', setlocale(LC_CTYPE, 0)) == 0) { --INI-- output_handler= default_charset= -mbstring.internal_encoding=none +mbstring.internal_encoding=pass --FILE-- <?php setlocale( LC_CTYPE, "de_DE.ISO-8859-1", "de_DE.ISO8859-1"); diff --git a/ext/standard/tests/strings/htmlentities04.phpt b/ext/standard/tests/strings/htmlentities04.phpt index 8e362d073..565c11bbc 100644 --- a/ext/standard/tests/strings/htmlentities04.phpt +++ b/ext/standard/tests/strings/htmlentities04.phpt @@ -10,7 +10,7 @@ if (!$result || preg_match('/EUC[^a-zA-Z]*JP/i', setlocale(LC_CTYPE, 0)) == 0) { --INI-- output_handler= default_charset= -mbstring.internal_encoding=none +mbstring.internal_encoding=pass --FILE-- <?php setlocale( LC_CTYPE, "ja_JP.EUC-JP", "ja_JP.eucJP" ); diff --git a/ext/standard/tests/strings/htmlentities15.phpt b/ext/standard/tests/strings/htmlentities15.phpt index 2dc36e6f7..f45be118c 100644 --- a/ext/standard/tests/strings/htmlentities15.phpt +++ b/ext/standard/tests/strings/htmlentities15.phpt @@ -3,7 +3,7 @@ htmlentities() test 15 (setlocale / KOI8-R) --INI-- output_handler= default_charset= -mbstring.internal_encoding=none +mbstring.internal_encoding=pass --SKIPIF-- <?php $result = (bool)setlocale(LC_CTYPE, "ru_RU.koi8r", "ru_RU.KOI8-R"); diff --git a/ext/standard/tests/strings/htmlentities_html4.phpt b/ext/standard/tests/strings/htmlentities_html4.phpt new file mode 100644 index 000000000..3f700e828 --- /dev/null +++ b/ext/standard/tests/strings/htmlentities_html4.phpt @@ -0,0 +1,305 @@ +--TEST-- +htmlentities() conformance check (HTML 4) +--FILE-- +<?php +function utf32_utf8($k) { + if ($k < 0x80) { + $retval = pack('C', $k); + } else if ($k < 0x800) { + $retval = pack('C2', + 0xc0 | ($k >> 6), + 0x80 | ($k & 0x3f)); + } else if ($k < 0x10000) { + $retval = pack('C3', + 0xe0 | ($k >> 12), + 0x80 | (($k >> 6) & 0x3f), + 0x80 | ($k & 0x3f)); + } else if ($k < 0x200000) { + $retval = pack('C4', + 0xf0 | ($k >> 18), + 0x80 | (($k >> 12) & 0x3f), + 0x80 | (($k >> 6) & 0x3f), + 0x80 | ($k & 0x3f)); + } else if ($k < 0x4000000) { + $retval = pack('C5', + 0xf8 | ($k >> 24), + 0x80 | (($k >> 18) & 0x3f), + 0x80 | (($k >> 12) & 0x3f), + 0x80 | (($k >> 6) & 0x3f), + 0x80 | ($k & 0x3f)); + } else { + $retval = pack('C6', + 0xfc | ($k >> 30), + 0x80 | (($k >> 24) & 0x3f), + 0x80 | (($k >> 18) & 0x3f), + 0x80 | (($k >> 12) & 0x3f), + 0x80 | (($k >> 6) & 0x3f), + 0x80 | ($k & 0x3f)); + } + return $retval; +} + +for ($i = 0; $i < 0x110000; $i++) { + if ($i >= 0xd800 && $i < 0xe000) + continue; + $str = utf32_utf8($i); + $result = htmlentities($str, ENT_QUOTES, 'UTF-8'); + if ($str != $result) { + printf("%s\tU+%05X\n", $result, $i); + } +} +?> +--EXPECT-- +" U+00022 +& U+00026 +' U+00027 +< U+0003C +> U+0003E + U+000A0 +¡ U+000A1 +¢ U+000A2 +£ U+000A3 +¤ U+000A4 +¥ U+000A5 +¦ U+000A6 +§ U+000A7 +¨ U+000A8 +© U+000A9 +ª U+000AA +« U+000AB +¬ U+000AC +­ U+000AD +® U+000AE +¯ U+000AF +° U+000B0 +± U+000B1 +² U+000B2 +³ U+000B3 +´ U+000B4 +µ U+000B5 +¶ U+000B6 +· U+000B7 +¸ U+000B8 +¹ U+000B9 +º U+000BA +» U+000BB +¼ U+000BC +½ U+000BD +¾ U+000BE +¿ U+000BF +À U+000C0 +Á U+000C1 + U+000C2 +à U+000C3 +Ä U+000C4 +Å U+000C5 +Æ U+000C6 +Ç U+000C7 +È U+000C8 +É U+000C9 +Ê U+000CA +Ë U+000CB +Ì U+000CC +Í U+000CD +Î U+000CE +Ï U+000CF +Ð U+000D0 +Ñ U+000D1 +Ò U+000D2 +Ó U+000D3 +Ô U+000D4 +Õ U+000D5 +Ö U+000D6 +× U+000D7 +Ø U+000D8 +Ù U+000D9 +Ú U+000DA +Û U+000DB +Ü U+000DC +Ý U+000DD +Þ U+000DE +ß U+000DF +à U+000E0 +á U+000E1 +â U+000E2 +ã U+000E3 +ä U+000E4 +å U+000E5 +æ U+000E6 +ç U+000E7 +è U+000E8 +é U+000E9 +ê U+000EA +ë U+000EB +ì U+000EC +í U+000ED +î U+000EE +ï U+000EF +ð U+000F0 +ñ U+000F1 +ò U+000F2 +ó U+000F3 +ô U+000F4 +õ U+000F5 +ö U+000F6 +÷ U+000F7 +ø U+000F8 +ù U+000F9 +ú U+000FA +û U+000FB +ü U+000FC +ý U+000FD +þ U+000FE +ÿ U+000FF +Œ U+00152 +œ U+00153 +Š U+00160 +š U+00161 +Ÿ U+00178 +ƒ U+00192 +ˆ U+002C6 +˜ U+002DC +Α U+00391 +Β U+00392 +Γ U+00393 +Δ U+00394 +Ε U+00395 +Ζ U+00396 +Η U+00397 +Θ U+00398 +Ι U+00399 +Κ U+0039A +Λ U+0039B +Μ U+0039C +Ν U+0039D +Ξ U+0039E +Ο U+0039F +Π U+003A0 +Ρ U+003A1 +Σ U+003A3 +Τ U+003A4 +Υ U+003A5 +Φ U+003A6 +Χ U+003A7 +Ψ U+003A8 +Ω U+003A9 +α U+003B1 +β U+003B2 +γ U+003B3 +δ U+003B4 +ε U+003B5 +ζ U+003B6 +η U+003B7 +θ U+003B8 +ι U+003B9 +κ U+003BA +λ U+003BB +μ U+003BC +ν U+003BD +ξ U+003BE +ο U+003BF +π U+003C0 +ρ U+003C1 +ς U+003C2 +σ U+003C3 +τ U+003C4 +υ U+003C5 +φ U+003C6 +χ U+003C7 +ψ U+003C8 +ω U+003C9 +ϑ U+003D1 +ϒ U+003D2 +ϖ U+003D6 +  U+02002 +  U+02003 +  U+02009 +‌ U+0200C +‍ U+0200D +‎ U+0200E +‏ U+0200F +– U+02013 +— U+02014 +‘ U+02018 +’ U+02019 +‚ U+0201A +“ U+0201C +” U+0201D +„ U+0201E +† U+02020 +‡ U+02021 +• U+02022 +… U+02026 +‰ U+02030 +′ U+02032 +″ U+02033 +‹ U+02039 +› U+0203A +‾ U+0203E +⁄ U+02044 +€ U+020AC +ℑ U+02111 +℘ U+02118 +ℜ U+0211C +™ U+02122 +ℵ U+02135 +← U+02190 +↑ U+02191 +→ U+02192 +↓ U+02193 +↔ U+02194 +↵ U+021B5 +⇐ U+021D0 +⇑ U+021D1 +⇒ U+021D2 +⇓ U+021D3 +⇔ U+021D4 +∀ U+02200 +∂ U+02202 +∃ U+02203 +∅ U+02205 +∇ U+02207 +∈ U+02208 +∉ U+02209 +∋ U+0220B +∏ U+0220F +∑ U+02211 +− U+02212 +∗ U+02217 +√ U+0221A +∝ U+0221D +∞ U+0221E +∠ U+02220 +∧ U+02227 +∨ U+02228 +∩ U+02229 +∪ U+0222A +∫ U+0222B +∴ U+02234 +∼ U+0223C +≅ U+02245 +≈ U+02248 +≠ U+02260 +≡ U+02261 +≤ U+02264 +≥ U+02265 +⊂ U+02282 +⊃ U+02283 +⊄ U+02284 +⊆ U+02286 +⊇ U+02287 +⊕ U+02295 +⊗ U+02297 +⊥ U+022A5 +⋅ U+022C5 +⌈ U+02308 +⌉ U+02309 +⌊ U+0230A +⌋ U+0230B +⟨ U+02329 +⟩ U+0232A +◊ U+025CA +♠ U+02660 +♣ U+02663 +♥ U+02665 +♦ U+02666 diff --git a/ext/standard/tests/strings/parse_str_basic3.phpt b/ext/standard/tests/strings/parse_str_basic3.phpt index 5b0641e14..0cc761615 100644 --- a/ext/standard/tests/strings/parse_str_basic3.phpt +++ b/ext/standard/tests/strings/parse_str_basic3.phpt @@ -91,7 +91,7 @@ var_dump($res); ?> ===DONE=== --EXPECTF-- -PHP Warning: Directive 'magic_quotes_gpc' is deprecated in PHP 5.3 and greater in Unknown on line 0 +Warning: Directive 'magic_quotes_gpc' is deprecated in PHP 5.3 and greater in Unknown on line 0 *** Testing parse_str() : basic functionality *** Test string with array values diff --git a/ext/standard/tests/strings/setlocale_variation2.phpt b/ext/standard/tests/strings/setlocale_variation2.phpt index 98c405b70..af8739a76 100644 --- a/ext/standard/tests/strings/setlocale_variation2.phpt +++ b/ext/standard/tests/strings/setlocale_variation2.phpt @@ -18,6 +18,10 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { /* setlocale() to set all available locales in the system and check the success count */ echo "*** Testing setlocale() : usage variations ***\n"; +function good_locale($locale) { + return $locale !== 'tt_RU@iqtelif.UTF-8'; +} + /* Prototype : array list_system_locales( void ) * Description: To get the currently installed locle in this platform * Arguments : Nil @@ -38,8 +42,8 @@ function list_system_locales() { $system_locales = explode("\n", $all_locales); - // return all the locale found in the system - return $system_locales; + // return all the locale found in the system, except for broken one + return array_filter($system_locales, 'good_locale'); } // gather all the locales installed in the system diff --git a/ext/standard/type.c b/ext/standard/type.c index be165d6bf..8b84662b6 100644 --- a/ext/standard/type.c +++ b/ext/standard/type.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: type.c 278172 2009-04-02 09:56:33Z dmitry $ */ +/* $Id: type.c 293036 2010-01-03 09:23:27Z sebastian $ */ #include "php.h" #include "php_incomplete_class.h" diff --git a/ext/standard/uniqid.c b/ext/standard/uniqid.c index e69f00568..ef25240d1 100644 --- a/ext/standard/uniqid.c +++ b/ext/standard/uniqid.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: uniqid.c 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: uniqid.c 293036 2010-01-03 09:23:27Z sebastian $ */ #include "php.h" diff --git a/ext/standard/uniqid.h b/ext/standard/uniqid.h index 716cb8c25..da98a8fad 100644 --- a/ext/standard/uniqid.h +++ b/ext/standard/uniqid.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: uniqid.h 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: uniqid.h 293036 2010-01-03 09:23:27Z sebastian $ */ #ifndef UNIQID_H #define UNIQID_H diff --git a/ext/standard/url.c b/ext/standard/url.c index 06d33fd9f..eebcdd05f 100644 --- a/ext/standard/url.c +++ b/ext/standard/url.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -15,7 +15,7 @@ | Author: Jim Winstead <jimw@php.net> | +----------------------------------------------------------------------+ */ -/* $Id: url.c 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: url.c 293036 2010-01-03 09:23:27Z sebastian $ */ #include <stdlib.h> #include <string.h> @@ -201,10 +201,21 @@ PHPAPI php_url *php_url_parse_ex(char const *str, int length) e = ue; if (!(p = memchr(s, '/', (ue - s)))) { - if ((p = memchr(s, '?', (ue - s)))) { - e = p; - } else if ((p = memchr(s, '#', (ue - s)))) { - e = p; + char *query, *fragment; + + query = memchr(s, '?', (ue - s)); + fragment = memchr(s, '#', (ue - s)); + + if (query && fragment) { + if (query > fragment) { + p = e = fragment; + } else { + p = e = query; + } + } else if (query) { + p = e = query; + } else if (fragment) { + p = e = fragment; } } else { e = p; @@ -285,10 +296,10 @@ PHPAPI php_url *php_url_parse_ex(char const *str, int length) if ((p = memchr(s, '?', (ue - s)))) { pp = strchr(s, '#'); - + if (pp && pp < p) { p = pp; - pp = strchr(pp+2, '#'); + goto label_parse; } if (p - s) { diff --git a/ext/standard/url.h b/ext/standard/url.h index a478d304a..a9c2e03c0 100644 --- a/ext/standard/url.h +++ b/ext/standard/url.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -15,7 +15,7 @@ | Author: Jim Winstead <jimw@php.net> | +----------------------------------------------------------------------+ */ -/* $Id: url.h 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: url.h 293036 2010-01-03 09:23:27Z sebastian $ */ #ifndef URL_H #define URL_H diff --git a/ext/standard/url_scanner_ex.h b/ext/standard/url_scanner_ex.h index d3fb96594..f454d9f65 100644 --- a/ext/standard/url_scanner_ex.h +++ b/ext/standard/url_scanner_ex.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: url_scanner_ex.h 286379 2009-07-26 23:20:34Z jani $ */ +/* $Id: url_scanner_ex.h 293036 2010-01-03 09:23:27Z sebastian $ */ #ifndef URL_SCANNER_EX_H #define URL_SCANNER_EX_H diff --git a/ext/standard/user_filters.c b/ext/standard/user_filters.c index fc0069aff..3922fc56a 100644 --- a/ext/standard/user_filters.c +++ b/ext/standard/user_filters.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: user_filters.c 273098 2009-01-08 18:40:27Z lbarnaud $ */ +/* $Id: user_filters.c 293036 2010-01-03 09:23:27Z sebastian $ */ #include "php.h" #include "php_globals.h" diff --git a/ext/standard/uuencode.c b/ext/standard/uuencode.c index 2980e1285..0ef1fd462 100644 --- a/ext/standard/uuencode.c +++ b/ext/standard/uuencode.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: uuencode.c 280460 2009-05-13 16:29:26Z kalle $ */ +/* $Id: uuencode.c 293036 2010-01-03 09:23:27Z sebastian $ */ /* * Portions of this code are based on Berkeley's uuencode/uudecode diff --git a/ext/standard/var.c b/ext/standard/var.c index 0ed635e2e..6d2614f4c 100644 --- a/ext/standard/var.c +++ b/ext/standard/var.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: var.c 287123 2009-08-11 22:46:07Z stas $ */ +/* $Id: var.c 293036 2010-01-03 09:23:27Z sebastian $ */ /* {{{ includes */ @@ -612,9 +612,9 @@ static void php_var_serialize_class(smart_str *buf, zval *struc, zval *retval_pt break; } pefree(prot_name, ce->type & ZEND_INTERNAL_CLASS); - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "\"%s\" returned as member variable from __sleep() but does not exist", Z_STRVAL_PP(name)); php_var_serialize_string(buf, Z_STRVAL_PP(name), Z_STRLEN_PP(name)); php_var_serialize_intern(buf, nvalp, var_hash TSRMLS_CC); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "\"%s\" returned as member variable from __sleep() but does not exist", Z_STRVAL_PP(name)); } while (0); } else { php_var_serialize_string(buf, Z_STRVAL_PP(name), Z_STRLEN_PP(name)); diff --git a/ext/standard/var_unserializer.c b/ext/standard/var_unserializer.c index 01d2fd9f6..82c16222a 100644 --- a/ext/standard/var_unserializer.c +++ b/ext/standard/var_unserializer.c @@ -1,9 +1,9 @@ -/* Generated by re2c 0.13.5 on Wed Apr 8 09:34:35 2009 */ +/* Generated by re2c 0.13.5 on Mon Nov 23 09:26:17 2009 */ /* +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: var_unserializer.c 278451 2009-04-08 18:10:46Z rasmus $ */ +/* $Id: var_unserializer.c 293036 2010-01-03 09:23:27Z sebastian $ */ #include "php.h" #include "ext/standard/php_var.h" diff --git a/ext/standard/var_unserializer.c.orig b/ext/standard/var_unserializer.c.orig index 7eebfc0a8..578f593ef 100644 --- a/ext/standard/var_unserializer.c.orig +++ b/ext/standard/var_unserializer.c.orig @@ -1,10 +1,10 @@ -/* Generated by re2c 0.13.5 on Wed Apr 8 09:34:35 2009 */ +/* Generated by re2c 0.13.5 on Mon Nov 23 09:26:17 2009 */ #line 1 "ext/standard/var_unserializer.re" /* +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: var_unserializer.c 278451 2009-04-08 18:10:46Z rasmus $ */ +/* $Id: var_unserializer.c 293036 2010-01-03 09:23:27Z sebastian $ */ #include "php.h" #include "ext/standard/php_var.h" diff --git a/ext/standard/var_unserializer.re b/ext/standard/var_unserializer.re index 0b009fa50..6cd6628aa 100644 --- a/ext/standard/var_unserializer.re +++ b/ext/standard/var_unserializer.re @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: var_unserializer.re 277374 2009-03-17 23:07:40Z felipe $ */ +/* $Id: var_unserializer.re 293035 2010-01-03 08:22:14Z sebastian $ */ #include "php.h" #include "ext/standard/php_var.h" diff --git a/ext/standard/versioning.c b/ext/standard/versioning.c index 172c555b4..0ab2472c7 100644 --- a/ext/standard/versioning.c +++ b/ext/standard/versioning.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2009 The PHP Group | + | Copyright (c) 1997-2010 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: versioning.c 272370 2008-12-31 11:15:49Z sebastian $ */ +/* $Id: versioning.c 293036 2010-01-03 09:23:27Z sebastian $ */ #include <stdio.h> #include <sys/types.h> |
