]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-7.4' into PHP-8.0
authorChristoph M. Becker <cmbecker69@gmx.de>
Mon, 8 Mar 2021 14:08:11 +0000 (15:08 +0100)
committerChristoph M. Becker <cmbecker69@gmx.de>
Mon, 8 Mar 2021 14:15:59 +0000 (15:15 +0100)
* PHP-7.4:
  Fix #51903: simplexml_load_file() doesn't use HTTP headers

1  2 
NEWS
ext/libxml/libxml.c
ext/libxml/tests/bug51903.phpt

diff --cc NEWS
index 46bf8239aa32e087f47a6e400c8ecc8d6bbf03f4,4ccac5378f8f9f0a6600a90f8549242c489f685b..4ca029d681cb79d0a3f08952db47e8597725b390
--- 1/NEWS
--- 2/NEWS
+++ b/NEWS
@@@ -15,9 -11,18 +15,12 @@@ PH
    . Fixed bug #80763 (msgfmt_format() does not accept DateTime references).
      (cmb)
  
 -- MySQLnd:
 -  . Fixed bug #80713 (SegFault when disabling ATTR_EMULATE_PREPARES and
 -    MySQL 8.0). (Nikita)
 -
 -- opcache:
 -  . Fixed bug #80805 (create simple class and get error in opcache.so). (Nikita)
 -
 -- phpdbg:
 -  . Fixed bug #80757 (Exit code is 0 when could not open file). (Felipe)
+ - Libxml:
+   . Fixed bug #51903 (simplexml_load_file() doesn't use HTTP headers). (cmb)
 +- Opcache:
 +  . Fixed bug #80786 (PHP crash using JIT). (Nikita)
 +  . Fixed bug #80782 (DASM_S_RANGE_VREG on PHP_INT_MIN-1). (Dmitry)
  
  - Session:
    . Fixed bug #80774 (session_name() problem with backslash). (cmb)
Simple merge
index 0000000000000000000000000000000000000000,36a4b5570448a420bbcbaa2e6ea202df2595e8c3..ebbca2068cca66c37ffa543a9725d65ad19d2315
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,38 +1,38 @@@
 -http_server_skipif('tcp://127.0.0.1:12342');
+ --TEST--
+ Bug #51903 (simplexml_load_file() doesn't use HTTP headers)
+ --SKIPIF--
+ <?php
+ if (!extension_loaded('simplexml')) die('skip simplexml extension not available');
+ if (@!include "./ext/standard/tests/http/server.inc") die('skip server.inc not available');
 -$pid = http_server('tcp://127.0.0.1:12342', $responses);
++http_server_skipif();
+ ?>
+ --FILE--
+ <?php
+ require "./ext/standard/tests/http/server.inc";
+ $responses = [
+     "data://text/plain,HTTP/1.1 200 OK\r\n"
+     . "Content-Type: text/xml; charset=ISO-8859-1\r\n\r\n"
+     . "<?xml version=\"1.0\"?>\n"
+     . "<root>\xE4\xF6\xFC</root>\n",
+     "data://text/plain,HTTP/1.1 200 OK\r\n"
+     . "Content-Type: text/xml; charset=ISO-8859-1; foo=bar\r\n\r\n"
+     . "<?xml version=\"1.0\"?>\n"
+     . "<root>\xE4\xF6\xFC</root>\n",
+     "data://text/plain,HTTP/1.1 200 OK\r\n"
+     . "Content-Type: text/xml; charset=\"ISO-8859-1\" ; foo=bar\r\n\r\n"
+     . "<?xml version=\"1.0\"?>\n"
+     . "<root>\xE4\xF6\xFC</root>\n",
+ ];
 -    $sxe = simplexml_load_file('http://127.0.0.1:12342/');
++['pid' => $pid, 'uri' => $uri] = http_server($responses);
+ for ($i = 0; $i < count($responses); $i++) {
++    $sxe = simplexml_load_file($uri);
+     echo "$sxe\n";
+ }
+ http_server_kill($pid);
+ ?>
+ --EXPECT--
+ äöü
+ äöü
+ äöü