Skip to content

Commit 6410f6f

Browse files
author
Yasuo Ohgaki
committed
Merge branch 'PHP-5.5' of git.php.net:php-src into PHP-5.5
* 'PHP-5.5' of git.php.net:php-src: (178 commits) Fixed bug #65939 (Space before ";" breaks php.ini parsing). (brainstorm at nopcode dot org) exif NEWS add tests for bug #62523 Merged PR #293 (Exif crash on unknown encoding was fixed) By: Draal Conflicts: configure.in main/php_version.h fix bug #65936 (dangling context pointer causes crash) remove TRAVIS check in test source Fixed compilation warning Just SKIP that test on travis Fixed issue #115 (path issue when using phar). fix memory leak on error (from Coverity scan) Fix coverity issue with -1 returned by findOffset not being handled by getPreferredTag 5.4.21 release date fix argument type & remove warning fix const warnings in intl methods When src->src is null this doesn't get initialized but it is still used, so the passed in *ze will point to unitialized memory. Hopefully src->src is never null, but just in case this initialization doesn't hurt. Fix coverity issue with -1 returned by findOffset not being handled by getPreferredTag fix possibility of access to *storedType without initialization 5.4.21 release date Fix typo These getpwnam('') tests are silly and not portable ...
2 parents 7be3c74 + b6ceea4 commit 6410f6f

File tree

222 files changed

+6784
-1708
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

222 files changed

+6784
-1708
lines changed

.travis.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,15 @@ notifications:
88
email: false
99

1010
env:
11-
- REPORT_EXIT_STATUS=1
11+
global:
12+
- MYSQL_TEST_HOST=127.0.0.1
13+
- MYSQL_TEST_USER=travis
14+
- PDO_MYSQL_TEST_DSN="mysql:host=127.0.0.1;dbname=test"
15+
- PDO_MYSQL_TEST_USER=travis
16+
- PDO_MYSQL_TEST_PASS=
17+
- PDO_MYSQL_TEST_HOST=127.0.0.1
18+
matrix:
19+
- REPORT_EXIT_STATUS=1
1220

1321
before_script:
1422
# Compile PHP
@@ -21,4 +29,4 @@ before_script:
2129
- . ./travis/ext/pdo_pgsql/setup.sh
2230

2331
# Run PHPs run-tests.php
24-
script: ./sapi/cli/php run-tests.php -p `pwd`/sapi/cli/php -g "FAIL,XFAIL,BORK,WARN,LEAK,SKIP" --show-diff
32+
script: ./sapi/cli/php run-tests.php -p `pwd`/sapi/cli/php -g "FAIL,XFAIL,BORK,WARN,LEAK,SKIP" --show-diff --set-timeout 120

CODING_STANDARDS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ Naming Conventions
151151

152152
7. Classes should be given descriptive names. Avoid using abbreviations where
153153
possible. Each word in the class name should start with a capital letter,
154-
without underscore delimiters (CampelCaps starting with a capital letter).
154+
without underscore delimiters (CamelCaps starting with a capital letter).
155155
The class name should be prefixed with the name of the 'parent set' (e.g.
156156
the name of the extension)::
157157

NEWS

Lines changed: 124 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,149 @@
11
PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
3-
?? ??? 2013, PHP 5.5.4
3+
?? ??? 2013, PHP 5.5.6
44

