Skip to content

Commit 2c3f6dc

Browse files
committed
Merge branch 'PHP-5.4' of ssh://git.php.net/php-src into PHP-5.4
Conflicts: NEWS
2 parents 9fc3818 + e4a28b7 commit 2c3f6dc

33 files changed

+1038
-445
lines changed

NEWS

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,30 @@ PHP NEWS
99
(Adam)
1010
. Fixed bug #62964 (Possible XSS on "Registered stream filters" info).
1111
(david at nnucomputerwhiz dot com)
12-
. Fixed bug #62672 (Error on serialize of ArrayObject).
13-
(lior dot k at zend dot com)
12+
. Fixed bug #62672 (Error on serialize of ArrayObject). (Lior Kaplan)
1413
. Fixed bug #62475 (variant_* functions causes crash when null given as an
1514
argument). (Felipe)
1615
. Fixed bug #60732 (php_error_docref links to invalid pages). (Jakub Vrana)
1716

17+
- CGI:
18+
. Fixed Bug #65143 (Missing php-cgi man page). (Remi)
19+
1820
- CLI server:
1921
. Fixed bug #65066 (Cli server not responsive when responding with 422 http
2022
status code). (Adam)
23+
24+
- FPM:
25+
. Fixed bug #63983 (enabling FPM borks compile on FreeBSD).
26+
(chibisuke at web dot de, Felipe)
27+
28+
- Imap:
29+
. Fixed bug #64467 (Segmentation fault after imap_reopen failure).
30+
(askalski at gmail dot com)
2131

2232
- Intl:
23-
. Fixed bug #62759: Buggy grapheme_substr() on edge case. (Stas)
33+
. Fixed bug #62759 (Buggy grapheme_substr() on edge case). (Stas)
34+
. Fixed bug #61860 (Offsets may be wrong for grapheme_stri* functions).
35+
(Stas)
2436

2537
- mysqlnd:
2638
. Fixed segfault in mysqlnd when doing long prepare. (Andrey)
@@ -33,13 +45,27 @@ PHP NEWS
3345
. Allowed PDO_OCI to compile with Oracle Database 12c client libraries.
3446
(Chris Jones)
3547

48+
- Phar:
49+
. Fixed Bug #65142 (Missing phar man page). (Remi)
50+
51+
- Session
52+
. Fixed bug #62535 ($_SESSION[$key]["cancel_upload"] doesn't work as
53+
documented). (Arpad)
54+
. Fixed bug #35703 (when session_name("123") consist only digits,
55+
should warning). (Yasuo)
56+
. Fixed bug #49175 (mod_files.sh does not support hash bits). Patch by
57+
oorza2k5 at gmail dot com (Yasuo)
58+
3659
- Sockets:
3760
. Implemented FR #63472 (Setting SO_BINDTODEVICE with socket_set_option).
3861
(Damjan Cvetko)
3962

4063
- SPL:
64+
. Fixed bug #65136 (RecursiveDirectoryIterator segfault). (Laruence)
4165
. Fixed bug #61828 (Memleak when calling Directory(Recursive)Iterator
4266
/Spl(Temp)FileObject ctor twice). (Laruence)
67+
. Fixed bug #60560 (SplFixedArray un-/serialize, getSize(), count() return 0,
68+
keys are strings). (Adam)
4369

4470
?? ??? 2013, PHP 5.4.17
4571

UPGRADING

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -640,6 +640,9 @@ c. New functions
640640
- SPL
641641
- class_uses()
642642

643+
- SplFixedArray
644+
- SplFixedArray::__wakeup() (5.4.18)
645+
643646
d. New global constants
644647

645648
- CURLOPT_MAX_RECV_SPEED_LARGE

Zend/acinclude.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ dnl This file contains local autoconf functions.
44

