Merge branch 'PHP-5.4' of https://git.php.net/push/php-src into PHP-5.4

* 'PHP-5.4' of https://git.php.net/push/php-src: (76 commits)
  Fixed bug #63186 (compile failure on netbsd)
  fix test for bug #60322
  ensure the error_reporting level to get expected notice
  fixed tests
  missing tests for bug #53437
  fix double entry
  Merge branch 'pull-request/341'
  typo fixes (argument)
  typo fixes (accommodate, parameter)
  missing colon
  Backported the fix for bug #53437
  Backported the fix for bug #53437
  Fixed bug #64988 (Class loading order affects E_STRICT warning)
  Fixed test script
  PHPTests for the DOMDocument::loadHTMLfile method. They cover - The basic behaviour - When the method receives as argument a file which doesn't exist - When the argument is an empty string - When an empty file is loaded - When a not-well formed html file is loaded
  Fix spelling and correct typo.
  Callback has to be restored in MSHUTDOWN
  Update NEWs
  Fixed bug #64997 (Segfault while using RecursiveIteratorIterator on 64-bits systems)
  Fixed merge wrongly
  ...
This commit is contained in:
Boris Lytochkin 2013-06-16 00:03:30 +04:00
commit 8acfa0b3f8
380 changed files with 2505 additions and 582 deletions

71
NEWS
View File

@ -1,22 +1,84 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 2013, PHP 5.4.16
?? ??? 2013, PHP 5.4.17
- Core:
. Fixed bug #64988 (Class loading order affects E_STRICT warning). (Laruence)
. Fixed bug #64966 (segfault in zend_do_fcall_common_helper_SPEC). (Laruence)
. Fixed bug #64960 (Segfault in gc_zval_possible_root). (Laruence)
. Fixed bug #64934 (Apache2 TS crash with get_browser()). (Anatol)
- DateTime:
. Fixed bug #53437 (Crash when using unserialized DatePeriod instance).
(Gustavo, Derick, Anatol)
- FPM:
. Fixed Bug #64915 (error_log ignored when daemonize=0). (Remi)
- PDO_DBlib:
. Fixed bug #63638 (Cannot connect to SQL Server 2008 with PDO dblib).
(Stanley Sufficool)
. Fixed bug #64338 (pdo_dblib can't connect to Azure SQL). (Stanley
Sufficool)
. Fixed bug #64808 (FreeTDS PDO getColumnMeta on a prepared but not executed
statement crashes). (Stanley Sufficool)
- PDO_pgsql:
. Fixed Bug #64949 (Buffer overflow in _pdo_pgsql_error). (Remi)
- SPL:
. Fixed bug #64997 (Segfault while using RecursiveIteratorIterator on
64-bits systems). (Laruence)
06 Jun 2013, PHP 5.4.16
- Core:
. Fixed bug #64879 (Heap based buffer overflow in quoted_printable_encode,
CVE 2013-2110). (Stas)
. Fixed bug #64853 (Use of no longer available ini directives causes crash on
TS build). (Anatol)
. Fixed bug #64729 (compilation failure on x32). (Gustavo)
. Fixed bug #64720 (SegFault on zend_deactivate). (Dmitry)
. Fixed bug #64660 (Segfault on memory exhaustion within function definition).
(Stas, reported by Juha Kylmänen)
- Calendar:
. Fixed bug #64895 (Integer overflow in SndToJewish). (Remi)
- Fileinfo:
. Fixed bug #64830 (mimetype detection segfaults on mp3 file). (Anatol)
- FPM:
. Ignore QUERY_STRING when sent in SCRIPT_FILENAME. (Remi)
. Fixed some possible memory or resource leaks and possible null dereference
detected by code coverity scan. (Remi)
. Log a warning when a syscall fails. (Remi)
. Add --with-fpm-systemd option to report health to systemd, and
systemd_interval option to configure this. The service can now use
Type=notify in the systemd unit file. (Remi)
- MySQLi
. Fixed bug #64726 (Segfault when calling fetch_object on a use_result and DB
pointer has closed). (Laruence)
- Phar
. Fixed bug #64214 (PHAR PHPTs intermittently crash when run on DFS, SMB or
with non std tmp dir). (Pierre)
- SNMP:
. Fixed bug #64765 (Some IPv6 addresses get interpreted wrong).
(Boris Lytochkin)
(Boris Lytochkin)
. Fixed bug #64159 (Truncated snmpget). (Boris Lytochkin)
?? ??? 2013, PHP 5.4.15
- Streams:
. Fixed bug #64770 (stream_select() fails with pipes returned by proc_open()
on Windows x64). (Anatol)
- Zend Engine:
. Fixed bug #64821 (Custom Exceptions crash when internal properties
overridden). (Anatol)
09 May 2013, PHP 5.4.15
- Core:
. Fixed bug #64578 (debug_backtrace in set_error_handler corrupts zend heap:
segfault). (Laruence)
@ -113,9 +175,6 @@ PHP NEWS
. Disabled external entities loading (CVE-2013-1643, CVE-2013-1824).
(Dmitry)
- Phar:
. Fixed timestamp update on Phar contents modification. (Dmitry)
- SPL:
. Fixed bug #64264 (SPLFixedArray toArray problem). (Laruence)
. Fixed bug #64228 (RecursiveDirectoryIterator always assumes SKIP_DOTS).

View File

@ -32,7 +32,7 @@ resources cannot be auto-converted.
Type specifiers
---------------
The following list shows the type specifier, its meaning and the parameter
types that need to be passed by address. All passed paramaters are set
types that need to be passed by address. All passed parameters are set
if the PHP parameter is non optional and untouched if optional and the
parameter is not present. The only exception is O where the zend_class_entry*
has to be provided on input and is used to verify the PHP parameter is an

View File

@ -1,6 +1,6 @@
[IMPORTANT NOTICE]
------------------
Failed tests usualy indicate a problem with your local system setup
Failed tests usually indicate a problem with your local system setup
and not within PHP itself (at least for official PHP release versions).
You may decide to automaticaly submit a test summary to our QA workflow
at the end of a test run.

View File

@ -435,7 +435,7 @@ Changes in the Zend Engine 2.0
that of other object-oriented languages, such as Java: When the
last reference to an object is destroyed the object's
destructor, which is a class method name __destruct() that
recieves no parameters, is called before the object is freed
receives no parameters, is called before the object is freed
from memory.
Example:

View File

@ -357,7 +357,7 @@ var_dump($global_var);
test_unset3();
var_dump($global_var);
//Note: No error conditions relating to passing arugments can be tested
//Note: No error conditions relating to passing arguments can be tested
// because these are not functions but statements, it will result in syntax error.
?>
===DONE===

View File

@ -1,5 +1,5 @@
--TEST--
Bug #32428 (The @ warning error supression operator is broken)
Bug #32428 (The @ warning error suppression operator is broken)
--FILE--
<?php
$data = @$not_exists;

11
Zend/tests/bug64660.phpt Normal file

File diff suppressed because one or more lines are too long

48
Zend/tests/bug64720.phpt Normal file
View File

@ -0,0 +1,48 @@
--TEST--
Bug #64720 (SegFault on zend_deactivate)
--FILE--
<?php
class Stat {
private static $requests;
public static function getInstance() {
if (!isset(self::$requests[1])) {
self::$requests[1] = new self();
}
return self::$requests[1];
}
public function __destruct() {
unset(self::$requests[1]);
}
}
class Foo {
public function __construct() {
Stat::getInstance();
}
}
class Error {
private $trace;
public function __construct() {
$this->trace = debug_backtrace(1);
}
}
class Bar {
public function __destruct() {
Stat::getInstance();
new Error();
}
public function test() {
new Error();
}
}
$foo = new Foo();
$bar = new Bar();
$bar->test();
?>
--EXPECTF--
Fatal error: Access to undeclared static property: Stat::$requests in %sbug64720.php on line 12

View File

@ -0,0 +1,22 @@
--TEST--
Bug #64821 Custom Exceptions crash when internal properties overridden (variation 1)
--FILE--
<?php
class a extends exception {
public function __construct() {
$this->message = NULL;
$this->string = NULL;
$this->code = array();
$this->line = "hello";
}
}
throw new a;
?>
--EXPECTF--
Fatal error: Uncaught exception 'a' in %s:0
Stack trace:
#0 {main}
thrown in %s on line %d

View File

@ -0,0 +1,19 @@
--TEST--
Bug #64821 Custom Exceptions crash when internal properties overridden (variation 2)
--FILE--
<?php
class a extends exception {
public function __construct() {
$this->line = array();
}
}
throw new a;
?>
--EXPECTF--
Fatal error: Uncaught exception 'a' in %s:0
Stack trace:
#0 {main}
thrown in %s on line %d

View File

@ -0,0 +1,20 @@
--TEST--
Bug #64821 Custom Exceptions crash when internal properties overridden (variation 3)
--FILE--
<?php
class a extends exception {
public function __construct() {
$this->line = array();
$this->file = NULL;
}
}
throw new a;
?>
--EXPECTF--
Fatal error: Uncaught exception 'a' in :0
Stack trace:
#0 {main}
thrown in Unknown on line %d

40
Zend/tests/bug64960.phpt Normal file
View File

@ -0,0 +1,40 @@
--TEST--
Bug #64960 (Segfault in gc_zval_possible_root)
--FILE--
<?php
// this makes ob_end_clean raise an error
ob_end_flush();
class ExceptionHandler {
public function __invoke (Exception $e)
{
// this triggers the custom error handler
ob_end_clean();
}
}
// this must be a class, closure does not trigger segfault
set_exception_handler(new ExceptionHandler());
// exception must be throwed from error handler.
set_error_handler(function()
{
$e = new Exception;
$e->_trace = debug_backtrace();
throw $e;
});
// trigger error handler
$a['waa'];
?>
--EXPECTF--
Notice: ob_end_flush(): failed to delete and flush buffer. No buffer to delete or flush in %sbug64960.php on line 3
Fatal error: Uncaught exception 'Exception' in %sbug64960.php:19
Stack trace:
#0 [internal function]: {closure}(8, 'ob_end_clean():...', '%s', 9, Array)
#1 %sbug64960.php(9): ob_end_clean()
#2 [internal function]: ExceptionHandler->__invoke(Object(Exception))
#3 {main}
thrown in %sbug64960.php on line 19

30
Zend/tests/bug64966.phpt Normal file
View File

@ -0,0 +1,30 @@
--TEST--
Bug #64966 (segfault in zend_do_fcall_common_helper_SPEC)
--FILE--
<?php
error_reporting(E_ALL);
set_error_handler(function($error) { throw new Exception(); }, E_RECOVERABLE_ERROR);
function test($func) {
$a = $func("");
return true;
}
class A {
public function b() {
test("strlen");
test("iterator_apply");
}
}
$a = new A();
$a->b();
?>
--EXPECTF--
Fatal error: Uncaught exception 'Exception' in %sbug64966.php:3
Stack trace:
#0 [internal function]: {closure}(4096, 'Argument 1 pass...', '%s', 6, Array)
#1 %sbug64966.php(6): iterator_apply('')
#2 %sbug64966.php(12): test('iterator_apply')
#3 %sbug64966.php(17): A->b()
#4 {main}
thrown in %sbug64966.php on line 3

30
Zend/tests/bug64988.phpt Normal file
View File

@ -0,0 +1,30 @@
--TEST--
Bug #64988 (Class loading order affects E_STRICT warning)
--FILE--
<?php
abstract class Base1 {
public function insert(array $data){
return array_reverse($data);
}
}
class Noisy1 extends Base1 {
public function insert(array $data, $option1 = Null) {
if (!empty($option1)) {
$data['option1'] = $option1;
}
return parent::insert($data);
}
}
class Smooth1 extends Noisy1 {
public function insert(array $data) {
return parent::insert($data, count($data));
}
}
$o = new Smooth1();
echo "okey";
?>
--EXPECTF--
Strict Standards: Declaration of Smooth1::insert() should be compatible with Noisy1::insert(array $data, $option1 = NULL) in %sbug64988.php on line 20
okey

View File

@ -1,5 +1,5 @@
--TEST--
GC 007: Unreferensed array cycle
GC 007: Unreferenced array cycle
--INI--
zend.enable_gc=1
--FILE--

View File

@ -1,5 +1,5 @@
--TEST--
GC 008: Unreferensed object cycle
GC 008: Unreferenced object cycle
--INI--
zend.enable_gc=1
--FILE--

View File

@ -1,5 +1,5 @@
--TEST--
GC 009: Unreferensed array-object cycle
GC 009: Unreferenced array-object cycle
--INI--
zend.enable_gc=1
--FILE--

View File