55
- Core:
6+
. Fixed bug #65939 (Space before ";" breaks php.ini parsing).
7+
(brainstorm at nopcode dot org)
8+
. Fixed bug #65911 (scope resolution operator - strange behavior with $this).
9+
(Bob Weinand)
10+
11+
17 Oct 2013, PHP 5.5.5
12+
13+
- Core:
14+
. Fixed bug #64979 (Wrong behavior of static variables in closure generators).
15+
(Nikita)
16+
. Fixed bug #65322 (compile time errors won't trigger auto loading). (Nikita)
17+
. Fixed bug #65821 (By-ref foreach on property access of string offset
18+
segfaults). (Nikita)
19+
. Fixed bug #65936 (dangling context pointer causes crash). (Tony)
20+
21+
- CLI server:
22+
. Fixed bug #65633 (built-in server treat some http headers as
23+
case-sensitive). (Adam)
24+
. Fixed bug #65818 (Segfault with built-in webserver and chunked transfer
25+
encoding). (Felipe)
26+
. Added application/pdf to PHP CLI Web Server mime types (Chris Jones)
27+
28+
- Datetime:
29+
. Fixed bug #64157 (DateTime::createFromFormat() reports confusing error
30+
message). (Boro Sitnikovski)
31+
. Fixed bug #65502 (DateTimeImmutable::createFromFormat returns DateTime).
32+
(Boro Sitnikovski)
33+
. Fixed bug #65548 (Comparison for DateTimeImmutable doesn't work).
34+
(Boro Sitnikovski)
35+
36+
- DBA extension:
37+
. Fixed bug #65708 (dba functions cast $key param to string in-place,
38+
bypassing copy on write). (Adam)
39+
40+
- Filter:
41+
. Add RFC 6598 IPs to reserved addresses. (Sebastian Nohn)
42+
. Fixed bug #64441 (FILTER_VALIDATE_URL rejects fully qualified domain names).
43+
(Syra)
44+
45+
- FTP:
46+
. Fixed bug #65667 (ftp_nb_continue produces segfault). (Philip Hofstetter)
47+
48+
- GD
49+
. Ensure that the defined interpolation method is used with the generic
50+
scaling methods. (Pierre)
51+
52+
- IMAP:
53+
. Fixed bug #65721 (configure script broken in 5.5.4 and 5.4.20 when enabling
54+
imap). (ryotakatsuki at gmail dot com)
55+
56+
- OPcache:
57+
. Fixed issue #115 (path issue when using phar). (Laruence)
58+
. Added support for GNU Hurd. (Svante Signell)
59+
. Added function opcache_compile_file() to load PHP scripts into cache
60+
without execution. (Julien)
61+
. Fixed bug #65845 (Error when Zend Opcache Optimizer is fully enabled).
62+
(Dmitry)
63+
. Fixed bug #65665 (Exception not properly caught when opcache enabled).
64+
(Laruence)
65+
. Fixed bug #65510 (5.5.2 crashes in _get_zval_ptr_ptr_var). (Dmitry)
66+
. Fixed issue #135 (segfault in interned strings if initial memory is too
67+
low). (Julien)
68+
69+
- Sockets:
70+
. Fixed bug #65808 (the socket_connect() won't work with IPv6 address).
71+
(Mike)
72+
73+
- SPL:
74+
. Fix bug #64782 (SplFileObject constructor make $context optional / give it
75+
a default value). (Nikita)
76+
77+
- Standard:
78+
. Fixed bug #61548 (content-type must appear at the end of headers for 201
79+
Location to work in http). (Mike)
80+
81+
- XMLReader:
82+
. Fixed bug #51936 (Crash with clone XMLReader). (Mike)
83+
. Fixed bug #64230 (XMLReader does not suppress errors). (Mike)
84+
85+
- Build system:
86+
. Fixed bug #51076 (race condition in shtool's mkdir -p implementation).
87+
(Mike, Raphael Geissert)
88+
. Fixed bug #62396 ('make test' crashes starting with 5.3.14 (missing
89+
gzencode())). (Mike)
90+
91+
92+
19 Sep 2013, PHP 5.5.4
93+
94+
- Core:
95+
. Fixed bug #60598 (cli/apache sapi segfault on objects manipulation).
96+
(Laruence)
97+
. Improved fputcsv() to allow specifying escape character.
98+
. Fixed bug #65490 (Duplicate calls to get lineno & filename for
99+
DTRACE_FUNCTION_*). (Chris Jones)
100+
. Fixed bug #65483 (quoted-printable encode stream filter incorrectly encoding
101+
spaces). (Michael M Slusarz)
102+
. Fixed bug #65481 (shutdown segfault due to serialize) (Mike)
6103
. Fixed bug #65470 (Segmentation fault in zend_error() with
7104
--enable-dtrace). (Chris Jones, Kris Van Hees)
8105
. Fixed bug #65225 (PHP_BINARY incorrectly set). (Patrick Allaert)
9106
. Fixed bug #62692 (PHP fails to build with DTrace). (Chris Jones, Kris Van Hees)
107+
. Fixed bug #61759 (class_alias() should accept classes with leading
108+
backslashes). (Julien)
109+
. Fixed bug #46311 (Pointer aliasing issue results in miscompile on gcc4.4).
110+
(Nikita Popov)
10111

11112
- cURL:
12113
. Fixed bug #65458 (curl memory leak). (Adam)
13114