55
AC_DEFUN([LIBZEND_BISON_CHECK],[
66
# we only support certain bison versions
7-
bison_version_list="1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3 2.4 2.4.1 2.4.2 2.4.3 2.5 2.5.1 2.6 2.6.1 2.6.2"
7+
bison_version_list="1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3 2.4 2.4.1 2.4.2 2.4.3 2.5 2.5.1 2.6 2.6.1 2.6.2 2.6.4"
88
99
# for standalone build of Zend Engine
1010
test -z "$SED" && SED=sed

Zend/zend_alloc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2461,7 +2461,7 @@ static inline size_t safe_address(size_t nmemb, size_t size, size_t offset)
24612461
size_t res = nmemb;
24622462
unsigned long overflow = 0;
24632463

2464-
__asm__ ("mull %3\n\taddl %4,%0\n\tadcl %1,%1"
2464+
__asm__ ("mull %3\n\taddl %4,%0\n\tadcl $0,%1"
24652465
: "=&a"(res), "=&d" (overflow)
24662466
: "%0"(res),
24672467
"rm"(size),
@@ -2489,7 +2489,7 @@ static inline size_t safe_address(size_t nmemb, size_t size, size_t offset)
24892489

24902490
__asm__ ("mul" LP_SUFF " %3\n\t"
24912491
"add %4,%0\n\t"
2492-
"adc %1,%1"
2492+
"adc $0,%1"
24932493
: "=&a"(res), "=&d" (overflow)
24942494
: "%0"(res),
24952495
"rm"(size),

ext/dba/tests/bug38698.phpt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,18 @@ Bug #38698 (Bug #38698 for some keys cdbmake creates corrupted db and cdb can't
88
--FILE--
99
<?php
1010

11+
function isLittleEndian() {
12+
return 0x00FF === current(unpack('v', pack('S',0x00FF)));
13+
}
14+
1115
$db_file = dirname(__FILE__) .'/129php.cdb';
1216

1317
if (($db_make=dba_open($db_file, "n", 'cdb_make'))!==FALSE) {
14-
dba_insert(pack('i',129), "Booo!", $db_make);
18+
if (isLittleEndian() === FALSE) {
19+
dba_insert(pack('V',129), "Booo!", $db_make);
20+
} else{
21+
dba_insert(pack('i',129), "Booo!", $db_make);
22+
}
1523
dba_close($db_make);
1624
// write md5 checksum of generated database file
1725
var_dump(md5_file($db_file));

ext/imap/php_imap.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1270,7 +1270,6 @@ PHP_FUNCTION(imap_reopen)
12701270
int mailbox_len;
12711271
long options = 0, retries = 0;
12721272
pils *imap_le_struct;
1273-
MAILSTREAM *imap_stream;
12741273
long flags=NIL;
12751274
long cl_flags=NIL;
12761275

@@ -1298,12 +1297,12 @@ PHP_FUNCTION(imap_reopen)
12981297
RETURN_FALSE;
12991298
}
13001299

1301-
imap_stream = mail_open(imap_le_struct->imap_stream, mailbox, flags);
1302-
if (imap_stream == NIL) {
1300+
imap_le_struct->imap_stream = mail_open(imap_le_struct->imap_stream, mailbox, flags);
1301+
if (imap_le_struct->imap_stream == NIL) {
1302+
zend_list_delete(Z_RESVAL_P(streamind));
13031303
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't re-open stream");
13041304
RETURN_FALSE;
13051305
}
1306-
imap_le_struct->imap_stream = imap_stream;
13071306
RETURN_TRUE;
13081307
}
13091308
/* }}} */

ext/intl/grapheme/grapheme_string.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ PHP_FUNCTION(grapheme_strpos)
113113
unsigned char *found;
114114
long loffset = 0;
115115
int32_t offset = 0;
116-
int ret_pos, uchar_pos;
116+
int ret_pos;
117117

118118
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|l", (char **)&haystack, &haystack_len, (char **)&needle, &needle_len, &loffset) == FAILURE) {
119119

@@ -160,10 +160,10 @@ PHP_FUNCTION(grapheme_strpos)
160160
}
161161

162162
/* do utf16 part of the strpos */
163-
ret_pos = grapheme_strpos_utf16(haystack, haystack_len, needle, needle_len, offset, &uchar_pos, 0 /* fIgnoreCase */ TSRMLS_CC );
163+
ret_pos = grapheme_strpos_utf16(haystack, haystack_len, needle, needle_len, offset, NULL, 0 /* fIgnoreCase */, 0 /* last */ TSRMLS_CC );
164164

165165
if ( ret_pos >= 0 ) {
166-
RETURN_LONG(ret_pos + offset);
166+
RETURN_LONG(ret_pos);
167167
} else {
168168
RETURN_FALSE;
169169
}
@@ -180,7 +180,7 @@ PHP_FUNCTION(grapheme_stripos)
180180
unsigned char *found;
181181
long loffset = 0;
182182
int32_t offset = 0;
183-
int ret_pos, uchar_pos;
183+
int ret_pos;
184184
int is_ascii;
185185

186186
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|l", (char **)&haystack, &haystack_len, (char **)&needle, &needle_len, &loffset) == FAILURE) {
@@ -235,10 +235,10 @@ PHP_FUNCTION(grapheme_stripos)
235235
}
236236

237237
/* do utf16 part of the strpos */
238-
ret_pos = grapheme_strpos_utf16(haystack, haystack_len, needle, needle_len, offset, &uchar_pos, 1 /* fIgnoreCase */ TSRMLS_CC );
238+
ret_pos = grapheme_strpos_utf16(haystack, haystack_len, needle, needle_len, offset, NULL, 1 /* fIgnoreCase */, 0 /*last */ TSRMLS_CC );
239239

240240
if ( ret_pos >= 0 ) {
241-
RETURN_LONG(ret_pos + offset);
241+
RETURN_LONG(ret_pos);
242242
} else {
243243
RETURN_FALSE;
244244
}
@@ -304,7 +304,7 @@ PHP_FUNCTION(grapheme_strrpos)
304304
/* else we need to continue via utf16 */
305305
}
306306

307-
ret_pos = grapheme_strrpos_utf16(haystack, haystack_len, needle, needle_len, offset, 0 /* f_ignore_case */ TSRMLS_CC);
307+
ret_pos = grapheme_strpos_utf16(haystack, haystack_len, needle, needle_len, offset, NULL, 0 /* f_ignore_case */, 1/* last */ TSRMLS_CC);
308308

309309
if ( ret_pos >= 0 ) {
310310
RETURN_LONG(ret_pos);
@@ -382,7 +382,7 @@ PHP_FUNCTION(grapheme_strripos)
382382
/* else we need to continue via utf16 */
383383
}
384384

385-
ret_pos = grapheme_strrpos_utf16(haystack, haystack_len, needle, needle_len, offset, 1 /* f_ignore_case */ TSRMLS_CC);
385+
ret_pos = grapheme_strpos_utf16(haystack, haystack_len, needle, needle_len, offset, NULL, 1 /* f_ignore_case */, 1 /*last */ TSRMLS_CC);
386386

387387
if ( ret_pos >= 0 ) {
388388
RETURN_LONG(ret_pos);
@@ -659,7 +659,7 @@ static void strstr_common_handler(INTERNAL_FUNCTION_PARAMETERS, int f_ignore_cas
659659
}
660660

661661
/* need to work in utf16 */
662-
ret_pos = grapheme_strpos_utf16(haystack, haystack_len, needle, needle_len, 0, &uchar_pos, f_ignore_case TSRMLS_CC );
662+
ret_pos = grapheme_strpos_utf16(haystack, haystack_len, needle, needle_len, 0, &uchar_pos, f_ignore_case, 0 /*last */ TSRMLS_CC );
663663

664664
if ( ret_pos < 0 ) {
665665
RETURN_FALSE;

0 commit comments

Comments
 (0)