diff options
Diffstat (limited to 'ext/standard')
202 files changed, 1871 insertions, 2945 deletions
diff --git a/ext/standard/array.c b/ext/standard/array.c index f0ed03b0c..e0f2f308b 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 309986 2011-04-06 10:23:06Z aharvey $ */ +/* $Id: array.c 321634 2012-01-01 13:15:04Z felipe $ */ #include "php.h" #include "php_ini.h" diff --git a/ext/standard/assert.c b/ext/standard/assert.c index c0f8cd4b5..8a60eb185 100644 --- a/ext/standard/assert.c +++ b/ext/standard/assert.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 311451 2011-05-26 18:17:43Z iliaa $ */ +/* $Id: assert.c 321634 2012-01-01 13:15:04Z felipe $ */ /* {{{ includes */ #include "php.h" diff --git a/ext/standard/base64.c b/ext/standard/base64.c index 7cd108b36..bee528ad1 100644 --- a/ext/standard/base64.c +++ b/ext/standard/base64.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: base64.c 321634 2012-01-01 13:15:04Z felipe $ */ #include <string.h> @@ -153,6 +153,14 @@ PHPAPI unsigned char *php_base64_decode_ex(const unsigned char *str, int length, while ((ch = *current++) != '\0' && length-- > 0) { if (ch == base64_pad) { if (*current != '=' && ((i % 4) == 1 || (strict && length > 0))) { + if ((i % 4) != 1) { + while (isspace(*(++current))) { + continue; + } + if (*current == '\0') { + continue; + } + } efree(result); return NULL; } diff --git a/ext/standard/base64.h b/ext/standard/base64.h index 33ce1cb30..841ffcdd9 100644 --- a/ext/standard/base64.h +++ b/ext/standard/base64.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: base64.h 321634 2012-01-01 13:15:04Z felipe $ */ #ifndef BASE64_H #define BASE64_H diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 6df993858..47b24ac74 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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.c 314452 2011-08-08 00:47:40Z laruence $ */ +/* $Id: basic_functions.c 321634 2012-01-01 13:15:04Z felipe $ */ #include "php.h" #include "php_streams.h" @@ -4022,7 +4022,13 @@ PHP_FUNCTION(getenv) ptr = emalloc(size); size = GetEnvironmentVariableA(str, ptr, size); - RETURN_STRING(ptr, 0); + if (size == 0) { + /* has been removed between the two calls */ + efree(ptr); + RETURN_EMPTY_STRING(); + } else { + RETURN_STRING(ptr, 0); + } } #else /* system method returns a const */ @@ -4819,7 +4825,9 @@ PHP_FUNCTION(call_user_method) Z_TYPE_P(object) != IS_STRING ) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Second argument is not an object or class name"); - efree(params); + if (params) { + efree(params); + } RETURN_FALSE; } @@ -5849,7 +5857,6 @@ PHP_FUNCTION(move_uploaded_file) RETURN_FALSE; } - VCWD_UNLINK(new_path); if (VCWD_RENAME(path, new_path) == 0) { successful = 1; #ifndef PHP_WIN32 @@ -6032,6 +6039,10 @@ PHP_FUNCTION(parse_ini_string) RETURN_FALSE; } + if (INT_MAX - str_len < ZEND_MMAP_AHEAD) { + RETVAL_FALSE; + } + /* Set callback function */ if (process_sections) { BG(active_ini_file_section) = NULL; diff --git a/ext/standard/basic_functions.h b/ext/standard/basic_functions.h index 248a4aa53..330c4aae7 100644 --- a/ext/standard/basic_functions.h +++ b/ext/standard/basic_functions.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 310691 2011-05-01 18:37:20Z cataphract $ */ +/* $Id: basic_functions.h 321634 2012-01-01 13:15:04Z felipe $ */ #ifndef BASIC_FUNCTIONS_H #define BASIC_FUNCTIONS_H diff --git a/ext/standard/browscap.c b/ext/standard/browscap.c index 68b5c5c8c..18cdf0c5c 100644 --- a/ext/standard/browscap.c +++ b/ext/standard/browscap.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 311764 2011-06-03 09:39:45Z cataphract $ */ +/* $Id: browscap.c 321634 2012-01-01 13:15:04Z felipe $ */ #include "php.h" #include "php_browscap.h" diff --git a/ext/standard/crc32.c b/ext/standard/crc32.c index 4390c42d6..55b491b5e 100644 --- a/ext/standard/crc32.c +++ b/ext/standard/crc32.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: crc32.c 321634 2012-01-01 13:15:04Z felipe $ */ #include "php.h" #include "basic_functions.h" diff --git a/ext/standard/crc32.h b/ext/standard/crc32.h index 48eb22e70..9f4c0f791 100644 --- a/ext/standard/crc32.h +++ b/ext/standard/crc32.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: crc32.h 321634 2012-01-01 13:15:04Z felipe $ */ /* * This code implements the AUTODIN II polynomial diff --git a/ext/standard/credits.c b/ext/standard/credits.c index d4bf4116b..a4179e5a2 100644 --- a/ext/standard/credits.c +++ b/ext/standard/credits.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 311822 2011-06-05 06:57:13Z philip $ */ +/* $Id: credits.c 321634 2012-01-01 13:15:04Z felipe $ */ #include "php.h" #include "info.h" diff --git a/ext/standard/credits.h b/ext/standard/credits.h index 2aa2f8c39..153b3d4d1 100644 --- a/ext/standard/credits.h +++ b/ext/standard/credits.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: credits.h 321634 2012-01-01 13:15:04Z felipe $ */ #ifndef CREDITS_H #define CREDITS_H diff --git a/ext/standard/crypt.c b/ext/standard/crypt.c index cda330b5d..1692360e3 100644 --- a/ext/standard/crypt.c +++ b/ext/standard/crypt.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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: crypt.c 314641 2011-08-09 12:16:58Z laruence $ */ +/* $Id: crypt.c 321634 2012-01-01 13:15:04Z felipe $ */ #include <stdlib.h> diff --git a/ext/standard/css.c b/ext/standard/css.c index ad2b2d64e..05bbb7e42 100644 --- a/ext/standard/css.c +++ b/ext/standard/css.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: css.c 321634 2012-01-01 13:15:04Z felipe $ */ #include "php.h" #include "info.h" diff --git a/ext/standard/css.h b/ext/standard/css.h index 8ac13a673..414bdcb0f 100644 --- a/ext/standard/css.h +++ b/ext/standard/css.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: css.h 321634 2012-01-01 13:15:04Z felipe $ */ #ifndef CSS_H #define CSS_H diff --git a/ext/standard/cyr_convert.c b/ext/standard/cyr_convert.c index 7547aabfc..8080e78e3 100644 --- a/ext/standard/cyr_convert.c +++ b/ext/standard/cyr_convert.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: cyr_convert.c 321634 2012-01-01 13:15:04Z felipe $ */ #include <stdlib.h> diff --git a/ext/standard/cyr_convert.h b/ext/standard/cyr_convert.h index fbe514a6e..9770a1e3d 100644 --- a/ext/standard/cyr_convert.h +++ b/ext/standard/cyr_convert.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: cyr_convert.h 321634 2012-01-01 13:15:04Z felipe $ */ #ifndef CYR_CONVERT_H #define CYR_CONVERT_H diff --git a/ext/standard/datetime.c b/ext/standard/datetime.c index 9881df1fd..6538b1850 100644 --- a/ext/standard/datetime.c +++ b/ext/standard/datetime.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: datetime.c 321634 2012-01-01 13:15:04Z felipe $ */ #include "php.h" #include "zend_operators.h" diff --git a/ext/standard/datetime.h b/ext/standard/datetime.h index fae5a9308..e15b84a15 100644 --- a/ext/standard/datetime.h +++ b/ext/standard/datetime.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: datetime.h 321634 2012-01-01 13:15:04Z felipe $ */ #ifndef DATETIME_H #define DATETIME_H diff --git a/ext/standard/dir.c b/ext/standard/dir.c index 6c93a1981..82b04bde5 100644 --- a/ext/standard/dir.c +++ b/ext/standard/dir.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: dir.c 321634 2012-01-01 13:15:04Z felipe $ */ /* {{{ includes/startup/misc */ diff --git a/ext/standard/dl.c b/ext/standard/dl.c index 81b12838d..425ae1a40 100644 --- a/ext/standard/dl.c +++ b/ext/standard/dl.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 311444 2011-05-26 14:37:13Z pajoye $ */ +/* $Id: dl.c 321634 2012-01-01 13:15:04Z felipe $ */ #include "php.h" #include "dl.h" diff --git a/ext/standard/dl.h b/ext/standard/dl.h index c60550443..76628efd8 100644 --- a/ext/standard/dl.h +++ b/ext/standard/dl.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: dl.h 321634 2012-01-01 13:15:04Z felipe $ */ #ifndef DL_H #define DL_H diff --git a/ext/standard/dns.c b/ext/standard/dns.c index 8453ad887..2b974ad70 100644 --- a/ext/standard/dns.c +++ b/ext/standard/dns.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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: dns.c 314766 2011-08-10 17:40:56Z rasmus $ */ +/* $Id: dns.c 321634 2012-01-01 13:15:04Z felipe $ */ /* {{{ includes */ #include "php.h" diff --git a/ext/standard/dns_win32.c b/ext/standard/dns_win32.c index a6e5b0a48..e20b19d0a 100644 --- a/ext/standard/dns_win32.c +++ b/ext/standard/dns_win32.c @@ -103,6 +103,11 @@ PHP_FUNCTION(dns_check_record) return; } + if (hostname_len == 0) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Host cannot be empty"); + RETURN_FALSE; + } + if (rectype) { if (!strcasecmp("A", rectype)) type = DNS_TYPE_A; else if (!strcasecmp("NS", rectype)) type = DNS_TYPE_NS; diff --git a/ext/standard/exec.c b/ext/standard/exec.c index efe18e797..d56009f63 100644 --- a/ext/standard/exec.c +++ b/ext/standard/exec.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: exec.c 321634 2012-01-01 13:15:04Z felipe $ */ #include <stdio.h> #include "php.h" diff --git a/ext/standard/exec.h b/ext/standard/exec.h index a8e809df3..7da109b25 100644 --- a/ext/standard/exec.h +++ b/ext/standard/exec.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: exec.h 321634 2012-01-01 13:15:04Z felipe $ */ #ifndef EXEC_H #define EXEC_H diff --git a/ext/standard/file.c b/ext/standard/file.c index 091eb4390..2fa1ecc6d 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 312285 2011-06-19 14:50:44Z felipe $ */ +/* $Id: file.c 321634 2012-01-01 13:15:04Z felipe $ */ /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */ @@ -876,7 +876,7 @@ PHP_FUNCTION(tempnam) RETVAL_FALSE; - if ((fd = php_open_temporary_fd(dir, p, &opened_path TSRMLS_CC)) >= 0) { + if ((fd = php_open_temporary_fd_ex(dir, p, &opened_path, 1 TSRMLS_CC)) >= 0) { close(fd); RETVAL_STRING(opened_path, 0); } @@ -2199,7 +2199,7 @@ PHPAPI void php_fgetcsv(php_stream *stream, char delimiter, char enclosure, char inc_len = (bptr < limit ? (*bptr == '\0' ? 1: php_mblen(bptr, limit - bptr)): 0); if (inc_len == 1) { char *tmp = bptr; - while (isspace((int)*(unsigned char *)tmp)) { + while ((*tmp != delimiter) && isspace((int)*(unsigned char *)tmp)) { tmp++; } if (*tmp == enclosure) { diff --git a/ext/standard/file.h b/ext/standard/file.h index b4c0e6287..fd9c51030 100644 --- a/ext/standard/file.h +++ b/ext/standard/file.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: file.h 321634 2012-01-01 13:15:04Z felipe $ */ /* 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 d961f0e65..bf980a3dd 100644 --- a/ext/standard/filestat.c +++ b/ext/standard/filestat.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: filestat.c 321634 2012-01-01 13:15:04Z felipe $ */ #include "php.h" #include "safe_mode.h" diff --git a/ext/standard/filters.c b/ext/standard/filters.c index 80ce98f34..5bad4cefe 100644 --- a/ext/standard/filters.c +++ b/ext/standard/filters.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 311407 2011-05-24 23:49:26Z felipe $ */ +/* $Id: filters.c 321634 2012-01-01 13:15:04Z felipe $ */ #include "php.h" #include "php_globals.h" @@ -1897,7 +1897,6 @@ php_stream_filter_factory consumed_filter_factory = { typedef enum _php_chunked_filter_state { CHUNK_SIZE_START, CHUNK_SIZE, - CHUNK_SIZE_EXT_START, CHUNK_SIZE_EXT, CHUNK_SIZE_CR, CHUNK_SIZE_LF, @@ -1937,7 +1936,7 @@ static int php_dechunk(char *buf, int len, php_chunked_filter_data *data) data->state = CHUNK_ERROR; break; } else { - data->state = CHUNK_SIZE_EXT_START; + data->state = CHUNK_SIZE_EXT; break; } data->state = CHUNK_SIZE; @@ -1948,13 +1947,6 @@ static int php_dechunk(char *buf, int len, php_chunked_filter_data *data) } else if (p == end) { return out_len; } - case CHUNK_SIZE_EXT_START: - if (*p == ';'|| *p == '\r' || *p == '\n') { - data->state = CHUNK_SIZE_EXT; - } else { - data->state = CHUNK_ERROR; - continue; - } case CHUNK_SIZE_EXT: /* skip extension */ while (p < end && *p != '\r' && *p != '\n') { diff --git a/ext/standard/flock_compat.c b/ext/standard/flock_compat.c index 2c9bcdb22..4e7a061f2 100644 --- a/ext/standard/flock_compat.c +++ b/ext/standard/flock_compat.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: flock_compat.c 321634 2012-01-01 13:15:04Z felipe $ */ #include "php.h" #include <errno.h> diff --git a/ext/standard/flock_compat.h b/ext/standard/flock_compat.h index 4d2ac3bb4..d8ff83b4a 100644 --- a/ext/standard/flock_compat.h +++ b/ext/standard/flock_compat.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: flock_compat.h 321634 2012-01-01 13:15:04Z felipe $ */ #ifndef FLOCK_COMPAT_H #define FLOCK_COMPAT_H diff --git a/ext/standard/formatted_print.c b/ext/standard/formatted_print.c index 78663bc5d..a3bbbf2d0 100644 --- a/ext/standard/formatted_print.c +++ b/ext/standard/formatted_print.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: formatted_print.c 321634 2012-01-01 13:15:04Z felipe $ */ #include <math.h> /* modf() */ #include "php.h" diff --git a/ext/standard/fsock.c b/ext/standard/fsock.c index a7b8c846d..556f83763 100644 --- a/ext/standard/fsock.c +++ b/ext/standard/fsock.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: fsock.c 321634 2012-01-01 13:15:04Z felipe $ */ #include "php.h" #include "php_globals.h" diff --git a/ext/standard/fsock.h b/ext/standard/fsock.h index 08422c103..dba7e80c6 100644 --- a/ext/standard/fsock.h +++ b/ext/standard/fsock.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: fsock.h 321634 2012-01-01 13:15:04Z felipe $ */ /* 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 27eb839b4..133b2a3b3 100644 --- a/ext/standard/ftok.c +++ b/ext/standard/ftok.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: ftok.c 321634 2012-01-01 13:15:04Z felipe $ */ #include "php.h" diff --git a/ext/standard/ftp_fopen_wrapper.c b/ext/standard/ftp_fopen_wrapper.c index b8f3fe100..b1e90c834 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-2011 The PHP Group | + | Copyright (c) 1997-2012 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 308734 2011-02-27 20:23:54Z cataphract $ */ +/* $Id: ftp_fopen_wrapper.c 321634 2012-01-01 13:15:04Z felipe $ */ #include "php.h" #include "php_globals.h" diff --git a/ext/standard/head.c b/ext/standard/head.c index 3ad04b04a..2392d7eb0 100644 --- a/ext/standard/head.c +++ b/ext/standard/head.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 314486 2011-08-08 12:10:27Z iliaa $ */ +/* $Id: head.c 321634 2012-01-01 13:15:04Z felipe $ */ #include <stdio.h> #include "php.h" diff --git a/ext/standard/head.h b/ext/standard/head.h index 5458e028a..71f307d3c 100644 --- a/ext/standard/head.h +++ b/ext/standard/head.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: head.h 321634 2012-01-01 13:15:04Z felipe $ */ #ifndef HEAD_H #define HEAD_H diff --git a/ext/standard/html.c b/ext/standard/html.c index a65456bf5..d0ed4a26f 100644 --- a/ext/standard/html.c +++ b/ext/standard/html.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: html.c 321634 2012-01-01 13:15:04Z felipe $ */ /* * HTML entity resources: @@ -1020,8 +1020,8 @@ PHPAPI char *php_unescape_html_entities(unsigned char *old, int oldlen, int *new code = strtol(p + 2, &next, 10); } - if (code == '\'' && !(quote_style & ENT_HTML_QUOTE_SINGLE) || - code == '"' && !(quote_style & ENT_HTML_QUOTE_DOUBLE)) { + if ((code == '\'' && !(quote_style & ENT_HTML_QUOTE_SINGLE)) || + (code == '"' && !(quote_style & ENT_HTML_QUOTE_DOUBLE))) { invalid_code = 1; } diff --git a/ext/standard/html.h b/ext/standard/html.h index 20256a3a5..497bf403a 100644 --- a/ext/standard/html.h +++ b/ext/standard/html.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: html.h 321634 2012-01-01 13:15:04Z felipe $ */ #ifndef HTML_H #define HTML_H diff --git a/ext/standard/http.c b/ext/standard/http.c index 5ddfbf055..d55de8a58 100644 --- a/ext/standard/http.c +++ b/ext/standard/http.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 307432 2011-01-13 07:27:46Z stas $ */ +/* $Id: http.c 321634 2012-01-01 13:15:04Z felipe $ */ #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 2fd25e0da..74df28404 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-2011 The PHP Group | + | Copyright (c) 1997-2012 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 314641 2011-08-09 12:16:58Z laruence $ */ +/* $Id: http_fopen_wrapper.c 321634 2012-01-01 13:15:04Z felipe $ */ #include "php.h" #include "php_globals.h" @@ -719,7 +719,10 @@ finish: 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); + if (php_stream_get_line(stream, http_header_line, HTTP_HEADER_BLOCK_SIZE, &http_header_line_length) == NULL) { + php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Failed to read HTTP headers"); + goto out; + } e = http_header_line + http_header_line_length - 1; } while (*e != '\n'); continue; @@ -787,9 +790,6 @@ finish: if (location[0] != '\0') php_stream_notify_info(context, PHP_STREAM_NOTIFY_REDIRECTED, location, 0); - if (context) { /* keep the context for the next try */ - zend_list_addref(context->rsrc_id); - } php_stream_close(stream); stream = NULL; diff --git a/ext/standard/image.c b/ext/standard/image.c index fc17ff67e..201b5f5f7 100644 --- a/ext/standard/image.c +++ b/ext/standard/image.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 310980 2011-05-13 05:06:48Z scottmac $ */ +/* $Id: image.c 321634 2012-01-01 13:15:04Z felipe $ */ #include "php.h" #include <stdio.h> diff --git a/ext/standard/incomplete_class.c b/ext/standard/incomplete_class.c index 9e45e4915..2a5988bee 100644 --- a/ext/standard/incomplete_class.c +++ b/ext/standard/incomplete_class.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: incomplete_class.c 321634 2012-01-01 13:15:04Z felipe $ */ #include "php.h" #include "basic_functions.h" diff --git a/ext/standard/info.c b/ext/standard/info.c index f7b697773..c46e068d2 100644 --- a/ext/standard/info.c +++ b/ext/standard/info.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 313538 2011-07-21 14:49:55Z pajoye $ */ +/* $Id: info.c 321634 2012-01-01 13:15:04Z felipe $ */ #include "php.h" #include "php_ini.h" @@ -626,7 +626,7 @@ PHPAPI void php_print_info_htmlhead(TSRMLS_D) PUTS("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"DTD/xhtml1-transitional.dtd\">\n"); - PUTS("<html>"); + PUTS("<html xmlns=\"http://www.w3.org/1999/xhtml\">"); PUTS("<head>\n"); php_info_print_style(TSRMLS_C); PUTS("<title>phpinfo()</title>"); diff --git a/ext/standard/info.h b/ext/standard/info.h index 977e305e1..ed5a61193 100644 --- a/ext/standard/info.h +++ b/ext/standard/info.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: info.h 321634 2012-01-01 13:15:04Z felipe $ */ #ifndef INFO_H #define INFO_H diff --git a/ext/standard/iptc.c b/ext/standard/iptc.c index dafbfa5f7..405c1a71d 100644 --- a/ext/standard/iptc.c +++ b/ext/standard/iptc.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: iptc.c 321634 2012-01-01 13:15:04Z felipe $ */ /* * Functions to parse & compse IPTC data. diff --git a/ext/standard/lcg.c b/ext/standard/lcg.c index 6db3f6fe4..6d63f59e1 100644 --- a/ext/standard/lcg.c +++ b/ext/standard/lcg.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: lcg.c 321634 2012-01-01 13:15:04Z felipe $ */ #include "php.h" #include "php_lcg.h" diff --git a/ext/standard/levenshtein.c b/ext/standard/levenshtein.c index a84b155f8..43d1a14ac 100644 --- a/ext/standard/levenshtein.c +++ b/ext/standard/levenshtein.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: levenshtein.c 321634 2012-01-01 13:15:04Z felipe $ */ #include "php.h" #include <stdlib.h> diff --git a/ext/standard/link.c b/ext/standard/link.c index 1f8be4c1b..b75441879 100644 --- a/ext/standard/link.c +++ b/ext/standard/link.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: link.c 321634 2012-01-01 13:15:04Z felipe $ */ #include "php.h" #include "php_filestat.h" diff --git a/ext/standard/link_win32.c b/ext/standard/link_win32.c index 37a5fd252..2d1723941 100644 --- a/ext/standard/link_win32.c +++ b/ext/standard/link_win32.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 313176 2011-07-12 15:15:17Z pajoye $ */ +/* $Id: link_win32.c 321634 2012-01-01 13:15:04Z felipe $ */ #ifdef PHP_WIN32 #include "php.h" diff --git a/ext/standard/mail.c b/ext/standard/mail.c index 984b84e37..8258e1150 100644 --- a/ext/standard/mail.c +++ b/ext/standard/mail.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: mail.c 321634 2012-01-01 13:15:04Z felipe $ */ #include <stdlib.h> #include <ctype.h> diff --git a/ext/standard/math.c b/ext/standard/math.c index b656fafae..4651b21fd 100644 --- a/ext/standard/math.c +++ b/ext/standard/math.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 312074 2011-06-12 00:56:18Z cataphract $ */ +/* $Id: math.c 321634 2012-01-01 13:15:04Z felipe $ */ #include "php.h" #include "php_math.h" diff --git a/ext/standard/md5.c b/ext/standard/md5.c index b9c9b3ab8..8ceeed8cf 100644 --- a/ext/standard/md5.c +++ b/ext/standard/md5.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: md5.c 321634 2012-01-01 13:15:04Z felipe $ */ #include "php.h" #include "md5.h" diff --git a/ext/standard/md5.h b/ext/standard/md5.h index 6ffbc2fca..508b493fb 100644 --- a/ext/standard/md5.h +++ b/ext/standard/md5.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: md5.h 321634 2012-01-01 13:15:04Z felipe $ */ #ifndef MD5_H #define MD5_H diff --git a/ext/standard/metaphone.c b/ext/standard/metaphone.c index 468f26758..4774b7ca4 100644 --- a/ext/standard/metaphone.c +++ b/ext/standard/metaphone.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: metaphone.c 321634 2012-01-01 13:15:04Z felipe $ */ /* 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 92248a22e..897a14e20 100644 --- a/ext/standard/microtime.c +++ b/ext/standard/microtime.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: microtime.c 321634 2012-01-01 13:15:04Z felipe $ */ #include "php.h" diff --git a/ext/standard/microtime.h b/ext/standard/microtime.h index b0019dbf9..7a1c8825d 100644 --- a/ext/standard/microtime.h +++ b/ext/standard/microtime.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: microtime.h 321634 2012-01-01 13:15:04Z felipe $ */ #ifndef MICROTIME_H #define MICROTIME_H diff --git a/ext/standard/pack.c b/ext/standard/pack.c index 9eca312a6..8bc95fc7c 100644 --- a/ext/standard/pack.c +++ b/ext/standard/pack.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: pack.c 321634 2012-01-01 13:15:04Z felipe $ */ #include "php.h" diff --git a/ext/standard/pack.h b/ext/standard/pack.h index 81c96dc9d..5ed9c5e4b 100644 --- a/ext/standard/pack.h +++ b/ext/standard/pack.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: pack.h 321634 2012-01-01 13:15:04Z felipe $ */ #ifndef PACK_H #define PACK_H diff --git a/ext/standard/pageinfo.c b/ext/standard/pageinfo.c index 09182dd7e..6fe112b36 100644 --- a/ext/standard/pageinfo.c +++ b/ext/standard/pageinfo.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: pageinfo.c 321634 2012-01-01 13:15:04Z felipe $ */ #include "php.h" #include "pageinfo.h" diff --git a/ext/standard/pageinfo.h b/ext/standard/pageinfo.h index 672179503..bc6528346 100644 --- a/ext/standard/pageinfo.h +++ b/ext/standard/pageinfo.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: pageinfo.h 321634 2012-01-01 13:15:04Z felipe $ */ #ifndef PAGEINFO_H #define PAGEINFO_H diff --git a/ext/standard/php_array.h b/ext/standard/php_array.h index ddd267096..dd4ae69ed 100644 --- a/ext/standard/php_array.h +++ b/ext/standard/php_array.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: php_array.h 321634 2012-01-01 13:15:04Z felipe $ */ #ifndef PHP_ARRAY_H #define PHP_ARRAY_H diff --git a/ext/standard/php_assert.h b/ext/standard/php_assert.h index 6cc5d76d3..5a61b515c 100644 --- a/ext/standard/php_assert.h +++ b/ext/standard/php_assert.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: php_assert.h 321634 2012-01-01 13:15:04Z felipe $ */ #ifndef PHP_ASSERT_H #define PHP_ASSERT_H diff --git a/ext/standard/php_browscap.h b/ext/standard/php_browscap.h index 523b2de13..5efd371a3 100644 --- a/ext/standard/php_browscap.h +++ b/ext/standard/php_browscap.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: php_browscap.h 321634 2012-01-01 13:15:04Z felipe $ */ #ifndef PHP_BROWSCAP_H #define PHP_BROWSCAP_H diff --git a/ext/standard/php_crypt.h b/ext/standard/php_crypt.h index 02c6d564d..9d5805f39 100644 --- a/ext/standard/php_crypt.h +++ b/ext/standard/php_crypt.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: php_crypt.h 321634 2012-01-01 13:15:04Z felipe $ */ #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 86076e8bf..e8d59b99a 100644 --- a/ext/standard/php_crypt_r.c +++ b/ext/standard/php_crypt_r.c @@ -1,9 +1,9 @@ -/* $Id: php_crypt_r.c 315338 2011-08-23 08:09:55Z johannes $ */ +/* $Id: php_crypt_r.c 321634 2012-01-01 13:15:04Z felipe $ */ /* +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 | @@ -94,8 +94,7 @@ void _crypt_extended_init_r(void) if (!initialized) { #ifdef PHP_WIN32 InterlockedIncrement(&initialized); -#elif (defined(__GNUC__) && !defined(__hpux) && (__GNUC__ > 4 || \ - (__GNUC__ == 4 && (__GNUC_MINOR__ > 1 || (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ > 1))))) +#elif defined(HAVE_SYNC_FETCH_AND_ADD) __sync_fetch_and_add(&initialized, 1); #elif defined(HAVE_ATOMIC_H) /* Solaris 10 defines atomic API within */ membar_producer(); diff --git a/ext/standard/php_crypt_r.h b/ext/standard/php_crypt_r.h index f153ac322..06f269987 100644 --- a/ext/standard/php_crypt_r.h +++ b/ext/standard/php_crypt_r.h @@ -1,9 +1,9 @@ -/* $Id: php_crypt_r.h 313406 2011-07-18 21:26:29Z pajoye $ */ +/* $Id: php_crypt_r.h 321634 2012-01-01 13:15:04Z felipe $ */ /* +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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_dir.h b/ext/standard/php_dir.h index a76615300..98cd5f932 100644 --- a/ext/standard/php_dir.h +++ b/ext/standard/php_dir.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: php_dir.h 321634 2012-01-01 13:15:04Z felipe $ */ #ifndef PHP_DIR_H #define PHP_DIR_H diff --git a/ext/standard/php_dns.h b/ext/standard/php_dns.h index e24caf538..0f015d1ce 100644 --- a/ext/standard/php_dns.h +++ b/ext/standard/php_dns.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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_dns.h 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: php_dns.h 321634 2012-01-01 13:15:04Z felipe $ */ #ifndef PHP_DNS_H #define PHP_DNS_H diff --git a/ext/standard/php_ext_syslog.h b/ext/standard/php_ext_syslog.h index cf697593a..988f47942 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-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: php_ext_syslog.h 321634 2012-01-01 13:15:04Z felipe $ */ #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 6103f2cb9..f1b894d4f 100644 --- a/ext/standard/php_filestat.h +++ b/ext/standard/php_filestat.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: php_filestat.h 321634 2012-01-01 13:15:04Z felipe $ */ #ifndef PHP_FILESTAT_H #define PHP_FILESTAT_H diff --git a/ext/standard/php_fopen_wrapper.c b/ext/standard/php_fopen_wrapper.c index 1360bab6c..999bc1f13 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-2011 The PHP Group | + | Copyright (c) 1997-2012 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 307536 2011-01-17 13:44:54Z iliaa $ */ +/* $Id: php_fopen_wrapper.c 321634 2012-01-01 13:15:04Z felipe $ */ #include <stdio.h> #include <stdlib.h> diff --git a/ext/standard/php_fopen_wrappers.h b/ext/standard/php_fopen_wrappers.h index 96beaea30..0d53bfa19 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-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: php_fopen_wrappers.h 321634 2012-01-01 13:15:04Z felipe $ */ #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 51860c809..b2b7a14a0 100644 --- a/ext/standard/php_ftok.h +++ b/ext/standard/php_ftok.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: php_ftok.h 321634 2012-01-01 13:15:04Z felipe $ */ #ifndef PHP_FTOK_H #define PHP_FTOK_H diff --git a/ext/standard/php_http.h b/ext/standard/php_http.h index 7330248c0..29279cb5f 100644 --- a/ext/standard/php_http.h +++ b/ext/standard/php_http.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 307432 2011-01-13 07:27:46Z stas $ */ +/* $Id: php_http.h 321634 2012-01-01 13:15:04Z felipe $ */ #ifndef PHP_HTTP_H #define PHP_HTTP_H diff --git a/ext/standard/php_image.h b/ext/standard/php_image.h index ed52ec9c7..c2f8f3347 100644 --- a/ext/standard/php_image.h +++ b/ext/standard/php_image.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: php_image.h 321634 2012-01-01 13:15:04Z felipe $ */ #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 ed52210c2..e1faf3e13 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-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: php_incomplete_class.h 321634 2012-01-01 13:15:04Z felipe $ */ #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 859ad6862..981cc7f49 100644 --- a/ext/standard/php_iptc.h +++ b/ext/standard/php_iptc.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: php_iptc.h 321634 2012-01-01 13:15:04Z felipe $ */ #ifndef PHP_IPTC_H #define PHP_IPTC_H diff --git a/ext/standard/php_lcg.h b/ext/standard/php_lcg.h index 7d57d69c2..cead367ab 100644 --- a/ext/standard/php_lcg.h +++ b/ext/standard/php_lcg.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: php_lcg.h 321634 2012-01-01 13:15:04Z felipe $ */ #ifndef PHP_LCG_H #define PHP_LCG_H diff --git a/ext/standard/php_link.h b/ext/standard/php_link.h index 8126a6304..57bc46a74 100644 --- a/ext/standard/php_link.h +++ b/ext/standard/php_link.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: php_link.h 321634 2012-01-01 13:15:04Z felipe $ */ #ifndef PHP_LINK_H #define PHP_LINK_H diff --git a/ext/standard/php_mail.h b/ext/standard/php_mail.h index 8164af8ac..88ba00ac1 100644 --- a/ext/standard/php_mail.h +++ b/ext/standard/php_mail.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: php_mail.h 321634 2012-01-01 13:15:04Z felipe $ */ #ifndef PHP_MAIL_H #define PHP_MAIL_H diff --git a/ext/standard/php_math.h b/ext/standard/php_math.h index 77fe6540e..2076caf80 100644 --- a/ext/standard/php_math.h +++ b/ext/standard/php_math.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: php_math.h 321634 2012-01-01 13:15:04Z felipe $ */ #ifndef PHP_MATH_H #define PHP_MATH_H diff --git a/ext/standard/php_metaphone.h b/ext/standard/php_metaphone.h index 1067e8b77..287b750bf 100644 --- a/ext/standard/php_metaphone.h +++ b/ext/standard/php_metaphone.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: php_metaphone.h 321634 2012-01-01 13:15:04Z felipe $ */ #ifndef PHP_METAPHONE_H #define PHP_METAPHONE_H diff --git a/ext/standard/php_rand.h b/ext/standard/php_rand.h index 9a0dceff4..7e66dc22b 100644 --- a/ext/standard/php_rand.h +++ b/ext/standard/php_rand.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: php_rand.h 321634 2012-01-01 13:15:04Z felipe $ */ #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 6b4c1a95c..0347be2d9 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-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: php_smart_str.h 321634 2012-01-01 13:15:04Z felipe $ */ #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 98da8b564..fe90c5e62 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-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: php_smart_str_public.h 321634 2012-01-01 13:15:04Z felipe $ */ #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 7595d45ec..9fa04f4e0 100644 --- a/ext/standard/php_standard.h +++ b/ext/standard/php_standard.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: php_standard.h 321634 2012-01-01 13:15:04Z felipe $ */ #include "basic_functions.h" #include "php_math.h" diff --git a/ext/standard/php_string.h b/ext/standard/php_string.h index 0901ec491..fbc64a13a 100644 --- a/ext/standard/php_string.h +++ b/ext/standard/php_string.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: php_string.h 321634 2012-01-01 13:15:04Z felipe $ */ /* 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 c2e5aa90d..f745cc040 100644 --- a/ext/standard/php_type.h +++ b/ext/standard/php_type.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: php_type.h 321634 2012-01-01 13:15:04Z felipe $ */ #ifndef PHP_TYPE_H #define PHP_TYPE_H diff --git a/ext/standard/php_uuencode.h b/ext/standard/php_uuencode.h index 7514ced0d..c6a42d78e 100644 --- a/ext/standard/php_uuencode.h +++ b/ext/standard/php_uuencode.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: php_uuencode.h 321634 2012-01-01 13:15:04Z felipe $ */ #ifndef PHP_UUENCODE_H #define PHP_UUENCODE_H diff --git a/ext/standard/php_var.h b/ext/standard/php_var.h index 94934183b..771d4876b 100644 --- a/ext/standard/php_var.h +++ b/ext/standard/php_var.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: php_var.h 321634 2012-01-01 13:15:04Z felipe $ */ #ifndef PHP_VAR_H #define PHP_VAR_H diff --git a/ext/standard/php_versioning.h b/ext/standard/php_versioning.h index d3e9aee82..7a464f081 100644 --- a/ext/standard/php_versioning.h +++ b/ext/standard/php_versioning.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: php_versioning.h 321634 2012-01-01 13:15:04Z felipe $ */ #ifndef PHP_VERSIONING_H #define PHP_VERSIONING_H diff --git a/ext/standard/proc_open.c b/ext/standard/proc_open.c index b9411aebc..89109813a 100644 --- a/ext/standard/proc_open.c +++ b/ext/standard/proc_open.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 314641 2011-08-09 12:16:58Z laruence $ */ +/* $Id: proc_open.c 321634 2012-01-01 13:15:04Z felipe $ */ #if 0 && (defined(__linux__) || defined(sun) || defined(__IRIX__)) # define _BSD_SOURCE /* linux wants this when XOPEN mode is on */ @@ -451,10 +451,9 @@ PHP_FUNCTION(proc_get_status) /* {{{ handy definitions for portability/readability */ #ifdef PHP_WIN32 -# define pipe(pair) (CreatePipe(&pair[0], &pair[1], &security, 2048L) ? 0 : -1) +# define pipe(pair) (CreatePipe(&pair[0], &pair[1], &security, 0) ? 0 : -1) # define COMSPEC_NT "cmd.exe" -# define COMSPEC_9X "command.com" static inline HANDLE dup_handle(HANDLE src, BOOL inherit, BOOL closeorig) { @@ -800,7 +799,7 @@ PHP_FUNCTION(proc_open) if (bypass_shell) { newprocok = CreateProcess(NULL, command, &security, &security, TRUE, dwCreateFlags, env.envp, cwd, &si, &pi); } else { - spprintf(&command_with_cmd, 0, "%s /c %s", GetVersion() < 0x80000000 ? COMSPEC_NT : COMSPEC_9X, command); + spprintf(&command_with_cmd, 0, "%s /c %s", COMSPEC_NT, command); newprocok = CreateProcess(NULL, command_with_cmd, &security, &security, TRUE, dwCreateFlags, env.envp, cwd, &si, &pi); diff --git a/ext/standard/proc_open.h b/ext/standard/proc_open.h index 3ff92eb73..d870e38b0 100644 --- a/ext/standard/proc_open.h +++ b/ext/standard/proc_open.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: proc_open.h 321634 2012-01-01 13:15:04Z felipe $ */ #ifdef PHP_WIN32 typedef HANDLE php_file_descriptor_t; diff --git a/ext/standard/quot_print.c b/ext/standard/quot_print.c index e4caaa4f5..cab811812 100644 --- a/ext/standard/quot_print.c +++ b/ext/standard/quot_print.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: quot_print.c 321634 2012-01-01 13:15:04Z felipe $ */ #include <stdlib.h> diff --git a/ext/standard/quot_print.h b/ext/standard/quot_print.h index acbe736de..a01820c2a 100644 --- a/ext/standard/quot_print.h +++ b/ext/standard/quot_print.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: quot_print.h 321634 2012-01-01 13:15:04Z felipe $ */ #ifndef QUOT_PRINT_H #define QUOT_PRINT_H diff --git a/ext/standard/rand.c b/ext/standard/rand.c index 2be932046..c2925f817 100644 --- a/ext/standard/rand.c +++ b/ext/standard/rand.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: rand.c 321634 2012-01-01 13:15:04Z felipe $ */ #include <stdlib.h> diff --git a/ext/standard/scanf.c b/ext/standard/scanf.c index 161fd6d26..989cfe404 100644 --- a/ext/standard/scanf.c +++ b/ext/standard/scanf.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: scanf.c 321634 2012-01-01 13:15:04Z felipe $ */ /* scanf.c -- diff --git a/ext/standard/scanf.h b/ext/standard/scanf.h index 0d5858717..b5191f7f2 100644 --- a/ext/standard/scanf.h +++ b/ext/standard/scanf.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: scanf.h 321634 2012-01-01 13:15:04Z felipe $ */ #ifndef SCANF_H #define SCANF_H diff --git a/ext/standard/sha1.c b/ext/standard/sha1.c index 0a9447993..50290303b 100644 --- a/ext/standard/sha1.c +++ b/ext/standard/sha1.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: sha1.c 321634 2012-01-01 13:15:04Z felipe $ */ #include "php.h" diff --git a/ext/standard/sha1.h b/ext/standard/sha1.h index 9cfef1e64..7f4e67526 100644 --- a/ext/standard/sha1.h +++ b/ext/standard/sha1.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: sha1.h 321634 2012-01-01 13:15:04Z felipe $ */ #ifndef SHA1_H #define SHA1_H diff --git a/ext/standard/soundex.c b/ext/standard/soundex.c index 0096a712c..c6a05480a 100644 --- a/ext/standard/soundex.c +++ b/ext/standard/soundex.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: soundex.c 321634 2012-01-01 13:15:04Z felipe $ */ #include "php.h" #include <stdlib.h> diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c index 3a90b885b..e6ad6ebc1 100644 --- a/ext/standard/streamsfuncs.c +++ b/ext/standard/streamsfuncs.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 307922 2011-02-01 18:10:35Z cataphract $ */ +/* $Id: streamsfuncs.c 321634 2012-01-01 13:15:04Z felipe $ */ #include "php.h" #include "php_globals.h" diff --git a/ext/standard/streamsfuncs.h b/ext/standard/streamsfuncs.h index 804501e99..aece3d458 100644 --- a/ext/standard/streamsfuncs.h +++ b/ext/standard/streamsfuncs.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: streamsfuncs.h 321634 2012-01-01 13:15:04Z felipe $ */ /* Flags for stream_socket_client */ #define PHP_STREAM_CLIENT_PERSISTENT 1 diff --git a/ext/standard/string.c b/ext/standard/string.c index 9d9e5b3f4..896a54566 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 310401 2011-04-21 01:51:24Z pierrick $ */ +/* $Id: string.c 321634 2012-01-01 13:15:04Z felipe $ */ /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */ @@ -2336,6 +2336,10 @@ PHP_FUNCTION(substr_replace) RETURN_STRINGL(Z_STRVAL_PP(str), Z_STRLEN_PP(str), 1); } } else { /* str is array of strings */ + char *str_index = NULL; + uint str_index_len; + ulong num_index; + array_init(return_value); if (Z_TYPE_PP(from) == IS_ARRAY) { @@ -2471,7 +2475,13 @@ PHP_FUNCTION(substr_replace) } result[result_len] = '\0'; - add_next_index_stringl(return_value, result, result_len, 0); + + if (zend_hash_get_current_key_ex(Z_ARRVAL_PP(str), &str_index, &str_index_len, &num_index, 0, &pos_str) == HASH_KEY_IS_STRING) { + add_assoc_stringl_ex(return_value, str_index, str_index_len, result, result_len, 0); + } else { + add_index_stringl(return_value, num_index, result, result_len, 0); + } + if(Z_TYPE_PP(tmp_str) != IS_STRING) { zval_dtor(orig_str); } diff --git a/ext/standard/syslog.c b/ext/standard/syslog.c index 4cd54d687..39e01771d 100644 --- a/ext/standard/syslog.c +++ b/ext/standard/syslog.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: syslog.c 321634 2012-01-01 13:15:04Z felipe $ */ #include "php.h" diff --git a/ext/standard/tests/array/array_change_key_case_variation8.phpt b/ext/standard/tests/array/array_change_key_case_variation8.phpt index f9893da79..3dc22ce0e 100644 --- a/ext/standard/tests/array/array_change_key_case_variation8.phpt +++ b/ext/standard/tests/array/array_change_key_case_variation8.phpt @@ -1,5 +1,10 @@ --TEST-- Test array_change_key_case() function : usage variations - Different strings as keys +--SKIPIF-- +<?php +if (substr(PHP_OS, 0, 3) == 'WIN') { + die("skip Output tested contains chars that are not shown the same on windows concole (ESC and co)"); +} --FILE-- <?php /* Prototype : array array_change_key_case(array $input [, int $case]) diff --git a/ext/standard/tests/array/arsort_variation5.phpt b/ext/standard/tests/array/arsort_variation5.phpt index e69c26988..55c0882db 100644 --- a/ext/standard/tests/array/arsort_variation5.phpt +++ b/ext/standard/tests/array/arsort_variation5.phpt @@ -1,5 +1,10 @@ --TEST-- -Test arsort() function : usage variations - sort strings +Test arsort() function : usage variations - sort strings +--SKIPIF-- +<?php +if (substr(PHP_OS, 0, 3) == 'WIN') { + die("skip Output tested contains chars that are not shown the same on windows concole (ESC and co)"); +} --FILE-- <?php /* Prototype : bool arsort ( array &$array [, int $asort_flags] ) @@ -76,8 +81,10 @@ array(12) { string(3) "\cx" ["\a"]=> string(2) "\a" - ["
"]=> - string(1) "
" + [" +"]=> + string(1) " +" [""]=> string(1) "" [""]=> @@ -106,8 +113,10 @@ array(12) { string(3) "\cx" ["\a"]=> string(2) "\a" - ["
"]=> - string(1) "
" + [" +"]=> + string(1) " +" [""]=> string(1) "" [""]=> @@ -136,8 +145,10 @@ array(12) { string(3) "\cx" ["\a"]=> string(2) "\a" - ["
"]=> - string(1) "
" + [" +"]=> + string(1) " +" [""]=> string(1) "" [""]=> diff --git a/ext/standard/tests/array/asort_variation5.phpt b/ext/standard/tests/array/asort_variation5.phpt index faf7a5de5..bb27dd692 100644 --- a/ext/standard/tests/array/asort_variation5.phpt +++ b/ext/standard/tests/array/asort_variation5.phpt @@ -1,5 +1,10 @@ --TEST-- -Test asort() function : usage variations - sort strings +Test asort() function : usage variations - sort strings +--SKIPIF-- +<?php +if (substr(PHP_OS, 0, 3) == 'WIN') { + die("skip Output tested contains chars that are not shown the same on windows concole (ESC and co)"); +} --FILE-- <?php /* Prototype : bool asort ( array &$array [, int $asort_flags] ) diff --git a/ext/standard/tests/array/krsort_variation5.phpt b/ext/standard/tests/array/krsort_variation5.phpt index 59621654c..0dffc1956 100644 --- a/ext/standard/tests/array/krsort_variation5.phpt +++ b/ext/standard/tests/array/krsort_variation5.phpt @@ -1,5 +1,10 @@ --TEST-- -Test krsort() function : usage variations - sort strings +Test krsort() function : usage variations - sort strings +--SKIPIF-- +<?php +if (substr(PHP_OS, 0, 3) == 'WIN') { + die("skip Output tested contains chars that are not shown the same on windows concole (ESC and co)"); +} --FILE-- <?php /* Prototype : bool krsort ( array &$array [, int $sort_flags] ) @@ -76,8 +81,10 @@ array(11) { string(3) "\cx" ["\a"]=> string(2) "\a" - ["
"]=> - string(1) "
" + [" +"]=> + string(1) " +" [""]=> string(1) "" [""]=> @@ -104,8 +111,10 @@ array(11) { string(3) "\cx" ["\a"]=> string(2) "\a" - ["
"]=> - string(1) "
" + [" +"]=> + string(1) " +" [""]=> string(1) "" [""]=> @@ -132,8 +141,10 @@ array(11) { string(3) "\cx" ["\a"]=> string(2) "\a" - ["
"]=> - string(1) "
" + [" +"]=> + string(1) " +" [""]=> string(1) "" [""]=> diff --git a/ext/standard/tests/array/ksort_variation5.phpt b/ext/standard/tests/array/ksort_variation5.phpt index 958476c01..d83591aae 100644 --- a/ext/standard/tests/array/ksort_variation5.phpt +++ b/ext/standard/tests/array/ksort_variation5.phpt @@ -1,5 +1,10 @@ --TEST-- -Test ksort() function : usage variations - sort strings +Test ksort() function : usage variations - sort strings +--SKIPIF-- +<?php +if (substr(PHP_OS, 0, 3) == 'WIN') { + die("skip Output tested contains chars that are not shown the same on windows concole (ESC and co)"); +} --FILE-- <?php /* Prototype : bool ksort ( array &$array [, int $sort_flags] ) @@ -78,8 +83,10 @@ array(11) { string(1) "" [""]=> string(1) "" - ["
"]=> - string(1) "
" + [" +"]=> + string(1) " +" ["\a"]=> string(2) "\a" ["\cx"]=> @@ -106,8 +113,10 @@ array(11) { string(1) "" [""]=> string(1) "" - ["
"]=> - string(1) "
" + [" +"]=> + string(1) " +" ["\a"]=> string(2) "\a" ["\cx"]=> @@ -134,8 +143,10 @@ array(11) { string(1) "" [""]=> string(1) "" - ["
"]=> - string(1) "
" + [" +"]=> + string(1) " +" ["\a"]=> string(2) "\a" ["\cx"]=> diff --git a/ext/standard/tests/array/natcasesort_variation4.phpt b/ext/standard/tests/array/natcasesort_variation4.phpt index 81276ef1c..2a189f337 100644 --- a/ext/standard/tests/array/natcasesort_variation4.phpt +++ b/ext/standard/tests/array/natcasesort_variation4.phpt @@ -1,5 +1,10 @@ --TEST-- Test natcasesort() function : usage variations - different string types +--SKIPIF-- +<?php +if (substr(PHP_OS, 0, 3) == 'WIN') { + die("skip Output tested contains chars that are not shown the same on windows concole (ESC and co)"); +} --FILE-- <?php /* Prototype : bool natcasesort(array &$array_arg) diff --git a/ext/standard/tests/array/rsort_variation5.phpt b/ext/standard/tests/array/rsort_variation5.phpt index eba6bc420..e955cb34f 100644 --- a/ext/standard/tests/array/rsort_variation5.phpt +++ b/ext/standard/tests/array/rsort_variation5.phpt @@ -1,5 +1,10 @@ --TEST-- Test rsort() function : usage variations - String values +--SKIPIF-- +<?php +if (substr(PHP_OS, 0, 3) == 'WIN') { + die("skip Output tested contains chars that are not shown the same on windows concole (ESC and co)"); +} --FILE-- <?php /* Prototype : bool rsort(array &$array_arg [, int $sort_flags]) diff --git a/ext/standard/tests/array/sort_variation5.phpt b/ext/standard/tests/array/sort_variation5.phpt index 061a1cbac..7384c7402 100644 --- a/ext/standard/tests/array/sort_variation5.phpt +++ b/ext/standard/tests/array/sort_variation5.phpt @@ -1,5 +1,10 @@ --TEST-- -Test sort() function : usage variations - sort strings +Test sort() function : usage variations - sort strings +--SKIPIF-- +<?php +if (substr(PHP_OS, 0, 3) == 'WIN') { + die("skip Output tested contains chars that are not shown the same on windows concole (ESC and co)"); +} --FILE-- <?php /* Prototype : bool sort ( array &$array [, int $sort_flags] ) @@ -74,7 +79,8 @@ array(12) { [5]=> string(1) "" [6]=> - string(1) "
" + string(1) " +" [7]=> string(2) "\a" [8]=> @@ -103,7 +109,8 @@ array(12) { [5]=> string(1) "" [6]=> - string(1) "
" + string(1) " +" [7]=> string(2) "\a" [8]=> @@ -132,7 +139,8 @@ array(12) { [5]=> string(1) "" [6]=> - string(1) "
" + string(1) " +" [7]=> string(2) "\a" [8]=> diff --git a/ext/standard/tests/class_object/is_a.phpt b/ext/standard/tests/class_object/is_a.phpt new file mode 100644 index 000000000..832d5550f --- /dev/null +++ b/ext/standard/tests/class_object/is_a.phpt @@ -0,0 +1,378 @@ +--TEST-- +is_a and is_subclass_of behaviour (with and without autoload) +--SKIPIF-- +<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?> +--FILE-- +<?php + +interface if_a { + function f_a(); +} + +interface if_b extends if_a { + function f_b(); +} + +class base { + function _is_a($sub) { + + echo "\n>>> With Defined class\n"; + echo str_pad('is_a( OBJECT:'.get_class($this).', '.$sub.') = ', 60) . (is_a($this, $sub) ? 'yes' : 'no')."\n"; + echo str_pad('is_a( STRING:'.get_class($this).', '.$sub.') = ', 60). (is_a(get_class($this), $sub) ? 'yes' : 'no')."\n"; + echo str_pad('is_a( STRING:'.get_class($this).', '.$sub.', true) = ', 60). (is_a(get_class($this), $sub, true) ? 'yes' : 'no')."\n"; + echo str_pad('is_subclass_of( OBJECT:'.get_class($this).', '.$sub.') = ', 60). (is_subclass_of($this, $sub) ? 'yes' : 'no')."\n"; + echo str_pad('is_subclass_of( STRING:'.get_class($this).', '.$sub.') = ', 60). (is_subclass_of(get_class($this), $sub) ? 'yes' : 'no')."\n"; + echo str_pad('is_subclass_of( STRING:'.get_class($this).', '.$sub.',false) = ', 60). (is_subclass_of(get_class($this), $sub , false) ? 'yes' : 'no')."\n"; + + // with autoload options.. + echo ">>> With Undefined\n"; + echo str_pad('is_a( STRING:undefB, '.$sub.',true) = ', 60). (is_a('undefB', $sub, true) ? 'yes' : 'no')."\n"; + echo str_pad('is_a( STRING:undefB, '.$sub.') = ', 60). (is_a('undefB', $sub) ? 'yes' : 'no')."\n"; + echo str_pad('is_subclass_of( STRING:undefB, '.$sub.',false) = ', 60). (is_subclass_of('undefB', $sub, false) ? 'yes' : 'no')."\n"; + echo str_pad('is_subclass_of( STRING:undefB, '.$sub.') = ', 60). (is_subclass_of('undefB', $sub) ? 'yes' : 'no')."\n"; + } + function test() { + echo $this->_is_a('base'); + echo $this->_is_a('derived_a'); + echo $this->_is_a('if_a'); + echo $this->_is_a('undefA'); + echo "\n"; + } +} + +class derived_a extends base implements if_a { + function f_a() {} +} + +class derived_b extends base implements if_a, if_b { + function f_a() {} + function f_b() {} +} + +class derived_c extends derived_a implements if_b { + function f_b() {} +} + +class derived_d extends derived_c { +} + +$t = new base(); +$t->test(); + +$t = new derived_a(); +$t->test(); + +eval(' + function __autoload($name) + { + echo ">>>> In __autoload: "; + var_dump($name); + } +'); + +echo "NOW WITH AUTOLOAD\n\n"; + +$t = new base(); +$t->test(); + +$t = new derived_a(); +$t->test(); + +$t = new derived_b(); +$t->test(); + + + + + +?> +--EXPECTF-- +>>> With Defined class +is_a( OBJECT:base, base) = yes +is_a( STRING:base, base) = no +is_a( STRING:base, base, true) = yes +is_subclass_of( OBJECT:base, base) = no +is_subclass_of( STRING:base, base) = no +is_subclass_of( STRING:base, base,false) = no +>>> With Undefined +is_a( STRING:undefB, base,true) = no +is_a( STRING:undefB, base) = no +is_subclass_of( STRING:undefB, base,false) = no +is_subclass_of( STRING:undefB, base) = no + +>>> With Defined class +is_a( OBJECT:base, derived_a) = no +is_a( STRING:base, derived_a) = no +is_a( STRING:base, derived_a, true) = no +is_subclass_of( OBJECT:base, derived_a) = no +is_subclass_of( STRING:base, derived_a) = no +is_subclass_of( STRING:base, derived_a,false) = no +>>> With Undefined +is_a( STRING:undefB, derived_a,true) = no +is_a( STRING:undefB, derived_a) = no +is_subclass_of( STRING:undefB, derived_a,false) = no +is_subclass_of( STRING:undefB, derived_a) = no + +>>> With Defined class +is_a( OBJECT:base, if_a) = no +is_a( STRING:base, if_a) = no +is_a( STRING:base, if_a, true) = no +is_subclass_of( OBJECT:base, if_a) = no +is_subclass_of( STRING:base, if_a) = no +is_subclass_of( STRING:base, if_a,false) = no +>>> With Undefined +is_a( STRING:undefB, if_a,true) = no +is_a( STRING:undefB, if_a) = no +is_subclass_of( STRING:undefB, if_a,false) = no +is_subclass_of( STRING:undefB, if_a) = no + +>>> With Defined class +is_a( OBJECT:base, undefA) = no +is_a( STRING:base, undefA) = no +is_a( STRING:base, undefA, true) = no +is_subclass_of( OBJECT:base, undefA) = no +is_subclass_of( STRING:base, undefA) = no +is_subclass_of( STRING:base, undefA,false) = no +>>> With Undefined +is_a( STRING:undefB, undefA,true) = no +is_a( STRING:undefB, undefA) = no +is_subclass_of( STRING:undefB, undefA,false) = no +is_subclass_of( STRING:undefB, undefA) = no + + +>>> With Defined class +is_a( OBJECT:derived_a, base) = yes +is_a( STRING:derived_a, base) = no +is_a( STRING:derived_a, base, true) = yes +is_subclass_of( OBJECT:derived_a, base) = yes +is_subclass_of( STRING:derived_a, base) = yes +is_subclass_of( STRING:derived_a, base,false) = no +>>> With Undefined +is_a( STRING:undefB, base,true) = no +is_a( STRING:undefB, base) = no +is_subclass_of( STRING:undefB, base,false) = no +is_subclass_of( STRING:undefB, base) = no + +>>> With Defined class +is_a( OBJECT:derived_a, derived_a) = yes +is_a( STRING:derived_a, derived_a) = no +is_a( STRING:derived_a, derived_a, true) = yes +is_subclass_of( OBJECT:derived_a, derived_a) = no +is_subclass_of( STRING:derived_a, derived_a) = no +is_subclass_of( STRING:derived_a, derived_a,false) = no +>>> With Undefined +is_a( STRING:undefB, derived_a,true) = no +is_a( STRING:undefB, derived_a) = no +is_subclass_of( STRING:undefB, derived_a,false) = no +is_subclass_of( STRING:undefB, derived_a) = no + +>>> With Defined class +is_a( OBJECT:derived_a, if_a) = yes +is_a( STRING:derived_a, if_a) = no +is_a( STRING:derived_a, if_a, true) = yes +is_subclass_of( OBJECT:derived_a, if_a) = yes +is_subclass_of( STRING:derived_a, if_a) = yes +is_subclass_of( STRING:derived_a, if_a,false) = no +>>> With Undefined +is_a( STRING:undefB, if_a,true) = no +is_a( STRING:undefB, if_a) = no +is_subclass_of( STRING:undefB, if_a,false) = no +is_subclass_of( STRING:undefB, if_a) = no + +>>> With Defined class +is_a( OBJECT:derived_a, undefA) = no +is_a( STRING:derived_a, undefA) = no +is_a( STRING:derived_a, undefA, true) = no +is_subclass_of( OBJECT:derived_a, undefA) = no +is_subclass_of( STRING:derived_a, undefA) = no +is_subclass_of( STRING:derived_a, undefA,false) = no +>>> With Undefined +is_a( STRING:undefB, undefA,true) = no +is_a( STRING:undefB, undefA) = no +is_subclass_of( STRING:undefB, undefA,false) = no +is_subclass_of( STRING:undefB, undefA) = no + +NOW WITH AUTOLOAD + + +>>> With Defined class +is_a( OBJECT:base, base) = yes +is_a( STRING:base, base) = no +is_a( STRING:base, base, true) = yes +is_subclass_of( OBJECT:base, base) = no +is_subclass_of( STRING:base, base) = no +is_subclass_of( STRING:base, base,false) = no +>>> With Undefined +>>>> In __autoload: string(6) "undefB" +is_a( STRING:undefB, base,true) = no +is_a( STRING:undefB, base) = no +is_subclass_of( STRING:undefB, base,false) = no +>>>> In __autoload: string(6) "undefB" +is_subclass_of( STRING:undefB, base) = no + +>>> With Defined class +is_a( OBJECT:base, derived_a) = no +is_a( STRING:base, derived_a) = no +is_a( STRING:base, derived_a, true) = no +is_subclass_of( OBJECT:base, derived_a) = no +is_subclass_of( STRING:base, derived_a) = no +is_subclass_of( STRING:base, derived_a,false) = no +>>> With Undefined +>>>> In __autoload: string(6) "undefB" +is_a( STRING:undefB, derived_a,true) = no +is_a( STRING:undefB, derived_a) = no +is_subclass_of( STRING:undefB, derived_a,false) = no +>>>> In __autoload: string(6) "undefB" +is_subclass_of( STRING:undefB, derived_a) = no + +>>> With Defined class +is_a( OBJECT:base, if_a) = no +is_a( STRING:base, if_a) = no +is_a( STRING:base, if_a, true) = no +is_subclass_of( OBJECT:base, if_a) = no +is_subclass_of( STRING:base, if_a) = no +is_subclass_of( STRING:base, if_a,false) = no +>>> With Undefined +>>>> In __autoload: string(6) "undefB" +is_a( STRING:undefB, if_a,true) = no +is_a( STRING:undefB, if_a) = no +is_subclass_of( STRING:undefB, if_a,false) = no +>>>> In __autoload: string(6) "undefB" +is_subclass_of( STRING:undefB, if_a) = no + +>>> With Defined class +is_a( OBJECT:base, undefA) = no +is_a( STRING:base, undefA) = no +is_a( STRING:base, undefA, true) = no +is_subclass_of( OBJECT:base, undefA) = no +is_subclass_of( STRING:base, undefA) = no +is_subclass_of( STRING:base, undefA,false) = no +>>> With Undefined +>>>> In __autoload: string(6) "undefB" +is_a( STRING:undefB, undefA,true) = no +is_a( STRING:undefB, undefA) = no +is_subclass_of( STRING:undefB, undefA,false) = no +>>>> In __autoload: string(6) "undefB" +is_subclass_of( STRING:undefB, undefA) = no + + +>>> With Defined class +is_a( OBJECT:derived_a, base) = yes +is_a( STRING:derived_a, base) = no +is_a( STRING:derived_a, base, true) = yes +is_subclass_of( OBJECT:derived_a, base) = yes +is_subclass_of( STRING:derived_a, base) = yes +is_subclass_of( STRING:derived_a, base,false) = no +>>> With Undefined +>>>> In __autoload: string(6) "undefB" +is_a( STRING:undefB, base,true) = no +is_a( STRING:undefB, base) = no +is_subclass_of( STRING:undefB, base,false) = no +>>>> In __autoload: string(6) "undefB" +is_subclass_of( STRING:undefB, base) = no + +>>> With Defined class +is_a( OBJECT:derived_a, derived_a) = yes +is_a( STRING:derived_a, derived_a) = no +is_a( STRING:derived_a, derived_a, true) = yes +is_subclass_of( OBJECT:derived_a, derived_a) = no +is_subclass_of( STRING:derived_a, derived_a) = no +is_subclass_of( STRING:derived_a, derived_a,false) = no +>>> With Undefined +>>>> In __autoload: string(6) "undefB" +is_a( STRING:undefB, derived_a,true) = no +is_a( STRING:undefB, derived_a) = no +is_subclass_of( STRING:undefB, derived_a,false) = no +>>>> In __autoload: string(6) "undefB" +is_subclass_of( STRING:undefB, derived_a) = no + +>>> With Defined class +is_a( OBJECT:derived_a, if_a) = yes +is_a( STRING:derived_a, if_a) = no +is_a( STRING:derived_a, if_a, true) = yes +is_subclass_of( OBJECT:derived_a, if_a) = yes +is_subclass_of( STRING:derived_a, if_a) = yes +is_subclass_of( STRING:derived_a, if_a,false) = no +>>> With Undefined +>>>> In __autoload: string(6) "undefB" +is_a( STRING:undefB, if_a,true) = no +is_a( STRING:undefB, if_a) = no +is_subclass_of( STRING:undefB, if_a,false) = no +>>>> In __autoload: string(6) "undefB" +is_subclass_of( STRING:undefB, if_a) = no + +>>> With Defined class +is_a( OBJECT:derived_a, undefA) = no +is_a( STRING:derived_a, undefA) = no +is_a( STRING:derived_a, undefA, true) = no +is_subclass_of( OBJECT:derived_a, undefA) = no +is_subclass_of( STRING:derived_a, undefA) = no +is_subclass_of( STRING:derived_a, undefA,false) = no +>>> With Undefined +>>>> In __autoload: string(6) "undefB" +is_a( STRING:undefB, undefA,true) = no +is_a( STRING:undefB, undefA) = no +is_subclass_of( STRING:undefB, undefA,false) = no +>>>> In __autoload: string(6) "undefB" +is_subclass_of( STRING:undefB, undefA) = no + + +>>> With Defined class +is_a( OBJECT:derived_b, base) = yes +is_a( STRING:derived_b, base) = no +is_a( STRING:derived_b, base, true) = yes +is_subclass_of( OBJECT:derived_b, base) = yes +is_subclass_of( STRING:derived_b, base) = yes +is_subclass_of( STRING:derived_b, base,false) = no +>>> With Undefined +>>>> In __autoload: string(6) "undefB" +is_a( STRING:undefB, base,true) = no +is_a( STRING:undefB, base) = no +is_subclass_of( STRING:undefB, base,false) = no +>>>> In __autoload: string(6) "undefB" +is_subclass_of( STRING:undefB, base) = no + +>>> With Defined class +is_a( OBJECT:derived_b, derived_a) = no +is_a( STRING:derived_b, derived_a) = no +is_a( STRING:derived_b, derived_a, true) = no +is_subclass_of( OBJECT:derived_b, derived_a) = no +is_subclass_of( STRING:derived_b, derived_a) = no +is_subclass_of( STRING:derived_b, derived_a,false) = no +>>> With Undefined +>>>> In __autoload: string(6) "undefB" +is_a( STRING:undefB, derived_a,true) = no +is_a( STRING:undefB, derived_a) = no +is_subclass_of( STRING:undefB, derived_a,false) = no +>>>> In __autoload: string(6) "undefB" +is_subclass_of( STRING:undefB, derived_a) = no + +>>> With Defined class +is_a( OBJECT:derived_b, if_a) = yes +is_a( STRING:derived_b, if_a) = no +is_a( STRING:derived_b, if_a, true) = yes +is_subclass_of( OBJECT:derived_b, if_a) = yes +is_subclass_of( STRING:derived_b, if_a) = yes +is_subclass_of( STRING:derived_b, if_a,false) = no +>>> With Undefined +>>>> In __autoload: string(6) "undefB" +is_a( STRING:undefB, if_a,true) = no +is_a( STRING:undefB, if_a) = no +is_subclass_of( STRING:undefB, if_a,false) = no +>>>> In __autoload: string(6) "undefB" +is_subclass_of( STRING:undefB, if_a) = no + +>>> With Defined class +is_a( OBJECT:derived_b, undefA) = no +is_a( STRING:derived_b, undefA) = no +is_a( STRING:derived_b, undefA, true) = no +is_subclass_of( OBJECT:derived_b, undefA) = no +is_subclass_of( STRING:derived_b, undefA) = no +is_subclass_of( STRING:derived_b, undefA,false) = no +>>> With Undefined +>>>> In __autoload: string(6) "undefB" +is_a( STRING:undefB, undefA,true) = no +is_a( STRING:undefB, undefA) = no +is_subclass_of( STRING:undefB, undefA,false) = no +>>>> In __autoload: string(6) "undefB" +is_subclass_of( STRING:undefB, undefA) = no diff --git a/ext/standard/tests/class_object/is_a_error_001.phpt b/ext/standard/tests/class_object/is_a_error_001.phpt index 921e3a260..6518a03c0 100644 --- a/ext/standard/tests/class_object/is_a_error_001.phpt +++ b/ext/standard/tests/class_object/is_a_error_001.phpt @@ -4,7 +4,7 @@ Test is_a() function : error conditions - wrong number of args error_reporting=E_ALL | E_STRICT | E_DEPRECATED --FILE-- <?php -/* Prototype : proto bool is_a(object object, string class_name) +/* Prototype : proto bool is_a(object object, string class_name, bool allow_string) * Description: Returns true if the object is of this class or has this class as one of its parents * Source code: Zend/zend_builtin_functions.c * Alias to functions: @@ -12,13 +12,19 @@ error_reporting=E_ALL | E_STRICT | E_DEPRECATED echo "*** Testing is_a() : error conditions ***\n"; - //Test is_a with one more than the expected number of arguments echo "\n-- Testing is_a() function with more than expected no. of arguments --\n"; $object = new stdclass(); $class_name = 'string_val'; +$allow_string = false; $extra_arg = 10; -var_dump( is_a($object, $class_name, $extra_arg) ); + +var_dump( is_a($object, $class_name, $allow_string, $object) ); + +//Test is_a with one more than the expected number of arguments +echo "\n-- Testing is_a() function with non-boolean in last position --\n"; +var_dump( is_a($object, $class_name, $object) ); + // Testing is_a with one less than the expected number of arguments echo "\n-- Testing is_a() function with less than expected no. of arguments --\n"; @@ -28,15 +34,21 @@ var_dump( is_a($object) ); echo "Done"; ?> --EXPECTF-- + *** Testing is_a() : error conditions *** -- Testing is_a() function with more than expected no. of arguments -- -Warning: is_a() expects exactly 2 parameters, 3 given in %s on line 16 +Warning: is_a() expects at most 3 parameters, 4 given in %s on line 17 +NULL + +-- Testing is_a() function with non-boolean in last position -- + +Warning: is_a() expects parameter 3 to be boolean, object given in %s on line 21 NULL -- Testing is_a() function with less than expected no. of arguments -- -Warning: is_a() expects exactly 2 parameters, 1 given in %s on line 21 +Warning: is_a() expects at least 2 parameters, 1 given in %s on line 27 NULL -Done +Done
\ No newline at end of file diff --git a/ext/standard/tests/class_object/is_subclass_of_error_001.phpt b/ext/standard/tests/class_object/is_subclass_of_error_001.phpt index bc657866d..987dcd47b 100644 --- a/ext/standard/tests/class_object/is_subclass_of_error_001.phpt +++ b/ext/standard/tests/class_object/is_subclass_of_error_001.phpt @@ -15,8 +15,18 @@ echo "*** Testing is_subclass_of() : error conditions ***\n"; echo "\n-- Testing is_subclass_of() function with more than expected no. of arguments --\n"; $object = new stdclass(); $class_name = 'string_val'; +$allow_string = false; $extra_arg = 10; -var_dump( is_subclass_of($object, $class_name, $extra_arg) ); +var_dump( is_subclass_of($object, $class_name, $allow_string, $extra_arg) ); + +//Test is_subclass_of with invalid last argument +echo "\n-- Testing is_subclass_of() function with more than typo style invalid 3rd argument --\n"; +var_dump( is_subclass_of($object, $class_name, $class_name) ); + + +//Test is_subclass_of with invalid last argument +echo "\n-- Testing is_subclass_of() function with more than invalid 3rd argument --\n"; +var_dump( is_subclass_of($object, $class_name, $object) ); // Testing is_subclass_of with one less than the expected number of arguments echo "\n-- Testing is_subclass_of() function with less than expected no. of arguments --\n"; @@ -30,11 +40,19 @@ echo "Done"; -- Testing is_subclass_of() function with more than expected no. of arguments -- -Warning: is_subclass_of() expects exactly 2 parameters, 3 given in %s on line 16 +Warning: is_subclass_of() expects at most 3 parameters, 4 given in %s on line 17 +NULL + +-- Testing is_subclass_of() function with more than typo style invalid 3rd argument -- +bool(false) + +-- Testing is_subclass_of() function with more than invalid 3rd argument -- + +Warning: is_subclass_of() expects parameter 3 to be boolean, object given in %s on line 26 NULL -- Testing is_subclass_of() function with less than expected no. of arguments -- -Warning: is_subclass_of() expects exactly 2 parameters, 1 given in %s on line 21 +Warning: is_subclass_of() expects at least 2 parameters, 1 given in %s on line 31 NULL Done diff --git a/ext/standard/tests/dir/opendir_variation6-win32.phpt b/ext/standard/tests/dir/opendir_variation6-win32.phpt new file mode 100644 index 000000000..f54a2ad4a --- /dev/null +++ b/ext/standard/tests/dir/opendir_variation6-win32.phpt @@ -0,0 +1,75 @@ +--TEST-- +Test opendir() function : usage variations - Different wildcards +--SKIPIF-- +<?php +if (substr(PHP_OS, 0, 3) != 'WIN') { + die("skip Valid only on Windows"); +} +?> +--FILE-- +<?php +/* Prototype : mixed opendir(string $path[, resource $context]) + * Description: Open a directory and return a dir_handle + * Source code: ext/standard/dir.c + */ + +/* + * Pass paths containing wildcards to test if opendir() recognises them + */ + +echo "*** Testing opendir() : usage variations ***\n"; +// create the temporary directories +$file_path = dirname(__FILE__); +$dir_path = $file_path . "/opendir_variation6"; +$sub_dir_path = $dir_path . "/sub_dir1"; + +mkdir($dir_path); +mkdir($sub_dir_path); + +// with different wildcard characters + +echo "\n-- Wildcard = '*' --\n"; +var_dump( opendir($file_path . "/opendir_var*") ); +var_dump( opendir($file_path . "/*") ); + +echo "\n-- Wildcard = '?' --\n"; +var_dump( opendir($dir_path . "/sub_dir?") ); +var_dump( opendir($dir_path . "/sub?dir1") ); + +?> +===DONE=== +--CLEAN-- +<?php +$dir_path = dirname(__FILE__) . "/opendir_variation6"; +$sub_dir_path = $dir_path . "/sub_dir1"; + +rmdir($sub_dir_path); +rmdir($dir_path); +?> +--EXPECTF-- +*** Testing opendir() : usage variations *** + +-- Wildcard = '*' -- + +Warning: opendir(%s/opendir_var*,%s/opendir_var*): %s in %s on line %d + +Warning: opendir(%s/opendir_var*): failed to open dir: %s in %s on line %d +bool(false) + +Warning: opendir(%s/*,%s/*): %s in %s on line %d + +Warning: opendir(%s/*): failed to open dir: %s in %s on line %d +bool(false) + +-- Wildcard = '?' -- + +Warning: opendir(%s/opendir_variation6/sub_dir?,%s/opendir_variation6/sub_dir?): %s in %s on line %d + +Warning: opendir(%s/opendir_variation6/sub_dir?): failed to open dir: %s in %s on line %d +bool(false) + +Warning: opendir(%s/opendir_variation6/sub?dir1,%s/opendir_variation6/sub?dir1): %s in %s on line %d + +Warning: opendir(%s/opendir_variation6/sub?dir1): failed to open dir: %s in %s on line %d +bool(false) +===DONE=== diff --git a/ext/standard/tests/directory/open_basedir_001.phpt b/ext/standard/tests/directory/open_basedir_001.phpt deleted file mode 100644 index 092eac27f..000000000 --- a/ext/standard/tests/directory/open_basedir_001.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -openbase_dir runtime tightning ---INI-- -open_basedir=/usr/local ---FILE-- -<?php -var_dump(ini_set("open_basedir", "/usr/local/bin")); -var_dump(ini_get("open_basedir")); -var_dump(ini_set("open_basedir", "/usr")); -var_dump(ini_get("open_basedir")); -?> ---EXPECT-- -string(10) "/usr/local" -string(14) "/usr/local/bin" -bool(false) -string(14) "/usr/local/bin" - diff --git a/ext/standard/tests/file/bug20424.phpt b/ext/standard/tests/file/bug20424.phpt index df10d4abd..b8f9dfd8f 100644 --- a/ext/standard/tests/file/bug20424.phpt +++ b/ext/standard/tests/file/bug20424.phpt @@ -2,7 +2,7 @@ Bug #20424 (stream_get_meta_data crashes on a normal file stream) --FILE-- <?php -$f = fopen(dirname(__FILE__) . "/../../../../run-tests.php", "r"); +$f = fopen(__FILE__, "r"); $dummy = var_export(stream_get_meta_data($f), TRUE); echo "I'm alive!\n"; ?> diff --git a/ext/standard/tests/file/bug52624.phpt b/ext/standard/tests/file/bug52624.phpt new file mode 100644 index 000000000..ee61eb90e --- /dev/null +++ b/ext/standard/tests/file/bug52624.phpt @@ -0,0 +1,12 @@ +--TEST-- +Bug #52624 (tempnam() by-pass open_basedir with inexistent directory) +--INI-- +open_basedir=. +--FILE-- +<?php + +echo tempnam("directory_that_not_exists", "prefix_"); + +?> +--EXPECTF-- +Warning: tempnam(): open_basedir restriction in effect. File(%s) is not within the allowed path(s): (%s) in %s on line %d diff --git a/ext/standard/tests/file/bug60120.phpt b/ext/standard/tests/file/bug60120.phpt new file mode 100644 index 000000000..8915bb833 --- /dev/null +++ b/ext/standard/tests/file/bug60120.phpt @@ -0,0 +1,74 @@ +--TEST--
+Bug #60120 (proc_open hangs when data in stdin/out/err is getting larger or equal to 2048)
+--SKIPIF--
+<?php
+if (substr(PHP_OS, 0, 3) != 'WIN') {
+ die('skip only for Windows');
+}
+$php = getenv('TEST_PHP_EXECUTABLE');
+if (!$php) {
+ die("No php executable defined\n");
+}
+?>
+--FILE--
+<?php
+
+error_reporting(E_ALL);
+
+$php = getenv('TEST_PHP_EXECUTABLE');
+if (!$php) {
+ die("No php executable defined\n");
+}
+$cmd = 'php -r "fwrite(STDOUT, $in = file_get_contents(\'php://stdin\')); fwrite(STDERR, $in);"';
+$descriptors = array(array('pipe', 'r'), array('pipe', 'w'), array('pipe', 'w'));
+$stdin = str_repeat('*', 1024 * 16) . '!';
+$stdin = str_repeat('*', 2049 );
+
+$options = array_merge(array('suppress_errors' => true, 'binary_pipes' => true, 'bypass_shell' => false));
+$process = proc_open($cmd, $descriptors, $pipes, getcwd(), array(), $options);
+
+foreach ($pipes as $pipe) {
+ stream_set_blocking($pipe, false);
+}
+$writePipes = array($pipes[0]);
+$stdinLen = strlen($stdin);
+$stdinOffset = 0;
+
+unset($pipes[0]);
+
+while ($pipes || $writePipes) {
+ $r = $pipes;
+ $w = $writePipes;
+ $e = null;
+ $n = stream_select($r, $w, $e, 60);
+
+ if (false === $n) {
+ break;
+ } elseif ($n === 0) {
+ proc_terminate($process);
+
+ }
+ if ($w) {
+ $written = fwrite($writePipes[0], (binary)substr($stdin, $stdinOffset), 8192);
+ if (false !== $written) {
+ $stdinOffset += $written;
+ }
+ if ($stdinOffset >= $stdinLen) {
+ fclose($writePipes[0]);
+ $writePipes = null;
+ }
+ }
+
+ foreach ($r as $pipe) {
+ $type = array_search($pipe, $pipes);
+ $data = fread($pipe, 8192);
+ if (false === $data || feof($pipe)) {
+ fclose($pipe);
+ unset($pipes[$type]);
+ }
+ }
+}
+echo "OK.";
+?>
+--EXPECT--
+OK.
diff --git a/ext/standard/tests/file/file_get_contents_error001.phpt b/ext/standard/tests/file/file_get_contents_error001.phpt index ced0da032..127901ad7 100644 --- a/ext/standard/tests/file/file_get_contents_error001.phpt +++ b/ext/standard/tests/file/file_get_contents_error001.phpt @@ -7,6 +7,7 @@ file_get_contents() test using offset parameter out of range display_errors=false --SKIPIF-- <?php + if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); if (!function_exists("file_get_contents")) die ("skip file_get_contents function is not found"); ?> diff --git a/ext/standard/tests/file/fread_socket_variation1.phpt b/ext/standard/tests/file/fread_socket_variation1.phpt index 50ee79bbf..a615d2f41 100644 --- a/ext/standard/tests/file/fread_socket_variation1.phpt +++ b/ext/standard/tests/file/fread_socket_variation1.phpt @@ -1,15 +1,11 @@ --TEST-- Testing fread() on a TCP server socket ---SKIPIF-- -<?php -if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); -?> --FILE-- <?php $tcp_socket = stream_socket_server('tcp://127.0.0.1:31337'); -socket_set_timeout($tcp_socket, 1); +socket_set_timeout($tcp_socket, 0, 1000); var_dump(fread($tcp_socket, 1)); diff --git a/ext/standard/tests/file/lstat_stat_basic.phpt b/ext/standard/tests/file/lstat_stat_basic.phpt index 362fcfe86..0d1476d68 100644 --- a/ext/standard/tests/file/lstat_stat_basic.phpt +++ b/ext/standard/tests/file/lstat_stat_basic.phpt @@ -2,6 +2,7 @@ Test lstat() & stat() functions: basic functionality --SKIPIF-- <?php +if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); if (substr(PHP_OS, 0, 3) == 'WIN') { die('skip.. lstat() not available on Windows'); } diff --git a/ext/standard/tests/file/lstat_stat_variation10.phpt b/ext/standard/tests/file/lstat_stat_variation10.phpt index a30b3c51f..51ebc25e7 100644 --- a/ext/standard/tests/file/lstat_stat_variation10.phpt +++ b/ext/standard/tests/file/lstat_stat_variation10.phpt @@ -2,6 +2,7 @@ Test lstat() and stat() functions: usage variations - effects of is_dir() --SKIPIF-- <?php +if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); if (substr(PHP_OS, 0, 3) == 'WIN') { die('skip.. Not valid for Windows'); } diff --git a/ext/standard/tests/file/lstat_stat_variation11.phpt b/ext/standard/tests/file/lstat_stat_variation11.phpt index df1b8ac12..a75504b47 100644 --- a/ext/standard/tests/file/lstat_stat_variation11.phpt +++ b/ext/standard/tests/file/lstat_stat_variation11.phpt @@ -2,6 +2,7 @@ Test lstat() and stat() functions: usage variations - effect of is_file() --SKIPIF-- <?php +if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); if (substr(PHP_OS, 0, 3) == 'WIN') { die('skip.. Not valid for Windows'); } diff --git a/ext/standard/tests/file/lstat_stat_variation12.phpt b/ext/standard/tests/file/lstat_stat_variation12.phpt index c1e37b543..8e1edd66c 100644 --- a/ext/standard/tests/file/lstat_stat_variation12.phpt +++ b/ext/standard/tests/file/lstat_stat_variation12.phpt @@ -2,6 +2,7 @@ Test lstat() and stat() functions: usage variations - effects of is_link() --SKIPIF-- <?php +if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); if (substr(PHP_OS, 0, 3) == 'WIN') { die('skip.. lstat() not available on Windows'); } diff --git a/ext/standard/tests/file/lstat_stat_variation13.phpt b/ext/standard/tests/file/lstat_stat_variation13.phpt index 474ddc516..288e0b5ec 100644 --- a/ext/standard/tests/file/lstat_stat_variation13.phpt +++ b/ext/standard/tests/file/lstat_stat_variation13.phpt @@ -2,6 +2,7 @@ Test lstat() and stat() functions: usage variations - file opened using w and r mode --SKIPIF-- <?php +if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); if (substr(PHP_OS, 0, 3) == 'WIN') { die('skip.. Not valid for Windows'); } diff --git a/ext/standard/tests/file/lstat_stat_variation15.phpt b/ext/standard/tests/file/lstat_stat_variation15.phpt index 45912ae58..8b67338ab 100644 --- a/ext/standard/tests/file/lstat_stat_variation15.phpt +++ b/ext/standard/tests/file/lstat_stat_variation15.phpt @@ -2,6 +2,7 @@ Test lstat() and stat() functions: usage variations - effects changing permissions of link --SKIPIF-- <?php +if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); if (substr(PHP_OS, 0, 3) == 'WIN') { die('skip.. lstat() not available on Windows'); } diff --git a/ext/standard/tests/file/lstat_stat_variation16.phpt b/ext/standard/tests/file/lstat_stat_variation16.phpt index 641ccd58d..9f1276548 100644 --- a/ext/standard/tests/file/lstat_stat_variation16.phpt +++ b/ext/standard/tests/file/lstat_stat_variation16.phpt @@ -2,6 +2,7 @@ Test lstat() and stat() functions: usage variations - effects changing permissions of file --SKIPIF-- <?php +if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); if (substr(PHP_OS, 0, 3) == 'WIN') { die('skip.. Not valid for Windows'); } diff --git a/ext/standard/tests/file/lstat_stat_variation17.phpt b/ext/standard/tests/file/lstat_stat_variation17.phpt index e50abf3f8..f2306de79 100644 --- a/ext/standard/tests/file/lstat_stat_variation17.phpt +++ b/ext/standard/tests/file/lstat_stat_variation17.phpt @@ -2,6 +2,7 @@ Test lstat() and stat() functions: usage variations - effects changing permissions of dir --SKIPIF-- <?php +if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); if (substr(PHP_OS, 0, 3) == 'WIN') { die('skip.. Not valid for Windows'); } diff --git a/ext/standard/tests/file/lstat_stat_variation21.phpt b/ext/standard/tests/file/lstat_stat_variation21.phpt index 1009c92c5..8620ab00d 100644 --- a/ext/standard/tests/file/lstat_stat_variation21.phpt +++ b/ext/standard/tests/file/lstat_stat_variation21.phpt @@ -2,6 +2,7 @@ Test lstat() and stat() functions: usage variations - effects of truncate() --SKIPIF-- <?php +if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); if (substr(PHP_OS, 0, 3) == 'WIN') { die('skip.. Not valid for Windows'); } diff --git a/ext/standard/tests/file/lstat_stat_variation4.phpt b/ext/standard/tests/file/lstat_stat_variation4.phpt index 7407a63bf..259beca00 100755 --- a/ext/standard/tests/file/lstat_stat_variation4.phpt +++ b/ext/standard/tests/file/lstat_stat_variation4.phpt @@ -2,6 +2,7 @@ Test lstat() and stat() functions: usage variations - effects of touch() on file --SKIPIF-- <?php +if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); if (substr(PHP_OS, 0, 3) == 'WIN') { die('skip.. Not valid for Windows'); } diff --git a/ext/standard/tests/file/lstat_stat_variation5.phpt b/ext/standard/tests/file/lstat_stat_variation5.phpt index 895e606b9..d0c096ef1 100755 --- a/ext/standard/tests/file/lstat_stat_variation5.phpt +++ b/ext/standard/tests/file/lstat_stat_variation5.phpt @@ -2,6 +2,7 @@ Test lstat() and stat() functions: usage variations - effects of touch() on dir --SKIPIF-- <?php +if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); if (substr(PHP_OS, 0, 3) == 'WIN') { die('skip.. Not valid for Windows'); } diff --git a/ext/standard/tests/file/lstat_stat_variation6.phpt b/ext/standard/tests/file/lstat_stat_variation6.phpt index b7913e0b3..7e557d034 100755 --- a/ext/standard/tests/file/lstat_stat_variation6.phpt +++ b/ext/standard/tests/file/lstat_stat_variation6.phpt @@ -2,6 +2,7 @@ Test lstat() and stat() functions: usage variations - effects of touch() on link --SKIPIF-- <?php +if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); if (!(stristr(PHP_OS, 'linux'))) { die('skip.. test valid for linux only'); } @@ -47,7 +48,7 @@ clearstatcache(); var_dump( touch($link_name) ); -$new_stat = lstat($link_name); +$new_stat = stat($file_name); // compare self stats var_dump( compare_self_stat($old_stat) ); diff --git a/ext/standard/tests/file/lstat_stat_variation8.phpt b/ext/standard/tests/file/lstat_stat_variation8.phpt index 412c3bf03..b0f170d1f 100644 --- a/ext/standard/tests/file/lstat_stat_variation8.phpt +++ b/ext/standard/tests/file/lstat_stat_variation8.phpt @@ -2,6 +2,7 @@ Test lstat() and stat() functions: usage variations - creating file/subdir --SKIPIF-- <?php +if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); if (substr(PHP_OS, 0, 3) == 'WIN') { die('skip.. Not valid for Windows'); } diff --git a/ext/standard/tests/file/readlink_realpath_variation3.phpt b/ext/standard/tests/file/readlink_realpath_variation3.phpt index 70e8d0c94..3766a5b43 100644 --- a/ext/standard/tests/file/readlink_realpath_variation3.phpt +++ b/ext/standard/tests/file/readlink_realpath_variation3.phpt @@ -46,32 +46,32 @@ echo "Done\n"; *** Testing readlink() and realpath() with linkname as empty string, NULL and single space *** -- Iteration1 -- -Warning: readlink(): No such file or directory in %s on line %d +Warning: readlink(): %s in %s on line %d bool(false) %s -- Iteration2 -- -Warning: readlink(): No such file or directory in %s on line %d +Warning: readlink(): %s in %s on line %d bool(false) %s -- Iteration3 -- -Warning: readlink(): No such file or directory in %s on line %d +Warning: readlink(): %s in %s on line %d bool(false) string(%d) "%s" -- Iteration4 -- -Warning: readlink(): No such file or directory in %s on line %d +Warning: readlink(): %s in %s on line %d bool(false) string(%d) "%s" -- Iteration5 -- -Warning: readlink(): No such file or directory in %s on line %d +Warning: readlink(): %s in %s on line %d bool(false) string(%d) "%s" -- Iteration6 -- -Warning: readlink(): No such file or directory in %s on line %d +Warning: readlink(): %s in %s on line %d bool(false) string(%d) "%s" Done diff --git a/ext/standard/tests/file/readlink_variation1.phpt b/ext/standard/tests/file/readlink_variation1.phpt index 49dc6a540..1dae17cbd 100644 --- a/ext/standard/tests/file/readlink_variation1.phpt +++ b/ext/standard/tests/file/readlink_variation1.phpt @@ -50,28 +50,28 @@ unlink($file_path."/readlink_variation2.tmp"); --EXPECTF-- *** Testing Invalid file types *** -Warning: readlink(): No such file or directory in %s on line %d +Warning: readlink(): %s in %s on line %d bool(false) -Warning: readlink(): No such file or directory in %s on line %d +Warning: readlink(): %s in %s on line %d bool(false) -Warning: readlink(): No such file or directory in %s on line %d +Warning: readlink(): %s in %s on line %d bool(false) -Warning: readlink(): No such file or directory in %s on line %d +Warning: readlink(): %s in %s on line %d bool(false) -Warning: readlink(): No such file or directory in %s on line %d +Warning: readlink(): %s in %s on line %d bool(false) Warning: readlink() expects parameter 1 to be string, resource given in %s on line %d NULL -Warning: readlink(): No such file or directory in %s on line %d +Warning: readlink(): %s in %s on line %d bool(false) -Warning: readlink(): No such file or directory in %s on line %d +Warning: readlink(): %s in %s on line %d bool(false) *** Done *** diff --git a/ext/standard/tests/file/rename_variation13-win32.phpt b/ext/standard/tests/file/rename_variation13-win32.phpt index 2cd9dbdd9..8e86d27a2 100644 --- a/ext/standard/tests/file/rename_variation13-win32.phpt +++ b/ext/standard/tests/file/rename_variation13-win32.phpt @@ -36,6 +36,9 @@ $names_arr = array( ); +/* disable notice so we don't get the array to string conversion notice for "$name" where $name = array() */ +error_reporting(E_ALL ^ E_NOTICE); + echo "*** Testing rename() with obscure files ***\n"; $file_path = dirname(__FILE__)."/renameVar13"; $aFile = $file_path.'/afile.tmp'; diff --git a/ext/standard/tests/file/rename_variation6-win32.phpt b/ext/standard/tests/file/rename_variation6-win32.phpt index 14d59d0ad..9aab0a7a8 100644 --- a/ext/standard/tests/file/rename_variation6-win32.phpt +++ b/ext/standard/tests/file/rename_variation6-win32.phpt @@ -33,7 +33,7 @@ var_dump(file_exists($tmp_file)); echo "Done\n"; ?> --EXPECTF-- -Warning: readlink(): Could not open file (error 2) in %s on line %d +Warning: readlink(): %s in %s on line %d bool(false) string(%d) "%srename_variation6-win32.php.tmp" bool(true) diff --git a/ext/standard/tests/file/touch_basic.phpt b/ext/standard/tests/file/touch_basic.phpt index fb042df67..c41fdf1d7 100644 --- a/ext/standard/tests/file/touch_basic.phpt +++ b/ext/standard/tests/file/touch_basic.phpt @@ -4,6 +4,7 @@ Test touch() function : basic functionality Dave Kelsey <d_kelsey@uk.ibm.com> --SKIPIF-- <?php +if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); if (substr(PHP_OS, 0, 3) == 'WIN') { die('skip.. only for Non Windows'); } diff --git a/ext/standard/tests/general_functions/bug39322.phpt b/ext/standard/tests/general_functions/bug39322.phpt index 6ba740dc8..a9f83c75b 100644 --- a/ext/standard/tests/general_functions/bug39322.phpt +++ b/ext/standard/tests/general_functions/bug39322.phpt @@ -2,6 +2,7 @@ Bug #39322 (proc_terminate() loosing process resource) --SKIPIF-- <?php +if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); if (!is_executable('/bin/sleep')) echo 'skip sleep not found'; ?> --FILE-- @@ -15,7 +16,7 @@ $pipes = array(); $process = proc_open('/bin/sleep 120', $descriptors, $pipes); -proc_terminate($process); +proc_terminate($process, 9); sleep(1); // wait a bit to let the process finish var_dump(proc_get_status($process)); @@ -37,7 +38,7 @@ array(8) { ["exitcode"]=> int(-1) ["termsig"]=> - int(15) + int(9) ["stopsig"]=> int(0) } diff --git a/ext/standard/tests/general_functions/call_user_method_002.phpt b/ext/standard/tests/general_functions/call_user_method_002.phpt new file mode 100644 index 000000000..054bc3ede --- /dev/null +++ b/ext/standard/tests/general_functions/call_user_method_002.phpt @@ -0,0 +1,12 @@ +--TEST-- +call_user_method() Invalid free +--FILE-- +<?php + +call_user_method("1", $arr1); + +?> +--EXPECTF-- +Deprecated: Function call_user_method() is deprecated in %s on line %d + +Warning: call_user_method(): Second argument is not an object or class name in %s on line %d diff --git a/ext/standard/tests/general_functions/parse_ini_file-win32.phpt b/ext/standard/tests/general_functions/parse_ini_file-win32.phpt deleted file mode 100644 index 7a1d63010..000000000 --- a/ext/standard/tests/general_functions/parse_ini_file-win32.phpt +++ /dev/null @@ -1,196 +0,0 @@ ---TEST-- -parse_ini_file() multiple calls ---SKIPIF-- -<?php if( substr(PHP_OS, 0, 3) != 'WIN' ) die("skip non Windows systems have different error message");?> ---FILE-- -<?php - -$filename = dirname(__FILE__)."/parse_ini_file.dat"; -@unlink($filename); /* Make sure the file really does not exist! */ - -var_dump(parse_ini_file()); -var_dump(parse_ini_file(1,1,1,1)); -var_dump(parse_ini_file($filename)); -var_dump(parse_ini_file($filename, true)); - -$ini = " -test = -"; -file_put_contents($filename, $ini); -var_dump(parse_ini_file($filename)); -$ini = " -test== -"; -file_put_contents($filename, $ini); -var_dump(parse_ini_file($filename)); - -$ini = " -test=test= -"; -file_put_contents($filename, $ini); -var_dump(parse_ini_file($filename)); - -$ini = " -test= \"new -line\" -"; -file_put_contents($filename, $ini); -var_dump(parse_ini_file($filename)); - -define("TEST_CONST", "test const value"); -$ini = " -test=TEST_CONST -"; -file_put_contents($filename, $ini); -var_dump(parse_ini_file($filename)); - -$ini = " -[section] -test=hello -"; -file_put_contents($filename, $ini); -var_dump(parse_ini_file($filename, true)); - -$ini = " -[section] -test=hello -"; -file_put_contents($filename, $ini); -var_dump(parse_ini_file($filename, false)); - -$ini = " -section.test=hello -"; -file_put_contents($filename, $ini); -var_dump(parse_ini_file($filename, true)); - -$ini = " -[section] -section.test=hello -"; -file_put_contents($filename, $ini); -var_dump(parse_ini_file($filename, true)); - -$ini = " -[section] -1=2 -"; -file_put_contents($filename, $ini); -var_dump(parse_ini_file($filename, true)); - -$ini = " -1=2 -"; -file_put_contents($filename, $ini); -var_dump(parse_ini_file($filename, true)); -$ini = " -test=test2 -test=test3 -test=test4 -"; -file_put_contents($filename, $ini); -var_dump(parse_ini_file($filename, true)); - -/* From bug #44574 */ -$ini = "[section1]\nname = value"; -file_put_contents($filename, $ini); -var_dump(parse_ini_file($filename, true)); - -/* #44842, labels starting with underscore */ -$ini = <<<'INI' -foo=bar1 -_foo=bar2 -foo_=bar3 -INI; -file_put_contents($filename, $ini); -var_dump(parse_ini_file($filename, true)); - -@unlink($filename); -echo "Done\n"; -?> ---EXPECTF-- -Warning: parse_ini_file() expects at least 1 parameter, 0 given in %s on line 6 -bool(false) - -Warning: parse_ini_file() expects at most 3 parameters, 4 given in %s on line 7 -bool(false) - -Warning: parse_ini_file(%sparse_ini_file.dat): failed to open stream: No such file or directory in %s.php on line 8 -bool(false) - -Warning: parse_ini_file(%sparse_ini_file.dat): failed to open stream: No such file or directory in %s.php on line 9 -bool(false) -array(1) { - ["test"]=> - string(0) "" -} - -Warning: parse error in %s on line %d - in %s on line 20 -bool(false) - -Warning: parse error in %s on line %d - in %s on line 26 -bool(false) -array(1) { - ["test"]=> - string(8) "new -line" -} -array(1) { - ["test"]=> - string(16) "test const value" -} -array(1) { - ["section"]=> - array(1) { - ["test"]=> - string(5) "hello" - } -} -array(1) { - ["test"]=> - string(5) "hello" -} -array(1) { - ["section.test"]=> - string(5) "hello" -} -array(1) { - ["section"]=> - array(1) { - ["section.test"]=> - string(5) "hello" - } -} -array(1) { - ["section"]=> - array(1) { - [1]=> - string(1) "2" - } -} -array(1) { - [1]=> - string(1) "2" -} -array(1) { - ["test"]=> - string(5) "test4" -} -array(1) { - ["section1"]=> - array(1) { - ["name"]=> - string(5) "value" - } -} -array(3) { - ["foo"]=> - string(4) "bar1" - ["_foo"]=> - string(4) "bar2" - ["foo_"]=> - string(4) "bar3" -} -Done diff --git a/ext/standard/tests/general_functions/parse_ini_file.phpt b/ext/standard/tests/general_functions/parse_ini_file.phpt index 8523c83cf..240b0f3b1 100644 --- a/ext/standard/tests/general_functions/parse_ini_file.phpt +++ b/ext/standard/tests/general_functions/parse_ini_file.phpt @@ -137,11 +137,11 @@ array(1) { string(0) "" } -Warning: syntax error, unexpected '=' in %sparse_ini_file.dat on line 2 +Warning: syntax error, unexpected '='%sparse_ini_file.dat on line 2 in %sparse_ini_file.php on line 20 bool(false) -Warning: syntax error, unexpected '=' in %sparse_ini_file.dat on line 2 +Warning: syntax error, unexpected '='%sparse_ini_file.dat on line 2 in %sparse_ini_file.php on line 26 bool(false) array(1) { diff --git a/ext/standard/tests/general_functions/parse_ini_string_002.phpt b/ext/standard/tests/general_functions/parse_ini_string_002.phpt index 0da959ab8..733409c84 100644 --- a/ext/standard/tests/general_functions/parse_ini_string_002.phpt +++ b/ext/standard/tests/general_functions/parse_ini_string_002.phpt @@ -97,11 +97,11 @@ array(1) { %unicode|string%(0) "" } -Warning: syntax error, unexpected '=' in Unknown on line 2 +Warning: syntax error, unexpected '='%sin Unknown on line 2 in %s bool(false) -Warning: syntax error, unexpected '=' in Unknown on line 2 +Warning: syntax error, unexpected '='%sin Unknown on line 2 in %s bool(false) array(1) { diff --git a/ext/standard/tests/general_functions/proc_open02.phpt b/ext/standard/tests/general_functions/proc_open02.phpt index 3406f6806..d5d878ed2 100644 --- a/ext/standard/tests/general_functions/proc_open02.phpt +++ b/ext/standard/tests/general_functions/proc_open02.phpt @@ -3,7 +3,6 @@ proc_open --SKIPIF-- <?php if (!is_executable('/bin/sleep')) echo 'skip no sleep'; -if (!is_executable('/usr/bin/nohup')) echo 'skip no nohup'; if (getenv('SKIP_SLOW_TESTS')) echo 'skip slow test'; ?> --FILE-- @@ -11,19 +10,19 @@ if (getenv('SKIP_SLOW_TESTS')) echo 'skip slow test'; $ds = array(array('pipe', 'r')); $cat = proc_open( - '/usr/bin/nohup /bin/sleep 50', + '/bin/sleep 2', $ds, $pipes ); -sleep(1); // let the OS run the nohup process before sending the signal +usleep(20000); // let the OS run the sleep process before sending the signal -var_dump(proc_terminate($cat, 1)); // send a SIGHUP -sleep(1); +var_dump(proc_terminate($cat, 0)); // status check +usleep(20000); var_dump(proc_get_status($cat)); var_dump(proc_terminate($cat)); // now really quit it -sleep(1); +usleep(20000); var_dump(proc_get_status($cat)); proc_close($cat); @@ -35,7 +34,7 @@ echo "Done!\n"; bool(true) array(8) { ["command"]=> - string(28) "/usr/bin/nohup /bin/sleep 50" + string(12) "/bin/sleep 2" ["pid"]=> int(%d) ["running"]=> @@ -54,7 +53,7 @@ array(8) { bool(true) array(8) { ["command"]=> - string(28) "/usr/bin/nohup /bin/sleep 50" + string(12) "/bin/sleep 2" ["pid"]=> int(%d) ["running"]=> diff --git a/ext/standard/tests/general_functions/sleep_basic.phpt b/ext/standard/tests/general_functions/sleep_basic.phpt index cfc00c6ea..5d7fe536f 100644 --- a/ext/standard/tests/general_functions/sleep_basic.phpt +++ b/ext/standard/tests/general_functions/sleep_basic.phpt @@ -1,5 +1,9 @@ --TEST-- Test sleep() function : basic functionality +--SKIPIF-- +<?php +if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); +?> --FILE-- <?php /* Prototype : int sleep ( int $seconds ) diff --git a/ext/standard/tests/general_functions/usleep_basic.phpt b/ext/standard/tests/general_functions/usleep_basic.phpt index 22c3e658b..d6f312e15 100644 --- a/ext/standard/tests/general_functions/usleep_basic.phpt +++ b/ext/standard/tests/general_functions/usleep_basic.phpt @@ -1,5 +1,9 @@ --TEST-- Test usleep() function +--SKIPIF-- +<?php +if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); +?> --FILE-- <?php /* Prototype : void usleep ( int $micro_seconds ) diff --git a/ext/standard/tests/http/bug38802.phpt b/ext/standard/tests/http/bug38802.phpt index 91fd1cce9..73b41183a 100644 --- a/ext/standard/tests/http/bug38802.phpt +++ b/ext/standard/tests/http/bug38802.phpt @@ -1,5 +1,7 @@ --TEST-- Bug #38802 (ignore_errors and max_redirects) +--INI-- +allow_url_fopen=1 --SKIPIF-- <?php require 'server.inc'; http_server_skipif('tcp://127.0.0.1:12342'); ?> --FILE-- diff --git a/ext/standard/tests/http/bug43510.phpt b/ext/standard/tests/http/bug43510.phpt index 7358ee12c..d97361237 100644 --- a/ext/standard/tests/http/bug43510.phpt +++ b/ext/standard/tests/http/bug43510.phpt @@ -1,5 +1,7 @@ --TEST-- Bug #43510 (stream_get_meta_data() does not return same mode as used in fopen) +--INI-- +allow_url_fopen=1 --SKIPIF-- <?php require 'server.inc'; http_server_skipif('tcp://127.0.0.1:12342'); ?> --FILE-- diff --git a/ext/standard/tests/http/bug48929.phpt b/ext/standard/tests/http/bug48929.phpt index 035ebb12b..2d1e45917 100644 --- a/ext/standard/tests/http/bug48929.phpt +++ b/ext/standard/tests/http/bug48929.phpt @@ -1,5 +1,7 @@ --TEST-- Bug #48929 (duplicate \r\n sent after last header line) +--INI-- +allow_url_fopen=1 --SKIPIF-- <?php require 'server.inc'; http_server_skipif('tcp://127.0.0.1:12342'); ?> --FILE-- diff --git a/ext/standard/tests/http/bug53198.phpt b/ext/standard/tests/http/bug53198.phpt index fe26bc952..3c640fa9c 100644 --- a/ext/standard/tests/http/bug53198.phpt +++ b/ext/standard/tests/http/bug53198.phpt @@ -1,56 +1,57 @@ ---TEST--
-Bug #53198 (From: header cannot be changed with ini_set)
---SKIPIF--
-<?php require 'server.inc'; http_server_skipif('tcp://127.0.0.1:12342'); ?>
---INI--
-from=teste@teste.pt
---FILE--
-<?php
-require 'server.inc';
-
-function do_test() {
-
- $responses = array(
- "data://text/plain,HTTP/1.0 200 OK\r\n\r\n",
- );
-
- $pid = http_server("tcp://127.0.0.1:12342", $responses, $output);
-
- foreach($responses as $r) {
-
- $fd = fopen('http://127.0.0.1:12342/', 'rb', false);
-
- fseek($output, 0, SEEK_SET);
- var_dump(stream_get_contents($output));
- fseek($output, 0, SEEK_SET);
- }
-
- http_server_kill($pid);
-
-}
-
-echo "-- Test: leave default --\n";
-
-do_test();
-
-echo "-- Test: after ini_set --\n";
-
-ini_set('from', 'junk@junk.com');
-
-do_test();
-
-?>
---EXPECT--
--- Test: leave default --
-string(63) "GET / HTTP/1.0
-From: teste@teste.pt
-Host: 127.0.0.1:12342
-
-"
--- Test: after ini_set --
-string(62) "GET / HTTP/1.0
-From: junk@junk.com
-Host: 127.0.0.1:12342
-
-"
-
+--TEST-- +Bug #53198 (From: header cannot be changed with ini_set) +--SKIPIF-- +<?php require 'server.inc'; http_server_skipif('tcp://127.0.0.1:12342'); ?> +--INI-- +allow_url_fopen=1 +from=teste@teste.pt +--FILE-- +<?php +require 'server.inc'; + +function do_test() { + + $responses = array( + "data://text/plain,HTTP/1.0 200 OK\r\n\r\n", + ); + + $pid = http_server("tcp://127.0.0.1:12342", $responses, $output); + + foreach($responses as $r) { + + $fd = fopen('http://127.0.0.1:12342/', 'rb', false); + + fseek($output, 0, SEEK_SET); + var_dump(stream_get_contents($output)); + fseek($output, 0, SEEK_SET); + } + + http_server_kill($pid); + +} + +echo "-- Test: leave default --\n"; + +do_test(); + +echo "-- Test: after ini_set --\n"; + +ini_set('from', 'junk@junk.com'); + +do_test(); + +?> +--EXPECT-- +-- Test: leave default -- +string(63) "GET / HTTP/1.0 +From: teste@teste.pt +Host: 127.0.0.1:12342 + +" +-- Test: after ini_set -- +string(62) "GET / HTTP/1.0 +From: junk@junk.com +Host: 127.0.0.1:12342 + +" + diff --git a/ext/standard/tests/http/bug60570.phpt b/ext/standard/tests/http/bug60570.phpt new file mode 100644 index 000000000..d1784b055 --- /dev/null +++ b/ext/standard/tests/http/bug60570.phpt @@ -0,0 +1,53 @@ +--TEST-- +Bug #60570 (Stream context leaks when http request fails) +--SKIPIF-- +<?php require 'server.inc'; http_server_skipif('tcp://127.0.0.1:12342'); ?> +--INI-- +allow_url_fopen=1 +allow_url_include=1 +--FILE-- +<?php +require 'server.inc'; + +function do_test() { + + $responses = array( + "data://text/plain,HTTP/1.0 404 Not Found\r\n\r\n", + "data://text/plain,HTTP/1.0 404 Not Found\r\n\r\n", + "data://text/plain,HTTP/1.0 404 Not Found\r\n\r\n" + ); + + $pid = http_server("tcp://127.0.0.1:12342", $responses, $output); + + $a = $b = null; + + $i = 3; + while ($i--) { + $context = stream_context_create(array('http'=>array('timeout'=>1))); + file_get_contents('http://127.0.0.1:12342/', 0, $context); + unset($context); + + $b = $a; + $a = memory_get_usage(); + } + + http_server_kill($pid); + + echo "leak? penultimate iteration: $b, last one: $a\n"; + var_dump($a == $b); +} + +do_test(); + +--EXPECTF-- +Warning: file_get_contents(http://127.0.0.1:12342/): failed to open stream: HTTP request failed! HTTP/1.0 404 Not Found + in %s on line %d + +Warning: file_get_contents(http://127.0.0.1:12342/): failed to open stream: HTTP request failed! HTTP/1.0 404 Not Found + in %s on line %d + +Warning: file_get_contents(http://127.0.0.1:12342/): failed to open stream: HTTP request failed! HTTP/1.0 404 Not Found + in %s on line %d +leak? penultimate iteration: %d, last one: %d +bool(true) + diff --git a/ext/standard/tests/http/ignore_errors.phpt b/ext/standard/tests/http/ignore_errors.phpt index c7e1acbfe..ab5421890 100644 --- a/ext/standard/tests/http/ignore_errors.phpt +++ b/ext/standard/tests/http/ignore_errors.phpt @@ -1,5 +1,7 @@ --TEST-- http:// and ignore_errors +--INI-- +allow_url_fopen=1 --SKIPIF-- <?php require 'server.inc'; http_server_skipif('tcp://127.0.0.1:12342'); ?> --FILE-- diff --git a/ext/standard/tests/image/image_type_to_mime_type_basic.phpt b/ext/standard/tests/image/image_type_to_mime_type_basic.phpt new file mode 100644 index 000000000..b81bdbde5 --- /dev/null +++ b/ext/standard/tests/image/image_type_to_mime_type_basic.phpt @@ -0,0 +1,63 @@ +--TEST-- +image_type_to_mime_type() +--SKIPIF-- +<?php + if (!function_exists('image_type_to_mime_type')) die('skip image_type_to_mime_type() not available'); +?> +--FILE-- +<?php + +/* Prototype : string image_type_to_mime_type ( int $imagetype ) + * Description: Get Mime-Type for image-type returned by getimagesize, exif_read_data, exif_thumbnail, exif_imagetype. + * Source code: ext/standard/image.c + * Alias to functions: + */ + +echo "Starting image_type_to_mime_type() test\n\n"; + +$image_types = array ( + IMAGETYPE_GIF, + IMAGETYPE_JPEG, + IMAGETYPE_PNG, + IMAGETYPE_SWF, + IMAGETYPE_PSD, + IMAGETYPE_BMP, + IMAGETYPE_TIFF_II, + IMAGETYPE_TIFF_MM, + IMAGETYPE_JPC, + IMAGETYPE_JP2, + IMAGETYPE_JPX, + IMAGETYPE_JB2, + IMAGETYPE_IFF, + IMAGETYPE_WBMP, + IMAGETYPE_JPEG2000, + IMAGETYPE_XBM +); + + foreach($image_types as $image_type) { + var_dump(image_type_to_mime_type($image_type)); + } + +echo "\nDone image_type_to_mime_type() test\n"; +?> +--EXPECT-- +Starting image_type_to_mime_type() test + +string(9) "image/gif" +string(10) "image/jpeg" +string(9) "image/png" +string(29) "application/x-shockwave-flash" +string(9) "image/psd" +string(14) "image/x-ms-bmp" +string(10) "image/tiff" +string(10) "image/tiff" +string(24) "application/octet-stream" +string(9) "image/jp2" +string(24) "application/octet-stream" +string(24) "application/octet-stream" +string(9) "image/iff" +string(18) "image/vnd.wap.wbmp" +string(24) "application/octet-stream" +string(9) "image/xbm" + +Done image_type_to_mime_type() test diff --git a/ext/standard/tests/image/image_type_to_mime_type_error.phpt b/ext/standard/tests/image/image_type_to_mime_type_error.phpt new file mode 100644 index 000000000..88aacbf17 --- /dev/null +++ b/ext/standard/tests/image/image_type_to_mime_type_error.phpt @@ -0,0 +1,35 @@ +--TEST-- +Test image_type_to_mime_type() function : error conditions - Pass incorrect number of arguments +--FILE-- +<?php +/* Prototype : proto string image_type_to_mime_type(int imagetype) + * Description: Get Mime-Type for image-type returned by getimagesize, exif_read_data, exif_thumbnail, exif_imagetype + * Source code: ext/standard/image.c + */ + +$imagetype = IMAGETYPE_GIF; +$extra_arg = 10; +echo "*** Testing image_type_to_mime_type() : error conditions ***\n"; + +// Zero arguments +echo "\n-- Testing image_type_to_mime_type() function with Zero arguments --\n"; +var_dump( image_type_to_mime_type() ); + +//Test image_type_to_mime_type with one more than the expected number of arguments +echo "\n-- Testing image_type_to_mime_type() function with more than expected no. of arguments --\n"; +var_dump( image_type_to_mime_type($imagetype, $extra_arg) ); +?> +===DONE=== +--EXPECTF-- +*** Testing image_type_to_mime_type() : error conditions *** + +-- Testing image_type_to_mime_type() function with Zero arguments -- + +Warning: image_type_to_mime_type() expects exactly 1 parameter, 0 given in %simage_type_to_mime_type_error.php on line 13 +NULL + +-- Testing image_type_to_mime_type() function with more than expected no. of arguments -- + +Warning: image_type_to_mime_type() expects exactly 1 parameter, 2 given in %simage_type_to_mime_type_error.php on line 17 +NULL +===DONE===
\ No newline at end of file diff --git a/ext/standard/tests/image/image_type_to_mime_type_variation1.phpt b/ext/standard/tests/image/image_type_to_mime_type_variation1.phpt new file mode 100644 index 000000000..0023b7125 --- /dev/null +++ b/ext/standard/tests/image/image_type_to_mime_type_variation1.phpt @@ -0,0 +1,152 @@ +--TEST-- +Test image_type_to_mime_type() function : usage variations - Pass different data types as imagetype +--FILE-- +<?php +/* Prototype : string image_type_to_mime_type(int imagetype) + * Description: Get Mime-Type for image-type returned by getimagesize, exif_read_data, exif_thumbnail, exif_imagetype + * Source code: ext/standard/image.c + */ + +echo "*** Testing image_type_to_mime_type() : usage variations ***\n"; + +error_reporting(E_ALL ^ E_NOTICE); + +//get an unset variable +$unset_var = 10; +unset ($unset_var); + +class MyClass +{ + function __toString() { + return "MyClass"; + } +} + +//array of values to iterate over +$values = array( + + // float data + 100.5, + -100.5, + 100.1234567e10, + 100.7654321E-10, + .5, + + // array data + array(), + array('color' => 'red', 'item' => 'pen'), + + // null data + NULL, + null, + + // boolean data + true, + false, + TRUE, + FALSE, + + // empty data + "", + '', + + // string data + "string", + 'string', + + // object data + new MyClass(), + + // undefined data + @$undefined_var, + + // unset data + @$unset_var, +); + +// loop through each element of the array for imagetype +$iterator = 1; +foreach($values as $value) { + echo "\n-- Iteration $iterator --\n"; + var_dump( image_type_to_mime_type($value) ); + $iterator++; +}; +?> +===DONE=== +--EXPECTF-- +*** Testing image_type_to_mime_type() : usage variations *** + +-- Iteration 1 -- +string(24) "application/octet-stream" + +-- Iteration 2 -- +string(24) "application/octet-stream" + +-- Iteration 3 -- +string(24) "application/octet-stream" + +-- Iteration 4 -- +string(24) "application/octet-stream" + +-- Iteration 5 -- +string(24) "application/octet-stream" + +-- Iteration 6 -- + +Warning: image_type_to_mime_type() expects parameter 1 to be long, array given in %s on line %d +NULL + +-- Iteration 7 -- + +Warning: image_type_to_mime_type() expects parameter 1 to be long, array given in %s on line %d +NULL + +-- Iteration 8 -- +string(24) "application/octet-stream" + +-- Iteration 9 -- +string(24) "application/octet-stream" + +-- Iteration 10 -- +string(9) "image/gif" + +-- Iteration 11 -- +string(24) "application/octet-stream" + +-- Iteration 12 -- +string(9) "image/gif" + +-- Iteration 13 -- +string(24) "application/octet-stream" + +-- Iteration 14 -- + +Warning: image_type_to_mime_type() expects parameter 1 to be long, string given in %s on line %d +NULL + +-- Iteration 15 -- + +Warning: image_type_to_mime_type() expects parameter 1 to be long, string given in %s on line %d +NULL + +-- Iteration 16 -- + +Warning: image_type_to_mime_type() expects parameter 1 to be long, string given in %s on line %d +NULL + +-- Iteration 17 -- + +Warning: image_type_to_mime_type() expects parameter 1 to be long, string given in %s on line %d +NULL + +-- Iteration 18 -- + +Warning: image_type_to_mime_type() expects parameter 1 to be long, object given in %s on line %d +NULL + +-- Iteration 19 -- +string(24) "application/octet-stream" + +-- Iteration 20 -- +string(24) "application/octet-stream" +===DONE===
\ No newline at end of file diff --git a/ext/standard/tests/image/image_type_to_mime_type_variation2.phpt b/ext/standard/tests/image/image_type_to_mime_type_variation2.phpt new file mode 100644 index 000000000..141bc576f --- /dev/null +++ b/ext/standard/tests/image/image_type_to_mime_type_variation2.phpt @@ -0,0 +1,80 @@ +--TEST-- +Test image_type_to_mime_type() function : usage variations - Pass decimal, octal, and hexadecimal values as imagetype +--FILE-- +<?php +/* Prototype : string image_type_to_mime_type(int imagetype) + * Description: Get Mime-Type for image-type returned by getimagesize, exif_read_data, exif_thumbnail, exif_imagetype + * Source code: ext/standard/image.c + */ + +echo "*** Testing image_type_to_mime_type() : usage variations ***\n"; + +error_reporting(E_ALL ^ E_NOTICE); +$values = array ( + //Decimal values + 0, + 1, + 12345, + -12345, + + //Octal values + 02, + 010, + 030071, + -030071, + + //Hexadecimal values + 0x0, + 0x1, + 0xABCD, + -0xABCD +); + +// loop through each element of the array for imagetype +$iterator = 1; +foreach($values as $value) { + echo "\n-- Iteration $iterator --\n"; + var_dump( image_type_to_mime_type($value) ); + $iterator++; +}; +?> +===DONE=== +--EXPECT-- +*** Testing image_type_to_mime_type() : usage variations *** + +-- Iteration 1 -- +string(24) "application/octet-stream" + +-- Iteration 2 -- +string(9) "image/gif" + +-- Iteration 3 -- +string(24) "application/octet-stream" + +-- Iteration 4 -- +string(24) "application/octet-stream" + +-- Iteration 5 -- +string(10) "image/jpeg" + +-- Iteration 6 -- +string(10) "image/tiff" + +-- Iteration 7 -- +string(24) "application/octet-stream" + +-- Iteration 8 -- +string(24) "application/octet-stream" + +-- Iteration 9 -- +string(24) "application/octet-stream" + +-- Iteration 10 -- +string(9) "image/gif" + +-- Iteration 11 -- +string(24) "application/octet-stream" + +-- Iteration 12 -- +string(24) "application/octet-stream" +===DONE=== diff --git a/ext/standard/tests/image/image_type_to_mime_type_variation4.phpt b/ext/standard/tests/image/image_type_to_mime_type_variation4.phpt new file mode 100644 index 000000000..a67bb86a6 --- /dev/null +++ b/ext/standard/tests/image/image_type_to_mime_type_variation4.phpt @@ -0,0 +1,29 @@ +--TEST-- +Test image_type_to_mime_type() function : usage variations - Passing IMAGETYPE_ICO and IMAGETYPE_SWC +--SKIPIF-- +<?php + if (!defined("IMAGETYPE_SWC") || !defined("IMAGETYPE_ICO") || !extension_loaded('zlib')) { + die("skip zlib extension is not available or IMAGETYPE_SWC/IMAGETYPE_ICO is not defined "); + } +?> +--FILE-- +<?php +/* Prototype : string image_type_to_mime_type(int imagetype) + * Description: Get Mime-Type for image-type returned by getimagesize, exif_read_data, exif_thumbnail, exif_imagetype + * Source code: ext/standard/image.c + */ + + +echo "*** Testing image_type_to_mime_type() : usage variations ***\n"; + +error_reporting(E_ALL ^ E_NOTICE); + +var_dump( image_type_to_mime_type(IMAGETYPE_ICO) ); +var_dump( image_type_to_mime_type(IMAGETYPE_SWC) ); +?> +===DONE=== +--EXPECT-- +*** Testing image_type_to_mime_type() : usage variations *** +string(24) "image/vnd.microsoft.icon" +string(29) "application/x-shockwave-flash" +===DONE=== diff --git a/ext/standard/tests/misc/time_sleep_until_basic.phpt b/ext/standard/tests/misc/time_sleep_until_basic.phpt index 956985a62..9ae912881 100644 --- a/ext/standard/tests/misc/time_sleep_until_basic.phpt +++ b/ext/standard/tests/misc/time_sleep_until_basic.phpt @@ -1,16 +1,20 @@ --TEST-- time_sleep_until() function - basic test for time_sleep_until() --SKIPIF-- -<?php if (!function_exists("time_sleep_until")) die('skip time_sleep_until() not available');?> +<?php +if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); +if (!function_exists("time_sleep_until")) die('skip time_sleep_until() not available'); +?> --CREDITS-- Manuel Baldassarri mb@ideato.it Michele Orselli mo@ideato.it #PHPTestFest Cesena Italia on 2009-06-20 --FILE-- <?php - $time = time() + 2; - time_sleep_until( $time ); - var_dump( time() >= $time ); + $time = microtime(true) + 2; + var_dump(time_sleep_until( (int)$time )); + var_dump(microtime(true) >= (int)$time); ?> --EXPECT-- bool(true) +bool(true) diff --git a/ext/standard/tests/network/bug41347.phpt b/ext/standard/tests/network/bug41347.phpt index 21fc002fa..6ece09819 100644 --- a/ext/standard/tests/network/bug41347.phpt +++ b/ext/standard/tests/network/bug41347.phpt @@ -1,11 +1,5 @@ --TEST-- dns_check_record() segfault with empty host ---SKIPIF-- -<?php -if (substr(PHP_OS, 0, 3) == 'WIN') { - die('skip No windows support'); -} -?> --FILE-- <?php var_dump(dns_check_record('')); diff --git a/ext/standard/tests/network/gethostbyaddr_basic1.phpt b/ext/standard/tests/network/gethostbyaddr_basic1.phpt index 2232d3626..a20b4756c 100644 --- a/ext/standard/tests/network/gethostbyaddr_basic1.phpt +++ b/ext/standard/tests/network/gethostbyaddr_basic1.phpt @@ -14,5 +14,5 @@ echo gethostbyaddr("127.0.0.1")."\n"; ===DONE=== --EXPECTF-- *** Testing gethostbyaddr() : basic functionality *** -%rloopback|localhost(\.localdomain)?%r -===DONE===
\ No newline at end of file +%rloopback|localhost(\.localdomain)?|%s%r +===DONE=== diff --git a/ext/standard/tests/network/gethostbyname_basic001.phpt b/ext/standard/tests/network/gethostbyname_basic001.phpt index 0cfc1b4f5..e917b5992 100644 --- a/ext/standard/tests/network/gethostbyname_basic001.phpt +++ b/ext/standard/tests/network/gethostbyname_basic001.phpt @@ -2,6 +2,10 @@ gethostbyname() function - basic type return test --CREDITS-- "Sylvain R." <sracine@phpquebec.org> +--SKIPIF-- +<?php +if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); +?> --FILE-- <?php var_dump(is_string(gethostbyname("www.php.net"))); diff --git a/ext/standard/tests/network/gethostbyname_basic002.phpt b/ext/standard/tests/network/gethostbyname_basic002.phpt index b4e191bfc..983faa929 100644 --- a/ext/standard/tests/network/gethostbyname_basic002.phpt +++ b/ext/standard/tests/network/gethostbyname_basic002.phpt @@ -2,6 +2,10 @@ gethostbyname() function - basic invalid parameter test --CREDITS-- "Sylvain R." <sracine@phpquebec.org> +--SKIPIF-- +<?php +if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); +?> --FILE-- <?php $ip = gethostbyname("www.php.net"); diff --git a/ext/standard/tests/network/gethostbyname_error004.phpt b/ext/standard/tests/network/gethostbyname_error004.phpt index 1d0f7d7a1..7aac17292 100644 --- a/ext/standard/tests/network/gethostbyname_error004.phpt +++ b/ext/standard/tests/network/gethostbyname_error004.phpt @@ -2,6 +2,10 @@ gethostbyname() function - basic return valid ip address test --CREDITS-- "Sylvain R." <sracine@phpquebec.org> +--SKIPIF-- +<?php +if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); +?> --FILE-- <?php $ip = gethostbyname("www.php.net"); diff --git a/ext/standard/tests/network/getmxrr.phpt b/ext/standard/tests/network/getmxrr.phpt index b6753f0d6..29cea1d71 100644 --- a/ext/standard/tests/network/getmxrr.phpt +++ b/ext/standard/tests/network/getmxrr.phpt @@ -2,13 +2,14 @@ getmxrr() test --SKIPIF-- <?php +if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); if (substr(PHP_OS, 0, 3) == 'WIN') { die('skip: no Windows support'); } ?> --FILE-- <?php -$domains = array( 'php.net', 'lists.php.net' ); +$domains = array( 'mx1.tests.php.net', 'mx2.tests.php.net' ); foreach ( $domains as $domain ) { if ( getmxrr( $domain, $hosts, $weights ) ) @@ -18,5 +19,5 @@ foreach ( $domains as $domain ) } ?> --EXPECT-- -Hosts: 2, weights: 2 Hosts: 1, weights: 1 +Hosts: 2, weights: 2 diff --git a/ext/standard/tests/network/http-stream.phpt b/ext/standard/tests/network/http-stream.phpt index e70caf982..6ee035a24 100644 --- a/ext/standard/tests/network/http-stream.phpt +++ b/ext/standard/tests/network/http-stream.phpt @@ -1,7 +1,10 @@ --TEST-- http-stream test --SKIPIF-- -<?php if (!extension_loaded("dom")) die("skip dom extension is not present"); ?> +<?php +if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); +if (!extension_loaded("dom")) die("skip dom extension is not present"); +?> --INI-- allow_url_fopen=1 --FILE-- diff --git a/ext/standard/tests/network/ip2long_variation1.phpt b/ext/standard/tests/network/ip2long_variation1.phpt index ac3c9c81e..ca67aa41a 100644 --- a/ext/standard/tests/network/ip2long_variation1.phpt +++ b/ext/standard/tests/network/ip2long_variation1.phpt @@ -1,5 +1,10 @@ --TEST-- Test ip2long() function : usage variation +--SKIPIF-- +<?php +if(substr(PHP_OS, 0, 3) == "WIN") + die("skip. Windows is more compliant (like 0 for localhost, etc.)"); +?> --FILE-- <?php /* Prototype : int ip2long(string ip_address) diff --git a/ext/standard/tests/php_ini_loaded_file.phpt b/ext/standard/tests/php_ini_loaded_file.phpt index 7958eb127..747e0196f 100644 --- a/ext/standard/tests/php_ini_loaded_file.phpt +++ b/ext/standard/tests/php_ini_loaded_file.phpt @@ -11,4 +11,4 @@ precision=12 var_dump(php_ini_loaded_file()); ?> --EXPECTF-- -string(%d) "%s/tmp-php.ini" +string(%d) "%sphp.ini" diff --git a/ext/standard/tests/serialize/bug55798.phpt b/ext/standard/tests/serialize/bug55798.phpt new file mode 100644 index 000000000..df8443b1f --- /dev/null +++ b/ext/standard/tests/serialize/bug55798.phpt @@ -0,0 +1,18 @@ +--TEST-- +Bug #55798 (serialize followed by unserialize with numeric object prop. gives integer prop) +--FILE-- +<?php + +$a = new stdClass(); +$a->{0} = 'X'; +$a->{1} = 'Y'; +var_dump(serialize($a)); +var_dump($a->{0}); +$b = unserialize(serialize($a)); +var_dump(serialize($b)); +var_dump($b->{0}); +--EXPECT-- +string(51) "O:8:"stdClass":2:{s:1:"0";s:1:"X";s:1:"1";s:1:"Y";}" +string(1) "X" +string(51) "O:8:"stdClass":2:{s:1:"0";s:1:"X";s:1:"1";s:1:"Y";}" +string(1) "X" diff --git a/ext/standard/tests/serialize/serialization_miscTypes_001.phpt b/ext/standard/tests/serialize/serialization_miscTypes_001.phpt Binary files differindex 038068249..8b974d475 100644 --- a/ext/standard/tests/serialize/serialization_miscTypes_001.phpt +++ b/ext/standard/tests/serialize/serialization_miscTypes_001.phpt diff --git a/ext/standard/tests/streams/bug46024.phpt b/ext/standard/tests/streams/bug46024.phpt index 3f2a5f836..fdfd03ee2 100644 --- a/ext/standard/tests/streams/bug46024.phpt +++ b/ext/standard/tests/streams/bug46024.phpt @@ -4,7 +4,7 @@ Bug #46024 stream_select() doesn't return the correct number <?php if (!getenv('TEST_PHP_EXECUTABLE')) die("skip TEST_PHP_EXECUTABLE not defined"); ?> --FILE-- <?php -$php = getenv('TEST_PHP_EXECUTABLE'); +$php = realpath(getenv('TEST_PHP_EXECUTABLE')); $pipes = array(); $proc = proc_open( "$php -n -i" diff --git a/ext/standard/tests/streams/bug54946.phpt b/ext/standard/tests/streams/bug54946.phpt index b3fa73df5..b51d593a9 100644 --- a/ext/standard/tests/streams/bug54946.phpt +++ b/ext/standard/tests/streams/bug54946.phpt @@ -2,33 +2,32 @@ Bug#54946 stream_get_contents infinite loop --FILE-- <?php -$filename = tempnam(sys_get_temp_dir(), "phpbug"); - +$filename = tempnam(__DIR__, "phpbug"); $stream = fopen($filename, "w"); // w or a $retval = stream_get_contents($stream, 1, 1); - +fclose($stream); var_dump($retval); unlink($filename); -$filename = tempnam(sys_get_temp_dir(), "phpbug2"); +$filename = tempnam(__DIR__, "phpbug2"); $stream = fopen($filename, "a"); $retval = stream_get_contents($stream, 1, 1); - var_dump($retval); +fclose($stream); unlink($filename); -$filename = tempnam(sys_get_temp_dir(), "phpbug3"); +$filename = tempnam(__DIR__, "phpbug3"); $stream = fopen($filename, "a"); fseek($stream, 1); $retval = stream_get_contents($stream, 1); - var_dump($retval); +fclose($stream); unlink($filename); ?> ===DONE=== diff --git a/ext/standard/tests/streams/bug60455_01.phpt b/ext/standard/tests/streams/bug60455_01.phpt new file mode 100644 index 000000000..466998201 --- /dev/null +++ b/ext/standard/tests/streams/bug60455_01.phpt @@ -0,0 +1,21 @@ +--TEST-- +Bug #60455: stream_get_line and 1-line noeol input +--FILE-- +<?php + +//It's critical the read on the stream returns the input but doesn't set EOF +//flag the first time. This is why we need to use sockets. + +$domain = (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN' ? STREAM_PF_INET : STREAM_PF_UNIX); +$sockets = stream_socket_pair($domain, STREAM_SOCK_STREAM, STREAM_IPPROTO_IP) + or die("stream_socket_pair"); +fwrite($sockets[0], "a"); +stream_socket_shutdown($sockets[0], STREAM_SHUT_RDWR); + +$f = $sockets[1]; +while (!feof($f)) { + $line = stream_get_line($f, 99, "\n"); + var_dump($line); +} +--EXPECT-- +string(1) "a" diff --git a/ext/standard/tests/streams/bug60455_02.phpt b/ext/standard/tests/streams/bug60455_02.phpt new file mode 100644 index 000000000..6e06e9fa3 --- /dev/null +++ b/ext/standard/tests/streams/bug60455_02.phpt @@ -0,0 +1,30 @@ +--TEST-- +Bug #60455: stream_get_line and 1-line followed by eol input +--FILE-- +<?php +class TestStream { + private $s = 0; + function stream_open($path, $mode, $options, &$opened_path) { + return true; + } + function stream_read($count) { + if ($this->s++ == 0) + return "a\n"; + + return ""; + } + function stream_eof() { + return $this->s >= 2; + } + +} + +stream_wrapper_register("test", "TestStream"); + +$f = fopen("test://", "r"); +while (!feof($f)) { + $line = stream_get_line($f, 99, "\n"); + var_dump($line); +} +--EXPECT-- +string(1) "a" diff --git a/ext/standard/tests/streams/bug60455_03.phpt b/ext/standard/tests/streams/bug60455_03.phpt new file mode 100644 index 000000000..5d7ba1f24 --- /dev/null +++ b/ext/standard/tests/streams/bug60455_03.phpt @@ -0,0 +1,53 @@ +--TEST-- +Bug #60455: stream_get_line and 2 lines, one possibly empty +--FILE-- +<?php +class TestStream { + private $lines = array(); + private $s = 0; + private $eofth = 3; + function stream_open($path, $mode, $options, &$opened_path) { + $this->lines[] = "a\n"; + $this->lines[] = ($path == "test://nonempty2nd" ? "b\n" : "\n"); + if ($path == "test://eofafter2nd") + $this->eofth = 2; + return true; + } + function stream_read($count) { + if (key_exists($this->s++, $this->lines)) + return $this->lines[$this->s - 1]; + + return ""; + } + function stream_eof() { + return $this->s >= $this->eofth; + } + +} + +stream_wrapper_register("test", "TestStream"); + +$f = fopen("test://nonempty2nd", "r"); +while (!feof($f)) { + $line = stream_get_line($f, 99, "\n"); + var_dump($line); +} +$f = fopen("test://", "r"); +while (!feof($f)) { + $line = stream_get_line($f, 99, "\n"); + var_dump($line); +} +$f = fopen("test://eofafter2nd", "r"); +while (!feof($f)) { + $line = stream_get_line($f, 99, "\n"); + var_dump($line); +} + + +--EXPECT-- +string(1) "a" +string(1) "b" +string(1) "a" +string(0) "" +string(1) "a" +string(0) "" diff --git a/ext/standard/tests/streams/stream_context_set_option_basic.phpt b/ext/standard/tests/streams/stream_context_set_option_basic.phpt new file mode 100644 index 000000000..63730ee99 --- /dev/null +++ b/ext/standard/tests/streams/stream_context_set_option_basic.phpt @@ -0,0 +1,37 @@ +--TEST-- +stream_context_set_option() function - basic test for stream_context_set_option() +--CREDITS-- +Jean-Marc Fontaine <jean-marc.fontaine@alterway.fr> +# Alter Way Contribution Day 2011 +--FILE-- +<?php +$context = stream_context_create(); + +// Single option +var_dump(stream_context_set_option($context, 'http', 'method', 'POST')); + +// Array of options +$options = array( + 'http' => array( + 'protocol_version' => 1.1, + 'user_agent' => 'PHPT Agent', + ), +); +var_dump(stream_context_set_option($context, $options)); + +var_dump(stream_context_get_options($context)); +?> +--EXPECT-- +bool(true) +bool(true) +array(1) { + ["http"]=> + array(3) { + ["method"]=> + string(4) "POST" + ["protocol_version"]=> + float(1.1) + ["user_agent"]=> + string(10) "PHPT Agent" + } +} diff --git a/ext/standard/tests/streams/stream_context_set_option_error_001.phpt b/ext/standard/tests/streams/stream_context_set_option_error_001.phpt new file mode 100644 index 000000000..04b37ca11 --- /dev/null +++ b/ext/standard/tests/streams/stream_context_set_option_error_001.phpt @@ -0,0 +1,21 @@ +--TEST-- +stream_context_set_option() function - error : invalid argument +--CREDITS-- +Jean-Marc Fontaine <jean-marc.fontaine@alterway.fr> +# Alter Way Contribution Day 2011 +--FILE-- +<?php +$context = stream_context_create(); + +// Single option +var_dump(stream_context_set_option($context, 'http')); + +// Array of options +var_dump(stream_context_set_option($context, array(), 'foo', 'bar')); +?> +--EXPECTF-- +Warning: stream_context_set_option(): called with wrong number or type of parameters; please RTM in %s on line %d +bool(false) + +Warning: stream_context_set_option(): called with wrong number or type of parameters; please RTM in %s on line %d +bool(false) diff --git a/ext/standard/tests/streams/stream_context_set_option_error_002.phpt b/ext/standard/tests/streams/stream_context_set_option_error_002.phpt new file mode 100644 index 000000000..e80fd39ed --- /dev/null +++ b/ext/standard/tests/streams/stream_context_set_option_error_002.phpt @@ -0,0 +1,18 @@ +--TEST-- +stream_context_set_option() function - error : missing argument +--CREDITS-- +Jean-Marc Fontaine <jean-marc.fontaine@alterway.fr> +# Alter Way Contribution Day 2011 +--FILE-- +<?php +var_dump(stream_context_set_option()); + +$context = stream_context_create(); +var_dump(stream_context_set_option($context)); +?> +--EXPECTF-- +Warning: stream_context_set_option(): called with wrong number or type of parameters; please RTM in %s on line %d +bool(false) + +Warning: stream_context_set_option(): called with wrong number or type of parameters; please RTM in %s on line %d +bool(false) diff --git a/ext/standard/tests/strings/bug55674.phpt b/ext/standard/tests/strings/bug55674.phpt new file mode 100644 index 000000000..72ece642a --- /dev/null +++ b/ext/standard/tests/strings/bug55674.phpt @@ -0,0 +1,50 @@ +--TEST-- +Bug #55674 (fgetcsv & str_getcsv skip empty fields in some tab-separated records) +--FILE-- +<?php +var_dump(str_getcsv("0\t\t\"2\"\n", "\t")); +var_dump(str_getcsv("0\t \t'2'\n", "\t", "'")); +var_dump(str_getcsv(",,,,")); +var_dump(str_getcsv(" \t \t\t\t ", "\t")); +?> +--EXPECT-- +array(3) { + [0]=> + string(1) "0" + [1]=> + string(0) "" + [2]=> + string(1) "2" +} +array(3) { + [0]=> + string(1) "0" + [1]=> + string(1) " " + [2]=> + string(1) "2" +} +array(5) { + [0]=> + string(0) "" + [1]=> + string(0) "" + [2]=> + string(0) "" + [3]=> + string(0) "" + [4]=> + string(0) "" +} +array(5) { + [0]=> + string(1) " " + [1]=> + string(2) " " + [2]=> + string(0) "" + [3]=> + string(0) "" + [4]=> + string(1) " " +} diff --git a/ext/standard/tests/strings/htmlentities_html4.phpt b/ext/standard/tests/strings/htmlentities_html4.phpt index d7bff707f..22b0305ce 100644 --- a/ext/standard/tests/strings/htmlentities_html4.phpt +++ b/ext/standard/tests/strings/htmlentities_html4.phpt @@ -1,9 +1,5 @@ --TEST-- htmlentities() conformance check (HTML 4) ---SKIPIF-- -<?php -if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); -?> --FILE-- <?php function utf32_utf8($k) { @@ -43,15 +39,23 @@ function utf32_utf8($k) { return $retval; } -for ($i = 0; $i < 0x110000; $i++) { +$table = get_html_translation_table(HTML_ENTITIES, ENT_QUOTES, 'UTF-8'); + +for ($i = 0; $i < 0x2710; $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); - } + if (isset($table[$str])) { + printf("%s\tU+%05X\n", $table[$str], $i); + unset($table[$str]); + } } + +if (!empty($table)) { + echo "Not matched entities: "; + var_dump($table); +} + ?> --EXPECT-- " U+00022 diff --git a/ext/standard/tests/strings/md5_file.phpt b/ext/standard/tests/strings/md5_file.phpt Binary files differindex 879cd59aa..e5d015cdd 100644 --- a/ext/standard/tests/strings/md5_file.phpt +++ b/ext/standard/tests/strings/md5_file.phpt diff --git a/ext/standard/tests/strings/sha1_file.phpt b/ext/standard/tests/strings/sha1_file.phpt index 3013adc34..574d384c2 100644 --- a/ext/standard/tests/strings/sha1_file.phpt +++ b/ext/standard/tests/strings/sha1_file.phpt @@ -1,17 +1,5 @@ --TEST-- Test sha1_file() function with ASCII output and raw binary output. Based on ext/standard/tests/strings/md5_file.phpt ---SKIPIF-- -<?php - -$path = dirname(__FILE__); -$data_file = "$path/EmptyFile.txt"; -$data_file1 = "$path/DataFile.txt"; -if !(($fp = fopen($data_file, 'w')) || ($fp1 = fopen($data_file1, 'w')) { - echo "File could not be created ,hence exiting from testcase due to pre-requisite failure\n"; -} -fclose( $fp ); -fclose( $fp1 ); - --FILE-- <?php diff --git a/ext/standard/tests/strings/substr_replace_array.phpt b/ext/standard/tests/strings/substr_replace_array.phpt new file mode 100644 index 000000000..dbb8b1714 --- /dev/null +++ b/ext/standard/tests/strings/substr_replace_array.phpt @@ -0,0 +1,19 @@ +--TEST-- +substr_replace() function - array +--FILE-- +<?php + +$arr = array('abc' => 'llsskdkk','def' => 'llsskjkkdd', 4 => 'hello', 42 => 'world'); +$newarr = substr_replace($arr, 'zzz', 0, -2); + +print_r($newarr); + +?> +--EXPECTF-- +Array +( + [abc] => zzzkk + [def] => zzzdd + [4] => zzzlo + [42] => zzzld +) diff --git a/ext/standard/tests/url/bug55273.phpt b/ext/standard/tests/url/bug55273.phpt new file mode 100644 index 000000000..1408506b4 --- /dev/null +++ b/ext/standard/tests/url/bug55273.phpt @@ -0,0 +1,25 @@ +--TEST-- +Bug #55273 (base64_decode() with strict rejects whitespace after pad) +--FILE-- +<?php +function test($s) { + $v = chunk_split(base64_encode($s)); + $r = base64_decode($v, True); + var_dump($v, $r); +} + +test('PHP'); +test('PH'); +test('P'); + +?> +--EXPECT-- +string(6) "UEhQ +" +string(3) "PHP" +string(6) "UEg= +" +string(2) "PH" +string(6) "UA== +" +string(1) "P" diff --git a/ext/standard/type.c b/ext/standard/type.c index 9f28c2874..e49711969 100644 --- a/ext/standard/type.c +++ b/ext/standard/type.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: type.c 321634 2012-01-01 13:15:04Z felipe $ */ #include "php.h" #include "php_incomplete_class.h" diff --git a/ext/standard/uniqid.c b/ext/standard/uniqid.c index 5c969fb48..7aafd7d22 100644 --- a/ext/standard/uniqid.c +++ b/ext/standard/uniqid.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: uniqid.c 321634 2012-01-01 13:15:04Z felipe $ */ #include "php.h" diff --git a/ext/standard/uniqid.h b/ext/standard/uniqid.h index e78308392..a218efa9b 100644 --- a/ext/standard/uniqid.h +++ b/ext/standard/uniqid.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: uniqid.h 321634 2012-01-01 13:15:04Z felipe $ */ #ifndef UNIQID_H #define UNIQID_H diff --git a/ext/standard/url.c b/ext/standard/url.c index 22a8471be..365415e08 100644 --- a/ext/standard/url.c +++ b/ext/standard/url.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 314783 2011-08-11 13:01:52Z iliaa $ */ +/* $Id: url.c 321634 2012-01-01 13:15:04Z felipe $ */ #include <stdlib.h> #include <string.h> diff --git a/ext/standard/url.h b/ext/standard/url.h index 9a2bcfaaa..66b3ad893 100644 --- a/ext/standard/url.h +++ b/ext/standard/url.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 307432 2011-01-13 07:27:46Z stas $ */ +/* $Id: url.h 321634 2012-01-01 13:15:04Z felipe $ */ #ifndef URL_H #define URL_H diff --git a/ext/standard/url_scanner_ex.c.orig b/ext/standard/url_scanner_ex.c.orig deleted file mode 100644 index 1ffa3698f..000000000 --- a/ext/standard/url_scanner_ex.c.orig +++ /dev/null @@ -1,1109 +0,0 @@ -/* Generated by re2c 0.13.5 on Fri Dec 31 23:52:51 2010 */ -#line 1 "ext/standard/url_scanner_ex.re" -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2006 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 | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Sascha Schumann <sascha@schumann.cx> | - +----------------------------------------------------------------------+ -*/ - -/* $Id: url_scanner_ex.c 313832 2011-07-28 10:52:45Z pajoye $ */ - -#include "php.h" - -#ifdef HAVE_UNISTD_H -#include <unistd.h> -#endif -#ifdef HAVE_LIMITS_H -#include <limits.h> -#endif - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -#include "php_ini.h" -#include "php_globals.h" -#define STATE_TAG SOME_OTHER_STATE_TAG -#include "basic_functions.h" -#include "url.h" -#undef STATE_TAG - -#define url_scanner url_scanner_ex - -#include "php_smart_str.h" - -static PHP_INI_MH(OnUpdateTags) -{ - url_adapt_state_ex_t *ctx; - char *key; - char *lasts; - char *tmp; - - ctx = &BG(url_adapt_state_ex); - - tmp = estrndup(new_value, new_value_length); - - if (ctx->tags) - zend_hash_destroy(ctx->tags); - else { - ctx->tags = malloc(sizeof(HashTable)); - if (!ctx->tags) { - return FAILURE; - } - } - zend_hash_init(ctx->tags, 0, NULL, NULL, 1); - - for (key = php_strtok_r(tmp, ",", &lasts); - key; - key = php_strtok_r(NULL, ",", &lasts)) { - char *val; - - val = strchr(key, '='); - if (val) { - char *q; - int keylen; - - *val++ = '\0'; - for (q = key; *q; q++) - *q = tolower(*q); - keylen = q - key; - /* key is stored withOUT NUL - val is stored WITH NUL */ - zend_hash_add(ctx->tags, key, keylen, val, strlen(val)+1, NULL); - } - } - - efree(tmp); - - return SUCCESS; -} - -PHP_INI_BEGIN() - STD_PHP_INI_ENTRY("url_rewriter.tags", "a=href,area=href,frame=src,form=,fieldset=", PHP_INI_ALL, OnUpdateTags, url_adapt_state_ex, php_basic_globals, basic_globals) -PHP_INI_END() - -#line 98 "ext/standard/url_scanner_ex.re" - - -#define YYFILL(n) goto done -#define YYCTYPE unsigned char -#define YYCURSOR p -#define YYLIMIT q -#define YYMARKER r - -static inline void append_modified_url(smart_str *url, smart_str *dest, smart_str *url_app, const char *separator) -{ - register const char *p, *q; - const char *bash = NULL; - const char *sep = "?"; - - q = (p = url->c) + url->len; - -scan: - -#line 114 "ext/standard/url_scanner_ex.c" -{ - YYCTYPE yych; - static const unsigned char yybm[] = { - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 0, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 0, 128, 128, 128, 128, 0, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - }; - - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if (yybm[0+yych] & 128) { - goto yy8; - } - if (yych <= '9') goto yy6; - if (yych >= ';') goto yy4; - ++YYCURSOR; -#line 116 "ext/standard/url_scanner_ex.re" - { smart_str_append(dest, url); return; } -#line 162 "ext/standard/url_scanner_ex.c" -yy4: - ++YYCURSOR; -#line 117 "ext/standard/url_scanner_ex.re" - { sep = separator; goto scan; } -#line 167 "ext/standard/url_scanner_ex.c" -yy6: - ++YYCURSOR; -#line 118 "ext/standard/url_scanner_ex.re" - { bash = p - 1; goto done; } -#line 172 "ext/standard/url_scanner_ex.c" -yy8: - ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if (yybm[0+yych] & 128) { - goto yy8; - } -#line 119 "ext/standard/url_scanner_ex.re" - { goto scan; } -#line 182 "ext/standard/url_scanner_ex.c" -} -#line 120 "ext/standard/url_scanner_ex.re" - -done: - - /* Don't modify URLs of the format "#mark" */ - if (bash && bash - url->c == 0) { - smart_str_append(dest, url); - return; - } - - if (bash) - smart_str_appendl(dest, url->c, bash - url->c); - else - smart_str_append(dest, url); - - smart_str_appends(dest, sep); - smart_str_append(dest, url_app); - - if (bash) - smart_str_appendl(dest, bash, q - bash); -} - - -#undef YYFILL -#undef YYCTYPE -#undef YYCURSOR -#undef YYLIMIT -#undef YYMARKER - -static inline void tag_arg(url_adapt_state_ex_t *ctx, char quotes, char type TSRMLS_DC) -{ - char f = 0; - - if (strncasecmp(ctx->arg.c, ctx->lookup_data, ctx->arg.len) == 0) - f = 1; - - if (quotes) - smart_str_appendc(&ctx->result, type); - if (f) { - append_modified_url(&ctx->val, &ctx->result, &ctx->url_app, PG(arg_separator).output); - } else { - smart_str_append(&ctx->result, &ctx->val); - } - if (quotes) - smart_str_appendc(&ctx->result, type); -} - -enum { - STATE_PLAIN = 0, - STATE_TAG, - STATE_NEXT_ARG, - STATE_ARG, - STATE_BEFORE_VAL, - STATE_VAL -}; - -#define YYFILL(n) goto stop -#define YYCTYPE unsigned char -#define YYCURSOR xp -#define YYLIMIT end -#define YYMARKER q -#define STATE ctx->state - -#define STD_PARA url_adapt_state_ex_t *ctx, char *start, char *YYCURSOR TSRMLS_DC -#define STD_ARGS ctx, start, xp TSRMLS_CC - -#if SCANNER_DEBUG -#define scdebug(x) printf x -#else -#define scdebug(x) -#endif - -static inline void passthru(STD_PARA) -{ - scdebug(("appending %d chars, starting with %c\n", YYCURSOR-start, *start)); - smart_str_appendl(&ctx->result, start, YYCURSOR - start); -} - -/* - * This function appends a hidden input field after a <form> or - * <fieldset>. The latter is important for XHTML. - */ - -static void handle_form(STD_PARA) -{ - int doit = 0; - - if (ctx->form_app.len > 0) { - switch (ctx->tag.len) { - case sizeof("form") - 1: - if (!strncasecmp(ctx->tag.c, "form", sizeof("form") - 1)) { - doit = 1; - } - if (doit && ctx->val.c && ctx->lookup_data && *ctx->lookup_data) { - char *e, *p = zend_memnstr(ctx->val.c, "://", sizeof("://") - 1, ctx->val.c + ctx->val.len); - if (p) { - e = memchr(p, '/', (ctx->val.c + ctx->val.len) - p); - if (!e) { - e = ctx->val.c + ctx->val.len; - } - if ((e - p) && strncasecmp(p, ctx->lookup_data, (e - p))) { - doit = 0; - } - } - } - break; - - case sizeof("fieldset") - 1: - if (!strncasecmp(ctx->tag.c, "fieldset", sizeof("fieldset") - 1)) { - doit = 1; - } - break; - } - - if (doit) - smart_str_append(&ctx->result, &ctx->form_app); - } -} - -/* - * HANDLE_TAG copies the HTML Tag and checks whether we - * have that tag in our table. If we might modify it, - * we continue to scan the tag, otherwise we simply copy the complete - * HTML stuff to the result buffer. - */ - -static inline void handle_tag(STD_PARA) -{ - int ok = 0; - int i; - - ctx->tag.len = 0; - smart_str_appendl(&ctx->tag, start, YYCURSOR - start); - for (i = 0; i < ctx->tag.len; i++) - ctx->tag.c[i] = tolower((int)(unsigned char)ctx->tag.c[i]); - if (zend_hash_find(ctx->tags, ctx->tag.c, ctx->tag.len, (void **) &ctx->lookup_data) == SUCCESS) - ok = 1; - STATE = ok ? STATE_NEXT_ARG : STATE_PLAIN; -} - -static inline void handle_arg(STD_PARA) -{ - ctx->arg.len = 0; - smart_str_appendl(&ctx->arg, start, YYCURSOR - start); -} - -static inline void handle_val(STD_PARA, char quotes, char type) -{ - smart_str_setl(&ctx->val, start + quotes, YYCURSOR - start - quotes * 2); - tag_arg(ctx, quotes, type TSRMLS_CC); -} - -static inline void xx_mainloop(url_adapt_state_ex_t *ctx, const char *newdata, size_t newlen TSRMLS_DC) -{ - char *end, *q; - char *xp; - char *start; - int rest; - - smart_str_appendl(&ctx->buf, newdata, newlen); - - YYCURSOR = ctx->buf.c; - YYLIMIT = ctx->buf.c + ctx->buf.len; - - switch (STATE) { - case STATE_PLAIN: goto state_plain; - case STATE_TAG: goto state_tag; - case STATE_NEXT_ARG: goto state_next_arg; - case STATE_ARG: goto state_arg; - case STATE_BEFORE_VAL: goto state_before_val; - case STATE_VAL: goto state_val; - } - - -state_plain_begin: - STATE = STATE_PLAIN; - -state_plain: - start = YYCURSOR; - -#line 364 "ext/standard/url_scanner_ex.c" -{ - YYCTYPE yych; - static const unsigned char yybm[] = { - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 0, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - }; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if (yybm[0+yych] & 128) { - goto yy15; - } - ++YYCURSOR; -#line 299 "ext/standard/url_scanner_ex.re" - { passthru(STD_ARGS); STATE = STATE_TAG; goto state_tag; } -#line 409 "ext/standard/url_scanner_ex.c" -yy15: - ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if (yybm[0+yych] & 128) { - goto yy15; - } -#line 300 "ext/standard/url_scanner_ex.re" - { passthru(STD_ARGS); goto state_plain; } -#line 419 "ext/standard/url_scanner_ex.c" -} -#line 301 "ext/standard/url_scanner_ex.re" - - -state_tag: - start = YYCURSOR; - -#line 427 "ext/standard/url_scanner_ex.c" -{ - YYCTYPE yych; - static const unsigned char yybm[] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 128, 0, 0, 0, 0, 0, - 0, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 0, 0, 0, 0, 0, - 0, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - }; - if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); - yych = *YYCURSOR; - if (yych <= '@') { - if (yych != ':') goto yy22; - } else { - if (yych <= 'Z') goto yy20; - if (yych <= '`') goto yy22; - if (yych >= '{') goto yy22; - } -yy20: - ++YYCURSOR; - yych = *YYCURSOR; - goto yy25; -yy21: -#line 306 "ext/standard/url_scanner_ex.re" - { handle_tag(STD_ARGS); /* Sets STATE */; passthru(STD_ARGS); if (STATE == STATE_PLAIN) goto state_plain; else goto state_next_arg; } -#line 480 "ext/standard/url_scanner_ex.c" -yy22: - ++YYCURSOR; -#line 307 "ext/standard/url_scanner_ex.re" - { passthru(STD_ARGS); goto state_plain_begin; } -#line 485 "ext/standard/url_scanner_ex.c" -yy24: - ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; -yy25: - if (yybm[0+yych] & 128) { - goto yy24; - } - goto yy21; -} -#line 308 "ext/standard/url_scanner_ex.re" - - -state_next_arg_begin: - STATE = STATE_NEXT_ARG; - -state_next_arg: - start = YYCURSOR; - -#line 505 "ext/standard/url_scanner_ex.c" -{ - YYCTYPE yych; - static const unsigned char yybm[] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 128, 128, 128, 0, 128, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 128, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - }; - if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); - yych = *YYCURSOR; - if (yych <= ' ') { - if (yych <= '\f') { - if (yych <= 0x08) goto yy34; - if (yych <= '\v') goto yy30; - goto yy34; - } else { - if (yych <= '\r') goto yy30; - if (yych <= 0x1F) goto yy34; - goto yy30; - } - } else { - if (yych <= '@') { - if (yych != '>') goto yy34; - } else { - if (yych <= 'Z') goto yy32; - if (yych <= '`') goto yy34; - if (yych <= 'z') goto yy32; - goto yy34; - } - } - ++YYCURSOR; -#line 316 "ext/standard/url_scanner_ex.re" - { passthru(STD_ARGS); handle_form(STD_ARGS); goto state_plain_begin; } -#line 567 "ext/standard/url_scanner_ex.c" -yy30: - ++YYCURSOR; - yych = *YYCURSOR; - goto yy37; -yy31: -#line 317 "ext/standard/url_scanner_ex.re" - { passthru(STD_ARGS); goto state_next_arg; } -#line 575 "ext/standard/url_scanner_ex.c" -yy32: - ++YYCURSOR; -#line 318 "ext/standard/url_scanner_ex.re" - { --YYCURSOR; STATE = STATE_ARG; goto state_arg; } -#line 580 "ext/standard/url_scanner_ex.c" -yy34: - ++YYCURSOR; -#line 319 "ext/standard/url_scanner_ex.re" - { passthru(STD_ARGS); goto state_plain_begin; } -#line 585 "ext/standard/url_scanner_ex.c" -yy36: - ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; -yy37: - if (yybm[0+yych] & 128) { - goto yy36; - } - goto yy31; -} -#line 320 "ext/standard/url_scanner_ex.re" - - -state_arg: - start = YYCURSOR; - -#line 602 "ext/standard/url_scanner_ex.c" -{ - YYCTYPE yych; - static const unsigned char yybm[] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 128, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 0, 0, 0, 0, 0, - 0, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - }; - if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); - yych = *YYCURSOR; - if (yych <= '@') goto yy42; - if (yych <= 'Z') goto yy40; - if (yych <= '`') goto yy42; - if (yych >= '{') goto yy42; -yy40: - ++YYCURSOR; - yych = *YYCURSOR; - goto yy45; -yy41: -#line 325 "ext/standard/url_scanner_ex.re" - { passthru(STD_ARGS); handle_arg(STD_ARGS); STATE = STATE_BEFORE_VAL; goto state_before_val; } -#line 652 "ext/standard/url_scanner_ex.c" -yy42: - ++YYCURSOR; -#line 326 "ext/standard/url_scanner_ex.re" - { passthru(STD_ARGS); STATE = STATE_NEXT_ARG; goto state_next_arg; } -#line 657 "ext/standard/url_scanner_ex.c" -yy44: - ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; -yy45: - if (yybm[0+yych] & 128) { - goto yy44; - } - goto yy41; -} -#line 327 "ext/standard/url_scanner_ex.re" - - -state_before_val: - start = YYCURSOR; - -#line 674 "ext/standard/url_scanner_ex.c" -{ - YYCTYPE yych; - static const unsigned char yybm[] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 128, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - }; - if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); - yych = *YYCURSOR; - if (yych == ' ') goto yy48; - if (yych == '=') goto yy50; - goto yy52; -yy48: - yych = *(YYMARKER = ++YYCURSOR); - if (yych == ' ') goto yy55; - if (yych == '=') goto yy53; -yy49: -#line 333 "ext/standard/url_scanner_ex.re" - { --YYCURSOR; goto state_next_arg_begin; } -#line 723 "ext/standard/url_scanner_ex.c" -yy50: - ++YYCURSOR; - yych = *YYCURSOR; - goto yy54; -yy51: -#line 332 "ext/standard/url_scanner_ex.re" - { passthru(STD_ARGS); STATE = STATE_VAL; goto state_val; } -#line 731 "ext/standard/url_scanner_ex.c" -yy52: - yych = *++YYCURSOR; - goto yy49; -yy53: - ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; -yy54: - if (yybm[0+yych] & 128) { - goto yy53; - } - goto yy51; -yy55: - ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if (yych == ' ') goto yy55; - if (yych == '=') goto yy53; - YYCURSOR = YYMARKER; - goto yy49; -} -#line 334 "ext/standard/url_scanner_ex.re" - - - -state_val: - start = YYCURSOR; - -#line 760 "ext/standard/url_scanner_ex.c" -{ - YYCTYPE yych; - static const unsigned char yybm[] = { - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 160, 160, 248, 248, 160, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 160, 248, 56, 248, 248, 248, 248, 200, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 0, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - 248, 248, 248, 248, 248, 248, 248, 248, - }; - if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3); - yych = *YYCURSOR; - if (yych <= ' ') { - if (yych <= '\f') { - if (yych <= 0x08) goto yy63; - if (yych <= '\n') goto yy64; - goto yy63; - } else { - if (yych <= '\r') goto yy64; - if (yych <= 0x1F) goto yy63; - goto yy64; - } - } else { - if (yych <= '&') { - if (yych != '"') goto yy63; - } else { - if (yych <= '\'') goto yy62; - if (yych == '>') goto yy64; - goto yy63; - } - } - yych = *(YYMARKER = ++YYCURSOR); - goto yy77; -yy61: -#line 342 "ext/standard/url_scanner_ex.re" - { handle_val(STD_ARGS, 0, ' '); goto state_next_arg_begin; } -#line 823 "ext/standard/url_scanner_ex.c" -yy62: - yych = *(YYMARKER = ++YYCURSOR); - goto yy69; -yy63: - yych = *++YYCURSOR; - goto yy67; -yy64: - ++YYCURSOR; -#line 343 "ext/standard/url_scanner_ex.re" - { passthru(STD_ARGS); goto state_next_arg_begin; } -#line 834 "ext/standard/url_scanner_ex.c" -yy66: - ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; -yy67: - if (yybm[0+yych] & 8) { - goto yy66; - } - goto yy61; -yy68: - YYMARKER = ++YYCURSOR; - if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); - yych = *YYCURSOR; -yy69: - if (yybm[0+yych] & 16) { - goto yy68; - } - if (yych <= '&') goto yy72; - if (yych >= '(') goto yy61; - ++YYCURSOR; - if (yybm[0+(yych = *YYCURSOR)] & 8) { - goto yy66; - } -yy71: -#line 341 "ext/standard/url_scanner_ex.re" - { handle_val(STD_ARGS, 1, '\''); goto state_next_arg_begin; } -#line 861 "ext/standard/url_scanner_ex.c" -yy72: - ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if (yybm[0+yych] & 32) { - goto yy72; - } - if (yych <= '=') goto yy75; -yy74: - YYCURSOR = YYMARKER; - goto yy61; -yy75: - yych = *++YYCURSOR; - goto yy71; -yy76: - YYMARKER = ++YYCURSOR; - if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); - yych = *YYCURSOR; -yy77: - if (yybm[0+yych] & 64) { - goto yy76; - } - if (yych <= '!') goto yy80; - if (yych >= '#') goto yy61; - ++YYCURSOR; - if (yybm[0+(yych = *YYCURSOR)] & 8) { - goto yy66; - } -yy79: -#line 340 "ext/standard/url_scanner_ex.re" - { handle_val(STD_ARGS, 1, '"'); goto state_next_arg_begin; } -#line 893 "ext/standard/url_scanner_ex.c" -yy80: - ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if (yybm[0+yych] & 128) { - goto yy80; - } - if (yych >= '>') goto yy74; - ++YYCURSOR; - yych = *YYCURSOR; - goto yy79; -} -#line 344 "ext/standard/url_scanner_ex.re" - - -stop: - rest = YYLIMIT - start; - scdebug(("stopped in state %d at pos %d (%d:%c) %d\n", STATE, YYCURSOR - ctx->buf.c, *YYCURSOR, *YYCURSOR, rest)); - /* XXX: Crash avoidance. Need to work with reporter to figure out what goes wrong */ - if (rest < 0) rest = 0; - - if (rest) memmove(ctx->buf.c, start, rest); - ctx->buf.len = rest; -} - -char *php_url_scanner_adapt_single_url(const char *url, size_t urllen, const char *name, const char *value, size_t *newlen TSRMLS_DC) -{ - smart_str surl = {0}; - smart_str buf = {0}; - smart_str url_app = {0}; - - smart_str_setl(&surl, url, urllen); - - smart_str_appends(&url_app, name); - smart_str_appendc(&url_app, '='); - smart_str_appends(&url_app, value); - - append_modified_url(&surl, &buf, &url_app, PG(arg_separator).output); - - smart_str_0(&buf); - if (newlen) *newlen = buf.len; - - smart_str_free(&url_app); - - return buf.c; -} - - -static char *url_adapt_ext(const char *src, size_t srclen, size_t *newlen, zend_bool do_flush TSRMLS_DC) -{ - url_adapt_state_ex_t *ctx; - char *retval; - - ctx = &BG(url_adapt_state_ex); - - xx_mainloop(ctx, src, srclen TSRMLS_CC); - - *newlen = ctx->result.len; - if (!ctx->result.c) { - smart_str_appendl(&ctx->result, "", 0); - } - smart_str_0(&ctx->result); - if (do_flush) { - smart_str_appendl(&ctx->result, ctx->buf.c, ctx->buf.len); - *newlen += ctx->buf.len; - smart_str_free(&ctx->buf); - } - retval = ctx->result.c; - ctx->result.c = NULL; - ctx->result.len = 0; - return retval; -} - -static int php_url_scanner_ex_activate(TSRMLS_D) -{ - url_adapt_state_ex_t *ctx; - - ctx = &BG(url_adapt_state_ex); - - memset(ctx, 0, ((size_t) &((url_adapt_state_ex_t *)0)->tags)); - - return SUCCESS; -} - -static int php_url_scanner_ex_deactivate(TSRMLS_D) -{ - url_adapt_state_ex_t *ctx; - - ctx = &BG(url_adapt_state_ex); - - smart_str_free(&ctx->result); - smart_str_free(&ctx->buf); - smart_str_free(&ctx->tag); - smart_str_free(&ctx->arg); - - return SUCCESS; -} - -static void php_url_scanner_output_handler(char *output, uint output_len, char **handled_output, uint *handled_output_len, int mode TSRMLS_DC) -{ - size_t len; - - if (BG(url_adapt_state_ex).url_app.len != 0) { - *handled_output = url_adapt_ext(output, output_len, &len, (zend_bool) (mode & (PHP_OUTPUT_HANDLER_END | PHP_OUTPUT_HANDLER_CONT) ? 1 : 0) TSRMLS_CC); - if (sizeof(uint) < sizeof(size_t)) { - if (len > UINT_MAX) - len = UINT_MAX; - } - *handled_output_len = len; - } else if (BG(url_adapt_state_ex).url_app.len == 0) { - url_adapt_state_ex_t *ctx = &BG(url_adapt_state_ex); - if (ctx->buf.len) { - smart_str_appendl(&ctx->result, ctx->buf.c, ctx->buf.len); - smart_str_appendl(&ctx->result, output, output_len); - - *handled_output = ctx->result.c; - *handled_output_len = ctx->buf.len + output_len; - - ctx->result.c = NULL; - ctx->result.len = 0; - smart_str_free(&ctx->buf); - } else { - *handled_output = NULL; - } - } else { - *handled_output = NULL; - } -} - -PHPAPI int php_url_scanner_add_var(char *name, int name_len, char *value, int value_len, int urlencode TSRMLS_DC) -{ - char *encoded; - int encoded_len; - smart_str val; - - if (! BG(url_adapt_state_ex).active) { - php_url_scanner_ex_activate(TSRMLS_C); - php_ob_set_internal_handler(php_url_scanner_output_handler, 0, "URL-Rewriter", 1 TSRMLS_CC); - BG(url_adapt_state_ex).active = 1; - } - - - if (BG(url_adapt_state_ex).url_app.len != 0) { - smart_str_appends(&BG(url_adapt_state_ex).url_app, PG(arg_separator).output); - } - - if (urlencode) { - encoded = php_url_encode(value, value_len, &encoded_len); - smart_str_setl(&val, encoded, encoded_len); - } else { - smart_str_setl(&val, value, value_len); - } - - smart_str_appendl(&BG(url_adapt_state_ex).url_app, name, name_len); - smart_str_appendc(&BG(url_adapt_state_ex).url_app, '='); - smart_str_append(&BG(url_adapt_state_ex).url_app, &val); - - smart_str_appends(&BG(url_adapt_state_ex).form_app, "<input type=\"hidden\" name=\""); - smart_str_appendl(&BG(url_adapt_state_ex).form_app, name, name_len); - smart_str_appends(&BG(url_adapt_state_ex).form_app, "\" value=\""); - smart_str_append(&BG(url_adapt_state_ex).form_app, &val); - smart_str_appends(&BG(url_adapt_state_ex).form_app, "\" />"); - - if (urlencode) - efree(encoded); - - return SUCCESS; -} - -PHPAPI int php_url_scanner_reset_vars(TSRMLS_D) -{ - BG(url_adapt_state_ex).form_app.len = 0; - BG(url_adapt_state_ex).url_app.len = 0; - - return SUCCESS; -} - -PHP_MINIT_FUNCTION(url_scanner) -{ - BG(url_adapt_state_ex).tags = NULL; - - BG(url_adapt_state_ex).form_app.c = BG(url_adapt_state_ex).url_app.c = 0; - BG(url_adapt_state_ex).form_app.len = BG(url_adapt_state_ex).url_app.len = 0; - - REGISTER_INI_ENTRIES(); - return SUCCESS; -} - -PHP_MSHUTDOWN_FUNCTION(url_scanner) -{ - UNREGISTER_INI_ENTRIES(); - - return SUCCESS; -} - -PHP_RINIT_FUNCTION(url_scanner) -{ - BG(url_adapt_state_ex).active = 0; - - return SUCCESS; -} - -PHP_RSHUTDOWN_FUNCTION(url_scanner) -{ - if (BG(url_adapt_state_ex).active) { - php_url_scanner_ex_deactivate(TSRMLS_C); - BG(url_adapt_state_ex).active = 0; - } - - smart_str_free(&BG(url_adapt_state_ex).form_app); - smart_str_free(&BG(url_adapt_state_ex).url_app); - - return SUCCESS; -} diff --git a/ext/standard/url_scanner_ex.h b/ext/standard/url_scanner_ex.h index 692f05af1..d4aea269f 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-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: url_scanner_ex.h 321634 2012-01-01 13:15:04Z felipe $ */ #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 449c42db1..ba145b559 100644 --- a/ext/standard/user_filters.c +++ b/ext/standard/user_filters.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 314641 2011-08-09 12:16:58Z laruence $ */ +/* $Id: user_filters.c 321634 2012-01-01 13:15:04Z felipe $ */ #include "php.h" #include "php_globals.h" diff --git a/ext/standard/uuencode.c b/ext/standard/uuencode.c index cdd73aaa5..60f59c12e 100644 --- a/ext/standard/uuencode.c +++ b/ext/standard/uuencode.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: uuencode.c 321634 2012-01-01 13:15:04Z felipe $ */ /* * Portions of this code are based on Berkeley's uuencode/uudecode diff --git a/ext/standard/var.c b/ext/standard/var.c index c8a89b746..ea156e859 100644 --- a/ext/standard/var.c +++ b/ext/standard/var.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 314403 2011-08-07 06:04:11Z pierrick $ */ +/* $Id: var.c 321634 2012-01-01 13:15:04Z felipe $ */ /* {{{ includes */ @@ -598,7 +598,7 @@ static inline zend_bool php_var_serialize_class_name(smart_str *buf, zval *struc PHP_SET_CLASS_ATTRIBUTES(struc); smart_str_appendl(buf, "O:", 2); - smart_str_append_long(buf, (long)name_len); + smart_str_append_long(buf, (int)name_len); smart_str_appendl(buf, ":\"", 2); smart_str_appendl(buf, class_name, name_len); smart_str_appendl(buf, "\":", 2); @@ -764,12 +764,12 @@ static void php_var_serialize_intern(smart_str *buf, zval *struc, HashTable *var if (ce->serialize(struc, &serialized_data, &serialized_length, (zend_serialize_data *)var_hash TSRMLS_CC) == SUCCESS) { smart_str_appendl(buf, "C:", 2); - smart_str_append_long(buf, (long)Z_OBJCE_P(struc)->name_length); + smart_str_append_long(buf, (int)Z_OBJCE_P(struc)->name_length); smart_str_appendl(buf, ":\"", 2); smart_str_appendl(buf, Z_OBJCE_P(struc)->name, Z_OBJCE_P(struc)->name_length); smart_str_appendl(buf, "\":", 2); - smart_str_append_long(buf, (long)serialized_length); + smart_str_append_long(buf, (int)serialized_length); smart_str_appendl(buf, ":{", 2); smart_str_appendl(buf, serialized_data, serialized_length); smart_str_appendc(buf, '}'); diff --git a/ext/standard/var_unserializer.c b/ext/standard/var_unserializer.c index 015f92d9e..8bacdfed3 100644 --- a/ext/standard/var_unserializer.c +++ b/ext/standard/var_unserializer.c @@ -1,9 +1,9 @@ -/* Generated by re2c 0.13.5 on Fri Dec 31 23:52:55 2010 */ +/* Generated by re2c 0.13.5 on Wed Sep 28 15:40:15 2011 */ /* +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: var_unserializer.c 321634 2012-01-01 13:15:04Z felipe $ */ #include "php.h" #include "ext/standard/php_var.h" @@ -251,7 +251,7 @@ static inline size_t parse_uiv(const unsigned char *p) #define UNSERIALIZE_PARAMETER zval **rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash TSRMLS_DC #define UNSERIALIZE_PASSTHRU rval, p, max, var_hash TSRMLS_CC -static inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht, long elements) +static inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht, long elements, int objprops) { while (elements-- > 0) { zval *key, *data, **old_data; @@ -280,7 +280,8 @@ static inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht, long return 0; } - switch (Z_TYPE_P(key)) { + if (!objprops) { + switch (Z_TYPE_P(key)) { case IS_LONG: if (zend_hash_index_find(ht, Z_LVAL_P(key), (void **)&old_data)==SUCCESS) { var_push_dtor(var_hash, old_data); @@ -293,6 +294,12 @@ static inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht, long } zend_symtable_update(ht, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, &data, sizeof(data), NULL); break; + } + } else { + /* object properties should include no integers */ + convert_to_string(key); + zend_hash_update(ht, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, &data, + sizeof data, NULL); } zval_dtor(key); @@ -360,7 +367,7 @@ static inline int object_common2(UNSERIALIZE_PARAMETER, long elements) zval *retval_ptr = NULL; zval fname; - if (!process_nested_data(UNSERIALIZE_PASSTHRU, Z_OBJPROP_PP(rval), elements)) { + if (!process_nested_data(UNSERIALIZE_PASSTHRU, Z_OBJPROP_PP(rval), elements, 1)) { return 0; } @@ -710,7 +717,7 @@ yy34: array_init_size(*rval, elements); - if (!process_nested_data(UNSERIALIZE_PASSTHRU, Z_ARRVAL_PP(rval), elements)) { + if (!process_nested_data(UNSERIALIZE_PASSTHRU, Z_ARRVAL_PP(rval), elements, 0)) { return 0; } diff --git a/ext/standard/var_unserializer.c.orig b/ext/standard/var_unserializer.c.orig deleted file mode 100644 index ad7823e99..000000000 --- a/ext/standard/var_unserializer.c.orig +++ /dev/null @@ -1,1177 +0,0 @@ -/* Generated by re2c 0.13.5 on Fri Dec 31 23:52:55 2010 */ -#line 1 "ext/standard/var_unserializer.re" -/* - +----------------------------------------------------------------------+ - | PHP Version 5 | - +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 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 | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Author: Sascha Schumann <sascha@schumann.cx> | - +----------------------------------------------------------------------+ -*/ - -/* $Id: var_unserializer.c 306939 2011-01-01 02:19:59Z felipe $ */ - -#include "php.h" -#include "ext/standard/php_var.h" -#include "php_incomplete_class.h" - -/* {{{ reference-handling for unserializer: var_* */ -#define VAR_ENTRIES_MAX 1024 - -typedef struct { - zval *data[VAR_ENTRIES_MAX]; - long used_slots; - void *next; -} var_entries; - -static inline void var_push(php_unserialize_data_t *var_hashx, zval **rval) -{ - var_entries *var_hash = var_hashx->first, *prev = NULL; - - while (var_hash && var_hash->used_slots == VAR_ENTRIES_MAX) { - prev = var_hash; - var_hash = var_hash->next; - } - - if (!var_hash) { - var_hash = emalloc(sizeof(var_entries)); - var_hash->used_slots = 0; - var_hash->next = 0; - - if (!var_hashx->first) - var_hashx->first = var_hash; - else - prev->next = var_hash; - } - - var_hash->data[var_hash->used_slots++] = *rval; -} - -PHPAPI void var_push_dtor(php_unserialize_data_t *var_hashx, zval **rval) -{ - var_entries *var_hash = var_hashx->first_dtor, *prev = NULL; - - while (var_hash && var_hash->used_slots == VAR_ENTRIES_MAX) { - prev = var_hash; - var_hash = var_hash->next; - } - - if (!var_hash) { - var_hash = emalloc(sizeof(var_entries)); - var_hash->used_slots = 0; - var_hash->next = 0; - - if (!var_hashx->first_dtor) - var_hashx->first_dtor = var_hash; - else - prev->next = var_hash; - } - - Z_ADDREF_PP(rval); - var_hash->data[var_hash->used_slots++] = *rval; -} - -PHPAPI void var_replace(php_unserialize_data_t *var_hashx, zval *ozval, zval **nzval) -{ - long i; - var_entries *var_hash = var_hashx->first; - - while (var_hash) { - for (i = 0; i < var_hash->used_slots; i++) { - if (var_hash->data[i] == ozval) { - var_hash->data[i] = *nzval; - /* do not break here */ - } - } - var_hash = var_hash->next; - } -} - -static int var_access(php_unserialize_data_t *var_hashx, long id, zval ***store) -{ - var_entries *var_hash = var_hashx->first; - - while (id >= VAR_ENTRIES_MAX && var_hash && var_hash->used_slots == VAR_ENTRIES_MAX) { - var_hash = var_hash->next; - id -= VAR_ENTRIES_MAX; - } - - if (!var_hash) return !SUCCESS; - - if (id < 0 || id >= var_hash->used_slots) return !SUCCESS; - - *store = &var_hash->data[id]; - - return SUCCESS; -} - -PHPAPI void var_destroy(php_unserialize_data_t *var_hashx) -{ - void *next; - long i; - var_entries *var_hash = var_hashx->first; - - while (var_hash) { - next = var_hash->next; - efree(var_hash); - var_hash = next; - } - - var_hash = var_hashx->first_dtor; - - while (var_hash) { - for (i = 0; i < var_hash->used_slots; i++) { - zval_ptr_dtor(&var_hash->data[i]); - } - next = var_hash->next; - efree(var_hash); - var_hash = next; - } -} - -/* }}} */ - -static char *unserialize_str(const unsigned char **p, size_t *len, size_t maxlen) -{ - size_t i, j; - char *str = safe_emalloc(*len, 1, 1); - unsigned char *end = *(unsigned char **)p+maxlen; - - if (end < *p) { - efree(str); - return NULL; - } - - for (i = 0; i < *len; i++) { - if (*p >= end) { - efree(str); - return NULL; - } - if (**p != '\\') { - str[i] = (char)**p; - } else { - unsigned char ch = 0; - - for (j = 0; j < 2; j++) { - (*p)++; - if (**p >= '0' && **p <= '9') { - ch = (ch << 4) + (**p -'0'); - } else if (**p >= 'a' && **p <= 'f') { - ch = (ch << 4) + (**p -'a'+10); - } else if (**p >= 'A' && **p <= 'F') { - ch = (ch << 4) + (**p -'A'+10); - } else { - efree(str); - return NULL; - } - } - str[i] = (char)ch; - } - (*p)++; - } - str[i] = 0; - *len = i; - return str; -} - -#define YYFILL(n) do { } while (0) -#define YYCTYPE unsigned char -#define YYCURSOR cursor -#define YYLIMIT limit -#define YYMARKER marker - - -#line 198 "ext/standard/var_unserializer.re" - - - - -static inline long parse_iv2(const unsigned char *p, const unsigned char **q) -{ - char cursor; - long result = 0; - int neg = 0; - - switch (*p) { - case '-': - neg++; - /* fall-through */ - case '+': - p++; - } - - while (1) { - cursor = (char)*p; - if (cursor >= '0' && cursor <= '9') { - result = result * 10 + (size_t)(cursor - (unsigned char)'0'); - } else { - break; - } - p++; - } - if (q) *q = p; - if (neg) return -result; - return result; -} - -static inline long parse_iv(const unsigned char *p) -{ - return parse_iv2(p, NULL); -} - -/* no need to check for length - re2c already did */ -static inline size_t parse_uiv(const unsigned char *p) -{ - unsigned char cursor; - size_t result = 0; - - if (*p == '+') { - p++; - } - - while (1) { - cursor = *p; - if (cursor >= '0' && cursor <= '9') { - result = result * 10 + (size_t)(cursor - (unsigned char)'0'); - } else { - break; - } - p++; - } - return result; -} - -#define UNSERIALIZE_PARAMETER zval **rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash TSRMLS_DC -#define UNSERIALIZE_PASSTHRU rval, p, max, var_hash TSRMLS_CC - -static inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht, long elements) -{ - while (elements-- > 0) { - zval *key, *data, **old_data; - - ALLOC_INIT_ZVAL(key); - - if (!php_var_unserialize(&key, p, max, NULL TSRMLS_CC)) { - zval_dtor(key); - FREE_ZVAL(key); - return 0; - } - - if (Z_TYPE_P(key) != IS_LONG && Z_TYPE_P(key) != IS_STRING) { - zval_dtor(key); - FREE_ZVAL(key); - return 0; - } - - ALLOC_INIT_ZVAL(data); - - if (!php_var_unserialize(&data, p, max, var_hash TSRMLS_CC)) { - zval_dtor(key); - FREE_ZVAL(key); - zval_dtor(data); - FREE_ZVAL(data); - return 0; - } - - switch (Z_TYPE_P(key)) { - case IS_LONG: - if (zend_hash_index_find(ht, Z_LVAL_P(key), (void **)&old_data)==SUCCESS) { - var_push_dtor(var_hash, old_data); - } - zend_hash_index_update(ht, Z_LVAL_P(key), &data, sizeof(data), NULL); - break; - case IS_STRING: - if (zend_symtable_find(ht, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, (void **)&old_data)==SUCCESS) { - var_push_dtor(var_hash, old_data); - } - zend_symtable_update(ht, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, &data, sizeof(data), NULL); - break; - } - - zval_dtor(key); - FREE_ZVAL(key); - - if (elements && *(*p-1) != ';' && *(*p-1) != '}') { - (*p)--; - return 0; - } - } - - return 1; -} - -static inline int finish_nested_data(UNSERIALIZE_PARAMETER) -{ - if (*((*p)++) == '}') - return 1; - -#if SOMETHING_NEW_MIGHT_LEAD_TO_CRASH_ENABLE_IF_YOU_ARE_BRAVE - zval_ptr_dtor(rval); -#endif - return 0; -} - -static inline int object_custom(UNSERIALIZE_PARAMETER, zend_class_entry *ce) -{ - long datalen; - - datalen = parse_iv2((*p) + 2, p); - - (*p) += 2; - - if (datalen < 0 || (*p) + datalen >= max) { - zend_error(E_WARNING, "Insufficient data for unserializing - %ld required, %ld present", datalen, (long)(max - (*p))); - return 0; - } - - if (ce->unserialize == NULL) { - zend_error(E_WARNING, "Class %s has no unserializer", ce->name); - object_init_ex(*rval, ce); - } else if (ce->unserialize(rval, ce, (const unsigned char*)*p, datalen, (zend_unserialize_data *)var_hash TSRMLS_CC) != SUCCESS) { - return 0; - } - - (*p) += datalen; - - return finish_nested_data(UNSERIALIZE_PASSTHRU); -} - -static inline long object_common1(UNSERIALIZE_PARAMETER, zend_class_entry *ce) -{ - long elements; - - elements = parse_iv2((*p) + 2, p); - - (*p) += 2; - - object_init_ex(*rval, ce); - return elements; -} - -static inline int object_common2(UNSERIALIZE_PARAMETER, long elements) -{ - zval *retval_ptr = NULL; - zval fname; - - if (!process_nested_data(UNSERIALIZE_PASSTHRU, Z_OBJPROP_PP(rval), elements)) { - return 0; - } - - if (Z_OBJCE_PP(rval) != PHP_IC_ENTRY && - zend_hash_exists(&Z_OBJCE_PP(rval)->function_table, "__wakeup", sizeof("__wakeup"))) { - INIT_PZVAL(&fname); - ZVAL_STRINGL(&fname, "__wakeup", sizeof("__wakeup") - 1, 0); - call_user_function_ex(CG(function_table), rval, &fname, &retval_ptr, 0, 0, 1, NULL TSRMLS_CC); - } - - if (retval_ptr) - zval_ptr_dtor(&retval_ptr); - - return finish_nested_data(UNSERIALIZE_PASSTHRU); - -} - -PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER) -{ - const unsigned char *cursor, *limit, *marker, *start; - zval **rval_ref; - - limit = cursor = *p; - - if (var_hash && cursor[0] != 'R') { - var_push(var_hash, rval); - } - - start = cursor; - - - - -#line 400 "ext/standard/var_unserializer.c" -{ - YYCTYPE yych; - static const unsigned char yybm[] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - }; - - if ((YYLIMIT - YYCURSOR) < 7) YYFILL(7); - yych = *YYCURSOR; - switch (yych) { - case 'C': - case 'O': goto yy13; - case 'N': goto yy5; - case 'R': goto yy2; - case 'S': goto yy10; - case 'a': goto yy11; - case 'b': goto yy6; - case 'd': goto yy8; - case 'i': goto yy7; - case 'o': goto yy12; - case 'r': goto yy4; - case 's': goto yy9; - case '}': goto yy14; - default: goto yy16; - } -yy2: - yych = *(YYMARKER = ++YYCURSOR); - if (yych == ':') goto yy95; -yy3: -#line 722 "ext/standard/var_unserializer.re" - { return 0; } -#line 462 "ext/standard/var_unserializer.c" -yy4: - yych = *(YYMARKER = ++YYCURSOR); - if (yych == ':') goto yy89; - goto yy3; -yy5: - yych = *++YYCURSOR; - if (yych == ';') goto yy87; - goto yy3; -yy6: - yych = *(YYMARKER = ++YYCURSOR); - if (yych == ':') goto yy83; - goto yy3; -yy7: - yych = *(YYMARKER = ++YYCURSOR); - if (yych == ':') goto yy77; - goto yy3; -yy8: - yych = *(YYMARKER = ++YYCURSOR); - if (yych == ':') goto yy53; - goto yy3; -yy9: - yych = *(YYMARKER = ++YYCURSOR); - if (yych == ':') goto yy46; - goto yy3; -yy10: - yych = *(YYMARKER = ++YYCURSOR); - if (yych == ':') goto yy39; - goto yy3; -yy11: - yych = *(YYMARKER = ++YYCURSOR); - if (yych == ':') goto yy32; - goto yy3; -yy12: - yych = *(YYMARKER = ++YYCURSOR); - if (yych == ':') goto yy25; - goto yy3; -yy13: - yych = *(YYMARKER = ++YYCURSOR); - if (yych == ':') goto yy17; - goto yy3; -yy14: - ++YYCURSOR; -#line 716 "ext/standard/var_unserializer.re" - { - /* this is the case where we have less data than planned */ - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unexpected end of serialized data"); - return 0; /* not sure if it should be 0 or 1 here? */ -} -#line 511 "ext/standard/var_unserializer.c" -yy16: - yych = *++YYCURSOR; - goto yy3; -yy17: - yych = *++YYCURSOR; - if (yybm[0+yych] & 128) { - goto yy20; - } - if (yych == '+') goto yy19; -yy18: - YYCURSOR = YYMARKER; - goto yy3; -yy19: - yych = *++YYCURSOR; - if (yybm[0+yych] & 128) { - goto yy20; - } - goto yy18; -yy20: - ++YYCURSOR; - if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); - yych = *YYCURSOR; - if (yybm[0+yych] & 128) { - goto yy20; - } - if (yych != ':') goto yy18; - yych = *++YYCURSOR; - if (yych != '"') goto yy18; - ++YYCURSOR; -#line 599 "ext/standard/var_unserializer.re" - { - size_t len, len2, len3, maxlen; - long elements; - char *class_name; - zend_class_entry *ce; - zend_class_entry **pce; - int incomplete_class = 0; - - int custom_object = 0; - - zval *user_func; - zval *retval_ptr; - zval **args[1]; - zval *arg_func_name; - - if (*start == 'C') { - custom_object = 1; - } - - INIT_PZVAL(*rval); - len2 = len = parse_uiv(start + 2); - maxlen = max - YYCURSOR; - if (maxlen < len || len == 0) { - *p = start + 2; - return 0; - } - - class_name = (char*)YYCURSOR; - - YYCURSOR += len; - - if (*(YYCURSOR) != '"') { - *p = YYCURSOR; - return 0; - } - if (*(YYCURSOR+1) != ':') { - *p = YYCURSOR+1; - return 0; - } - - len3 = strspn(class_name, "0123456789_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377\\"); - if (len3 != len) - { - *p = YYCURSOR + len3 - len; - return 0; - } - - class_name = estrndup(class_name, len); - - do { - /* Try to find class directly */ - if (zend_lookup_class(class_name, len2, &pce TSRMLS_CC) == SUCCESS) { - ce = *pce; - break; - } - - /* Check for unserialize callback */ - if ((PG(unserialize_callback_func) == NULL) || (PG(unserialize_callback_func)[0] == '\0')) { - incomplete_class = 1; - ce = PHP_IC_ENTRY; - break; - } - - /* Call unserialize callback */ - MAKE_STD_ZVAL(user_func); - ZVAL_STRING(user_func, PG(unserialize_callback_func), 1); - args[0] = &arg_func_name; - MAKE_STD_ZVAL(arg_func_name); - ZVAL_STRING(arg_func_name, class_name, 1); - if (call_user_function_ex(CG(function_table), NULL, user_func, &retval_ptr, 1, args, 0, NULL TSRMLS_CC) != SUCCESS) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "defined (%s) but not found", user_func->value.str.val); - incomplete_class = 1; - ce = PHP_IC_ENTRY; - zval_ptr_dtor(&user_func); - zval_ptr_dtor(&arg_func_name); - break; - } - if (retval_ptr) { - zval_ptr_dtor(&retval_ptr); - } - - /* The callback function may have defined the class */ - if (zend_lookup_class(class_name, len2, &pce TSRMLS_CC) == SUCCESS) { - ce = *pce; - } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Function %s() hasn't defined the class it was called for", user_func->value.str.val); - incomplete_class = 1; - ce = PHP_IC_ENTRY; - } - - zval_ptr_dtor(&user_func); - zval_ptr_dtor(&arg_func_name); - break; - } while (1); - - *p = YYCURSOR; - - if (custom_object) { - int ret = object_custom(UNSERIALIZE_PASSTHRU, ce); - - if (ret && incomplete_class) { - php_store_class_name(*rval, class_name, len2); - } - efree(class_name); - return ret; - } - - elements = object_common1(UNSERIALIZE_PASSTHRU, ce); - - if (incomplete_class) { - php_store_class_name(*rval, class_name, len2); - } - efree(class_name); - - return object_common2(UNSERIALIZE_PASSTHRU, elements); -} -#line 658 "ext/standard/var_unserializer.c" -yy25: - yych = *++YYCURSOR; - if (yych <= ',') { - if (yych != '+') goto yy18; - } else { - if (yych <= '-') goto yy26; - if (yych <= '/') goto yy18; - if (yych <= '9') goto yy27; - goto yy18; - } -yy26: - yych = *++YYCURSOR; - if (yych <= '/') goto yy18; - if (yych >= ':') goto yy18; -yy27: - ++YYCURSOR; - if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); - yych = *YYCURSOR; - if (yych <= '/') goto yy18; - if (yych <= '9') goto yy27; - if (yych >= ';') goto yy18; - yych = *++YYCURSOR; - if (yych != '"') goto yy18; - ++YYCURSOR; -#line 591 "ext/standard/var_unserializer.re" - { - - INIT_PZVAL(*rval); - - return object_common2(UNSERIALIZE_PASSTHRU, - object_common1(UNSERIALIZE_PASSTHRU, ZEND_STANDARD_CLASS_DEF_PTR)); -} -#line 691 "ext/standard/var_unserializer.c" -yy32: - yych = *++YYCURSOR; - if (yych == '+') goto yy33; - if (yych <= '/') goto yy18; - if (yych <= '9') goto yy34; - goto yy18; -yy33: - yych = *++YYCURSOR; - if (yych <= '/') goto yy18; - if (yych >= ':') goto yy18; -yy34: - ++YYCURSOR; - if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); - yych = *YYCURSOR; - if (yych <= '/') goto yy18; - if (yych <= '9') goto yy34; - if (yych >= ';') goto yy18; - yych = *++YYCURSOR; - if (yych != '{') goto yy18; - ++YYCURSOR; -#line 571 "ext/standard/var_unserializer.re" - { - long elements = parse_iv(start + 2); - /* use iv() not uiv() in order to check data range */ - *p = YYCURSOR; - - if (elements < 0) { - return 0; - } - - INIT_PZVAL(*rval); - - array_init_size(*rval, elements); - - if (!process_nested_data(UNSERIALIZE_PASSTHRU, Z_ARRVAL_PP(rval), elements)) { - return 0; - } - - return finish_nested_data(UNSERIALIZE_PASSTHRU); -} -#line 732 "ext/standard/var_unserializer.c" -yy39: - yych = *++YYCURSOR; - if (yych == '+') goto yy40; - if (yych <= '/') goto yy18; - if (yych <= '9') goto yy41; - goto yy18; -yy40: - yych = *++YYCURSOR; - if (yych <= '/') goto yy18; - if (yych >= ':') goto yy18; -yy41: - ++YYCURSOR; - if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); - yych = *YYCURSOR; - if (yych <= '/') goto yy18; - if (yych <= '9') goto yy41; - if (yych >= ';') goto yy18; - yych = *++YYCURSOR; - if (yych != '"') goto yy18; - ++YYCURSOR; -#line 542 "ext/standard/var_unserializer.re" - { - size_t len, maxlen; - char *str; - - len = parse_uiv(start + 2); - maxlen = max - YYCURSOR; - if (maxlen < len) { - *p = start + 2; - return 0; - } - - if ((str = unserialize_str(&YYCURSOR, &len, maxlen)) == NULL) { - return 0; - } - - if (*(YYCURSOR) != '"') { - efree(str); - *p = YYCURSOR; - return 0; - } - - YYCURSOR += 2; - *p = YYCURSOR; - - INIT_PZVAL(*rval); - ZVAL_STRINGL(*rval, str, len, 0); - return 1; -} -#line 782 "ext/standard/var_unserializer.c" -yy46: - yych = *++YYCURSOR; - if (yych == '+') goto yy47; - if (yych <= '/') goto yy18; - if (yych <= '9') goto yy48; - goto yy18; -yy47: - yych = *++YYCURSOR; - if (yych <= '/') goto yy18; - if (yych >= ':') goto yy18; -yy48: - ++YYCURSOR; - if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); - yych = *YYCURSOR; - if (yych <= '/') goto yy18; - if (yych <= '9') goto yy48; - if (yych >= ';') goto yy18; - yych = *++YYCURSOR; - if (yych != '"') goto yy18; - ++YYCURSOR; -#line 514 "ext/standard/var_unserializer.re" - { - size_t len, maxlen; - char *str; - - len = parse_uiv(start + 2); - maxlen = max - YYCURSOR; - if (maxlen < len) { - *p = start + 2; - return 0; - } - - str = (char*)YYCURSOR; - - YYCURSOR += len; - - if (*(YYCURSOR) != '"') { - *p = YYCURSOR; - return 0; - } - - YYCURSOR += 2; - *p = YYCURSOR; - - INIT_PZVAL(*rval); - ZVAL_STRINGL(*rval, str, len, 1); - return 1; -} -#line 831 "ext/standard/var_unserializer.c" -yy53: - yych = *++YYCURSOR; - if (yych <= '/') { - if (yych <= ',') { - if (yych == '+') goto yy57; - goto yy18; - } else { - if (yych <= '-') goto yy55; - if (yych <= '.') goto yy60; - goto yy18; - } - } else { - if (yych <= 'I') { - if (yych <= '9') goto yy58; - if (yych <= 'H') goto yy18; - goto yy56; - } else { - if (yych != 'N') goto yy18; - } - } - yych = *++YYCURSOR; - if (yych == 'A') goto yy76; - goto yy18; -yy55: - yych = *++YYCURSOR; - if (yych <= '/') { - if (yych == '.') goto yy60; - goto yy18; - } else { - if (yych <= '9') goto yy58; - if (yych != 'I') goto yy18; - } -yy56: - yych = *++YYCURSOR; - if (yych == 'N') goto yy72; - goto yy18; -yy57: - yych = *++YYCURSOR; - if (yych == '.') goto yy60; - if (yych <= '/') goto yy18; - if (yych >= ':') goto yy18; -yy58: - ++YYCURSOR; - if ((YYLIMIT - YYCURSOR) < 4) YYFILL(4); - yych = *YYCURSOR; - if (yych <= ':') { - if (yych <= '.') { - if (yych <= '-') goto yy18; - goto yy70; - } else { - if (yych <= '/') goto yy18; - if (yych <= '9') goto yy58; - goto yy18; - } - } else { - if (yych <= 'E') { - if (yych <= ';') goto yy63; - if (yych <= 'D') goto yy18; - goto yy65; - } else { - if (yych == 'e') goto yy65; - goto yy18; - } - } -yy60: - yych = *++YYCURSOR; - if (yych <= '/') goto yy18; - if (yych >= ':') goto yy18; -yy61: - ++YYCURSOR; - if ((YYLIMIT - YYCURSOR) < 4) YYFILL(4); - yych = *YYCURSOR; - if (yych <= ';') { - if (yych <= '/') goto yy18; - if (yych <= '9') goto yy61; - if (yych <= ':') goto yy18; - } else { - if (yych <= 'E') { - if (yych <= 'D') goto yy18; - goto yy65; - } else { - if (yych == 'e') goto yy65; - goto yy18; - } - } -yy63: - ++YYCURSOR; -#line 504 "ext/standard/var_unserializer.re" - { -#if SIZEOF_LONG == 4 -use_double: -#endif - *p = YYCURSOR; - INIT_PZVAL(*rval); - ZVAL_DOUBLE(*rval, zend_strtod((const char *)start + 2, NULL)); - return 1; -} -#line 929 "ext/standard/var_unserializer.c" -yy65: - yych = *++YYCURSOR; - if (yych <= ',') { - if (yych != '+') goto yy18; - } else { - if (yych <= '-') goto yy66; - if (yych <= '/') goto yy18; - if (yych <= '9') goto yy67; - goto yy18; - } -yy66: - yych = *++YYCURSOR; - if (yych <= ',') { - if (yych == '+') goto yy69; - goto yy18; - } else { - if (yych <= '-') goto yy69; - if (yych <= '/') goto yy18; - if (yych >= ':') goto yy18; - } -yy67: - ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if (yych <= '/') goto yy18; - if (yych <= '9') goto yy67; - if (yych == ';') goto yy63; - goto yy18; -yy69: - yych = *++YYCURSOR; - if (yych <= '/') goto yy18; - if (yych <= '9') goto yy67; - goto yy18; -yy70: - ++YYCURSOR; - if ((YYLIMIT - YYCURSOR) < 4) YYFILL(4); - yych = *YYCURSOR; - if (yych <= ';') { - if (yych <= '/') goto yy18; - if (yych <= '9') goto yy70; - if (yych <= ':') goto yy18; - goto yy63; - } else { - if (yych <= 'E') { - if (yych <= 'D') goto yy18; - goto yy65; - } else { - if (yych == 'e') goto yy65; - goto yy18; - } - } -yy72: - yych = *++YYCURSOR; - if (yych != 'F') goto yy18; -yy73: - yych = *++YYCURSOR; - if (yych != ';') goto yy18; - ++YYCURSOR; -#line 489 "ext/standard/var_unserializer.re" - { - *p = YYCURSOR; - INIT_PZVAL(*rval); - - if (!strncmp(start + 2, "NAN", 3)) { - ZVAL_DOUBLE(*rval, php_get_nan()); - } else if (!strncmp(start + 2, "INF", 3)) { - ZVAL_DOUBLE(*rval, php_get_inf()); - } else if (!strncmp(start + 2, "-INF", 4)) { - ZVAL_DOUBLE(*rval, -php_get_inf()); - } - - return 1; -} -#line 1003 "ext/standard/var_unserializer.c" -yy76: - yych = *++YYCURSOR; - if (yych == 'N') goto yy73; - goto yy18; -yy77: - yych = *++YYCURSOR; - if (yych <= ',') { - if (yych != '+') goto yy18; - } else { - if (yych <= '-') goto yy78; - if (yych <= '/') goto yy18; - if (yych <= '9') goto yy79; - goto yy18; - } -yy78: - yych = *++YYCURSOR; - if (yych <= '/') goto yy18; - if (yych >= ':') goto yy18; -yy79: - ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if (yych <= '/') goto yy18; - if (yych <= '9') goto yy79; - if (yych != ';') goto yy18; - ++YYCURSOR; -#line 462 "ext/standard/var_unserializer.re" - { -#if SIZEOF_LONG == 4 - int digits = YYCURSOR - start - 3; - - if (start[2] == '-' || start[2] == '+') { - digits--; - } - - /* Use double for large long values that were serialized on a 64-bit system */ - if (digits >= MAX_LENGTH_OF_LONG - 1) { - if (digits == MAX_LENGTH_OF_LONG - 1) { - int cmp = strncmp(YYCURSOR - MAX_LENGTH_OF_LONG, long_min_digits, MAX_LENGTH_OF_LONG - 1); - - if (!(cmp < 0 || (cmp == 0 && start[2] == '-'))) { - goto use_double; - } - } else { - goto use_double; - } - } -#endif - *p = YYCURSOR; - INIT_PZVAL(*rval); - ZVAL_LONG(*rval, parse_iv(start + 2)); - return 1; -} -#line 1057 "ext/standard/var_unserializer.c" -yy83: - yych = *++YYCURSOR; - if (yych <= '/') goto yy18; - if (yych >= '2') goto yy18; - yych = *++YYCURSOR; - if (yych != ';') goto yy18; - ++YYCURSOR; -#line 455 "ext/standard/var_unserializer.re" - { - *p = YYCURSOR; - INIT_PZVAL(*rval); - ZVAL_BOOL(*rval, parse_iv(start + 2)); - return 1; -} -#line 1072 "ext/standard/var_unserializer.c" -yy87: - ++YYCURSOR; -#line 448 "ext/standard/var_unserializer.re" - { - *p = YYCURSOR; - INIT_PZVAL(*rval); - ZVAL_NULL(*rval); - return 1; -} -#line 1082 "ext/standard/var_unserializer.c" -yy89: - yych = *++YYCURSOR; - if (yych <= ',') { - if (yych != '+') goto yy18; - } else { - if (yych <= '-') goto yy90; - if (yych <= '/') goto yy18; - if (yych <= '9') goto yy91; - goto yy18; - } -yy90: - yych = *++YYCURSOR; - if (yych <= '/') goto yy18; - if (yych >= ':') goto yy18; -yy91: - ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if (yych <= '/') goto yy18; - if (yych <= '9') goto yy91; - if (yych != ';') goto yy18; - ++YYCURSOR; -#line 425 "ext/standard/var_unserializer.re" - { - long id; - - *p = YYCURSOR; - if (!var_hash) return 0; - - id = parse_iv(start + 2) - 1; - if (id == -1 || var_access(var_hash, id, &rval_ref) != SUCCESS) { - return 0; - } - - if (*rval == *rval_ref) return 0; - - if (*rval != NULL) { - zval_ptr_dtor(rval); - } - *rval = *rval_ref; - Z_ADDREF_PP(rval); - Z_UNSET_ISREF_PP(rval); - - return 1; -} -#line 1128 "ext/standard/var_unserializer.c" -yy95: - yych = *++YYCURSOR; - if (yych <= ',') { - if (yych != '+') goto yy18; - } else { - if (yych <= '-') goto yy96; - if (yych <= '/') goto yy18; - if (yych <= '9') goto yy97; - goto yy18; - } -yy96: - yych = *++YYCURSOR; - if (yych <= '/') goto yy18; - if (yych >= ':') goto yy18; -yy97: - ++YYCURSOR; - if (YYLIMIT <= YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if (yych <= '/') goto yy18; - if (yych <= '9') goto yy97; - if (yych != ';') goto yy18; - ++YYCURSOR; -#line 404 "ext/standard/var_unserializer.re" - { - long id; - - *p = YYCURSOR; - if (!var_hash) return 0; - - id = parse_iv(start + 2) - 1; - if (id == -1 || var_access(var_hash, id, &rval_ref) != SUCCESS) { - return 0; - } - - if (*rval != NULL) { - zval_ptr_dtor(rval); - } - *rval = *rval_ref; - Z_ADDREF_PP(rval); - Z_SET_ISREF_PP(rval); - - return 1; -} -#line 1172 "ext/standard/var_unserializer.c" -} -#line 724 "ext/standard/var_unserializer.re" - - - return 0; -} diff --git a/ext/standard/var_unserializer.re b/ext/standard/var_unserializer.re index 500025d4d..c6ae65d29 100644 --- a/ext/standard/var_unserializer.re +++ b/ext/standard/var_unserializer.re @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: var_unserializer.re 321634 2012-01-01 13:15:04Z felipe $ */ #include "php.h" #include "ext/standard/php_var.h" @@ -257,7 +257,7 @@ static inline size_t parse_uiv(const unsigned char *p) #define UNSERIALIZE_PARAMETER zval **rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash TSRMLS_DC #define UNSERIALIZE_PASSTHRU rval, p, max, var_hash TSRMLS_CC -static inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht, long elements) +static inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht, long elements, int objprops) { while (elements-- > 0) { zval *key, *data, **old_data; @@ -286,7 +286,8 @@ static inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht, long return 0; } - switch (Z_TYPE_P(key)) { + if (!objprops) { + switch (Z_TYPE_P(key)) { case IS_LONG: if (zend_hash_index_find(ht, Z_LVAL_P(key), (void **)&old_data)==SUCCESS) { var_push_dtor(var_hash, old_data); @@ -299,6 +300,12 @@ static inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht, long } zend_symtable_update(ht, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, &data, sizeof(data), NULL); break; + } + } else { + /* object properties should include no integers */ + convert_to_string(key); + zend_hash_update(ht, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, &data, + sizeof data, NULL); } zval_dtor(key); @@ -366,7 +373,7 @@ static inline int object_common2(UNSERIALIZE_PARAMETER, long elements) zval *retval_ptr = NULL; zval fname; - if (!process_nested_data(UNSERIALIZE_PASSTHRU, Z_OBJPROP_PP(rval), elements)) { + if (!process_nested_data(UNSERIALIZE_PASSTHRU, Z_OBJPROP_PP(rval), elements, 1)) { return 0; } @@ -581,7 +588,7 @@ use_double: array_init_size(*rval, elements); - if (!process_nested_data(UNSERIALIZE_PASSTHRU, Z_ARRVAL_PP(rval), elements)) { + if (!process_nested_data(UNSERIALIZE_PASSTHRU, Z_ARRVAL_PP(rval), elements, 0)) { return 0; } diff --git a/ext/standard/versioning.c b/ext/standard/versioning.c index 759cbb8f1..1cb9d4507 100644 --- a/ext/standard/versioning.c +++ b/ext/standard/versioning.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2011 The PHP Group | + | Copyright (c) 1997-2012 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 306939 2011-01-01 02:19:59Z felipe $ */ +/* $Id: versioning.c 321634 2012-01-01 13:15:04Z felipe $ */ #include <stdio.h> #include <sys/types.h> |