115+
- Datetime:
116+
. Fixed bug #65554 (createFromFormat broken when weekday name is followed
117+
by some delimiters). (Valentin Logvinskiy, Stas).
118+
. Fixed bug #65564 (stack-buffer-overflow in DateTimeZone stuff caught
119+
by AddressSanitizer). (Remi).
120+
121+
- OPCache:
122+
. Fixed bug #65561 (Zend Opcache on Solaris 11 x86 needs ZEND_MM_ALIGNMENT=4).
123+
(Terry Ellison)
124+
14125
- Openssl:
15126
. Fixed bug #64802 (openssl_x509_parse fails to parse subject properly in
16127
some cases). (Mark Jones)
17128

129+
- PDO:
130+
. Fixed bug #64953 (Postgres prepared statement positional parameter
131+
casting). (Mike)
132+
18133
- Session:
19134
. Fixed bug #65475 (Session ID is not initialized properly when strict session
20135
is enabled). (Yasuo)
21136
. Fixed bug #51127/#65359 Request #25630/#43980/#54383 (Added php_serialize
22137
session serialize handler that uses plain serialize()). (Yasuo)
23138

139+
- Standard:
140+
. Fix issue with return types of password API helper functions. Found via
141+
static analysis by cjones. (Anthony Ferrara)
142+
143+
- Zlib:
144+
. Fixed bug #65391 (Unable to send vary header user-agent when
145+
ob_start('ob_gzhandler') is called) (Mike)
146+
24147
22 Aug 2013, PHP 5.5.3
25148

26149
- Openssl:

README.EXTENSIONS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ zend_module_entry foo_module_entry = {
3030
PHP_RSHUTDOWN(foo), /* per-request shutdown function */
3131
PHP_MINFO(foo), /* information function */
3232
#if ZEND_MODULE_API_NO >= 20010901
33-
FOO_VERSION, /* extension version number (string) */
33+
PHP_FOO_VERSION, /* extension version number (string) */
3434
#endif
3535
STANDARD_MODULE_PROPERTIES
3636
};

README.EXT_SKEL

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ HOW TO USE IT
3131

3232
./buildconf; ./configure --enable-module_name; make
3333

34+
The definition of PHP_MODULE_NAME_VERSION will be present in the
35+
php_module_name.h and injected into the zend_module_entry definition. This
36+
is required by the PECL website for the version string conformity checks
37+
against package.xml
38+
3439
But if you already have planned the overall scheme of your module, what
3540
functions it will contain, their return types and the arguments they take
3641
(a very good idea) and don't want to bother yourself with creating function

README.SELF-CONTAINED-EXTENSIONS

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,3 +153,18 @@ ADDING SHARED MODULE SUPPORT TO A MODULE
153153
#ifdef COMPILE_DL_FOO
154154
ZEND_GET_MODULE(foo)
155155
#endif
156+
157+
PECL SITE CONFORMITY
158+
159+
If you plan to release an extension to the PECL website, there are several
160+
points to be regarded.
161+
162+
1. Add LICENSE or COPYING to the package.xml
163+
164+
2. The following should be defined in one of the extension header files
165+
166+
#define PHP_FOO_VERSION "1.2.3"
167+
168+
This macros has to be used within your foo_module_entry to indicate the
169+
extension version.
170+

UPGRADING

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,9 @@ PHP 5.5 UPGRADE NOTES
186186
DOMDocument::schemaValidate() accept flag parameter. Only flag
187187
available now is LIBXML_SCHEMA_CREATE. Default is 0.
188188

189+
- Since 5.5.4, fputcsv() has fifth parameter escape_char, allowing to
190+
specify escape char.
191+
189192
========================================
190193
5. New Functions
191194
========================================
@@ -340,6 +343,8 @@ None
340343

341344
- Intl:
342345
- This extension now requires ICU 4.0+.
346+
- Phar:
347+
- Added ability of resolving alias created by Phar::map
343348

344349
========================================
345350
9. New Global Constants

