summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRemi Collet <remi@php.net>2012-11-28 10:24:32 +0100
committerRemi Collet <remi@php.net>2012-11-28 10:24:32 +0100
commit1e6baa26734d827be6d279b111dcce6d2f39b6df (patch)
tree3b181a41d663f18bb03e87e629806ae670fb5d0b
parent92147243bf082b9d05c1b2949c35637c8fbd0dd9 (diff)
parente6b727d3b7eef06d8b7b6a4638a95e7a571d97b5 (diff)
downloadphp-git-1e6baa26734d827be6d279b111dcce6d2f39b6df.tar.gz
Merge branch 'PHP-5.3' of git.php.net:php-src into PHP-5.3
* 'PHP-5.3' of git.php.net:php-src: Fixed bug #63590 Fileinfo delivers ifferent results in TS and NTS under Windows This test isn't supposed to pass on windows Fixed Bug #63614 (Fatal error on Reflection)
-rw-r--r--NEWS9
-rw-r--r--ext/fileinfo/libmagic.patch42
-rw-r--r--ext/fileinfo/libmagic/apprentice.c4
-rw-r--r--ext/fileinfo/tests/finfo_file_regex-win32.phpt36
-rw-r--r--ext/fileinfo/tests/finfo_file_regex.phpt3
-rw-r--r--ext/fileinfo/tests/finfo_open_error-win32.phpt46
-rw-r--r--ext/fileinfo/tests/finfo_open_error.phpt3
-rw-r--r--ext/reflection/php_reflection.c2
-rw-r--r--ext/reflection/tests/bug63614.phpt41
-rw-r--r--ext/standard/tests/file/lstat_stat_variation22.phpt7
10 files changed, 84 insertions, 109 deletions
diff --git a/NEWS b/NEWS
index 06f5a25006..eb4238ab78 100644
--- a/NEWS
+++ b/NEWS
@@ -7,17 +7,26 @@ PHP NEWS
from value). (Pierrick)
. Fixed bug #63468 (wrong called method as callback with inheritance).
(Laruence)
+
- Core:
. Fixed bug #63451 (config.guess file does not have AIX 7 defined,
shared objects are not created). (kemcline at au1 dot ibm dot com)
+
- Apache2 Handler SAPI:
. Enabled Apache 2.4 configure option for Windows (Pierre, Anatoliy)
+
- Fileinfo:
. Fixed bug #63248 (Load multiple magic files from a directory under Windows).
(Anatoliy)
+ . Fixed bug #63590 (Different results in TS and NTS under Windows).
+ (Anatoliy)
+
- Imap:
. Fixed Bug #63126 DISABLE_AUTHENTICATOR ignores array (Remi)
+- Reflection:
+ . Fixed Bug #63614 (Fatal error on Reflection). (Laruence)
+
22 Nov 2012, PHP 5.3.19
diff --git a/ext/fileinfo/libmagic.patch b/ext/fileinfo/libmagic.patch
index 9647620f1e..9be317b008 100644
--- a/ext/fileinfo/libmagic.patch
+++ b/ext/fileinfo/libmagic.patch
@@ -1,6 +1,6 @@
diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
--- libmagic.orig/apprentice.c Sat Dec 17 18:17:18 2011
-+++ libmagic/apprentice.c Fri Nov 23 13:04:15 2012
++++ libmagic/apprentice.c Tue Nov 27 16:25:57 2012
@@ -29,6 +29,8 @@
* apprentice - make one pass through /etc/magic, learning its secrets.
*/
@@ -267,11 +267,11 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
- ssize_t len;
+ size_t len;
+ size_t lineno = 0;
++
++ php_stream *stream;
- FILE *f = fopen(ms->file = fn, "r");
- if (f == NULL) {
-+ php_stream *stream;
-+
+ TSRMLS_FETCH();
+
+#if PHP_API_VERSION < 20100412
@@ -765,14 +765,18 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
if (strip) {
if ((p = strrchr(fn, '/')) != NULL)
-@@ -2370,14 +2405,14 @@
+@@ -2370,14 +2405,18 @@
q++;
/* Compatibility with old code that looked in .mime */
if (ms->flags & MAGIC_MIME) {
- asprintf(&buf, "%.*s.mime%s", (int)(q - fn), fn, ext);
- if (access(buf, R_OK) != -1) {
+ spprintf(&buf, MAXPATHLEN, "%.*s.mime%s", (int)(q - fn), fn, ext);
++#ifdef PHP_WIN32
++ if (VCWD_ACCESS(buf, R_OK) == 0) {
++#else
+ if (VCWD_ACCESS(buf, R_OK) != -1) {
++#endif
ms->flags &= MAGIC_MIME_TYPE;
return buf;
}
@@ -784,7 +788,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
/* Compatibility with old code that looked in .mime */
if (strstr(p, ".mime") != NULL)
-@@ -2467,7 +2502,7 @@
+@@ -2467,7 +2506,7 @@
m->offset = swap4((uint32_t)m->offset);
m->in_offset = swap4((uint32_t)m->in_offset);
m->lineno = swap4((uint32_t)m->lineno);
@@ -795,7 +799,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
}
diff -u libmagic.orig/ascmagic.c libmagic/ascmagic.c
--- libmagic.orig/ascmagic.c Sat Dec 17 18:17:18 2011
-+++ libmagic/ascmagic.c Wed Mar 28 15:35:25 2012
++++ libmagic/ascmagic.c Tue Apr 10 09:46:33 2012
@@ -139,10 +139,8 @@
/* malloc size is a conservative overestimate; could be
improved, or at least realloced after conversion. */
@@ -821,7 +825,7 @@ diff -u libmagic.orig/ascmagic.c libmagic/ascmagic.c
}
diff -u libmagic.orig/cdf.c libmagic/cdf.c
--- libmagic.orig/cdf.c Mon Feb 20 23:35:29 2012
-+++ libmagic/cdf.c Mon Apr 2 17:43:23 2012
++++ libmagic/cdf.c Tue Apr 10 09:46:33 2012
@@ -43,7 +43,17 @@
#include <err.h>
#endif
@@ -885,7 +889,7 @@ diff -u libmagic.orig/cdf.c libmagic/cdf.c
} else {
diff -u libmagic.orig/cdf.h libmagic/cdf.h
--- libmagic.orig/cdf.h Fri Feb 17 06:28:31 2012
-+++ libmagic/cdf.h Wed Mar 28 15:35:25 2012
++++ libmagic/cdf.h Tue Apr 10 09:46:34 2012
@@ -35,7 +35,7 @@
#ifndef _H_CDF_
#define _H_CDF_
@@ -923,7 +927,7 @@ diff -u libmagic.orig/cdf.h libmagic/cdf.h
void cdf_unpack_header(cdf_header_t *, char *);
diff -u libmagic.orig/cdf_time.c libmagic/cdf_time.c
--- libmagic.orig/cdf_time.c Tue Dec 13 14:48:41 2011
-+++ libmagic/cdf_time.c Wed Mar 28 15:35:25 2012
++++ libmagic/cdf_time.c Tue Apr 10 09:46:34 2012
@@ -96,7 +96,7 @@
}
@@ -982,7 +986,7 @@ diff -u libmagic.orig/cdf_time.c libmagic/cdf_time.c
char *p, *q;
diff -u libmagic.orig/compress.c libmagic/compress.c
--- libmagic.orig/compress.c Sat Dec 17 18:17:18 2011
-+++ libmagic/compress.c Mon Apr 2 17:43:23 2012
++++ libmagic/compress.c Tue Apr 10 09:46:34 2012
@@ -32,6 +32,7 @@
* uncompress(method, old, n, newch) - uncompress old into new,
* using method, return sizeof new
@@ -1145,7 +1149,7 @@ diff -u libmagic.orig/compress.c libmagic/compress.c
+#endif /* if PHP_FILEINFO_UNCOMPRESS */
diff -u libmagic.orig/file.h libmagic/file.h
--- libmagic.orig/file.h Tue Sep 20 17:30:14 2011
-+++ libmagic/file.h Sun Apr 22 20:06:21 2012
++++ libmagic/file.h Mon Apr 23 17:58:54 2012
@@ -33,11 +33,9 @@
#ifndef __file_h__
#define __file_h__
@@ -1320,7 +1324,7 @@ diff -u libmagic.orig/file.h libmagic/file.h
#endif /* __file_h__ */
diff -u libmagic.orig/fsmagic.c libmagic/fsmagic.c
--- libmagic.orig/fsmagic.c Tue Aug 23 10:57:10 2011
-+++ libmagic/fsmagic.c Wed Mar 28 15:35:26 2012
++++ libmagic/fsmagic.c Tue Apr 10 09:46:34 2012
@@ -59,27 +59,21 @@
# define minor(dev) ((dev) & 0xff)
#endif
@@ -1645,7 +1649,7 @@ diff -u libmagic.orig/fsmagic.c libmagic/fsmagic.c
/*
diff -u libmagic.orig/funcs.c libmagic/funcs.c
--- libmagic.orig/funcs.c Sat Dec 17 18:17:18 2011
-+++ libmagic/funcs.c Sun Apr 22 20:06:21 2012
++++ libmagic/funcs.c Mon Apr 23 17:58:54 2012
@@ -41,52 +41,42 @@
#if defined(HAVE_WCTYPE_H)
#include <wctype.h>
@@ -1941,7 +1945,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
+
diff -u libmagic.orig/magic.c libmagic/magic.c
--- libmagic.orig/magic.c Thu May 26 03:27:59 2011
-+++ libmagic/magic.c Mon Apr 2 12:38:04 2012
++++ libmagic/magic.c Tue Apr 10 09:46:34 2012
@@ -25,11 +25,6 @@
* SUCH DAMAGE.
*/
@@ -2319,7 +2323,7 @@ diff -u libmagic.orig/magic.c libmagic/magic.c
magic_error(struct magic_set *ms)
diff -u libmagic.orig/magic.h libmagic/magic.h
--- libmagic.orig/magic.h Sun Dec 18 15:54:43 2011
-+++ libmagic/magic.h Wed Mar 28 15:35:26 2012
++++ libmagic/magic.h Tue Apr 10 09:46:34 2012
@@ -85,6 +85,7 @@
const char *magic_getpath(const char *, int);
@@ -2338,7 +2342,7 @@ diff -u libmagic.orig/magic.h libmagic/magic.h
diff -u libmagic.orig/print.c libmagic/print.c
--- libmagic.orig/print.c Tue Sep 20 17:28:09 2011
-+++ libmagic/print.c Thu Apr 5 10:22:12 2012
++++ libmagic/print.c Tue Nov 27 16:24:35 2012
@@ -29,6 +29,9 @@
* print.c - debugging printout routines
*/
@@ -2533,7 +2537,7 @@ diff -u libmagic.orig/print.c libmagic/print.c
protected const char *
diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
--- libmagic.orig/readcdf.c Mon Feb 20 21:04:58 2012
-+++ libmagic/readcdf.c Wed Mar 28 15:35:26 2012
++++ libmagic/readcdf.c Tue Apr 10 09:46:34 2012
@@ -30,7 +30,11 @@
#endif
@@ -2581,7 +2585,7 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
*ec = '\0';
diff -u libmagic.orig/readelf.c libmagic/readelf.c
--- libmagic.orig/readelf.c Tue Aug 23 10:57:10 2011
-+++ libmagic/readelf.c Mon Apr 2 17:43:23 2012
++++ libmagic/readelf.c Tue Apr 10 09:46:34 2012
@@ -49,7 +49,7 @@
off_t, int *, int);
private int doshn(struct magic_set *, int, int, int, off_t, int, size_t,
@@ -2738,7 +2742,7 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c
if (fstat(fd, &st) == -1) {
diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
--- libmagic.orig/softmagic.c Sat Dec 17 18:17:18 2011
-+++ libmagic/softmagic.c Fri May 25 09:48:22 2012
++++ libmagic/softmagic.c Fri May 25 09:59:25 2012
@@ -41,6 +41,11 @@
#include <stdlib.h>
#include <time.h>
diff --git a/ext/fileinfo/libmagic/apprentice.c b/ext/fileinfo/libmagic/apprentice.c
index ee1ad4d6e8..e88a3e6c86 100644
--- a/ext/fileinfo/libmagic/apprentice.c
+++ b/ext/fileinfo/libmagic/apprentice.c
@@ -2406,7 +2406,11 @@ mkdbname(struct magic_set *ms, const char *fn, int strip)
/* Compatibility with old code that looked in .mime */
if (ms->flags & MAGIC_MIME) {
spprintf(&buf, MAXPATHLEN, "%.*s.mime%s", (int)(q - fn), fn, ext);
+#ifdef PHP_WIN32
+ if (VCWD_ACCESS(buf, R_OK) == 0) {
+#else
if (VCWD_ACCESS(buf, R_OK) != -1) {
+#endif
ms->flags &= MAGIC_MIME_TYPE;
return buf;
}
diff --git a/ext/fileinfo/tests/finfo_file_regex-win32.phpt b/ext/fileinfo/tests/finfo_file_regex-win32.phpt
deleted file mode 100644
index 1eda48c4d0..0000000000
--- a/ext/fileinfo/tests/finfo_file_regex-win32.phpt
+++ /dev/null
@@ -1,36 +0,0 @@
---TEST--
-Test finfo_file() function : regex rules
---SKIPIF--
-<?php require_once(dirname(__FILE__) . '/skipif.inc');
-if (substr(PHP_OS, 0, 3) != 'WIN') {
- die('skip.. only for Windows');
-}
-?>
---FILE--
-<?php
-/**
- * Works with the unix file command:
- * $ file -m magic resources/test.awk
- * resources/test.awk: awk script, ASCII text
- */
-$magicFile = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'magic';
-$finfo = finfo_open( FILEINFO_MIME, $magicFile );
-
-echo "*** Testing finfo_file() : regex rules ***\n";
-
-// Calling finfo_file() with all possible arguments
-$file = __DIR__ . '/resources/test.awk';
-var_dump( finfo_file( $finfo, $file ) );
-var_dump( finfo_file( $finfo, $file, FILEINFO_CONTINUE ) );
-
-// Windows uses libfileinfo 1.0.5-dev
-// this may be causing the slightly different output from the first
-// finfo_file() call
-
-?>
-===DONE===
---EXPECTF--
-*** Testing finfo_file() : regex rules ***
-string(10) "text/plain"
-string(22) "awk script, ASCII text"
-===DONE===
diff --git a/ext/fileinfo/tests/finfo_file_regex.phpt b/ext/fileinfo/tests/finfo_file_regex.phpt
index ee4c8b0b7a..7d9cd3adfa 100644
--- a/ext/fileinfo/tests/finfo_file_regex.phpt
+++ b/ext/fileinfo/tests/finfo_file_regex.phpt
@@ -2,9 +2,6 @@
Test finfo_file() function : regex rules
--SKIPIF--
<?php require_once(dirname(__FILE__) . '/skipif.inc');
-if (substr(PHP_OS, 0, 3) == 'WIN') {
- die('skip.. only for Non Windows Systems');
-}
?>
--FILE--
<?php
diff --git a/ext/fileinfo/tests/finfo_open_error-win32.phpt b/ext/fileinfo/tests/finfo_open_error-win32.phpt
deleted file mode 100644
index bd50327b2d..0000000000
--- a/ext/fileinfo/tests/finfo_open_error-win32.phpt
+++ /dev/null
@@ -1,46 +0,0 @@
---TEST--
-Test finfo_open() function : error functionality
---SKIPIF--
-<?php require_once(dirname(__FILE__) . '/skipif.inc');
-if(substr(PHP_OS, 0, 3) != 'WIN' )
- die("skip Not Valid for Linux");
-?>
---FILE--
-<?php
-/* Prototype : resource finfo_open([int options [, string arg]])
- * Description: Create a new fileinfo resource.
- * Source code: ext/fileinfo/fileinfo.c
- * Alias to functions:
- */
-
-$magicFile = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'magic';
-
-echo "*** Testing finfo_open() : error functionality ***\n";
-
-var_dump( finfo_open( FILEINFO_MIME, 'foobarfile' ) );
-var_dump( finfo_open( array(), $magicFile ) );
-var_dump( finfo_open( FILEINFO_MIME, $magicFile, 'extraArg' ) );
-var_dump( finfo_open( PHP_INT_MAX - 1, $magicFile ) );
-var_dump( finfo_open( 'foobar' ) );
-
-var_dump( new finfo('foobar') );
-
-?>
-===DONE===
---EXPECTF--
-*** Testing finfo_open() : error functionality ***
-bool(false)
-
-Warning: finfo_open() expects parameter 1 to be long, array given in %s on line %d
-bool(false)
-
-Warning: finfo_open() expects at most 2 parameters, 3 given in %s on line %d
-bool(false)
-resource(%d) of type (file_info)
-
-Warning: finfo_open() expects parameter 1 to be long, %unicode_string_optional% given in %s on line %d
-bool(false)
-
-Warning: finfo::finfo() expects parameter 1 to be long, %unicode_string_optional% given in %s on line %d
-NULL
-===DONE===
diff --git a/ext/fileinfo/tests/finfo_open_error.phpt b/ext/fileinfo/tests/finfo_open_error.phpt
index 7bf60bfe63..b4448a27a3 100644
--- a/ext/fileinfo/tests/finfo_open_error.phpt
+++ b/ext/fileinfo/tests/finfo_open_error.phpt
@@ -2,9 +2,6 @@
Test finfo_open() function : error functionality
--SKIPIF--
<?php require_once(dirname(__FILE__) . '/skipif.inc');
-if(substr(PHP_OS, 0, 3) == 'WIN' )
- die("skip Not Valid for Windows");
-?>
--FILE--
<?php
/* Prototype : resource finfo_open([int options [, string arg]])
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index 593a0506b0..8b8b8869e3 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -1733,7 +1733,7 @@ ZEND_METHOD(reflection_function, getStaticVariables)
/* Return an empty array in case no static variables exist */
array_init(return_value);
if (fptr->type == ZEND_USER_FUNCTION && fptr->op_array.static_variables != NULL) {
- zend_hash_apply_with_argument(fptr->op_array.static_variables, (apply_func_arg_t) zval_update_constant, (void*)1 TSRMLS_CC);
+ zend_hash_apply_with_argument(fptr->op_array.static_variables, (apply_func_arg_t) zval_update_constant_inline_change, fptr->common.scope TSRMLS_CC);
zend_hash_copy(Z_ARRVAL_P(return_value), fptr->op_array.static_variables, (copy_ctor_func_t) zval_add_ref, (void *) &tmp_copy, sizeof(zval *));
}
}
diff --git a/ext/reflection/tests/bug63614.phpt b/ext/reflection/tests/bug63614.phpt
new file mode 100644
index 0000000000..c13ff4b20e
--- /dev/null
+++ b/ext/reflection/tests/bug63614.phpt
@@ -0,0 +1,41 @@
+--TEST--
+Bug #63614 (Fatal error on Reflection)
+--FILE--
+<?php
+function dummy() {
+ static $a = array();
+}
+
+class Test
+{
+ const A = 0;
+
+ public function func()
+ {
+ static $a = array(
+ self::A => 'a'
+ );
+ }
+}
+
+$reflect = new ReflectionFunction("dummy");
+print_r($reflect->getStaticVariables());
+$reflect = new ReflectionMethod('Test', 'func');
+print_r($reflect->getStaticVariables());
+?>
+--EXPECT--
+Array
+(
+ [a] => Array
+ (
+ )
+
+)
+Array
+(
+ [a] => Array
+ (
+ [0] => a
+ )
+
+)
diff --git a/ext/standard/tests/file/lstat_stat_variation22.phpt b/ext/standard/tests/file/lstat_stat_variation22.phpt
index c9072ce013..f9d9047188 100644
--- a/ext/standard/tests/file/lstat_stat_variation22.phpt
+++ b/ext/standard/tests/file/lstat_stat_variation22.phpt
@@ -2,6 +2,11 @@
Test lstat() and stat() functions: usage variations - invalid filenames
--CREDITS--
Dave Kelsey <d_kelsey@uk.ibm.com>
+--SKIPIF--
+<?php
+if (substr(PHP_OS, 0, 3) == 'WIN') {
+ die('skip ... not for Windows');
+}
--FILE--
<?php
/* Prototype: array lstat ( string $filename );
@@ -46,4 +51,4 @@ bool(false)
Warning: lstat(): Lstat failed for | in %s on line %d
bool(false)
-Done \ No newline at end of file
+Done