@ -1143,7 +1143,7 @@ ZEND_API void object_properties_init(zend_object *object, zend_class_entry *clas
/* This function requires 'properties' to contain all props declared in the
* class and all props being public. If only a subset is given or the class
* has protected members then you need to merge the properties seperately by
* has protected members then you need to merge the properties separately by
* calling zend_merge_properties(). */
ZEND_API int _object_and_properties_init(zval *arg, zend_class_entry *class_type, HashTable *properties ZEND_FILE_LINE_DC TSRMLS_DC) /* {{{ */
{

View File

@ -90,7 +90,7 @@ typedef struct _zend_fcall_info_cache {
#define ZEND_NS_RAW_FENTRY(ns, zend_name, name, arg_info, flags) ZEND_RAW_FENTRY(ZEND_NS_NAME(ns, zend_name), name, arg_info, flags)
#define ZEND_NS_RAW_NAMED_FE(ns, zend_name, name, arg_info) ZEND_NS_RAW_FENTRY(ns, #zend_name, name, arg_info, 0)
#define ZEND_NS_NAMED_FE(ns, zend_name, name, arg_info) ZEND_NS_FENTRY(ns, #zend_name, name, arg_info, 0)
#define ZEND_NS_NAMED_FE(ns, zend_name, name, arg_info) ZEND_NS_FENTRY(ns, zend_name, name, arg_info, 0)
#define ZEND_NS_FE(ns, name, arg_info) ZEND_NS_FENTRY(ns, name, ZEND_FN(name), arg_info, 0)
#define ZEND_NS_DEP_FE(ns, name, arg_info) ZEND_NS_FENTRY(ns, name, ZEND_FN(name), arg_info, ZEND_ACC_DEPRECATED)
#define ZEND_NS_FALIAS(ns, name, alias, arg_info) ZEND_NS_FENTRY(ns, name, ZEND_FN(alias), arg_info, 0)
@ -461,7 +461,7 @@ ZEND_API extern const zend_fcall_info_cache empty_fcall_info_cache;
*/
ZEND_API int zend_fcall_info_init(zval *callable, uint check_flags, zend_fcall_info *fci, zend_fcall_info_cache *fcc, char **callable_name, char **error TSRMLS_DC);
/** Clear argumens connected with zend_fcall_info *fci
/** Clear arguments connected with zend_fcall_info *fci
* If free_mem is not zero then the params array gets free'd as well
*/
ZEND_API void zend_fcall_info_args_clear(zend_fcall_info *fci, int free_mem);
@ -499,7 +499,7 @@ ZEND_API int zend_fcall_info_argv(zend_fcall_info *fci TSRMLS_DC, int argc, va_l
ZEND_API int zend_fcall_info_argn(zend_fcall_info *fci TSRMLS_DC, int argc, ...);
/** Call a function using information created by zend_fcall_info_init()/args().
* If args is given then those replace the arguement info in fci is temporarily.
* If args is given then those replace the argument info in fci is temporarily.
*/
ZEND_API int zend_fcall_info_call(zend_fcall_info *fci, zend_fcall_info_cache *fcc, zval **retval, zval *args TSRMLS_DC);

View File

@ -3267,11 +3267,11 @@ static void do_inheritance_check_on_method(zend_function *child, zend_function *
if (child->common.prototype && (child->common.prototype->common.fn_flags & ZEND_ACC_ABSTRACT)) {
if (!zend_do_perform_implementation_check(child, child->common.prototype TSRMLS_CC)) {
zend_error(E_COMPILE_ERROR, "Declaration of %s::%s() must be compatible with %s", ZEND_FN_SCOPE_NAME(child), child->common.function_name, zend_get_function_declaration(child->common.prototype? child->common.prototype : parent TSRMLS_CC));
zend_error(E_COMPILE_ERROR, "Declaration of %s::%s() must be compatible with %s", ZEND_FN_SCOPE_NAME(child), child->common.function_name, zend_get_function_declaration(child->common.prototype TSRMLS_CC));
}
} else if (EG(error_reporting) & E_STRICT || EG(user_error_handler)) { /* Check E_STRICT (or custom error handler) before the check so that we save some time */
if (!zend_do_perform_implementation_check(child, parent TSRMLS_CC)) {
char *method_prototype = zend_get_function_declaration(child->common.prototype? child->common.prototype : parent TSRMLS_CC);
char *method_prototype = zend_get_function_declaration(parent TSRMLS_CC);
zend_error(E_STRICT, "Declaration of %s::%s() should be compatible with %s", ZEND_FN_SCOPE_NAME(child), child->common.function_name, method_prototype);
efree(method_prototype);
}
@ -3744,7 +3744,7 @@ static void zend_add_trait_method(zend_class_entry *ce, const char *name, const
#endif
} else {
/* inherited members are overridden by members inserted by traits */
/* check whether the trait method fullfills the inheritance requirements */
/* check whether the trait method fulfills the inheritance requirements */
do_inheritance_check_on_method(fn, existing_fn TSRMLS_CC);
}
}
@ -5479,7 +5479,7 @@ void zend_do_shell_exec(znode *result, const znode *cmd TSRMLS_DC) /* {{{ */
break;
}
SET_NODE(opline->op1, cmd);
opline->op2.opline_num = 0;
opline->op2.opline_num = 1;
opline->extended_value = ZEND_DO_FCALL;
SET_UNUSED(opline->op2);
@ -6943,7 +6943,7 @@ ZEND_API size_t zend_dirname(char *path, size_t len)
}
#elif defined(NETWARE)
/*
* Find the first occurence of : from the left
* Find the first occurrence of : from the left
* move the path pointer to the position just after :
* increment the len_adjust to the length of path till colon character(inclusive)
* If there is no character beyond : simple return len

View File

@ -817,6 +817,10 @@ ZEND_API void zend_exception_error(zval *exception, int severity TSRMLS_DC) /* {
if (instanceof_function(ce_exception, default_exception_ce TSRMLS_CC)) {
file = zend_read_property(default_exception_ce, EG(exception), "file", sizeof("file")-1, 1 TSRMLS_CC);
line = zend_read_property(default_exception_ce, EG(exception), "line", sizeof("line")-1, 1 TSRMLS_CC);
convert_to_string(file);
file = (Z_STRLEN_P(file) > 0) ? file : NULL;
line = (Z_TYPE_P(line) == IS_LONG) ? line : NULL;
} else {
file = NULL;
line = NULL;
@ -828,7 +832,11 @@ ZEND_API void zend_exception_error(zval *exception, int severity TSRMLS_DC) /* {
file = zend_read_property(default_exception_ce, exception, "file", sizeof("file")-1, 1 TSRMLS_CC);
line = zend_read_property(default_exception_ce, exception, "line", sizeof("line")-1, 1 TSRMLS_CC);
zend_error_va(severity, Z_STRVAL_P(file), Z_LVAL_P(line), "Uncaught %s\n thrown", Z_STRVAL_P(str));
convert_to_string(str);
convert_to_string(file);
convert_to_long(line);
zend_error_va(severity, (Z_STRLEN_P(file) > 0) ? Z_STRVAL_P(file) : NULL, Z_LVAL_P(line), "Uncaught %s\n thrown", Z_STRVAL_P(str));
} else {
zend_error(severity, "Uncaught exception '%s'", ce_exception->name);
}

View File

@ -254,15 +254,13 @@ void shutdown_executor(TSRMLS_D) /* {{{ */
if (EG(user_error_handler)) {
zeh = EG(user_error_handler);
EG(user_error_handler) = NULL;
zval_dtor(zeh);
FREE_ZVAL(zeh);
zval_ptr_dtor(&zeh);
}
if (EG(user_exception_handler)) {
zeh = EG(user_exception_handler);
EG(user_exception_handler) = NULL;
zval_dtor(zeh);
FREE_ZVAL(zeh);
zval_ptr_dtor(&zeh);
}
zend_stack_destroy(&EG(user_error_handlers_error_reporting));

View File

@ -106,7 +106,7 @@ typedef struct _zend_gc_globals {
gc_root_buffer *first_unused; /* pointer to first unused buffer */
gc_root_buffer *last_unused; /* pointer to last unused buffer */
zval_gc_info *zval_to_free; /* temporaryt list of zvals to free */
zval_gc_info *zval_to_free; /* temporary list of zvals to free */
zval_gc_info *free_list;
zval_gc_info *next_to_free;
@ -199,7 +199,7 @@ static zend_always_inline void gc_remove_from_buffer(gc_root_buffer *root TSRMLS
GC_ZVAL_INIT(z); \
} while (0)
/* The following macroses override macroses from zend_alloc.h */
/* The following macros override macros from zend_alloc.h */
#undef ALLOC_ZVAL
#define ALLOC_ZVAL(z) \
do { \

View File

@ -1,4 +1,4 @@
/* Generated by re2c 0.13.5 on Wed Mar 27 23:52:29 2013 */
/* Generated by re2c 0.13.5 on Mon May 20 00:45:38 2013 */
#line 1 "Zend/zend_language_scanner.l"
/*
+----------------------------------------------------------------------+
@ -585,7 +585,7 @@ ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type TSR
compiler_result = zendparse(TSRMLS_C);
zend_do_return(&retval_znode, 0 TSRMLS_CC);
CG(in_compilation) = original_in_compilation;
if (compiler_result==1) { /* parser error */
if (compiler_result != 0) { /* parser error */
zend_bailout();
}
compilation_successful=1;
@ -760,7 +760,7 @@ zend_op_array *compile_string(zval *source_string, char *filename TSRMLS_DC)
SCNG(script_filtered) = NULL;
}
if (compiler_result==1) {
if (compiler_result != 0) {
CG(active_op_array) = original_active_op_array;
CG(unclean_shutdown)=1;
destroy_op_array(op_array TSRMLS_CC);

View File

@ -583,7 +583,7 @@ ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type TSR
compiler_result = zendparse(TSRMLS_C);
zend_do_return(&retval_znode, 0 TSRMLS_CC);
CG(in_compilation) = original_in_compilation;
if (compiler_result==1) { /* parser error */
if (compiler_result != 0) { /* parser error */
zend_bailout();
}
compilation_successful=1;
@ -758,7 +758,7 @@ zend_op_array *compile_string(zval *source_string, char *filename TSRMLS_DC)
SCNG(script_filtered) = NULL;
}
if (compiler_result==1) {
if (compiler_result != 0) {
CG(active_op_array) = original_active_op_array;
CG(unclean_shutdown)=1;
destroy_op_array(op_array TSRMLS_CC);

View File

@ -1278,6 +1278,14 @@ ZEND_API zval **zend_std_get_static_property(zend_class_entry *ce, const char *p
}
}
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL) ||
UNEXPECTED(CE_STATIC_MEMBERS(ce)[property_info->offset] == NULL)) {
if (!silent) {
zend_error_noreturn(E_ERROR, "Access to undeclared static property: %s::$%s", ce->name, property_name);
}
return NULL;
}
return &CE_STATIC_MEMBERS(ce)[property_info->offset];
}
/* }}} */

View File

@ -162,8 +162,9 @@ static inline void cleanup_user_class_data(zend_class_entry *ce TSRMLS_DC)
for (i = 0; i < ce->default_static_members_count; i++) {
if (ce->static_members_table[i]) {
zval_ptr_dtor(&ce->static_members_table[i]);
zval *p = ce->static_members_table[i];
ce->static_members_table[i] = NULL;
zval_ptr_dtor(&p);
}
}
ce->static_members_table = NULL;

View File

@ -1475,7 +1475,7 @@ ZEND_API int compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {
/* If both are objects sharing the same comparision handler then use is */
if (Z_OBJ_HANDLER_P(op1,compare_objects) == Z_OBJ_HANDLER_P(op2,compare_objects)) {
if (Z_OBJ_HANDLE_P(op1) == Z_OBJ_HANDLE_P(op2)) {
/* object handles are identical, apprently this is the same object */
/* object handles are identical, apparently this is the same object */
ZVAL_LONG(result, 0);
return SUCCESS;
}

View File

@ -2684,6 +2684,8 @@ ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY)
if (!RETURN_VALUE_USED(opline)) {
zval_ptr_dtor(&ret->var.ptr);
}
} else if (RETURN_VALUE_USED(opline)) {
EX_T(opline->result.var).var.ptr = NULL;
}
} else if (fbc->type == ZEND_USER_FUNCTION) {
EX(original_return_value) = EG(return_value_ptr_ptr);

View File

@ -648,6 +648,8 @@ static int ZEND_FASTCALL zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_AR
if (!RETURN_VALUE_USED(opline)) {
zval_ptr_dtor(&ret->var.ptr);
}
} else if (RETURN_VALUE_USED(opline)) {
EX_T(opline->result.var).var.ptr = NULL;
}
} else if (fbc->type == ZEND_USER_FUNCTION) {
EX(original_return_value) = EG(return_value_ptr_ptr);

View File

@ -1832,7 +1832,7 @@ AC_TRY_COMPILE([
])
dnl -------------------------------------------------------------------------
dnl Library/function existance and build sanity checks
dnl Library/function existence and build sanity checks
dnl -------------------------------------------------------------------------
dnl

View File

@ -376,11 +376,11 @@ while [ $# -gt 0 ]; do
eval "opt_${opt_OPT}=yes"
;;
':' )
# option with argument (multiple occurances override)
# option with argument (multiple occurrences override)
eval "opt_${opt_OPT}=\"\$opt_ARG\""
;;
'+' )
# option with argument (multiple occurances append)
# option with argument (multiple occurrences append)
eval "opt_${opt_OPT}=\"\$opt_${opt_OPT}\${ASC_NL}\$opt_ARG\""
;;
* )

View File

@ -119,7 +119,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
PHP_MAJOR_VERSION=5
PHP_MINOR_VERSION=4
PHP_RELEASE_VERSION=16
PHP_RELEASE_VERSION=17
PHP_EXTRA_VERSION="-dev"
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`

View File

@ -518,7 +518,7 @@ static PHP_FUNCTION(bzcompress)
efree(dest);
RETURN_LONG(error);
} else {
/* Copy the buffer, we have perhaps allocate alot more than we need,
/* Copy the buffer, we have perhaps allocate a lot more than we need,
so we erealloc() the buffer to the proper size */
dest = erealloc(dest, dest_len + 1);
dest[dest_len] = 0;

View File

@ -272,6 +272,7 @@
#define HALAKIM_PER_METONIC_CYCLE (HALAKIM_PER_LUNAR_CYCLE * (12 * 19 + 7))
#define JEWISH_SDN_OFFSET 347997
#define JEWISH_SDN_MAX 324542846L /* 12/13/887605, greater value raises interger overflow */
#define NEW_MOON_OF_CREATION 31524
#define SUNDAY 0
@ -519,7 +520,7 @@ void SdnToJewish(
int tishri1After;
int yearLength;
if (sdn <= JEWISH_SDN_OFFSET) {
if (sdn <= JEWISH_SDN_OFFSET || sdn > JEWISH_SDN_MAX) {
*pYear = 0;
*pMonth = 0;
*pDay = 0;

View File

@ -0,0 +1,19 @@
--TEST--
Bug #64895: Integer overflow in SndToJewish
--SKIPIF--
<?php
include 'skipif.inc';
if (PHP_INT_SIZE == 4) {
die("skip this test is for 64bit platform only");
}
?>
--FILE--
<?php
$a = array(38245310, 324542846, 324542847, 9223372036854743639);
foreach ($a as $x) var_dump(jdtojewish($x));
--EXPECTF--
string(11) "2/22/103759"
string(12) "12/13/887605"
string(5) "0/0/0"
string(5) "0/0/0"

View File

@ -429,7 +429,7 @@ PHP_FUNCTION(com_variant_create_instance)
/* If already an array and VT_ARRAY is passed then:
- if only VT_ARRAY passed then do not perform a conversion
- if VT_ARRAY plus other type passed then perform conversion
but will probably fail (origional behavior)
but will probably fail (original behavior)
*/
if ((vt & VT_ARRAY) && (V_VT(&obj->v) & VT_ARRAY)) {
long orig_vt = vt;

View File

@ -39,6 +39,20 @@ static __inline __int64_t php_date_llabs( __int64_t i ) { return i >= 0 ? i : -i
static inline long long php_date_llabs( long long i ) { return i >= 0 ? i : -i; }
#endif
#ifdef PHP_WIN32
#define DATE_I64_BUF_LEN 65
# define DATE_I64A(i, s, len) _i64toa_s(i, s, len, 10)
# define DATE_A64I(i, s) i = _atoi64(s)
#else
#define DATE_I64_BUF_LEN 65
# define DATE_I64A(i, s, len) \
do { \
int st = snprintf(s, len, "%lld", i); \
s[st] = '\0'; \
} while (0);
# define DATE_A64I(i, s) i = atoll(s)
#endif
/* {{{ arginfo */
ZEND_BEGIN_ARG_INFO_EX(arginfo_date, 0, 0, 1)
ZEND_ARG_INFO(0, format)
@ -472,6 +486,8 @@ const zend_function_entry date_funcs_interval[] = {
const zend_function_entry date_funcs_period[] = {
PHP_ME(DatePeriod, __construct, arginfo_date_period_construct, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC)
PHP_ME(DatePeriod, __wakeup, NULL, ZEND_ACC_PUBLIC)
PHP_ME(DatePeriod, __set_state, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
PHP_FE_END
};
@ -569,9 +585,13 @@ static HashTable *date_object_get_gc(zval *object, zval ***table, int *n TSRMLS_
static HashTable *date_object_get_properties(zval *object TSRMLS_DC);
static HashTable *date_object_get_gc_interval(zval *object, zval ***table, int *n TSRMLS_DC);
static HashTable *date_object_get_properties_interval(zval *object TSRMLS_DC);
static HashTable *date_object_get_gc_period(zval *object, zval ***table, int *n TSRMLS_DC);
static HashTable *date_object_get_properties_period(zval *object TSRMLS_DC);
zval *date_interval_read_property(zval *object, zval *member, int type, const zend_literal *key TSRMLS_DC);
void date_interval_write_property(zval *object, zval *member, zval *value, const zend_literal *key TSRMLS_DC);
static zval *date_period_read_property(zval *object, zval *member, int type, const zend_literal *key TSRMLS_DC);
static void date_period_write_property(zval *object, zval *member, zval *value, const zend_literal *key TSRMLS_DC);
/* {{{ Module struct */
zend_module_entry date_module_entry = {
@ -1982,6 +2002,11 @@ static void date_register_classes(TSRMLS_D)
zend_class_implements(date_ce_period TSRMLS_CC, 1, zend_ce_traversable);
memcpy(&date_object_handlers_period, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
date_object_handlers_period.clone_obj = date_object_clone_period;
date_object_handlers_period.get_properties = date_object_get_properties_period;
date_object_handlers_period.get_property_ptr_ptr = NULL;
date_object_handlers_period.get_gc = date_object_get_gc_period;
date_object_handlers_period.read_property = date_period_read_property;
date_object_handlers_period.write_property = date_period_write_property;
#define REGISTER_PERIOD_CLASS_CONST_STRING(const_name, value) \
zend_declare_class_constant_long(date_ce_period, const_name, sizeof(const_name)-1, value TSRMLS_CC);
@ -2081,7 +2106,7 @@ static HashTable *date_object_get_properties(zval *object TSRMLS_DC)
props = zend_std_get_properties(object TSRMLS_CC);
if (!dateobj->time) {
if (!dateobj->time || GC_G(gc_active)) {
return props;
}
@ -2229,7 +2254,6 @@ static HashTable *date_object_get_properties_interval(zval *object TSRMLS_DC)
zval *zv;
php_interval_obj *intervalobj;
intervalobj = (php_interval_obj *) zend_object_store_get_object(object TSRMLS_CC);
props = zend_std_get_properties(object TSRMLS_CC);
@ -2240,7 +2264,7 @@ static HashTable *date_object_get_properties_interval(zval *object TSRMLS_DC)
#define PHP_DATE_INTERVAL_ADD_PROPERTY(n,f) \
MAKE_STD_ZVAL(zv); \
ZVAL_LONG(zv, intervalobj->diff->f); \
ZVAL_LONG(zv, (long)intervalobj->diff->f); \
zend_hash_update(props, n, strlen(n) + 1, &zv, sizeof(zval), NULL);
PHP_DATE_INTERVAL_ADD_PROPERTY("y", y);
@ -2249,6 +2273,9 @@ static HashTable *date_object_get_properties_interval(zval *object TSRMLS_DC)
PHP_DATE_INTERVAL_ADD_PROPERTY("h", h);
PHP_DATE_INTERVAL_ADD_PROPERTY("i", i);
PHP_DATE_INTERVAL_ADD_PROPERTY("s", s);
PHP_DATE_INTERVAL_ADD_PROPERTY("weekday", weekday);
PHP_DATE_INTERVAL_ADD_PROPERTY("weekday_behavior", weekday_behavior);
PHP_DATE_INTERVAL_ADD_PROPERTY("first_last_day_of", first_last_day_of);
PHP_DATE_INTERVAL_ADD_PROPERTY("invert", invert);
if (intervalobj->diff->days != -99999) {
PHP_DATE_INTERVAL_ADD_PROPERTY("days", days);
@ -2257,6 +2284,10 @@ static HashTable *date_object_get_properties_interval(zval *object TSRMLS_DC)
ZVAL_FALSE(zv);
zend_hash_update(props, "days", 5, &zv, sizeof(zval), NULL);
}
PHP_DATE_INTERVAL_ADD_PROPERTY("special_type", special.type);
PHP_DATE_INTERVAL_ADD_PROPERTY("special_amount", special.amount);
PHP_DATE_INTERVAL_ADD_PROPERTY("have_weekday_relative", have_weekday_relative);
PHP_DATE_INTERVAL_ADD_PROPERTY("have_special_relative", have_special_relative);
return props;
}
@ -2358,6 +2389,7 @@ PHPAPI zval *php_date_instantiate(zend_class_entry *pce, zval *object TSRMLS_DC)
object_init_ex(object, pce);
Z_SET_REFCOUNT_P(object, 1);
Z_UNSET_ISREF_P(object);
return object;
}
@ -3629,30 +3661,48 @@ PHP_METHOD(DateInterval, __construct)
}
/* }}} */
static long php_date_long_from_hash_element(HashTable *myht, char *element, size_t size)
{
zval **z_arg = NULL;
if (zend_hash_find(myht, element, size + 1, (void**) &z_arg) == SUCCESS) {
convert_to_long(*z_arg);
return Z_LVAL_PP(z_arg);
} else {
return -1;
}
}
static int php_date_interval_initialize_from_hash(zval **return_value, php_interval_obj **intobj, HashTable *myht TSRMLS_DC)
{
(*intobj)->diff = timelib_rel_time_ctor();
(*intobj)->diff->y = php_date_long_from_hash_element(myht, "y", 1);
(*intobj)->diff->m = php_date_long_from_hash_element(myht, "m", 1);
(*intobj)->diff->d = php_date_long_from_hash_element(myht, "d", 1);
(*intobj)->diff->h = php_date_long_from_hash_element(myht, "h", 1);
(*intobj)->diff->i = php_date_long_from_hash_element(myht, "i", 1);
(*intobj)->diff->s = php_date_long_from_hash_element(myht, "s", 1);
(*intobj)->diff->invert = php_date_long_from_hash_element(myht, "invert", 6);
(*intobj)->diff->days = php_date_long_from_hash_element(myht, "days", 4);
#define PHP_DATE_INTERVAL_READ_PROPERTY(element, member, itype, def) \
do { \
zval **z_arg = NULL; \
if (zend_hash_find(myht, element, strlen(element) + 1, (void**) &z_arg) == SUCCESS) { \
convert_to_long(*z_arg); \
(*intobj)->diff->member = (itype)Z_LVAL_PP(z_arg); \
} else { \
(*intobj)->diff->member = (itype)def; \
} \
} while (0);
#define PHP_DATE_INTERVAL_READ_PROPERTY_I64(element, member) \
do { \
zval **z_arg = NULL; \
if (zend_hash_find(myht, element, strlen(element) + 1, (void**) &z_arg) == SUCCESS) { \
convert_to_string(*z_arg); \
DATE_A64I((*intobj)->diff->member, Z_STRVAL_PP(z_arg)); \
} else { \
(*intobj)->diff->member = -1LL; \
} \
} while (0);
PHP_DATE_INTERVAL_READ_PROPERTY("y", y, timelib_sll, -1)
PHP_DATE_INTERVAL_READ_PROPERTY("m", m, timelib_sll, -1)
PHP_DATE_INTERVAL_READ_PROPERTY("d", d, timelib_sll, -1)
PHP_DATE_INTERVAL_READ_PROPERTY("h", h, timelib_sll, -1)
PHP_DATE_INTERVAL_READ_PROPERTY("i", i, timelib_sll, -1)
PHP_DATE_INTERVAL_READ_PROPERTY("s", s, timelib_sll, -1)
PHP_DATE_INTERVAL_READ_PROPERTY("weekday", weekday, int, -1)
PHP_DATE_INTERVAL_READ_PROPERTY("weekday_behavior", weekday_behavior, int, -1)
PHP_DATE_INTERVAL_READ_PROPERTY("first_last_day_of", first_last_day_of, int, -1)
PHP_DATE_INTERVAL_READ_PROPERTY("invert", invert, int, 0);
PHP_DATE_INTERVAL_READ_PROPERTY_I64("days", days);
PHP_DATE_INTERVAL_READ_PROPERTY("special_type", special.type, unsigned int, 0);
PHP_DATE_INTERVAL_READ_PROPERTY_I64("special_amount", special.amount);
PHP_DATE_INTERVAL_READ_PROPERTY("have_weekday_relative", have_weekday_relative, unsigned int, 0);
PHP_DATE_INTERVAL_READ_PROPERTY("have_special_relative", have_special_relative, unsigned int, 0);
(*intobj)->initialized = 1;
return 0;
@ -4256,6 +4306,229 @@ PHP_FUNCTION(date_sun_info)
timelib_time_dtor(t2);
}
/* }}} */
static HashTable *date_object_get_gc_period(zval *object, zval ***table, int *n TSRMLS_DC)
{
*table = NULL;
*n = 0;
return zend_std_get_properties(object TSRMLS_CC);
}
static HashTable *date_object_get_properties_period(zval *object TSRMLS_DC)
{
HashTable *props;
zval *zv;
php_period_obj *period_obj;
period_obj = zend_object_store_get_object(object TSRMLS_CC);
props = zend_std_get_properties(object TSRMLS_CC);
if (!period_obj->start || GC_G(gc_active)) {
return props;
}
MAKE_STD_ZVAL(zv);
if (period_obj->start) {
php_date_obj *date_obj;
object_init_ex(zv, date_ce_date);
date_obj = zend_object_store_get_object(zv TSRMLS_CC);
date_obj->time = timelib_time_clone(period_obj->start);
} else {
ZVAL_NULL(zv);
}
zend_hash_update(props, "start", sizeof("start"), &zv, sizeof(zv), NULL);
MAKE_STD_ZVAL(zv);
if (period_obj->current) {
php_date_obj *date_obj;
object_init_ex(zv, date_ce_date);
date_obj = zend_object_store_get_object(zv TSRMLS_CC);
date_obj->time = timelib_time_clone(period_obj->current);
} else {
ZVAL_NULL(zv);
}
zend_hash_update(props, "current", sizeof("current"), &zv, sizeof(zv), NULL);
MAKE_STD_ZVAL(zv);
if (period_obj->end) {
php_date_obj *date_obj;
object_init_ex(zv, date_ce_date);
date_obj = zend_object_store_get_object(zv TSRMLS_CC);
date_obj->time = timelib_time_clone(period_obj->end);
} else {
ZVAL_NULL(zv);
}
zend_hash_update(props, "end", sizeof("end"), &zv, sizeof(zv), NULL);
MAKE_STD_ZVAL(zv);
if (period_obj->interval) {
php_interval_obj *interval_obj;
object_init_ex(zv, date_ce_interval);
interval_obj = zend_object_store_get_object(zv TSRMLS_CC);
interval_obj->diff = timelib_rel_time_clone(period_obj->interval);
interval_obj->initialized = 1;
} else {
ZVAL_NULL(zv);
}
zend_hash_update(props, "interval", sizeof("interval"), &zv, sizeof(zv), NULL);
/* converted to larger type (int->long); must check when unserializing */
MAKE_STD_ZVAL(zv);
ZVAL_LONG(zv, (long) period_obj->recurrences);
zend_hash_update(props, "recurrences", sizeof("recurrences"), &zv, sizeof(zv), NULL);
MAKE_STD_ZVAL(zv);
ZVAL_BOOL(zv, period_obj->include_start_date);
zend_hash_update(props, "include_start_date", sizeof("include_start_date"), &zv, sizeof(zv), NULL);
return props;
}
static int php_date_period_initialize_from_hash(php_period_obj *period_obj, HashTable *myht TSRMLS_DC)
{
zval **ht_entry;
/* this function does no rollback on error */
if (zend_hash_find(myht, "start", sizeof("start"), (void**) &ht_entry) == SUCCESS) {
if (Z_TYPE_PP(ht_entry) == IS_OBJECT && Z_OBJCE_PP(ht_entry) == date_ce_date) {
php_date_obj *date_obj;
date_obj = zend_object_store_get_object(*ht_entry TSRMLS_CC);
period_obj->start = timelib_time_clone(date_obj->time);
} else if (Z_TYPE_PP(ht_entry) != IS_NULL) {
return 0;
}
} else {
return 0;
}
if (zend_hash_find(myht, "end", sizeof("end"), (void**) &ht_entry) == SUCCESS) {
if (Z_TYPE_PP(ht_entry) == IS_OBJECT && Z_OBJCE_PP(ht_entry) == date_ce_date) {
php_date_obj *date_obj;
date_obj = zend_object_store_get_object(*ht_entry TSRMLS_CC);
period_obj->end = timelib_time_clone(date_obj->time);
} else if (Z_TYPE_PP(ht_entry) != IS_NULL) {
return 0;
}
} else {
return 0;
}
if (zend_hash_find(myht, "current", sizeof("current"), (void**) &ht_entry) == SUCCESS) {
if (Z_TYPE_PP(ht_entry) == IS_OBJECT && Z_OBJCE_PP(ht_entry) == date_ce_date) {
php_date_obj *date_obj;
date_obj = zend_object_store_get_object(*ht_entry TSRMLS_CC);
period_obj->current = timelib_time_clone(date_obj->time);
} else if (Z_TYPE_PP(ht_entry) != IS_NULL) {
return 0;
}
} else {
return 0;
}
if (zend_hash_find(myht, "interval", sizeof("interval"), (void**) &ht_entry) == SUCCESS) {
if (Z_TYPE_PP(ht_entry) == IS_OBJECT && Z_OBJCE_PP(ht_entry) == date_ce_interval) {
php_interval_obj *interval_obj;
interval_obj = zend_object_store_get_object(*ht_entry TSRMLS_CC);
period_obj->interval = timelib_rel_time_clone(interval_obj->diff);
} else { /* interval is required */
return 0;
}
} else {
return 0;
}
if (zend_hash_find(myht, "recurrences", sizeof("recurrences"), (void**) &ht_entry) == SUCCESS &&
Z_TYPE_PP(ht_entry) == IS_LONG && Z_LVAL_PP(ht_entry) >= 0 && Z_LVAL_PP(ht_entry) <= INT_MAX) {
period_obj->recurrences = Z_LVAL_PP(ht_entry);
} else {
return 0;
}
if (zend_hash_find(myht, "include_start_date", sizeof("include_start_date"), (void**) &ht_entry) == SUCCESS &&
Z_TYPE_PP(ht_entry) == IS_BOOL) {
period_obj->include_start_date = Z_BVAL_PP(ht_entry);
} else {
return 0;
}
period_obj->initialized = 1;
return 1;
}
/* {{{ proto DatePeriod::__set_state()
*/
PHP_METHOD(DatePeriod, __set_state)
{
php_period_obj *period_obj;
zval *array;
HashTable *myht;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &array) == FAILURE) {
RETURN_FALSE;
}
myht = Z_ARRVAL_P(array);
object_init_ex(return_value, date_ce_period);
period_obj = zend_object_store_get_object(return_value TSRMLS_CC);
if (!php_date_period_initialize_from_hash(period_obj, myht TSRMLS_CC)) {
php_error(E_ERROR, "Invalid serialization data for DatePeriod object");
}
}
/* }}} */
/* {{{ proto DatePeriod::__wakeup()
*/
PHP_METHOD(DatePeriod, __wakeup)
{
zval *object = getThis();
php_period_obj *period_obj;
HashTable *myht;
period_obj = zend_object_store_get_object(object TSRMLS_CC);
myht = Z_OBJPROP_P(object);
if (!php_date_period_initialize_from_hash(period_obj, myht TSRMLS_CC)) {
php_error(E_ERROR, "Invalid serialization data for DatePeriod object");
}
}
/* }}} */
/* {{{ date_period_read_property */
static zval *date_period_read_property(zval *object, zval *member, int type, const zend_literal *key TSRMLS_DC)
{
zval *zv;
if (type != BP_VAR_IS && type != BP_VAR_R) {
php_error_docref(NULL TSRMLS_CC, E_ERROR, "Retrieval of DatePeriod properties for modification is unsupported");
}
Z_OBJPROP_P(object); /* build properties hash table */
zv = std_object_handlers.read_property(object, member, type, key TSRMLS_CC);
if (Z_TYPE_P(zv) == IS_OBJECT && Z_OBJ_HANDLER_P(zv, clone_obj)) {
/* defensive copy */
zend_object_value zov = Z_OBJ_HANDLER_P(zv, clone_obj)(zv TSRMLS_CC);
MAKE_STD_ZVAL(zv);
Z_TYPE_P(zv) = IS_OBJECT;
Z_OBJVAL_P(zv) = zov;
}
return zv;
}
/* }}} */
/* {{{ date_period_write_property */
static void date_period_write_property(zval *object, zval *member, zval *value, const zend_literal *key TSRMLS_DC)
{
php_error_docref(NULL TSRMLS_CC, E_ERROR, "Writing to DatePeriod properties is unsupported");
}
/* }}} */
/*
* Local variables:
* tab-width: 4

View File

@ -88,6 +88,8 @@ PHP_FUNCTION(date_interval_format);
PHP_FUNCTION(date_interval_create_from_date_string);
PHP_METHOD(DatePeriod, __construct);
PHP_METHOD(DatePeriod, __wakeup);
PHP_METHOD(DatePeriod, __set_state);
/* Options and Configuration */
PHP_FUNCTION(date_default_timezone_set);

View File

@ -11,8 +11,8 @@ $other = new DateTime("31-July-2008");
$diff = date_diff($date, $other);
var_dump($diff);
--EXPECT--
object(DateInterval)#3 (8) {
--EXPECTF--
object(DateInterval)#%d (15) {
["y"]=>
int(0)
["m"]=>
@ -25,8 +25,22 @@ object(DateInterval)#3 (8) {
int(0)
["s"]=>
int(0)
["weekday"]=>
int(0)
["weekday_behavior"]=>
int(0)
["first_last_day_of"]=>
int(0)
["invert"]=>
int(0)
["days"]=>
int(3)
["special_type"]=>
int(0)
["special_amount"]=>
int(0)
["have_weekday_relative"]=>
int(0)
["have_special_relative"]=>
int(0)
}

View File

@ -15,8 +15,15 @@ DateInterval Object
[h] => 12
[i] => 30
[s] => 5
[weekday] => 0
[weekday_behavior] => 0
[first_last_day_of] => 0
[invert] => 0
[days] =>%s
[days] =>
[special_type] => 0
[special_amount] => 0
[have_weekday_relative] => 0
[have_special_relative] => 0
)
DateInterval Object
(
@ -26,6 +33,13 @@ DateInterval Object
[h] => 12
[i] => 30
[s] => 5
[weekday] => 0
[weekday_behavior] => 0
[first_last_day_of] => 0
[invert] => 0
[days] =>%s
[days] => 0
[special_type] => 0
[special_amount] => 0
[have_weekday_relative] => 0
[have_special_relative] => 0
)

View File

@ -17,6 +17,13 @@ DateInterval Object
[h] => 4
[i] => 0
[s] => 0
[weekday] => 0
[weekday_behavior] => 0
[first_last_day_of] => 0
[invert] => 0
[days] => 30
[special_type] => 0
[special_amount] => 0
[have_weekday_relative] => 0
[have_special_relative] => 0
)

View File

@ -8,7 +8,7 @@ echo $i->format("%d"), "\n";
echo $i->format("%a"), "\n";
?>
--EXPECT--
object(DateInterval)#1 (8) {
object(DateInterval)#1 (15) {
["y"]=>
int(0)
["m"]=>
@ -21,10 +21,24 @@ object(DateInterval)#1 (8) {
int(0)
["s"]=>
int(0)
["weekday"]=>
int(0)
["weekday_behavior"]=>
int(0)
["first_last_day_of"]=>
int(0)
["invert"]=>
int(0)
["days"]=>
bool(false)
["special_type"]=>
int(0)
["special_amount"]=>
int(0)
["have_weekday_relative"]=>
int(0)
["have_special_relative"]=>
int(0)
}
7
(unknown)

View File

@ -32,7 +32,7 @@ var_dump($unser, $p);
?>
--EXPECT--
object(DateInterval)#3 (8) {
object(DateInterval)#3 (15) {
["y"]=>
int(0)
["m"]=>
@ -45,12 +45,26 @@ object(DateInterval)#3 (8) {
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)
}
string(128) "O:12:"DateInterval":8:{s:1:"y";i:0;s:1:"m";i:0;s:1:"d";i:0;s:1:"h";i:4;s:1:"i";i:0;s:1:"s";i:0;s:6:"invert";i:0;s:4:"days";i:0;}"
string(320) "O:12:"DateInterval":15:{s:1:"y";i:0;s:1:"m";i:0;s:1:"d";i:0;s:1:"h";i:4;s:1:"i";i:0;s:1:"s";i:0;s:7:"weekday";i:0;s:16:"weekday_behavior";i:0;s:17:"first_last_day_of";i:0;s:6:"invert";i:0;s:4:"days";i:0;s:12:"special_type";i:0;s:14:"special_amount";i:0;s:21:"have_weekday_relative";i:0;s:21:"have_special_relative";i:0;}"
DateInterval::__set_state(array(
'y' => 0,
'm' => 0,
@ -58,9 +72,16 @@ DateInterval::__set_state(array(
'h' => 4,
'i' => 0,
's' => 0,
'weekday' => 0,
'weekday_behavior' => 0,
'first_last_day_of' => 0,
'invert' => 0,
'days' => 0,
))object(DateInterval)#5 (8) {
'special_type' => 0,
'special_amount' => 0,
'have_weekday_relative' => 0,
'have_special_relative' => 0,
))object(DateInterval)#5 (15) {
["y"]=>
int(0)
["m"]=>
@ -73,14 +94,78 @@ DateInterval::__set_state(array(
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)
}
object(DatePeriod)#6 (0) {
object(DatePeriod)#6 (6) {
["start"]=>
object(DateTime)#4 (3) {
["date"]=>
string(19) "2003-01-02 08:00:00"
["timezone_type"]=>
int(3)
["timezone"]=>
string(3) "UTC"
}
["current"]=>
NULL
["end"]=>
NULL
["interval"]=>
object(DateInterval)#7 (15) {
["y"]=>
int(0)
["m"]=>
int(0)
["d"]=>
int(0)
["h"]=>
int(4)
["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)
}
["recurrences"]=>
int(3)
["include_start_date"]=>
bool(true)
}
object(DateInterval)#4 (8) {
object(DateInterval)#8 (15) {
["y"]=>
int(7)
["m"]=>
@ -93,10 +178,74 @@ object(DateInterval)#4 (8) {
int(3)
["s"]=>
int(2)
["weekday"]=>
int(-1)
["weekday_behavior"]=>
int(-1)
["first_last_day_of"]=>
int(-1)
["invert"]=>
int(1)
["days"]=>
int(2400)
["special_type"]=>
int(0)
["special_amount"]=>
int(-1)
["have_weekday_relative"]=>
int(0)
["have_special_relative"]=>
int(0)
}
object(DatePeriod)#7 (0) {
object(DatePeriod)#9 (6) {
["start"]=>
object(DateTime)#6 (3) {
["date"]=>
string(19) "2003-01-02 08:00:00"
["timezone_type"]=>
int(3)
["timezone"]=>
string(3) "UTC"
}
["current"]=>
NULL
["end"]=>
NULL
["interval"]=>
object(DateInterval)#7 (15) {
["y"]=>
int(0)
["m"]=>
int(0)
["d"]=>
int(0)
["h"]=>
int(4)
["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)
}
["recurrences"]=>
int(3)
["include_start_date"]=>
bool(true)
}

View File

@ -27,6 +27,13 @@ di Object
[h] => 0
[i] => 0
[s] => 0
[weekday] => 0
[weekday_behavior] => 0
[first_last_day_of] => 0
[invert] => 0
[days] =>
[special_type] => 0
[special_amount] => 0
[have_weekday_relative] => 0
[have_special_relative] => 0
)

View File

@ -25,7 +25,7 @@ foreach($intervals as $iv) {
echo "==DONE==\n";
?>
--EXPECTF--
object(DateInterval)#%d (8) {
object(DateInterval)#%d (15) {
["y"]=>
int(1)
["m"]=>
@ -38,12 +38,26 @@ object(DateInterval)#%d (8) {
int(30)
["s"]=>
int(0)
["weekday"]=>
int(0)
["weekday_behavior"]=>
int(0)
["first_last_day_of"]=>
int(0)
["invert"]=>
int(1)
["days"]=>
int(437)
["special_type"]=>
int(0)
["special_amount"]=>
int(0)
["have_weekday_relative"]=>
int(0)
["have_special_relative"]=>
int(0)
}
object(DateInterval)#%d (8) {
object(DateInterval)#%d (15) {
["y"]=>
int(0)
["m"]=>
@ -56,12 +70,26 @@ object(DateInterval)#%d (8) {
int(30)
["s"]=>
int(0)
["weekday"]=>
int(0)
["weekday_behavior"]=>
int(0)
["first_last_day_of"]=>
int(0)
["invert"]=>
int(0)
["days"]=>
int(294)
["special_type"]=>
int(0)
["special_amount"]=>
int(0)
["have_weekday_relative"]=>
int(0)
["have_special_relative"]=>
int(0)
}
object(DateInterval)#%d (8) {
object(DateInterval)#%d (15) {
["y"]=>
int(0)
["m"]=>
@ -74,10 +102,24 @@ object(DateInterval)#%d (8) {
int(30)
["s"]=>
int(0)
["weekday"]=>
int(0)
["weekday_behavior"]=>
int(0)
["first_last_day_of"]=>
int(0)
["invert"]=>
int(0)
["days"]=>
int(294)
["special_type"]=>
int(0)
["special_amount"]=>
int(0)
["have_weekday_relative"]=>
int(0)
["have_special_relative"]=>
int(0)
}
DateInterval::__construct(): Failed to parse interval (2007-05-11T15:30:00Z/)
DateInterval::__construct(): Failed to parse interval (2007-05-11T15:30:00Z)

View File

@ -1,7 +1,5 @@
--TEST--
Bug #53437 (Crash when using unserialized DatePeriod instance)
--XFAIL--
Bug #53437 Not fixed yet
Bug #53437 (Crash when using unserialized DatePeriod instance), variation 1
--FILE--
<?php
$dp = new DatePeriod(new DateTime('2010-01-01 UTC'), new DateInterval('P1D'), 2);
@ -20,9 +18,137 @@ $dpu = unserialize($ser); // $dpu has invalid values???
var_dump($dpu);
echo "Unserialized:\r\n";
// ???which leads to CRASH:
foreach($dpu as $dt) {
echo $dt->format('Y-m-d H:i:s')."\r\n";
}
?>
==DONE==
--EXPECT--
Original:
2010-01-01 00:00:00
2010-01-02 00:00:00
2010-01-03 00:00:00
object(DatePeriod)#1 (6) {
["start"]=>
object(DateTime)#2 (3) {
["date"]=>
string(19) "2010-01-01 00:00:00"
["timezone_type"]=>
int(3)
["timezone"]=>
string(3) "UTC"
}
["current"]=>
object(DateTime)#4 (3) {
["date"]=>
string(19) "2010-01-04 00:00:00"
["timezone_type"]=>
int(3)
["timezone"]=>
string(3) "UTC"
}
["end"]=>
NULL
["interval"]=>
object(DateInterval)#5 (15) {
["y"]=>
int(0)
["m"]=>
int(0)
["d"]=>
int(1)
["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"]=>
bool(false)
["special_type"]=>
int(0)
["special_amount"]=>
int(0)
["have_weekday_relative"]=>
int(0)
["have_special_relative"]=>
int(0)
}
["recurrences"]=>
int(3)
["include_start_date"]=>
bool(true)
}
object(DatePeriod)#5 (6) {
["start"]=>
object(DateTime)#10 (3) {
["date"]=>
string(19) "2010-01-01 00:00:00"
["timezone_type"]=>
int(3)
["timezone"]=>
string(3) "UTC"
}
["current"]=>
object(DateTime)#7 (3) {
["date"]=>
string(19) "2010-01-04 00:00:00"
["timezone_type"]=>
int(3)
["timezone"]=>
string(3) "UTC"
}
["end"]=>
NULL
["interval"]=>
object(DateInterval)#8 (15) {
["y"]=>
int(0)
["m"]=>
int(0)
["d"]=>
int(1)
["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)
}
["recurrences"]=>
int(3)
["include_start_date"]=>
bool(true)
}
Unserialized:
2010-01-01 00:00:00
2010-01-02 00:00:00
2010-01-03 00:00:00
==DONE==

View File

@ -0,0 +1,13 @@
--TEST--
Bug #53437 (Crash when using unserialized DatePeriod instance), variation 2
--FILE--
<?php
$s = 'O:10:"DatePeriod":0:{}';
$dp = unserialize($s);
var_dump($dp);
?>
==DONE==
--EXPECTF--
Fatal error: Invalid serialization data for DatePeriod object in %sbug53437_var1.php on line %d

View File

@ -0,0 +1,80 @@
--TEST--
Bug #53437 DateInterval basic serialization
--FILE--
<?php
$di0 = new DateInterval('P2Y4DT6H8M');
$s = serialize($di0);
$di1 = unserialize($s);
var_dump($di0, $di1);
?>
==DONE==
--EXPECT--
object(DateInterval)#1 (15) {
["y"]=>
int(2)
["m"]=>
int(0)
["d"]=>
int(4)
["h"]=>
int(6)
["i"]=>
int(8)
["s"]=>
int(0)
["weekday"]=>
int(0)
["weekday_behavior"]=>
int(0)
["first_last_day_of"]=>
int(0)
["invert"]=>
int(0)
["days"]=>
bool(false)
["special_type"]=>
int(0)
["special_amount"]=>
int(0)
["have_weekday_relative"]=>
int(0)
["have_special_relative"]=>
int(0)
}
object(DateInterval)#2 (15) {
["y"]=>
int(2)
["m"]=>
int(0)
["d"]=>
int(4)
["h"]=>
int(6)
["i"]=>
int(8)
["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)
}
==DONE==

View File

@ -0,0 +1,47 @@
--TEST--
Bug #53437 DateInterval unserialize bad data, 32 bit
--SKIPIF--
<?php if (PHP_INT_SIZE != 4) { die('skip 32 bit only'); } ?>
--FILE--
<?php
$s = 'O:12:"DateInterval":15:{s:1:"y";s:1:"2";s:1:"m";s:1:"0";s:1:"d";s:3:"bla";s:1:"h";s:1:"6";s:1:"i";s:1:"8";s:1:"s";s:1:"0";s:7:"weekday";i:10;s:16:"weekday_behavior";i:10;s:17:"first_last_day_of";i:0;s:6:"invert";i:0;s:4:"days";s:4:"aoeu";s:12:"special_type";i:0;s:14:"special_amount";s:21:"234523452345234532455";s:21:"have_weekday_relative";i:21474836489;s:21:"have_special_relative";s:3:"bla";}';
$di = unserialize($s);
var_dump($di);
?>
==DONE==
--EXPECTF--
object(DateInterval)#%d (15) {
["y"]=>
int(2)
["m"]=>
int(0)
["d"]=>
int(0)
["h"]=>
int(6)
["i"]=>
int(8)
["s"]=>
int(0)
["weekday"]=>
int(10)
["weekday_behavior"]=>
int(10)
["first_last_day_of"]=>
int(0)
["invert"]=>
int(0)
["days"]=>
int(0)
["special_type"]=>
int(0)
["special_amount"]=>
int(-1)
["have_weekday_relative"]=>
int(9)
["have_special_relative"]=>
int(0)
}
==DONE==

View File

@ -0,0 +1,64 @@
--TEST--
Bug #53437 (Check that var_dump out is the same using the whole object or it's single properties), variation 4
--INI--
date.timezone = Europe/Berlin
--FILE--
<?php
$dt = new DateTime('2009-10-11');
$df = $dt->diff(new DateTime('2009-10-13'));
var_dump($df,
$df->y,
$df->m,
$df->d,
$df->h,
$df->i,
$df->s,
$df->invert,
$df->days);
?>
==DONE==
--EXPECTF--
object(DateInterval)#%d (15) {
["y"]=>
int(0)
["m"]=>
int(0)
["d"]=>
int(2)
["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(2)
["special_type"]=>
int(0)
["special_amount"]=>
int(0)
["have_weekday_relative"]=>
int(0)
["have_special_relative"]=>
int(0)
}
int(0)
int(0)
int(2)
int(0)
int(0)
int(0)
int(0)
int(2)
==DONE==

View File

@ -0,0 +1,47 @@
--TEST--
Bug #53437 DateInterval unserialize bad data, 64 bit
--SKIPIF--
<?php if (PHP_INT_SIZE != 8) { die('skip true 64 bit only'); } ?>
--FILE--
<?php
$s = 'O:12:"DateInterval":15:{s:1:"y";s:1:"2";s:1:"m";s:1:"0";s:1:"d";s:3:"bla";s:1:"h";s:1:"6";s:1:"i";s:1:"8";s:1:"s";s:1:"0";s:7:"weekday";i:10;s:16:"weekday_behavior";i:10;s:17:"first_last_day_of";i:0;s:6:"invert";i:0;s:4:"days";s:4:"aoeu";s:12:"special_type";i:0;s:14:"special_amount";s:21:"234523452345234532455";s:21:"have_weekday_relative";i:21474836489;s:21:"have_special_relative";s:3:"bla";}';
$di = unserialize($s);
var_dump($di);
?>
==DONE==
--EXPECTF--
object(DateInterval)#%d (15) {
["y"]=>
int(2)
["m"]=>
int(0)
["d"]=>
int(0)
["h"]=>
int(6)
["i"]=>
int(8)
["s"]=>
int(0)
["weekday"]=>
int(10)
["weekday_behavior"]=>
int(10)
["first_last_day_of"]=>
int(0)
["invert"]=>
int(0)
["days"]=>
int(0)
["special_type"]=>
int(0)
["special_amount"]=>
int(9223372036854775807)
["have_weekday_relative"]=>
int(9)
["have_special_relative"]=>
int(0)
}
==DONE==

View File

@ -28,7 +28,7 @@ object(DateTime)#2 (3) {
["timezone"]=>
string(3) "EDT"
}
object(DateInterval)#3 (8) {
object(DateInterval)#3 (15) {
["y"]=>
int(0)
["m"]=>
@ -41,8 +41,22 @@ object(DateInterval)#3 (8) {
int(19)
["s"]=>
int(40)
["weekday"]=>
int(0)
["weekday_behavior"]=>
int(0)
["first_last_day_of"]=>
int(0)
["invert"]=>
int(0)
["days"]=>
int(33)
["special_type"]=>
int(0)
["special_amount"]=>
int(0)
["have_weekday_relative"]=>
int(0)
["have_special_relative"]=>
int(0)
}

View File

@ -14,7 +14,7 @@ offset: +1 GMT
echo "Basic test for date_sunrise() and date_sunset()\n";
// supress date() function strict msgs
// suppress date() function strict msgs
error_reporting(E_ALL & ~E_STRICT);
echo date("D M d Y") . ', sunrise time : ' . date_sunrise(time(), SUNFUNCS_RET_STRING, 38.4, -9, 90, 1) . "\n";

View File

@ -20,7 +20,7 @@ DBA CDB handler test (read only)
$keys .= $a;
$count++;
}
// display number of entries and key existance
// display number of entries and key existence
echo $count;
for ($i=1; $i<8; $i++) {
echo dba_exists($i, $db_file) ? "Y" : "N";

View File

@ -177,7 +177,7 @@ PHP_METHOD(domelement, __construct)
RETURN_FALSE;
}
/* Namespace logic is seperate and only when uri passed in to insure no BC breakage */
/* Namespace logic is separate and only when uri passed in to insure no BC breakage */
if (uri_len > 0) {
errorcode = dom_check_qname(name, &localname, &prefix, uri_len, name_len);
if (errorcode == 0) {

View File

@ -0,0 +1,17 @@
--TEST--
Test DOMDocument::loadHTMLFile
--DESCRIPTION--
Verifies the basic behaviour of the method
--CREDITS--
Antonio Diaz Ruiz <dejalatele@gmail.com>
--INI--
assert.bail=true
--SKIPIF--
<?php include('skipif.inc'); ?>
--FILE--
<?php
$doc = new DOMDocument();
$result = $doc->loadHTMLFile(dirname(__FILE__) . "/test.html");
assert('$result === true');
?>
--EXPECT--

View File

@ -0,0 +1,18 @@
--TEST--
Test DOMDocument::loadHTMLFile when the file doesn't exist
--DESCRIPTION--
Verifies that an error message is showed if the file doesn't exist
--CREDITS--
Antonio Diaz Ruiz <dejalatele@gmail.com>
--INI--
assert.bail=true
--SKIPIF--
<?php include('skipif.inc'); ?>
--FILE--
<?php
$doc = new DOMDocument();
$result = $doc->loadHTMLFile(dirname(__FILE__) . "/ffff/test.html");
assert('$result === false');
?>
--EXPECTF--
%r(PHP ){0,1}%rWarning: DOMDocument::loadHTMLFile(): I/O warning : failed to load external entity %s

View File

@ -0,0 +1,18 @@
--TEST--
Test DOMDocument::loadHTMLFile when an empty string is passed
--DESCRIPTION--
Verifies that an error message is showed if an empty string is passed as argument
--CREDITS--
Antonio Diaz Ruiz <dejalatele@gmail.com>
--INI--
assert.bail=true
--SKIPIF--
<?php include('skipif.inc'); ?>
--FILE--
<?php
$doc = new DOMDocument();
$result = $doc->loadHTMLFile("");
assert('$result === false');
?>
--EXPECTF--
%r(PHP ){0,1}%rWarning: DOMDocument::loadHTMLFile(): Empty string supplied as input %s

View File

@ -0,0 +1,18 @@
--TEST--
Test DOMDocument::loadHTMLFile when an empty document is loaded
--DESCRIPTION--
Verifies that an warning message is showed if an empty document is loaded
--CREDITS--
Antonio Diaz Ruiz <dejalatele@gmail.com>
--INI--
assert.bail=true
--SKIPIF--
<?php include('skipif.inc'); ?>
--FILE--
<?php
$doc = new DOMDocument();
$result = $doc->loadHTMLFile(dirname(__FILE__) . "/empty.html");
assert('$result === true');
?>
--EXPECTF--
%r(PHP ){0,1}%rWarning: DOMDocument::loadHTMLFile(): Document is empty %s

View File

@ -0,0 +1,17 @@
--TEST--
Test DOMDocument::loadHTMLFile when a not-well formed document is loaded
--DESCRIPTION--
Verifies the behavior if a not-well formed document is loaded
--CREDITS--
Antonio Diaz Ruiz <dejalatele@gmail.com>
--INI--
assert.bail=true
--SKIPIF--
<?php include('skipif.inc'); ?>
--FILE--
<?php
$doc = new DOMDocument();
$result = $doc->loadHTMLFile(dirname(__FILE__) . "/not_well.html");
assert('$result === true');
?>
--EXPECT--

View File

@ -39,7 +39,7 @@ $root = $dom->documentElement;
$children = $root->childNodes;
$len = $children->length;
echo "orignal has $len nodes\n";
echo "original has $len nodes\n";
for ($index = $children->length - 1; $index >=0; $index--) {
echo "node $index\n";
$current = $children->item($index);
@ -58,7 +58,7 @@ for ($index = 0; $index < $children->length; $index++) {
}
--EXPECTF--
orignal has 5 nodes
original has 5 nodes
node 4
Course: no title:DOMText
~string(1) "

0
ext/dom/tests/empty.html Normal file
View File

View File

@ -0,0 +1,8 @@
<head>
<title>Hello world</title>
</head>
<body>
This is a not well-formed<br>
html files with undeclared entities&nbsp;
</body>
</html>

View File

@ -651,7 +651,7 @@ PHP_FUNCTION(enchant_broker_free_dict)
/* }}} */
/* {{{ proto bool enchant_broker_dict_exists(resource broker, string tag)
Wether a dictionary exists or not. Using non-empty tag */
Whether a dictionary exists or not. Using non-empty tag */
PHP_FUNCTION(enchant_broker_dict_exists)
{
zval *broker;

View File

@ -78,7 +78,7 @@ $values = array (
// loop through each element of the array and check the working of exif_tagname()
// when $index arugment is supplied with different values
// when $index argument is supplied with different values
echo "\n--- Testing exif_tagname() by supplying different values for 'index' argument ---\n";
$counter = 1;

View File

@ -2978,7 +2978,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 2013-03-21 18:45:14.000000000 +0100
+++ libmagic/softmagic.c 2013-04-08 15:42:57.328298809 +0200
+++ libmagic/softmagic.c 2013-05-14 11:00:07.044745939 +0200
@@ -41,6 +41,11 @@
#include <stdlib.h>
#include <time.h>
@ -3123,7 +3123,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
}
}
@@ -1717,9 +1694,9 @@
@@ -1717,12 +1694,12 @@
ms->o.buf = sbuf;
ms->offset = soffset;
if (rv == 1) {
@ -3134,7 +3134,11 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
+ return -1;
if (file_printf(ms, "%s", rbuf) == -1)
return -1;
free(rbuf);
- free(rbuf);
+ efree(rbuf);
}
return rv;
@@ -1837,6 +1814,42 @@
return file_strncmp(a, b, len, flags);
}

View File

@ -1699,7 +1699,7 @@ mget(struct magic_set *ms, const unsigned char *s, struct magic *m,
return -1;
if (file_printf(ms, "%s", rbuf) == -1)
return -1;
free(rbuf);
efree(rbuf);
}
return rv;

View File

@ -18,7 +18,7 @@ ksort($results);
var_dump($results);
?>
--EXPECTF--
array(7) {
array(8) {
["%s/resources/dir.zip"]=>
string(15) "application/zip"
["%s/resources/test.awk"]=>
@ -29,6 +29,8 @@ array(7) {
string(9) "image/gif"
["%s/resources/test.jpg"]=>
string(10) "image/jpeg"
["%s/resources/test.mp3"]=>
string(10) "audio/mpeg"
["%s/resources/test.pdf"]=>
string(15) "application/pdf"
["%s/resources/test.png"]=>

View File

@ -1,5 +1,5 @@
--TEST--
Test finfo extention : loading into phpinfo()
Test finfo extension : loading into phpinfo()
--SKIPIF--
<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
--FILE--

View File

@ -4957,7 +4957,7 @@
>>>>0 ubelong =0 \b, next free block index %lu
>>>>0 ubelong !0 \b, next free block index %lu
>>>512 default x dBase IV DBT
# DBF file name without extention
# DBF file name without extension
>>>>8 string >\0 \b of %-.8s.DBF
# size of blocks ; not reliable 0x2020204C
#>>>>4 ulelong =0 \b, blocks size %lu
@ -13205,7 +13205,7 @@
# they have their real name at offset 22
>>>>>22 string >\0 \b%-.5s
>4 uleshort&0x8000 0x0000
# 32 bit sector adressing ( > 32 MB) for block devices
# 32 bit sector addressing ( > 32 MB) for block devices
>>4 uleshort&0x0002 0x0002 \b,32-bit sector-
# support by driver functions 13h, 17h, 18h
>4 uleshort&0x0040 0x0040 \b,IOCTL-
@ -17951,7 +17951,7 @@
# 00030 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 ................
# 00040 00 00 00 00 ff ff ff ff ff ff ff ff 02 00 00 00 ................
#
# GRR this test is still too general as it catches example adressen.dbt
# GRR this test is still too general as it catches example addressen.dbt
0 belong 0x03000000
>8 ubelong 0xec020000 VMS Alpha executable
>>75264 string PK\003\004 \b, Info-ZIP SFX archive v5.12 w/decryption

Binary file not shown.

View File

@ -1,5 +1,7 @@
--TEST--
#49510 boolean validation fails with FILTER_NULL_ON_FAILURE
Bug #49510 boolean validation fails with FILTER_NULL_ON_FAILURE
--SKIPIF--
<?php if (!extension_loaded("filter")) die("skip"); ?>
--FILE--
<?php
var_dump(filter_var(false, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE));

View File

@ -35,9 +35,9 @@ imagefilledellipse($image_lge, 200, 150, 300, 200, $col_ellipse);
imagepng($image_lge, $dest_lge);
// Get new dimensions
$percent = 0.5; // new image 50% of orginal
$percent = 0.5; // new image 50% of original
list($width, $height) = getimagesize($dest_lge);
echo "Size of orginal: width=". $width . " height=" . $height . "\n";
echo "Size of original: width=". $width . " height=" . $height . "\n";
$new_width = $width * $percent;
$new_height = $height * $percent;
@ -66,6 +66,6 @@ echo "Done\n";
?>
--EXPECT--
Simple test of imagecopyresampled() function
Size of orginal: width=400 height=300
Size of original: width=400 height=300
Size of copy: width=200 height=150
Done

View File

@ -24,7 +24,7 @@ $supported_hash_al = array(
"CRC32" => 4,
"CRC32B" => 4,
"ADLER32" => 4,
"NA_XYZ" => 0 /* verify that the algorythm works */
"NA_XYZ" => 0 /* verify that the algorithm works */
);
$hc = mhash_count() + 1;

View File

@ -61,7 +61,7 @@ function displayOverviewFields($resp, $fields=null) {
* @param string mailbox_suffix Suffix used to uniquely identify mailboxes
* @param int message_count number of test msgs to be written to new mailbox
*
* @return IMAP stream to new mailbox on sucesss; FALSE on failure
* @return IMAP stream to new mailbox on success; FALSE on failure
*/
function setup_test_mailbox($mailbox_suffix, $message_count, &$new_mailbox = null, $msg_type = "simple"){
global $server, $default_mailbox, $username, $password;

View File

@ -18,7 +18,7 @@ InterBase: transactions
/*
Difference between default and other transactions:
default commited when you call ibase_close().
default committed when you call ibase_close().
Other transaction doing rollback.
If you not open default transaction with
@ -158,7 +158,7 @@ three transaction on default link
ibase_free_result($res);
/* tr_4 IBASE_COMMITED + IBASE_REC_NO_VERSION + IBASE_NOWAIT */
/* tr_4 IBASE_COMMITTED + IBASE_REC_NO_VERSION + IBASE_NOWAIT */
$res = ibase_query($tr_4, "select * from test5");
echo "three rows in fourth transaction with deadlock\n";

View File

@ -7,7 +7,7 @@ Examle of locales format: 'en_US', 'ru_UA', 'ua_UA' (see http://demo.icu-project
2. Collator::getDisplayName( $obj_locale, $disp_locale ).
Get name of the object for the desired Locale, in the desired langauge. Both arguments
Get name of the object for the desired Locale, in the desired language. Both arguments
must be from getAvailableLocales method.
@param string $obj_locale Locale to get display name for.

View File

@ -98,7 +98,7 @@
* @param string $haystack The input string.
* @param string $needle The string to look for.
* @param [boolean] $before_needle If TRUE (the default is FALSE), grapheme_strstr() returns the part of the
haystack before the first occurence of the needle.
haystack before the first occurrence of the needle.
* @return string Returns the portion of string, or FALSE if needle is not found.
*/
function grapheme_strstr($haystack, $needle, $before_needle = FALSE) {}
@ -109,7 +109,7 @@
* @param string $haystack The input string.
* @param string $needle The string to look for.
* @param [boolean] $before_needle If TRUE (the default is FALSE), grapheme_strstr() returns the part of the
haystack before the first occurence of the needle.
haystack before the first occurrence of the needle.
* @return string Returns the portion of string, or FALSE if needle is not found.
*/
function grapheme_stristr($haystack, $needle, $before_needle = FALSE) {}

View File

@ -31,7 +31,7 @@ class MessageFormatter {
/**
* Format the message
* @param array $args arguments to insert into the pattern string
* @return string the formatted string, or false if an error ocurred
* @return string the formatted string, or false if an error occurred
*/
public function format($args) {}
@ -124,7 +124,7 @@ class MessageFormatter {
* Format the message
* @param MessageFormatter $fmt The message formatter
* @param array $args arguments to insert into the pattern string
* @return string the formatted string, or false if an error ocurred
* @return string the formatted string, or false if an error occurred
*/
function msgfmt_format($fmt, $args) {}

View File

@ -1,5 +1,5 @@
--TEST--
Check that bad argumens return the same
Check that bad arguments return the same
--SKIPIF--
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
--FILE--

View File

@ -8,7 +8,7 @@ error_reporting=E_ALL & ~E_NOTICE
--FILE--
<?php
/*
* Note: Using error_reporting=E_ALL & ~E_NOTICE to supress "Trying to get property of non-object" notices.
* Note: Using error_reporting=E_ALL & ~E_NOTICE to suppress "Trying to get property of non-object" notices.
*/
class StreamExploiter {
public function stream_close ( ) {

View File

@ -408,7 +408,7 @@ o i18n.script_encoding - script encoding
entering the script parser.
Be aware that auto detection may fail under some conditions.
For best auto detection, add multibyte charactor at begining of
For best auto detection, add multibyte charactor at beginning of
script.

View File

@ -4643,7 +4643,7 @@ static const int ucs_r2_jisx0213_min = 0xFA0F;
static const int ucs_r2_jisx0213_max = 0xFA6A;
/*
CJK Compatibility Ideographs: U+F900 - U+FAFF (seperate mapping for U+F9XX)
CJK Compatibility Ideographs: U+F900 - U+FAFF (separate mapping for U+F9XX)
*/
static const unsigned short ucs_r2b_jisx0213_cmap_key[] = {
0xf91d,0xf928,0xf929,0xf936,0xf970,0xf9d0,0xf9dc};

View File

@ -1607,7 +1607,7 @@ History
2003/01/31: [impl] rename TTRANS() to TOLOWER().
2003/01/30: [bug] .c.o --> .c.obj in win32\Makefile.
2003/01/30: [impl] add -DNOT_RUBY to Makefile.in.
NOT_RUBY is refered in regint.h for escape double
NOT_RUBY is referred in regint.h for escape double
including config.h.
2003/01/30: [impl] when string hasn't case ambiguity, don't compile
to ignore case opcode.

View File

@ -648,7 +648,7 @@ _php_mb_regex_init_options(const char *parg, int narg, OnigOptionType *option, O
/* }}} */
/*
* php funcions
* php functions
*/
/* {{{ proto string mb_regex_encoding([string encoding])

View File

@ -1,5 +1,7 @@
--TEST--
Optional long parameter might be null
--SKIPIF--
<?php extension_loaded('mbstring') or die('skip mbstring not available'); ?>
--FILE--
<?php
echo mb_strpos('abb', 'b', null, 'UTF-8') . "\n";

View File

@ -720,7 +720,7 @@ PHP_MINFO_FUNCTION(mysql)
static void php_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
{
char *user=NULL, *passwd=NULL, *host_and_port=NULL, *socket=NULL, *tmp=NULL, *host=NULL;
int user_len, passwd_len, host_len;
int user_len = 0, passwd_len = 0, host_len = 0;
char *hashed_details=NULL;
int hashed_details_length, port = MYSQL_PORT;
long client_flags = 0;

View File

@ -16,7 +16,7 @@ class DbConnection {
var_dump($link);
$link = mysqli_init();
/* @ is to supress 'Property access is not allowed yet' */
/* @ is to suppress 'Property access is not allowed yet' */
@var_dump($link);
$mysql = new my_mysqli($host, $user, $passwd, $db, $port, $socket);

View File

@ -1337,7 +1337,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, list_fields)(MYSQLND_CONN_DATA * conn, const c
}
if (FAIL == result->m.read_result_metadata(result, conn TSRMLS_CC)) {
DBG_ERR("Error ocurred while reading metadata");
DBG_ERR("Error occurred while reading metadata");
result->m.free_result(result, TRUE TSRMLS_CC);
result = NULL;
break;

View File

@ -497,7 +497,7 @@ mysqlnd_query_read_result_set_header(MYSQLND_CONN_DATA * conn, MYSQLND_STMT * s
mnd_efree(conn->current_result);
conn->current_result = NULL;
}
DBG_ERR("Error ocurred while reading metadata");
DBG_ERR("Error occurred while reading metadata");
break;
}
@ -509,7 +509,7 @@ mysqlnd_query_read_result_set_header(MYSQLND_CONN_DATA * conn, MYSQLND_STMT * s
break;
}
if (FAIL == (ret = PACKET_READ(fields_eof, conn))) {
DBG_ERR("Error ocurred while reading the EOF packet");
DBG_ERR("Error occurred while reading the EOF packet");
result->m.free_result_contents(result TSRMLS_CC);
mnd_efree(result);
if (!stmt) {

View File

@ -831,7 +831,7 @@ Fixed bug #36820 (Privileged connection with an Oracle password file fails)
<date>2006-03-16</date>
<license uri="http://www.php.net/license">PHP</license>
<notes>Changed OCI8 code to use OCIServerVersion() instead of OCIPing(), which may crash Oracle server of version &lt; 10.2
Fixed bug #36235 (ocicolumnname returns false before a succesfull fetch)
Fixed bug #36235 (ocicolumnname returns false before a successfull fetch)
Fixed bug #36096 (oci_result() returns garbage after oci_fetch() failed)
Fixed bug #36055 (possible OCI8 crash in multithreaded environment)
Fixed bug #36010 (Segfault when re-creating and re-executing statements with bound parameters)

View File

@ -98,7 +98,7 @@ function set_attr($conn,$attr,$sufix)
else if (!strcmp($attr,'CLIENT_IDENTIFIER'))
$r = oci_set_client_identifier($conn,'ID00'.$sufix);
else
echo "Pass one of the above four attibutes!!!\n";
echo "Pass one of the above four attributes!!!\n";
if ($r) {
echo "Value of $attr has been set successfully\n";
}

View File

@ -62,7 +62,7 @@ foreach($values_array as $val ) {
oci_set_client_info($c1,$val);
$r = oci_set_action($c1,$val);
if ($r) {
echo "Values set succesfully to $val\n";
echo "Values set successfully to $val\n";
foreach($attr_array as $attr) {
get_attr($c1,$attr);
}
@ -98,12 +98,12 @@ bool(true)
The value of ACTION is ACTION1
Setting to different values
Values set succesfully to 1000
Values set successfully to 1000
The value of MODULE is 1000
The value of ACTION is 1000
The value of CLIENT_INFO is 1000
The value of CLIENT_IDENTIFIER is 1000
Values set succesfully to
Values set successfully to
The value of MODULE is
The value of ACTION is
The value of CLIENT_INFO is

View File

@ -161,7 +161,7 @@ PHP_FUNCTION(solid_fetch_prev);
#define UNIX
/*
* Extended Fetch in the Birdstep ODBC API is incapable of returning long varchar (memo) fields.
* So the following line has been commented-out to accomadate. - KNS
* So the following line has been commented-out to accommodate. - KNS
*
* #define HAVE_SQL_EXTENDED_FETCH 1
*/

View File

@ -3,7 +3,7 @@ default_bits = 1024
default_keyfile = privkey.pem
distinguished_name = req_distinguished_name
attributes = req_attributes
x509_extensions = v3_ca # The extentions to add to the self signed cert
x509_extensions = v3_ca # The extensions to add to the self signed cert
string_mask = MASK:4294967295

View File

@ -274,7 +274,7 @@ static int php_openssl_sockop_close(php_stream *stream, int close_handle TSRMLS_
* Essentially, we are waiting for the socket to become writeable, which means
* that all pending data has been sent.
* We use a small timeout which should encourage the OS to send the data,
* but at the same time avoid hanging indefintely.
* but at the same time avoid hanging indefinitely.
* */
do {
n = php_pollfd_for_ms(sslsock->s.socket, POLLOUT, 500);

View File

@ -1751,7 +1751,7 @@ Version 7.7 07-May-08
containing () gave an internal compiling error instead of "reference to
non-existent subpattern". Fortunately, when the pattern did exist, the
compiled code was correct. (When scanning forwards to check for the
existencd of the subpattern, it was treating the data ']' as terminating
existence of the subpattern, it was treating the data ']' as terminating
the class, so got the count wrong. When actually compiling, the reference
was subsequently set up correctly.)

View File

@ -591,7 +591,7 @@ some of the new functionality in Perl 5.005.
Another (I hope this is the last!) change has been made to the API for the
pcre_compile() function. An additional argument has been added to make it
possible to pass over a pointer to character tables built in the current
locale by pcre_maketables(). To use the default tables, this new arguement
locale by pcre_maketables(). To use the default tables, this new argument
should be passed as NULL.
IMPORTANT FOR THOSE UPGRADING FROM VERSION 2.05

View File

@ -8139,7 +8139,7 @@ if (code - codestart > length) errorcode = ERR23;
#ifdef SUPPORT_VALGRIND
/* If the estimated length exceeds the really used length, mark the extra
allocated memory as unadressable, so that any out-of-bound reads can be
allocated memory as unaddressable, so that any out-of-bound reads can be
detected. */
VALGRIND_MAKE_MEM_NOACCESS(code, (length - (code - codestart)) * sizeof(pcre_uchar));
#endif

Some files were not shown because too many files have changed in this diff Show More