]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-7.3' into PHP-7.4
authorChristoph M. Becker <cmbecker69@gmx.de>
Fri, 23 Aug 2019 12:02:48 +0000 (14:02 +0200)
committerChristoph M. Becker <cmbecker69@gmx.de>
Fri, 23 Aug 2019 12:04:31 +0000 (14:04 +0200)
* PHP-7.3:
  Fix #77812: Interactive mode does not support PHP 7.3-style heredoc

1  2 
NEWS
ext/readline/readline_cli.c

diff --cc NEWS
index c781ff758b59a780e47332ecc84fc51d6d73af3c,0e6efd76cd18bb4653922c469abd0a4c95f99c0b..8fa0367077e38dc5c89799df998b7fb547c79f18
--- 1/NEWS
--- 2/NEWS
+++ b/NEWS
@@@ -1,27 -1,19 +1,29 @@@
  PHP                                                                        NEWS
  |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 -?? ??? ????, PHP 7.3.10
 +?? ??? ????, PHP 7.4.0RC1
  
  - Core:
 -  . Fixed bug #78220 (Can't access OneDrive folder). (cmb, ab)
 -  . Fixed bug #77922 (Double release of doc comment on inherited shadow
 -    property). (Nikita)
 -  . Fixed bug #78441 (Parse error due to heredoc identifier followed by digit).
 -    (cmb)
+   . Fixed bug #77812 (Interactive mode does not support PHP 7.3-style heredoc).
+     (cmb, Nikita)
 +  . Fixed bug #78438 (Corruption when __unserializing deeply nested structures).
 +    (cmb, Nikita)
 +  . Fixed bug #78441 (Parse error due to heredoc identifier followed by digit).
 +    (cmb)
  
 -- Intl:
 -  . Ensure IDNA2003 rules are used with idn_to_ascii() and idn_to_utf8()
 -    when requested. (Sara)
 +22 Aug 2019, PHP 7.4.0beta4
 +
 +- Core:
 +  . Fixed bug #78220 (Can't access OneDrive folder). (cmb, ab)
 +  . Fixed bug #78396 (Second file_put_contents in Shutdown hangs script).
 +    (Nikita)
 +  . Fixed bug #78406 (Broken file includes with user-defined stream filters).
 +    (Nikita)
 +  . Fixed bug #72530 (Use After Free in GC with Certain Destructors). (Nikita)
 +  . Fixed bug #78386 (fstat mode has unexpected value on PHP 7.4). (cmb)
 +
 +- Date:
 +  . Fixed bug #78383 (Casting a DateTime to array no longer returns its
 +    properties). (Nikita)
  
  - MySQLnd:
    . Fixed connect_attr issues and added the _server_host connection attribute.
index c533fc27432912a98af1bae59eba3804a54e3205,6e6e9161be452284f52d87c4c3eae53971b2de43..d7d96b59e122cdb319ce6e1ebd45ac8002905fd7
@@@ -350,12 -347,14 +350,15 @@@ static int cli_is_valid_code(char *code
                                }
                                break;
                        case heredoc:
-                               if (code[i - (heredoc_len + 1)] == '\n' && !strncmp(code + i - heredoc_len, heredoc_tag, heredoc_len) && code[i] == '\n') {
-                                       code_type = body;
-                               } else if (code[i - (heredoc_len + 2)] == '\n' && !strncmp(code + i - heredoc_len - 1, heredoc_tag, heredoc_len) && code[i-1] == ';' && code[i] == '\n') {
 +                              ZEND_ASSERT(heredoc_tag);
+                               if (!strncmp(code + i - heredoc_len + 1, heredoc_tag, heredoc_len)) {
+                                       unsigned char c = code[i + 1];
+                                       char *p = code + i - heredoc_len;
+                                       if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || (c >= '0' && c <= '9') || c == '_' || c >= 0x80) break;
+                                       while (*p == ' ' || *p == '\t') p--;
+                                       if (*p != '\n') break;
                                        code_type = body;
-                                       valid_end = 1;
                                }
                                break;
                        case outside: