]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-5.5' into PHP-5.6
authorTjerk Meesters <datibbaw@php.net>
Wed, 30 Jul 2014 10:27:29 +0000 (18:27 +0800)
committerTjerk Meesters <datibbaw@php.net>
Wed, 30 Jul 2014 10:27:29 +0000 (18:27 +0800)
* PHP-5.5:
  Updated NEWS for #67693
  Fixed bug #67693 - incorrect push to the empty array

1  2 
NEWS
ext/standard/array.c

diff --cc NEWS
index 621003367403c8fc1c3acc4b7bb60b4a3586e363,bc27f4e86eda06780b8dbe9a974bfcdda8e3abb9..70338ee7503ec909ab19004e27ddd780be205cde
--- 1/NEWS
--- 2/NEWS
+++ b/NEWS
@@@ -1,10 -1,38 +1,13 @@@
  PHP                                                                        NEWS
  |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 -?? ??? 2014, PHP 5.5.16
 -
 -- COM:
 -  . Fixed missing type checks in com_event_sink (Yussuf Khalil, Stas).
 -
 -- FPM:
 -  . Fixed bug #67635 (php links to systemd libraries without using pkg-config).
 -    (pacho@gentoo.org, Remi)
 -
 -- OpenSSL:
 -  . Fixed missing type checks in OpenSSL options (Yussuf Khalil, Stas).
 -
 -- readline:
 -  . Fixed bug #55496 (Interactive mode doesn't force a newline before the
 -    prompt). (Bob, Johannes)
 -  . Fixed bug #67496 (Save command history when exiting interactive shell
 -    with control-c). (Dmitry Saprykin, Johannes)
 -
 -- Sessions:
 -  . Fixed missing type checks in php_session_create_id (Yussuf Khalil, Stas).
 +?? ??? 2014, PHP 5.6.0 Release Candidate 4
  
 -24 Jul 2014, PHP 5.5.15
+ - Core:
+   . Fixed bug #67693 (incorrect push to the empty array) (Tjerk)
 +31 Jul 2014, PHP 5.6.0 Release Candidate 3
  
  - Core:
 -  . Fixed bug #67428 (header('Location: foo') will override a 308-399 response
 -    code). (Adam)
 -  . Fixed bug #67436 (Autoloader isn't called if two method definitions don't
 -    match). (Bob)
 -  . Fixed bug #67091 (make install fails to install libphp5.so on FreeBSD 10.0).
 -    (Ferenc)
    . Fixed bug #67497 (eval with parse error causes segmentation fault in
      generator). (Nikita)
    . Fixed bug #67151 (strtr with empty array crashes). (Nikita)
index cbcaaf5b8bb8aeb43aee08b0c65ec6418cddb9aa,b2e9a6f284b338481d31b2328df85c9963524b5f..2792b86f020d337c6ef774a5ad5721dcfca89723
@@@ -1892,8 -1967,25 +1892,8 @@@ static void _phpi_pop(INTERNAL_FUNCTION
  
        /* If we did a shift... re-index like it did before */
        if (!off_the_end) {
 -              unsigned int k = 0;
 -              int should_rehash = 0;
 -              Bucket *p = Z_ARRVAL_P(stack)->pListHead;
 -              while (p != NULL) {
 -                      if (p->nKeyLength == 0) {
 -                              if (p->h != k) {
 -                                      p->h = k++;
 -                                      should_rehash = 1;
 -                              } else {
 -                                      k++;
 -                              }
 -                      }
 -                      p = p->pListNext;
 -              }
 -              Z_ARRVAL_P(stack)->nNextFreeElement = k;
 -              if (should_rehash) {
 -                      zend_hash_rehash(Z_ARRVAL_P(stack));
 -              }
 +              zend_hash_reindex(Z_ARRVAL_P(stack), 1);
-       } else if (!key_len && index >= Z_ARRVAL_P(stack)->nNextFreeElement - 1) {
+       } else if (!key_len && Z_ARRVAL_P(stack)->nNextFreeElement > 0 && index >= Z_ARRVAL_P(stack)->nNextFreeElement - 1) {
                Z_ARRVAL_P(stack)->nNextFreeElement = Z_ARRVAL_P(stack)->nNextFreeElement - 1;
        }