Zend/acinclude.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ AC_DEFUN([LIBZEND_BISON_CHECK],[
1212
bison_version=none
1313
if test "$YACC"; then
1414
AC_CACHE_CHECK([for bison version], php_cv_bison_version, [
15-
bison_version_vars=`bison --version 2> /dev/null | grep 'GNU Bison' | cut -d ' ' -f 4 | $SED -e 's/\./ /' | tr -d a-z`
15+
bison_version_vars=`$YACC --version 2> /dev/null | grep 'GNU Bison' | cut -d ' ' -f 4 | $SED -e 's/\./ /g' | tr -d a-z`
1616
php_cv_bison_version=invalid
1717
if test -n "$bison_version_vars"; then
1818
set $bison_version_vars

Zend/tests/bug60598.phpt

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
--TEST--
2+
Bug #60598 (cli/apache sapi segfault on objects manipulation)
3+
--FILE--
4+
<?php
5+
define('OBJECT_COUNT', 10000);
6+
7+
$containers = array();
8+
9+
class Object {
10+
protected $_guid = 0;
11+
public function __construct() {
12+
global $containers;
13+
$this->guid = 1;
14+
$containers[spl_object_hash($this)] = $this;
15+
}
16+
public function __destruct() {
17+
global $containers;
18+
$containers[spl_object_hash($this)] = NULL;
19+
}
20+
}
21+
22+
for ($i = 0; $i < OBJECT_COUNT; ++$i) {
23+
new Object();
24+
}
25+
26+
// You probably won't see this because of the "zend_mm_heap corrupted"
27+
?>
28+
If you see this, try to increase OBJECT_COUNT to 100,000
29+
--EXPECT--
30+
If you see this, try to increase OBJECT_COUNT to 100,000

Zend/tests/bug64896.phpt

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
--TEST--
2+
Bug #64896 (Segfault with gc_collect_cycles using unserialize on certain objects)
3+
--XFAIL--
4+
We can not fix this bug without a significant (performace slow down) change to gc
5+
--FILE--
6+
<?php
7+
$bar = NULL;
8+
class bad
9+
{
10+
private $_private = array();
11+
12+
public function __construct()
13+
{
14+
$this->_private[] = 'php';
15+
}
16+
17+
public function __destruct()
18+
{
19+
global $bar;
20+
$bar = $this;
21+
}
22+
}
23+
24+
$foo = new stdclass;
25+
$foo->foo = $foo;
26+
$foo->bad = new bad;
27+
28+
gc_disable();
29+
30+
unserialize(serialize($foo));
31+
gc_collect_cycles();
32+
var_dump($bar);
33+
/* will output:
34+
object(bad)#4 (1) {
35+
["_private":"bad":private]=>
36+
&UNKNOWN:0
37+
}
38+
*/
39+
?>
40+
--EXPECTF--
41+
bject(bad)#%d (1) {
42+
["_private":"bad":private]=>
43+
array(1) {
44+
[0]=>
45+
string(3) "php"
46+
}
47+
}

Zend/tests/bug64979.phpt

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
--TEST--
2-
Bug #64578 (Closures with static variables can be generators)
3-
--XFAIL--
4-
Bug #64979 not fixed yet.
2+
Bug #64979 (Wrong behavior of static variables in closure generators)
53
--FILE--
64
<?php
75

86
function new_closure_gen() {
9-
return function() {
10-
static $foo = 0;
11-
yield ++$foo;
12-
};
7+
return function() {
8+
static $foo = 0;
9+
yield ++$foo;
10+
};
1311
}
1412

1513
$closure1 = new_closure_gen();
@@ -20,9 +18,9 @@ $gen2 = $closure1();
2018
$gen3 = $closure2();
2119

2220
foreach (array($gen1, $gen2, $gen3) as $gen) {
23-
foreach ($gen as $val) {
24-
print "$val\n";
25-
}
21+
foreach ($gen as $val) {
22+
var_dump($val);
23+
}
2624
}
2725

2826
?>

Zend/tests/bug65322.phpt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
--TEST--
2+
Bug #65322: compile time errors won't trigger auto loading
3+
--FILE--
4+
<?php
5+
6+
spl_autoload_register(function($class) {
7+
var_dump($class);
8+
class B {}
9+
});
10+
11+
set_error_handler(function($_, $msg, $file) {
12+
var_dump($msg, $file);
13+
new B;
14+
});
15+
16+
eval('class A { function a() {} function __construct() {} }');
17+
18+
?>
19+
--EXPECTF--
20+
string(50) "Redefining already defined constructor for class A"
21+
string(%d) "%s(%d) : eval()'d code"
22+
string(1) "B"

0 commit comments

Comments
 (0)