Compare commits

..
14 Commits
Author SHA1 Message Date
Ferenc Kovacs 939409d36f update NEWS about the release date of 5.6.1 2014-10-01 11:17:38 +02:00
Ferenc Kovacs 4c4a354223 5.6.1 2014-09-24 10:30:08 +02:00
Ferenc Kovacs c7c360ed37 removing the NEWS entry as we had to revert this fix for now 2014-09-24 10:27:42 +02:00
Ferenc Kovacs 4879eb7242 Revert "Merge branch 'PHP-5.5' into PHP-5.6"
This reverts commit 98e67add15, reversing
changes made to 2cdc1a2b74.
2014-09-24 10:17:25 +02:00
Ferenc Kovacs 43c72ea2cb Revert "fix TS build"
This reverts commit 84a4041ba4.
2014-09-24 10:15:53 +02:00
Ferenc Kovacs dc5f587e07 Revert "Merge branch 'PHP-5.4' into PHP-5.5"
This reverts commit 30a73658c6, reversing
changes made to 7fac56e072.
2014-09-24 10:14:15 +02:00
Ferenc Kovacs 4465b0f415 Revert "Bug #67965: Fix blocking behavior in non-blocking crypto streams"
This reverts commit f86b2193a4.
2014-09-24 10:13:24 +02:00
Ferenc Kovacs 4310db437a Revert "Bug #41631: Fix regression from first attempt (6569db8)"
This reverts commit 372844918a.
2014-09-24 10:12:56 +02:00
Sebastian Zartner 725748cd25 Fixed typo 2014-09-24 09:50:56 +02:00
Ferenc Kovacs d841843c2f add NEWS entry for #68088 2014-09-24 09:42:47 +02:00
Ferenc Kovacs ee8e2373ac the order of the blocks should be Core, then exts in alphabetical order 2014-09-24 09:42:23 +02:00
Julien Pauli afcda556be NEWS for last commit 2014-09-15 15:37:05 +02:00
Bob Weinand 2f57d19f76 Fix bug #111 (compile error without ZEND_SIGNALS) 2014-09-15 15:12:54 +02:00
Julien Pauli 78e8b1511c 5.6.1RC1 2014-09-11 18:46:38 +02:00
340 changed files with 2364 additions and 8892 deletions

No files matched your search

-1
View File
@@ -19,7 +19,6 @@
*.tgz
*.tar.gz
*.tar.bz2
*.tar.xz
.FBCIndex
.FBCLockFolder
.deps
+1 -1
View File
@@ -42,5 +42,5 @@ before_script:
# Run PHPs run-tests.php
script:
- ./sapi/cli/php run-tests.php -p `pwd`/sapi/cli/php -g "FAIL,XFAIL,BORK,WARN,LEAK,SKIP" --show-diff --set-timeout 120 -s
- ./sapi/cli/php run-tests.php -p `pwd`/sapi/cli/php -g "FAIL,XFAIL,BORK,WARN,LEAK,SKIP" --show-diff --set-timeout 120
- ./sapi/cli/php sapi/phpdbg/tests/run-tests.php -diff2stdout --phpdbg sapi/phpdbg/phpdbg
+1 -1
View File
@@ -42,7 +42,7 @@ Exceptions:
4. When writing functions that deal with strings, be sure to remember
that PHP holds the length property of each string, and that it
shouldn't be calculated with strlen(). Write your functions in such
shouldn't be calculated with strlen(). Write your functions in a such
a way so that they'll take advantage of the length property, both
for efficiency and in order for them to be binary-safe.
Functions that change strings and obtain their new lengths while
-12
View File
@@ -385,12 +385,6 @@ MAINTENANCE: Maintained
STATUS: Working
SINCE: 4.0.4
-------------------------------------------------------------------------------
EXTENSION: hash
PRIMARY MAINTAINER: Sara Golemon <pollita@php.net>, Mike Wallner <mike@php.net>, Anatol Belski <ab@php.net>
MAINTENANCE: Maintained
STATUS: Working
SINCE: 5.1.2
-------------------------------------------------------------------------------
EXTENSION: iconv
PRIMARY MAINTAINER: Moriyoshi Koizumi <moriyoshi@php.net>
MAINTENANCE: Maintained
@@ -444,12 +438,6 @@ PRIMARY MAINTAINER: Frank M. Kromann
MAINTENANCE: Unknown
STATUS: Experimental
-------------------------------------------------------------------------------
EXTENSION: opcache
PRIMARY MAINTAINER: Dmitry Stogov <dmitry@zend.com>, Xinchen Hui <laruence@php.net>
MAINTENANCE: Maintained
STATUS: Working
SINCE: 5.5.0
-------------------------------------------------------------------------------
EXTENSION: openssl
PRIMARY MAINTAINER: Wez Furlong <wez@php.net>, Pierre-Alain Joye <pajoye@php.net>
MAINTENANCE: Maintained
+1 -1
View File
@@ -155,7 +155,7 @@ Table of Contents
a list of all available options along with short explanations running
./configure --help. Our manual documents the different options
separately. You will find the core options in the appendix, while the
different extension specific options are described on the reference
different extension specific options are descibed on the reference
pages.
When PHP is configured, you are ready to build the module and/or
-149
View File
@@ -1,153 +1,5 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
18 Dec 2014, PHP 5.6.4
- Core:
. Fixed bug #68091 (Some Zend headers lack appropriate extern "C" blocks).
(Adam)
. Fixed bug #68104 (Segfault while pre-evaluating a disabled function).
(Laruence)
. Fixed bug #68185 ("Inconsistent insteadof definition."- incorrectly
triggered). (Julien)
. Fixed bug #68355 (Inconsistency in example php.ini comments).
(Chris McCafferty)
. Fixed bug #68370 ("unset($this)" can make the program crash). (Laruence)
. Fixed bug #68422 (Incorrect argument reflection info for array_multisort()).
(Alexander Lisachenko)
. Fixed bug #68545 (NULL pointer dereference in unserialize.c). (Anatol)
. Fixed bug #68446 (Array constant not accepted for array parameter default).
(Bob, Dmitry)
. Fixed bug #68594 (Use after free vulnerability in unserialize()).
(CVE-2014-8142) (Stefan Esser)
- Date:
. Fixed day_of_week function as it could sometimes return negative values
internally. (Derick)
- FPM:
. Fixed bug #68381 (fpm_unix_init_main ignores log_level).
(David Zuelke, Remi)
. Fixed bug #68420 (listen=9000 listens to ipv6 localhost instead of all
addresses). (Remi)
. Fixed bug #68421 (access.format='%R' doesn't log ipv6 address). (Remi)
. Fixed bug #68423 (PHP-FPM will no longer load all pools). (Remi)
. Fixed bug #68428 (listen.allowed_clients is IPv4 only). (Remi)
. Fixed bug #68452 (php-fpm man page is oudated). (Remi)
. Fixed request #68458 (Change pm.start_servers default warning to
notice). (David Zuelke, Remi)
. Fixed bug #68463 (listen.allowed_clients can silently result
in no allowed access). (Remi)
. Fixed request #68391 (php-fpm conf files loading order).
(Florian Margaine, Remi)
. Fixed bug #68478 (access.log don't use prefix). (Remi)
- Mcrypt:
. Fixed possible read after end of buffer and use after free. (Dmitry)
- GMP:
. Fixed bug #68419 (build error with gmp 4.1). (Remi)
- PDO_pgsql:
. Fixed bug #67462 (PDO_PGSQL::beginTransaction() wrongly throws exception
when not in transaction) (Matteo)
. Fixed bug #68351 (PDO::PARAM_BOOL and ATTR_EMULATE_PREPARES misbehaving)
(Matteo)
- Session:
. Fixed bug #68331 (Session custom storage callable functions not being called)
(Yasuo Ohgaki)
- SOAP:
. Fixed bug #68361 (Segmentation fault on SoapClient::__getTypes).
(Laruence)
- zlib:
. Fixed bug #53829 (Compiling PHP with large file support will replace
function gzopen by gzopen64) (Sascha Kettler, Matteo)
13 Nov 2014, PHP 5.6.3
- Core:
. Implemented 64-bit format codes for pack() and unpack(). (Leigh)
. Fixed bug #51800 (proc_open on Windows hangs forever). (Anatol)
. Fixed bug #67633 (A foreach on an array returned from a function not doing
copy-on-write). (Nikita)
. Fixed bug #67739 (Windows 8.1/Server 2012 R2 OS build number reported
as 6.2 (instead of 6.3)). (Christian Wenz)
. Fixed bug #67949 (DOMNodeList elements should be accessible through
array notation) (Florian)
. Fixed bug #68095 (AddressSanitizer reports a heap buffer overflow in
php_getopt()). (Stas)
. Fixed bug #68118 ($a->foo .= 'test'; can leave $a->foo undefined). (Nikita)
. Fixed bug #68129 (parse_url() - incomplete support for empty usernames
and passwords) (Tjerk)
. Fixed bug #68365 (zend_mm_heap corrupted after memory overflow in
zend_hash_copy). (Dmitry)
- CURL:
. Add CURL_SSLVERSION_TLSv1_0, CURL_SSLVERSION_TLSv1_1, and
CURL_SSLVERSION_TLSv1_2 constants if supported by libcurl (Rasmus)
- Fileinfo:
. Fixed bug #66242 (libmagic: don't assume char is signed). (ArdB)
. Fixed bug #68224 (buffer-overflow in libmagic/readcdf.c caught by
AddressSanitizer). (Remi)
. Fixed bug #68283 (fileinfo: out-of-bounds read in elf note headers).
(CVE-2014-3710) (Remi)
- FPM:
. Fixed bug #65641 (PHP-FPM incorrectly defines the SCRIPT_NAME variable
when using Apache, mod_proxy-fcgi and ProxyPass). (Remi)
. Implemented FR #55508 (listen and listen.allowed_clients should take IPv6
addresses). (Robin Gloster)
- GD:
. Fixed bug #65171 (imagescale() fails without height param). (Remi)
- GMP:
. Implemented gmp_random_range() and gmp_random_bits(). (Leigh)
. Fixed bug #63595 (GMP memory management conflicts with other libraries
using GMP). (Remi)
- Mysqli:
. Fixed bug #68114 (linker error on some OS X machines with fixed width
decimal support) (Keyur Govande)
- ODBC:
. Fixed bug #68087 (ODBC not correctly reading DATE column when preceded by
a VARCHAR column) (Keyur Govande)
- OpenSSL:
. Fixed bug #68074 (Allow to use system cipher list instead of hardcoded
value). (Remi)
- PDO_pgsql:
. Fixed bug #68199 (PDO::pgsqlGetNotify doesn't support NOTIFY payloads)
(Matteo, Alain Laporte)
. Fixed bug #66584 (Segmentation fault on statement deallocation) (Matteo)
- Reflection:
. Fixed bug #68103 (Duplicate entry in Reflection for class alias). (Remi)
- SPL:
. Fixed bug #68128 (Regression in RecursiveRegexIterator) (Tjerk)
16 Oct 2014, PHP 5.6.2
- Core:
. Fixed bug #68044 (Integer overflow in unserialize() (32-bits only)).
(CVE-2014-3669) (Stas)
- cURL:
. Fixed bug #68089 (NULL byte injection - cURL lib). (Stas)
- EXIF:
. Fixed bug #68113 (Heap corruption in exif_thumbnail()). (CVE-2014-3670)
(Stas)
- XMLRPC:
. Fixed bug #68027 (Global buffer overflow in mkgmtime() function).
(CVE-2014-3668) (Stas)
02 Oct 2014, PHP 5.6.1
@@ -465,7 +317,6 @@ PHP NEWS
. Fixed issue with null bytes in LDAP bindings. (Matthew Daley)
- litespeed
. Updated LiteSpeed SAPI code to V6.6 (George Wang)
. Fixed bug #63228 (-Werror=format-security error in lsapi code).
(Elan Ruusamäe, George)
+3 -3
View File
@@ -8,7 +8,7 @@ the original run-tests.php script. server-tests is *not* used by
'make test'. server-tests was developed to provide support for
testing PHP under it's primary environment, HTTP, and can run the
PHP tests under any of the SAPI modules that are direct executables,
or are accessible via HTTP.
or are accessable via HTTP.
[New features]
----------------
@@ -95,7 +95,7 @@ include:
$filename full native path to file, will become PATH_TRANSLATED
$filepath =dirname($filename)
$scriptname this is what will become SCRIPT_NAME unless you override it
$docroot the equivalent of DOCUMENT_ROOT under Apache
$docroot the equivelant of DOCUMENT_ROOT under Apache
$cwd the directory that the test is being initiated from
$this->conf all server-tests configuration vars
$this->env all environment variables that will get passed to the test
@@ -105,7 +105,7 @@ include:
This section is also eval'd, and is similar in nature to --ENV--. However,
this section is used to build the url used in an HTTP request. Valid values
to set in this section would include:
SCRIPT_NAME The initial part of the request url
SCRIPT_NAME The inital part of the request url
PATH_INFO The pathinfo part of a request url
FRAGMENT The fragment section of a url (after #)
QUERY_STRING The query part of a url (after ?)
-2
View File
@@ -217,7 +217,6 @@ PHP 5.6 UPGRADE NOTES
- Strings:
substr_compare() now allows $length to be zero.
pack() and unpack() now support 64-bit format specifiers: q, Q, J and P.
- Crypt:
crypt() will now raise an E_NOTICE error if the salt parameter is omitted.
@@ -270,7 +269,6 @@ PHP 5.6 UPGRADE NOTES
Added gmp_root($a, $nth) and gmp_rootrem($a, $nth) for calculating nth roots.
Added gmp_import($data, $word_size = 1, $options = GMP_MSW_FIRST | GMP_NATIVE_ENDIAN) in PHP 5.6.1.
Added gmp_export($gmpnumber, $word_size = 1, $options = GMP_MSW_FIRST | GMP_NATIVE_ENDIAN) in PHP 5.6.1.
Added gmp_random_range() and gmp_random_bits() in PHP 5.6.3.
- Hash
Added hash_equals($known_string, $user_string)
+1 -1
View File
@@ -19,6 +19,6 @@ $b = new b();
$b->test();
--EXPECTF--
Strict Standards: Declaration of b::test() should be compatible with a::test($arg = c::TESTCONSTANT) in %s%ebug67436%eb.php on line %d
Strict Standards: Declaration of b::test() should be compatible with a::test($arg = c::TESTCONSTANT) in %s/bug67436/b.php on line %d
b::test()
a::test(c::TESTCONSTANT)
-44
View File
@@ -1,44 +0,0 @@
--TEST--
Bug #67633: A foreach on an array returned from a function not doing copy-on-write
--FILE--
<?php
function id($x) {
return $x;
}
function &ref_id(&$x) {
return $x;
}
$c = 'c';
$array = ['a', 'b', $c];
foreach(id($array) as &$v) {
$v .= 'q';
}
var_dump($array);
foreach(ref_id($array) as &$v) {
$v .= 'q';
}
var_dump($array);
?>
--EXPECT--
array(3) {
[0]=>
string(1) "a"
[1]=>
string(1) "b"
[2]=>
string(1) "c"
}
array(3) {
[0]=>
string(2) "aq"
[1]=>
string(2) "bq"
[2]=>
&string(2) "cq"
}
-21
View File
@@ -1,21 +0,0 @@
--TEST--
Bug #68118: $a->foo .= 'test'; can leave $a->foo undefined
--FILE--
<?php
set_error_handler(function() {
$obj = new stdClass;
$obj->test = 'meow';
return true;
});
$a = new stdClass;
$a->undefined .= 'test';
var_dump($a);
?>
--EXPECT--
object(stdClass)#2 (1) {
["undefined"]=>
string(4) "test"
}
-18
View File
@@ -1,18 +0,0 @@
--TEST--
Bug #68370 "unset($this)" can make the program crash
--FILE--
<?php
class C {
public function test() {
unset($this);
return get_defined_vars();
}
}
$c = new C();
$x = $c->test();
print_r($x);
unset($c, $x);
--EXPECTF--
Array
(
)
-36
View File
@@ -1,36 +0,0 @@
--TEST--
Bug #68446 (Array constant not accepted for array parameter default)
--FILE--
<?php
const FOO = [1];
const BAR = null;
function a(array $a = FOO) {
var_dump($a);
}
function b(array $b = BAR) {
var_dump($b);
}
b(null);
b([]);
b();
a([]);
a();
a(null);
?>
--EXPECTF--
NULL
array(0) {
}
NULL
array(0) {
}
array(1) {
[0]=>
int(1)
}
Catchable fatal error: Argument 1 passed to a() must be of the type array, null given, called in %s on line %d and defined in %s on line %d
+1 -1
View File
@@ -901,7 +901,7 @@ ZEND_API void _zend_bailout(char *filename, uint lineno) /* {{{ */
/* }}} */
END_EXTERN_C()
ZEND_API void zend_append_version_info(const zend_extension *extension) /* {{{ */
void zend_append_version_info(const zend_extension *extension) /* {{{ */
{
char *new_info;
uint new_info_length;
+10 -7
View File
@@ -2499,7 +2499,7 @@ ZEND_API void zend_post_deactivate_modules(TSRMLS_D) /* {{{ */
/* }}} */
/* return the next free module number */
ZEND_API int zend_next_free_module(void) /* {{{ */
int zend_next_free_module(void) /* {{{ */
{
return zend_hash_num_elements(&module_registry) + 1;
}
@@ -2635,15 +2635,18 @@ ZEND_API ZEND_FUNCTION(display_disabled_function)
}
/* }}} */
static zend_function_entry disabled_function[] = {
ZEND_FE(display_disabled_function, NULL)
ZEND_FE_END
};
ZEND_API int zend_disable_function(char *function_name, uint function_name_length TSRMLS_DC) /* {{{ */
{
zend_internal_function *func;
if (zend_hash_find(CG(function_table), function_name, function_name_length+1, (void **)&func)==SUCCESS) {
func->arg_info = NULL;
func->handler = ZEND_FN(display_disabled_function);
return SUCCESS;
if (zend_hash_del(CG(function_table), function_name, function_name_length+1)==FAILURE) {
return FAILURE;
}
return FAILURE;
disabled_function[0].fname = function_name;
return zend_register_functions(NULL, disabled_function, CG(function_table), MODULE_PERSISTENT TSRMLS_CC);
}
/* }}} */
+1 -1
View File
@@ -233,7 +233,7 @@ typedef struct _zend_fcall_info_cache {
#define ZEND_FCI_INITIALIZED(fci) ((fci).size != 0)
ZEND_API int zend_next_free_module(void);
int zend_next_free_module(void);
BEGIN_EXTERN_C()
ZEND_API int zend_get_parameters(int ht, int param_count, ...);
+5 -23
View File
@@ -1931,11 +1931,8 @@ void zend_do_receive_param(zend_uchar op, znode *varname, const znode *initializ
if (class_type->u.constant.type == IS_ARRAY) {
cur_arg_info->type_hint = IS_ARRAY;
if (op == ZEND_RECV_INIT) {
if (Z_TYPE(initialization->u.constant) == IS_NULL || (Z_TYPE(initialization->u.constant) == IS_CONSTANT && !strcasecmp(Z_STRVAL(initialization->u.constant), "NULL"))) {
if (Z_TYPE(initialization->u.constant) == IS_NULL || (Z_TYPE(initialization->u.constant) == IS_CONSTANT && !strcasecmp(Z_STRVAL(initialization->u.constant), "NULL")) || Z_TYPE(initialization->u.constant) == IS_CONSTANT_AST) {
cur_arg_info->allow_null = 1;
} else if (IS_CONSTANT_TYPE(Z_TYPE(initialization->u.constant))) {
/* delay constant resolution and check to run-time */
cur_arg_info->allow_null = 0;
} else if (Z_TYPE(initialization->u.constant) != IS_ARRAY) {
zend_error_noreturn(E_COMPILE_ERROR, "Default value for parameters with array type hint can only be an array or NULL");
}
@@ -1943,11 +1940,8 @@ void zend_do_receive_param(zend_uchar op, znode *varname, const znode *initializ
} else if (class_type->u.constant.type == IS_CALLABLE) {
cur_arg_info->type_hint = IS_CALLABLE;
if (op == ZEND_RECV_INIT) {
if (Z_TYPE(initialization->u.constant) == IS_NULL || (Z_TYPE(initialization->u.constant) == IS_CONSTANT && !strcasecmp(Z_STRVAL(initialization->u.constant), "NULL"))) {
if (Z_TYPE(initialization->u.constant) == IS_NULL || (Z_TYPE(initialization->u.constant) == IS_CONSTANT && !strcasecmp(Z_STRVAL(initialization->u.constant), "NULL")) || Z_TYPE(initialization->u.constant) == IS_CONSTANT_AST) {
cur_arg_info->allow_null = 1;
} else if (IS_CONSTANT_TYPE(Z_TYPE(initialization->u.constant))) {
/* delay constant resolution and check to run-time */
cur_arg_info->allow_null = 0;
} else {
zend_error_noreturn(E_COMPILE_ERROR, "Default value for parameters with callable type hint can only be NULL");
}
@@ -1961,11 +1955,8 @@ void zend_do_receive_param(zend_uchar op, znode *varname, const znode *initializ
cur_arg_info->class_name = Z_STRVAL(class_type->u.constant);
cur_arg_info->class_name_len = Z_STRLEN(class_type->u.constant);
if (op == ZEND_RECV_INIT) {
if (Z_TYPE(initialization->u.constant) == IS_NULL || (Z_TYPE(initialization->u.constant) == IS_CONSTANT && !strcasecmp(Z_STRVAL(initialization->u.constant), "NULL"))) {
if (Z_TYPE(initialization->u.constant) == IS_NULL || (Z_TYPE(initialization->u.constant) == IS_CONSTANT && !strcasecmp(Z_STRVAL(initialization->u.constant), "NULL")) || Z_TYPE(initialization->u.constant) == IS_CONSTANT_AST) {
cur_arg_info->allow_null = 1;
} else if (IS_CONSTANT_TYPE(Z_TYPE(initialization->u.constant))) {
/* delay constant resolution and check to run-time */
cur_arg_info->allow_null = 0;
} else {
zend_error_noreturn(E_COMPILE_ERROR, "Default value for parameters with a class type hint can only be NULL");
}
@@ -4255,8 +4246,8 @@ static void zend_traits_init_trait_structures(zend_class_entry *ce TSRMLS_DC) /*
/* make sure that the trait method is not from a class mentioned in
exclude_from_classes, for consistency */
if (cur_precedence->trait_method->ce == cur_precedence->exclude_from_classes[j]) {
zend_error(E_COMPILE_ERROR,
if (cur_precedence->trait_method->ce == cur_precedence->exclude_from_classes[i]) {
zend_error_noreturn(E_COMPILE_ERROR,
"Inconsistent insteadof definition. "
"The method %s is to be used from %s, but %s is also on the exclude list",
cur_method_ref->method_name,
@@ -6346,15 +6337,6 @@ void zend_do_foreach_begin(znode *foreach_token, znode *open_brackets_token, zno
/* save the location of FETCH_W instruction(s) */
open_brackets_token->u.op.opline_num = get_next_op_number(CG(active_op_array));
zend_do_end_variable_parse(array, BP_VAR_W, 0 TSRMLS_CC);
if (zend_is_function_or_method_call(array)) {
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_SEPARATE;
SET_NODE(opline->op1, array);
SET_UNUSED(opline->op2);
opline->result_type = IS_VAR;
opline->result.var = opline->op1.var;
}
} else {
is_variable = 0;
open_brackets_token->u.op.opline_num = get_next_op_number(CG(active_op_array));
+4 -19
View File
@@ -608,22 +608,7 @@ ZEND_API int zend_verify_arg_error(int error_type, const zend_function *zf, zend
return 0;
}
static int is_null_constant(zval *default_value TSRMLS_DC)
{
if (IS_CONSTANT_TYPE(Z_TYPE_P(default_value))) {
zval constant = *default_value;
zval *constant_ptr = &constant;
zval_update_constant(&constant_ptr, 0 TSRMLS_CC);
if (Z_TYPE(constant) == IS_NULL) {
return 1;
}
zval_dtor(&constant);
}
return 0;
}
static inline int zend_verify_arg_type(zend_function *zf, zend_uint arg_num, zval *arg, ulong fetch_type, zval *default_value TSRMLS_DC)
static inline int zend_verify_arg_type(zend_function *zf, zend_uint arg_num, zval *arg, ulong fetch_type TSRMLS_DC)
{
zend_arg_info *cur_arg_info;
char *need_msg;
@@ -653,7 +638,7 @@ static inline int zend_verify_arg_type(zend_function *zf, zend_uint arg_num, zva
if (!ce || !instanceof_function(Z_OBJCE_P(arg), ce TSRMLS_CC)) {
return zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, need_msg, class_name, "instance of ", Z_OBJCE_P(arg)->name TSRMLS_CC);
}
} else if (Z_TYPE_P(arg) != IS_NULL || !(cur_arg_info->allow_null || (default_value && is_null_constant(default_value TSRMLS_CC)))) {
} else if (Z_TYPE_P(arg) != IS_NULL || !cur_arg_info->allow_null) {
need_msg = zend_verify_arg_class_kind(cur_arg_info, fetch_type, &class_name, &ce TSRMLS_CC);
return zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, need_msg, class_name, zend_zval_type_name(arg), "" TSRMLS_CC);
}
@@ -664,7 +649,7 @@ static inline int zend_verify_arg_type(zend_function *zf, zend_uint arg_num, zva
return zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, "be of the type array", "", "none", "" TSRMLS_CC);
}
if (Z_TYPE_P(arg) != IS_ARRAY && (Z_TYPE_P(arg) != IS_NULL || !(cur_arg_info->allow_null || (default_value && is_null_constant(default_value TSRMLS_CC))))) {
if (Z_TYPE_P(arg) != IS_ARRAY && (Z_TYPE_P(arg) != IS_NULL || !cur_arg_info->allow_null)) {
return zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, "be of the type array", "", zend_zval_type_name(arg), "" TSRMLS_CC);
}
break;
@@ -673,7 +658,7 @@ static inline int zend_verify_arg_type(zend_function *zf, zend_uint arg_num, zva
if (!arg) {
return zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, "be callable", "", "none", "" TSRMLS_CC);
}
if (!zend_is_callable(arg, IS_CALLABLE_CHECK_SILENT, NULL TSRMLS_CC) && (Z_TYPE_P(arg) != IS_NULL || !(cur_arg_info->allow_null || (default_value && is_null_constant(default_value TSRMLS_CC))))) {
if (!zend_is_callable(arg, IS_CALLABLE_CHECK_SILENT, NULL TSRMLS_CC) && (Z_TYPE_P(arg) != IS_NULL || !cur_arg_info->allow_null)) {
return zend_verify_arg_error(E_RECOVERABLE_ERROR, zf, arg_num, "be callable", "", zend_zval_type_name(arg), "" TSRMLS_CC);
}
break;
+9 -6
View File
@@ -1236,10 +1236,6 @@ ZEND_API void zend_timeout(int dummy) /* {{{ */
#ifdef ZEND_WIN32
static LRESULT CALLBACK zend_timeout_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) /* {{{ */
{
#ifdef ZTS
THREAD_T thread_id = (THREAD_T)wParam;
#endif
switch (message) {
case WM_DESTROY:
PostQuitMessage(0);
@@ -1254,7 +1250,7 @@ static LRESULT CALLBACK zend_timeout_WndProc(HWND hWnd, UINT message, WPARAM wPa
#endif
SetTimer(timeout_window, wParam, lParam*1000, NULL);
#ifdef ZTS
tsrm_ls = ts_resource_ex(0, &thread_id);
tsrm_ls = ts_resource_ex(0, &wParam);
if (!tsrm_ls) {
/* shouldn't normally happen */
break;
@@ -1271,7 +1267,7 @@ static LRESULT CALLBACK zend_timeout_WndProc(HWND hWnd, UINT message, WPARAM wPa
#ifdef ZTS
void ***tsrm_ls;
tsrm_ls = ts_resource_ex(0, &thread_id);
tsrm_ls = ts_resource_ex(0, &wParam);
if (!tsrm_ls) {
/* Thread died before receiving its timeout? */
break;
@@ -1660,6 +1656,13 @@ ZEND_API void zend_rebuild_symbol_table(TSRMLS_D) /* {{{ */
/*printf("Cache miss! Initialized %x\n", EG(active_symbol_table));*/
}
ex->symbol_table = EG(active_symbol_table);
if (ex->op_array->this_var != -1 &&
!*EX_CV_NUM(ex, ex->op_array->this_var) &&
EG(This)) {
*EX_CV_NUM(ex, ex->op_array->this_var) = (zval**)EX_CV_NUM(ex, ex->op_array->last_var + ex->op_array->this_var);
**EX_CV_NUM(ex, ex->op_array->this_var) = EG(This);
}
for (i = 0; i < ex->op_array->last_var; i++) {
if (*EX_CV_NUM(ex, i)) {
zend_hash_quick_update(EG(active_symbol_table),
+1 -1
View File
@@ -111,7 +111,7 @@ END_EXTERN_C()
ZEND_API extern zend_llist zend_extensions;
void zend_extension_dtor(zend_extension *extension);
ZEND_API void zend_append_version_info(const zend_extension *extension);
void zend_append_version_info(const zend_extension *extension);
int zend_startup_extensions_mechanism(void);
int zend_startup_extensions(void);
void zend_shutdown_extensions(TSRMLS_D);
-4
View File
@@ -21,8 +21,6 @@
#ifndef ZEND_FLOAT_H
#define ZEND_FLOAT_H
BEGIN_EXTERN_C()
/*
Define functions for FP initialization and de-initialization.
*/
@@ -30,8 +28,6 @@ extern ZEND_API void zend_init_fpu(TSRMLS_D);
extern ZEND_API void zend_shutdown_fpu(TSRMLS_D);
extern ZEND_API void zend_ensure_fpu_mode(TSRMLS_D);
END_EXTERN_C()
/* Copy of the contents of xpfpa.h (which is under public domain)
See http://wiki.php.net/rfc/rounding for details.
+3 -6
View File
@@ -786,6 +786,9 @@ static zval **zend_std_get_property_ptr_ptr(zval *object, zval *member, int type
/* we don't have access controls - will just add it */
new_zval = &EG(uninitialized_zval);
if(UNEXPECTED(type == BP_VAR_RW || type == BP_VAR_R)) {
zend_error(E_NOTICE, "Undefined property: %s::$%s", zobj->ce->name, Z_STRVAL_P(member));
}
Z_ADDREF_P(new_zval);
if (EXPECTED((property_info->flags & ZEND_ACC_STATIC) == 0) &&
property_info->offset >= 0) {
@@ -805,12 +808,6 @@ static zval **zend_std_get_property_ptr_ptr(zval *object, zval *member, int type
}
zend_hash_quick_update(zobj->properties, property_info->name, property_info->name_length+1, property_info->h, &new_zval, sizeof(zval *), (void **) &retval);
}
/* Notice is thrown after creation of the property, to avoid EG(std_property_info)
* being overwritten in an error handler. */
if (UNEXPECTED(type == BP_VAR_RW || type == BP_VAR_R)) {
zend_error(E_NOTICE, "Undefined property: %s::$%s", zobj->ce->name, Z_STRVAL_P(member));
}
} else {
/* we do have getter - fail and let it try again with usual get/set */
retval = NULL;
+1 -1
View File
@@ -137,9 +137,9 @@ ZEND_API void _zval_copy_ctor_func(zval *zvalue ZEND_FILE_LINE_DC)
}
ALLOC_HASHTABLE_REL(tmp_ht);
zend_hash_init(tmp_ht, zend_hash_num_elements(original_ht), NULL, ZVAL_PTR_DTOR, 0);
zvalue->value.ht = tmp_ht;
zend_hash_copy(tmp_ht, original_ht, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
tmp_ht->nNextFreeElement = original_ht->nNextFreeElement;
zvalue->value.ht = tmp_ht;
}
break;
case IS_CONSTANT_AST:
-4
View File
@@ -21,13 +21,9 @@
#ifndef ZEND_VM_H
#define ZEND_VM_H
BEGIN_EXTERN_C()
ZEND_API void zend_vm_use_old_executor(void);
ZEND_API void zend_vm_set_opcode_handler(zend_op* opcode);
END_EXTERN_C()
#define ZEND_VM_SET_OPCODE_HANDLER(opline) zend_vm_set_opcode_handler(opline)
#endif
+5 -5
View File
@@ -1961,7 +1961,7 @@ ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY)
void **p = EX(function_state).arguments - num_args;
for (i = 0; i < num_args; ++i, ++p) {
zend_verify_arg_type(fbc, i + 1, (zval *) *p, 0, NULL TSRMLS_CC);
zend_verify_arg_type(fbc, i + 1, (zval *) *p, 0 TSRMLS_CC);
}
}
@@ -3374,7 +3374,7 @@ ZEND_VM_HANDLER(63, ZEND_RECV, ANY, ANY)
SAVE_OPLINE();
if (UNEXPECTED(param == NULL)) {
if (zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, NULL, opline->extended_value, NULL TSRMLS_CC)) {
if (zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, NULL, opline->extended_value TSRMLS_CC)) {
const char *space;
const char *class_name;
zend_execute_data *ptr;
@@ -3396,7 +3396,7 @@ ZEND_VM_HANDLER(63, ZEND_RECV, ANY, ANY)
} else {
zval **var_ptr;
zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, *param, opline->extended_value, NULL TSRMLS_CC);
zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, *param, opline->extended_value TSRMLS_CC);
var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->result.var TSRMLS_CC);
Z_DELREF_PP(var_ptr);
*var_ptr = *param;
@@ -3438,7 +3438,7 @@ ZEND_VM_HANDLER(64, ZEND_RECV_INIT, ANY, CONST)
Z_ADDREF_P(assignment_value);
}
zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, assignment_value, opline->extended_value, opline->op2.zv TSRMLS_CC);
zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, assignment_value, opline->extended_value TSRMLS_CC);
var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->result.var TSRMLS_CC);
zval_ptr_dtor(var_ptr);
*var_ptr = assignment_value;
@@ -3469,7 +3469,7 @@ ZEND_VM_HANDLER(164, ZEND_RECV_VARIADIC, ANY, ANY)
for (; arg_num <= arg_count; ++arg_num) {
zval **param = zend_vm_stack_get_arg(arg_num TSRMLS_CC);
zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, *param, opline->extended_value, NULL TSRMLS_CC);
zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, *param, opline->extended_value TSRMLS_CC);
zend_hash_next_index_insert(Z_ARRVAL_P(params), param, sizeof(zval *), NULL);
Z_ADDREF_PP(param);
}
+5 -5
View File
@@ -541,7 +541,7 @@ static int ZEND_FASTCALL zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_AR
void **p = EX(function_state).arguments - num_args;
for (i = 0; i < num_args; ++i, ++p) {
zend_verify_arg_type(fbc, i + 1, (zval *) *p, 0, NULL TSRMLS_CC);
zend_verify_arg_type(fbc, i + 1, (zval *) *p, 0 TSRMLS_CC);
}
}
@@ -861,7 +861,7 @@ static int ZEND_FASTCALL ZEND_RECV_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
if (UNEXPECTED(param == NULL)) {
if (zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, NULL, opline->extended_value, NULL TSRMLS_CC)) {
if (zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, NULL, opline->extended_value TSRMLS_CC)) {
const char *space;
const char *class_name;
zend_execute_data *ptr;
@@ -883,7 +883,7 @@ static int ZEND_FASTCALL ZEND_RECV_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
} else {
zval **var_ptr;
zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, *param, opline->extended_value, NULL TSRMLS_CC);
zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, *param, opline->extended_value TSRMLS_CC);
var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->result.var TSRMLS_CC);
Z_DELREF_PP(var_ptr);
*var_ptr = *param;
@@ -916,7 +916,7 @@ static int ZEND_FASTCALL ZEND_RECV_VARIADIC_SPEC_HANDLER(ZEND_OPCODE_HANDLER_AR
for (; arg_num <= arg_count; ++arg_num) {
zval **param = zend_vm_stack_get_arg(arg_num TSRMLS_CC);
zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, *param, opline->extended_value, NULL TSRMLS_CC);
zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, *param, opline->extended_value TSRMLS_CC);
zend_hash_next_index_insert(Z_ARRVAL_P(params), param, sizeof(zval *), NULL);
Z_ADDREF_PP(param);
}
@@ -1643,7 +1643,7 @@ static int ZEND_FASTCALL ZEND_RECV_INIT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_
Z_ADDREF_P(assignment_value);
}
zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, assignment_value, opline->extended_value, opline->op2.zv TSRMLS_CC);
zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, assignment_value, opline->extended_value TSRMLS_CC);
var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->result.var TSRMLS_CC);
zval_ptr_dtor(var_ptr);
*var_ptr = assignment_value;
-2
View File
@@ -1208,9 +1208,7 @@ function gen_vm($def, $skel) {
out($f, $GLOBALS['header_text']);
fputs($f, "#ifndef ZEND_VM_OPCODES_H\n#define ZEND_VM_OPCODES_H\n\n");
fputs($f, "BEGIN_EXTERN_C()\n\n");
fputs($f, "ZEND_API const char *zend_get_opcode_name(zend_uchar opcode);\n\n");
fputs($f, "END_EXTERN_C()\n\n");
foreach ($opcodes as $code => $dsc) {
$code = str_pad((string)$code,$code_len," ",STR_PAD_LEFT);
-4
View File
@@ -21,12 +21,8 @@
#ifndef ZEND_VM_OPCODES_H
#define ZEND_VM_OPCODES_H
BEGIN_EXTERN_C()
ZEND_API const char *zend_get_opcode_name(zend_uchar opcode);
END_EXTERN_C()
#define ZEND_NOP 0
#define ZEND_ADD 1
#define ZEND_SUB 2
+1 -1
View File
@@ -119,7 +119,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
PHP_MAJOR_VERSION=5
PHP_MINOR_VERSION=6
PHP_RELEASE_VERSION=4
PHP_RELEASE_VERSION=1
PHP_EXTRA_VERSION=""
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION`
+1 -1
View File
@@ -47,7 +47,7 @@
*
* CALENDAR OVERVIEW
*
* Julius Caesar created the calendar in 46 B.C. as a modified form of
* Julias Ceasar created the calendar in 46 B.C. as a modified form of
* the old Roman republican calendar which was based on lunar cycles.
* The new Julian calendar set fixed lengths for the months, abandoning
* the lunar cycle. It also specified that there would be exactly 12
+2 -2
View File
@@ -21,10 +21,10 @@ putenv('TZ=UTC');
// -uses --INI-- section with date.timezone=UTC
// -uses putenv('TZ=UTC')
// date.timezone=UTC
// -if omitted from easter_date.phpt, outputs DATE_TZ_ERRMSG warning
// -if ommitted from easter_date.phpt, outputs DATE_TZ_ERRMSG warning
// -easter_date() calls mktime() and localtime()
// -whereas unixtojd(1000000000) calls localtime(1000000000)
// -if omitted from unixtojd.phpt, does NOT output DATE_TZ_ERRMSG
// -if ommitted from unixtojd.phpt, does NOT output DATE_TZ_ERRMSG
//
// unixtojd() calls php_localtime_r() which for Pacific timezone systems, returns a time -8 hours
// -this incorrect localtime is passed to the julian date conversion (GregorianToSDN) function which works (probably correctly)
-11
View File
@@ -169,11 +169,6 @@ static int php_curl_option_str(php_curl *ch, long option, const char *str, const
{
CURLcode error = CURLE_OK;
if (strlen(str) != len) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Curl option contains invalid characters (\\0)");
return FAILURE;
}
#if LIBCURL_VERSION_NUM >= 0x071100
if (make_copy) {
#endif
@@ -1194,12 +1189,6 @@ PHP_MINIT_FUNCTION(curl)
REGISTER_CURL_CONSTANT(CURLSSLOPT_ALLOW_BEAST);
#endif
#if LIBCURL_VERSION_NUM >= 0x072200 /* Available since 7.34.0 */
REGISTER_CURL_CONSTANT(CURL_SSLVERSION_TLSv1_0);
REGISTER_CURL_CONSTANT(CURL_SSLVERSION_TLSv1_1);
REGISTER_CURL_CONSTANT(CURL_SSLVERSION_TLSv1_2);
#endif
#if CURLOPT_FTPASCII != 0
REGISTER_CURL_CONSTANT(CURLOPT_FTPASCII);
#endif
-18
View File
@@ -1,18 +0,0 @@
--TEST--
Bug #68089 (NULL byte injection - cURL lib)
--SKIPIF--
<?php
include 'skipif.inc';
?>
--FILE--
<?php
$url = "file:///etc/passwd\0http://google.com";
$ch = curl_init();
var_dump(curl_setopt($ch, CURLOPT_URL, $url));
?>
Done
--EXPECTF--
Warning: curl_setopt(): Curl option contains invalid characters (\0) in %s%ebug68089.php on line 4
bool(false)
Done
+1 -1
View File
@@ -28,7 +28,7 @@ Features
AsynchDNS => Yes
CharConv => No
Debug => No
GSS-Negotiate => No
GSS-Negotiate => Yes
IDN => Yes
IPv6 => Yes
krb4 => No
-27
View File
@@ -1,27 +0,0 @@
--TEST--
Test curl_multi_init() fail if any parameter is passed
--CREDITS--
Paulo Eduardo <pauloelr [at] gmail [dot] com>
#testfest SP 2014
--SKIPIF--
<?php if (!extension_loaded("curl")) print "skip"; ?>
--FILE--
<?php
/* Prototype : resource curl_multi_init(void)
* Description : Returns a new cURL multi handle
* Source code : ext/curl/multi.c
* Test documentation: http://wiki.php.net/qa/temp/ext/curl
*/
// start testing
//create the multiple cURL handle
$mh = curl_multi_init('test');
var_dump($mh);
?>
===DONE===
--EXPECTF--
Warning: curl_multi_init() expects exactly 0 parameters, %d given in %s on line %d
NULL
===DONE===
+3 -15
View File
@@ -23,21 +23,9 @@
static int m_table_common[13] = { -1, 0, 3, 3, 6, 1, 4, 6, 2, 5, 0, 3, 5 }; /* 1 = jan */
static int m_table_leap[13] = { -1, 6, 2, 3, 6, 1, 4, 6, 2, 5, 0, 3, 5 }; /* 1 = jan */
static timelib_sll positive_mod(timelib_sll x, timelib_sll y)
{
timelib_sll tmp;
tmp = x % y;
if (tmp < 0) {
tmp += y;
}
return tmp;
}
static timelib_sll century_value(timelib_sll j)
{
return 6 - positive_mod(j, 4) * 2;
return 6 - (j % 4) * 2;
}
static timelib_sll timelib_day_of_week_ex(timelib_sll y, timelib_sll m, timelib_sll d, int iso)
@@ -48,9 +36,9 @@ static timelib_sll timelib_day_of_week_ex(timelib_sll y, timelib_sll m, timelib_
* Julian calendar. We just return the 'wrong' day of week to be
* consistent. */
c1 = century_value(y / 100);
y1 = positive_mod(y, 100);
y1 = (y % 100);
m1 = timelib_is_leap(y) ? m_table_leap[m] : m_table_common[m];
dow = positive_mod((c1 + y1 + m1 + (y1 / 4) + d), 7);
dow = (c1 + y1 + m1 + (y1 / 4) + d) % 7;
if (iso) {
if (dow == 0) {
dow = 7;
+3 -3
View File
@@ -336,7 +336,7 @@ static ttinfo* fetch_timezone_offset(timelib_tzinfo *tz, timelib_sll ts, timelib
{
uint32_t i;
/* If there is no transition time, we pick the first one, if that doesn't
/* If there is no transistion time, we pick the first one, if that doesn't
* exist we return NULL */
if (!tz->timecnt || !tz->trans) {
*transition_time = 0;
@@ -346,8 +346,8 @@ static ttinfo* fetch_timezone_offset(timelib_tzinfo *tz, timelib_sll ts, timelib
return NULL;
}
/* If the TS is lower than the first transition time, then we scan over
* all the transition times to find the first non-DST one, or the first
/* If the TS is lower than the first transistion time, then we scan over
* all the transistion times to find the first non-DST one, or the first
* one in case there are only DST entries. Not sure which smartass came up
* with this idea in the first though :) */
if (ts < tz->trans[0]) {
+761 -798
View File
File diff suppressed because it is too large. Load diff
+4 -4
View File
@@ -330,7 +330,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_timezone_offset_get, 0, 0, 2)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_timezone_method_offset_get, 0, 0, 1)
ZEND_ARG_INFO(0, object)
ZEND_ARG_INFO(0, datetime)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_timezone_transitions_get, 0, 0, 1)
@@ -3848,7 +3848,7 @@ PHP_FUNCTION(timezone_name_from_abbr)
}
/* }}} */
/* {{{ proto long timezone_offset_get(DateTimeZone object, DateTimeInterface object)
/* {{{ proto long timezone_offset_get(DateTimeZone object, DateTime object)
Returns the timezone offset.
*/
PHP_FUNCTION(timezone_offset_get)
@@ -3858,13 +3858,13 @@ PHP_FUNCTION(timezone_offset_get)
php_date_obj *dateobj;
timelib_time_offset *offset;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &object, date_ce_timezone, &dateobject, date_ce_interface) == FAILURE) {
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &object, date_ce_timezone, &dateobject, date_ce_date) == FAILURE) {
RETURN_FALSE;
}
tzobj = (php_timezone_obj *) zend_object_store_get_object(object TSRMLS_CC);
DATE_CHECK_INITIALIZED(tzobj->initialized, DateTimeZone);
dateobj = (php_date_obj *) zend_object_store_get_object(dateobject TSRMLS_CC);
DATE_CHECK_INITIALIZED(dateobj->time, DateTimeInterface);
DATE_CHECK_INITIALIZED(dateobj->time, DateTime);
switch (tzobj->type) {
case TIMELIB_ZONETYPE_ID:
+1 -1
View File
@@ -3,7 +3,7 @@ strtotime() function
--SKIPIF--
<?php
if (!@putenv("TZ=EST5") || getenv("TZ") != 'EST5') {
die("skip unable to change TZ environment variable\n");
die("skip unable to change TZ enviroment variable\n");
}
?>
--FILE--
-13
View File
@@ -1,13 +0,0 @@
--TEST--
DateTimeZone::getOffset() accepts a DateTimeInterface object
--FILE--
<?php
$tz = new DateTimeZone('Europe/London');
$dt = new DateTimeImmutable('2014-09-20', $tz);
echo $tz->getOffset($dt);
echo $tz->getOffset(1);
--EXPECTF--
3600
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, integer given in %s
@@ -112,141 +112,141 @@ fclose( $file_handle );
-- int 0 --
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, integer given in %s on line %d
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, integer given in %s on line %d
bool(false)
-- int 1 --
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, integer given in %s on line %d
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, integer given in %s on line %d
bool(false)
-- int 12345 --
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, integer given in %s on line %d
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, integer given in %s on line %d
bool(false)
-- int -12345 --
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, integer given in %s on line %d
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, integer given in %s on line %d
bool(false)
-- float 10.5 --
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, double given in %s on line %d
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, double given in %s on line %d
bool(false)
-- float -10.5 --
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, double given in %s on line %d
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, double given in %s on line %d
bool(false)
-- float .5 --
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, double given in %s on line %d
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, double given in %s on line %d
bool(false)
-- empty array --
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, array given in %s on line %d
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, array given in %s on line %d
bool(false)
-- int indexed array --
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, array given in %s on line %d
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, array given in %s on line %d
bool(false)
-- associative array --
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, array given in %s on line %d
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, array given in %s on line %d
bool(false)
-- nested arrays --
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, array given in %s on line %d
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, array given in %s on line %d
bool(false)
-- uppercase NULL --
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, null given in %s on line %d
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, null given in %s on line %d
bool(false)
-- lowercase null --
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, null given in %s on line %d
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, null given in %s on line %d
bool(false)
-- lowercase true --
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, boolean given in %s on line %d
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, boolean given in %s on line %d
bool(false)
-- lowercase false --
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, boolean given in %s on line %d
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, boolean given in %s on line %d
bool(false)
-- uppercase TRUE --
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, boolean given in %s on line %d
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, boolean given in %s on line %d
bool(false)
-- uppercase FALSE --
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, boolean given in %s on line %d
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, boolean given in %s on line %d
bool(false)
-- empty string DQ --
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, string given in %s on line %d
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, string given in %s on line %d
bool(false)
-- empty string SQ --
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, string given in %s on line %d
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, string given in %s on line %d
bool(false)
-- string DQ --
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, string given in %s on line %d
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, string given in %s on line %d
bool(false)
-- string SQ --
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, string given in %s on line %d
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, string given in %s on line %d
bool(false)
-- mixed case string --
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, string given in %s on line %d
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, string given in %s on line %d
bool(false)
-- heredoc --
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, string given in %s on line %d
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, string given in %s on line %d
bool(false)
-- instance of classWithToString --
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, object given in %s on line %d
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, object given in %s on line %d
bool(false)
-- instance of classWithoutToString --
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, object given in %s on line %d
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, object given in %s on line %d
bool(false)
-- undefined var --
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, null given in %s on line %d
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, null given in %s on line %d
bool(false)
-- unset var --
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, null given in %s on line %d
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, null given in %s on line %d
bool(false)
-- resource --
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, resource given in %s on line %d
Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, resource given in %s on line %d
bool(false)
===DONE===
@@ -145,7 +145,7 @@ object(DateTime)#%d (3) {
-- int -12345 --
object(DateTime)#%d (3) {
["date"]=>
string(28) "-12345-02-11 08:34:10.000000"
string(28) "-12345-02-15 08:34:10.000000"
["timezone_type"]=>
int(3)
["timezone"]=>
@@ -165,7 +165,7 @@ object(DateTime)#%d (3) {
-- float -10.5 --
object(DateTime)#%d (3) {
["date"]=>
string(27) "-0010-02-14 08:34:10.000000"
string(27) "-0010-02-19 08:34:10.000000"
["timezone_type"]=>
int(3)
["timezone"]=>
+1 -1
View File
@@ -8,7 +8,7 @@ if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
die("skip. set TZ env is not supported at runtime.");
}
if (!@putenv("TZ=US/Eastern") || getenv("TZ") != 'US/Eastern') {
die("skip unable to change TZ environment variable\n");
die("skip unable to change TZ enviroment variable\n");
}
?>
--FILE--
+1 -1
View File
@@ -4,7 +4,7 @@ Bug #26317 (military timezone offset signedness)
date.timezone=GMT0
--SKIPIF--
if (!@putenv("TZ=GMT0") || getenv("TZ") != 'GMT0') {
die("skip unable to change TZ environment variable\n");
die("skip unable to change TZ enviroment variable\n");
}
--FILE--
<?php
+1 -1
View File
@@ -4,7 +4,7 @@ Bug #26320 (strtotime handling of XML Schema/ISO 8601 format)
date.timezone=GMT0
--SKIPIF--
if (!@putenv("TZ=GMT0") || getenv("TZ") != 'GMT0') {
die("skip unable to change TZ environment variable\n");
die("skip unable to change TZ enviroment variable\n");
}
--FILE--
<?php
+2 -3
View File
@@ -10,8 +10,7 @@ var_dump($date->format('r'));
$date->setDate(-2147483648, 1, 1);
var_dump($date->format('r'));
var_dump($date->format('c'));
?>
--EXPECT--
string(32) "Fri, 01 Jan -1500 00:00:00 +0000"
string(38) "Mon, 01 Jan -2147483648 00:00:00 +0000"
string(32) "Sat, 01 Jan -1500 00:00:00 +0000"
string(42) "Unknown, 01 Jan -2147483648 00:00:00 +0000"
string(32) "-2147483648-01-01T00:00:00+00:00"
@@ -1,34 +0,0 @@
--TEST--
Test date_interval_create_from_date_string() function : basic functionality
--CREDITS--
Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
--FILE--
<?php
$string = '1 day'; //P1D
$i = date_interval_create_from_date_string($string);
var_dump($i->d);
$string = '2 weeks'; //14 days
$i = date_interval_create_from_date_string($string);
var_dump($i->d);
$string = '3 months';
$i = date_interval_create_from_date_string($string);
var_dump($i->m);
$string = '4 years';
$i = date_interval_create_from_date_string($string);
var_dump($i->y);
$string = '1 year + 1 day';
$i = date_interval_create_from_date_string($string);
var_dump($i->y);
var_dump($i->d);
?>
--EXPECTF--
int(1)
int(14)
int(3)
int(4)
int(1)
int(1)
@@ -1,42 +0,0 @@
--TEST--
Test date_interval_create_from_date_string() function : null parameter
--CREDITS--
Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
--FILE--
<?php
$i = date_interval_create_from_date_string(null); //returns a empty object
var_dump($i);
?>
--EXPECTF--
object(DateInterval)#1 (15) {
["y"]=>
int(0)
["m"]=>
int(0)
["d"]=>
int(0)
["h"]=>
int(0)
["i"]=>
int(0)
["s"]=>
int(0)
["weekday"]=>
int(0)
["weekday_behavior"]=>
int(0)
["first_last_day_of"]=>
int(0)
["invert"]=>
int(0)
["days"]=>
int(0)
["special_type"]=>
int(0)
["special_amount"]=>
int(0)
["have_weekday_relative"]=>
int(0)
["have_special_relative"]=>
int(0)
}
@@ -1,11 +0,0 @@
--TEST--
Test date_interval_create_from_date_string() function : wrong parameter (array)
--CREDITS--
Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
--FILE--
<?php
$wrong_parameter = array();
$i = date_interval_create_from_date_string($wrong_parameter);
?>
--EXPECTF--
Warning: date_interval_create_from_date_string() expects parameter 1 to be string, array given in %s on line %d
@@ -1,9 +0,0 @@
--TEST--
Test date_interval_create_from_date_string() function : with 2 parameters (wrong).
Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
--FILE--
<?php
$i = date_interval_create_from_date_string('1 year', 'wrong');
?>
--EXPECTF--
Warning: date_interval_create_from_date_string() expects exactly 1 parameter, 2 given in %s on line %d
@@ -145,7 +145,7 @@ object(DateTime)#%d (3) {
-- int -12345 --
object(DateTime)#%d (3) {
["date"]=>
string(28) "-12345-02-11 08:34:10.000000"
string(28) "-12345-02-15 08:34:10.000000"
["timezone_type"]=>
int(3)
["timezone"]=>
@@ -165,7 +165,7 @@ object(DateTime)#%d (3) {
-- float -10.5 --
object(DateTime)#%d (3) {
["date"]=>
string(27) "-0010-02-14 08:34:10.000000"
string(27) "-0010-02-19 08:34:10.000000"
["timezone_type"]=>
int(3)
["timezone"]=>
-19
View File
@@ -1,19 +0,0 @@
--TEST--
Test the basics to function date_timestamp_set().
--CREDITS--
Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
--INI--
date.timezone = UTC;
date_default_timezone_set("America/Sao_Paulo");
--FILE--
<?php
$dftz021 = date_default_timezone_get(); //UTC
$dtms021 = date_create();
date_timestamp_set($dtms021, 1234567890);
var_dump(date_format($dtms021, 'B => (U) => T Y-M-d H:i:s'));
?>
--EXPECTF--
string(47) "021 => (1234567890) => UTC 2009-Feb-13 23:31:30"
@@ -1,17 +0,0 @@
--TEST--
Test the function date_timestamp_set() with first null parameter.
--CREDITS--
Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
--INI--
date.timezone = UTC;
date_default_timezone_set("America/Sao_Paulo");
--FILE--
<?php
$dftz021 = date_default_timezone_get(); //UTC
$dtms021 = date_create();
date_timestamp_set(null, 1234567890);
?>
--EXPECTF--
Warning: date_timestamp_set() expects parameter 1 to be DateTime, null given in %s on line %d
@@ -1,24 +0,0 @@
--TEST--
Test the function date_timestamp_set() with second null parameter.
--CREDITS--
Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
--INI--
date.timezone = UTC;
date_default_timezone_set("America/Sao_Paulo");
--FILE--
<?php
$dftz021 = date_default_timezone_get(); //UTC
$dtms021 = date_create();
var_dump(date_timestamp_set($dtms021, null));
?>
--EXPECTF--
object(DateTime)#1 (3) {
["date"]=>
string(26) "1970-01-01 00:00:00.000000"
["timezone_type"]=>
int(3)
["timezone"]=>
string(3) "UTC"
}
@@ -1,17 +0,0 @@
--TEST--
Check the function date_timestamp_set() with first parameter wrong (array).
--CREDITS--
Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
--INI--
date.timezone = UTC;
date_default_timezone_set("America/Sao_Paulo");
--FILE--
<?php
$dftz021 = date_default_timezone_get(); //UTC
$dtms021 = array();
date_timestamp_set($dtms021, 123456789);
?>
--EXPECTF--
Warning: date_timestamp_set() expects parameter 1 to be DateTime, array given in %s on line %d
@@ -1,15 +0,0 @@
--TEST--
Check the function date_timestamp_set() with first parameter wrong (integer).
--CREDITS--
Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
--INI--
date.timezone = UTC;
date_default_timezone_set("America/Sao_Paulo");
--FILE--
<?php
$dftz021 = date_default_timezone_get(); //UTC
date_timestamp_set(987654321, 123456789);
?>
--EXPECTF--
Warning: date_timestamp_set() expects parameter 1 to be DateTime, integer given in %s on line %d
@@ -1,19 +0,0 @@
--TEST--
Check the function date_timestamp_set() with second parameter wrong (array).
--CREDITS--
Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
--INI--
date.timezone = UTC;
date_default_timezone_set("America/Sao_Paulo");
--FILE--
<?php
$dftz021 = date_default_timezone_get(); //UTC
$dtms021 = new DateTime();
$wrong_parameter = array();
date_timestamp_set($dtms021, $wrong_parameter);
?>
--EXPECTF--
Warning: date_timestamp_set() expects parameter 2 to be long, array given in %s on line %d
@@ -1,17 +0,0 @@
--TEST--
Check the function date_timestamp_set() with 3 parameters.
--CREDITS--
Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
--INI--
date.timezone = UTC;
date_default_timezone_set("America/Sao_Paulo");
--FILE--
<?php
$dftz021 = date_default_timezone_get(); //UTC
$dtms021 = new DateTime();
date_timestamp_set($dtms021, 123456789, 'error');
?>
--EXPECTF--
Warning: date_timestamp_set() expects exactly 2 parameters, 3 given in %s on line %d
+2 -2
View File
@@ -61,7 +61,7 @@ array\(11\) {
\["mday"\]=>
int\((9|14|23)\)
\["wday"\]=>
int\(0\)
int\((6|-4)\)
\["mon"\]=>
int\((10|12)\)
\["year"\]=>
@@ -69,7 +69,7 @@ array\(11\) {
\["yday"\]=>
int\((282|347|295)\)
\["weekday"\]=>
string\(6\) "Sunday"
string\((8|7)\) "(Saturday|Unknown)"
\["month"\]=>
string\((7|8)\) "(October|December)"
\[0\]=>
+2 -2
View File
@@ -87,7 +87,7 @@ array\(9\) {
\[5\]=>
int\((104|1|-3843)\)
\[6\]=>
int\(6\)
int\((5|-5)\)
\[7\]=>
int\((281|346|294)\)
\[8\]=>
@@ -107,7 +107,7 @@ array\(9\) {
\["tm_year"\]=>
int\((104|1|-3843)\)
\["tm_wday"\]=>
int\(6\)
int\((5|-5)\)
\["tm_yday"\]=>
int\((281|346|294)\)
\["tm_isdst"\]=>
@@ -73,12 +73,12 @@ bool(false)
-- Testing timezone_offset_get() function with an invalid values for $datetime argument --
Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, object given in %s on line %d
Warning: timezone_offset_get() expects parameter 2 to be DateTime, object given in %s on line %d
bool(false)
Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, integer given in %s on line %d
Warning: timezone_offset_get() expects parameter 2 to be DateTime, integer given in %s on line %d
bool(false)
Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, null given in %s on line %d
Warning: timezone_offset_get() expects parameter 2 to be DateTime, null given in %s on line %d
bool(false)
===DONE===
@@ -112,141 +112,141 @@ fclose( $file_handle );
-- int 0 --
Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, integer given in %s on line %d
Warning: timezone_offset_get() expects parameter 2 to be DateTime, integer given in %s on line %d
bool(false)
-- int 1 --
Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, integer given in %s on line %d
Warning: timezone_offset_get() expects parameter 2 to be DateTime, integer given in %s on line %d
bool(false)
-- int 12345 --
Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, integer given in %s on line %d
Warning: timezone_offset_get() expects parameter 2 to be DateTime, integer given in %s on line %d
bool(false)
-- int -12345 --
Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, integer given in %s on line %d
Warning: timezone_offset_get() expects parameter 2 to be DateTime, integer given in %s on line %d
bool(false)
-- float 10.5 --
Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, double given in %s on line %d
Warning: timezone_offset_get() expects parameter 2 to be DateTime, double given in %s on line %d
bool(false)
-- float -10.5 --
Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, double given in %s on line %d
Warning: timezone_offset_get() expects parameter 2 to be DateTime, double given in %s on line %d
bool(false)
-- float .5 --
Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, double given in %s on line %d
Warning: timezone_offset_get() expects parameter 2 to be DateTime, double given in %s on line %d
bool(false)
-- empty array --
Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, array given in %s on line %d
Warning: timezone_offset_get() expects parameter 2 to be DateTime, array given in %s on line %d
bool(false)
-- int indexed array --
Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, array given in %s on line %d
Warning: timezone_offset_get() expects parameter 2 to be DateTime, array given in %s on line %d
bool(false)
-- associative array --
Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, array given in %s on line %d
Warning: timezone_offset_get() expects parameter 2 to be DateTime, array given in %s on line %d
bool(false)
-- nested arrays --
Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, array given in %s on line %d
Warning: timezone_offset_get() expects parameter 2 to be DateTime, array given in %s on line %d
bool(false)
-- uppercase NULL --
Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, null given in %s on line %d
Warning: timezone_offset_get() expects parameter 2 to be DateTime, null given in %s on line %d
bool(false)
-- lowercase null --
Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, null given in %s on line %d
Warning: timezone_offset_get() expects parameter 2 to be DateTime, null given in %s on line %d
bool(false)
-- lowercase true --
Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, boolean given in %s on line %d
Warning: timezone_offset_get() expects parameter 2 to be DateTime, boolean given in %s on line %d
bool(false)
-- lowercase false --
Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, boolean given in %s on line %d
Warning: timezone_offset_get() expects parameter 2 to be DateTime, boolean given in %s on line %d
bool(false)
-- uppercase TRUE --
Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, boolean given in %s on line %d
Warning: timezone_offset_get() expects parameter 2 to be DateTime, boolean given in %s on line %d
bool(false)
-- uppercase FALSE --
Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, boolean given in %s on line %d
Warning: timezone_offset_get() expects parameter 2 to be DateTime, boolean given in %s on line %d
bool(false)
-- empty string DQ --
Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, string given in %s on line %d
Warning: timezone_offset_get() expects parameter 2 to be DateTime, string given in %s on line %d
bool(false)
-- empty string SQ --
Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, string given in %s on line %d
Warning: timezone_offset_get() expects parameter 2 to be DateTime, string given in %s on line %d
bool(false)
-- string DQ --
Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, string given in %s on line %d
Warning: timezone_offset_get() expects parameter 2 to be DateTime, string given in %s on line %d
bool(false)
-- string SQ --
Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, string given in %s on line %d
Warning: timezone_offset_get() expects parameter 2 to be DateTime, string given in %s on line %d
bool(false)
-- mixed case string --
Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, string given in %s on line %d
Warning: timezone_offset_get() expects parameter 2 to be DateTime, string given in %s on line %d
bool(false)
-- heredoc --
Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, string given in %s on line %d
Warning: timezone_offset_get() expects parameter 2 to be DateTime, string given in %s on line %d
bool(false)
-- instance of classWithToString --
Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, object given in %s on line %d
Warning: timezone_offset_get() expects parameter 2 to be DateTime, object given in %s on line %d
bool(false)
-- instance of classWithoutToString --
Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, object given in %s on line %d
Warning: timezone_offset_get() expects parameter 2 to be DateTime, object given in %s on line %d
bool(false)
-- undefined var --
Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, null given in %s on line %d
Warning: timezone_offset_get() expects parameter 2 to be DateTime, null given in %s on line %d
bool(false)
-- unset var --
Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, null given in %s on line %d
Warning: timezone_offset_get() expects parameter 2 to be DateTime, null given in %s on line %d
bool(false)
-- resource --
Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, resource given in %s on line %d
Warning: timezone_offset_get() expects parameter 2 to be DateTime, resource given in %s on line %d
bool(false)
===DONE===
-13
View File
@@ -1,13 +0,0 @@
--TEST--
Test the basics to function timezone_version_get().
--CREDITS--
Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
--INI--
date.timezone = UTC;
date_default_timezone_set("America/Sao_Paulo");
--FILE--
<?php
var_dump(timezone_version_get());
?>
--EXPECTREGEX--
string\([6-7]\) \"20[0-9][0-9]\.[1-9][0-9]?\"
@@ -1,12 +0,0 @@
--TEST--
timezone_version_get: Test that timezone_location_get returns a date concatenated with a dot and a version number
--CREDITS--
Rodrigo Wanderley de Melo Cardoso <rodrigogepem@gmail.com>
#PHPTestFest2014 São Paulo 2014-07-05
--INI--
date.timezone=UTC
--FILE--
<?php $versionTimezone = timezone_version_get();
echo $versionTimezone; ?>
--EXPECTREGEX--
^[12][0-9]{3}.[0-9]+$
-2
View File
@@ -137,8 +137,6 @@ int dom_node_text_content_write(dom_object *obj, zval *newval TSRMLS_DC);
/* nodelist properties */
int dom_nodelist_length_read(dom_object *obj, zval **retval TSRMLS_DC);
xmlNodePtr dom_nodelist_xml_item(dom_nnodemap_object *objmap, long index);
xmlNodePtr dom_nodelist_baseobj_item(dom_nnodemap_object *objmap, long index);
/* notation properties */
int dom_notation_public_id_read(dom_object *obj, zval **retval TSRMLS_DC);
+1 -54
View File
@@ -72,7 +72,6 @@ zend_class_entry *dom_namespace_node_class_entry;
/* }}} */
zend_object_handlers dom_object_handlers;
zend_object_handlers dom_nnodemap_object_handlers;
static HashTable classes;
/* {{{ prop handler tables */
@@ -669,10 +668,6 @@ PHP_MINIT_FUNCTION(dom)
dom_object_handlers.has_property = dom_property_exists;
dom_object_handlers.get_debug_info = dom_get_debug_info;
memcpy(&dom_nnodemap_object_handlers, &dom_object_handlers, sizeof(zend_object_handlers));
dom_nnodemap_object_handlers.read_dimension = dom_nodelist_read_dimension;
dom_nnodemap_object_handlers.has_dimension = dom_nodelist_has_dimension;
zend_hash_init(&classes, 0, NULL, NULL, 1);
INIT_CLASS_ENTRY(ce, "DOMException", php_dom_domexception_class_functions);
@@ -1302,7 +1297,7 @@ zend_object_value dom_nnodemap_objects_new(zend_class_entry *class_type TSRMLS_D
retval.handle = zend_objects_store_put(intern, dom_nnodemap_object_dtor, (zend_objects_free_object_storage_t)dom_nnodemap_objects_free_storage, dom_objects_clone TSRMLS_CC);
intern->handle = retval.handle;
retval.handlers = &dom_nnodemap_object_handlers;
retval.handlers = dom_get_obj_handlers(TSRMLS_C);
return retval;
}
@@ -1679,54 +1674,6 @@ xmlNsPtr dom_get_nsdecl(xmlNode *node, xmlChar *localName) {
}
/* }}} end dom_get_nsdecl */
static inline long dom_get_long(zval *offset) /* {{{ */
{
if (Z_TYPE_P(offset) == IS_LONG) {
return Z_LVAL_P(offset);
} else {
zval tmp;
MAKE_COPY_ZVAL(&offset, &tmp);
convert_to_long(&tmp);
return Z_LVAL(tmp);
}
}
/* }}} */
zval *dom_nodelist_read_dimension(zval *object, zval *offset, int type TSRMLS_DC) /* {{{ */
{
zval *rv, offset_copy = zval_used_for_init;
if (!offset) {
return NULL;
}
ZVAL_LONG(&offset_copy, dom_get_long(offset));
zend_call_method_with_1_params(&object, Z_OBJCE_P(object), NULL, "item", &rv, &offset_copy);
Z_DELREF_P(rv);
return rv;
} /* }}} end dom_nodelist_read_dimension */
int dom_nodelist_has_dimension(zval *object, zval *member, int check_empty TSRMLS_DC)
{
long offset = dom_get_long(member);
if (offset < 0) {
return 0;
} else {
zval *length = zend_read_property(Z_OBJCE_P(object), object, "length", sizeof("length") - 1, 0 TSRMLS_CC);
int ret = length && offset < Z_LVAL_P(length);
FREE_ZVAL(length);
return ret;
}
} /* }}} end dom_nodelist_has_dimension */
#endif /* HAVE_DOM */
/*
-2
View File
@@ -123,8 +123,6 @@ xmlNode *php_dom_libxml_hash_iter(xmlHashTable *ht, int index);
xmlNode *php_dom_libxml_notation_iter(xmlHashTable *ht, int index);
zend_object_iterator *php_dom_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC);
int dom_set_doc_classmap(php_libxml_ref_obj *document, zend_class_entry *basece, zend_class_entry *ce TSRMLS_DC);
zval *dom_nodelist_read_dimension(zval *object, zval *offset, int type TSRMLS_DC);
int dom_nodelist_has_dimension(zval *object, zval *member, int check_empty TSRMLS_DC);
#define REGISTER_DOM_CLASS(ce, name, parent_ce, funcs, entry) \
INIT_CLASS_ENTRY(ce, name, funcs); \
-87
View File
@@ -1,87 +0,0 @@
--TEST--
Bug #67949: DOMNodeList elements should be accessible through array notation
--FILE--
<?php
$html = <<<HTML
<div>data</div>
<a href="test">hello world</a>
HTML;
$doc = new DOMDocument;
$doc->loadHTML($html);
$nodes = $doc->getElementsByTagName('div');
echo "testing has_dimension\n";
var_dump(isset($nodes[0]));
var_dump(isset($nodes[1]));
var_dump(isset($nodes[-1]));
echo "testing property access\n";
var_dump($nodes[0]->textContent);
var_dump($nodes[1]->textContent);
echo "testing offset not a long\n";
$offset = ['test'];
var_dump($offset);
var_dump(isset($nodes[$offset]), $nodes[$offset]->textContent);
var_dump($offset);
$something = 'test';
$offset = &$something;
var_dump($offset);
var_dump(isset($nodes[$offset]), $nodes[$offset]->textContent);
var_dump($offset);
$offset = 'test';
var_dump($offset);
var_dump(isset($nodes[$offset]), $nodes[$offset]->textContent);
var_dump($offset);
echo "testing read_dimension with null offset\n";
var_dump($nodes[][] = 1);
echo "testing attribute access\n";
$anchor = $doc->getElementsByTagName('a')[0];
var_dump($anchor->attributes[0]->name);
echo "==DONE==\n";
--EXPECTF--
testing has_dimension
bool(true)
bool(false)
bool(false)
testing property access
string(4) "data"
Notice: Trying to get property of non-object in %s on line %d
NULL
testing offset not a long
array(1) {
[0]=>
string(4) "test"
}
Notice: Trying to get property of non-object in %s on line %d
bool(false)
NULL
array(1) {
[0]=>
string(4) "test"
}
string(4) "test"
bool(true)
string(4) "data"
string(4) "test"
string(4) "test"
bool(true)
string(4) "data"
string(4) "test"
testing read_dimension with null offset
NULL
testing attribute access
string(4) "href"
==DONE==
+2 -2
View File
@@ -2416,11 +2416,11 @@ static void* exif_ifd_make_value(image_info_data *info_data, int motorola_intel
data_ptr += 8;
break;
case TAG_FMT_SINGLE:
memmove(data_ptr, &info_value->f, 4);
memmove(data_ptr, &info_data->value.f, byte_count);
data_ptr += 4;
break;
case TAG_FMT_DOUBLE:
memmove(data_ptr, &info_value->d, 8);
memmove(data_ptr, &info_data->value.d, byte_count);
data_ptr += 8;
break;
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 368 B

-17
View File
@@ -1,17 +0,0 @@
--TEST--
Bug #68113 (Heap corruption in exif_thumbnail())
--SKIPIF--
<?php
extension_loaded("exif") or die("skip need exif");
?>
--FILE--
<?php
var_dump(exif_thumbnail(__DIR__."/bug68113.jpg"));
?>
Done
--EXPECTF--
Warning: exif_thumbnail(bug68113.jpg): File structure corrupted in %s%ebug68113.php on line 2
Warning: exif_thumbnail(bug68113.jpg): Invalid JPEG file in %s%ebug68113.php on line 2
bool(false)
Done
+2 -2
View File
@@ -156,12 +156,12 @@ if test "\$PHP_$EXTNAME" != "no"; then
dnl PHP_CHECK_LIBRARY(\$LIBNAME,\$LIBSYMBOL,
dnl [
dnl PHP_ADD_LIBRARY_WITH_PATH(\$LIBNAME, \$${EXTNAME}_DIR/\$PHP_LIBDIR, ${EXTNAME}_SHARED_LIBADD)
dnl PHP_ADD_LIBRARY_WITH_PATH(\$LIBNAME, \$${EXTNAME}_DIR/lib, ${EXTNAME}_SHARED_LIBADD)
dnl AC_DEFINE(HAVE_${EXTNAME}LIB,1,[ ])
dnl ],[
dnl AC_MSG_ERROR([wrong $extname lib version or lib not found])
dnl ],[
dnl -L\$${EXTNAME}_DIR/\$PHP_LIBDIR -lm
dnl -L\$${EXTNAME}_DIR/lib -lm
dnl ])
dnl
dnl PHP_SUBST(${EXTNAME}_SHARED_LIBADD)
+1 -1
View File
@@ -3,7 +3,7 @@ if(!extension_loaded('fileinfo')) {
dl('fileinfo.' . PHP_SHLIB_SUFFIX);
}
if(!extension_loaded('fileinfo')) {
die("fileinfo extension is not available, please compile it.\n");
die("fileinfo extension is not avaliable, please compile it.\n");
}
// normal operation
+43 -194
View File
@@ -1,6 +1,6 @@
diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
--- libmagic.orig/apprentice.c Tue Nov 19 22:01:12 2013
+++ libmagic/apprentice.c Fri Oct 3 22:48:34 2014
+++ libmagic/apprentice.c Mon Mar 31 17:15:53 2014
@@ -29,6 +29,8 @@
* apprentice - make one pass through /etc/magic, learning its secrets.
*/
@@ -454,15 +454,6 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
return NULL;
}
return map;
@@ -1248,7 +1272,7 @@
* the sign extension must have happened.
*/
case FILE_BYTE:
- v = (char) v;
+ v = (signed char) v;
break;
case FILE_SHORT:
case FILE_BESHORT:
@@ -1516,7 +1540,7 @@
if (me->cont_count == me->max_count) {
struct magic *nm;
@@ -831,7 +822,7 @@ diff -u libmagic.orig/ascmagic.c libmagic/ascmagic.c
}
diff -u libmagic.orig/cdf.c libmagic/cdf.c
--- libmagic.orig/cdf.c Tue Feb 26 17:20:42 2013
+++ libmagic/cdf.c Fri Oct 3 22:48:34 2014
+++ libmagic/cdf.c Tue Jul 1 08:57:25 2014
@@ -35,7 +35,7 @@
#include "file.h"
@@ -946,7 +937,7 @@ diff -u libmagic.orig/cdf.c libmagic/cdf.c
/* If the it is not there, just fake it; some docs don't have it */
if (d->d_stream_first_sector < 0)
@@ -796,11 +815,15 @@
@@ -796,7 +815,11 @@
if (cdf_check_stream_offset(sst, h, e, 0, __LINE__) == -1)
goto out;
for (i = 0; i < sh.sh_properties; i++) {
@@ -959,11 +950,6 @@ diff -u libmagic.orig/cdf.c libmagic/cdf.c
q = (const uint8_t *)(const void *)
((const char *)(const void *)p + ofs
- 2 * sizeof(uint32_t));
- if (q > e) {
+ if (q < p || q > e) {
DPRINTF(("Ran of the end %p > %p\n", q, e));
goto out;
}
@@ -810,6 +833,10 @@
i, inp[i].pi_id, inp[i].pi_type, q - p, offs));
if (inp[i].pi_type & CDF_VECTOR) {
@@ -1828,16 +1814,7 @@ diff -u libmagic.orig/fsmagic.c libmagic/fsmagic.c
}
diff -u libmagic.orig/funcs.c libmagic/funcs.c
--- libmagic.orig/funcs.c Thu Feb 13 00:20:53 2014
+++ libmagic/funcs.c Fri Oct 3 22:48:34 2014
@@ -27,7 +27,7 @@
#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: funcs.c,v 1.67 2014/02/12 23:20:53 christos Exp $")
+FILE_RCSID("@(#)$File: funcs.c,v 1.68 2014/02/18 11:09:31 kim Exp $")
#endif /* lint */
#include "magic.h"
+++ libmagic/funcs.c Wed Mar 19 13:28:34 2014
@@ -41,79 +41,79 @@
#if defined(HAVE_WCTYPE_H)
#include <wctype.h>
@@ -1970,26 +1947,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
{
int m = 0, rv = 0, looks_text = 0;
int mime = ms->flags & MAGIC_MIME;
@@ -174,8 +173,7 @@
const char *code_mime = "binary";
const char *type = "application/octet-stream";
const char *def = "data";
-
-
+ const char *ftype = NULL;
if (nb == 0) {
def = "empty";
@@ -188,7 +186,7 @@
if ((ms->flags & MAGIC_NO_CHECK_ENCODING) == 0) {
looks_text = file_encoding(ms, ubuf, nb, &u8buf, &ulen,
- &code, &code_mime, &type);
+ &code, &code_mime, &ftype);
}
#ifdef __EMX__
@@ -203,10 +201,10 @@
@@ -203,10 +202,10 @@
}
}
#endif
@@ -2003,7 +1961,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
if ((ms->flags & MAGIC_DEBUG) != 0)
(void)fprintf(stderr, "zmagic %d\n", m);
goto done_encoding;
@@ -221,12 +219,17 @@
@@ -221,12 +220,17 @@
}
/* Check if we have a CDF file */
@@ -2026,16 +1984,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
/* try soft magic tests */
if ((ms->flags & MAGIC_NO_CHECK_SOFT) == 0)
@@ -268,7 +271,7 @@
if ((ms->flags & MAGIC_NO_CHECK_ENCODING) == 0) {
if (looks_text == 0)
if ((m = file_ascmagic_with_encoding( ms, ubuf,
- nb, u8buf, ulen, code, type, looks_text))
+ nb, u8buf, ulen, code, ftype, looks_text))
!= 0) {
if ((ms->flags & MAGIC_DEBUG) != 0)
(void)fprintf(stderr,
@@ -300,7 +303,6 @@
@@ -300,7 +304,6 @@
return m;
}
@@ -2043,7 +1992,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
protected int
file_reset(struct magic_set *ms)
@@ -310,11 +312,11 @@
@@ -310,11 +313,11 @@
return -1;
}
if (ms->o.buf) {
@@ -2057,7 +2006,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
ms->o.pbuf = NULL;
}
ms->event_flags &= ~EVENT_HAD_ERR;
@@ -333,7 +335,7 @@
@@ -333,7 +336,7 @@
protected const char *
file_getbuffer(struct magic_set *ms)
{
@@ -2066,7 +2015,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
size_t psize, len;
if (ms->event_flags & EVENT_HAD_ERR)
@@ -348,15 +350,13 @@
@@ -348,15 +351,13 @@
/* * 4 is for octal representation, + 1 is for NUL */
len = strlen(ms->o.buf);
if (len > (SIZE_MAX - 1) / 4) {
@@ -2083,7 +2032,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
#if defined(HAVE_WCHAR_H) && defined(HAVE_MBRTOWC) && defined(HAVE_WCWIDTH)
{
@@ -416,8 +416,8 @@
@@ -416,8 +417,8 @@
if (level >= ms->c.len) {
len = (ms->c.len += 20) * sizeof(*ms->c.li);
ms->c.li = CAST(struct level_info *, (ms->c.li == NULL) ?
@@ -2094,7 +2043,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
if (ms->c.li == NULL) {
file_oomem(ms, len);
return -1;
@@ -437,32 +437,50 @@
@@ -437,32 +438,50 @@
return ms->o.buf == NULL ? 0 : strlen(ms->o.buf);
}
@@ -2757,7 +2706,7 @@ diff -u libmagic.orig/print.c libmagic/print.c
}
diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
--- libmagic.orig/readcdf.c Tue Jan 7 04:13:42 2014
+++ libmagic/readcdf.c Sat Oct 25 11:50:04 2014
+++ libmagic/readcdf.c Thu Jun 5 18:05:33 2014
@@ -26,11 +26,15 @@
#include "file.h"
@@ -2775,7 +2724,7 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
#include <string.h>
#include <time.h>
#include <ctype.h>
@@ -69,6 +73,50 @@
@@ -69,6 +73,44 @@
{ NULL, NULL, },
};
@@ -2794,9 +2743,6 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
+ { 0x00000000000c1084LLU, 0x46000000000000c0LLU },
+#endif
+ "x-msi",
+ },
+ { { 0, 0 },
+ NULL,
+ }
+}, clsid2desc[] = {
+ {
@@ -2807,9 +2753,6 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
+#endif
+ "MSI Installer",
+ },
+ { { 0, 0 },
+ NULL,
+ }
+};
+
+private const char *
@@ -2826,7 +2769,7 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
private const char *
cdf_app_to_mime(const char *vbuf, const struct nv *nv)
{
@@ -87,16 +135,21 @@
@@ -87,16 +129,21 @@
private int
cdf_file_property_info(struct magic_set *ms, const cdf_property_info_t *info,
@@ -2850,7 +2793,7 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
for (i = 0; i < count; i++) {
cdf_print_property_name(buf, sizeof(buf), info[i].pi_id);
switch (info[i].pi_type) {
@@ -153,7 +206,7 @@
@@ -153,7 +200,7 @@
buf, vbuf) == -1)
return -1;
}
@@ -2859,7 +2802,7 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
CDF_PROPERTY_NAME_OF_APPLICATION) {
str = cdf_app_to_mime(vbuf, app2mime);
}
@@ -162,8 +215,12 @@
@@ -162,8 +209,12 @@
case CDF_FILETIME:
tp = info[i].pi_tp;
if (tp != 0) {
@@ -2874,7 +2817,7 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
cdf_print_elapsed_time(tbuf,
sizeof(tbuf), tp);
if (NOTMIME(ms) && file_printf(ms,
@@ -171,8 +228,11 @@
@@ -171,8 +222,11 @@
return -1;
} else {
char *c, *ec;
@@ -2888,7 +2831,7 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
if (c != NULL &&
(ec = strchr(c, '\n')) != NULL)
*ec = '\0';
@@ -200,7 +260,7 @@
@@ -200,7 +254,7 @@
private int
cdf_file_summary_info(struct magic_set *ms, const cdf_header_t *h,
@@ -2897,7 +2840,7 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
{
cdf_summary_info_header_t si;
cdf_property_info_t *info;
@@ -211,6 +271,8 @@
@@ -211,6 +265,8 @@
return -1;
if (NOTMIME(ms)) {
@@ -2906,7 +2849,7 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
if (file_printf(ms, "Composite Document File V2 Document")
== -1)
return -1;
@@ -238,9 +300,15 @@
@@ -238,9 +294,15 @@
return -2;
break;
}
@@ -2924,7 +2867,7 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
free(info);
return m == -1 ? -2 : m;
@@ -258,6 +326,7 @@
@@ -258,6 +320,7 @@
int i;
const char *expn = "";
const char *corrupt = "corrupt: ";
@@ -2932,7 +2875,7 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
info.i_fd = fd;
info.i_buf = buf;
@@ -291,7 +360,8 @@
@@ -291,7 +354,8 @@
goto out2;
}
@@ -2942,7 +2885,7 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
expn = "Cannot read short stream";
goto out3;
}
@@ -312,23 +382,21 @@
@@ -312,23 +376,21 @@
#ifdef CDF_DEBUG
cdf_dump_summary_info(&h, &scn);
#endif
@@ -2975,7 +2918,7 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
if (str != NULL) {
diff -u libmagic.orig/readelf.c libmagic/readelf.c
--- libmagic.orig/readelf.c Tue Nov 5 16:44:01 2013
+++ libmagic/readelf.c Sat Oct 25 11:50:04 2014
+++ libmagic/readelf.c Fri Feb 21 00:21:27 2014
@@ -48,8 +48,8 @@
private int dophn_exec(struct magic_set *, int, int, int, off_t, int, size_t,
off_t, int *, int);
@@ -3040,21 +2983,7 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c
file_badread(ms);
return -1;
}
@@ -477,6 +492,13 @@
uint32_t namesz, descsz;
unsigned char *nbuf = CAST(unsigned char *, vbuf);
+ if (xnh_sizeof + offset > size) {
+ /*
+ * We're out of note headers.
+ */
+ return xnh_sizeof + offset;
+ }
+
(void)memcpy(xnh_addr, &nbuf[offset], xnh_sizeof);
offset += xnh_sizeof;
@@ -913,24 +935,12 @@
@@ -913,24 +928,12 @@
return 0;
}
@@ -3082,7 +3011,7 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c
file_badread(ms);
return -1;
}
@@ -955,14 +965,17 @@
@@ -955,14 +958,17 @@
/* Things we can determine when we seek */
switch (xsh_type) {
case SHT_NOTE:
@@ -3105,7 +3034,7 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c
return -1;
}
@@ -971,25 +984,16 @@
@@ -971,25 +977,16 @@
if (noff >= (off_t)xsh_size)
break;
noff = donote(ms, nbuf, (size_t)noff,
@@ -3136,7 +3065,7 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c
file_badseek(ms);
return -1;
}
@@ -1001,7 +1005,7 @@
@@ -1001,7 +998,7 @@
MAX(sizeof cap32, sizeof cap64)];
if ((coff += xcap_sizeof) > (off_t)xsh_size)
break;
@@ -3145,7 +3074,7 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c
(ssize_t)xcap_sizeof) {
file_badread(ms);
return -1;
@@ -1027,13 +1031,12 @@
@@ -1027,13 +1024,12 @@
break;
}
}
@@ -3161,7 +3090,7 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c
if (file_printf(ms, ", %sstripped", stripped ? "" : "not ") == -1)
return -1;
if (cap_hw1) {
@@ -1112,7 +1115,7 @@
@@ -1112,7 +1108,7 @@
const char *shared_libraries = "";
unsigned char nbuf[BUFSIZ];
ssize_t bufsize;
@@ -3170,7 +3099,7 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c
if (size != xph_sizeof) {
if (file_printf(ms, ", corrupted program header size") == -1)
@@ -1121,8 +1124,13 @@
@@ -1121,8 +1117,13 @@
}
for ( ; num; num--) {
@@ -3186,7 +3115,7 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c
return -1;
}
@@ -1160,9 +1168,12 @@
@@ -1160,9 +1161,12 @@
* This is a PT_NOTE section; loop through all the notes
* in the section.
*/
@@ -3202,7 +3131,7 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c
if (bufsize == -1) {
file_badread(ms);
return -1;
@@ -1223,7 +1234,7 @@
@@ -1223,7 +1227,7 @@
/*
* If we cannot seek, it must be a pipe, socket or fifo.
*/
@@ -3234,7 +3163,7 @@ diff -u libmagic.orig/readelf.h libmagic/readelf.h
typedef uint8_t Elf64_Char;
diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
--- libmagic.orig/softmagic.c Thu Feb 13 00:20:53 2014
+++ libmagic/softmagic.c Mon Aug 4 14:58:55 2014
+++ libmagic/softmagic.c Tue Jul 1 08:57:25 2014
@@ -50,6 +50,11 @@
#include <locale.h>
#endif
@@ -3247,15 +3176,6 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
private int match(struct magic_set *, struct magic *, uint32_t,
const unsigned char *, size_t, size_t, int, int, int, int, int *, int *,
@@ -62,7 +67,7 @@
private int32_t moffset(struct magic_set *, struct magic *);
private void mdebug(uint32_t, const char *, size_t);
private int mcopy(struct magic_set *, union VALUETYPE *, int, int,
- const unsigned char *, uint32_t, size_t, size_t);
+ const unsigned char *, uint32_t, size_t, struct magic *);
private int mconvert(struct magic_set *, struct magic *, int);
private int print_sep(struct magic_set *, int);
private int handle_annotation(struct magic_set *, struct magic *);
@@ -71,7 +76,8 @@
private void cvt_32(union VALUETYPE *, const struct magic *);
private void cvt_64(union VALUETYPE *, const struct magic *);
@@ -3400,72 +3320,9 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
while (len--)
*ptr1++ = *ptr2++;
*ptr1 = '\0';
@@ -1046,7 +1038,7 @@
private int
mcopy(struct magic_set *ms, union VALUETYPE *p, int type, int indir,
- const unsigned char *s, uint32_t offset, size_t nbytes, size_t linecnt)
+ const unsigned char *s, uint32_t offset, size_t nbytes, struct magic *m)
{
/*
* Note: FILE_SEARCH and FILE_REGEX do not actually copy
@@ -1066,15 +1058,24 @@
const char *last; /* end of search region */
const char *buf; /* start of search region */
const char *end;
- size_t lines;
+ size_t lines, linecnt, bytecnt;
+ linecnt = m->str_range;
+ bytecnt = linecnt * 80;
+
+ if (bytecnt == 0) {
+ bytecnt = 8192;
+ }
+ if (bytecnt > nbytes) {
+ bytecnt = nbytes;
+ }
if (s == NULL) {
ms->search.s_len = 0;
ms->search.s = NULL;
return 0;
}
buf = RCAST(const char *, s) + offset;
- end = last = RCAST(const char *, s) + nbytes;
+ end = last = RCAST(const char *, s) + bytecnt;
/* mget() guarantees buf <= last */
for (lines = linecnt, b = buf; lines && b < end &&
((b = CAST(const char *,
@@ -1087,7 +1088,7 @@
b++;
}
if (lines)
- last = RCAST(const char *, s) + nbytes;
+ last = RCAST(const char *, s) + bytecnt;
ms->search.s = buf;
ms->search.s_len = last - buf;
@@ -1158,7 +1159,6 @@
int *need_separator, int *returnval)
{
uint32_t soffset, offset = ms->offset;
- uint32_t count = m->str_range;
int rv, oneed_separator, in_type;
char *sbuf, *rbuf;
union VALUETYPE *p = &ms->ms_value;
@@ -1170,17 +1170,13 @@
}
if (mcopy(ms, p, m->type, m->flag & INDIR, s, (uint32_t)(offset + o),
- (uint32_t)nbytes, count) == -1)
+ (uint32_t)nbytes, m) == -1)
return -1;
if ((ms->flags & MAGIC_DEBUG) != 0) {
fprintf(stderr, "mget(type=%d, flag=%x, offset=%u, o=%zu, "
- "nbytes=%zu, count=%u)\n", m->type, m->flag, offset, o,
- nbytes, count);
+ "nbytes=%zu)\n", m->type, m->flag, offset, o, nbytes);
@@ -1178,9 +1170,6 @@
"nbytes=%zu, count=%u)\n", m->type, m->flag, offset, o,
nbytes, count);
mdebug(offset, (char *)(void *)p, sizeof(union VALUETYPE));
-#ifndef COMPILE_ONLY
- file_mdump(m);
@@ -3473,15 +3330,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
}
if (m->flag & INDIR) {
@@ -1672,16 +1668,13 @@
if ((ms->flags & MAGIC_DEBUG) != 0)
fprintf(stderr, "indirect +offs=%u\n", offset);
}
- if (mcopy(ms, p, m->type, 0, s, offset, nbytes, count) == -1)
+ if (mcopy(ms, p, m->type, 0, s, offset, nbytes, m) == -1)
return -1;
ms->offset = offset;
@@ -1679,9 +1668,6 @@
if ((ms->flags & MAGIC_DEBUG) != 0) {
mdebug(offset, (char *)(void *)p,
sizeof(union VALUETYPE));
@@ -3491,7 +3340,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
}
}
@@ -1755,11 +1748,21 @@
@@ -1755,11 +1741,21 @@
ms->offset = soffset;
if (rv == 1) {
if ((ms->flags & (MAGIC_MIME|MAGIC_APPLE)) == 0 &&
@@ -3516,7 +3365,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
}
return rv;
@@ -1875,6 +1878,42 @@
@@ -1875,6 +1871,42 @@
return file_strncmp(a, b, len, flags);
}
@@ -3559,7 +3408,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
private int
magiccheck(struct magic_set *ms, struct magic *m)
{
@@ -2035,63 +2074,151 @@
@@ -2035,63 +2067,151 @@
break;
}
case FILE_REGEX: {
@@ -3595,7 +3444,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
+ zval *retval;
+ zval *subpats;
+ char *haystack;
+
+
+ MAKE_STD_ZVAL(retval);
+ ALLOC_INIT_ZVAL(subpats);
+
+1 -1
View File
@@ -1272,7 +1272,7 @@ file_signextend(struct magic_set *ms, struct magic *m, uint64_t v)
* the sign extension must have happened.
*/
case FILE_BYTE:
v = (signed char) v;
v = (char) v;
break;
case FILE_SHORT:
case FILE_BESHORT:
+1 -1
View File
@@ -351,7 +351,7 @@
*
* Revision 1.8 93/02/19 15:01:26 ian
* Numerous changes from Guy Harris too numerous to mention but including
* byte-order independence, fixing "old-style masking", etc. etc. A bugfix
* byte-order independance, fixing "old-style masking", etc. etc. A bugfix
* for broken symlinks from martin@@d255s004.zfe.siemens.de.
*
* Revision 1.7 93/01/05 14:57:27 ian
-6
View File
@@ -88,9 +88,6 @@ static const struct cv {
{ 0x00000000000c1084LLU, 0x46000000000000c0LLU },
#endif
"x-msi",
},
{ { 0, 0 },
NULL,
}
}, clsid2desc[] = {
{
@@ -101,9 +98,6 @@ static const struct cv {
#endif
"MSI Installer",
},
{ { 0, 0 },
NULL,
}
};
private const char *
-7
View File
@@ -492,13 +492,6 @@ donote(struct magic_set *ms, void *vbuf, size_t offset, size_t size,
uint32_t namesz, descsz;
unsigned char *nbuf = CAST(unsigned char *, vbuf);
if (xnh_sizeof + offset > size) {
/*
* We're out of note headers.
*/
return xnh_sizeof + offset;
}
(void)memcpy(xnh_addr, &nbuf[offset], xnh_sizeof);
offset += xnh_sizeof;
+7 -7
View File
@@ -3918,7 +3918,7 @@
>7 string x version %.2s
# We skip the path here, because it is often long (so file will
# truncate it) and mostly redundant.
# The inverted index functionality was added some time between
# The inverted index functionality was added some time betwen
# versions 11 and 15, so look for -q if version is above 14:
>7 string >14
>>10 search/100 \ -q\ with inverted index
@@ -3972,7 +3972,7 @@
# .cwk
0 string \002\000\210\003\102\117\102\117\000\001\206 Claris works document
# .plt
0 string \020\341\000\000\010\010 Claris Works palette files .plt
0 string \020\341\000\000\010\010 Claris Works pallete files .plt
# .msp a dictionary file I am not sure about this I have only one .msp file
0 string \002\271\262\000\040\002\000\164 Claris works dictionary
@@ -4443,9 +4443,9 @@
>6 byte&0x04 =0x8 \b, [4-Scr]
#------------------------------------------------------------------------------
# game boy: file(1) magic for the Nintendo (Color) Game Boy raw ROM format
# gameboy: file(1) magic for the Nintendo (Color) Gameboy raw ROM format
#
0x104 belong 0xCEED6666 Game Boy ROM:
0x104 belong 0xCEED6666 Gameboy ROM:
>0x134 string >\0 "%.16s"
>0x146 byte 0x03 \b,[SGB]
>0x147 byte 0x00 \b, [ROM ONLY]
@@ -4605,8 +4605,8 @@
0 string \x01ZZZZZ\x01 3DO "Opera" file system
# From Gurkan Sengun <gurkan@linuks.mine.nu>, www.linuks.mine.nu
0 string GBS Nintendo Game Boy Music/Audio Data
12 string GameBoy\ Music\ Module Nintendo Game Boy Music Module
0 string GBS Nintendo Gameboy Music/Audio Data
12 string GameBoy\ Music\ Module Nintendo Gameboy Music Module
# Playstations Patch Files from: From: Thomas Klausner <tk@giga.or.at>
0 string PPF30 Playstation Patch File version 3.0
@@ -15279,7 +15279,7 @@
# $File: oasis,v 1.1 2011/03/15 02:09:38 christos Exp $
# OASIS
# Summary: OASIS stream file
# Long description: Open Artwork System Interchange Standard
# Long descripton: Open Artwork System Interchange Standard
# File extension: .oas
# Full name: Ben Cowley (bcowley@broadcom.com)
# Philip Dixon (pdixon@broadcom.com)
+1 -1
View File
@@ -791,7 +791,7 @@ PHP_FUNCTION(filter_input)
/* }}} */
/* {{{ proto mixed filter_var(mixed variable [, long filter [, mixed options]])
* Returns the filtered version of the variable.
* Returns the filtered version of the vriable.
*/
PHP_FUNCTION(filter_var)
{
+2 -2
View File
@@ -69,8 +69,8 @@ typedef struct ftpbuf
ftptype_t type; /* current transfer type */
int pasv; /* 0=off; 1=pasv; 2=ready */
php_sockaddr_storage pasvaddr; /* passive mode address */
long timeout_sec; /* User configurable timeout (seconds) */
int autoseek; /* User configurable autoseek flag */
long timeout_sec; /* User configureable timeout (seconds) */
int autoseek; /* User configureable autoseek flag */
int nb; /* "nonblocking" transfer in progress */
databuf_t *data; /* Data connection for "nonblocking" transfers */
+2 -14
View File
@@ -5118,23 +5118,11 @@ PHP_FUNCTION(imagescale)
return;
}
method = tmp_m;
ZEND_FETCH_RESOURCE(im, gdImagePtr, &IM, -1, "Image", le_gd);
if (tmp_h < 0) {
/* preserve ratio */
long src_x, src_y;
src_x = gdImageSX(im);
src_y = gdImageSY(im);
if (src_x) {
tmp_h = tmp_w * src_y / src_x;
}
}
new_width = tmp_w;
new_height = tmp_h;
ZEND_FETCH_RESOURCE(im, gdImagePtr, &IM, -1, "Image", le_gd);
if (gdImageSetInterpolationMethod(im, method)) {
im_scaled = gdImageScale(im, new_width, new_height);
}
+1 -1
View File
@@ -782,7 +782,7 @@ int gdImageBrightness(gdImagePtr src, int brightness);
/* Set the contrast level <contrast> for the image <src> */
int gdImageContrast(gdImagePtr src, double contrast);
/* Simply adds or subtracts respectively red, green or blue to a pixel */
/* Simply adds or substracts respectively red, green or blue to a pixel */
int gdImageColor(gdImagePtr src, const int red, const int green, const int blue, const int alpha);
/* Image convolution by a 3x3 custom matrix */
+1 -1
View File
@@ -1,6 +1,6 @@
/* This is potentially great stuff, but fails against the test
program at the end. This would probably be much more
efficient than the implementation currently in gd.c if the
efficent than the implementation currently in gd.c if the
errors in the output were corrected. TBB */
#if 0
+1 -1
View File
@@ -464,7 +464,7 @@ static void *fontFetch (char **error, void *key)
return NULL;
}
/* FIXME - This mapping stuff is incomplete - where is the spec? */
/* FIXME - This mapping stuff is imcomplete - where is the spec? */
/* EAM - It's worse than that. It's pointless to match character encodings here.
* As currently written, the stored a->face->charmap only matches one of
* the actual charmaps and we cannot know at this stage if it is the right
+2 -2
View File
@@ -169,7 +169,7 @@ static inline uint32 get_le32(const uint8* const data) {
* Y2/U2/V2: The Y/U/V data of the second image
*
* Returns the PSNR (http://en.wikipedia.org/wiki/Peak_signal-to-noise_ratio)
* value computed between the two images
* value computed bewteen the two images
*/
double GetPSNRYuv(const uint8* Y1,
const uint8* U1,
@@ -210,7 +210,7 @@ double GetPSNRYuv(const uint8* Y1,
* imgdata: data buffer containing webp image
* imgdata_size: size of the imgdata buffer
*
* Returns the PSNR value computed between the two images
* Returns the PSNR value computed bewteen the two images
*/
double WebPGetPSNR(const uint8* Y1,
const uint8* U1,
+1 -1
View File
@@ -57,7 +57,7 @@ typedef enum WebPResultType {
* 3. p_Y/p_U/p_V : pointer to the Y/U/V data buffer (this routine will
* allocate memory for the buffer, fill the buffer with
* appropriate data and transfer owner ship of the buffer
* to caller. Caller is responsible for freeing the memory).
* to caller. Caller is reponsible for freeing the memory).
* Note that the memory for Y, U, V buffers is alloacted
* in one chunk, hence one should call free(*p_Y) only.
* Do not try to free the U and V buffers.
+5 -4
View File
@@ -1,12 +1,13 @@
--TEST--
Bug #48801 (Problem with imagettfbbox) freetype >= 2.4.10
Bug #48801 (Problem with imagettfbbox) freetype >= 2.4.10 and < 2.4.12
--SKIPIF--
<?php
if(!extension_loaded('gd')){ die('skip gd extension not available'); }
if(!function_exists('imageftbbox')) die('skip imageftbbox() not available');
include dirname(__FILE__) . '/func.inc';
if(version_compare(get_freetype_version(), '2.4.10') == -1) die('skip for freetype >= 2.4.10');
if(version_compare(get_freetype_version(), '2.4.10') < 0) die('skip for freetype >= 2.4.10');
if(version_compare(get_freetype_version(), '2.4.12') >= 0) die('skip for freetype < 2.4.12');
?>
--FILE--
<?php
@@ -20,6 +21,6 @@ echo '(' . $bbox[6] . ', ' . $bbox[7] . ")\n";
?>
--EXPECTF--
(-1, 15)
(15%d, 15)
(15%d, -48)
(156, 15)
(156, -48)
(-1, -48)
+25
View File
@@ -0,0 +1,25 @@
--TEST--
Bug #48801 (Problem with imagettfbbox) freetype >= 2.4.12
--SKIPIF--
<?php
if(!extension_loaded('gd')){ die('skip gd extension not available'); }
if(!function_exists('imageftbbox')) die('skip imageftbbox() not available');
include dirname(__FILE__) . '/func.inc';
if(version_compare(get_freetype_version(), '2.4.12') < 0) die('skip for freetype >= 2.4.12');
?>
--FILE--
<?php
$cwd = dirname(__FILE__);
$font = "$cwd/Tuffy.ttf";
$bbox = imageftbbox(50, 0, $font, "image");
echo '(' . $bbox[0] . ', ' . $bbox[1] . ")\n";
echo '(' . $bbox[2] . ', ' . $bbox[3] . ")\n";
echo '(' . $bbox[4] . ', ' . $bbox[5] . ")\n";
echo '(' . $bbox[6] . ', ' . $bbox[7] . ")\n";
?>
--EXPECTF--
(-1, 15)
(155, 15)
(155, -48)
(-1, -48)
@@ -1,19 +0,0 @@
--TEST--
test imagealphablending without arguments
--CREDITS--
Marcelo Diniz <marcelo.leo27 [at] gmail [dot] com
‪#‎phpspMaisTestFest PHPSP on 2014-07-05
--SKIPIF--
<?php
if (!extension_loaded('gd')) die("skip gd extension not available.");
?>
--FILE--
<?php
imagealphablending();
?>
--EXPECTF--
Warning: imagealphablending() expects exactly 2 parameters, 0 given in %s on line %d
@@ -1,19 +0,0 @@
--TEST--
test imagecolorresolvealpha without arguments
--CREDITS--
Marcelo Diniz <marcelo.leo27 [at] gmail [dot] com
‪#‎phpspMaisTestFest PHPSP on 2014-07-05
--SKIPIF--
<?php
if (!extension_loaded('gd')) die("skip gd extension not available.");
?>
--FILE--
<?php
imagecolorresolvealpha();
?>
--EXPECTF--
Warning: imagecolorresolvealpha() expects exactly 5 parameters, 0 given in %s on line %d
-19
View File
@@ -1,19 +0,0 @@
--TEST--
test imagesavealpha without arguments
--CREDITS--
Marcelo Diniz <marcelo.leo27 [at] gmail [dot] com
‪#‎phpspMaisTestFest PHPSP on 2014-07-05
--SKIPIF--
<?php
if (!extension_loaded('gd')) die("skip gd extension not available.");
?>
--FILE--
<?php
imagesavealpha();
?>
--EXPECTF--
Warning: imagesavealpha() expects exactly 2 parameters, 0 given in %s on line %d
Binary file not shown.
@@ -1,17 +0,0 @@
msgid ""
msgstr ""
"Project-Id-Version: bugs.php.net/66265\n"
"POT-Creation-Date: 2014-11-20 16:33+0100\n"
"PO-Revision-Date: 2014-11-20 16:40+0100\n"
"Last-Translator: <ab@php.net>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.6.10\n"
"X-Poedit-Basepath: .\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"Language: de_DE\n"
msgid "hello"
msgstr "hallo"
Binary file not shown.
@@ -1,17 +0,0 @@
msgid ""
msgstr ""
"Project-Id-Version: bugs.php.net/66265\n"
"POT-Creation-Date: 2014-11-20 16:33+0100\n"
"PO-Revision-Date: 2014-11-20 16:40+0100\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.6.10\n"
"X-Poedit-Basepath: .\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"Language: en_US\n"
msgid "hello"
msgstr "hello"
Binary file not shown.
@@ -1,17 +0,0 @@
msgid ""
msgstr ""
"Project-Id-Version: bugs.php.net/66265\n"
"POT-Creation-Date: 2014-11-20 16:33+0100\n"
"PO-Revision-Date: 2014-11-20 16:59+0100\n"
"Last-Translator: <ab@php.net>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.6.10\n"
"X-Poedit-Basepath: .\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"Language: fr_FR\n"
msgid "hello"
msgstr "salut"
-55
View File
@@ -1,55 +0,0 @@
--TEST--
#66265: gettext doesn't switch locales within the same script
--SKIPIF--
<?php
if (!extension_loaded("gettext")) {
die("skip\n");
}
if (PHP_ZTS) {
/* this is supposed to fail on the TS build at least on Windows,
should be even XFAIL till it's fixed there */
die("skip NTS only");
}
if (substr(PHP_OS, 0, 3) != 'WIN') {
$loc = ["de_DE", "fr_FR", "en_US"];
foreach($loc as $l) {
if (!setlocale(LC_ALL, $l)) {
die("SKIP '$l' locale not supported.");
}
}
}
?>
--FILE--
<?php
$domain = 'domain';
$loc = ["de_DE", "fr_FR", "en_US"];
foreach ($loc as $l) {
putenv("LC_ALL=$l");
$path = realpath(dirname(__FILE__) . DIRECTORY_SEPARATOR . "66265");
bindtextdomain($domain, $path);
bind_textdomain_codeset($domain, "UTF-8");
textdomain($domain);
echo 'LC_ALL=', getenv('LC_ALL'), "\n";
echo 'hello=', _('hello'), "\n";
echo "\n";
}
?>
==DONE==
--EXPECTF--
LC_ALL=de_DE
hello=hallo
LC_ALL=fr_FR
hello=salut
LC_ALL=en_US
hello=hello
==DONE==
Loaded 100 of 340 files, more files were not shown because too many files have changed in this diff. Show more