Compare commits

...
Author SHA1 Message Date
Davey Shafik 6a77550df1 Update versions/dates for PHP 7.1.0RC2 2016-09-14 11:58:39 +00:00
Jakub Zelenka 25b4bd1606 Merge branch 'PHP-7.0' into PHP-7.1 2016-09-14 12:34:39 +01:00
Jakub Zelenka cfc8522238 Sync NEWS for bug #73072 2016-09-14 12:31:45 +01:00
Christoph M. Becker 219d8599b0 Fix #72430: [] operator not supported for strings 2016-09-14 12:43:22 +02:00
Anatol Belski 001fbbb94f fix erroneous resource destruction 2016-09-14 12:07:38 +02:00
Davey Shafik acc574d76b Sync NEWS 2016-09-13 19:38:39 -07:00
Adam Baratz f6b6e97b29 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Add special case for earlier versions of TDS
  Adjust error formatting so ext/pdo/tests/bug_43130.phpt passes with pdo_dblib
  Free error and message strings when cleaning up PDO instances that use pdo_dblib
  Add common suite
2016-09-13 17:02:53 -04:00
Adam Baratz bcee34c649 Add special case for earlier versions of TDS 2016-09-13 17:01:51 -04:00
Adam Baratz 0de333bd62 Adjust error formatting so ext/pdo/tests/bug_43130.phpt passes with pdo_dblib 2016-09-13 16:43:33 -04:00
Adam Baratz 69eef8c361 Free error and message strings when cleaning up PDO instances that use pdo_dblib 2016-09-13 16:43:30 -04:00
Adam Baratz efadcb0390 Add common suite 2016-09-13 16:43:25 -04:00
Adam Baratz 45850213bd Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Explicitly allow NULL values for dblib compatibility
  Add dblib-specific query
  Remove test cases don't test distinct behavior
2016-09-13 16:38:56 -04:00
Adam Baratz 9fb94f03e7 Explicitly allow NULL values for dblib compatibility
MSSQL won't necessarily default columns to NULL, see:
https://msdn.microsoft.com/en-us/library/ms174979.aspx
2016-09-13 16:36:23 -04:00
Adam Baratz 69013f6b26 Add dblib-specific query 2016-09-13 16:36:23 -04:00
Adam Baratz f0a12af65b Remove test cases don't test distinct behavior
These cases are also incompatible with pdo_dblib. Removing is easier.
2016-09-13 16:36:23 -04:00
Adam Baratz c02ff02953 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Handle SQLDECIMAL/SQLNUMERIC types, which are used by later TDS versions
2016-09-13 16:33:18 -04:00
Adam Baratz 91c49c4ab0 Handle SQLDECIMAL/SQLNUMERIC types, which are used by later TDS versions 2016-09-13 16:32:37 -04:00
Adam Baratz 421f654874 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Allow \PDO::setAttribute() to set pdo_dblib query timeouts
2016-09-13 16:14:55 -04:00
Adam Baratz 9cdf2042bd Allow \PDO::setAttribute() to set pdo_dblib query timeouts 2016-09-13 16:13:26 -04:00
Jakub Zelenka 1b1b7f8809 Merge branch 'PHP-7.0' into PHP-7.1 2016-09-13 18:27:55 +01:00
Jakub Zelenka 3a739c9f9f Merge branch 'PHP-5.6' into PHP-7.0 2016-09-13 18:19:20 +01:00
Jakub Zelenka 05baa92727 Fix bug #73072 (Invalid path SNI_server_certs causes segfault) 2016-09-13 18:15:34 +01:00
Christoph M. Becker db95bd5807 Merge branch 'PHP-7.0' into PHP-7.1 2016-09-13 16:00:01 +02:00
Christoph M. Becker c8a9ad1527 Merge branch 'PHP-5.6' into PHP-7.0 2016-09-13 15:59:12 +02:00
Christoph M. Becker c43ecfd798 Merge branch 'pull-request/2126' into PHP-5.6 2016-09-13 15:57:39 +02:00
Anatol Belski 0492a05f97 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  update NEWS
2016-09-13 15:56:16 +02:00
Anatol Belski 667d8d3522 update NEWS 2016-09-13 15:55:31 +02:00
Anatol Belski 252b28dbb6 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  update NEWS
  upgrade bundled sqlite to 3.14.2
2016-09-13 15:46:55 +02:00
Anatol Belski 598ed66f82 update NEWS 2016-09-13 15:45:18 +02:00
Anatol Belski 1382e88ac1 upgrade bundled sqlite to 3.14.2 2016-09-13 15:44:21 +02:00
Anatol Belski 86d6f29e8f Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  add test for bug #73068
2016-09-13 15:30:35 +02:00
Anatol Belski 5163925796 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  add test for bug #73068
2016-09-13 15:29:46 +02:00
Anatol Belski 248f8c3a91 add test for bug #73068 2016-09-13 15:28:28 +02:00
Christoph M. Becker 07aab07ce5 Update to SQLite 3.14.2 2016-09-13 13:40:18 +02:00
Anatol Belski 128043babe Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  update NEWS
2016-09-13 12:34:55 +02:00
Anatol Belski 941b56dd4a update NEWS 2016-09-13 12:34:03 +02:00
Anatol Belski 2820adcc7e Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  fix test portability
2016-09-13 12:09:50 +02:00
Anatol Belski 855b8e4f79 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix test portability
2016-09-13 12:02:05 +02:00
Anatol Belski fc31d6fed4 fix test portability 2016-09-13 12:00:29 +02:00
Anatol Belski 2088e3eb45 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  pick up the safe alloc pieces from 19866fb76c
2016-09-13 11:51:17 +02:00
Anatol Belski c403b30291 pick up the safe alloc pieces from
19866fb76c
2016-09-13 11:50:18 +02:00
Anatol Belski 0dd2f072b1 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  missed semicolon
  fix C89 conformity
  Fix bug #72293 - Heap overflow in mysqlnd related to BIT fields
  Fix test
  Fix bug #73065: Out-Of-Bounds Read in php_wddx_push_element of wddx.c
  Fix bug #73035 (Out of bound when verify signature of tar phar in phar_parse_tarfile)
  Fix bug #73052 - Memory Corruption in During Deserialized-object Destruction
  Add check in fgetcsv in case sizeof(unit) != sizeof(size_t)
  Fix bug #73029 - Missing type check when unserializing SplArray
  Fix bug #72860: wddx_deserialize use-after-free
  Also fix overflow in wordwrap
  Fix bug #73007: add locale length check
  Add more checks for int overflow
  Fix bug #72928 - Out of bound when verify signature of zip phar in phar_parse_zipfile
  Fix various int size overflows.
2016-09-13 10:57:03 +02:00
Anatol Belski 01f6a0a860 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  missed semicolon
  fix C89 conformity
  Fix bug #72293 - Heap overflow in mysqlnd related to BIT fields
  Fix test
  Fix bug #73065: Out-Of-Bounds Read in php_wddx_push_element of wddx.c
  Fix bug #73035 (Out of bound when verify signature of tar phar in phar_parse_tarfile)
  Fix bug #73052 - Memory Corruption in During Deserialized-object Destruction
  Add check in fgetcsv in case sizeof(unit) != sizeof(size_t)
  Fix bug #73029 - Missing type check when unserializing SplArray
  Fix bug #72860: wddx_deserialize use-after-free
  Also fix overflow in wordwrap
  Fix bug #73007: add locale length check
  Add more checks for int overflow
  Fix bug #72928 - Out of bound when verify signature of zip phar in phar_parse_zipfile
  Fix various int size overflows.
2016-09-13 10:54:54 +02:00
Anatol Belski 8fd0e0285f missed semicolon 2016-09-13 10:50:44 +02:00
Anatol Belski 363c2524dd fix C89 conformity 2016-09-13 10:43:51 +02:00
Stanislav Malyshev dad0e9d1a3 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0: (22 commits)
  Fix bug #72293 - Heap overflow in mysqlnd related to BIT fields
  I don't think 8cceb012a7 is needed
  Fix test
  Add check in fgetcsv in case sizeof(unit) != sizeof(size_t)
  Fix bug #73065: Out-Of-Bounds Read in php_wddx_push_element of wddx.c
  Fix bug #73035 (Out of bound when verify signature of tar phar in phar_parse_tarfile)
  Fix bug #73052 - Memory Corruption in During Deserialized-object Destruction
  Fix bug #73029 - Missing type check when unserializing SplArray
  Fix bug #72860: wddx_deserialize use-after-free
  Fix bug #73007: add locale length check
  Fix bug #72928 - Out of bound when verify signature of zip phar in phar_parse_zipfile
  sync NEWS
  Revert "Merge branch 'PHP-5.6' into PHP-7.0"
  Merge branch 'PHP-5.6' into PHP-7.0
  Merge branch 'PHP-5.6' into PHP-7.0
  Revert "Revert "Merge branch 'PHP-5.6' into PHP-7.0""
  fix version
  sync NEWS
  Fix bug #72957
  set versions
  ...
2016-09-12 21:10:34 -07:00
Stanislav Malyshev 07c6bdb85d Merge branch 'PHP-7.0.11' into PHP-7.0
* PHP-7.0.11: (22 commits)
  Fix bug #72293 - Heap overflow in mysqlnd related to BIT fields
  I don't think 8cceb012a7 is needed
  Fix test
  Add check in fgetcsv in case sizeof(unit) != sizeof(size_t)
  Fix bug #73065: Out-Of-Bounds Read in php_wddx_push_element of wddx.c
  Fix bug #73035 (Out of bound when verify signature of tar phar in phar_parse_tarfile)
  Fix bug #73052 - Memory Corruption in During Deserialized-object Destruction
  Fix bug #73029 - Missing type check when unserializing SplArray
  Fix bug #72860: wddx_deserialize use-after-free
  Fix bug #73007: add locale length check
  Fix bug #72928 - Out of bound when verify signature of zip phar in phar_parse_zipfile
  sync NEWS
  Revert "Merge branch 'PHP-5.6' into PHP-7.0"
  Merge branch 'PHP-5.6' into PHP-7.0
  Merge branch 'PHP-5.6' into PHP-7.0
  Revert "Revert "Merge branch 'PHP-5.6' into PHP-7.0""
  fix version
  sync NEWS
  Fix bug #72957
  set versions
  ...
2016-09-12 21:09:30 -07:00
Stanislav Malyshev caea2c876b Fix bug #72293 - Heap overflow in mysqlnd related to BIT fields 2016-09-12 21:07:44 -07:00
Stanislav Malyshev 28f80baf3c Fix bug #72293 - Heap overflow in mysqlnd related to BIT fields 2016-09-12 21:04:23 -07:00
Stanislav Malyshev 33d0ef0fef Fix test 2016-09-12 21:04:23 -07:00
Stanislav Malyshev c4cca4c20e Fix bug #73065: Out-Of-Bounds Read in php_wddx_push_element of wddx.c 2016-09-12 21:04:23 -07:00
Stanislav Malyshev f5a9592ad8 Fix bug #73035 (Out of bound when verify signature of tar phar in phar_parse_tarfile) 2016-09-12 21:04:23 -07:00
Stanislav Malyshev 6a7cc8ff85 Fix bug #73052 - Memory Corruption in During Deserialized-object Destruction 2016-09-12 21:04:23 -07:00
Stanislav Malyshev 7381d4c00e Add check in fgetcsv in case sizeof(unit) != sizeof(size_t) 2016-09-12 21:04:23 -07:00
Stanislav Malyshev ecb7f58a06 Fix bug #73029 - Missing type check when unserializing SplArray 2016-09-12 21:04:23 -07:00
Stanislav Malyshev b88393f08a Fix bug #72860: wddx_deserialize use-after-free 2016-09-12 21:04:23 -07:00
Stanislav Malyshev 65c8caafa8 Also fix overflow in wordwrap 2016-09-12 21:04:23 -07:00
Stanislav Malyshev 6d55ba2656 Fix bug #73007: add locale length check 2016-09-12 21:04:23 -07:00
Stanislav Malyshev ba5ac0d360 Add more checks for int overflow 2016-09-12 21:04:23 -07:00
Stanislav Malyshev 223266e4e4 Fix bug #72928 - Out of bound when verify signature of zip phar in phar_parse_zipfile 2016-09-12 21:04:23 -07:00
Stanislav Malyshev 19866fb76c Fix various int size overflows.
Add function for detection of string zvals with length that does not fit
INT_MAX.
2016-09-12 21:04:23 -07:00
Stanislav Malyshev c984661d39 Fix bug #72293 - Heap overflow in mysqlnd related to BIT fields 2016-09-12 20:28:50 -07:00
Stanislav Malyshev 32e0b46997 I don't think 8cceb012a7 is needed 2016-09-12 20:15:22 -07:00
Stanislav Malyshev fab33740c5 Fix test 2016-09-12 20:15:18 -07:00
Xinchen Hui 339a865d87 Update NEWS 2016-09-13 10:59:30 +08:00
Xinchen Hui a339523fe5 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #73067 (__debugInfo crashes when throwing an exception)
2016-09-13 10:59:09 +08:00
Xinchen Hui 2d8ab51576 Fixed bug #73067 (__debugInfo crashes when throwing an exception) 2016-09-13 10:58:57 +08:00
Adam Baratz 76af2def79 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Never quote values as raw binary data
2016-09-12 17:44:33 -04:00
Adam Baratz 2302eef5c9 Never quote values as raw binary data
This reverts a1a18fca6e which was intended to fix
bug #52885. That commit introduced a BC break which wasn't universally
desirable. The issue of quoting binary data (or NVARCHAR strings, or other
nonstandard types) will have to be addressed separately.
2016-09-12 17:32:50 -04:00
Anatol Belski 8cceb012a7 Add check in fgetcsv in case sizeof(unit) != sizeof(size_t)
(cherry picked from commit 99ac11222cb2a4e9aa6a865f908b28def349c049)

Conflicts:
	ext/standard/file.c
2016-09-12 18:59:38 +02:00
Adam Baratz 39f45e208c Add myself as pdo_dblib maintainer 2016-09-12 12:43:39 -04:00
Stanislav Malyshev 9528ce7315 Fix bug #73065: Out-Of-Bounds Read in php_wddx_push_element of wddx.c
(cherry picked from commit bbaf784f8d213e201baf67e861f20b38c6e87d3b)

Conflicts:
	ext/wddx/wddx.c
2016-09-12 18:13:04 +02:00
Stanislav Malyshev c5f34c9eca Fix bug #73035 (Out of bound when verify signature of tar phar in phar_parse_tarfile)
(cherry picked from commit 75ebf471ff46ec6e5ee279b3650c11d51ebaf9e3)
2016-09-12 17:54:32 +02:00
Stanislav Malyshev 27876d22ef Fix bug #73052 - Memory Corruption in During Deserialized-object Destruction
(cherry picked from commit b6e1e5e0b3e6221c7b14fa10cba30f5c5e719e1b)

Conflicts:
	Zend/zend_objects_API.c
	ext/standard/var_unserializer.c
	ext/standard/var_unserializer.re
2016-09-12 17:53:44 +02:00
Stanislav Malyshev 022e75cba1 Fix bug #73029 - Missing type check when unserializing SplArray
(cherry picked from commit 6d16288150be33392a3249e417a0929881feb9a2)

Conflicts:
	ext/spl/spl_array.c
2016-09-12 17:42:23 +02:00
Stanislav Malyshev 060ab26cfe Fix bug #72860: wddx_deserialize use-after-free
(cherry picked from commit ee552853ff4d72f626102025133e2cd1575043ee)

Conflicts:
	ext/wddx/wddx.c
2016-09-12 17:33:32 +02:00
Stanislav Malyshev 92db16e456 Fix bug #73007: add locale length check
(cherry picked from commit 9e07089626f373d0e7b24b7aeb8b8459aae5f5f8)

Conflicts:
	ext/intl/msgformat/msgformat_format.c
2016-09-12 17:19:47 +02:00
Stanislav Malyshev 0bfb970f43 Fix bug #72928 - Out of bound when verify signature of zip phar in phar_parse_zipfile
(cherry picked from commit 19484ab77466f99c78fc0e677f7e03da0584d6a2)
2016-09-12 17:04:19 +02:00
Christoph M. Becker c7adfeb6c6 Merge branch 'PHP-7.0' into PHP-7.1 2016-09-12 13:36:24 +02:00
Christoph M. Becker 82fa85fd08 Merge branch 'PHP-5.6' into PHP-7.0 2016-09-12 13:27:57 +02:00
Christoph M. Becker 0cbf634657 Skip regression test for issue that has not yet been released in libgd
<https://github.com/libgd/libgd/issues/177> has been assessed as enhancement,
so most likely it will be released with GD 2.3.
2016-09-12 13:21:34 +02:00
Christoph M. Becker 6ef0b09948 Merge branch 'PHP-7.0' into PHP-7.1 2016-09-12 12:44:49 +02:00
Christoph M. Becker c2044e60f3 Merge branch 'PHP-5.6' into PHP-7.0 2016-09-12 12:39:14 +02:00
Christoph M. Becker fcdc30b347 Skip test for external GD because of not yet published bugfix 2016-09-12 12:34:11 +02:00
Christoph M. Becker 6c3f90cab9 Merge branch 'PHP-7.0' into PHP-7.1 2016-09-12 00:03:56 +02:00
Christoph M. Becker c02cfd4e25 Merge branch 'PHP-5.6' into PHP-7.0 2016-09-11 23:51:32 +02:00
Christoph M. Becker 6d0e773292 Skip tests for unpatched external libgd regarding libvpx
Some issues have never been fixed in the external libgd's libvpx binding,
so we skip the respective tests.
2016-09-11 23:49:09 +02:00
Andrea Faulds fc5497cb92 Merge branch 'PHP-7.0' into PHP-7.1 2016-09-11 22:46:20 +01:00
Andrea Faulds d690014bf3 Remove zpp fallback code (always use Fast ZPP)
Squashed commit of the following:

commit 3e27fbb3d22b42d181e15c345f1c59a007b6b58c
Author: Andrea Faulds <ajf@ajf.me>
Date:   Sun Sep 11 19:14:37 2016 +0100

    Keep dummy FAST_ZPP macro for compatibility

commit 8a7cfd00deaa4a3c5026c97580c49c886c72a5b4
Author: Andrea Faulds <ajf@ajf.me>
Date:   Mon Sep 5 22:36:03 2016 +0100

    Remove FAST_ZPP macro and plain zpp fallback code
2016-09-11 22:44:46 +01:00
Christoph M. Becker c90f7f66ea Merge branch 'PHP-7.0' into PHP-7.1 2016-09-11 23:03:58 +02:00
Christoph M. Becker 529811cfb0 Merge branch 'PHP-5.6' into PHP-7.0 2016-09-11 19:32:54 +02:00
Christoph M. Becker 6ef987e012 Split test for bundled vs. external libgd
The behavior of imagecropauto($im, IMG_CROP_DEFAULT) is rather different
for the bundled and an external libgd, see
<https://github.com/libgd/libgd/issues/298>.
Therefore we split the test for now.
2016-09-11 19:30:55 +02:00
Christoph M. Becker c911aa9def Merge branch 'PHP-7.0' into PHP-7.1 2016-09-11 18:40:46 +02:00
Christoph M. Becker 225478bccf Merge branch 'PHP-5.6' into PHP-7.0 2016-09-11 18:35:11 +02:00
Christoph M. Becker 38455293f7 Make test case more resilient
This test case fails with external libgd, because libgd < 2.2.4 converts
palette images to truecolor (<https://github.com/libgd/libgd/issues/297>).

However, even if there happens no truecolor conversion, it is not guaranteed
that the palette indexes of the original and the cropped image are identical
(this is, for instance, not the case with current libgd master where the bug
has been fixed). Therefore we check for the expected RGBA value instead of
the palette index.
2016-09-11 18:29:27 +02:00
Christoph M. Becker 29cb3c89e5 Replace md5 image comparision with test_image_equals_file() 2016-09-11 14:56:11 +02:00
Christoph M. Becker b843d65599 Merge branch 'PHP-7.0' into PHP-7.1 2016-09-11 14:05:19 +02:00
Christoph M. Becker cd16b64f01 Merge branch 'PHP-5.6' into PHP-7.0 2016-09-11 13:26:30 +02:00
Anatol Belski c300fdfa36 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  fix bug category
  update NEWS
2016-09-11 13:21:15 +02:00
Anatol Belski 95e4e6a3ce fix bug category 2016-09-11 13:20:25 +02:00
Anatol Belski 1b2007dada sync NEWS 2016-09-11 13:19:17 +02:00
Anatol Belski 0fdf2ffae1 update NEWS 2016-09-11 13:05:07 +02:00
Anatol Belski 65bf5e88c7 Revert "Merge branch 'PHP-5.6' into PHP-7.0"
This reverts commit 946335ba70, reversing
changes made to 3437dbfa00.
2016-09-11 12:59:43 +02:00
Christoph M. Becker 2970630133 Merge branch 'PHP-5.6' into PHP-7.0
(cherry picked from commit f93fd8ce32)
2016-09-11 12:59:43 +02:00
Christoph M. Becker 874697e30a Merge branch 'PHP-5.6' into PHP-7.0
(cherry picked from commit 8f32d609c5)
2016-09-11 12:59:43 +02:00
Anatol Belski d947d974d5 Revert "Revert "Merge branch 'PHP-5.6' into PHP-7.0""
This reverts commit 62d5bfb527.
2016-09-11 12:59:43 +02:00
Christoph M. Becker dc09f30933 A picture is worth a thousand message digests
The bundled GD test suites makes heavy use of md5() to verify the result
of drawing operations. This leads to fragile tests (even a slight change
in a PNG header would cause failure, and of course there is the
possibility of collisions), and even worse, eventual test failures are
rather unrevealing.

Therefore we replace all md5() verification with a simplistic
test_image_equals_file(), which is basically a simplified port of libgd's
gdTestImageCompareToFile(), adapted to the needs of PHPTs.

In the long run better tests helpers should be introduced (see also
<http://news.php.net/php.internals/94081>), but for now this solution
is preferable over the former.

(cherry picked from commit 24f9e96792518ec2a75f26b1eb2471dd7694f2b7)
2016-09-11 12:56:53 +02:00
Christoph M. Becker 625e43caa8 Merge branch 'PHP-7.0' into PHP-7.1 2016-09-11 00:14:49 +02:00
Christoph M. Becker 8753356eb0 Merge branch 'PHP-5.6' into PHP-7.0 2016-09-11 00:09:23 +02:00
Christoph M. Becker 326a4e38fb Add regression test for bug #73053
The test succeeds with libxml < 2.9.4, and is supposed to succeed with
libxml > 2.9.4. Unfortunately, we can't conditionally mark a test case
as XFAIL, so we're simply skipping the test for libxml 2.9.4 instead.
2016-09-11 00:06:45 +02:00
Anatol Belski aa5abe113b update NEWS 2016-09-10 11:04:57 +02:00
Anatol Belski 6e1d8d9c71 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  update NEWS
  update NEWS
2016-09-10 11:04:38 +02:00
Anatol Belski 1ed07676e6 update NEWS 2016-09-10 11:04:00 +02:00
Anatol Belski 1c789dba7b Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  update NEWS
2016-09-10 11:03:39 +02:00
Anatol Belski 6c9d37d059 update NEWS 2016-09-10 11:02:17 +02:00
Anatol Belski 435048935e Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Bug #73058 crypt broken when salt is 'too' long
2016-09-10 02:49:30 +02:00
Anatol Belski e539ea439b Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Bug #73058 crypt broken when salt is 'too' long
2016-09-10 02:44:21 +02:00
Anatol Belski 669fda00b7 Bug #73058 crypt broken when salt is 'too' long 2016-09-10 02:39:28 +02:00
Xinchen Hui a90e438af3 Merge branch 'PHP-7.1' of git.php.net:/php-src into PHP-7.1
* 'PHP-7.1' of git.php.net:/php-src:
  Don't optimize (string) cast on arrays
2016-09-09 22:40:53 +08:00
Xinchen Hui 2a3b75a0eb Fixed function info 2016-09-09 22:40:08 +08:00
Nikita Popov 1d4b831d63 Merge branch 'PHP-7.0' into PHP-7.1 2016-09-09 16:38:42 +02:00
Nikita Popov e3c08de08a Don't optimize (string) cast on arrays
Otherwise we throw a notice during pass1_5 optimization.
2016-09-09 16:38:26 +02:00
Christoph M. Becker 7d80b64ac8 Merge branch 'PHP-7.0' into PHP-7.1 2016-09-09 16:32:27 +02:00
Christoph M. Becker 7a90fc96d8 Merge branch 'PHP-5.6' into PHP-7.0 2016-09-09 16:30:26 +02:00
Christoph M. Becker c42a7f2f3f Remove ignored --FAIL-- section from test case
This is just confusing.
2016-09-09 16:27:50 +02:00
Nikita Popov 766264f8d2 Merge branch 'PHP-7.0' into PHP-7.1 2016-09-09 16:02:59 +02:00
Nikita Popov bbcf77c309 Fix some block_pass bugs 2016-09-09 15:58:36 +02:00
Nikita Popov 30af80610e Compile intval() etc to casts 2016-09-09 15:45:46 +02:00
Nikita Popov b4213f0d0b Add fast paths for bitwise operators 2016-09-09 15:30:41 +02:00
Christoph M. Becker e8e41aa8cd Merge branch 'PHP-7.0' into PHP-7.1 2016-09-09 14:43:16 +02:00
Christoph M. Becker 1a30a7a422 Merge branch 'PHP-5.6' into PHP-7.0 2016-09-09 14:34:11 +02:00
Christoph M. Becker 23e721fc93 Fix #73054: default option ignored when object passed to int filter
If an object that can't be converted to string is validated, we must not
bail out early, but rather check for a requested default value.
2016-09-09 14:30:24 +02:00
Christoph M. Becker e5ff8b2f31 Merge branch 'PHP-7.0' into PHP-7.1 2016-09-09 12:53:35 +02:00
Christoph M. Becker 807c49e6be Merge branch 'PHP-5.6' into PHP-7.0 2016-09-09 12:49:02 +02:00
Levi Morrison cb91a51b00 Partially fix bug #67167 - Wrong return value...
...from FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE

The remainer of the fix would require the filter functions to only
convert to string when it makes sense for that particular filter.

(cherry picked from commit 432dc527ad)
2016-09-09 12:45:46 +02:00
Yasuo Ohgaki 17dbb916fc Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Update NEWS
  Fixed Bug #68015 Session does not report invalid uid for files save handler
2016-09-09 11:39:40 +09:00
Yasuo Ohgaki fb9444e053 Update NEWS 2016-09-09 11:34:34 +09:00
Yasuo Ohgaki 0e3b30fad1 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fixed Bug #68015 Session does not report invalid uid for files save handler
2016-09-09 11:32:20 +09:00
Yasuo Ohgaki 38553e853b Fixed Bug #68015 Session does not report invalid uid for files save handler 2016-09-09 11:31:54 +09:00
Anatol Belski 1cf0a2c9ae Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  backport 59444347 and 3d7343f6
2016-09-08 17:50:46 +02:00
Anatol Belski 4fda0a9479 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  backport 59444347 and 3d7343f6
2016-09-08 17:49:47 +02:00
Anatol Belski b1f33db39f backport 59444347 and 3d7343f6 2016-09-08 17:46:53 +02:00
Yasuo Ohgaki 71ff5cd3c4 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fix bug26639.phpt
2016-09-08 14:10:55 +09:00
Yasuo Ohgaki 963454b93f Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix bug26639.phpt
2016-09-08 14:10:21 +09:00
Yasuo Ohgaki 8c700076d7 Fix bug26639.phpt 2016-09-08 14:07:57 +09:00
Yasuo Ohgaki 2c3bc4eb55 Update NEWS 2016-09-08 13:35:38 +09:00
Yasuo Ohgaki c50ae8fda7 Update NEWS 2016-09-08 13:35:35 +09:00
Yasuo Ohgaki fb1c46f013 Update NEWS 2016-09-08 13:35:30 +09:00
Yasuo Ohgaki 1ecf361c15 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fix Bug #72992 mbstring.internal_encoding doesn't inherit default_charset
2016-09-08 13:32:47 +09:00
Yasuo Ohgaki 379d9a1cfc Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix Bug #72992 mbstring.internal_encoding doesn't inherit default_charset
2016-09-08 13:32:31 +09:00
Yasuo Ohgaki 8bbd0952e5 Fix Bug #72992 mbstring.internal_encoding doesn't inherit default_charset 2016-09-08 13:17:10 +09:00
Dmitry Stogov 6aa07c9083 Fixed type inference bug 2016-09-07 11:36:14 +03:00
Nikita Popov 135f275836 Add ISSET_ISEMPTY_STATIC_PROP to smart branch list 2016-09-06 22:19:34 +02:00
Christoph M. Becker 68d3501381 Merge branch 'pull-request/2115' into PHP-7.1 2016-09-06 14:14:23 +02:00
Nikita Popov 09f7bb2082 Followup for bug #72785
Fix incorrect handling of nesting ... need to reset to the old
value afterwards.
2016-09-06 12:59:35 +02:00
Christoph M. Becker 5d394b3bb4 Merge branch 'PHP-7.0' into PHP-7.1 2016-09-06 12:16:42 +02:00
Christoph M. Becker af3031d755 Merge branch 'PHP-5.6' into PHP-7.0 2016-09-06 12:11:24 +02:00
Christoph M. Becker dad793630d Fix #73025: Heap Buffer Overflow in virtual_popen of zend_virtual_cwd.c
`command_length` is retrieved via strlen() and later passed to emalloc()
and memcpy(), so the appropriate type is `size_t`.

We don't add a regression test, because that would need to allocate a string
of at least 2 GiB.
2016-09-06 12:05:58 +02:00
Yasuo Ohgaki 3a35d43ad9 Update NEWS 2016-09-06 18:29:20 +09:00
Yasuo Ohgaki 0adf9191ad Update NEWS 2016-09-06 18:29:00 +09:00
Yasuo Ohgaki a58e6d4e34 Update NEWS 2016-09-06 18:28:45 +09:00
Yasuo Ohgaki 012232b9a4 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed Bug #66964 mb_convert_variables() cannot detect recursion
2016-09-06 16:42:07 +09:00
Yasuo Ohgaki 6f1a52bfbb Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fixed Bug #66964 mb_convert_variables() cannot detect recursion
2016-09-06 16:41:52 +09:00
Yasuo Ohgaki 608decfd3f Merge branch 'PHP-7.1' of git.php.net:php-src into PHP-7.1
* 'PHP-7.1' of git.php.net:php-src: (53 commits)
  Fix bug #72785 - allowed_classes only applies to outermost unserialize()
  Fix #70752: Depacking with wrong password leaves 0 length files
  Unbreak FAST_ZPP dead code
  Updated NEWS
  Fixes #72590: Opcache restart with kill_all_lockers does not work
  Limit editorconfig to C code
  Updated NEWS
  Updated NEWS
  Updated NEWS
  Fix #72972, Bad filter for the flags FILTER_FLAG_NO_RES_RANGE and FILTER_FLAG_NO_PRIV_RANGE
  Change the name of the second parameter of image writer functions
  Added editorconfig file
  Implement #47456: Missing PCRE option 'J'
  Use integer placeholders, since values can vary with the TDS version
  phpdbg: couple of network function return checks. Possible overflow when copy the socket_path configuration.
  Same issue as #72926 in another place.
  Sync fix for bug #72910 with current upstream
  Fix #72994: mbc_to_code() out of bounds read
  Bump PHP_API_VERSION
  Fix bug #72996
  ...
2016-09-06 16:41:09 +09:00
Yasuo Ohgaki a25f6f89cd Fixed Bug #66964 mb_convert_variables() cannot detect recursion 2016-09-06 16:05:34 +09:00
Stanislav Malyshev 747d21cfd2 Fix bug #72785 - allowed_classes only applies to outermost unserialize() 2016-09-05 19:56:36 -07:00
Christoph M. Becker 1928cdcacb Merge branch 'PHP-7.0' into PHP-7.1 2016-09-06 01:18:22 +02:00
Christoph M. Becker 81ec843d0e Merge branch 'PHP-5.6' into PHP-7.0 2016-09-06 01:15:36 +02:00
Christoph M. Becker 8aad3131a1 Fix #70752: Depacking with wrong password leaves 0 length files
We should not open the output stream before we have tried to open the
archive entry, as failing the latter could leave an empty file behind.
2016-09-06 01:03:46 +02:00
Andrea Faulds cfc83af978 Merge branch 'PHP-7.0' into PHP-7.1 2016-09-05 22:13:20 +01:00
Andrea Faulds 009ee6e503 Unbreak FAST_ZPP dead code 2016-09-05 22:12:26 +01:00
Julien Pauli b86e15849e Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Updated NEWS
  Fixes #72590: Opcache restart with kill_all_lockers does not work
2016-09-05 17:04:15 +02:00
Julien Pauli 4fa52b42c7 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Updated NEWS
  Fixes #72590: Opcache restart with kill_all_lockers does not work
2016-09-05 17:03:51 +02:00
Julien Pauli dd6da58fac Updated NEWS 2016-09-05 17:03:29 +02:00
Keyur 0045d16863 Fixes #72590: Opcache restart with kill_all_lockers does not work
ACCEL_LOG_ERROR is special and causes a zend_bailout() and the code
never gets to call kill() in the next line after the logging. Change
the log level to WARNING.
2016-09-05 16:59:28 +02:00
Nikita Popov a463da7204 Merge branch 'PHP-7.0' into PHP-7.1
[ci skip]
2016-09-05 14:22:45 +02:00
Nikita Popov 1cd0c80acf Merge branch 'PHP-5.6' into PHP-7.0
[ci skip]
2016-09-05 14:22:29 +02:00
Nikita Popov b92cb6b238 Limit editorconfig to C code
PHPT files do not follow this.

[ci skip]
2016-09-05 14:22:13 +02:00
Julien Pauli 5f9fe06555 Updated NEWS 2016-09-05 10:19:21 +02:00
Julien Pauli 51de65c20e Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Updated NEWS
  Updated NEWS
2016-09-05 10:18:57 +02:00
Julien Pauli d185c2f13a Updated NEWS 2016-09-05 10:18:39 +02:00
Julien Pauli 14d754d6fd Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Updated NEWS
2016-09-05 10:18:08 +02:00
Julien Pauli 1abbcc8cc5 Updated NEWS 2016-09-05 10:17:56 +02:00
Julien Pauli 376dcaa39a Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fix #72972, Bad filter for the flags FILTER_FLAG_NO_RES_RANGE and FILTER_FLAG_NO_PRIV_RANGE
2016-09-05 10:13:19 +02:00
Julien Pauli e5047ac2d2 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix #72972, Bad filter for the flags FILTER_FLAG_NO_RES_RANGE and FILTER_FLAG_NO_PRIV_RANGE
2016-09-05 10:12:49 +02:00
Julien Pauli 9834978a8b Fix #72972, Bad filter for the flags FILTER_FLAG_NO_RES_RANGE and FILTER_FLAG_NO_PRIV_RANGE 2016-09-05 10:08:42 +02:00
Christoph M. Becker f203de0748 Change the name of the second parameter of image writer functions
As of PHP 5.4.0 the second parameter of all image writer functions (except
imagexbm) accepts also a stream resource. Therefore the parameter name
`filename` is inappropriate. We change it to `to` according to what it's
already called in _php_image_output_ctx().

We consider the reflection only related BC break acceptable for a minor version.
2016-09-05 00:43:30 -07:00
Stanislav Malyshev 0d4411d7c8 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Added editorconfig file
2016-09-05 00:41:26 -07:00
Stanislav Malyshev 4e0605044a Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Added editorconfig file
2016-09-05 00:41:23 -07:00
Richard Fussenegger 5c38fbe543 Added editorconfig file 2016-09-05 00:40:58 -07:00
Stanislav Malyshev 9650b8e241 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Implement #47456: Missing PCRE option 'J'
2016-09-05 00:39:01 -07:00
Stanislav Malyshev 92db92c620 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Implement #47456: Missing PCRE option 'J'
2016-09-05 00:38:57 -07:00
Christoph M. Becker 39423e425d Implement #47456: Missing PCRE option 'J'
While it is possible to force the same behavior by setting the internal
option (?J), having a dedicated modifier appears to be useful. After all,
J is even listed on the "Pattern Modifiers" man page[1], but the description
referrs to (?J).

[1] <http://php.net/manual/en/reference.pcre.pattern.modifiers.php>
2016-09-05 00:30:48 -07:00
Stanislav Malyshev f57c059b96 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Recognize TDS versions 7.3 and 7.4
2016-09-05 00:29:21 -07:00
Stanislav Malyshev b5f9427ca9 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Recognize TDS versions 7.3 and 7.4
2016-09-05 00:29:18 -07:00
Stanislav Malyshev cee363d609 Merge branch 'pull-request/2061' into PHP-5.6
* pull-request/2061:
  Recognize TDS versions 7.3 and 7.4
2016-09-05 00:29:11 -07:00
Stanislav Malyshev 498e36294e Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Use integer placeholders, since values can vary with the TDS version
2016-09-05 00:19:34 -07:00
Stanislav Malyshev 54f6c8d6df Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Use integer placeholders, since values can vary with the TDS version
2016-09-05 00:19:26 -07:00
Adam Baratz 84d495055d Use integer placeholders, since values can vary with the TDS version 2016-09-05 00:17:59 -07:00
Stanislav Malyshev 8c16f2262f Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  phpdbg: couple of network function return checks. Possible overflow when copy the socket_path configuration.
2016-09-04 23:24:31 -07:00
David Carlier 19350b6b73 phpdbg: couple of network function return checks. Possible
overflow when copy the socket_path configuration.
2016-09-04 23:18:51 -07:00
Stanislav Malyshev defa47b94d Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Same issue as #72926 in another place.
2016-09-04 20:58:09 -07:00
Stanislav Malyshev a2fdf0f413 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Same issue as #72926 in another place.
2016-09-04 20:57:46 -07:00
Stanislav Malyshev b578580e88 Same issue as #72926 in another place. 2016-09-04 20:49:34 -07:00
Stanislav Malyshev 3bfd06061e Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Sync fix for bug #72910 with current upstream
2016-09-04 19:15:45 -07:00
Stanislav Malyshev c3dfe57c23 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Sync fix for bug #72910 with current upstream
2016-09-04 19:15:30 -07:00
Stanislav Malyshev d1fbc98ff6 Sync fix for bug #72910 with current upstream 2016-09-04 19:13:48 -07:00
Christoph M. Becker 94b66b8793 Merge branch 'PHP-7.0' into PHP-7.1 2016-09-04 16:47:55 +02:00
Christoph M. Becker 7f97d63130 Merge branch 'PHP-5.6' into PHP-7.0 2016-09-04 16:39:45 +02:00
Christoph M. Becker b7259b71b4 Fix #72994: mbc_to_code() out of bounds read
We're backporting commit 999a3553 to the still supported PHP 5.6.
2016-09-04 16:37:06 +02:00
Nikita Popov 69f0d3df60 Bump PHP_API_VERSION 2016-09-04 14:27:28 +02:00
Nikita Popov f1bfd7fe00 Merge branch 'PHP-7.0' into PHP-7.1 2016-09-03 23:31:05 +02:00
Nikita Popov 1ae2d074f8 Fix bug #72996 2016-09-03 23:30:23 +02:00
Christoph M. Becker 85824eda36 Merge branch 'PHP-7.0' into PHP-7.1 2016-09-03 20:09:50 +02:00
Christoph M. Becker 8cc9570f53 Merge branch 'PHP-5.6' into PHP-7.0 2016-09-03 19:59:44 +02:00
Christoph M. Becker d582241368 Fix #67325: imagetruecolortopalette: white is duplicated in palette
gdImageTrueColorToPalette() is sometimes wasteful by putting multiple white
color entries into the palette. This is caused by an obvious typo, where
to avoid a division by zero when `total` is zero, `count` is checked instead
of `total`.

We fix this issue to improve the quality of the color quantization.

Cf. <https://github.com/libgd/libgd/commit/24b4550f>
2016-09-03 19:50:42 +02:00
Anatol Belski 1b2a06fe64 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  fix leak and error check order
2016-09-03 17:04:43 +02:00
Anatol Belski c9040d43a8 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix leak and error check order
2016-09-03 17:03:55 +02:00
Anatol Belski 9513187dee fix leak and error check order 2016-09-03 16:59:17 +02:00
Christoph M. Becker 9eeb705eca Merge branch 'PHP-7.0' into PHP-7.1 2016-09-03 13:53:07 +02:00
Christoph M. Becker 0bc7e0c0ce Merge branch 'PHP-5.6' into PHP-7.0 2016-09-03 13:46:03 +02:00
Christoph M. Becker bca913d70a Fix proto comment
While we're at it, we also change a related comment to use American English
consistently.
2016-09-03 13:41:29 +02:00
Christoph M. Becker 727b422ad9 Fix #72948: Uncatchable "Catchable" fatal error for class to string conversions
E_RECOVERABLE errors are reported as "Catchable fatal error". This is
misleading, because they actually can't be caught via try-catch statements.
Therefore we change the wording to "Recoverable fatal error" as suggested by
Nikita.
2016-09-03 13:05:37 +02:00
Christoph M. Becker 5bdf2fa345 Merge branch 'pull-request/2114' into PHP-7.1 2016-09-03 12:00:46 +02:00
Christoph M. Becker b8d26ebb9a Merge branch 'PHP-7.0' into PHP-7.1 2016-09-03 00:40:05 +02:00
Christoph M. Becker f3dc00fdfb Merge branch 'PHP-5.6' into PHP-7.0 2016-09-03 00:30:05 +02:00
Christoph M. Becker c83bdb8e6a Make test case more resilient
When ran from a root directory the test case failed, because the open_basedir
restriction for "../[…]" won't kick in. Therefore we change the current
working directory to the test case's directory, as discussed on internals,
see <http://news.php.net/php.internals/95585>.
2016-09-03 00:24:30 +02:00
Anatol Belski e89c09ba29 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  fix double free
2016-09-03 00:06:16 +02:00
Anatol Belski 7483acf511 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix double free
2016-09-03 00:05:02 +02:00
Anatol Belski 5efd2a33df fix double free 2016-09-03 00:01:04 +02:00
Anatol Belski e4564e4b98 improve fix 2016-09-02 23:33:43 +02:00
Anatol Belski 93bb779433 fix leak 2016-09-02 23:31:26 +02:00
Anatol Belski 0b5faa4461 fix leak 2016-09-02 20:20:37 +02:00
Anatol Belski 596f488e06 Add skipifs to some mb path tests
These were invented primarily to test the multibyte path handling
patch on Windows. How it turns out by PR #2105, some test issues
on some filesystems are possible. Particularly HFS is configurable
to use different ways to save filenames, see
https://developer.apple.com/library/mac/qa/qa1173/_index.html
This makes it impossible to test the filenames byte wise, while
the results are still correct. There are still several other tests
using UTF-8 file names spread over other extensions. So far no
false positives are to see, they don't need to be touched.
2016-09-02 19:46:32 +02:00
Anatol Belski 2c02e93e69 fix leak 2016-09-02 19:46:32 +02:00
Anatol Belski 44e43a4738 fix mem leak 2016-09-02 19:46:32 +02:00
Christoph M. Becker 8f110ee4dc Update to SQLite 3.14.1 2016-09-02 17:58:16 +02:00
Stephan Muggli 9c69d98614 Fix typo in UPGRADING 2016-09-02 15:04:58 +00:00
Julien Pauli e681b8771b Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fix warning about sign-mismatch comparisons
2016-09-02 17:02:25 +02:00
Julien Pauli e14b14d026 Fix warning about sign-mismatch comparisons 2016-09-02 17:01:52 +02:00
Stanislav Malyshev 01f4a52aaa Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fix bug #72910
  5.6.27 will be next
2016-09-01 23:29:17 -07:00
Stanislav Malyshev 2adc335eb5 Merge branch 'PHP-7.1' of git.php.net:php-src into PHP-7.1
* 'PHP-7.1' of git.php.net:php-src: (134 commits)
  fix useless assignment
  avoid needless function call
  remove useless assignment
  remove unused assignment
  rewrite the getcwd part
  fix leak
  fix unused assignment
  remove duplicated symbol
  Revert 	39587c4817 	8b7f594a2b Because of 	24fdffdacb
  add extra test to protected behavior of compact and array string key order
  fix unintentional bc break with compact('this') behavior
  Fix some grammatical errors in PHP 7.1 Upgrade Notes
  Update NEWS
  Fixed bug #72982 (Memory leak in zend_accel_blacklist_update_regexp() function)
  Update NEWS and UPGRADING
  Revert "Revert "Implement RFC Add session_gc() https://wiki.php.net/rfc/session-gc""
  Revert "Revert "Merge RFC https://wiki.php.net/rfc/session-create-id""
  Revert "Revert "Add tests""
  Revert "Fix NEWS"
  Fix bug #72940 properly. Reduce needless branches
  ...
2016-09-01 23:28:56 -07:00
Stanislav Malyshev ccc8d92d3d Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix bug #72910
  5.6.27 will be next
2016-09-01 23:28:44 -07:00
Stanislav Malyshev e576714f6b Fix bug #72910
Merge upstream patch from https://github.com/kkos/oniguruma/commit/65bdf2a0d160d06556415e5f396a75f6b11bad5c
2016-09-01 23:27:06 -07:00
Anatol Belski f1cf26ea4f fix useless assignment 2016-09-01 23:45:31 +02:00
Anatol Belski 1d64b4c71e avoid needless function call 2016-09-01 23:45:31 +02:00
Anatol Belski a989091880 remove useless assignment 2016-09-01 23:45:31 +02:00
Anatol Belski 0382a64fdf remove unused assignment 2016-09-01 23:45:31 +02:00
Anatol Belski ac82a34185 rewrite the getcwd part
Also fixes a possible memory leak. Still not ideal, as seems CWD
longer than MAX_PATH is still not supported. But a heap allocation
is not needed anyway, as MAXPATHLEN value is the maximum supported.
2016-09-01 23:45:31 +02:00
Anatol Belski 7020e6f9ae fix leak 2016-09-01 23:45:31 +02:00
Anatol Belski 0a50cbabf6 fix unused assignment 2016-09-01 23:45:31 +02:00
Anatol Belski cd7853b455 remove duplicated symbol 2016-09-01 23:45:31 +02:00
Ferenc Kovacs fbb81dd755 5.6.27 will be next 2016-09-01 20:27:19 +02:00
Remi Collet 5a9691bf08 Revert
39587c4817
	8b7f594a2b
Because of
	24fdffdacb
2016-09-01 15:21:45 +02:00
Márcio Almada cba560e67f add extra test to protected behavior of compact and array string key order 2016-09-01 13:01:42 +02:00
Márcio Almada 00c2c3a476 fix unintentional bc break with compact('this') behavior 2016-09-01 13:01:38 +02:00
Teoh Han Hui 2c3408f5cb Fix some grammatical errors in PHP 7.1 Upgrade Notes
[skip ci]
2016-09-01 12:58:32 +02:00
Xinchen Hui 06e4a03e01 Update NEWS 2016-09-01 12:11:24 +08:00
Xinchen Hui 5f3a26c741 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #72982 (Memory leak in zend_accel_blacklist_update_regexp() function)
2016-09-01 12:10:54 +08:00
Xinchen Hui 1ee41683dc Fixed bug #72982 (Memory leak in zend_accel_blacklist_update_regexp() function) 2016-09-01 12:10:38 +08:00
Yasuo Ohgaki 4f07f0e93f Update NEWS and UPGRADING 2016-09-01 10:32:34 +09:00
Yasuo Ohgaki a4a2f66e75 Revert "Revert "Implement RFC Add session_gc() https://wiki.php.net/rfc/session-gc""
This reverts commit 355c7e7d1c.
2016-09-01 10:12:26 +09:00
Yasuo Ohgaki b36ae7467e Revert "Revert "Merge RFC https://wiki.php.net/rfc/session-create-id""
This reverts commit 663f1c8fb0.
2016-09-01 10:12:23 +09:00
Yasuo Ohgaki 7505eaf6fa Revert "Revert "Add tests""
This reverts commit 4f11dedc43.
2016-09-01 10:12:19 +09:00
Yasuo Ohgaki 5366df75b4 Revert "Fix NEWS"
This reverts commit abc2271b8d.
2016-09-01 10:12:16 +09:00
Yasuo Ohgaki 90352bb4a2 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fix bug #72940 properly. Reduce needless branches
2016-09-01 07:47:27 +09:00
Yasuo Ohgaki cc797d4fc3 Fix bug #72940 properly. Reduce needless branches 2016-09-01 07:47:13 +09:00
Yasuo Ohgaki 355c7e7d1c Revert "Implement RFC Add session_gc() https://wiki.php.net/rfc/session-gc"
This reverts commit 1cf179e415.
2016-09-01 05:54:55 +09:00
Yasuo Ohgaki 663f1c8fb0 Revert "Merge RFC https://wiki.php.net/rfc/session-create-id"
This reverts commit 7ee9f81c54.
2016-09-01 05:54:30 +09:00
Yasuo Ohgaki 4f11dedc43 Revert "Add tests"
This reverts commit aff4c7d826.
2016-09-01 05:54:19 +09:00
Yasuo Ohgaki abc2271b8d Fix NEWS 2016-09-01 05:53:26 +09:00
Yasuo Ohgaki 80d514d294 Update UPGRADING 2016-09-01 03:24:50 +09:00
Davey Shafik f17d67123f Update NEWS for 7.1.0RC2 2016-08-31 17:01:42 +00:00
Christoph M. Becker 9cc11dbded Merge branch 'PHP-7.0' into PHP-7.1 2016-08-31 16:45:15 +02:00
Christoph M. Becker f93fd8ce32 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-31 16:38:38 +02:00
Christoph M. Becker b2d267d9ee Fix #71882 amendment 2: Negative ftruncate() on php://memory exhausts memory 2016-08-31 16:33:14 +02:00
Christoph M. Becker cb78ea9cc3 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-31 14:55:37 +02:00
Christoph M. Becker 8f32d609c5 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-31 14:53:53 +02:00
Christoph M. Becker 314a9f8553 Fix #71882 amendment: Negative ftruncate() on php://memory exhausts memory
To avoid BC breaks, we do not raise a warning for now.
2016-08-31 14:51:37 +02:00
Christoph M. Becker 56ed966bc6 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-31 14:32:24 +02:00
Yasuo Ohgaki 97f2bb894a Update NEWS 2016-08-31 21:10:57 +09:00
Yasuo Ohgaki e385b05ebe Update NEWS 2016-08-31 21:08:23 +09:00
Yasuo Ohgaki 747b61808b Update NEWS 2016-08-31 21:06:19 +09:00
Yasuo Ohgaki aff4c7d826 Add tests 2016-08-31 21:03:10 +09:00
Yasuo Ohgaki 7ee9f81c54 Merge RFC https://wiki.php.net/rfc/session-create-id 2016-08-31 20:34:20 +09:00
Christoph M. Becker 08a71df612 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-31 13:27:23 +02:00
Christoph M. Becker f215fb874f Fix #71882 amendment: Negative ftruncate() on php://memory exhausts memory
To avoid BC breaks, we do not raise a warning for now.
2016-08-31 13:24:37 +02:00
Anatol Belski aeb7b4094a sync tests 2016-08-31 12:26:51 +02:00
Anatol Belski e446ec14e5 add more defs for resource alloc/dealloc 2016-08-31 12:10:40 +02:00
Anatol Belski 4c8e6a2c95 add yet one define 2016-08-31 12:10:40 +02:00
Davey Shafik 11f0f97160 Update NEWS 2016-08-30 19:47:50 -07:00
Davey Shafik 12ee17d5e0 Implement \ArgumentCountError exception 2016-08-30 19:35:56 -07:00
Anatol Belski ed51f34795 fix version 2016-08-30 18:37:43 +02:00
Nikita Popov 02fb46e17c Merge branch 'PHP-7.0' into PHP-7.1 2016-08-30 18:07:21 +02:00
Nikita Popov 3317287ce1 Fix bug #71711
Also handle another case of bug #71996.
2016-08-30 18:06:18 +02:00
Nikita Popov b218eb916f Merge branch 'PHP-7.0' into PHP-7.1 2016-08-30 17:21:33 +02:00
Nikita Popov 8e487aefaa Fixed bug #71996 2016-08-30 17:20:55 +02:00
Christoph M. Becker ecdef60d00 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-30 15:12:49 +02:00
Christoph M. Becker 972302d2f0 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-30 15:01:12 +02:00
Christoph M. Becker 2f10db36af Fix #66797: mb_substr only takes 32-bit signed integer
`from` and `len` are `long`, but get passed to mbfl_substr() which expects
`int`s. Therefore we clamp the values to avoid the undefined conversion
behavior.
2016-08-30 14:52:47 +02:00
Anatol Belski 3d66d56c1d Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  fix typo
  prepare for next
2016-08-30 14:16:48 +02:00
Anatol Belski 52afd8b744 fix typo 2016-08-30 14:11:47 +02:00
Anatol Belski bc7460260b prepare for next 2016-08-30 14:11:22 +02:00
Nikita Popov c361020f04 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-30 13:45:49 +02:00
Nikita Popov 2c12a5f0a8 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-30 13:44:59 +02:00
Ville Hukkamäki af7828a20f Test case for bug #72771 2016-08-30 13:44:34 +02:00
Anatol Belski 119744fc22 sync NEWS 2016-08-30 13:39:27 +02:00
Nikita Popov 345b96c4a3 Fix bug #72957
(cherry picked from commit bfd4277008)
2016-08-30 13:38:54 +02:00
Nikita Popov d49024c6de Merge branch 'PHP-7.0' into PHP-7.1 2016-08-30 13:06:32 +02:00
Nikita Popov bfd4277008 Fix bug #72957 2016-08-30 13:05:53 +02:00
Nikita Popov 6adb7e0b7a Followup for bug #72971
Property writes did not respect the namespace either. This is an
incomplete fix in that it only handles the case where an existing
child element is modified, not when a new one is created.
2016-08-30 12:53:50 +02:00
Anatol Belski f6d02733fd set versions 2016-08-30 12:11:22 +02:00
Anatol Belski 191ff3d995 sync NEWS 2016-08-30 12:07:51 +02:00
Anatol Belski 62d5bfb527 Revert "Merge branch 'PHP-5.6' into PHP-7.0"
This reverts commit 65f0c163f9, reversing
changes made to 4b45c0a9a7.
2016-08-30 12:06:46 +02:00
Nikita Popov 51a564e505 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-30 10:56:06 +02:00
Nikita Popov 07cc6a6ba2 Fix bug #72971 2016-08-30 10:54:31 +02:00
Yasuo Ohgaki 4a12450de2 Update NEWS 2016-08-30 16:05:49 +09:00
Yasuo Ohgaki f5cd6e5710 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #72940 SID always return "name=ID", even if session cookie exist
2016-08-30 15:58:55 +09:00
Yasuo Ohgaki b5f2f6fbd8 Fixed bug #72940 SID always return "name=ID", even if session cookie exist 2016-08-30 15:58:25 +09:00
Christoph M. Becker 38a7c0e0f7 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-30 02:24:43 +02:00
Christoph M. Becker 65f0c163f9 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-30 02:13:48 +02:00
Christoph M. Becker 207dab585a Fix #71882: Negative ftruncate() on php://memory exhausts memory
We must not pass negative sizes to a size_t parameter.
2016-08-30 02:05:45 +02:00
Christoph M. Becker ec8bbba9c6 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-30 01:18:59 +02:00
Christoph M. Becker 4b45c0a9a7 Merge branch 'pull-request/2043' into PHP-7.0 2016-08-30 01:16:45 +02:00
Anatol Belski 2bfe926eb1 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  fix HANDLE leak
2016-08-29 21:48:50 +02:00
Anatol Belski 1b227de970 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix HANDLE leak
2016-08-29 21:47:54 +02:00
Anatol Belski c7b4cd1a51 fix HANDLE leak 2016-08-29 21:45:39 +02:00
Anatol Belski 6bb5b6e8a3 update NEWS 2016-08-29 21:26:13 +02:00
Anatol Belski 2b9670512b Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  update NEWS
  update NEWS
2016-08-29 21:24:08 +02:00
Anatol Belski 5bcae9d586 update NEWS 2016-08-29 21:23:20 +02:00
Anatol Belski b6b7696114 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  update NEWS
2016-08-29 21:22:43 +02:00
Anatol Belski ae81e8fc32 update NEWS 2016-08-29 21:20:36 +02:00
Anatol Belski c560678c14 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  ensure null termination
2016-08-29 21:15:55 +02:00
Anatol Belski 2004585d03 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  ensure null termination
2016-08-29 21:13:39 +02:00
Anatol Belski d787b0ea13 ensure null termination 2016-08-29 21:03:03 +02:00
Anatol Belski 22a825db85 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #72703 Out of bounds global memory read in BF_crypt triggered by password_verify
2016-08-29 20:34:44 +02:00
Anatol Belski 946335ba70 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fixed bug #72703 Out of bounds global memory read in BF_crypt triggered by password_verify
2016-08-29 20:32:55 +02:00
Anatol Belski 295303b590 Fixed bug #72703 Out of bounds global memory read in BF_crypt triggered by password_verify 2016-08-29 20:25:34 +02:00
Dmitry Stogov 722783c2c6 Merge branch 'PHP-7.1' of git.php.net:php-src into PHP-7.1
* 'PHP-7.1' of git.php.net:php-src:
  fix double free
2016-08-29 20:37:01 +03:00
Dmitry Stogov 94fbcbe172 Allow optional splitting of basic blocks at RECV/RECV_INIT opcodes. 2016-08-29 20:35:17 +03:00
Anatol Belski a349afd26b Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  fix double free
2016-08-29 19:34:19 +02:00
Anatol Belski 3437dbfa00 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix double free
2016-08-29 19:33:22 +02:00
Anatol Belski 1a840b9af0 fix double free 2016-08-29 19:27:47 +02:00
Anatol Belski 5c8aa478da Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  fix double free
2016-08-29 18:57:50 +02:00
Anatol Belski 1d93086937 fix double free 2016-08-29 18:56:25 +02:00
Anatol Belski 3196ea195b add note to UPGRADING.INTERNALS 2016-08-29 18:37:35 +02:00
Anatol Belski 78401a7f01 extend help message 2016-08-29 18:25:00 +02:00
Anatol Belski 78c15e2744 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  fix leak
2016-08-29 18:08:17 +02:00
Anatol Belski ca4eeedd36 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix leak
2016-08-29 18:05:47 +02:00
Anatol Belski e2609a38d9 fix leak 2016-08-29 18:01:21 +02:00
Anatol Belski faccbeb588 fix search path 2016-08-29 17:44:37 +02:00
Anatol Belski 3ab2a58753 support also cppcheck for static analyze 2016-08-29 17:44:37 +02:00
Anatol Belski 201f90a8cc add error check and fix leak 2016-08-29 17:25:46 +02:00
Anatol Belski 7ecfb4b954 fix leak 2016-08-29 17:25:13 +02:00
Jakub Zelenka c4961fa8b6 Bump PHP_JSON_VERSION to 1.5.0 2016-08-29 15:18:00 +01:00
Jakub Zelenka ab65665a0e Merge branch 'json_encode_fail_return' into PHP-7.1 2016-08-29 15:01:00 +01:00
Jakub Zelenka f5b4aae7ac Update NEWS with info about a json_encode fail return 2016-08-29 14:59:44 +01:00
Jakub Zelenka 27acbcf4df Add test for fixed bug #68992 2016-08-29 14:49:40 +01:00
Jakub Zelenka df05dbb3df Fix recursion and protection in the failed JSON encoding 2016-08-29 14:49:40 +01:00
Jakub Zelenka 12a8c3f6e7 Add initial failure checking for json_encode 2016-08-29 14:49:40 +01:00
Anatol Belski 50c5d13d26 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  fix leak
2016-08-29 15:44:13 +02:00
Anatol Belski d80a317c0b fix leak 2016-08-29 15:43:10 +02:00
Anatol Belski a747578497 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  fix possible memory leak
2016-08-29 15:29:52 +02:00
Anatol Belski 1d7ec685c1 fix possible memory leak 2016-08-29 15:28:09 +02:00
Anatol Belski 0e709fe42d Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  fix dealloc mismatch
2016-08-29 13:43:08 +02:00
Anatol Belski eac7f4b670 fix dealloc mismatch 2016-08-29 12:46:23 +02:00
Dmitry Stogov b5bab0fce8 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #72944 (Null pointer deref in zval_delref_p).
2016-08-29 12:07:54 +03:00
Dmitry Stogov b66039db33 Fixed bug #72944 (Null pointer deref in zval_delref_p). 2016-08-29 12:02:50 +03:00
George Wang 0a09eecfcc code cleanup. 2016-08-28 22:31:08 -04:00
George Wang 413bd261ec Merge branch 'PHP-7.0' into PHP-7.1 2016-08-28 22:29:38 -04:00
George Wang ca1eb585ee Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	sapi/litespeed/lsapi_main.c
2016-08-28 22:23:28 -04:00
George Wang c73bcbefbd Added .user.ini support.
Added LSPHPRC support.
update LiteSpeed SAPI version to 6.10 .
2016-08-28 21:49:30 -04:00
Yasuo Ohgaki 1cf179e415 Implement RFC Add session_gc() https://wiki.php.net/rfc/session-gc 2016-08-29 05:57:37 +09:00
Anatol Belski be0958d291 extend help msg 2016-08-28 20:18:11 +02:00
Anatol Belski b415290c92 fix leak 2016-08-28 19:42:41 +02:00
Anatol Belski 48b1cb2f12 extend clang vs compat options 2016-08-28 19:42:41 +02:00
Anatol Belski 378ed99424 fix leak 2016-08-28 19:42:41 +02:00
Anatol Belski 10c2ac8c81 integrate clang analyzer 2016-08-28 19:42:41 +02:00
Xinchen Hui 01701912c7 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #72936 (Zend API's zend_symtable_str_update() asserts key should end with '\0')
2016-08-29 00:10:57 +08:00
Xinchen Hui 986d0f87ec Fixed bug #72936 (Zend API's zend_symtable_str_update() asserts key should end with '\0') 2016-08-29 00:10:31 +08:00
Anatol Belski 92a60a67cf fix leak 2016-08-27 22:28:13 +02:00
Anatol Belski b6440a74c1 add parentheses 2016-08-27 22:26:18 +02:00
Anatol Belski 8a8a441972 fix clang compat 2016-08-27 22:25:02 +02:00
Anatol Belski d58202853d fix leak 2016-08-27 22:24:24 +02:00
Christoph M. Becker 3a78530b8a Merge branch 'PHP-7.0' into PHP-7.1 2016-08-27 01:23:36 +02:00
Christoph M. Becker 8fcfacf746 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-27 01:18:10 +02:00
Christoph M. Becker 2139918ea6 Fix #65550: get_browser() incorrectly parsers entries with "+" sign
+ signs in the browscap patterns are meant to be literal characters, so we
have to escape them for the regex matching.
2016-08-27 01:12:01 +02:00
Anatol Belski 88f6706656 fix leak 2016-08-26 22:05:06 +02:00
Christoph M. Becker 14cd14ddaf Merge branch 'PHP-7.0' into PHP-7.1 2016-08-26 18:52:06 +02:00
Christoph M. Becker c4c3eb55a7 Fix #72949: Typo in opcache error message 2016-08-26 18:50:30 +02:00
Xinchen Hui 557f1ccf0c Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #72943 (assign_dim on string doesn't reset hval)

Conflicts:
	Zend/zend_execute.c
2016-08-26 18:32:54 +08:00
Xinchen Hui c67fa3c91d Fixed bug #72943 (assign_dim on string doesn't reset hval) 2016-08-26 18:30:08 +08:00
Anatol Belski 726e3b8ff0 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  update NEWS
  pdo_dblib: stringify uniqidentifier field
2016-08-25 19:46:01 +02:00
Anatol Belski 9f6d2c05b4 update NEWS 2016-08-25 19:44:55 +02:00
Anatol Belski 57509fb969 update NEWS 2016-08-25 19:43:39 +02:00
Alexander Zhuravlev a000bff2c3 pdo_dblib: stringify uniqidentifier field
Keep old 5.6 behavior: return Uniqidentifier value as 36-byte hex string (not binary),
when PDO::ATTR_STRINGIFY_FETCHES is TRUE

pdo_dblib: Stringify uniqidentifier field

Keep old 5.6 behavior: return Uniqidentifier value as 36-byte hex string (not binary),
when PDO::ATTR_STRINGIFY_FETCHES is TRUE

Tests added.

pdo_dblib: Stringify uniqidentifier field

Keep old 5.6 behavior: return Uniqidentifier value as 36-byte hex string (not binary),
when PDO::ATTR_STRINGIFY_FETCHES is TRUE

Tests fix.

pdo_dblib: Stringify uniqueidentifier field Added separate PDO::DBLIB_ATTR_STRINGIFY_UNIQUEIDENTIFIER attribute instead of PDO::ATTR_STRINGIFY_FETCHES.

pdo_dblib: Stringify uniqueidentifier field Added `getAttribute` support for PDO::DBLIB_ATTR_STRINGIFY_UNIQUEIDENTIFIER.

Simplify storage of stringify_uniqueidentifier attribute
2016-08-25 19:37:21 +02:00
Christoph M. Becker 3f53814ca7 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-25 18:41:45 +02:00
Christoph M. Becker 433976f931 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-25 18:29:23 +02:00
Christoph M. Becker 84512a1177 Fix #70825: Cannot fetch multiple values with group in ini file
If we have the position already from the last fetch, we also have to preset
the current group, because it won't be read again.
2016-08-25 18:18:10 +02:00
Anatol Belski 9f0f7c0336 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  fix check for args by ref
2016-08-25 18:09:37 +02:00
Anatol Belski 51d19c12a5 fix check for args by ref 2016-08-25 18:06:47 +02:00
Christoph M. Becker 96ea8de591 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-25 16:31:03 +02:00
Christoph M. Becker 5f6a1d1472 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-25 16:22:57 +02:00
Christoph M. Becker bd8112afe0 Fix #71514: Bad dba_replace condition because of wrong API usage
We're backporting commit 9e309a2d to PHP-5.6, because it is a bugfix.
2016-08-25 16:20:30 +02:00
Anatol Belski 2e1bb5ee22 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  backport relevant part from bug #72858 patch in 7.0
2016-08-25 12:53:37 +02:00
Anatol Belski d3058a69d8 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  backport relevant part from bug #72858 patch in 7.0
2016-08-25 12:52:29 +02:00
Anatol Belski a1ff39ffe5 backport relevant part from bug #72858 patch in 7.0 2016-08-25 12:46:28 +02:00
Anatol Belski cd5cab6288 update NEWS 2016-08-25 12:14:33 +02:00
Anatol Belski fe4fa1fadf Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #72922 COM called from PHP does not return out parameters
2016-08-25 12:13:55 +02:00
Anatol Belski 392c5ea472 Fixed bug #72922 COM called from PHP does not return out parameters 2016-08-25 12:12:45 +02:00
Xinchen Hui 38f7d595c0 Remove redundant \t 2016-08-25 13:29:22 +08:00
Levi Morrison f4e68a3968 Revert "Do not prepend ? on nullables in ReflectionType::__toString()"
This reverts commit 8855a2ce76.
2016-08-23 09:43:31 -06:00
Dmitry Stogov 129e8dadf4 op_arrays may be optimized independetly and "script" might be NULL 2016-08-23 13:17:53 +03:00
Dmitry Stogov 76707dc204 Don't keep dangling pointers. 2016-08-23 12:58:46 +03:00
Dmitry Stogov 62ab40bc96 Added tests and NEWS entry
Fixed bug #72598 (Reference is lost after array_slice())
2016-08-23 12:14:31 +03:00
Dmitry Stogov 0cc8ff2b41 Run ext/opcache/tests/*.phpt by default 2016-08-23 11:51:08 +03:00
Nikita Popov 906456c410 call_user_func(_array): Don't abort on reference warning
Change zend_call_function() to not abort the call if a non-reference
is passed to a reference argument. The usual warning will still be
thrown, but the call will proceed as usual.
2016-08-23 10:29:15 +03:00
Xinchen Hui 26d74a0420 Fixed tests 2016-08-23 11:32:21 +08:00
Xinchen Hui 434ae90e85 Fixed bug #72920 (Accessing a private constant using constant() creates an exception AND warning) 2016-08-22 23:44:38 +08:00
Dmitry Stogov caf890b291 Fixed CFG construction for stackless execution (split basic blocks after calls) 2016-08-22 16:48:26 +03:00
Yasuo Ohgaki 7d703a0060 Adjust test so that it passes on more restrictive filesystems 2016-08-22 17:01:07 +09:00
Jakub Zelenka 21c72827c7 Do not expect error 0407006A in openssl_private_(en|de)crypt
It makes the test work with OpenSSL 1.1
2016-08-21 20:29:03 +01:00
Christoph M. Becker 5347246f56 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-21 19:55:09 +02:00
Christoph M. Becker 4c13a7f5c4 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-21 19:48:38 +02:00
Christoph M. Becker 6a232c3604 Fix #68716: possible resource leaks in _php_image_convert()
We properly clean up after ourselves wrt. to closing opened file pointers
and created images.
2016-08-21 19:39:58 +02:00
Anatol Belski 096b0a556c extend readdir utf-8 name test 2016-08-21 18:21:49 +02:00
Christoph M. Becker 3dc6c4b329 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-21 17:51:53 +02:00
Christoph M. Becker 4c68fc5392 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-21 17:45:49 +02:00
Christoph M. Becker d65adac2be Fix #72913: imagecopy() loses single-color transparency on palette images
The proper code to handle true-color to palette copies is already contained
in gdImageCopy(), so we can simply remove the buggy duplicated code.
2016-08-21 17:39:23 +02:00
Christoph M. Becker 15f1b04198 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-21 16:21:13 +02:00
Christoph M. Becker 7a36056d6c Merge branch 'PHP-5.6' into PHP-7.0 2016-08-21 16:15:22 +02:00
Christoph M. Becker 9eb5bbd8bd Fix #66005: imagecopy does not support 1bit transparency on truecolor images
We must not copy transparent pixels, see
<https://github.com/libgd/libgd/commit/daac285c>.
2016-08-21 16:08:57 +02:00
Xinchen Hui e849e65d89 This is unecessary for 7.1 (IS_ERROR is an internal type) 2016-08-21 17:40:10 +08:00
Xinchen Hui e572035ecf Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug  #72911 (Memleak in zend_binary_assign_op_obj_helper)
  Fixed bug #72907 (null pointer deref, segfault in gc_remove_zval_from_buffer (zend_gc.c:260))
2016-08-21 17:39:52 +08:00
Xinchen Hui 0476bb1de5 Fixed bug #72911 (Memleak in zend_binary_assign_op_obj_helper) 2016-08-21 17:38:03 +08:00
Xinchen Hui 17e8a3df13 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fixed bug #72907 (null pointer deref, segfault in gc_remove_zval_from_buffer (zend_gc.c:260))
2016-08-21 17:19:36 +08:00
Xinchen Hui 226e21b0fe Merge branch 'PHP-5.6' of git.php.net:/php-src into PHP-5.6
* 'PHP-5.6' of git.php.net:/php-src:
  Improvements to fix #72714, suggested by nikic
  Fix #65732: grapheme_*() is not Unicode compliant on CR LF sequence
  Fix #72714: _xml_startElementHandler() segmentation fault
  update NEWS
  Fixed bug #72852 imap_mail null dereference
  Revert "Fix dba configuration for Windows"
  Fix dba configuration for Windows
  Fix broken test include
  fix NEWS
  Add myself as PDO_OCI maintainer
2016-08-21 17:19:24 +08:00
Xinchen Hui b740bb3987 Fixed bug #72907 (null pointer deref, segfault in gc_remove_zval_from_buffer (zend_gc.c:260)) 2016-08-21 17:10:10 +08:00
Aaron Piotrowski 8855a2ce76 Do not prepend ? on nullables in ReflectionType::__toString()
Better BC with 7.0.
2016-08-21 00:12:47 -05:00
Aaron Piotrowski 08c5d77027 Revert "Fix closure tests using ReflectionType::__toString()"
This reverts commit 6fcedc96fb.
2016-08-20 23:26:01 -05:00
Aaron Piotrowski c9ee0cb202 Revert "Append \ to class name returned from ReflectionType::__toString()"
This reverts commit 20fdd47921.
2016-08-20 23:26:01 -05:00
Anatol Belski 872028de20 fix TS issues with url rewrite globals 2016-08-20 22:41:06 +02:00
Nikita Popov dfed09afca Fix off-by-one in ReflectionType::__toString()
Review mistake...
2016-08-20 19:00:03 +02:00
Christoph M. Becker 9988863d37 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-20 12:50:48 +02:00
Christoph M. Becker 39172d44d8 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-20 12:46:08 +02:00
Christoph M. Becker 52793c14d9 Improvements to fix #72714, suggested by nikic 2016-08-20 12:44:20 +02:00
Christoph M. Becker 29849e5ba1 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-20 03:11:05 +02:00
Christoph M. Becker 078f674212 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-20 03:04:08 +02:00
Christoph M. Becker e4a006cd3e Fix #65732: grapheme_*() is not Unicode compliant on CR LF sequence
According to the Unicode specification (at least as of 5.1), CRLF sequences
are considered to be a single grapheme. We cater to that special case by
letting grapheme_ascii_check() fail. While it would be trivial to fix
grapheme_ascii_check() wrt. grapheme_strlen(), grapheme_substr() and
grapheme_strrpos() would be much harder to handle, so we accept the slight
performance penalty if CRLF is involved.
2016-08-20 03:01:35 +02:00
Christoph M. Becker 76c796fb27 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-20 02:28:18 +02:00
Christoph M. Becker db1ef5cb00 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-20 02:14:49 +02:00
Christoph M. Becker 9164dc11e2 Fix #72714: _xml_startElementHandler() segmentation fault
The issue is caused by an integer overflow when the `long` passed as
XML_OPTION_SKIP_TAGSTART is assigned to `xml_parser::toffset` which is
declared as `int`. We can simply work around this issue, by clipping
resulting negative values to 0 (and raising a notice in this case), because
the reasonable range for this value is certainly catered to by positive
`int`s.

However, there still remains the issue that `xml_parser::toffset` is later
added to `char *`s, which can cause OOB reads, so we make sure that the
upper bound never exceeds the strlen(). We eschew optimizing `SKIP_TAGSTART`
wrt. to the potentially duplicate strlen() call, because that code path is
unexpected anyway.
2016-08-20 01:58:08 +02:00
Anatol Belski 98a155f336 update NEWS 2016-08-20 01:38:56 +02:00
Anatol Belski f613582898 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  update NEWS
  update NEWS
  Fixed bug #72852 imap_mail null dereference
2016-08-20 01:38:30 +02:00
Anatol Belski a556543a3f update NEWS 2016-08-20 01:38:01 +02:00
Anatol Belski a569b8816b Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  update NEWS
  Fixed bug #72852 imap_mail null dereference
2016-08-20 01:37:26 +02:00
Anatol Belski f682193609 update NEWS 2016-08-20 01:36:37 +02:00
Anatol Belski 21f08a7488 Fixed bug #72852 imap_mail null dereference 2016-08-20 01:34:46 +02:00
Stanislav Malyshev 52cef90fde Revert "Fix closure tests using ReflectionType::__toString()"
This reverts commit 6fcedc96fb.
2016-08-19 11:37:02 -07:00
Stanislav Malyshev 6e6e81c402 Revert "Append \ to class name returned from ReflectionType::__toString()"
This reverts commit 20fdd47921.
2016-08-19 11:36:49 -07:00
Christoph M. Becker ae92977191 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-19 16:39:56 +02:00
Christoph M. Becker 61344c6d66 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-19 16:38:53 +02:00
Christoph M. Becker 057278b759 Revert "Fix dba configuration for Windows"
This reverts commit ad76e8a529.

After a discussion with Anatol it seems to be better QA wise to not make
this change in stable versions or betas.
2016-08-19 16:35:31 +02:00
Anatol Belski 83255b1e8c Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Improve fix for bug #72837
2016-08-19 12:52:13 +02:00
Anatol Belski 2d123a916d Improve fix for bug #72837 2016-08-19 12:50:32 +02:00
Christoph M. Becker 9fcee1e656 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-19 11:49:07 +02:00
Christoph M. Becker 4df85466b6 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-19 11:47:42 +02:00
Christoph M. Becker ad76e8a529 Fix dba configuration for Windows
To be able to build the dba extension on Windows, libdb was required. This
is contrary to *nix where each handler can be configured individually. To
avoid BC breaks, we only do minimal modifications, instead of adjusting the
Windows configuration to match the *nix configuration, for now.
2016-08-19 11:42:16 +02:00
Davey Shafik 0880bd1bb6 Update NEWS for 7.1.0RC1 2016-08-19 06:51:53 +00:00
Xinchen Hui 566d65d222 Fixed bug #72888 (Segfault on clone on splFileObject) 2016-08-19 11:28:36 +08:00
Davey Shafik 0b1c8178ab Sync NEWS 2016-08-19 09:00:34 +10:00
Nikita Popov 37b0dcc8e0 Decouple DEBUG_FILE_UPLOAD from ZEND_DEBUG
Enabling ZEND_DEBUG should not result in intrusive program
behavior changes.
2016-08-19 00:34:13 +02:00
Christoph M. Becker cf40f999ba Merge branch 'PHP-7.0' into PHP-7.1 2016-08-18 18:03:15 +02:00
Christoph M. Becker caf0ad403d Merge branch 'PHP-5.6' into PHP-7.0 2016-08-18 17:56:16 +02:00
Christoph M. Becker bc1214f25e Fix broken test include
To avoid that the test stalls, we must always use `t` mode.
2016-08-18 17:53:57 +02:00
Anatol Belski 2a1d35ec6c update NEWS 2016-08-18 17:53:08 +02:00
Anatol Belski b4b8d0887a Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  update NEWS
2016-08-18 17:51:18 +02:00
Anatol Belski e6d3221766 update NEWS 2016-08-18 17:50:17 +02:00
Anatol Belski 74cfb2284e fix format 2016-08-18 16:29:46 +02:00
Anatol Belski 2f430a4b6c Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  avoid other efforts if memory mapping fails
2016-08-18 16:01:23 +02:00
Anatol Belski 98d8794eae avoid other efforts if memory mapping fails 2016-08-18 15:58:33 +02:00
Julien Pauli 5818b09a45 Updated UPGRADING about function call args 2016-08-18 15:46:02 +02:00
Anatol Belski ecdd24f0fc Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  fix test
2016-08-18 15:36:07 +02:00
Anatol Belski 91cd55e32a fix test 2016-08-18 15:35:26 +02:00
Anatol Belski 20aae1caa3 map ell the err code 2016-08-18 15:28:15 +02:00
Anatol Belski b81a073b85 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #72858 shm_attach null dereference
2016-08-18 14:40:20 +02:00
Anatol Belski 67f8c14c29 Fixed bug #72858 shm_attach null dereference 2016-08-18 14:15:10 +02:00
Ferenc Kovacs a2ee13b5ea Merge branch 'PHP-7.0' into PHP-7.1 2016-08-18 13:04:43 +02:00
Ferenc Kovacs 7ecd4bb0a4 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-18 13:03:14 +02:00
Ferenc Kovacs 761d2f629b fix NEWS 2016-08-18 13:01:53 +02:00
Xinchen Hui 1eb4851fa2 Remove leftover of previous change 2016-08-18 15:44:33 +08:00
Xinchen Hui 66a527b8c1 Fixed segfault introduced in 447e57a1e1 2016-08-18 15:37:39 +08:00
Xinchen Hui a3740dadec Remove outdate checks 2016-08-18 15:37:15 +08:00
Christopher Jones 1685282a15 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-18 15:47:47 +10:00
Christopher Jones 127b42f9b3 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-18 15:47:36 +10:00
Christopher Jones f2d5305097 Add myself as PDO_OCI maintainer 2016-08-18 15:47:25 +10:00
Christopher Jones cb34882e61 Prepare for OCI8 PECL release 2016-08-18 13:58:24 +10:00
Christopher Jones fe3e330c2e Merge branch 'PHP-7.0' into PHP-7.1 2016-08-18 13:52:56 +10:00
Christopher Jones 7ed2602af8 Prepare for OCI8 PECL release 2016-08-18 13:52:50 +10:00
Christopher Jones b12ac316eb Prepare for OCI8 PECL release 2016-08-18 13:50:36 +10:00
Anatol Belski 2103e9f21f fix test
The improvements to the base64 functionality allows now to loosen
strictness. Strict mode still can be activated later, if there are
any issues.
2016-08-18 00:18:26 +02:00
Anatol Belski fc1b69888e Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  sync NEWS
2016-08-18 00:16:50 +02:00
Anatol Belski 52787e902f sync NEWS 2016-08-18 00:15:54 +02:00
Christoph M. Becker 38f2c6262f Merge branch 'PHP-7.0' into PHP-7.1 2016-08-17 22:13:57 +02:00
Christoph M. Becker 9fa0009702 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-17 22:12:01 +02:00
Christoph M. Becker 54293d21cb Skip tests that are supposed to fail due to bugs in old external libgd 2016-08-17 21:36:26 +02:00
Kalle Sommer Nielsen d85fd07923 Merge branch 'PHP-7.1' of git.php.net:php-src into PHP-7.1 2016-08-17 20:27:46 +02:00
Kalle Sommer Nielsen 447e57a1e1 Fixed 7.1 build, decls first please! 2016-08-17 20:26:32 +02:00
Christoph M. Becker 09898f91a3 Make this test also a little more resilient
See <http://git.php.net/?p=php-src.git;a=commit;h=a3159d29bb24d5c946c14b7aa33e96bebcd56e59>.
2016-08-17 19:09:31 +02:00
Christoph M. Becker 7f47dcf31b Merge branch 'PHP-7.0' into PHP-7.1 2016-08-17 18:25:45 +02:00
Christoph M. Becker 1bc9ea4f10 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-17 18:13:41 +02:00
Christoph M. Becker a3159d29bb Make tests a little more resilient
PNG allows identical images to be stored differently what makes nearly all
tests checking the MD5 hash of the PNG representation fail with external
libgd. For now, we use the GD format instead, which doesn't allow for such
differences.

Of course, this md5() checking should be replaced by a image diffing feature
in the long run.
2016-08-17 17:59:33 +02:00
Kalle Sommer Nielsen 1e4cae28b2 Seems like I did a bad merge earlier, this should make PHP-7.0 sync with 7.1/master properly now 2016-08-17 16:34:22 +02:00
Kalle Sommer Nielsen 27ceb6ffb5 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fix build as done in master in commit 040331c364
  Fixed C89 build
2016-08-17 14:15:09 +02:00
Kalle Sommer Nielsen 9b783107e5 Fix build as done in master in commit 040331c364
The reason why we cannot use round() here, is that it does not come with the standard C library on Windows, I don't think this affects other systems.

At the same time, also expose _php_math_round()
2016-08-17 14:10:24 +02:00
Kalle Sommer Nielsen 8a1fbdda43 Fixed C89 build 2016-08-17 13:43:50 +02:00
Anatol Belski f7231acadf Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  fix char * vs zend_string *
2016-08-17 13:23:31 +02:00
Anatol Belski 06c0540b90 fix char * vs zend_string * 2016-08-17 13:22:02 +02:00
Christoph M. Becker f7d4733b2e Merge branch 'PHP-7.0' into PHP-7.1 2016-08-17 12:49:00 +02:00
Christoph M. Becker 356b586ec1 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-17 12:47:06 +02:00
Christoph M. Becker 48198e4c25 Fix #68302: impossible to compile php with zip support
We should not let configure succeed, if SIZEOF_OFF_T == 0, just to let the
compilation fail later. Instead we bail out early, giving a hint regarding
the potential issue, namely misconfigured libraries.
2016-08-17 12:43:29 +02:00
Anatol Belski 526e6bf818 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  fix tests
2016-08-17 12:41:38 +02:00
Anatol Belski 05c8a0771d fix tests
The 70436 test is just a bonus for the hardening in 72633.
2016-08-17 12:39:35 +02:00
Xinchen Hui 0fd0328933 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Avoid duplicating string
2016-08-17 18:19:59 +08:00
Xinchen Hui 195d7618e7 Avoid duplicating string 2016-08-17 18:19:14 +08:00
Anatol Belski afa832b5a6 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Revert "fix tests"
2016-08-17 12:07:39 +02:00
Anatol Belski 7d4c5a0dc9 Revert "fix tests"
This reverts commit a47df5be19.

Looks like some environment issue, as some system throws the notice,
some don't. Revert for now.
2016-08-17 12:04:03 +02:00
Anatol Belski 60f1ec1c32 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  fix leak
2016-08-17 11:53:00 +02:00
Anatol Belski a5d00fc908 fix leak 2016-08-17 11:51:56 +02:00
Xinchen Hui 30e751fe5b Update NEWs 2016-08-17 17:14:53 +08:00
Xinchen Hui ce6ad9bdd9 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0: (48 commits)
  Update NEWs
  Unused label
  Fixed bug #72853 (stream_set_blocking doesn't work)
  fix test
  Bug #72663 - part 3
  Bug #72663 - part 2
  Bug #72663 - part 1
  Update NEWS
  BLock test with memory leak
  fix tests
  Fix TSRM build
  Fix bug #72850 - integer overflow in uuencode
  Fixed bug #72849 - integer overflow in urlencode
  Fix bug #72848 - integer overflow in quoted_printable_encode caused heap corruption
  Fix bug #72838 - 	Integer overflow lead to heap corruption in sql_regcase
  Fix bug #72837 - integer overflow in bzdecompress caused heap corruption
  Fix bug #72836 - integer overflow in base64_decode caused heap corruption
  Fix for bug #72807 - do not produce strings with negative length
  Fix for bug #72790 and bug #72799
  Fix bug #72730 - imagegammacorrect allows arbitrary write access
  ...

Conflicts:
	ext/standard/var_unserializer.c
2016-08-17 17:14:30 +08:00
Xinchen Hui 1dab8e07f2 Update NEWs 2016-08-17 16:56:58 +08:00
Xinchen Hui b172f43caa Unused label 2016-08-17 16:56:20 +08:00
Xinchen Hui 3956deb1b2 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fixed bug #72853 (stream_set_blocking doesn't work)

Conflicts:
	main/streams/plain_wrapper.c
2016-08-17 16:56:02 +08:00
Xinchen Hui abe00908af Fixed bug #72853 (stream_set_blocking doesn't work)
Implemented  PHP_STREAM_OPTION_META_DATA_API for plain_wrappers
2016-08-17 16:54:21 +08:00
Stanislav Malyshev ed9d916c28 fix test 2016-08-17 01:12:33 -07:00
Nikita Popov e0f9fbdfa6 Bug #72663 - part 3
When using the php_serialize session serialization handler, do
not use the result of the unserialization if it failed.
2016-08-17 01:01:03 -07:00
Nikita Popov 61f2f5a0f7 Bug #72663 - part 2
If a (nested) unserialize() call fails, we remove all the values
that were inserted into var_hash during that call. This prevents
their use in other unserializations in the same context.
2016-08-17 00:47:02 -07:00
Nikita Popov 2135fdef9b Bug #72663 - part 1
Don't call __destruct() on an unserialized object that has a
__wakeup() method if either
a) unserialization of its properties fails or
b) the __wakeup() call fails (e.g. by throwing).

This basically treats __wakeup() as a form of constructor and
aligns us with the usual behavior that if the constructor call
fails the destructor should not be called.

The security aspect here is that people use __wakeup() to prevent
unserialization of objects with dangerous __destruct() methods,
but this is ineffective if __destruct() can still be called while
__wakeup() was skipped.
2016-08-17 00:45:57 -07:00
Stanislav Malyshev 0d13325b66 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6: (24 commits)
  Update NEWS
  BLock test with memory leak
  fix tests
  Fix TSRM build
  Fix bug #72850 - integer overflow in uuencode
  Fixed bug #72849 - integer overflow in urlencode
  Fix bug #72848 - integer overflow in quoted_printable_encode caused heap corruption
  Fix bug #72838 - 	Integer overflow lead to heap corruption in sql_regcase
  Fix bug #72837 - integer overflow in bzdecompress caused heap corruption
  Fix bug #72836 - integer overflow in base64_decode caused heap corruption
  Fix for bug #72807 - do not produce strings with negative length
  Fix for bug #72790 and bug #72799
  Fix bug #72730 - imagegammacorrect allows arbitrary write access
  Fix bug#72697 - select_colors write out-of-bounds
  Fixed bug #72627: Memory Leakage In exif_process_IFD_in_TIFF
  Fix bug #72750: wddx_deserialize null dereference
  Fix bug #72771: ftps:// opendir wrapper is vulnerable to protocol downgrade attack
  Improve fix for #72663
  Fix bug #70436: Use After Free Vulnerability in unserialize()
  Fix bug #72749: wddx_deserialize allows illegal memory access
  ...

Conflicts:
	Zend/zend_API.h
	ext/bz2/bz2.c
	ext/curl/interface.c
	ext/ereg/ereg.c
	ext/exif/exif.c
	ext/gd/gd.c
	ext/gd/tests/imagetruecolortopalette_error3.phpt
	ext/gd/tests/imagetruecolortopalette_error4.phpt
	ext/session/session.c
	ext/snmp/snmp.c
	ext/standard/base64.c
	ext/standard/ftp_fopen_wrapper.c
	ext/standard/quot_print.c
	ext/standard/url.c
	ext/standard/uuencode.c
	ext/standard/var.c
	ext/standard/var_unserializer.c
	ext/standard/var_unserializer.re
	ext/wddx/tests/bug72790.phpt
	ext/wddx/tests/bug72799.phpt
	ext/wddx/wddx.c
	sapi/cli/generate_mime_type_map.php
2016-08-17 00:43:33 -07:00
Stanislav Malyshev 75d7666968 Merge branch 'PHP-7.0.10' into PHP-7.0
* PHP-7.0.10:
  Fix bug #72749: wddx_deserialize allows illegal memory access
  Fixed bug #72627: Memory Leakage In exif_process_IFD_in_TIFF
  fix tests
  Fix bug#72697 - select_colors write out-of-bounds
  Fix bug #72708 - php_snmp_parse_oid integer overflow in memory allocation
  Fix bug #72730 - imagegammacorrect allows arbitrary write access
  Fix bug #72750: wddx_deserialize null dereference
  Fix bug #72771: ftps:// opendir wrapper is vulnerable to protocol downgrade attack
  fix tests
  add missing skipif section
  Fix for bug #72790 and bug #72799
  Fix bug #72837 - integer overflow in bzdecompress caused heap corruption
  Fix bug #72742 - memory allocator fails to realloc small block to large one
  Use size_t for path length
  Check for string overflow
  Fix for bug #72782: mcrypt accepts only ints, so don't pass anything else
  Fix bug #72674 - check both curl_escape and curl_unescape
2016-08-16 23:52:22 -07:00
Stanislav Malyshev f8a75d4eee Merge branch 'PHP-7.0' into PHP-7.0.10
* PHP-7.0: (34 commits)
  Fix URL rewriter partially
  Support "git worktree"
  Add NEWS
  Fix ASSERT logic
  Bugfix 72791: fix memory leak in PDO persistent connections
  Don't copy mime types in CLI server
  Remove obsolete Id tags
  Bump version in OCI8 test
  Fixed bug #72788 (Invalid memory access when using persistent PDO connection)
  Remove typo'd commit
  Fix bug 72788: Invalid memory access when database_object_handle is undefined. Also fix memory leak in dbh_free when using persistent PDO connections.
  Replace dead branch with ZEND_ASSERT()
  Add test for bug #69107: finfo no longer detects PHP files
  Fix bug #55451
  Fix stream_socket_enable_crypto() test
  Remove old $Id$ tags
  Sync with 7.1 branch changes from Nikita & Dimitri to keep OCI8 code identical
  Fix bug #72524 (Binding null values triggers ORA-24816 error)
  Fix the fix (Nikita), thanks!
  Check the return value of dbconvert() in mssql_guid_string(), as it may return -1 in case the conversion failed. In that case false is returned.
  ...

Conflicts:
	ext/standard/ftp_fopen_wrapper.c
2016-08-16 23:50:42 -07:00
Stanislav Malyshev 9e00ad2b09 Update NEWS 2016-08-16 23:44:59 -07:00
Stanislav Malyshev 4bf5c3187f BLock test with memory leak 2016-08-16 22:55:44 -07:00
Stanislav Malyshev d8b2de164e fix tests 2016-08-16 22:55:43 -07:00
Stanislav Malyshev 40bd921cea Fix TSRM build 2016-08-16 22:55:43 -07:00
Stanislav Malyshev 35a8ed2f62 Fix bug #72850 - integer overflow in uuencode 2016-08-16 22:55:43 -07:00
Stanislav Malyshev b9e81e5844 Fixed bug #72849 - integer overflow in urlencode 2016-08-16 22:55:42 -07:00
Stanislav Malyshev 24d741d376 Fix bug #72848 - integer overflow in quoted_printable_encode caused heap corruption 2016-08-16 22:55:42 -07:00
Stanislav Malyshev 5f91f692c3 Fix bug #72838 - Integer overflow lead to heap corruption in sql_regcase 2016-08-16 22:55:42 -07:00
Stanislav Malyshev cfdeedd985 Fix bug #72837 - integer overflow in bzdecompress caused heap corruption 2016-08-16 22:55:41 -07:00
Stanislav Malyshev d6a43a8562 Fix bug #72836 - integer overflow in base64_decode caused heap corruption 2016-08-16 22:55:41 -07:00
Stanislav Malyshev 1cd6bc6463 Fix for bug #72807 - do not produce strings with negative length 2016-08-16 22:55:41 -07:00
Stanislav Malyshev 5a34bd6d1e Fix for bug #72790 and bug #72799 2016-08-16 22:55:41 -07:00
Stanislav Malyshev 1bd103df00 Fix bug #72730 - imagegammacorrect allows arbitrary write access 2016-08-16 22:55:40 -07:00
Stanislav Malyshev a3598dd7c9 Fix bug#72697 - select_colors write out-of-bounds 2016-08-16 22:55:40 -07:00
Stanislav Malyshev 6dbb1ee46b Fixed bug #72627: Memory Leakage In exif_process_IFD_in_TIFF 2016-08-16 22:55:40 -07:00
Stanislav Malyshev 698a691724 Fix bug #72750: wddx_deserialize null dereference 2016-08-16 22:55:39 -07:00
Stanislav Malyshev e018ff094f Fix bug #72771: ftps:// opendir wrapper is vulnerable to protocol downgrade attack 2016-08-16 22:55:39 -07:00
Stanislav Malyshev 639f7fde6a Improve fix for #72663 2016-08-16 22:55:20 -07:00
Stanislav Malyshev 95d09e4b5e Fix bug #70436: Use After Free Vulnerability in unserialize() 2016-08-16 22:55:20 -07:00
Stanislav Malyshev 426aeb2808 Fix bug #72749: wddx_deserialize allows illegal memory access 2016-08-16 22:55:19 -07:00
Stanislav Malyshev f1a0b7d690 Update comment 2016-08-16 22:55:19 -07:00
Stanislav Malyshev da316b50bd Fix bug #72708 - php_snmp_parse_oid integer overflow in memory allocation 2016-08-16 22:55:19 -07:00
Stanislav Malyshev 8763c6090d Fix bug #72681 - consume data even if we're not storing them 2016-08-16 22:54:42 -07:00
Stanislav Malyshev 448c9be157 Fix bug #72663 - destroy broken object when unserializing 2016-08-16 22:54:42 -07:00
Xinchen Hui e47773b626 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Unused var
2016-08-17 11:18:48 +08:00
Xinchen Hui f3231a7c76 Unused var 2016-08-17 11:16:48 +08:00
Anatol Belski 5a4eab965a update NEWS 2016-08-17 01:44:29 +02:00
Anatol Belski 0077287688 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  update NEWS
2016-08-17 01:44:04 +02:00
Anatol Belski 0f337e11bc update NEWS 2016-08-17 01:37:40 +02:00
Christoph M. Becker 1d24ac46ab Merge branch 'PHP-7.0' into PHP-7.1 2016-08-17 01:23:22 +02:00
Christoph M. Becker 6202b47e63 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-17 01:22:11 +02:00
Anatol Belski abc7d1f140 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  fix test
  fix blocking pipe stream option value
2016-08-17 00:58:54 +02:00
Anatol Belski 20f76efb78 fix test 2016-08-17 00:56:19 +02:00
Anatol Belski 6de67244d4 fix blocking pipe stream option value
As revealed by #72857, this value conflicts with the xport option.
Wrong code can otherwise cause streams misbehave, fe if local and
network streams APIs are mixed.
2016-08-17 00:53:15 +02:00
Christoph M. Becker 1bb92d5212 #72085: SEGV on unknown address zif_xml_parse
We better make sure that the ZVALs we're accessing as arrays are indeed
arrays.
2016-08-17 00:42:45 +02:00
Stanislav Malyshev e3829b8869 Fix bug #72749: wddx_deserialize allows illegal memory access
(cherry picked from commit 659a21dc20f0b64dafd8cb16573059d3b45cce6b)

Conflicts:
	ext/wddx/wddx.c
2016-08-16 23:36:14 +02:00
Anatol Belski 620bb201c4 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  fix test cleanup
2016-08-16 22:55:51 +02:00
Anatol Belski f18f394386 fix test cleanup 2016-08-16 22:54:51 +02:00
Anatol Belski 77ea89cb33 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed #72857 stream_socket_recvfrom read access violation
2016-08-16 22:50:28 +02:00
Anatol Belski 5391bb8be0 Fixed #72857 stream_socket_recvfrom read access violation 2016-08-16 22:47:50 +02:00
Nikita Popov 7384fcff0a Merge branch 'PHP-7.0' into PHP-7.1 2016-08-16 21:05:57 +02:00
Nikita Popov e2230c17d3 Fix bug #72854 2016-08-16 21:05:30 +02:00
Aaron Piotrowski 6fcedc96fb Fix closure tests using ReflectionType::__toString() 2016-08-16 13:05:51 -05:00
Aaron Piotrowski 20fdd47921 Append \ to class name returned from ReflectionType::__toString() 2016-08-16 11:28:33 -05:00
Nikita Popov ba09a520d2 Cleanup parameter/return type checking code
a) Extract all the logic for error message formatting into a separate
function that is reused for everything.
b) Extract the logic for whether a value matches a type into two
functions, one for user types, one for internal ones.

This tries to fight the increasing code duplication in the type
checking code, whether everything was repeated at least four times
and parts of the error message handling were repeated in dozens of
branches.
2016-08-16 15:48:33 +02:00
Stanislav Malyshev 24fb60ffe9 Fixed bug #72627: Memory Leakage In exif_process_IFD_in_TIFF
(cherry picked from commit 620b01337cc39f856ca68c34c35e154f5f0682fc)

Conflicts:
	ext/exif/exif.c
2016-08-16 15:04:16 +02:00
Anatol Belski d926a48fd2 fix tests 2016-08-16 14:41:24 +02:00
Anatol Belski 28022c9b1f Fix bug#72697 - select_colors write out-of-bounds
(cherry picked from commit b6f13a5ef9d6280cf984826a5de012a32c396cd4)

Conflicts:
	ext/gd/gd.c
2016-08-16 14:37:39 +02:00
Stanislav Malyshev b735a4419c Fix bug #72708 - php_snmp_parse_oid integer overflow in memory allocation
(cherry picked from commit c3f6d6da100c6451a540680504de4105b8bed83c)

Conflicts:
	ext/snmp/snmp.c
	main/php_version.h
2016-08-16 14:22:10 +02:00
Stanislav Malyshev e70069a62f Fix bug #72730 - imagegammacorrect allows arbitrary write access
(cherry picked from commit 047fe0ed03093a496691d376fcf51a7e2f1d04b0)

Conflicts:
	ext/gd/gd.c
2016-08-16 14:14:03 +02:00
Stanislav Malyshev f1486f0fd6 Fix bug #72750: wddx_deserialize null dereference
(cherry picked from commit 6930a1d12c47aa1d2675837852910d177b0ceb11)

Conflicts:
	ext/wddx/wddx.c
2016-08-16 13:13:05 +02:00
Anatol Belski e5b0952be2 Fix bug #72771: ftps:// opendir wrapper is vulnerable to protocol downgrade attack
(cherry picked from commit f9c2edb4dbc01a817989b70ca7726f177bb1a103)

Conflicts:
	ext/standard/ftp_fopen_wrapper.c
2016-08-16 13:08:24 +02:00
Anatol Belski a47df5be19 fix tests 2016-08-16 13:01:06 +02:00
Anatol Belski 4bccb8e94e add missing skipif section 2016-08-16 12:53:40 +02:00
Stanislav Malyshev 0c8a2a2cd1 Fix for bug #72790 and bug #72799
(cherry picked from commit a14fdb9746262549bbbb96abb87338bacd147e1b)

Conflicts:
	ext/wddx/wddx.c
2016-08-16 12:46:29 +02:00
Nikita Popov 1397f754c8 Fix handling of qualified nullable parameter types
compile_typename() can't deal with TYPE_NULLABLE flags, drop it
beforehand.
2016-08-16 12:43:17 +02:00
Anatol Belski 67d0fe39ee Fix bug #72837 - integer overflow in bzdecompress caused heap corruption
Conflicts:
	ext/bz2/bz2.c
2016-08-16 12:34:25 +02:00
Dmitry Stogov 443da77c35 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed use after free
2016-08-16 11:44:53 +03:00
Dmitry Stogov ff06588130 Fixed use after free 2016-08-16 11:44:22 +03:00
Christopher Jones 603ed84c13 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-16 16:59:58 +10:00
Christopher Jones 51c1b64fa9 Remove unused OCI8 macros 2016-08-16 16:58:20 +10:00
Matthias Endler ad8b99c888 Fix some typos in PHP FPM configuration
[skip ci]
2016-08-15 22:50:14 +02:00
Nikita Popov f7caa2bd8e Hide (un)serialize data from ABI
The (UN)SERIALIZE_INIT/DESTROY macros now go through non-inlined
functions, so any changes to them will apply to extensions without
rebuilds.

Additionally, the (un)serialize_data structures are now no longer
exported.

This means that we are allowed to change these structures in patch
releases without breaking the ABI.
2016-08-15 22:42:27 +02:00
Xinchen Hui c63260c088 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #72846 (getConstant for a array constant with constant values returns NULL/NFC/UKNOWN)
2016-08-15 23:25:07 +08:00
Xinchen Hui 60de74ebda Fixed bug #72846 (getConstant for a array constant with constant values returns NULL/NFC/UKNOWN) 2016-08-15 23:22:55 +08:00
Stanislav Malyshev c2a13ced42 Fix bug #72742 - memory allocator fails to realloc small block to large one 2016-08-14 19:08:59 -07:00
Anatol Belski 51b0398ffc Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  put missing prototype and fix ts build
2016-08-14 22:40:20 +02:00
Anatol Belski d6b46901b2 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  put missing prototype and fix ts build
2016-08-14 22:39:01 +02:00
Anatol Belski 4a4422740f put missing prototype and fix ts build 2016-08-14 22:35:01 +02:00
Jakub Zelenka 427c8c809d Set DSA or DH key only if pub key supplied 2016-08-14 20:42:56 +01:00
Anatol Belski b783952cb1 Merge branch 'PHP-7.1' of git.php.net:php-src into PHP-7.1 2016-08-14 21:00:56 +02:00
Anatol Belski 909b62cda2 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  update NEWS
  update NEWS
2016-08-14 20:55:41 +02:00
Anatol Belski 32c94deac3 update UPGRADING 2016-08-14 20:55:26 +02:00
Anatol Belski e910b0a8a5 update NEWS 2016-08-14 20:52:47 +02:00
Anatol Belski 9088ef8052 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  update NEWS
2016-08-14 20:51:44 +02:00
Anatol Belski 5c7f802e7e update NEWS 2016-08-14 20:50:23 +02:00
Jakub Zelenka c3c90abb17 Return false if tag is not supplied or cannot be retrieved in AEAD
It doesn't make sense to return just encoded string as it cannot be
used anyway (decryption without a tag will not work).
2016-08-14 19:34:03 +01:00
Anatol Belski e6536b9d6f Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #72759 Regression in pgo_pgsql
2016-08-14 20:06:44 +02:00
Anatol Belski 245eaf5187 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fixed bug #72759 Regression in pgo_pgsql
2016-08-14 20:04:49 +02:00
Anatol Belski 977cbc2fff Fixed bug #72759 Regression in pgo_pgsql
This is caused by the fix for #72633. Namely, lastval() throws an error,
if no nextval() was called earlier in the same session. This is by all
means correct so far, however inside a transaction it leads to an abort.
This is the opposite to MySQL's last_insert_id() which doesn't produce
any error no matter something were autoincremented or not.

To avoid existing scripts breakage in the stable branches, the previous
patch is extended to revert the transaction to the state before the lastval()
call in case of error. It is done only for 5.6 and 7.0 to retain BC. For 7.1+,
the clean behavior should persist. This is already the current behavior, when
the sequence name is explicitly passed. So there's no reason to obfuscate the
errors where this breakage is valid.
2016-08-14 19:33:24 +02:00
Jakub Zelenka 37c12f8f86 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-14 14:01:36 +01:00
Jakub Zelenka 436d50a821 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-14 14:00:35 +01:00
Jakub Zelenka 9f1d962ed6 Fixed bug #72787 (json_decode reads out of bounds) 2016-08-14 13:52:59 +01:00
Nikita Popov 6ab9b531bc Merge branch 'PHP-7.0' into PHP-7.1 2016-08-13 21:42:51 +02:00
Nikita Popov 98787d9002 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-13 21:41:00 +02:00
Benedict Singer dfadc5a427 Bug 70195
Many FTP-S servers now require FTP clients to re-use the SSL session
from the control connection on the data connection, to prove that the
same entity controls both connections. This patch updates PHP's FTP-S
client code to allow that possibility.
2016-08-13 21:35:03 +02:00
Christoph M. Becker a927056cad Merge branch 'PHP-7.0' into PHP-7.1 2016-08-13 16:31:43 +02:00
Christoph M. Becker 33508a3d47 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-13 16:23:15 +02:00
Christoph M. Becker 82df4e2638 Fix #72278: getimagesize returning FALSE on valid jpg
getimagesize() is rather strict about the length of the marker payload data,
and fails if there are extraneous bytes before the next marker. Only a very
special case reported in bug #13213 is catered to.

libjpeg is rather resilient to such corrupted JPEG files, and raises a
recoverable error in this case. Other image processors also accept such
JPEG files, so we adapt getimagesize() to skip (but warn about) such
extraneous bytes.
2016-08-13 16:14:34 +02:00
Christoph M. Becker f0c77ee7f8 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-13 12:06:11 +02:00
Christoph M. Becker a93c62aafa Merge branch 'PHP-5.6' into PHP-7.0 2016-08-13 11:47:20 +02:00
Christoph M. Becker ae3b2078ea Fix #72823: strtr out-of-bound access
If php_strtr_array_prepare_repls() reports pattern_len == 0, we return
early to avoid OOB accesses, and because there is nothing to replace anyway.
2016-08-13 11:40:33 +02:00
Christoph M. Becker 02d6e4e517 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-13 01:29:49 +02:00
Christoph M. Becker 175d94b6e5 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-13 01:21:57 +02:00
Christoph M. Becker 7938ebf6c1 Fix #60665: call to empty() on NULL result using PDO::FETCH_LAZY returns false
The has_property handler only checked whether a respective column name
exists, but neither whether the column value is set, nor whether it is
empty, respectively. We fix that to match the behavior of POD:FETCH_OBJ in
particular and PHP in general.
2016-08-13 01:11:13 +02:00
Christoph M. Becker 040e99f566 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-12 12:55:32 +02:00
Christoph M. Becker 92a076a92b Fix #72793: xml_parser_free leaks mem when execute xml_set_object 2016-08-12 12:54:21 +02:00
Xinchen Hui 0b58d5eb81 Update NEWs 2016-08-12 16:36:57 +08:00
Xinchen Hui dd618664a0 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #72813 (Segfault with __get returned by ref)
  Fix URL rewriter partially

Conflicts:
	Zend/zend_object_handlers.c
	ext/standard/url_scanner_ex.c
	ext/standard/url_scanner_ex.re
2016-08-12 16:35:41 +08:00
Xinchen Hui fe41f87e46 Merge branch 'PHP-7.0' of git.php.net:/php-src into PHP-7.0
* 'PHP-7.0' of git.php.net:/php-src:
  Fix URL rewriter partially
  Support "git worktree"
2016-08-12 16:25:18 +08:00
Xinchen Hui e03480bfab Fixed bug #72813 (Segfault with __get returned by ref)
This should be safe change, as we don't dereference value and member
after calling setter/getter.

And compare to adding unref codes, this is much cheaper.
2016-08-12 16:24:46 +08:00
Yasuo Ohgaki 3467526a65 Merge RFC: Session ID without hashing
https://wiki.php.net/rfc/session-id-without-hashing
2016-08-12 12:31:02 +09:00
Andrea Faulds 1dab96c1db Show "or null" in TypeErrors for nullable arg_infos 2016-08-11 18:44:43 +02:00
Davey Shafik b33e965111 Use non-deprecated %pure-parser 2016-08-11 18:29:55 +02:00
Joey 194ffefb9e Corrected typo in comment
Finger-key interface malfunction.
2016-08-11 18:28:50 +02:00
Levi Morrison 9b6d7f5701 Remove extra pointer in SplFixedArray 2016-08-11 18:25:56 +02:00
Anatol Belski e5d9d009cf add missing chunk to support mb path in symlink() 2016-08-11 13:38:28 +02:00
Anatol Belski 53034feda5 pull ps_title behind the logic to support the current codepage 2016-08-11 13:38:28 +02:00
Anatol Belski 525eb35667 fix typo 2016-08-11 13:38:28 +02:00
Anatol Belski 6359c7a2bf add missing mb path support chunk 2016-08-11 13:38:28 +02:00
Aaron Piotrowski 622d2f41d1 ReflectionType improvements
Added ReflectionNamedType and updated ReflectionType::__toString()
2016-08-11 12:19:33 +02:00
Ville Hukkamäki 283b0cc8a5 Fix #72810. Add check for SKIP_ONLINE_TESTS 2016-08-11 12:01:24 +02:00
Stanislav Malyshev 6304a611cd Use size_t for path length 2016-08-10 23:46:58 -07:00
Stanislav Malyshev 7bf6d98535 Check for string overflow 2016-08-10 23:46:33 -07:00
Stanislav Malyshev 4f6a97f532 Fix for bug #72782: mcrypt accepts only ints, so don't pass anything else 2016-08-10 22:39:03 -07:00
Yasuo Ohgaki ae3782a0db Fix URL rewriter partially 2016-08-11 09:18:47 +09:00
Yasuo Ohgaki f19578ad58 Fix URL rewriter partially 2016-08-11 09:18:33 +09:00
Yasuo Ohgaki a53a6b3fb4 Fix URL rewriter issues 2016-08-11 08:31:48 +09:00
Yasuo Ohgaki 2644943968 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Support "git worktree"
2016-08-11 08:09:37 +09:00
Yasuo Ohgaki 5bf14e4699 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Support "git worktree"
2016-08-11 08:09:05 +09:00
Yasuo Ohgaki a38bc7b373 Support "git worktree" 2016-08-11 08:08:26 +09:00
Leigh 9a9004318f Preserve BC for rand() AND mt_rand() where min > max 2016-08-10 23:32:32 +01:00
Christoph M. Becker 24fdffdacb Update to SQLite 3.14.0 2016-08-10 18:09:38 +02:00
Keyur 40059beed8 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Add NEWS
  Fix ASSERT logic
  Bugfix 72791: fix memory leak in PDO persistent connections
2016-08-09 17:30:26 +00:00
Keyur bb955ec937 Add NEWS 2016-08-09 17:29:36 +00:00
Keyur 2b7715b925 Merge branch 'pull-request/2067' into PHP-7.0 2016-08-09 17:27:52 +00:00
Keyur 2ab9a2d4be Fix ASSERT logic 2016-08-09 14:41:20 +00:00
Keyur 98e4d509f6 Bugfix 72791: fix memory leak in PDO persistent connections 2016-08-09 14:01:25 +00:00
Nikita Popov 2fbfa7f62e Merge branch 'PHP-7.0' into PHP-7.1 2016-08-09 15:35:04 +02:00
Nikita Popov 842e408c67 Don't copy mime types in CLI server
This is both unnecessary and causes leaks in valgrind.
2016-08-09 15:34:03 +02:00
Christoph M. Becker b50a4a485a Class constant visibility modifiers are now supported 2016-08-09 11:54:43 +02:00
Christopher Jones a3fdc5f680 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-09 16:13:27 +10:00
Christopher Jones 3c5e6b29ce Remove obsolete Id tags 2016-08-09 16:12:58 +10:00
Christopher Jones 3dbeb6118d Merge branch 'PHP-7.0' into PHP-7.1 2016-08-09 16:00:44 +10:00
Christopher Jones 797f69ef32 Bump version in OCI8 test 2016-08-09 15:59:59 +10:00
Xinchen Hui ecc4025c71 Update NEWS 2016-08-09 11:32:55 +08:00
Xinchen Hui 3f1e9ed8f8 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #72788 (Invalid memory access when using persistent PDO connection)
  Remove typo'd commit
  Fix bug 72788: Invalid memory access when database_object_handle is undefined. Also fix memory leak in dbh_free when using persistent PDO connections.
2016-08-09 11:32:34 +08:00
Xinchen Hui e52cb1858d Fixed bug #72788 (Invalid memory access when using persistent PDO connection) 2016-08-09 11:32:16 +08:00
Xinchen Hui ebd21de1e4 Merge branch 'bug72788' of https://github.com/keyurdg/php-src into PHP-7.0
* 'bug72788' of https://github.com/keyurdg/php-src:
  Remove typo'd commit
  Fix bug 72788: Invalid memory access when database_object_handle is undefined. Also fix memory leak in dbh_free when using persistent PDO connections.
2016-08-09 11:25:32 +08:00
Keyur a74c7cb528 Remove typo'd commit 2016-08-09 01:36:15 +00:00
Keyur 3f25c4228a Fix bug 72788: Invalid memory access when database_object_handle
is undefined. Also fix memory leak in dbh_free when using persistent
PDO connections.
2016-08-09 00:16:46 +00:00
Leigh 2ece5decb7 Swap min/max if min > max 2016-08-08 22:31:59 +01:00
Leigh 99e3bb1430 Allow min > max for mt_rand(). Bug #72784 2016-08-08 22:16:27 +01:00
Andrea Faulds ab45f13a0b Merge branch 'PHP-7.0' into PHP-7.1 2016-08-08 21:00:49 +01:00
Andrea Faulds 5358c7cf5e Replace dead branch with ZEND_ASSERT() 2016-08-08 20:56:11 +01:00
Christoph M. Becker e8d8169fc1 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-08 18:51:34 +02:00
Nikita Popov cf017ce17f Fix array_column() packed hash initialization
FILL assumes enough space is alredy allocated -- do that. Note that
the used size is an upper bound, albeit a likely one.
2016-08-08 18:47:52 +02:00
Christoph M. Becker 9d03310b23 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-08 18:45:27 +02:00
Christoph M. Becker 243d5fcb1f Add test for bug #69107: finfo no longer detects PHP files 2016-08-08 18:43:33 +02:00
Anatol Belski 33a7ad2365 check malloc result 2016-08-08 10:33:07 +02:00
Christoph M. Becker f706897f33 Implement #38992: invoke() and invokeArgs() static method calls should match
We don't want ReflectionMethod::invoke() to simply ignore its first argument,
if the method to invoke is a static method. Instead we match its ZPP with
that of ReflectionMethod::invokeArgs(). Furthermore, we apply the DRY
principle by factoring out the code to a common helper function to prevent
inadvertent future divergence of the implementations of both methods.

As can be seen from the necessity to adapt some test cases, this causes a
BC break for some pathological cases. Therefore we apply this patch to PHP
7.1 only, which is still in beta phase.
2016-08-08 01:43:03 +02:00
Nikita Popov e52c1f3ca9 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-07 18:50:27 +02:00
Lauri Kenttä e616bc8694 Fix bug #55451
Make substr_compare ignore the length if it's NULL. This allows to
use the last parameter (case_insensitivity) with the default length.
2016-08-07 18:48:36 +02:00
Nikita Popov f350e20da6 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-07 18:38:43 +02:00
Nikita Popov 56d7e98ddf Merge branch 'PHP-5.6' into PHP-7.0 2016-08-07 18:38:28 +02:00
Nikita Popov 40d237df1f Fix stream_socket_enable_crypto() test
The whole test doesn't make any sense at all, but this only fixes
the additional warnings you get when linked against openssl w/o
SSL3.
2016-08-07 18:37:38 +02:00
Nikita Popov af77c53ee1 Fix PUTC warning
Change the macro to not provide a useless return value using a
comma expression, which generates warnings.
2016-08-07 17:43:20 +02:00
Nikita Popov 3823bfc6f2 Avoid use of scratch space in HTTP fopen wrapper
Instead directly write into req_buf smart_str.
2016-08-07 17:43:06 +02:00
Lior Kaplan 283ee1f6dc Recognize TDS versions 7.3 and 7.4 2016-08-07 15:15:59 +03:00
Christopher Jones 40bbf4ec06 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-07 10:25:16 +10:00
Christopher Jones dd7cdab8e4 Remove old $Id$ tags 2016-08-07 10:24:56 +10:00
Christopher Jones 9acafa16b1 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-07 10:21:14 +10:00
Christopher Jones 944d473eaa Sync with 7.1 branch changes from Nikita & Dimitri to keep OCI8 code identical 2016-08-07 10:17:06 +10:00
Christopher Jones fadbb30e66 News for 7.1 2016-08-07 10:06:11 +10:00
Christopher Jones f16285b35a Merge branch 'PHP-7.0' into PHP-7.1 2016-08-07 10:02:14 +10:00
Christopher Jones b601dc5b29 Fix bug #72524 (Binding null values triggers ORA-24816 error) 2016-08-07 09:39:44 +10:00
Leigh 5bf39267ee mt_rand 32/64-bit consistency 2016-08-06 11:15:26 +01:00
Kalle Sommer Nielsen 3d51b1d544 Fix the fix (Nikita), thanks! 2016-08-06 12:08:13 +02:00
Kalle Sommer Nielsen 5e2b8349b4 Check the return value of dbconvert() in mssql_guid_string(), as it may return -1 in case the conversion failed. In that case false is returned.
Also initialize buffer and buffer2 to NULL, which should fix bug #72039 (Use of uninitialised value on mssql_guid_string).

This only applies to 5.6, as we do not have mssql in 7.0 anymore
2016-08-06 10:17:49 +02:00
Nikita Popov be31515cc6 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-05 23:10:12 +02:00
Nikita Popov a2a2ea18fe Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	ext/standard/ftp_fopen_wrapper.c
2016-08-05 23:09:30 +02:00
Ville Hukkamaki 65056e9d6c Fix #72764
Negotiate data channel encryption after NLST command.
This is to prevent issues with IIS and ProFTPD.
2016-08-05 22:56:54 +02:00
Nikita Popov 3859bcd1f8 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-05 19:56:27 +02:00
Nikita Popov 807e81937b Fix bug #72767
The page size calculation did not account for the size of the
stack header (or rather it did account for it, but in the wrong
direction...)
2016-08-05 19:55:10 +02:00
Nikita Popov 1a780e6727 Add assertion to prevent type narrowing
Currently type narrowing is always a bug, make sure we know about
it.
2016-08-05 16:30:57 +02:00
Nikita Popov fc7c81ff54 Fixed bug #72762 2016-08-05 16:27:55 +02:00
ju1ius 03d03243fa Fix #72711: mb_ereg does not clear the $regs parameter on failure
When `mb_ereg` failed to match, it didn't update the `$regs` argument.
Now it will always set it to the empty array.
2016-08-05 13:22:10 +02:00
Ville Hukkamäki 318d3b3a3f Implement request #27814
Construct HTTP request headers into smart_str and send whole
request in one go.
2016-08-04 14:20:36 +02:00
Xinchen Hui 3800e1cf97 Fixed bug #72743 (Out-of-bound read in php_stream_filter_create) 2016-08-04 19:10:40 +08:00
Christoph M. Becker 5b547af1ad Merge branch 'PHP-7.0' into PHP-7.1 2016-08-04 12:10:34 +02:00
Christoph M. Becker 62f12a8b86 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-04 12:09:16 +02:00
Christoph M. Becker a8515a339d Fix broken skip marker in test case 2016-08-04 12:06:07 +02:00
Matteo Beccati 70698d1566 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Clean up FR #72633
  Fixed invalid handle error with Implicit Result Sets and bump OCI8 version.

Conflicts:
	ext/oci8/package.xml
2016-08-04 09:37:40 +02:00
Matteo Beccati 4003595d60 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Clean up FR #72633
2016-08-04 09:30:48 +02:00
Matteo Beccati d3a8e107ac Clean up FR #72633 2016-08-04 09:28:58 +02:00
Christopher Jones 0781f512c3 Fixed invalid handle error with Implicit Result Sets and bump OCI8 version. 2016-08-04 17:14:19 +10:00
Christopher Jones 2b7a699acd Fixed invalid handle error with Implicit Result Sets 2016-08-04 17:01:57 +10:00
Christopher Jones 78488a54c8 Fixed invalid handle error with Implicit Result Sets and bump OCI8 version. 2016-08-04 16:55:54 +10:00
Christopher Jones 06be3c659c Merge branch 'PHP-7.0' of https://git.php.net/repository/php-src into PHP-7.0 2016-08-04 16:45:29 +10:00
Stanislav Malyshev 67264ebc70 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fix bug #72716 - initialize buffer before read
2016-08-03 23:03:15 -07:00
Stanislav Malyshev b57474f23e Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix bug #72716 - initialize buffer before read

Conflicts:
	ext/standard/ftp_fopen_wrapper.c
2016-08-03 23:00:32 -07:00
Stanislav Malyshev 4f861b6071 Fix bug #72716 - initialize buffer before read 2016-08-03 22:59:42 -07:00
Ferenc Kovacs 7d4f5e3938 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-04 01:43:27 +02:00
Ferenc Kovacs db4211a8fe Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	configure.in
	main/php_version.h
2016-08-04 01:42:00 +02:00
Ferenc Kovacs 562c17eb4e 5.6.26 will be next 2016-08-04 01:39:37 +02:00
Nikita Popov ec6d70db77 Fix leak on self-referencing constants 2016-08-03 23:10:09 +02:00
Davey Shafik b304ab5c70 Move fix for #72735 to 7.1.0beta3 2016-08-03 12:31:15 -07:00
Anatol Belski 662e5ae951 improve the check, avoid strlen on NULL 2016-08-03 12:29:03 -07:00
Kalle Sommer Nielsen 835ef14979 Changed the way MAKERNOTE is handled in case we do not have a matching signature (Remi).
Before this patch, exif_process_IFD_in_MAKERNOTE() would return false, then causing the rest of the EXIF parsing to be interrupted. This is a regression from earlier which was most likely a part of a security fix for MAKERNOTE.

The new behavior is to instead of stopping to parse, to continue so we can still fetch data like thumbnail and GPS, thrus allowing yet unsupported formats to parse. If EXIF's debugging mode is enabled, a notice will display in case we do not match against a valid MAKERNOTE signature.

This should temporarily fix bug #72682 (exif_read_data() fails to read all data for some images) until I get around to debug it further.
2016-08-03 12:29:03 -07:00
Jakub Zelenka 6822af2e73 Do not add already added object to the internal OpenSSL table
This fixes OpenSSL 1.1 where adding object with OID that has been
already added causes an error - preventing of duplication.
2016-08-03 20:01:41 +01:00
Anatol Belski 8f0baa9707 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  improve the check, avoid strlen on NULL
2016-08-03 18:29:42 +02:00
Anatol Belski 138689ffb7 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  improve the check, avoid strlen on NULL
2016-08-03 18:28:48 +02:00
Anatol Belski 9667ee4f72 improve the check, avoid strlen on NULL 2016-08-03 18:26:29 +02:00
Anatol Belski a60e1bfedf update NEWS 2016-08-03 17:42:45 +02:00
Anatol Belski 8830b3d020 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  update NEWS
  update NEWS
  Changed the way MAKERNOTE is handled in case we do not have a matching signature (Remi).
2016-08-03 17:40:38 +02:00
Anatol Belski 2bdb34fd40 update NEWS 2016-08-03 17:39:55 +02:00
Anatol Belski 0e82eb48cb Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  update NEWS
  Changed the way MAKERNOTE is handled in case we do not have a matching signature (Remi).
2016-08-03 17:39:22 +02:00
Anatol Belski f15c155363 update NEWS 2016-08-03 17:38:11 +02:00
Kalle Sommer Nielsen d5796fb298 Changed the way MAKERNOTE is handled in case we do not have a matching signature (Remi).
Before this patch, exif_process_IFD_in_MAKERNOTE() would return false, then causing the rest of the EXIF parsing to be interrupted. This is a regression from earlier which was most likely a part of a security fix for MAKERNOTE.

The new behavior is to instead of stopping to parse, to continue so we can still fetch data like thumbnail and GPS, thrus allowing yet unsupported formats to parse. If EXIF's debugging mode is enabled, a notice will display in case we do not match against a valid MAKERNOTE signature.

This should temporarily fix bug #72682 (exif_read_data() fails to read all data for some images) until I get around to debug it further.

(cherry picked from commit aabcb5481d)
2016-08-03 17:36:00 +02:00
Anatol Belski c17092fc13 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  update libs_versions.txt
  update libs_versions.txt
2016-08-03 15:06:39 +02:00
Anatol Belski e3dabe448d update libs_versions.txt 2016-08-03 15:06:02 +02:00
Anatol Belski 7922e0f0bf Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  update libs_versions.txt
2016-08-03 15:05:39 +02:00
Anatol Belski 67c2b0a9e8 update libs_versions.txt 2016-08-03 15:03:41 +02:00
Remi Collet f9ce8aa75b Minor revert of be3640150c
On 32bits this may cause php to hangs forever.
2016-08-03 14:27:46 +02:00
Remi Collet a70ca97c18 fix paths in tests 2016-08-03 14:24:35 +02:00
Remi Collet 8b7f594a2b clean removed functions (since they are alias) 2016-08-03 12:59:14 +02:00
Remi Collet cff668f7a7 Fix 32bits tests
Notice: this warning is only raise since rand is an alias to mt_rand
2016-08-03 12:56:07 +02:00
Anatol Belski 39587c4817 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  fix ts build
2016-08-03 12:20:23 +02:00
Anatol Belski 151c39827a Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix ts build
2016-08-03 12:19:29 +02:00
Anatol Belski fad3f936ac fix ts build 2016-08-03 12:16:42 +02:00
Remi Collet 60bb15d8a1 add skipif (needs json) 2016-08-03 11:03:22 +02:00
Stanislav Malyshev 72dbb7f416 Fix bug #72674 - check both curl_escape and curl_unescape 2016-08-03 00:58:55 -07:00
Xinchen Hui 6d1f473247 It's packed array 2016-08-03 12:37:14 +08:00
Xinchen Hui be00b4ed13 Optmized array_rand 2016-08-03 12:06:04 +08:00
Xinchen Hui 501d24f81b Optimized array_pad 2016-08-03 11:24:31 +08:00
Davey Shafik 9ecefe72d8 Update NEWS for 7.1.0beta3 2016-08-02 16:40:07 -07:00
Nikita Popov 41e93041f8 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-03 00:35:00 +02:00
Nikita Popov 1bcd439cad Fix bug #72724 2016-08-03 00:34:36 +02:00
Christoph M. Becker 3d0002ed36 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-02 18:56:35 +02:00
Christoph M. Becker 3a8c027ec3 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-02 18:49:59 +02:00
Christoph M. Becker f5622f5c87 Fix #72709: imagesetstyle() causes OOB read for empty $styles
Calling imagesetstyle() with an empty $styles array caused gdImageSetStyle()
to be called with `noOfPixels==0`, what could have lead to OOB reads.
Actually, this issue will be fixed in libgd, but to avoid issues when older
libgd is in use, we simply disallow passing an empty $styles array to
imagesetstyle(), what wouldn't serve a useful purpose anyway.
2016-08-02 18:43:37 +02:00
Anatol Belski 02fce3ecea Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  update NEWS
  cleanup table after test
  - lastInsertId using Postgres Lastval() function
2016-08-02 14:42:55 +02:00
Anatol Belski 072af35b5c Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  update NEWS
  cleanup table after test
  - lastInsertId using Postgres Lastval() function
2016-08-02 14:40:31 +02:00
Anatol Belski e95625f47e update NEWS 2016-08-02 14:36:56 +02:00
Anatol Belski 40b3a031b2 cleanup table after test 2016-08-02 14:35:24 +02:00
Pablo Santiago Sánchez 90c6cbd09b - lastInsertId using Postgres Lastval() function 2016-08-02 14:34:30 +02:00
Xinchen Hui 82ba5b59d9 Fixed warning: "operation on ‘s’ may be undefined" 2016-08-02 20:28:42 +08:00
Xinchen Hui 81a7d52814 Folder marks 2016-08-02 20:08:15 +08:00
Xinchen Hui 70f79fd8b6 Optimized array_merge and cleanup 2016-08-02 20:02:23 +08:00
Xinchen Hui 87057858a0 Merge branch 'PHP-7.1' of git.php.net:/php-src into PHP-7.1
* 'PHP-7.1' of git.php.net:/php-src:
  prepare next
  fix php_version.h
2016-08-02 17:40:37 +08:00
Xinchen Hui e730c8fc90 Optimized array_merge 2016-08-02 17:39:53 +08:00
Anatol Belski 45eadced70 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  prepare next
2016-08-02 11:15:07 +02:00
Anatol Belski 5c51433e2a prepare next 2016-08-02 11:13:20 +02:00
Anatol Belski ed863e45da Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  fix php_version.h
2016-08-02 11:08:21 +02:00
Anatol Belski 9f14920725 fix php_version.h 2016-08-02 11:06:33 +02:00
Xinchen Hui fea2042a47 Optimized array_column (thanks to Benjamin Coutu) 2016-08-02 12:40:46 +08:00
Xinchen Hui a15902fa71 fixed IS_REFERENCE handling 2016-08-02 11:05:51 +08:00
Xinchen Hui f93061471b Make the expression more reasonble (by nikic) 2016-08-01 20:20:01 +08:00
Xinchen Hui 4d9195927a Optimized array_reverse 2016-08-01 20:11:08 +08:00
Anatol Belski 318102fc60 update NEWS 2016-07-31 15:01:45 +02:00
Anatol Belski db9baae4fb Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  update NEWS
  Revert "upgraded to PCRE 8.39"
2016-07-31 15:00:18 +02:00
Anatol Belski 753e6eacd5 update NEWS 2016-07-31 14:58:46 +02:00
Anatol Belski 5f9df47ea8 Revert "upgraded to PCRE 8.39"
This reverts commit 2fba646837.

PCRE-8.39 throws weird valgrind backtraces on some systems, see
http://news.php.net/php.cvs/93494 . Those could be false positives
due to some changes in JIT, still i couldn't 100% ensure this.
Thus, better we continue to ship 8.38 bundled for now, and apply
patches, if needed.
2016-07-31 14:55:17 +02:00
Nikita Popov 0e52228d60 Merge branch 'PHP-7.0' into PHP-7.1 2016-07-30 18:36:09 +02:00
Nikita Popov c4d35c3214 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-30 18:36:00 +02:00
Nikita Popov c9d3ff0c6e Revert "Fixed bug #71219"
This reverts commit 14d674442e.

I misread the discussion on the bug -- this is not the correct
fix. However the other proposed fix does not work either, so just
reverting for now.
2016-07-30 18:34:34 +02:00
Nikita Popov 510aba6276 Merge branch 'PHP-7.0' into PHP-7.1 2016-07-30 18:24:59 +02:00
Nikita Popov 9fe0398dad Merge branch 'PHP-5.6' into PHP-7.0 2016-07-30 18:24:14 +02:00
Nikita Popov 14d674442e Fixed bug #71219 2016-07-30 18:21:19 +02:00
Nikita Popov 7e8c4fcc40 Merge branch 'PHP-7.0' into PHP-7.1 2016-07-30 16:29:33 +02:00
Nikita Popov dd7bea17bf Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	ext/wddx/wddx.c
2016-07-30 16:29:10 +02:00
Nikita Popov 99613431b4 Add missing TSRMLS_FETCH() 2016-07-30 16:28:42 +02:00
Nikita Popov f9be9b1a72 Merge branch 'PHP-7.0' into PHP-7.1 2016-07-30 16:08:30 +02:00
Nikita Popov 029f8e8777 Fix incorrect merge
Forgot to amend the merge fixes...
2016-07-30 16:07:54 +02:00
Nikita Popov be836ea4fb Merge branch 'PHP-7.0' into PHP-7.1 2016-07-30 15:55:00 +02:00
Nikita Popov 1f67b4c24d Merge branch 'PHP-5.6' into PHP-7.0 2016-07-30 15:51:23 +02:00
Nikita Popov e87ac688d5 Fixed bug #72142 2016-07-30 15:13:03 +02:00
Christoph M. Becker 9c2814313d Merge branch 'PHP-7.0' into PHP-7.1 2016-07-30 12:04:12 +02:00
Christoph M. Becker e5940aa795 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-30 12:01:29 +02:00
ju1ius 1d32b80903 fixes bad address given to onig_error_code_to_str
Closes bug #72710

(cherry picked from commit 0fb7eb6723bcc6fd98053911543e801edb5ab763)
2016-07-30 11:46:34 +02:00
Nikita Popov ca82574d7c Fix invalid free on undef const in update_const()
Also clean up the control flow a bit -- move all unqualified
constant handling in one branch.
2016-07-30 00:37:01 +02:00
Nikita Popov 11e050920d Fix memory unsafety in array_walk()
Fixes bugs #61967, #62607, #69068, #70713.

The primary changes are:
a) Use the ht_iterator mechanism to ensure safety not only if the
   iterated array itself changes, but also if it is replaced (and
   potentially destroyed) entirely. We use the same semantics for
   behavior under modification as foreach-by-reference. In
   particular, we advance to the next element before processing it.
   If the iterated entity is exchanged we iterate the new one from
   the start. If it is not an array/object we warn and abort.
b) Always create a reference to the current value. Previously the
   code kept the value as a non-reference and updated it to the
   reference value produced by the user callback. However this is
   unsafe, as the array may have been reallocated in the meantime,
   so the previous value pointer is no longer value.
c) Around a recursive walk, incref the reference containing the
   array. This ensures that the location where the currently
   iterated value is stored cannot be freed.

One problem I was not able to solve is that we cannot decrement
the apply count if the array is exchanged during a recursive walk.
2016-07-30 00:15:32 +02:00
Nikita Popov 261c436d8c Merge branch 'PHP-7.0' into PHP-7.1 2016-07-29 19:08:15 +02:00
Nikita Popov 8a442a33c3 Fix ref handling in array_merge/replace_recursive()
As usual, if the reference has rc=1 it really isn't a reference.
2016-07-29 19:07:04 +02:00
Anatol Belski 5b6f793644 update NEWS 2016-07-29 17:33:40 +02:00
Anatol Belski 9b9aeb66bd add test for bug #72701 2016-07-29 17:23:39 +02:00
Anatol Belski 8033fb4044 Fixed bug #72701 mysqli_get_host_info() wrong output 2016-07-29 17:00:52 +02:00
Anatol Belski fe8daf2a28 fix typo 2016-07-29 15:08:55 +02:00
Anatol Belski d6f7020eaa add more errno handling 2016-07-29 15:05:41 +02:00
Anatol Belski d8403aa019 set errno in ioutil access routine 2016-07-29 14:31:06 +02:00
Anatol Belski 6dbfd4287b move error check to right place
this only makes sense when length was passed
2016-07-29 13:33:58 +02:00
Anatol Belski 0596a2561b Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  document file cache fallback ini directive
2016-07-29 13:07:43 +02:00
Anatol Belski 1666e80cb9 document file cache fallback ini directive 2016-07-29 13:04:51 +02:00
Christoph M. Becker a837b2f6a3 Fix #72320: iconv_substr returns false for empty strings
For consistency with substr() and mb_substr(), iconv_substr() should return
an empty string instead of FALSE, when $offset == iconv_strlen($str).
2016-07-29 11:33:50 +02:00
Anatol Belski 41d172d20f fix and improve the ioutil cwd routine for nts
- move intermediate var to stack
- fix length calculation
- improve error code setting
2016-07-29 02:41:00 +02:00
Christoph M. Becker 09b5a453c1 Merge branch 'PHP-7.0' into PHP-7.1 2016-07-29 01:27:51 +02:00
Christoph M. Becker 293dd3d701 Merge branch 'PHP-5.6' into PHP-7.0
# Resolved conflicts:
#	ext/calendar/calendar.c
2016-07-29 01:26:15 +02:00
Christoph M. Becker f67ccd4a7b Fix #71894: AddressSanitizer: global-buffer-overflow in zif_cal_from_jd
Julian days < 347998 denote invalid Jewish calendar dates, so
cal_from_jd($jd, CAL_JEWISH) and jdmonthname($jd, CAL_MONTH_JEWISH) should
actually fail. For BC we don't yet let them though, but we fix the OOB read
that happens in this case, and we also adjust cal_from_jd()'s return value
to have empty strings for "abbrevdayname" and "dayname" instead of "Sun"/
"Sunday" and NULL for "dow" instead of 0, which doesn't make any sense.
2016-07-29 01:04:21 +02:00
Christoph M. Becker 834919f0a5 Merge branch 'PHP-7.0' into PHP-7.1 2016-07-28 20:09:50 +02:00
Christoph M. Becker a952aac6a7 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-28 20:00:37 +02:00
Christoph M. Becker 5c458c9b02 Implement FR #65462: Please add tests for gregorian and jewish overflow fixes 2016-07-28 19:59:14 +02:00
Christoph M. Becker 28ade0e102 Merge branch 'PHP-7.0' into PHP-7.1 2016-07-28 19:25:22 +02:00
Christoph M. Becker 7c412688f4 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-28 19:22:40 +02:00
Christoph M. Becker 7ab39e2fae Fix #67976: cal_days_month() fails for final month of the French calendar
The French calendar ends on 0014-13-05, so trying to calculate the Julian
day of 0015-01-01 fails. We cater to that by returning the hard-coded value.
2016-07-28 19:13:58 +02:00
Nikita Popov 1315a3dd62 Merge branch 'PHP-7.0' into PHP-7.1 2016-07-28 18:52:04 +02:00
Nikita Popov 3b48c5a36f Revert "Make call_user_func() on reference args consistent"
This reverts commit fafe01b07b.

See bug #72698, there is code using this behavior. Reverting for
PHP 7.0 *only*. The fix is still in PHP 7.1.
2016-07-28 18:45:44 +02:00
Christoph M. Becker c61889d44b Merge branch 'PHP-7.0' into PHP-7.1 2016-07-28 18:25:49 +02:00
Christoph M. Becker 1693eb9d2a Merge branch 'PHP-5.6' into PHP-7.0 2016-07-28 18:24:37 +02:00
Christoph M. Becker ced2a80e6f Bug #69975 had already been fixed as of PHP 5.6.12
Also CVE-2015-8879 had been assigned.
2016-07-28 18:22:19 +02:00
Christoph M. Becker 81577235ee Merge branch 'PHP-7.0' into PHP-7.1 2016-07-28 17:31:13 +02:00
Christoph M. Becker 573568bbce Merge branch 'PHP-5.6' into PHP-7.0 2016-07-28 17:30:29 +02:00
Christoph M. Becker c301adbbd1 Fix #72677: SCM_CREDENTIALS related tests should be skipped on AIX
Patch provided by matthieu dot sarter dot external at atos dot net.
2016-07-28 17:19:47 +02:00
Christoph M. Becker b0558b3004 Merge branch 'PHP-7.0' into PHP-7.1 2016-07-28 17:00:54 +02:00
Christoph M. Becker 95190db84d Merge branch 'PHP-5.6' into PHP-7.0 2016-07-28 16:54:36 +02:00
Christoph M. Becker 6e886f07a8 Fix #72676: Test cli_process_title_unix fails on AIX
Patch provided by matthieu dot sarter dot external at atos dot net.
2016-07-28 16:51:45 +02:00
Christoph M. Becker af285634c6 Merge branch 'PHP-7.0' into PHP-7.1 2016-07-28 16:40:37 +02:00
Christoph M. Becker 81c25abd25 Update to SQLite3 3.13.0 2016-07-28 16:39:24 +02:00
Christoph M. Becker de755310b4 Merge branch 'PHP-7.0' into PHP-7.1
# Resolved conflicts:
#	ext/mbstring/php_mbregex.c
2016-07-28 15:50:41 +02:00
Christoph M. Becker 805dc0ea47 Merge branch 'PHP-5.6' into PHP-7.0
# Resolved conflicts:
#	ext/mbstring/php_mbregex.c
2016-07-28 15:26:29 +02:00
Christoph M. Becker ee6900c3de Fix #72694: mb_ereg_search_setpos does not accept a string's last position
Setting the search position immediately behind the last character should be
allowed, so we fix this off-by-one error.
2016-07-28 15:21:48 +02:00
Christoph M. Becker 6aaef1ed34 Merge branch 'PHP-7.0' into PHP-7.1 2016-07-28 14:09:29 +02:00
Christoph M. Becker a621023168 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-28 14:03:40 +02:00
Christoph M. Becker 56cdaecb28 Fix #72693: mb_ereg_search increments search position when a match zero-width
That's caused by an off-by-one error, which we fix.
2016-07-28 13:57:38 +02:00
Christoph M. Becker db69ea32cb Merge branch 'PHP-7.0' into PHP-7.1 2016-07-28 13:19:15 +02:00
Christoph M. Becker 18a37eeeec Merge branch 'PHP-5.6' into PHP-7.0
# Resolved conflicts:
#	ext/mbstring/php_mbregex.c
2016-07-28 13:12:40 +02:00
Christoph M. Becker d276e6a838 Fix #72691: mb_ereg_search raises a warning if a match zero-width
That warning doesn't make sense (PCRE doesn't throw such a warning either),
so we remove it.
2016-07-28 13:07:05 +02:00
Christoph M. Becker 2e9b6a0aed Merge branch 'PHP-7.0' into PHP-7.1 2016-07-28 12:30:02 +02:00
Christoph M. Becker c7a4e37d97 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-28 12:29:00 +02:00
Christoph M. Becker 0ae8c337a3 Bug #6836 has already been fixed in PHP 5.6.24 and 7.0.9 2016-07-28 12:26:41 +02:00
Pierrick Charron 942d6c14d2 Add new curl functions in UPGRADING 2016-07-27 23:54:45 -04:00
Pierrick Charron 8d44942912 Merge branch 'PHP-7.0' into PHP-7.1 2016-07-27 23:39:34 -04:00
Pierrick Charron bf37b97d9c Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	ext/curl/interface.c
2016-07-27 23:36:22 -04:00
Pierrick Charron 30a5ed3a79 Fixed bug #71929 (CURLINFO_CERTINFO data parsing error). 2016-07-27 23:30:20 -04:00
Pierrick Charron 206f9f1337 Merge branch 'PHP-7.0' into PHP-7.1 2016-07-27 18:25:55 -04:00
Pierrick Charron 1b681880c1 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-27 18:17:43 -04:00
Anatol Belski 915d2b9420 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  cleanup the table after the test run
2016-07-27 23:53:19 +02:00
Pierrick Charron ed16f2fed5 Update NEWS 2016-07-27 17:52:05 -04:00
Anatol Belski 266c62070f cleanup the table after the test run 2016-07-27 23:50:10 +02:00
Anatol Belski b28758565d update NEWS 2016-07-27 23:32:20 +02:00
Anatol Belski a6a98b29ba Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  update NEWS
2016-07-27 23:31:35 +02:00
Anatol Belski e0294b39e3 update NEWS 2016-07-27 23:30:23 +02:00
Anatol Belski fb244637c6 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Implemented FR #72633 Postgres PDO lastInsertId() should work without specifying a sequence
2016-07-27 23:03:23 +02:00
root 12628e9a46 Implemented FR #72633 Postgres PDO lastInsertId() should work without specifying a sequence 2016-07-27 23:00:12 +02:00
Anatol Belski 1d0dc760b7 update NEWS 2016-07-27 20:49:46 +02:00
Anatol Belski a6713dd783 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #72683 getmxrr broken
2016-07-27 20:49:16 +02:00
Anatol Belski c52322707e Fixed bug #72683 getmxrr broken 2016-07-27 20:48:45 +02:00
Anatol Belski 064fe37aea Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  update NEWS
2016-07-27 20:42:05 +02:00
Anatol Belski 6e8b2d21d1 update NEWS 2016-07-27 20:41:27 +02:00
Christoph M. Becker 15f94e93e7 Merge branch 'PHP-7.0' into PHP-7.1 2016-07-27 19:06:36 +02:00
Christoph M. Becker 40afd77826 Merge branch 'PHP-5.6' into PHP-7.0
# Resolved conflicts:
#	ext/pcre/php_pcre.c
2016-07-27 19:00:38 +02:00
Christoph M. Becker 315c0536c2 Fix #72688: preg_match missing group names in matches
We have to multiply with 0x100 to properly scale the high byte.
2016-07-27 18:50:52 +02:00
Bob Weinand dfb3e270c2 Merge remote-tracking branch 'origin/PHP-7.0' into PHP-7.1 2016-07-27 18:18:47 +02:00
Bob Weinand 5513f00a97 Fixed a potential segfault in zend_objects_store_free_object_storage()
Under the special circumstance where a garbage collected objects bucket slot was not reused until the end of the script, we get access into freed memory...
No test added as it usually is valgrind-only, and only sometimes when the memory happens to have changed (i.e. (GC_FLAGS(obj) & IS_OBJ_FREE_CALLED) == 0), it actually *may* segfault
2016-07-27 18:08:43 +02:00
Christoph M. Becker be11563fa2 Merge branch 'PHP-7.0' into PHP-7.1 2016-07-27 16:54:27 +02:00
Christoph M. Becker 23c359c276 Merge branch 'PHP-5.6' into PHP-7.0
# Resolved conflicts:
#	ext/sqlite3/sqlite3.c
2016-07-27 16:48:29 +02:00
Christoph M. Becker cc125f277b Implement #72653: SQLite should allow opening with empty filename
From the [sqlite3_open](https://www.sqlite.org/c3ref/open.html) docs:

| If the filename is an empty string, then a private, temporary on-disk
| database will be created. This private database will be automatically
| deleted as soon as the database connection is closed.

We make that facility available to userland.

While we're at it, we also do some minor optimizations, remove the
unnecessary check for NUL characters in filename, which is already catered
to by ZPP(p), and add a missing `return` in case db_obj isn't initialized.
2016-07-27 16:41:03 +02:00
Nikita Popov fab1815192 Merge branch 'PHP-7.0' into PHP-7.1 2016-07-27 15:59:23 +02:00
Nikita Popov 0d2c4f822c Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	ext/standard/ftp_fopen_wrapper.c
2016-07-27 15:58:06 +02:00
Ville Hukkamäki cce457c68c Fix bug #72667
Open data stream after receiving PASV reply, before sending the
main request.

Included test cases for opendir() with ftp:// and ftps:// wrappers.
Test cases re-use ext/ftp/tests/server.inc

Conflicts:
	ext/standard/ftp_fopen_wrapper.c
2016-07-27 15:55:47 +02:00
Pierrick Charron 929c1e0cdf Merge branch 'PHP-7.0' into PHP-7.1 2016-07-27 00:39:47 -04:00
Pierrick Charron 6714f73545 Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	main/streams/streams.c
2016-07-27 00:38:54 -04:00
Pierrick Charron 074b86d845 Fixed bug #72686 (zlib: url support is broken).
zlib: support is broken since a really long time.
It never worked on versions >= PHP5.6 so we can just remove
this dead code.

Bug was introduced 2006-05-14 (Before 5.2.0)
2016-07-27 00:33:13 -04:00
Pierrick Charron a8c4a4262e Merge branch 'PHP-7.0' into PHP-7.1 2016-07-26 20:37:04 -04:00
Pierrick Charron 2597f5d665 Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	ext/spl/spl_iterators.c
2016-07-26 20:36:34 -04:00
Pierrick Charron 4c2e1a13be Fixed bug #72684 (AppendIterator segfault with closed generator) 2016-07-26 20:34:16 -04:00
Pierrick Charron ca493af862 Merge branch 'PHP-7.0' into PHP-7.1 2016-07-26 19:23:08 -04:00
Pierrick Charron 31ed322b06 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-26 19:20:12 -04:00
Pierrick Charron 24d8f6ed7c Fixed bug #71709
When curl_setopt is called with an empty slist as value, we should
not add the empty slist to the list of slist to free.
2016-07-26 18:50:15 -04:00
Anatol Belski 21f80a00a9 fix broken proto doc 2016-07-26 16:29:24 +02:00
Anatol Belski 866e551c0a Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  upgraded to PCRE 8.39
2016-07-26 15:12:03 +02:00
Anatol Belski 2fba646837 upgraded to PCRE 8.39
(cherry picked from commit 9d4fe9672a)
2016-07-26 15:07:04 +02:00
Anatol Belski a35adb8b22 fix missing header and conflicting symbol 2016-07-26 14:00:24 +02:00
Anatol Belski 893e3b06ea fix compiler warning 2016-07-26 07:53:24 +02:00
Anatol Belski 3958f7af00 fix data type 2016-07-26 07:53:24 +02:00
Nikita Popov 4d2479202a Merge branch 'PHP-7.0' into PHP-7.1 2016-07-25 23:04:14 +02:00
Nikita Popov b1d36cb820 Fix GMP unserialization with self-reference 2016-07-25 23:04:00 +02:00
Andrey Hristov b27ff62ee0 Fix for bug #71863 Segfault when EXPLAIN with "Unknown column" error
The reason was that after the big refactoring of mysqlnd at the end of
last year code that is initializing the error_info structure in the
result set was not added. It existed already for connections and PS.
The code that segfaults is hit only with MariaDB because MariaDB sends
full metadata about the EXPLAIN query + EOF packet and only then it sends
an error packet. MySQL doesn't do that but sends directly an error which
is caught (by different code path). As errors during execution (which means
after sending meta) are pretty rare there was no test case of MySQL to
catch it.
2016-07-25 21:59:27 +02:00
Christoph M. Becker ac0bbea3a8 Merge branch 'PHP-7.0' into PHP-7.1 2016-07-25 17:15:10 +02:00
Christoph M. Becker ccf39dd552 Merge branch 'PHP-5.6' into PHP-7.0
# Resolved conflicts:
#	ext/sqlite3/sqlite3.c
#	ext/sqlite3/tests/bug72668.phpt
2016-07-25 17:07:41 +02:00
Christoph M. Becker 64e3e932fc Further fixes wrt. bug #72668
Not only SQLite3::querySingle(), but also SQLite3::query() and
SQLite3Stmt::execute() were affected.
2016-07-25 17:03:10 +02:00
Anatol Belski 2334d8335b use more suitable types here, too
and simplify the loop
2016-07-25 14:46:20 +02:00
Anatol Belski 198c2ec5f0 change to more suitable datatypes 2016-07-25 14:46:20 +02:00
Xinchen Hui 2abb56e0bd Update NEWs 2016-07-25 20:29:26 +08:00
Xinchen Hui 088905bf60 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #72668 (Spurious warning when exception is thrown in user defined function)
2016-07-25 20:28:57 +08:00
Xinchen Hui f5e56cf970 Fixed bug #72668 (Spurious warning when exception is thrown in user defined function) 2016-07-25 20:28:39 +08:00
Anatol Belski 0d5050225d update NEWS 2016-07-25 12:50:21 +02:00
Anatol Belski bd9a5b183c Fixed bug #72658 Locale::lookup() / locale_lookup() hangs if no match found 2016-07-25 12:49:13 +02:00
Christoph M. Becker ee07e23e8e Fix SQLite3 header files
While sqlite3.c had already been updated to 3.13.0, the header files had
been forgotten.
2016-07-25 10:27:21 +02:00
Anatol Belski 6bb2c7f63f Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  update NEWS
  Make phpize use PHP_PREFIX as the default location (windows)
  Enable 'nmake test' on building extensions
2016-07-25 10:18:10 +02:00
Anatol Belski 9a4c9348b1 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  update NEWS
  Make phpize use PHP_PREFIX as the default location (windows)
  Enable 'nmake test' on building extensions
2016-07-25 10:17:41 +02:00
Anatol Belski 0c34d515f1 update NEWS 2016-07-25 10:14:18 +02:00
y-uti 3f842655db Make phpize use PHP_PREFIX as the default location (windows)
The default path to where an extension is installed should be
PHP_PREFIX/ext on windows.
2016-07-25 10:01:34 +02:00
y-uti 72ac8cf5ad Enable 'nmake test' on building extensions
On Windows, Makefile generated by phpize doesn't have the 'test'
target rule. This commit fixes that and enables 'nmake test' on
Windows.
2016-07-25 09:55:07 +02:00
Anatol Belski 30118e33b3 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  update NEWS
  Enable 'nmake test' on building extensions
  Make phpize use PHP_PREFIX as the default location (windows)
2016-07-25 09:52:38 +02:00
Anatol Belski 59de6fb268 update NeWS 2016-07-25 09:52:21 +02:00
Anatol Belski 27dd8048b7 update NEWS 2016-07-25 09:51:13 +02:00
y-uti 0f9bf85ad9 Enable 'nmake test' on building extensions
On Windows, Makefile generated by phpize doesn't have the 'test'
target rule. This commit fixes that and enables 'nmake test' on
Windows.
2016-07-25 09:46:06 +02:00
y-uti 6ed7136371 Make phpize use PHP_PREFIX as the default location (windows)
The default path to where an extension is installed should be
PHP_PREFIX/ext on windows.
2016-07-25 09:46:00 +02:00
Christoph M. Becker 387847a0b2 Merge branch 'PHP-7.0' into PHP-7.1 2016-07-25 02:03:54 +02:00
Christoph M. Becker 138fea83fe Merge branch 'PHP-5.6' into PHP-7.0
# Resolved conflicts:
#	ext/gd/tests/gd_info_variation1.phpt
2016-07-25 02:02:54 +02:00
Christoph M. Becker 305bddb0ed Fix broken test case
d28f1da introduced a test regression, due to potentially additional output
regarding FreeType support. We fix that by making the test more resilient.
2016-07-25 02:00:37 +02:00
Christoph M. Becker d55a773223 Merge branch 'PHP-7.0' into PHP-7.1 2016-07-25 00:25:11 +02:00
Christoph M. Becker 4db4997ac5 Merge branch 'PHP-5.6' into PHP-7.0
# Resolved conflicts:
#	ext/gd/tests/gd_info_variation1.phpt
2016-07-25 00:16:21 +02:00
Christoph M. Becker d28f1dae9d Fix broken test case
The test claims that it would be "checking all the values in returned array",
but due to the use of %a it actually skipped elements. We fix that by using
%s instead.
2016-07-25 00:13:44 +02:00
Xinchen Hui 3d33eb743d Update NEWS 2016-07-24 23:59:05 +08:00
Xinchen Hui 393d56f1e3 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #72660 (NULL Pointer dereference in zend_virtual_cwd)
2016-07-24 23:58:50 +08:00
Xinchen Hui ad96a052d9 Fixed bug #72660 (NULL Pointer dereference in zend_virtual_cwd) 2016-07-24 23:58:22 +08:00
Anatol Belski fcc9386578 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  regenerate date parser with re2c 0.15.3
  regenerate date parser with re2c 0.15.3
2016-07-24 14:55:15 +02:00
Anatol Belski da3995852e regenerate date parser with re2c 0.15.3 2016-07-24 14:53:53 +02:00
Anatol Belski 8eb94b6e32 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  regenerate date parser with re2c 0.15.3
2016-07-24 14:51:59 +02:00
Anatol Belski 9cd23ff84f regenerate date parser with re2c 0.15.3 2016-07-24 14:50:10 +02:00
Xinchen Hui 9b34f44f41 Merge branch 'PHP-7.1' of git.php.net:/php-src into PHP-7.1
* 'PHP-7.1' of git.php.net:/php-src: (32 commits)
  fix compiler warning
  rework long path normalization stuf
  More tolerance in another IntlCalendar test
  Ensure session GC is not run during variation6.phpt
  add folds
  improve typedef and fix the fake function
  add missing cast
  Fix typos, previous version used reserver/reserverd/reserved
  Fixed bug #72625 realpath() fails on non canonical long path
  correct comment
  don't return long path prefix to script
  fix test
  fix test
  Fix #68712: suspicious if-else statements
  Fix copy&paste errors in gd_interpolation.c
  Fix #66555: Always false condition in ext/gd/libgd/gdkanji.c
  Fix ClosedGeneratorException possibly thrown into wrong scope
  Fix for bug #54431
  Fix build
  Make sure TOKEN_PARSE mode is thread safe
  ...
2016-07-24 11:03:49 +08:00
Xinchen Hui a3a797dbd5 Fixed bug #72661 (ReflectionType::__toString crashes with iterable) 2016-07-24 11:01:19 +08:00
Anatol Belski addb2e22b3 fix compiler warning 2016-07-24 03:51:53 +02:00
Anatol Belski 4acde210fd rework long path normalization stuf
Simplify, set error codes, ensure 32-bit is ok as well. The
canonicalization part is still an issue on win7 as the API
is missing there. However a partial improvement is reached
there as well thanks to the slash conversion.
2016-07-24 03:51:47 +02:00
Nikita Popov ca64223193 Merge branch 'PHP-7.0' into PHP-7.1 2016-07-24 00:18:51 +02:00
Nikita Popov aecc435482 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-24 00:18:47 +02:00
Nikita Popov 04b42b1e05 More tolerance in another IntlCalendar test
Again, off-by-1000 is expected if we're late in the second. Add an
extra 1000 to account for actual delta in call times.
2016-07-24 00:15:14 +02:00
Nikita Popov 42e995e0d3 Merge branch 'PHP-7.0' into PHP-7.1 2016-07-24 00:08:18 +02:00
Nikita Popov 2194690625 Ensure session GC is not run during variation6.phpt
The implemented gc() handler simply deletes all sessions, including
the current one. This may cause a subsequent unlink() warning.
Avoid this by preventing GC from running.
2016-07-24 00:07:54 +02:00
Anatol Belski 69ae61af96 add folds 2016-07-23 23:24:32 +02:00
Anatol Belski 88d4f149a6 improve typedef and fix the fake function 2016-07-23 23:24:32 +02:00
Anatol Belski 40557fdc34 add missing cast 2016-07-23 23:24:32 +02:00
Sjon Hortensius 66626cc223 Fix typos, previous version used reserver/reserverd/reserved 2016-07-23 23:14:14 +02:00
Anatol Belski 0f16c56262 Fixed bug #72625 realpath() fails on non canonical long path 2016-07-23 21:11:27 +02:00
Anatol Belski fc30b8e0f7 correct comment 2016-07-23 21:11:27 +02:00
Anatol Belski 7d83324105 don't return long path prefix to script 2016-07-23 21:11:27 +02:00
Anatol Belski 3d95cc50a7 fix test 2016-07-23 21:06:11 +02:00
Anatol Belski b238211732 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  fix test
2016-07-23 21:04:52 +02:00
Anatol Belski 958fa34c16 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix test
2016-07-23 21:03:45 +02:00
Anatol Belski 80fee637f4 fix test 2016-07-23 20:55:39 +02:00
Christoph M. Becker 8aa9ddb4d2 Merge branch 'PHP-7.0' into PHP-7.1 2016-07-23 19:38:45 +02:00
Christoph M. Becker 2c0a18480d Merge branch 'PHP-5.6' into PHP-7.0 2016-07-23 19:36:53 +02:00
Christoph M. Becker 88838dd282 Fix #68712: suspicious if-else statements 2016-07-23 19:29:43 +02:00
Christoph M. Becker 88bc54d3dc Merge branch 'PHP-7.0' into PHP-7.1 2016-07-23 18:13:29 +02:00
Christoph M. Becker 03ccd42b18 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-23 18:12:14 +02:00
Christoph M. Becker 9fbd0c1ff1 Fix copy&paste errors in gd_interpolation.c
According to <https://github.com/libgd/libgd/commit/f101380>.
2016-07-23 18:09:18 +02:00
Christoph M. Becker 03eeea4aa5 Merge branch 'PHP-7.0' into PHP-7.1 2016-07-23 16:57:12 +02:00
Christoph M. Becker 5056d59f96 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-23 16:55:16 +02:00
Christoph M. Becker 2c16b9cf62 Fix #66555: Always false condition in ext/gd/libgd/gdkanji.c
This issue has already been fixed in libgd[1], so we fix PHP's bundled
libgd accordingly.

[1] <https://github.com/libgd/libgd/commit/aa1d71c>
2016-07-23 16:48:07 +02:00
Bob Weinand 35764e3579 Merge remote-tracking branch 'origin/PHP-7.0' into PHP-7.1 2016-07-23 16:40:02 +02:00
Bob Weinand 6046acf93e Fix ClosedGeneratorException possibly thrown into wrong scope 2016-07-23 16:39:21 +02:00
Nikita Popov 696d6e7c90 Merge branch 'PHP-7.0' into PHP-7.1 2016-07-23 13:30:55 +02:00
Nikita Popov f12fd5c2d3 Merge branch 'PHP-5.6' into PHP-7.0
Conflicts:
	ext/standard/ftp_fopen_wrapper.c
2016-07-23 13:29:57 +02:00
vhuk 65abdb556d Fix for bug #54431 2016-07-23 13:28:42 +02:00
Nikita Popov f4d1af7981 Fix build
Missed this occurrence...
2016-07-23 00:12:11 +02:00
Nikita Popov 07af6ba898 Make sure TOKEN_PARSE mode is thread safe
Introduce an on_event_context passed to the on_event hook. Use this
context to pass along the token array. Previously this was stored
in a non-tls global :/
2016-07-23 00:00:13 +02:00
Nikita Popov 40b312d4c2 Use OPENSSL_RAW_DATA in raw data decryption tests 2016-07-22 18:30:30 +02:00
Nikita Popov bb51da29dc Make base64_decode() in non-strict mode binary safe 2016-07-22 18:20:34 +02:00
Nikita Popov e1216f6fc1 Add NEWS entries 2016-07-22 18:07:45 +02:00
Lauri Kenttä cab5f6a889 base64_decode: Add tests 2016-07-22 18:03:56 +02:00
Lauri Kenttä 316d5a19a6 base64_decode: Handle all invalid padding equally 2016-07-22 18:03:56 +02:00
Lauri Kenttä 5c62f3f68e base64_decode: strict: Fail on excessive padding 2016-07-22 18:03:56 +02:00
Lauri Kenttä 586a0761ff base64_decode: strict: Fail on truncated input 2016-07-22 18:03:56 +02:00
Lauri Kenttä 0981e5de3c base64_decode: Avoid code duplication in failures 2016-07-22 18:03:55 +02:00
Lauri Kenttä 7a02704c0e Require strict base64 in data URI
As the tests already show, the data URI wrapper is supposed to fail
for corrupt input, but for some reason, one case of invalid input is
still allowed to pass?! Strict base64 makes a lot more sense here.
Also, Chromium and Firefox fail on invalid base64, so it's a logical
choice for PHP as well.
2016-07-22 18:03:55 +02:00
Lauri Kenttä f775199ac7 Require strict base64 in openssl_decode
Using invalid data in a security-related context makes no sense,
and there's even a test which depends on invalid base64 data failing,
even though it currently fails for the wrong reasons by sheer luck.
2016-07-22 18:03:55 +02:00
Lauri Kenttä 76f6f3583c Fix test: Use valid base64 even for invalid OpenSSL data 2016-07-22 18:03:55 +02:00
Nikita Popov dc04f2d2db Merge branch 'PHP-7.0' into PHP-7.1 2016-07-22 17:22:29 +02:00
Nikita Popov 7d77289717 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-22 17:22:13 +02:00
Nikita Popov 4fc1bfa93b Make IntlCalendar::getNow() test more tolerant
Due to the *1000 factor the two values may be off-by-1000 even
without any actual delay, so increase the check to 2000.
2016-07-22 17:20:56 +02:00
Xinchen Hui eaa8f49708 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #72647 (xmlrpc_encode() unexpected output after referencing array elements)
2016-07-22 23:15:24 +08:00
Xinchen Hui 6929121423 Fixed bug #72647 (xmlrpc_encode() unexpected output after referencing array elements) 2016-07-22 23:15:15 +08:00
Xinchen Hui 05dfd1d39f Update NEWs 2016-07-22 23:14:51 +08:00
Xinchen Hui df358a1c06 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #72647 (xmlrpc_encode() unexpected output after referencing array elements)
2016-07-22 23:14:28 +08:00
Xinchen Hui 516837344e Fixed bug #72647 (xmlrpc_encode() unexpected output after referencing array elements) 2016-07-22 23:13:42 +08:00
Christoph M. Becker a6953e70e5 Merge branch 'PHP-7.0' into PHP-7.1 2016-07-22 15:29:18 +02:00
Christoph M. Becker 9a2207c90a Merge branch 'PHP-5.6' into PHP-7.0
# Resolved conflicts:
#	ext/spl/spl_directory.c
2016-07-22 15:27:55 +02:00
Christoph M. Becker 6b116932b2 Fix #72646: SplFileObject::getCsvControl does not return the escape character
This has obviously been missed when adding the $escape parameter to
SplFileObject::setCsvControl() in PHP 5.3, so we catch up on this.
2016-07-22 15:24:50 +02:00
Remi Collet d5ad4b8b14 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  FPM: add test for CVE-2016-5385
2016-07-22 09:37:00 +02:00
Remi Collet 9622f973a5 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  FPM: add test for CVE-2016-5385
2016-07-22 09:36:36 +02:00
Remi Collet fb4a6dc0f1 FPM: add test for CVE-2016-5385 2016-07-22 09:35:09 +02:00
Christoph M. Becker 9c8b2c8689 Merge branch 'PHP-7.0' into PHP-7.1 2016-07-21 18:53:42 +02:00
Christoph M. Becker 4472f9e822 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-21 18:39:27 +02:00
Christoph M. Becker f2c2a4be9e Fix #72330: CSV fields incorrectly split if escape char followed by UTF chars
We must not forget to properly reset the state for multibyte characters
following an escape character.
2016-07-21 18:37:24 +02:00
Christoph M. Becker 4c5aa9ba2c Merge branch 'PHP-7.0' into PHP-7.1 2016-07-21 16:51:19 +02:00
Christoph M. Becker 7e2c3a77c0 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-21 16:50:37 +02:00
Pieter Hordijk f813f43855 Removed incorrect (leftover?) sentence in ini
about mbstring or iconv output handler
2016-07-21 16:49:14 +02:00
Christoph M. Becker 8950fb42d9 Merge branch 'PHP-7.0' into PHP-7.1 2016-07-21 16:33:06 +02:00
Christoph M. Becker bee362d5e3 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-21 16:31:16 +02:00
Pieter Hordijk 82bfb090ac Removed incorrect (leftover?) sentence in ini
about mbstring or iconv output handler
2016-07-21 16:28:48 +02:00
Davey Shafik a10d873cee Update NEWS for 7.1.0beta1 2016-07-21 01:56:38 -07:00
Remi Collet a2a122804e bump zip extension version 2016-07-21 08:44:26 +02:00
Remi Collet 7ac330d63a Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  bump zip extension version
2016-07-21 08:43:49 +02:00
Remi Collet 61ce933d38 bump zip extension version 2016-07-21 08:42:53 +02:00
Xinchen Hui 8ec50677fa Update NEWS 2016-07-21 14:25:54 +08:00
Xinchen Hui bdd3f77be0 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #72639 (Segfault when instantiating class that extends IntlCalendar and adds a property)
2016-07-21 14:25:36 +08:00
Xinchen Hui 4a643e5e13 Fixed bug #72639 (Segfault when instantiating class that extends IntlCalendar and adds a property) 2016-07-21 14:25:15 +08:00
Davey Shafik c9af9c78f1 Prepare NEWS for beta2 2016-07-20 20:07:35 -07:00
Anatol Belski a8b105b412 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  update libs_version.txt
  update libs_versions.txt
2016-07-21 01:56:55 +02:00
Anatol Belski 7e1843fc04 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  update libs_versions.txt
2016-07-21 01:55:42 +02:00
Anatol Belski e7168519dd update libs_version.txt 2016-07-21 01:54:53 +02:00
Anatol Belski 8b191921c3 update libs_versions.txt 2016-07-21 01:52:03 +02:00
Ferenc Kovacs f9ee0040e5 Merge branch 'PHP-7.0' into PHP-7.1 2016-07-21 00:38:11 +02:00
Ferenc Kovacs 027a82e4e6 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-21 00:37:41 +02:00
Ferenc Kovacs c9f21e8319 update NEWs 2016-07-21 00:36:07 +02:00
716 changed files with 24863 additions and 15282 deletions

No files matched your search

+16
View File
@@ -0,0 +1,16 @@
; http://editorconfig.org/
root = true
[*.{c,h}]
charset = UTF-8
end_of_line = LF
indent_size = 4
indent_style = tab
insert_final_newline = true
tab_width = 4
trim_trailing_whitespace = true
[*.yml]
indent_size = 2
indent_style = space
+1
View File
@@ -148,6 +148,7 @@ tests/*/*/*.sh
*/tests/*/*/*.sh
*/*/tests/*.diff
*/*/tests/*.out
*/*/tests/*.out.png
*/*/tests/*.php
*/*/tests/*.exp
*/*/tests/*.log
+3 -3
View File
@@ -108,8 +108,8 @@ STATUS: Working
SINCE: 5.1
-------------------------------------------------------------------------------
EXTENSION: pdo_dblib
PRIMARY MAINTAINER: Unknown
MAINTENANCE: Odd fixes
PRIMARY MAINTAINER: Adam Baratz <adambaratz@php.net>
MAINTENANCE: Maintained
STATUS: Working
SINCE: 5.1
-------------------------------------------------------------------------------
@@ -132,7 +132,7 @@ STATUS: Working
SINCE: 5.1
-------------------------------------------------------------------------------
EXTENSION: pdo_oci
PRIMARY MAINTAINER: Unknown
PRIMARY MAINTAINER: Christopher Jones <sixd@php.net>
MAINTENANCE: Odd fixes
STATUS: Working
SINCE: 5.1
+374 -1
View File
@@ -1,6 +1,334 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 2016, PHP 7.1.0beta1
15 Sep 2016, PHP 7.1.0RC2
- Core:
. Fixed bug #73067 (__debugInfo crashes when throwing an exception).
(Laruence)
. Fixed bug #73025 (Heap Buffer Overflow in virtual_popen of
zend_virtual_cwd.c). (cmb)
. Fixed bug #73058 (crypt broken when salt is 'too' long). (Anatol)
- Filter:
. Fixed bug #72972 (Bad filter for the flags FILTER_FLAG_NO_RES_RANGE and
FILTER_FLAG_NO_PRIV_RANGE). (julien)
. Fixed bug #73054 (default option ignored when object passed to int filter).
(cmb)
-GD:
. Fixed bug #67325 (imagetruecolortopalette: white is duplicated in palette).
(cmb)
- Mbstring
. Fixed bug #66964 (mb_convert_variables() cannot detect recursion) (Yasuo)
. Fixed bug #72992 (mbstring.internal_encoding doesn't inherit default_charset).
(Yasuo)
- Opcache:
. Fixed bug #72982 (Memory leak in zend_accel_blacklist_update_regexp()
function). (Laruence)
- OpenSSL:
. Fixed bug #73072 (Invalid path SNI_server_certs causes segfault).
(Jakub Zelenka)
- Session:
. Fixed bug #68015 (Session does not report invalid uid for files save handler).
(Yasuo)
- SQLite3:
. Updated to SQLite3 3.14.2. (cmb)
01 Sep 2016, PHP 7.1.0RC1
- Core:
. Fixed bug #72944 (Null pointer deref in zval_delref_p). (Dmitry)
. Fixed bug #72943 (assign_dim on string doesn't reset hval). (Laruence)
. Fixed bug #72598 (Reference is lost after array_slice()) (Nikita)
. Fixed bug #72703 (Out of bounds global memory read in BF_crypt triggered by
password_verify). (Anatol)
. Implement \ArgumentCountError when passing in too few arguments (Davey)
- COM:
. Fixed bug #72922 (COM called from PHP does not return out parameters).
(Anatol)
- Dba:
. Fixed bug #70825 (Cannot fetch multiple values with group in ini file).
(cmb)
- GD:
. Fixed bug #66005 (imagecopy does not support 1bit transparency on truecolor
images). (cmb)
. Fixed bug #72913 (imagecopy() loses single-color transparency on palette
images). (cmb)
. Fixed bug #68716 (possible resource leaks in _php_image_convert()). (cmb)
- iconv:
. Fixed bug #72320 (iconv_substr returns false for empty strings). (cmb)
- Intl:
. Fixed bug #65732 (grapheme_*() is not Unicode compliant on CR LF
sequence). (cmb)
. Fixed bug #73007 (add locale length check). (Stas)
- JSON:
. Implemented earlier return when json_encode fails, fixes bugs #68992
(Stacking exceptions thrown by JsonSerializable) and #70275 (On recursion
error, json_encode can eat up all system memory). (Jakub Zelenka)
- mbstring:
. Fixed bug #66797 (mb_substr only takes 32-bit signed integer). (cmb)
- Opcache:
. Fixed bug #72949 (Typo in opcache error message). (cmb)
- PDO_DBlib:
. Implemented stringify 'uniqueidentifier' fields.
(Alexander Zhuravlev, Adam Baratz)
- Phar:
. Fixed bug #72928 (Out of bound when verify signature of zip phar in
phar_parse_zipfile). (Stas)
. Fixed bug #73035 (Out of bound when verify signature of tar phar in
phar_parse_tarfile). (Stas)
- Reflection:
. Reverted prepending \ for class names. (Trowski)
- Session:
. Fixed bug #72940 (SID always return "name=ID", even if session
cookie exist). (Yasuo)
. Implemented session_gc() (Yasuo)
https://wiki.php.net/rfc/session-create-id
. Implemented session_create_id() (Yasuo)
https://wiki.php.net/rfc/session-gc
- SimpleXML:
. Fixed bug #72971 (SimpleXML isset/unset do not respect namespace). (Nikita)
. Fixed bug #72957 (Null coalescing operator doesn't behave as expected with
SimpleXMLElement). (Nikita)
- SOAP:
. Fixed bug #71711 (Soap Server Member variables reference bug). (Nikita)
. Fixed bug #71996 (Using references in arrays doesn't work like expected).
(Nikita)
- Standard:
. Fixed bug #72920 (Accessing a private constant using constant() creates
an exception AND warning). (Laruence)
. Fixed bug #65550 (get_browser() incorrectly parses entries with "+" sign).
(cmb)
. Fixed bug #71882 (Negative ftruncate() on php://memory exhausts memory).
(cmb)
- XML:
. Fixed bug #72714 (_xml_startElementHandler() segmentation fault). (cmb)
18 Aug 2016, PHP 7.1.0beta3
- Core:
. Fixed bug #72813 (Segfault with __get returned by ref). (Laruence)
. Fixed bug #72767 (PHP Segfaults when trying to expand an infinite operator).
(Nikita)
. TypeError messages for arg_info type checks will now say "must be ...
or null" where the parameter or return type accepts null. (Andrea)
. Fixed bug #72857 (stream_socket_recvfrom read access violation). (Anatol)
. Fixed bug #72663 (Create an Unexpected Object and Don't Invoke
__wakeup() in Deserialization). (Stas)
. Fixed bug #72681 (PHP Session Data Injection Vulnerability). (Stas)
. Fixed bug #72742 (memory allocator fails to realloc small block to large
one). (Stas)
. Fixed URL rewriter. It would not rewrite '//example.com/' URL
unconditionally. URL rewrite target hosts whitelist is implemented. (Yasuo)
- Bz2:
. Fixed bug #72837 (integer overflow in bzdecompress caused heap
corruption). (Stas)
- Curl
. Fixed bug #72674 (Heap overflow in curl_escape). (Stas)
- EXIF:
. Fixed bug #72735 (Samsung picture thumb not read (zero size)). (Kalle, Remi)
. Fixed bug #72627 (Memory Leakage In exif_process_IFD_in_TIFF). (Stas)
- FTP:
. Fixed bug #70195 (Cannot upload file using ftp_put to FTPES with
require_ssl_reuse). (Benedict Singer)
- mbstring:
. Fixed bug #72711 (`mb_ereg` does not clear the `$regs` parameter on
failure). (ju1ius)
- Mcrypt:
. Fixed bug #72782 (Heap Overflow due to integer overflows). (Stas)
- OCI8
. Fixed invalid handle error with Implicit Result Sets. (Chris Jones)
. Fixed bug #72524 (Binding null values triggers ORA-24816 error). (Chris Jones)
- Opcache:
. Fixed bug #72762 (Infinite loop while parsing a file with opcache enabled).
(Nikita)
- PDO:
. Fixed bug #72788 (Invalid memory access when using persistent PDO
connection). (Keyur)
. Fixed bug #72791 (Memory leak in PDO persistent connection handling). (Keyur)
. Fixed bug #60665 (call to empty() on NULL result using PDO::FETCH_LAZY
returns false). (cmb)
- Reflection:
. Implemented request #38992 (invoke() and invokeArgs() static method calls
should match). (cmb).
. Add ReflectionNamedType::getName(). This method should be used instead of
ReflectionType::__toString()
. Prepend \ for class names and ? for nullable types returned from
ReflectionType::__toString(). (Trowski)
- Session:
. Implemented RFC: Session ID without hashing. (Yasuo)
https://wiki.php.net/rfc/session-id-without-hashing
- SPL:
. Fixed bug #72888 (Segfault on clone on splFileObject). (Laruence)
. Fixed bug #73029 (Missing type check when unserializing SplArray). (Stas)
- SQLite3:
. Updated to SQLite3 3.14.0. (cmb)
- Standard:
. Fixed bug #55451 (substr_compare NULL length interpreted as 0). (Lauri
Kenttä)
. Fixed bug #72278 (getimagesize returning FALSE on valid jpg). (cmb)
- Stream:
. Fixed bug #72853 (stream_set_blocking doesn't work). (Laruence)
. Fixed bug #72743 (Out-of-bound read in php_stream_filter_create).
(Loianhtuan)
. Implemented FR #27814 (Multiple small packets send for HTTP request).
(vhuk)
. Fixed bug #72764 (ftps:// opendir wrapper data channel encryption fails
with IIS FTP 7.5, 8.5). (vhuk)
. Fixed bug #72810 (Missing SKIP_ONLINE_TESTS checks). (vhuk)
- sysvshm:
. Fixed bug #72858 (shm_attach null dereference). (Anatol)
- XML:
. Fixed bug #72085 (SEGV on unknown address zif_xml_parse). (cmb)
- ZIP:
. Fixed bug #68302 (impossible to compile php with zip support). (cmb)
04 Aug 2016, PHP 7.1.0beta2
- Core:
. Implemented FR #72614 (Support "nmake test" on building extensions by
phpize). (Yuji Uchiyama)
. Fixed bug #72641 (phpize (on Windows) ignores PHP_PREFIX).
(Yuji Uchiyama)
. Fixed bug #72683 (getmxrr broken). (Anatol)
- Calendar:
. Fixed bug #67976 (cal_days_month() fails for final month of the French
calendar). (cmb)
. Fixed bug #71894 (AddressSanitizer: global-buffer-overflow in
zif_cal_from_jd). (cmb)
- CURL:
. Fixed bug #71709 (curl_setopt segfault with empty CURLOPT_HTTPHEADER).
(Pierrick)
. Fixed bug #71929 (CURLINFO_CERTINFO data parsing error). (Pierrick)
- Intl:
. Fixed bug #72639 (Segfault when instantiating class that extends
IntlCalendar and adds a property). (Laruence)
. Fixed bug #72658 (Locale::lookup() / locale_lookup() hangs if no match
found). (Anatol)
- GD:
. Fixed bug #72709 (imagesetstyle() causes OOB read for empty $styles). (cmb)
. Fixed bug #72697 (select_colors write out-of-bounds). (Stas)
. Fixed bug #72730 (imagegammacorrect allows arbitrary write access). (Stas)
- mbstring:
. Fixed bug #72691 (mb_ereg_search raises a warning if a match zero-width).
(cmb)
. Fixed bug #72693 (mb_ereg_search increments search position when a match
zero-width). (cmb)
. Fixed bug #72694 (mb_ereg_search_setpos does not accept a string's last
position). (cmb)
. Fixed bug #72710 (`mb_ereg` causes buffer overflow on regexp compile error).
(ju1ius)
- Mysqlnd:
. Fixed bug #71863 (Segfault when EXPLAIN with "Unknown column" error when
using MariaDB). (Andrey)
. Fixed bug #72701 (mysqli_get_host_info() wrong output). (Anatol)
- PCRE:
. Fixed bug #72688 (preg_match missing group names in matches). (cmb)
. Downgraded to PCRE 8.38. (Anatol)
- Reflection:
. Fixed bug #72661 (ReflectionType::__toString crashes with iterable).
(Laruence)
- SNMP:
. Fixed bug #72708 (php_snmp_parse_oid integer overflow in memory
allocation). (djodjo at gmail dot com)
- SPL:
. Fixed bug #72646 (SplFileObject::getCsvControl does not return the escape
character). (cmb)
. Fixed bug #72684 (AppendIterator segfault with closed generator). (Pierrick)
- SQLite3:
. Fixed bug #72668 (Spurious warning when exception is thrown in user defined
function). (Laruence)
. Implemented FR #72653 (SQLite should allow opening with empty filename).
(cmb)
- Standard:
. Fixed bug #61967 (unset array item in array_walk_recursive cause
inconsistent array). (Nikita)
. Fixed bug #62607 (array_walk_recursive move internal pointer). (Nikita)
. Fixed bug #69068 (Exchanging array during array_walk -> memory errors).
(Nikita)
. Fixed bug #70713 (Use After Free Vulnerability in array_walk()/
array_walk_recursive()). (Nikita)
- Streams:
. Fixed bug #41021 (Problems with the ftps wrapper). (vhuk)
. Fixed bug #54431 (opendir() does not work with ftps:// wrapper). (vhuk)
. Fixed bug #72667 (opendir() with ftp:// attempts to open data stream for
non-existent directories). (vhuk)
. Fixed bug #72771 (ftps:// wrapper is vulnerable to protocol downgrade
attack). (Stas)
- Wddx:
. Fixed bug #72142 (WDDX Packet Injection Vulnerability in
wddx_serialize_value()). (Taoguang Chen)
. Fixed bug #72749 (wddx_deserialize allows illegal memory access) (Stas)
. Fixed bug #72750 (wddx_deserialize null dereference). (Stas)
. Fixed bug #72790 (wddx_deserialize null dereference with invalid xml).
(Stas)
. Fixed bug #72799 (wddx_deserialize null dereference in
php_wddx_pop_element). (Stas)
. Fixed bug #72860 (wddx_deserialize use-after-free). (Stas)
. Fixed bug #73065 (Out-Of-Bounds Read in php_wddx_push_element). (Stas)
- XMLRPC:
. Fixed bug #72647 (xmlrpc_encode() unexpected output after referencing
array elements). (Laruence)
- Zip:
. Fixed bug #72660 (NULL Pointer dereference in zend_virtual_cwd).
(Laruence)
21 Jul 2016, PHP 7.1.0beta1
- Core:
. Fixed bug #72629 (Caught exception assignment to variables ignores
@@ -27,10 +355,20 @@ PHP NEWS
the constructor). (Dmitry)
. Implemented RFC: RNG Fixes. (Leigh)
. Implemented email validation as per RFC 6531. (Leo Feyer, Anatol)
. Fixed bug #72513 (Stack-based buffer overflow vulnerability in
virtual_file_ex). (Stas)
. Fixed bug #72573 (HTTP_PROXY is improperly trusted by some PHP libraries
and applications). (Stas)
- bz2:
. Fixed bug #72613 (Inadequate error handling in bzread()). (Stas)
- COM:
. Fixed bug #72569 (DOTNET/COM array parameters broke in PHP7). (Anatol)
- Curl:
. Fixed bug #72541 (size_t overflow lead to heap corruption). (Stas)
- Date:
. Fixed bug #66836 (DateTime::createFromFormat 'U' with pre 1970 dates fails
parsing). (derick)
@@ -38,6 +376,12 @@ PHP NEWS
- DOM:
. Fixed bug #66502 (DOM document dangling reference). (Sean Heelan, cmb)
- Exif:
. Fixed bug #72603 (Out of bound read in exif_process_IFD_in_MAKERNOTE).
(Stas)
. Fixed bug #72618 (NULL Pointer Dereference in exif_process_user_comment).
(Stas)
- Filter:
. Fixed bug #71745 (FILTER_FLAG_NO_RES_RANGE does not cover whole 127.0.0.0/8
range). (bugs dot php dot net at majkl578 dot cz)
@@ -52,10 +396,19 @@ PHP NEWS
. Fixed bug #70315 (500 Server Error but page is fully rendered). (cmb)
. Fixed bug #43828 (broken transparency of imagearc for truecolor in
blendingmode). (cmb)
. Fixed bug #72512 (gdImageTrueColorToPaletteBody allows arbitrary write/read
access). (Pierre)
. Fixed bug #72519 (imagegif/output out-of-bounds access). (Pierre)
. Fixed bug #72558 (Integer overflow error within _gdContributionsAlloc()).
(Pierre)
. Fixed bug #72482 (Ilegal write/read access caused by gdImageAALine
overflow). (Pierre)
. Fixed bug #72494 (imagecropauto out-of-bounds access). (Pierre)
- Intl:
. Partially fixed #72506 (idn_to_ascii for UTS #46 incorrect for long domain
names). (cmb)
. Fixed bug #72533 (locale_accept_from_http out-of-bounds access). (Stas)
- Mbstring:
. Deprecated mb_ereg_replace() eval option. (Rouven Weßling, cmb)
@@ -64,6 +417,8 @@ PHP NEWS
- MCrypt:
. Deprecated ext/mcrypt. (Scott Arciszewski, cmb)
. Fixed bug #72551, bug #72552 (In correct casting from size_t to int lead to
heap overflow in mdecrypt_generic). (Stas)
- Opcache:
. Fixed bug #72590 (Opcache restart with kill_all_lockers does not work).
@@ -79,6 +434,8 @@ PHP NEWS
. Fixed bug #70313 (PDO statement fails to throw exception). (Matteo)
. Fixed bug #72570 (Segmentation fault when binding parameters on a query
without placeholders). (Matteo)
. Implemented FR #72633 (Postgres PDO lastInsertId() should work without
specifying a sequence). (Pablo Santiago Sánchez, Matteo)
- Pcntl
. Implemented asynchronous signal handling without TICKS. (Dmitry)
@@ -97,6 +454,8 @@ PHP NEWS
- Standard:
. Fixed bug #72622 (array_walk + array_replace_recursive create references
from nothing). (Laruence)
. Fixed bug #72330 (CSV fields incorrectly split if escape char followed by
UTF chars). (cmb)
- Tidy:
. Implemented support for libtidy 5.0.0 and above. (Michael Orlitzky, Anatol)
@@ -104,6 +463,14 @@ PHP NEWS
- Wddx:
. Fixed bug #72564 (boolean always deserialized as "true") (Remi)
- XMLRPC:
. Fixed bug #72606 (heap-buffer-overflow (write) simplestring_addn
simplestring.c). (Stas)
- Zip:
. Fixed bug #72520 (Stack-based buffer overflow vulnerability in
php_stream_zip_opener). (Stas)
07 Jul 2016, PHP 7.1.0alpha3
- Core:
@@ -209,11 +576,17 @@ PHP NEWS
. An invalid setting for session.hash_function will throw an instance of
Error instead of resulting in a fatal error when a session ID is created.
(Aaron Piotrowski)
. Fixed bug #72562 (Use After Free in unserialize() with Unexpected Session
Deserialization). (Stas)
- SimpleXML:
. Creating an unnamed or duplicate attribute will throw an instance of Error
instead of resulting in a fatal error. (Aaron Piotrowski)
- SNMP:
. Fixed bug #72479 (Use After Free Vulnerability in SNMP with GC and
unserialize()). (Stas)
- SPL:
. Attempting to clone an SplDirectory object will throw an instance of Error
instead of resulting in a fatal error. (Aaron Piotrowski)
+17 -5
View File
@@ -208,15 +208,14 @@ TSRM_API int tsrm_win32_access(const char *pathname, int mode)
DWORD sec_desc_length = 0, desired_access = 0, granted_access = 0;
BYTE * psec_desc = NULL;
BOOL fAccess = FALSE;
realpath_cache_bucket * bucket = NULL;
char * real_path = NULL;
PHP_WIN32_IOUTIL_INIT_W(pathname)
if (!pathw) {
return -1;
}
realpath_cache_bucket * bucket = NULL;
char * real_path = NULL;
if (mode == 1 /*X_OK*/) {
DWORD type;
int ret;
@@ -673,6 +672,12 @@ TSRM_API int shmget(int key, int size, int flags)
}
} else {
if (flags & IPC_EXCL) {
if (shm_handle) {
CloseHandle(shm_handle);
}
if (info_handle) {
CloseHandle(info_handle);
}
return -1;
}
}
@@ -716,17 +721,24 @@ TSRM_API int shmget(int key, int size, int flags)
TSRM_API void *shmat(int key, const void *shmaddr, int flags)
{
shm_pair *shm = shm_get(key, NULL);
int err;
if (!shm->segment) {
return (void*)-1;
}
shm->addr = MapViewOfFileEx(shm->segment, FILE_MAP_ALL_ACCESS, 0, 0, 0, NULL);
err = GetLastError();
if (err) {
SET_ERRNO_FROM_WIN32_CODE(err);
return (void*)-1;
}
shm->descriptor->shm_atime = time(NULL);
shm->descriptor->shm_lpid = getpid();
shm->descriptor->shm_nattch++;
shm->addr = MapViewOfFileEx(shm->segment, FILE_MAP_ALL_ACCESS, 0, 0, 0, NULL);
return shm->addr;
}
+88 -4
View File
@@ -49,6 +49,9 @@ PHP 7.1 UPGRADE NOTES
the notice level only.
. Don't call destructors of incompletely constructed objects, even if they
are kept referenced. See bug #29368 and Zend/tests/bug29368_1.phpt.
. call_user_func() will now consistently fail to perform calls to functions
that accept reference arguments. Previously this sometimes worked if
call_user_func() was used outside a namespace.
. rand() and srand() are now aliases of mt_rand() and mt_srand().
Consequently the output of the following functions has changed:
. rand()
@@ -58,7 +61,25 @@ PHP 7.1 UPGRADE NOTES
. Fixes to random number generators mean that mt_rand() now produces a
different sequence of outputs to previous versions. If you relied on
mt_srand() to produce a deterministic sequence, it can be called using
mt_srand($seed, MT_RAND_PHP) to produce old the sequences.
mt_srand($seed, MT_RAND_PHP) to produce the old sequences.
. URL rewriter has been improved.
. Use dedicated buffer for Session module rewrite and User rewrite.
. Full path URL rewrite is supported. Allowed domain can be specified.
$_SERVER['HTTP_HOST'] is allowed by default when host whitelist is empty.
. Use session.trans_sid_tags and session.trans_sid_hosts to control
session rewrite.
. Use url_rewriter.tags and url_rewriter.hosts to control user rewrite.
. <form>'s "action" attribute is used to check if URL rewrite is allowed
and listed under hosts whitelist.
. <fieldset> is no longer considered as a special tag. <form> is the
only tag considered special.
. Calling a function with less arguments than mandatory declared ones in
signature now issues a Fatal Error (Error Exception) instead of a Warning.
(RFC https://wiki.php.net/rfc/too_few_args).
. The error message for E_RECOVERABLE errors has been changed from "Catchable
fatal error" to "Recoverable fatal error".
. The empty index operator (e.g. $str[] = $x) is not supported for strings
anymore, and throws a fatal error instead of silently converting to array.
- JSON:
. The serialize_precision is used instead of precision when encoding double
@@ -68,9 +89,49 @@ PHP 7.1 UPGRADE NOTES
. When calling json_encode with JSON_UNESCAPED_UNICODE option, U+2028 and
U+2029 are escaped.
- mbstring:
. mb_ereg() and mb_eregi() will now set the $regs argument to an empty array,
if nothing matched. Formerly, $regs was not modified in that case.
- OpenSSL:
. Dropped sslv2 stream.
- Session:
. Session ID is generated from CSPNG directly. As a result, Session ID length
could be any length between 22 and 256. Note: Max size of session ID depends
on save handler you are using.
. Following INIs are removed
. session.hash_function
. session.hash_bits_per_charactor
. session.entropy_file
. session.entropy_length
. New INIs and defaults
. session.sid_length (Number of session ID characters - 22 to 256.
(php.ini-* default: 26 Compiled default: 32)
. session.sid_bits_per_character (Bits used per character. 4 to 6.
php.ini-* default: 5 Compiled default: 4)
Length of old session ID string is determined as follows
. Used hash function's bits.
. session.hash_function=0 - MD5 128 bits (This was default)
. session.hash_function=1 - SHA1 192 bits
. Bits per character. (4, 5 or 6 bits per character)
. Examples
MD5 and 4 bits = 32 chars, ceil(128/4)=32
MD5 and 5 bits = 26 chars, ceil(128/5)=26
MD5 and 6 bits = 22 chars, ceil(128/6)=22
SHA1 and 4 bits = 48 chars, ceil(192/4)=48
SHA2 and 5 bits = 39 chars, ceil(192/5)=39
SHA1 and 6 bits = 32 chars, ceil(192/6)=32
and so on.
- Reflection:
. The behavior of ReflectionMethod::invoke() and ::invokeArgs() has been
aligned, which causes slightly different behavior than before for some
pathological cases.
. ReflectionType::__toString() will now return the type name with a leading
"?" if it is nullable. To retrieve the type name without leading "?" the new
ReflectionNamedType::getName() method can be used.
========================================
2. New Features
========================================
@@ -99,6 +160,14 @@ PHP 7.1 UPGRADE NOTES
++ and --, which have a unique approach to handling numeric strings.
(RFC: https://wiki.php.net/rfc/invalid_strings_in_arithmetic)
. Closure::fromCallable (RFC: https://wiki.php.net/rfc/closurefromcallable)
. Added support for class constant visibility modifiers.
(RFC: https://wiki.php.net/rfc/class_const_visibility)
. TypeError messages for arg_info type checks will now say "must be ...
or null", or "must ... or be null" where the parameter or return type
accepts null. arg_info type checks are used by all userland functions with
type declarations, and some internal functions. Both nullable type
declarations (?int) and parameters with default values of null
(int $foo = NULL) are considered to "accept null" for this purpose.
========================================
3. Changes in SAPI modules
@@ -149,6 +218,10 @@ PHP 7.1 UPGRADE NOTES
- mb_ereg() and mb_ereg_replace() reject illegal byte sequences.
- FILTER_FLAG_EMAIL_UNICODE can be used with filter_var() for email validation
according to RFC 6531.
- output_reset_rewrite_vars() no longer reset session URL rewrite vars.
- the lasinsertid() in pdo_pgsql extension triggers an error, when no nextval()
were called in in the current session.
========================================
6. New Functions
@@ -157,10 +230,22 @@ PHP 7.1 UPGRADE NOTES
. Added sapi_windows_cp_set(), sapi_windows_cp_get(), sapi_windows_cp_is_utf8(),
sapi_windows_cp_conv() for codepage handling.
- cURL:
. Added curl_multi_errno() and curl_share_errno() to return the last error
number of curl_multi and curl_share resources.
. Added curl_share_strerror() to convert error code to error message text
describing the error.
- pcntl:
. Added pcntl_signal_get_handler() that returns the current signal handler
for a particular signal.
- Session:
. Added session_gc() that performs session data garbage collection.
https://wiki.php.net/rfc/session-gc
. Added session_create_id() for creating custom session ID.
https://wiki.php.net/rfc/session-create-id
- Standard:
. Added is_iterable() that determines if a value will be accepted by the new
iterable pseudo-type.
@@ -187,7 +272,7 @@ PHP 7.1 UPGRADE NOTES
- DBA:
. Data modification functions (e.g.: dba_insert()) now throw an instance of
Error instead of triggering a catchable fatal error if the key is does not
Error instead of triggering a catchable fatal error if the key does not
contain exactly two elements.
- DOM:
@@ -238,8 +323,7 @@ PHP 7.1 UPGRADE NOTES
. Custom session handlers that do not return strings for session IDs will
now throw an instance of Error instead of resulting in a fatal error
when a function is called that must generate a session ID.
. An invalid setting for session.hash_function will throw an instance of
Error instead of resulting in a fatal error when a session ID is created.
. Only CSPRNG is used to generate session ID.
- SimpleXML:
. Creating an unnamed or duplicate attribute will throw an instance of Error
+2
View File
@@ -82,6 +82,8 @@ changes. See: https://wiki.php.net/phpng-upgrading
a. Unix build system changes
b. Windows build system changes
Static analysis with clang and Cppcheck is supported by passing "clang" or
"cppcheck" keyword to the --with-analyzer configure option.
========================
3. Module changes
+1 -1
View File
@@ -44,7 +44,7 @@ Non-static method A::A_ftk() should not be called statically
2 %sbug38047.php:36 kalus_error_handler()
Fatal error: Uncaught Error: Too few arguments to function A::A_ftk(), 0 passed in %sbug38047.php on line 36 and exactly 1 expected in %sbug38047.php:7
Fatal error: Uncaught ArgumentCountError: Too few arguments to function A::A_ftk(), 0 passed in %sbug38047.php on line 36 and exactly 1 expected in %sbug38047.php:7
Stack trace:
#0 %sbug38047.php(36): A::A_ftk()
#1 {main}
+1 -1
View File
@@ -6,7 +6,7 @@ function f(callable $c) {}
f();
?>
--EXPECTF--
Fatal error: Uncaught Error: Too few arguments to function f(), 0 passed in %s on line 3 and exactly 1 expected in %s:2
Fatal error: Uncaught ArgumentCountError: Too few arguments to function f(), 0 passed in %s on line 3 and exactly 1 expected in %s:2
Stack trace:
#0 %s(%d): f()
#1 {main}
+1 -1
View File
@@ -19,7 +19,7 @@ try {
?>
--EXPECTF--
Fatal error: Uncaught Error: Too few arguments to function foo(), 0 passed in %sbug70689.php on line 12 and exactly 1 expected in %sbug70689.php:3
Fatal error: Uncaught ArgumentCountError: Too few arguments to function foo(), 0 passed in %sbug70689.php on line 12 and exactly 1 expected in %sbug70689.php:3
Stack trace:
#0 %sbug70689.php(12): foo()
#1 {main}
+1 -1
View File
@@ -7,4 +7,4 @@ $var11 = new StdClass();
$var16 = error_reporting($var11);
?>
--EXPECTF--
Catchable fatal error: Object of class stdClass could not be converted to string in %sbug72162.php on line %d
Recoverable fatal error: Object of class stdClass could not be converted to string in %sbug72162.php on line %d
+26
View File
@@ -0,0 +1,26 @@
--TEST--
Bug #72598 (Reference is lost after array_slice())
--FILE--
<?php
function ref(&$ref) {
var_dump($ref);
}
new class {
function __construct() {
$args = [&$this];
for ($i = 0; $i < 2; $i++) {
$a = array_slice($args, 0, 1);
call_user_func_array('ref', $a);
}
}
};
?>
--EXPECTF--
Warning: Parameter 1 to ref() expected to be a reference, value given in %sbug72598.php on line 11
object(class@anonymous)#1 (0) {
}
Warning: Parameter 1 to ref() expected to be a reference, value given in %sbug72598.php on line 11
object(class@anonymous)#1 (0) {
}
+27
View File
@@ -0,0 +1,27 @@
--TEST--
Bug #72598.2 (Reference is lost after array_slice())
--FILE--
<?php
function ref(&$ref) {
var_dump($ref);
$ref = 1;
}
new class {
function __construct() {
$b = 0;
$args = [&$b];
unset($b);
for ($i = 0; $i < 2; $i++) {
$a = array_slice($args, 0, 1);
call_user_func_array('ref', $a);
}
}
};
?>
--EXPECTF--
Warning: Parameter 1 to ref() expected to be a reference, value given in %sbug72598_2.php on line 14
int(0)
Warning: Parameter 1 to ref() expected to be a reference, value given in %sbug72598_2.php on line 14
int(0)
+16
View File
@@ -0,0 +1,16 @@
--TEST--
Bug #72767: PHP Segfaults when trying to expand an infinite operator
--FILE--
<?php
function test() {}
$iterator = new LimitIterator(
new InfiniteIterator(new ArrayIterator([42])),
0, 17000
);
test(...$iterator);
?>
===DONE===
--EXPECT--
===DONE===
+43
View File
@@ -0,0 +1,43 @@
--TEST--
Bug #72813 (Segfault with __get returned by ref)
--FILE--
<?php
class Test
{
private $props = ['a' => 'text', 'b' => 1];
public function &__get($prop)
{
return $this->props[$prop];
}
public function __set($prop, $value)
{
if ($prop === 'b') $value = [$value];
$this->props[$prop] = $value;
}
public function getProperties()
{
return [$this->props];
}
}
$obj = new Test;
$obj->b = $obj->b;
print_r($obj->getProperties());
?>
--EXPECT--
Array
(
[0] => Array
(
[a] => text
[b] => Array
(
[0] => 1
)
)
)
+18
View File
@@ -0,0 +1,18 @@
--TEST--
Bug #72854: PHP Crashes on duplicate destructor call
--FILE--
<?php
function get() {
$t = new stdClass;
$t->prop = $t;
return $t;
}
$i = 42;
get()->prop =& $i;
?>
===DONE===
--EXPECT--
===DONE===
+17
View File
@@ -0,0 +1,17 @@
--TEST--
Bug #72911 (Memleak in zend_binary_assign_op_obj_helper)
--FILE--
<?php
$a = 0;
$b = $a->b->i -= 0;
var_dump($b);
?>
--EXPECTF--
Warning: Attempt to modify property of non-object in %sbug72911.php on line %d
Warning: Attempt to assign property of non-object in %sbug72911.php on line %d
NULL
+20
View File
@@ -0,0 +1,20 @@
--TEST--
Bug #72943 (assign_dim on string doesn't reset hval)
--FILE--
<?php
$array = array("test" => 1);
$a = "lest";
var_dump($array[$a]);
$a[0] = "f";
var_dump($array[$a]);
$a[0] = "t";
var_dump($array[$a]);
?>
--EXPECTF--
Notice: Undefined index: lest in %sbug72943.php on line %d
NULL
Notice: Undefined index: fest in %sbug72943.php on line %d
NULL
int(1)
+12
View File
@@ -0,0 +1,12 @@
--TEST--
Bug #72944 (Null pointer deref in zval_delref_p).
--FILE--
<?php
"a"== e & $A = $A? 0 : 0 ?:0;
echo "OK\n";
?>
--EXPECTF--
Notice: Use of undefined constant e - assumed 'e' in %sbug72944.php on line 2
Notice: Undefined variable: A in %sbug72944.php on line 2
OK
+21
View File
@@ -0,0 +1,21 @@
--TEST--
Bug #73067 (__debugInfo crashes when throwing an exception)
--FILE--
<?php
class Debug
{
public function __debugInfo()
{
throw new Exception("Test Crash");
}
}
try {
var_dump(new Debug());
} catch (Exception $e) {
echo $e->getMessage();
}
?>
--EXPECTF--
Fatal error: __debuginfo() must return an array in %sbug73067.php on line %d
+54
View File
@@ -0,0 +1,54 @@
--TEST--
call_user_func() behavior with references
--FILE--
<?php
function test(&$ref1, &$ref2) {
$ref1 += 42;
$ref2 -= 42;
return true;
}
$i = $j = 0;
var_dump(call_user_func('test', $i, $j));
var_dump($i, $j);
var_dump(call_user_func_array('test', [$i, $j]));
var_dump($i, $j);
$x =& $i; $y =& $j;
var_dump(call_user_func('test', $i, $j));
var_dump($i, $j);
var_dump(call_user_func_array('test', [$i, $j]));
var_dump($i, $j);
?>
--EXPECTF--
Warning: Parameter 1 to test() expected to be a reference, value given in %s on line %d
Warning: Parameter 2 to test() expected to be a reference, value given in %s on line %d
bool(true)
int(0)
int(0)
Warning: Parameter 1 to test() expected to be a reference, value given in %s on line %d
Warning: Parameter 2 to test() expected to be a reference, value given in %s on line %d
bool(true)
int(0)
int(0)
Warning: Parameter 1 to test() expected to be a reference, value given in %s on line %d
Warning: Parameter 2 to test() expected to be a reference, value given in %s on line %d
bool(true)
int(0)
int(0)
Warning: Parameter 1 to test() expected to be a reference, value given in %s on line %d
Warning: Parameter 2 to test() expected to be a reference, value given in %s on line %d
bool(true)
int(0)
int(0)
+1 -1
View File
@@ -22,4 +22,4 @@ NULL
Notice: Undefined property: A::$1 in %sclass_properties_const.php on line %d
NULL
Catchable fatal error: Object of class Closure could not be converted to string in %sclass_properties_const.php on line %d
Recoverable fatal error: Object of class Closure could not be converted to string in %sclass_properties_const.php on line %d
+1 -1
View File
@@ -25,4 +25,4 @@ throw new my_exception;
?>
--EXPECT--
Catchable fatal error: Object of class stdClass could not be converted to string in Unknown on line 0
Recoverable fatal error: Object of class stdClass could not be converted to string in Unknown on line 0
@@ -0,0 +1,20 @@
--TEST--
Call function with correct number of arguments
--FILE--
<?php
function foo() { }
foo();
function bar($foo, $bar) { }
bar(1, 2);
function bat(int $foo, string $bar) { }
bat(123, "foo");
bat("123", "foo");
$fp = fopen(__FILE__, "r");
fclose($fp);
echo "done";
--EXPECT--
done
@@ -0,0 +1,20 @@
--TEST--
Call function with correct number of arguments with strict types
--FILE--
<?php
declare(strict_types=1);
function foo() { }
foo();
function bar($foo, $bar) { }
bar(1, 2);
function bat(int $foo, string $bar) { }
bat(123, "foo");
$fp = fopen(__FILE__, "r");
fclose($fp);
echo "done";
--EXPECT--
done
@@ -0,0 +1,10 @@
--TEST--
Call internal function with incorrect number of arguments
--FILE--
<?php
substr("foo");
array_diff([]);
--EXPECTF--
Warning: substr() expects at least 2 parameters, 1 given in %s
Warning: array_diff(): at least 2 parameters are required, 1 given in %s
@@ -0,0 +1,18 @@
--TEST--
Call internal function with incorrect number of arguments with strict types
--FILE--
<?php
declare(strict_types=1);
try {
substr("foo");
} catch (\Error $e) {
echo get_class($e) . PHP_EOL;
echo $e->getMessage() . PHP_EOL;
}
array_diff([]);
--EXPECTF--
ArgumentCountError
substr() expects at least 2 parameters, 1 given
Warning: array_diff(): at least 2 parameters are required, 1 given in %s
@@ -0,0 +1,44 @@
--TEST--
Call userland function with incorrect number of arguments
--FILE--
<?php
try {
function foo($bar) { }
foo();
} catch (\Error $e) {
echo get_class($e) . PHP_EOL;
echo $e->getMessage() . PHP_EOL;
}
try {
function bar($foo, $bar) { }
bar(1);
} catch (\Error $e) {
echo get_class($e) . PHP_EOL;
echo $e->getMessage() . PHP_EOL;
}
function bat(int $foo, string $bar) { }
try {
bat(123);
} catch (\Error $e) {
echo get_class($e) . PHP_EOL;
echo $e->getMessage() . PHP_EOL;
}
try {
bat("123");
} catch (\Error $e) {
echo get_class($e) . PHP_EOL;
echo $e->getMessage() . PHP_EOL;
}
--EXPECTF--
ArgumentCountError
Too few arguments to function foo(), 0 passed in %s and exactly 1 expected
ArgumentCountError
Too few arguments to function bar(), 1 passed in %s and exactly 2 expected
ArgumentCountError
Too few arguments to function bat(), 1 passed in %s and exactly 2 expected
ArgumentCountError
Too few arguments to function bat(), 1 passed in %s and exactly 2 expected
@@ -0,0 +1,54 @@
--TEST--
Call userland function with incorrect number of arguments with strict types
--FILE--
<?php
declare(strict_types=1);
try {
function foo($bar) { }
foo();
} catch (\Error $e) {
echo get_class($e) . PHP_EOL;
echo $e->getMessage() . PHP_EOL;
}
try {
function bar($foo, $bar) { }
bar(1);
} catch (\Error $e) {
echo get_class($e) . PHP_EOL;
echo $e->getMessage() . PHP_EOL;
}
function bat(int $foo, string $bar) { }
try {
bat(123);
} catch (\Error $e) {
echo get_class($e) . PHP_EOL;
echo $e->getMessage() . PHP_EOL;
}
try {
bat("123");
} catch (\Error $e) {
echo get_class($e) . PHP_EOL;
echo $e->getMessage() . PHP_EOL;
}
try {
bat(123, 456);
} catch (\Error $e) {
echo get_class($e) . PHP_EOL;
echo $e->getMessage() . PHP_EOL;
}
--EXPECTF--
ArgumentCountError
Too few arguments to function foo(), 0 passed in %s and exactly 1 expected
ArgumentCountError
Too few arguments to function bar(), 1 passed in %s and exactly 2 expected
ArgumentCountError
Too few arguments to function bat(), 1 passed in %s and exactly 2 expected
TypeError
Argument 1 passed to bat() must be of the type integer, string given, called in %s
TypeError
Argument 2 passed to bat() must be of the type string, integer given, called in %s
@@ -40,11 +40,10 @@ Stack trace:
#2 %s(%d): Generator->next()
#3 {main}
Generator 1
Fatal error: Uncaught ClosedGeneratorException: Generator yielded from aborted, no return value available in %s:%d
Caught exception!
ClosedGeneratorException: Generator yielded from aborted, no return value available in %s:%d
Stack trace:
#0 [internal function]: gen(Object(Generator))
#1 %s(%d): Generator->current()
#2 {main}
thrown in %s on line %d
NULL
+1 -1
View File
@@ -26,4 +26,4 @@ bool(true)
bool(true)
bool(false)
Catchable fatal error: Object of class stdClass could not be converted to string in %s on line %d
Recoverable fatal error: Object of class stdClass could not be converted to string in %s on line %d
+1 -1
View File
@@ -18,7 +18,7 @@ new bar(new \stdclass);
--EXPECTF--
NULL
Fatal error: Uncaught TypeError: Argument 1 passed to foo\bar::__construct() must be of the type array, object given, called in %s on line %d and defined in %s:%d
Fatal error: Uncaught TypeError: Argument 1 passed to foo\bar::__construct() must be of the type array or null, object given, called in %s on line %d and defined in %s:%d
Stack trace:
#0 %s(%d): foo\bar->__construct(Object(stdClass))
#1 {main}
+1 -1
View File
@@ -30,7 +30,7 @@ object(foo\test)#%d (0) {
}
NULL
Fatal error: Uncaught TypeError: Argument 1 passed to foo\bar::__construct() must implement interface foo\foo, instance of stdClass given, called in %s on line %d and defined in %s:%d
Fatal error: Uncaught TypeError: Argument 1 passed to foo\bar::__construct() must implement interface foo\foo or be null, instance of stdClass given, called in %s on line %d and defined in %s:%d
Stack trace:
#0 %s(%d): foo\bar->__construct(Object(stdClass))
#1 {main}
@@ -9,7 +9,7 @@ function f(?callable $p) {}
f();
--EXPECTF--
Fatal error: Uncaught Error: Too few arguments to function f(), 0 passed in %snullable_type_parameters_do_not_have_default_value.php on line %d and exactly 1 expected in %s:%d
Fatal error: Uncaught ArgumentCountError: Too few arguments to function f(), 0 passed in %snullable_type_parameters_do_not_have_default_value.php on line %d and exactly 1 expected in %s:%d
Stack trace:
#%d %s
#%d %s
+1 -1
View File
@@ -25,7 +25,7 @@ $foo = new foo;
$foo->testFoo(new foo);
$foo->testBar(new bar);
$foo->testBaz(new baz);
$foo->testFoo(new stdClass); // Catchable fatal error
$foo->testFoo(new stdClass); // Recoverable fatal error
?>
--EXPECTF--
+1 -1
View File
@@ -16,7 +16,7 @@ foo(0);
ok
ok
Fatal error: Uncaught TypeError: Return value of foo() must be of the type array, integer returned in %s030.php:3
Fatal error: Uncaught TypeError: Return value of foo() must be of the type array or null, integer returned in %s030.php:3
Stack trace:
#0 %s030.php(10): foo(0)
#1 {main}
+13
View File
@@ -0,0 +1,13 @@
--TEST--
Fully-qualified nullable parameter type
--FILE--
<?php
namespace Foo;
function test(?\stdClass $param) {}
test(new \stdClass);
?>
===DONE===
--EXPECT--
===DONE===
+317
View File
@@ -0,0 +1,317 @@
--TEST--
Test "or null"/"or be null" in type-checking errors for userland functions
--FILE--
<?php
// This should test every branch in zend_execute.c's `zend_verify_arg_type`, `zend_verify_return_type` and `zend_verify_missing_return_type` functions which produces an "or null"/"or be null" part in its error message
function unloadedClass(?I\Dont\Exist $param) {}
try {
unloadedClass(new \StdClass);
} catch (\TypeError $e) {
echo $e, PHP_EOL;
}
class RealClass {}
interface RealInterface {}
function loadedClass(?RealClass $param) {}
function loadedInterface(?RealInterface $param) {}
try {
loadedClass(new \StdClass);
} catch (\TypeError $e) {
echo $e, PHP_EOL;
}
try {
loadedInterface(new \StdClass);
} catch (\TypeError $e) {
echo $e, PHP_EOL;
}
try {
unloadedClass(1);
} catch (\TypeError $e) {
echo $e, PHP_EOL;
}
try {
loadedClass(1);
} catch (\TypeError $e) {
echo $e, PHP_EOL;
}
try {
loadedInterface(1);
} catch (\TypeError $e) {
echo $e, PHP_EOL;
}
function callableF(?callable $param) {}
try {
callableF(1);
} catch (\TypeError $e) {
echo $e, PHP_EOL;
}
function iterableF(?iterable $param) {}
try {
iterableF(1);
} catch (\TypeError $e) {
echo $e, PHP_EOL;
}
function intF(?int $param) {}
try {
intF(new StdClass);
} catch (\TypeError $e) {
echo $e, PHP_EOL;
}
function returnUnloadedClass(): ?I\Dont\Exist {
return new \StdClass;
}
try {
returnUnloadedClass();
} catch (\TypeError $e) {
echo $e, PHP_EOL;
}
function returnLoadedClass(): ?RealClass {
return new \StdClass;
}
try {
returnLoadedClass();
} catch (\TypeError $e) {
echo $e, PHP_EOL;
}
function returnLoadedInterface(): ?RealInterface {
return new \StdClass;
}
try {
returnLoadedInterface();
} catch (\TypeError $e) {
echo $e, PHP_EOL;
}
function returnUnloadedClassScalar(): ?I\Dont\Exist {
return 1;
}
try {
returnUnloadedClassScalar();
} catch (\TypeError $e) {
echo $e, PHP_EOL;
}
function returnLoadedClassScalar(): ?RealClass {
return 1;
}
try {
returnLoadedClassScalar();
} catch (\TypeError $e) {
echo $e, PHP_EOL;
}
function returnLoadedInterfaceScalar(): ?RealInterface {
return 1;
}
try {
returnLoadedInterfaceScalar();
} catch (\TypeError $e) {
echo $e, PHP_EOL;
}
function returnCallable(): ?callable {
return 1;
}
try {
returnCallable();
} catch (\TypeError $e) {
echo $e, PHP_EOL;
}
function returnIterable(): ?iterable {
return 1;
}
try {
returnIterable();
} catch (\TypeError $e) {
echo $e, PHP_EOL;
}
function returnInt(): ?int {
return new \StdClass;
}
try {
returnInt();
} catch (\TypeError $e) {
echo $e, PHP_EOL;
}
function returnMissingUnloadedClass(): ?I\Dont\Exist {
}
try {
returnMissingUnloadedClass();
} catch (\TypeError $e) {
echo $e, PHP_EOL;
}
function returnMissingLoadedClass(): ?RealClass {
}
try {
returnMissingLoadedClass();
} catch (\TypeError $e) {
echo $e, PHP_EOL;
}
function returnMissingLoadedInterface(): ?RealInterface {
}
try {
returnMissingLoadedInterface();
} catch (\TypeError $e) {
echo $e, PHP_EOL;
}
function returnMissingCallable(): ?callable {
}
try {
returnMissingCallable();
} catch (\TypeError $e) {
echo $e, PHP_EOL;
}
function returnMissingIterable(): ?iterable {
}
try {
returnMissingIterable();
} catch (\TypeError $e) {
echo $e, PHP_EOL;
}
function returnMissingInt(): ?int {
}
try {
returnMissingInt();
} catch (\TypeError $e) {
echo $e, PHP_EOL;
}
?>
--EXPECTF--
TypeError: Argument 1 passed to unloadedClass() must be an instance of I\Dont\Exist or null, instance of stdClass given, called in %s on line 8 and defined in %s:5
Stack trace:
#0 %s(8): unloadedClass(Object(stdClass))
#1 {main}
TypeError: Argument 1 passed to loadedClass() must be an instance of RealClass or null, instance of stdClass given, called in %s on line 20 and defined in %s:16
Stack trace:
#0 %s(20): loadedClass(Object(stdClass))
#1 {main}
TypeError: Argument 1 passed to loadedInterface() must implement interface RealInterface or be null, instance of stdClass given, called in %s on line 26 and defined in %s:17
Stack trace:
#0 %s(26): loadedInterface(Object(stdClass))
#1 {main}
TypeError: Argument 1 passed to unloadedClass() must be an instance of I\Dont\Exist or null, integer given, called in %s on line 32 and defined in %s:5
Stack trace:
#0 %s(32): unloadedClass(1)
#1 {main}
TypeError: Argument 1 passed to loadedClass() must be an instance of RealClass or null, integer given, called in %s on line 38 and defined in %s:16
Stack trace:
#0 %s(38): loadedClass(1)
#1 {main}
TypeError: Argument 1 passed to loadedInterface() must implement interface RealInterface or be null, integer given, called in %s on line 44 and defined in %s:17
Stack trace:
#0 %s(44): loadedInterface(1)
#1 {main}
TypeError: Argument 1 passed to callableF() must be callable or null, integer given, called in %s on line 52 and defined in %s:49
Stack trace:
#0 %s(52): callableF(1)
#1 {main}
TypeError: Argument 1 passed to iterableF() must be iterable or null, integer given, called in %s on line 60 and defined in %s:57
Stack trace:
#0 %s(60): iterableF(1)
#1 {main}
TypeError: Argument 1 passed to intF() must be of the type integer or null, object given, called in %s on line 68 and defined in %s:65
Stack trace:
#0 %s(68): intF(Object(stdClass))
#1 {main}
TypeError: Return value of returnUnloadedClass() must be an instance of I\Dont\Exist or null, instance of stdClass returned in %s:74
Stack trace:
#0 %s(78): returnUnloadedClass()
#1 {main}
TypeError: Return value of returnLoadedClass() must be an instance of RealClass or null, instance of stdClass returned in %s:84
Stack trace:
#0 %s(88): returnLoadedClass()
#1 {main}
TypeError: Return value of returnLoadedInterface() must implement interface RealInterface or be null, instance of stdClass returned in %s:94
Stack trace:
#0 %s(98): returnLoadedInterface()
#1 {main}
TypeError: Return value of returnUnloadedClassScalar() must be an instance of I\Dont\Exist or null, integer returned in %s:104
Stack trace:
#0 %s(108): returnUnloadedClassScalar()
#1 {main}
TypeError: Return value of returnLoadedClassScalar() must be an instance of RealClass or null, integer returned in %s:114
Stack trace:
#0 %s(118): returnLoadedClassScalar()
#1 {main}
TypeError: Return value of returnLoadedInterfaceScalar() must implement interface RealInterface or be null, integer returned in %s:124
Stack trace:
#0 %s(128): returnLoadedInterfaceScalar()
#1 {main}
TypeError: Return value of returnCallable() must be callable or null, integer returned in %s:134
Stack trace:
#0 %s(138): returnCallable()
#1 {main}
TypeError: Return value of returnIterable() must be iterable or null, integer returned in %s:144
Stack trace:
#0 %s(148): returnIterable()
#1 {main}
TypeError: Return value of returnInt() must be of the type integer or null, object returned in %s:154
Stack trace:
#0 %s(158): returnInt()
#1 {main}
TypeError: Return value of returnMissingUnloadedClass() must be an instance of I\Dont\Exist or null, none returned in %s:164
Stack trace:
#0 %s(167): returnMissingUnloadedClass()
#1 {main}
TypeError: Return value of returnMissingLoadedClass() must be an instance of RealClass or null, none returned in %s:173
Stack trace:
#0 %s(176): returnMissingLoadedClass()
#1 {main}
TypeError: Return value of returnMissingLoadedInterface() must implement interface RealInterface or be null, none returned in %s:182
Stack trace:
#0 %s(185): returnMissingLoadedInterface()
#1 {main}
TypeError: Return value of returnMissingCallable() must be callable or null, none returned in %s:191
Stack trace:
#0 %s(194): returnMissingCallable()
#1 {main}
TypeError: Return value of returnMissingIterable() must be iterable or null, none returned in %s:200
Stack trace:
#0 %s(203): returnMissingIterable()
#1 {main}
TypeError: Return value of returnMissingInt() must be of the type integer or null, none returned in %s:209
Stack trace:
#0 %s(212): returnMissingInt()
#1 {main}
+17
View File
@@ -1372,6 +1372,23 @@ ZEND_API ZEND_COLD void zend_internal_type_error(zend_bool throw_exception, cons
va_end(va);
} /* }}} */
ZEND_API ZEND_COLD void zend_internal_argument_count_error(zend_bool throw_exception, const char *format, ...) /* {{{ */
{
va_list va;
char *message = NULL;
va_start(va, format);
zend_vspprintf(&message, 0, format, va);
if (throw_exception) {
zend_throw_exception(zend_ce_argument_count_error, message, 0);
} else {
zend_error(E_WARNING, "%s", message);
}
efree(message);
va_end(va);
} /* }}} */
ZEND_API ZEND_COLD void zend_output_debug_string(zend_bool trigger_break, const char *format, ...) /* {{{ */
{
#if ZEND_DEBUG
+1
View File
@@ -271,6 +271,7 @@ ZEND_API ZEND_COLD void zend_error(int type, const char *format, ...) ZEND_ATTRI
ZEND_API ZEND_COLD void zend_throw_error(zend_class_entry *exception_ce, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
ZEND_API ZEND_COLD void zend_type_error(const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 1, 2);
ZEND_API ZEND_COLD void zend_internal_type_error(zend_bool throw_exception, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
ZEND_API ZEND_COLD void zend_internal_argument_count_error(zend_bool throw_exception, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
ZEND_COLD void zenderror(const char *error);
+15 -14
View File
@@ -157,7 +157,7 @@ ZEND_API ZEND_COLD void zend_wrong_param_count(void) /* {{{ */
const char *space;
const char *class_name = get_active_class_name(&space);
zend_internal_type_error(ZEND_ARG_USES_STRICT_TYPES(), "Wrong parameter count for %s%s%s()", class_name, space, get_active_function_name());
zend_internal_argument_count_error(ZEND_ARG_USES_STRICT_TYPES(), "Wrong parameter count for %s%s%s()", class_name, space, get_active_function_name());
}
/* }}} */
@@ -202,20 +202,21 @@ ZEND_API char *zend_zval_type_name(const zval *arg) /* {{{ */
}
/* }}} */
#ifdef FAST_ZPP
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameters_count_error(int num_args, int min_num_args, int max_num_args) /* {{{ */
{
zend_function *active_function = EG(current_execute_data)->func;
const char *class_name = active_function->common.scope ? ZSTR_VAL(active_function->common.scope->name) : "";
zend_internal_type_error(ZEND_ARG_USES_STRICT_TYPES(), "%s%s%s() expects %s %d parameter%s, %d given",
class_name, \
class_name[0] ? "::" : "", \
ZSTR_VAL(active_function->common.function_name),
min_num_args == max_num_args ? "exactly" : num_args < min_num_args ? "at least" : "at most",
num_args < min_num_args ? min_num_args : max_num_args,
(num_args < min_num_args ? min_num_args : max_num_args) == 1 ? "" : "s",
num_args);
zend_internal_argument_count_error(
ZEND_ARG_USES_STRICT_TYPES(),
"%s%s%s() expects %s %d parameter%s, %d given",
class_name, \
class_name[0] ? "::" : "", \
ZSTR_VAL(active_function->common.function_name),
min_num_args == max_num_args ? "exactly" : num_args < min_num_args ? "at least" : "at most",
num_args < min_num_args ? min_num_args : max_num_args,
(num_args < min_num_args ? min_num_args : max_num_args) == 1 ? "" : "s",
num_args);
}
/* }}} */
@@ -296,7 +297,6 @@ ZEND_API int ZEND_FASTCALL zend_parse_arg_class(zval *arg, zend_class_entry **pc
return 1;
}
/* }}} */
#endif
ZEND_API int ZEND_FASTCALL zend_parse_arg_bool_weak(zval *arg, zend_bool *dest) /* {{{ */
{
@@ -875,7 +875,7 @@ static int zend_parse_va_args(int num_args, const char *type_spec, va_list *va,
zend_function *active_function = EG(current_execute_data)->func;
const char *class_name = active_function->common.scope ? ZSTR_VAL(active_function->common.scope->name) : "";
zend_bool throw_exception = ZEND_ARG_USES_STRICT_TYPES() || (flags & ZEND_PARSE_PARAMS_THROW);
zend_internal_type_error(throw_exception, "%s%s%s() expects %s %d parameter%s, %d given",
zend_internal_argument_count_error(throw_exception, "%s%s%s() expects %s %d parameter%s, %d given",
class_name,
class_name[0] ? "::" : "",
ZSTR_VAL(active_function->common.function_name),
@@ -2909,7 +2909,7 @@ static int zend_is_callable_check_func(int check_flags, zval *callable, zend_fca
zend_string *mname, *cname;
zend_string *lmname;
const char *colon;
size_t clen, mlen;
size_t clen;
HashTable *ftable;
int call_via_handler = 0;
zend_class_entry *scope;
@@ -2962,6 +2962,8 @@ static int zend_is_callable_check_func(int check_flags, zval *callable, zend_fca
colon > Z_STRVAL_P(callable) &&
*(colon-1) == ':'
) {
size_t mlen;
colon--;
clen = colon - Z_STRVAL_P(callable);
mlen = Z_STRLEN_P(callable) - clen - 2;
@@ -2994,7 +2996,6 @@ static int zend_is_callable_check_func(int check_flags, zval *callable, zend_fca
mname = zend_string_init(Z_STRVAL_P(callable) + clen + 2, mlen, 0);
} else if (ce_org) {
/* Try to fetch find static method of given class. */
mlen = Z_STRLEN_P(callable);
mname = Z_STR_P(callable);
zend_string_addref(mname);
ftable = &ce_org->function_table;
+2 -6
View File
@@ -676,13 +676,11 @@ END_EXTERN_C()
/* Fast parameter parsing API */
/* This API should be used only for really often used functions.
* (Keep the original parsing code and wrap usage with #ifndef FAST_ZPP)
/* Fast ZPP is always enabled now; this define is left in for compatibility
* with any existing conditional compilation blocks.
*/
#define FAST_ZPP 1
#ifdef FAST_ZPP
#define Z_EXPECTED_TYPES(_) \
_(Z_EXPECTED_LONG, "integer") \
_(Z_EXPECTED_BOOL, "boolean") \
@@ -1045,8 +1043,6 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_error(int severity, in
#define Z_PARAM_VARIADIC(spec, dest, dest_num) \
Z_PARAM_VARIADIC_EX(spec, dest, dest_num, 0)
#endif /* FAST_ZPP */
/* End of new parameter parsing API */
/* Inlined implementations shared by new and old parameter parsing APIs */
+12 -12
View File
@@ -1503,21 +1503,21 @@ static void *zend_mm_realloc_heap(zend_mm_heap *heap, void *ptr, size_t size, si
ZEND_MM_CHECK(chunk->heap == heap, "zend_mm_heap corrupted");
if (info & ZEND_MM_IS_SRUN) {
int old_bin_num, bin_num;
old_bin_num = ZEND_MM_SRUN_BIN_NUM(info);
int old_bin_num = ZEND_MM_SRUN_BIN_NUM(info);
old_size = bin_data_size[old_bin_num];
bin_num = ZEND_MM_SMALL_SIZE_TO_BIN(size);
if (old_bin_num == bin_num) {
if (size <= ZEND_MM_MAX_SMALL_SIZE) {
int bin_num = ZEND_MM_SMALL_SIZE_TO_BIN(size);
if (old_bin_num == bin_num) {
#if ZEND_DEBUG
dbg = zend_mm_get_debug_info(heap, ptr);
dbg->size = real_size;
dbg->filename = __zend_filename;
dbg->orig_filename = __zend_orig_filename;
dbg->lineno = __zend_lineno;
dbg->orig_lineno = __zend_orig_lineno;
dbg = zend_mm_get_debug_info(heap, ptr);
dbg->size = real_size;
dbg->filename = __zend_filename;
dbg->orig_filename = __zend_orig_filename;
dbg->lineno = __zend_lineno;
dbg->orig_lineno = __zend_orig_lineno;
#endif
return ptr;
return ptr;
}
}
} else /* if (info & ZEND_MM_IS_LARGE_RUN) */ {
ZEND_MM_CHECK(ZEND_MM_ALIGNED_OFFSET(page_offset, ZEND_MM_PAGE_SIZE) == 0, "zend_mm_heap corrupted");
+1 -66
View File
@@ -622,15 +622,9 @@ ZEND_FUNCTION(strlen)
{
zend_string *s;
#ifndef FAST_ZPP
if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &s) == FAILURE) {
return;
}
#else
ZEND_PARSE_PARAMETERS_START(1, 1)
Z_PARAM_STR(s)
ZEND_PARSE_PARAMETERS_END();
#endif
RETVAL_LONG(ZSTR_LEN(s));
}
@@ -770,16 +764,10 @@ ZEND_FUNCTION(error_reporting)
zval *err = NULL;
int old_error_reporting;
#ifndef FAST_ZPP
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|z", &err) == FAILURE) {
return;
}
#else
ZEND_PARSE_PARAMETERS_START(0, 1)
Z_PARAM_OPTIONAL
Z_PARAM_ZVAL(err)
ZEND_PARSE_PARAMETERS_END();
#endif
old_error_reporting = EG(error_reporting);
if (ZEND_NUM_ARGS() != 0) {
@@ -893,18 +881,12 @@ ZEND_FUNCTION(define)
int case_sensitive = CONST_CS;
zend_constant c;
#ifndef FAST_ZPP
if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sz|b", &name, &val, &non_cs) == FAILURE) {
return;
}
#else
ZEND_PARSE_PARAMETERS_START(2, 3)
Z_PARAM_STR(name)
Z_PARAM_ZVAL(val)
Z_PARAM_OPTIONAL
Z_PARAM_BOOL(non_cs)
ZEND_PARSE_PARAMETERS_END();
#endif
if (non_cs) {
case_sensitive = 0;
@@ -985,15 +967,9 @@ ZEND_FUNCTION(defined)
{
zend_string *name;
#ifndef FAST_ZPP
if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &name) == FAILURE) {
return;
}
#else
ZEND_PARSE_PARAMETERS_START(1, 1)
Z_PARAM_STR(name)
ZEND_PARSE_PARAMETERS_END();
#endif
if (zend_get_constant_ex(name, zend_get_executed_scope(), ZEND_FETCH_CLASS_SILENT)) {
RETURN_TRUE;
@@ -1094,18 +1070,12 @@ static void is_a_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool only_subclass) /*
zend_bool allow_string = only_subclass;
zend_bool retval;
#ifndef FAST_ZPP
if (zend_parse_parameters(ZEND_NUM_ARGS(), "zS|b", &obj, &class_name, &allow_string) == FAILURE) {
return;
}
#else
ZEND_PARSE_PARAMETERS_START(2, 3)
Z_PARAM_ZVAL(obj)
Z_PARAM_STR(class_name)
Z_PARAM_OPTIONAL
Z_PARAM_BOOL(allow_string)
ZEND_PARSE_PARAMETERS_END();
#endif
/*
* allow_string - is_a default is no, is_subclass_of is yes.
* if it's allowed, then the autoloader will be called if the class does not exist.
@@ -1246,15 +1216,9 @@ ZEND_FUNCTION(get_object_vars)
zend_string *key;
zend_object *zobj;
#ifndef FAST_ZPP
if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &obj) == FAILURE) {
return;
}
#else
ZEND_PARSE_PARAMETERS_START(1, 1)
Z_PARAM_OBJECT(obj)
ZEND_PARSE_PARAMETERS_END();
#endif
if (Z_OBJ_HT_P(obj)->get_properties == NULL) {
RETURN_FALSE;
@@ -1392,16 +1356,11 @@ ZEND_FUNCTION(method_exists)
zend_string *lcname;
zend_class_entry * ce;
#ifndef FAST_ZPP
if (zend_parse_parameters(ZEND_NUM_ARGS(), "zS", &klass, &method_name) == FAILURE) {
return;
}
#else
ZEND_PARSE_PARAMETERS_START(2, 2)
Z_PARAM_ZVAL(klass)
Z_PARAM_STR(method_name)
ZEND_PARSE_PARAMETERS_END();
#endif
if (Z_TYPE_P(klass) == IS_OBJECT) {
ce = Z_OBJCE_P(klass);
} else if (Z_TYPE_P(klass) == IS_STRING) {
@@ -1497,17 +1456,11 @@ ZEND_FUNCTION(class_exists)
zend_class_entry *ce;
zend_bool autoload = 1;
#ifndef FAST_ZPP
if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|b", &class_name, &autoload) == FAILURE) {
return;
}
#else
ZEND_PARSE_PARAMETERS_START(1, 2)
Z_PARAM_STR(class_name)
Z_PARAM_OPTIONAL
Z_PARAM_BOOL(autoload)
ZEND_PARSE_PARAMETERS_END();
#endif
if (!autoload) {
if (ZSTR_VAL(class_name)[0] == '\\') {
@@ -1540,17 +1493,11 @@ ZEND_FUNCTION(interface_exists)
zend_class_entry *ce;
zend_bool autoload = 1;
#ifndef FAST_ZPP
if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|b", &iface_name, &autoload) == FAILURE) {
return;
}
#else
ZEND_PARSE_PARAMETERS_START(1, 2)
Z_PARAM_STR(iface_name)
Z_PARAM_OPTIONAL
Z_PARAM_BOOL(autoload)
ZEND_PARSE_PARAMETERS_END();
#endif
if (!autoload) {
if (ZSTR_VAL(iface_name)[0] == '\\') {
@@ -1582,17 +1529,11 @@ ZEND_FUNCTION(trait_exists)
zend_class_entry *ce;
zend_bool autoload = 1;
#ifndef FAST_ZPP
if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|b", &trait_name, &autoload) == FAILURE) {
return;
}
#else
ZEND_PARSE_PARAMETERS_START(1, 2)
Z_PARAM_STR(trait_name)
Z_PARAM_OPTIONAL
Z_PARAM_BOOL(autoload)
ZEND_PARSE_PARAMETERS_END();
#endif
if (!autoload) {
if (ZSTR_VAL(trait_name)[0] == '\\') {
@@ -1625,15 +1566,9 @@ ZEND_FUNCTION(function_exists)
zend_function *func;
zend_string *lcname;
#ifndef FAST_ZPP
if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &name) == FAILURE) {
return;
}
#else
ZEND_PARSE_PARAMETERS_START(1, 1)
Z_PARAM_STR(name)
ZEND_PARSE_PARAMETERS_END();
#endif
if (ZSTR_VAL(name)[0] == '\\') {
/* Ignore leading "\" */
+64 -2
View File
@@ -584,7 +584,9 @@ static int zend_add_const_name_literal(zend_op_array *op_array, zend_string *nam
void zend_stop_lexing(void)
{
if(LANG_SCNG(on_event)) LANG_SCNG(on_event)(ON_STOP, END, 0);
if (LANG_SCNG(on_event)) {
LANG_SCNG(on_event)(ON_STOP, END, 0, LANG_SCNG(on_event_context));
}
LANG_SCNG(yy_cursor) = LANG_SCNG(yy_limit);
}
@@ -2196,10 +2198,43 @@ static inline uint32_t zend_emit_jump(uint32_t opnum_target) /* {{{ */
}
/* }}} */
ZEND_API int zend_is_smart_branch(zend_op *opline) /* {{{ */
{
switch (opline->opcode) {
case ZEND_IS_IDENTICAL:
case ZEND_IS_NOT_IDENTICAL:
case ZEND_IS_EQUAL:
case ZEND_IS_NOT_EQUAL:
case ZEND_IS_SMALLER:
case ZEND_IS_SMALLER_OR_EQUAL:
case ZEND_CASE:
case ZEND_ISSET_ISEMPTY_VAR:
case ZEND_ISSET_ISEMPTY_DIM_OBJ:
case ZEND_ISSET_ISEMPTY_PROP_OBJ:
case ZEND_ISSET_ISEMPTY_STATIC_PROP:
case ZEND_INSTANCEOF:
case ZEND_TYPE_CHECK:
case ZEND_DEFINED:
return 1;
default:
return 0;
}
}
/* }}} */
static inline uint32_t zend_emit_cond_jump(zend_uchar opcode, znode *cond, uint32_t opnum_target) /* {{{ */
{
uint32_t opnum = get_next_op_number(CG(active_op_array));
zend_op *opline = zend_emit_op(NULL, opcode, cond, NULL);
zend_op *opline;
if ((cond->op_type & (IS_CV|IS_CONST))
&& opnum > 0
&& zend_is_smart_branch(CG(active_op_array)->opcodes + opnum - 1)) {
/* emit extra NOP to avoid incorrect SMART_BRANCH in very rare cases */
zend_emit_op(NULL, ZEND_NOP, NULL, NULL);
opnum = get_next_op_number(CG(active_op_array));
}
opline = zend_emit_op(NULL, opcode, cond, NULL);
opline->op2.opline_num = opnum_target;
return opnum;
}
@@ -3377,6 +3412,22 @@ int zend_compile_func_typecheck(znode *result, zend_ast_list *args, uint32_t typ
}
/* }}} */
int zend_compile_func_cast(znode *result, zend_ast_list *args, uint32_t type) /* {{{ */
{
znode arg_node;
zend_op *opline;
if (args->children != 1 || args->child[0]->kind == ZEND_AST_UNPACK) {
return FAILURE;
}
zend_compile_expr(&arg_node, args->child[0]);
opline = zend_emit_op_tmp(result, ZEND_CAST, &arg_node, NULL);
opline->extended_value = type;
return SUCCESS;
}
/* }}} */
int zend_compile_func_defined(znode *result, zend_ast_list *args) /* {{{ */
{
zend_string *name;
@@ -3642,6 +3693,16 @@ int zend_try_compile_special_func(znode *result, zend_string *lcname, zend_ast_l
return zend_compile_func_typecheck(result, args, IS_OBJECT);
} else if (zend_string_equals_literal(lcname, "is_resource")) {
return zend_compile_func_typecheck(result, args, IS_RESOURCE);
} else if (zend_string_equals_literal(lcname, "boolval")) {
return zend_compile_func_cast(result, args, _IS_BOOL);
} else if (zend_string_equals_literal(lcname, "intval")) {
return zend_compile_func_cast(result, args, IS_LONG);
} else if (zend_string_equals_literal(lcname, "floatval")
|| zend_string_equals_literal(lcname, "doubleval")
) {
return zend_compile_func_cast(result, args, IS_DOUBLE);
} else if (zend_string_equals_literal(lcname, "strval")) {
return zend_compile_func_cast(result, args, IS_STRING);
} else if (zend_string_equals_literal(lcname, "defined")) {
return zend_compile_func_defined(result, args);
} else if (zend_string_equals_literal(lcname, "chr") && type == BP_VAR_R) {
@@ -5138,6 +5199,7 @@ void zend_compile_params(zend_ast *ast, zend_ast *return_type_ast) /* {{{ */
op_array->fn_flags |= ZEND_ACC_HAS_TYPE_HINTS;
arg_info->allow_null = has_null_default || is_explicitly_nullable;
type_ast->attr &= ~ZEND_TYPE_NULLABLE;
zend_compile_typename(type_ast, arg_info);
if (arg_info->type_hint == IS_VOID) {
+2 -1
View File
@@ -449,7 +449,7 @@ struct _zend_execute_data {
const zend_op *opline; /* executed opline */
zend_execute_data *call; /* current call */
zval *return_value;
zend_function *func; /* executed funcrion */
zend_function *func; /* executed function */
zval This; /* this + call_info + num_args */
zend_execute_data *prev_execute_data;
zend_array *symbol_table;
@@ -791,6 +791,7 @@ ZEND_API char *zend_make_compiled_string_description(const char *name);
ZEND_API void zend_initialize_class_data(zend_class_entry *ce, zend_bool nullify_handlers);
uint32_t zend_get_class_fetch_type(zend_string *name);
ZEND_API zend_uchar zend_get_call_op(const zend_op *init_op, zend_function *fbc);
ZEND_API int zend_is_smart_branch(zend_op *opline);
typedef zend_bool (*zend_auto_global_callback)(zend_string *name);
typedef struct _zend_auto_global {
+2
View File
@@ -375,12 +375,14 @@ ZEND_API zval *zend_get_constant_ex(zend_string *cname, zend_class_entry *scope,
if (Z_TYPE_P(ret_constant) == IS_CONSTANT_AST) {
if (IS_CONSTANT_VISITED(ret_constant)) {
zend_throw_error(NULL, "Cannot declare self-referencing constant '%s::%s'", ZSTR_VAL(class_name), ZSTR_VAL(constant_name));
ret_constant = NULL;
goto failure;
}
MARK_CONSTANT_VISITED(ret_constant);
}
if (UNEXPECTED(zval_update_constant_ex(ret_constant, ce) != SUCCESS)) {
RESET_CONSTANT_VISITED(ret_constant);
ret_constant = NULL;
goto failure;
}
RESET_CONSTANT_VISITED(ret_constant);
+6 -1
View File
@@ -36,6 +36,7 @@ ZEND_API zend_class_entry *zend_ce_error_exception;
ZEND_API zend_class_entry *zend_ce_error;
ZEND_API zend_class_entry *zend_ce_parse_error;
ZEND_API zend_class_entry *zend_ce_type_error;
ZEND_API zend_class_entry *zend_ce_argument_count_error;
ZEND_API zend_class_entry *zend_ce_arithmetic_error;
ZEND_API zend_class_entry *zend_ce_division_by_zero_error;
@@ -709,7 +710,7 @@ ZEND_METHOD(exception, __toString)
ZVAL_UNDEF(&trace);
}
if (Z_OBJCE_P(exception) == zend_ce_type_error && strstr(ZSTR_VAL(message), ", called in ")) {
if ((Z_OBJCE_P(exception) == zend_ce_type_error || Z_OBJCE_P(exception) == zend_ce_argument_count_error) && strstr(ZSTR_VAL(message), ", called in ")) {
zend_string *real_message = zend_strpprintf(0, "%s and defined", ZSTR_VAL(message));
zend_string_release(message);
message = real_message;
@@ -859,6 +860,10 @@ void zend_register_default_exception(void) /* {{{ */
zend_ce_type_error = zend_register_internal_class_ex(&ce, zend_ce_error);
zend_ce_type_error->create_object = zend_default_exception_new;
INIT_CLASS_ENTRY(ce, "ArgumentCountError", NULL);
zend_ce_argument_count_error = zend_register_internal_class_ex(&ce, zend_ce_type_error);
zend_ce_argument_count_error->create_object = zend_default_exception_new;
INIT_CLASS_ENTRY(ce, "ArithmeticError", NULL);
zend_ce_arithmetic_error = zend_register_internal_class_ex(&ce, zend_ce_error);
zend_ce_arithmetic_error->create_object = zend_default_exception_new;
+1
View File
@@ -32,6 +32,7 @@ extern ZEND_API zend_class_entry *zend_ce_error_exception;
extern ZEND_API zend_class_entry *zend_ce_error;
extern ZEND_API zend_class_entry *zend_ce_parse_error;
extern ZEND_API zend_class_entry *zend_ce_type_error;
extern ZEND_API zend_class_entry *zend_ce_argument_count_error;
extern ZEND_API zend_class_entry *zend_ce_arithmetic_error;
extern ZEND_API zend_class_entry *zend_ce_division_by_zero_error;
+251 -269
View File
@@ -131,7 +131,8 @@ ZEND_API const zend_internal_function zend_pass_function = {
((ZEND_VM_STACK_PAGE_SLOTS(gen) - ZEND_VM_STACK_HEADER_SLOTS) * sizeof(zval))
#define ZEND_VM_STACK_PAGE_ALIGNED_SIZE(gen, size) \
(((size) + (ZEND_VM_STACK_FREE_PAGE_SIZE(gen) - 1)) & ~(ZEND_VM_STACK_PAGE_SIZE(gen) - 1))
(((size) + ZEND_VM_STACK_HEADER_SLOTS * sizeof(zval) \
+ (ZEND_VM_STACK_PAGE_SIZE(gen) - 1)) & ~(ZEND_VM_STACK_PAGE_SIZE(gen) - 1))
static zend_always_inline zend_vm_stack zend_vm_stack_new_page(size_t size, zend_vm_stack prev) {
zend_vm_stack page = (zend_vm_stack)emalloc(size);
@@ -566,6 +567,7 @@ static inline zval *_get_obj_zval_ptr_ptr(int op_type, znode_op node, zend_execu
static inline void zend_assign_to_variable_reference(zval *variable_ptr, zval *value_ptr)
{
zend_reference *ref;
zval garbage;
if (EXPECTED(!Z_ISREF_P(value_ptr))) {
ZVAL_NEW_REF(value_ptr, value_ptr);
@@ -575,8 +577,9 @@ static inline void zend_assign_to_variable_reference(zval *variable_ptr, zval *v
ref = Z_REF_P(value_ptr);
GC_REFCOUNT(ref)++;
zval_ptr_dtor(variable_ptr);
ZVAL_COPY_VALUE(&garbage, variable_ptr);
ZVAL_REF(variable_ptr, ref);
zval_ptr_dtor(&garbage);
}
/* this should modify object only if it's empty */
@@ -596,21 +599,18 @@ static inline int make_real_object(zval *object)
return 1;
}
static char * zend_verify_internal_arg_class_kind(const zend_internal_arg_info *cur_arg_info, char **class_name, zend_class_entry **pce)
static zend_class_entry *zend_verify_internal_arg_class_kind(
const zend_internal_arg_info *cur_arg_info)
{
zend_string *key;
zend_class_entry *ce;
ALLOCA_FLAG(use_heap);
ZSTR_ALLOCA_INIT(key, cur_arg_info->class_name, strlen(cur_arg_info->class_name), use_heap);
*pce = zend_fetch_class(key, (ZEND_FETCH_CLASS_AUTO | ZEND_FETCH_CLASS_NO_AUTOLOAD));
ce = zend_fetch_class(key, (ZEND_FETCH_CLASS_AUTO | ZEND_FETCH_CLASS_NO_AUTOLOAD));
ZSTR_ALLOCA_FREE(key, use_heap);
*class_name = (*pce) ? ZSTR_VAL((*pce)->name) : (char*)cur_arg_info->class_name;
if (*pce && (*pce)->ce_flags & ZEND_ACC_INTERFACE) {
return "implement interface ";
} else {
return "be an instance of ";
}
return ce;
}
static zend_always_inline zend_class_entry* zend_verify_arg_class_kind(const zend_arg_info *cur_arg_info)
@@ -618,31 +618,102 @@ static zend_always_inline zend_class_entry* zend_verify_arg_class_kind(const zen
return zend_fetch_class(cur_arg_info->class_name, (ZEND_FETCH_CLASS_AUTO | ZEND_FETCH_CLASS_NO_AUTOLOAD));
}
static ZEND_COLD void zend_verify_arg_error(const zend_function *zf, uint32_t arg_num, const char *need_msg, const char *need_kind, const char *given_msg, const char *given_kind)
static ZEND_COLD void zend_verify_type_error_common(
const zend_function *zf, const zend_arg_info *arg_info,
const zend_class_entry *ce, zval *value,
const char **fname, const char **fsep, const char **fclass,
const char **need_msg, const char **need_kind, const char **need_or_null,
const char **given_msg, const char **given_kind)
{
zend_execute_data *ptr = EG(current_execute_data)->prev_execute_data;
const char *fname = ZSTR_VAL(zf->common.function_name);
const char *fsep;
const char *fclass;
zend_bool is_interface = 0;
*fname = ZSTR_VAL(zf->common.function_name);
if (zf->common.scope) {
fsep = "::";
fclass = ZSTR_VAL(zf->common.scope->name);
*fsep = "::";
*fclass = ZSTR_VAL(zf->common.scope->name);
} else {
fsep = "";
fclass = "";
*fsep = "";
*fclass = "";
}
if (zf->common.type == ZEND_USER_FUNCTION) {
if (ptr && ptr->func && ZEND_USER_CODE(ptr->func->common.type)) {
zend_type_error("Argument %d passed to %s%s%s() must %s%s, %s%s given, called in %s on line %d",
arg_num, fclass, fsep, fname, need_msg, need_kind, given_msg, given_kind,
ZSTR_VAL(ptr->func->op_array.filename), ptr->opline->lineno);
switch (arg_info->type_hint) {
case IS_OBJECT:
if (ce) {
if (ce->ce_flags & ZEND_ACC_INTERFACE) {
*need_msg = "implement interface ";
is_interface = 1;
} else {
*need_msg = "be an instance of ";
}
*need_kind = ZSTR_VAL(ce->name);
} else {
/* We don't know whether it's a class or interface, assume it's a class */
*need_msg = "be an instance of ";
*need_kind = zf->common.type == ZEND_INTERNAL_FUNCTION
? ((zend_internal_arg_info *) arg_info)->class_name
: ZSTR_VAL(arg_info->class_name);
}
break;
case IS_CALLABLE:
*need_msg = "be callable";
*need_kind = "";
break;
case IS_ITERABLE:
*need_msg = "be iterable";
*need_kind = "";
break;
default:
*need_msg = "be of the type ";
*need_kind = zend_get_type_by_const(arg_info->type_hint);
break;
}
if (arg_info->allow_null) {
*need_or_null = is_interface ? " or be null" : " or null";
} else {
*need_or_null = "";
}
if (value) {
if (arg_info->type_hint == IS_OBJECT && Z_TYPE_P(value) == IS_OBJECT) {
*given_msg = "instance of ";
*given_kind = ZSTR_VAL(Z_OBJCE_P(value)->name);
} else {
zend_type_error("Argument %d passed to %s%s%s() must %s%s, %s%s given", arg_num, fclass, fsep, fname, need_msg, need_kind, given_msg, given_kind);
*given_msg = zend_zval_type_name(value);
*given_kind = "";
}
} else {
zend_type_error("Argument %d passed to %s%s%s() must %s%s, %s%s given", arg_num, fclass, fsep, fname, need_msg, need_kind, given_msg, given_kind);
*given_msg = "none";
*given_kind = "";
}
}
static ZEND_COLD void zend_verify_arg_error(
const zend_function *zf, const zend_arg_info *arg_info,
int arg_num, const zend_class_entry *ce, zval *value)
{
zend_execute_data *ptr = EG(current_execute_data)->prev_execute_data;
const char *fname, *fsep, *fclass;
const char *need_msg, *need_kind, *need_or_null, *given_msg, *given_kind;
if (value) {
zend_verify_type_error_common(
zf, arg_info, ce, value,
&fname, &fsep, &fclass, &need_msg, &need_kind, &need_or_null, &given_msg, &given_kind);
if (zf->common.type == ZEND_USER_FUNCTION) {
if (ptr && ptr->func && ZEND_USER_CODE(ptr->func->common.type)) {
zend_type_error("Argument %d passed to %s%s%s() must %s%s%s, %s%s given, called in %s on line %d",
arg_num, fclass, fsep, fname, need_msg, need_kind, need_or_null, given_msg, given_kind,
ZSTR_VAL(ptr->func->op_array.filename), ptr->opline->lineno);
} else {
zend_type_error("Argument %d passed to %s%s%s() must %s%s%s, %s%s given", arg_num, fclass, fsep, fname, need_msg, need_kind, need_or_null, given_msg, given_kind);
}
} else {
zend_type_error("Argument %d passed to %s%s%s() must %s%s%s, %s%s given", arg_num, fclass, fsep, fname, need_msg, need_kind, need_or_null, given_msg, given_kind);
}
} else {
zend_missing_arg_error(ptr);
}
}
@@ -724,11 +795,50 @@ static zend_bool zend_verify_scalar_type_hint(zend_uchar type_hint, zval *arg, z
return zend_verify_weak_scalar_type_hint(type_hint, arg);
}
static zend_always_inline zend_bool zend_check_internal_type(
const zend_function *zf, const zend_internal_arg_info *arg_info,
zval *arg, zend_class_entry **ce, zend_bool is_return_type)
{
if (!arg_info->type_hint) {
return 1;
}
ZVAL_DEREF(arg);
if (EXPECTED(arg_info->type_hint == Z_TYPE_P(arg))) {
if (arg_info->class_name) {
*ce = zend_verify_internal_arg_class_kind(arg_info);
return *ce && instanceof_function(Z_OBJCE_P(arg), *ce);
}
return 1;
}
if (Z_TYPE_P(arg) == IS_NULL && arg_info->allow_null) {
return 1;
}
if (arg_info->class_name) {
*ce = zend_verify_internal_arg_class_kind(arg_info);
return 0;
} else if (arg_info->type_hint == IS_CALLABLE) {
return zend_is_callable(arg, IS_CALLABLE_CHECK_SILENT, NULL);
} else if (arg_info->type_hint == IS_ITERABLE) {
return zend_is_iterable(arg);
} else if (arg_info->type_hint == _IS_BOOL &&
EXPECTED(Z_TYPE_P(arg) == IS_FALSE || Z_TYPE_P(arg) == IS_TRUE)) {
return 1;
} else if (is_return_type) {
/* Internal return types are always strict */
return 0;
} else {
/* Internal parameter types honor strict_types */
return zend_verify_scalar_type_hint(arg_info->type_hint, arg, ZEND_CALL_USES_STRICT_TYPES(EG(current_execute_data)));
}
}
static int zend_verify_internal_arg_type(zend_function *zf, uint32_t arg_num, zval *arg)
{
zend_internal_arg_info *cur_arg_info;
char *need_msg, *class_name;
zend_class_entry *ce;
const zend_internal_arg_info *cur_arg_info;
zend_class_entry *ce = NULL;
if (EXPECTED(arg_num <= zf->internal_function.num_args)) {
cur_arg_info = &zf->internal_function.arg_info[arg_num-1];
@@ -738,40 +848,11 @@ static int zend_verify_internal_arg_type(zend_function *zf, uint32_t arg_num, zv
return 1;
}
if (cur_arg_info->type_hint) {
ZVAL_DEREF(arg);
if (EXPECTED(cur_arg_info->type_hint == Z_TYPE_P(arg))) {
if (cur_arg_info->class_name) {
need_msg = zend_verify_internal_arg_class_kind((zend_internal_arg_info*)cur_arg_info, &class_name, &ce);
if (!ce || !instanceof_function(Z_OBJCE_P(arg), ce)) {
zend_verify_arg_error(zf, arg_num, need_msg, class_name, "instance of ", ZSTR_VAL(Z_OBJCE_P(arg)->name));
return 0;
}
}
} else if (Z_TYPE_P(arg) != IS_NULL || !cur_arg_info->allow_null) {
if (cur_arg_info->class_name) {
need_msg = zend_verify_internal_arg_class_kind((zend_internal_arg_info*)cur_arg_info, &class_name, &ce);
zend_verify_arg_error(zf, arg_num, need_msg, class_name, zend_zval_type_name(arg), "");
return 0;
} else if (cur_arg_info->type_hint == IS_CALLABLE) {
if (!zend_is_callable(arg, IS_CALLABLE_CHECK_SILENT, NULL)) {
zend_verify_arg_error(zf, arg_num, "be callable", "", zend_zval_type_name(arg), "");
return 0;
}
} else if (cur_arg_info->type_hint == IS_ITERABLE) {
if (!zend_is_iterable(arg)) {
zend_verify_arg_error(zf, arg_num, "be iterable", "", zend_zval_type_name(arg), "");
return 0;
}
} else if (cur_arg_info->type_hint == _IS_BOOL &&
EXPECTED(Z_TYPE_P(arg) == IS_FALSE || Z_TYPE_P(arg) == IS_TRUE)) {
/* pass */
} else if (UNEXPECTED(!zend_verify_scalar_type_hint(cur_arg_info->type_hint, arg, ZEND_CALL_USES_STRICT_TYPES(EG(current_execute_data))))) {
zend_verify_arg_error(zf, arg_num, "be of the type ", zend_get_type_by_const(cur_arg_info->type_hint), zend_zval_type_name(arg), "");
return 0;
}
}
if (UNEXPECTED(!zend_check_internal_type(zf, cur_arg_info, arg, &ce, 0))) {
zend_verify_arg_error(zf, (const zend_arg_info *) cur_arg_info, arg_num, ce, arg);
return 0;
}
return 1;
}
@@ -792,10 +873,69 @@ static zend_never_inline int zend_verify_internal_arg_types(zend_function *fbc,
return 1;
}
static zend_always_inline zend_bool zend_check_type(
const zend_function *zf, const zend_arg_info *arg_info,
zval *arg, zend_class_entry **ce, void **cache_slot,
zval *default_value, zend_bool is_return_type)
{
if (!arg_info->type_hint) {
return 1;
}
ZVAL_DEREF(arg);
if (EXPECTED(arg_info->type_hint == Z_TYPE_P(arg))) {
if (arg_info->class_name) {
if (EXPECTED(*cache_slot)) {
*ce = (zend_class_entry *) *cache_slot;
} else {
*ce = zend_verify_arg_class_kind(arg_info);
if (UNEXPECTED(!*ce)) {
return 0;
}
*cache_slot = (void *) *ce;
}
if (UNEXPECTED(!instanceof_function(Z_OBJCE_P(arg), *ce))) {
return 0;
}
}
return 1;
}
if (Z_TYPE_P(arg) == IS_NULL && (arg_info->allow_null || (default_value && is_null_constant(zf->common.scope, default_value)))) {
/* Null passed to nullable type */
return 1;
}
if (UNEXPECTED(arg_info->class_name)) {
/* This is always an error - we fetch the class name for the error message here */
if (EXPECTED(*cache_slot)) {
*ce = (zend_class_entry *) *cache_slot;
} else {
*ce = zend_verify_arg_class_kind(arg_info);
if (*ce) {
*cache_slot = (void *) *ce;
}
}
return 0;
} else if (arg_info->type_hint == IS_CALLABLE) {
return zend_is_callable(arg, IS_CALLABLE_CHECK_SILENT, NULL);
} else if (arg_info->type_hint == IS_ITERABLE) {
return zend_is_iterable(arg);
} else if (arg_info->type_hint == _IS_BOOL &&
EXPECTED(Z_TYPE_P(arg) == IS_FALSE || Z_TYPE_P(arg) == IS_TRUE)) {
return 1;
} else {
return zend_verify_scalar_type_hint(arg_info->type_hint, arg,
is_return_type ? ZEND_RET_USES_STRICT_TYPES() : ZEND_ARG_USES_STRICT_TYPES());
}
/* Special handling for IS_VOID is not necessary (for return types),
* because this case is already checked at compile-time. */
}
static zend_always_inline int zend_verify_arg_type(zend_function *zf, uint32_t arg_num, zval *arg, zval *default_value, void **cache_slot)
{
zend_arg_info *cur_arg_info;
char *need_msg;
zend_class_entry *ce;
if (EXPECTED(arg_num <= zf->common.num_args)) {
@@ -806,68 +946,11 @@ static zend_always_inline int zend_verify_arg_type(zend_function *zf, uint32_t a
return 1;
}
if (cur_arg_info->type_hint) {
ZVAL_DEREF(arg);
if (EXPECTED(cur_arg_info->type_hint == Z_TYPE_P(arg))) {
if (cur_arg_info->class_name) {
if (EXPECTED(*cache_slot)) {
ce = (zend_class_entry*)*cache_slot;
} else {
ce = zend_verify_arg_class_kind(cur_arg_info);
if (UNEXPECTED(!ce)) {
zend_verify_arg_error(zf, arg_num, "be an instance of ", ZSTR_VAL(cur_arg_info->class_name), "instance of ", ZSTR_VAL(Z_OBJCE_P(arg)->name));
return 0;
}
*cache_slot = (void*)ce;
}
if (UNEXPECTED(!instanceof_function(Z_OBJCE_P(arg), ce))) {
need_msg =
(ce->ce_flags & ZEND_ACC_INTERFACE) ?
"implement interface " : "be an instance of ";
zend_verify_arg_error(zf, arg_num, need_msg, ZSTR_VAL(ce->name), "instance of ", ZSTR_VAL(Z_OBJCE_P(arg)->name));
return 0;
}
}
} else if (Z_TYPE_P(arg) != IS_NULL || !(cur_arg_info->allow_null || (default_value && is_null_constant(zf->common.scope, default_value)))) {
if (cur_arg_info->class_name) {
if (EXPECTED(*cache_slot)) {
ce = (zend_class_entry*)*cache_slot;
} else {
ce = zend_verify_arg_class_kind(cur_arg_info);
if (UNEXPECTED(!ce)) {
if (Z_TYPE_P(arg) == IS_OBJECT) {
zend_verify_arg_error(zf, arg_num, "be an instance of ", ZSTR_VAL(cur_arg_info->class_name), "instance of ", ZSTR_VAL(Z_OBJCE_P(arg)->name));
} else {
zend_verify_arg_error(zf, arg_num, "be an instance of ", ZSTR_VAL(cur_arg_info->class_name), "", zend_zval_type_name(arg));
}
return 0;
}
*cache_slot = (void*)ce;
}
need_msg =
(ce->ce_flags & ZEND_ACC_INTERFACE) ?
"implement interface " : "be an instance of ";
zend_verify_arg_error(zf, arg_num, need_msg, ZSTR_VAL(ce->name), zend_zval_type_name(arg), "");
return 0;
} else if (cur_arg_info->type_hint == IS_CALLABLE) {
if (!zend_is_callable(arg, IS_CALLABLE_CHECK_SILENT, NULL)) {
zend_verify_arg_error(zf, arg_num, "be callable", "", zend_zval_type_name(arg), "");
return 0;
}
} else if (cur_arg_info->type_hint == IS_ITERABLE) {
if (!zend_is_iterable(arg)) {
zend_verify_arg_error(zf, arg_num, "be iterable", "", zend_zval_type_name(arg), "");
return 0;
}
} else if (cur_arg_info->type_hint == _IS_BOOL &&
EXPECTED(Z_TYPE_P(arg) == IS_FALSE || Z_TYPE_P(arg) == IS_TRUE)) {
/* pass */
} else if (UNEXPECTED(!zend_verify_scalar_type_hint(cur_arg_info->type_hint, arg, ZEND_ARG_USES_STRICT_TYPES()))) {
zend_verify_arg_error(zf, arg_num, "be of the type ", zend_get_type_by_const(cur_arg_info->type_hint), zend_zval_type_name(arg), "");
return 0;
}
}
if (UNEXPECTED(!zend_check_type(zf, cur_arg_info, arg, &ce, cache_slot, default_value, 0))) {
zend_verify_arg_error(zf, cur_arg_info, arg_num, ce, arg);
return 0;
}
return 1;
}
@@ -876,7 +959,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_missing_arg_error(zend_execute_data *
zend_execute_data *ptr = EX(prev_execute_data);
if (ptr && ptr->func && ZEND_USER_CODE(ptr->func->common.type)) {
zend_throw_error(NULL, "Too few arguments to function %s%s%s(), %d passed in %s on line %d and %s %d expected",
zend_throw_error(zend_ce_argument_count_error, "Too few arguments to function %s%s%s(), %d passed in %s on line %d and %s %d expected",
EX(func)->common.scope ? ZSTR_VAL(EX(func)->common.scope->name) : "",
EX(func)->common.scope ? "::" : "",
ZSTR_VAL(EX(func)->common.function_name),
@@ -886,7 +969,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_missing_arg_error(zend_execute_data *
EX(func)->common.required_num_args == EX(func)->common.num_args ? "exactly" : "at least",
EX(func)->common.required_num_args);
} else {
zend_throw_error(NULL, "Too few arguments to function %s%s%s(), %d passed and %s %d expected",
zend_throw_error(zend_ce_argument_count_error, "Too few arguments to function %s%s%s(), %d passed and %s %d expected",
EX(func)->common.scope ? ZSTR_VAL(EX(func)->common.scope->name) : "",
EX(func)->common.scope ? "::" : "",
ZSTR_VAL(EX(func)->common.function_name),
@@ -896,41 +979,35 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_missing_arg_error(zend_execute_data *
}
}
static ZEND_COLD void zend_verify_return_error(const zend_function *zf, const char *need_msg, const char *need_kind, const char *returned_msg, const char *returned_kind)
static ZEND_COLD void zend_verify_return_error(
const zend_function *zf, const zend_class_entry *ce, zval *value)
{
const char *fname = ZSTR_VAL(zf->common.function_name);
const char *fsep;
const char *fclass;
const zend_arg_info *arg_info = &zf->common.arg_info[-1];
const char *fname, *fsep, *fclass;
const char *need_msg, *need_kind, *need_or_null, *given_msg, *given_kind;
if (zf->common.scope) {
fsep = "::";
fclass = ZSTR_VAL(zf->common.scope->name);
} else {
fsep = "";
fclass = "";
}
zend_verify_type_error_common(
zf, arg_info, ce, value,
&fname, &fsep, &fclass, &need_msg, &need_kind, &need_or_null, &given_msg, &given_kind);
zend_type_error("Return value of %s%s%s() must %s%s, %s%s returned",
fclass, fsep, fname, need_msg, need_kind, returned_msg, returned_kind);
zend_type_error("Return value of %s%s%s() must %s%s%s, %s%s returned",
fclass, fsep, fname, need_msg, need_kind, need_or_null, given_msg, given_kind);
}
#if ZEND_DEBUG
static ZEND_COLD void zend_verify_internal_return_error(const zend_function *zf, const char *need_msg, const char *need_kind, const char *returned_msg, const char *returned_kind)
static ZEND_COLD void zend_verify_internal_return_error(
const zend_function *zf, const zend_class_entry *ce, zval *value)
{
const char *fname = ZSTR_VAL(zf->common.function_name);
const char *fsep;
const char *fclass;
const zend_arg_info *arg_info = &zf->common.arg_info[-1];
const char *fname, *fsep, *fclass;
const char *need_msg, *need_kind, *need_or_null, *given_msg, *given_kind;
if (zf->common.scope) {
fsep = "::";
fclass = ZSTR_VAL(zf->common.scope->name);
} else {
fsep = "";
fclass = "";
}
zend_verify_type_error_common(
zf, arg_info, ce, value,
&fname, &fsep, &fclass, &need_msg, &need_kind, &need_or_null, &given_msg, &given_kind);
zend_error_noreturn(E_CORE_ERROR, "Return value of %s%s%s() must %s%s, %s%s returned",
fclass, fsep, fname, need_msg, need_kind, returned_msg, returned_kind);
zend_error_noreturn(E_CORE_ERROR, "Return value of %s%s%s() must %s%s%s, %s%s returned",
fclass, fsep, fname, need_msg, need_kind, need_or_null, given_msg, given_kind);
}
static ZEND_COLD void zend_verify_void_return_error(const zend_function *zf, const char *returned_msg, const char *returned_kind)
@@ -953,46 +1030,19 @@ static ZEND_COLD void zend_verify_void_return_error(const zend_function *zf, con
static int zend_verify_internal_return_type(zend_function *zf, zval *ret)
{
zend_arg_info *ret_info = zf->common.arg_info - 1;
char *need_msg, *class_name;
zend_class_entry *ce;
zend_internal_arg_info *ret_info = zf->internal_function.arg_info - 1;
zend_class_entry *ce = NULL;
if (ret_info->type_hint) {
if (EXPECTED(ret_info->type_hint == Z_TYPE_P(ret))) {
if (ret_info->class_name) {
need_msg = zend_verify_internal_arg_class_kind((zend_internal_arg_info *)ret_info, &class_name, &ce);
if (!ce || !instanceof_function(Z_OBJCE_P(ret), ce)) {
zend_verify_internal_return_error(zf, need_msg, class_name, "instance of ", ZSTR_VAL(Z_OBJCE_P(ret)->name));
return 0;
}
}
} else if (Z_TYPE_P(ret) != IS_NULL || !ret_info->allow_null) {
if (ret_info->class_name) {
need_msg = zend_verify_internal_arg_class_kind((zend_internal_arg_info *)ret_info, &class_name, &ce);
zend_verify_internal_return_error(zf, need_msg, class_name, zend_zval_type_name(ret), "");
} else if (ret_info->type_hint == IS_CALLABLE) {
if (!zend_is_callable(ret, IS_CALLABLE_CHECK_SILENT, NULL) && (Z_TYPE_P(ret) != IS_NULL || !ret_info->allow_null)) {
zend_verify_internal_return_error(zf, "be callable", "", zend_zval_type_name(ret), "");
return 0;
}
} else if (ret_info->type_hint == IS_ITERABLE) {
if (!zend_is_iterable(ret) && (Z_TYPE_P(ret) != IS_NULL || !ret_info->allow_null)) {
zend_verify_internal_return_error(zf, "be iterable", "", zend_zval_type_name(ret), "");
return 0;
}
} else if (ret_info->type_hint == _IS_BOOL &&
EXPECTED(Z_TYPE_P(ret) == IS_FALSE || Z_TYPE_P(ret) == IS_TRUE)) {
/* pass */
} else if (ret_info->type_hint == IS_VOID) {
zend_verify_void_return_error(zf, zend_zval_type_name(ret), "");
} else {
/* Use strict check to verify return value of internal function */
zend_verify_internal_return_error(zf, "be of the type ", zend_get_type_by_const(ret_info->type_hint), zend_zval_type_name(ret), "");
return 0;
}
}
if (UNEXPECTED(ret_info->type_hint == IS_VOID && Z_TYPE_P(ret) != IS_NULL)) {
zend_verify_void_return_error(zf, zend_zval_type_name(ret), "");
return 0;
}
if (UNEXPECTED(!zend_check_internal_type(zf, ret_info, ret, &ce, 1))) {
zend_verify_internal_return_error(zf, ce, ret);
return 0;
}
return 1;
}
#endif
@@ -1000,99 +1050,30 @@ static int zend_verify_internal_return_type(zend_function *zf, zval *ret)
static zend_always_inline void zend_verify_return_type(zend_function *zf, zval *ret, void **cache_slot)
{
zend_arg_info *ret_info = zf->common.arg_info - 1;
char *need_msg;
zend_class_entry *ce;
if (ret_info->type_hint) {
if (EXPECTED(ret_info->type_hint == Z_TYPE_P(ret))) {
if (ret_info->class_name) {
if (EXPECTED(*cache_slot)) {
ce = (zend_class_entry*)*cache_slot;
} else {
ce = zend_verify_arg_class_kind(ret_info);
if (UNEXPECTED(!ce)) {
zend_verify_return_error(zf, "be an instance of ", ZSTR_VAL(ret_info->class_name), "instance of ", ZSTR_VAL(Z_OBJCE_P(ret)->name));
return;
}
*cache_slot = (void*)ce;
}
if (UNEXPECTED(!instanceof_function(Z_OBJCE_P(ret), ce))) {
need_msg =
(ce->ce_flags & ZEND_ACC_INTERFACE) ?
"implement interface " : "be an instance of ";
zend_verify_return_error(zf, need_msg, ZSTR_VAL(ce->name), "instance of ", ZSTR_VAL(Z_OBJCE_P(ret)->name));
}
}
} else if (Z_TYPE_P(ret) != IS_NULL || !ret_info->allow_null) {
if (ret_info->class_name) {
if (EXPECTED(*cache_slot)) {
ce = (zend_class_entry*)*cache_slot;
} else {
ce = zend_verify_arg_class_kind(ret_info);
if (UNEXPECTED(!ce)) {
zend_verify_return_error(zf, "be an instance of ", ZSTR_VAL(ret_info->class_name), zend_zval_type_name(ret), "");
return;
}
*cache_slot = (void*)ce;
}
need_msg =
(ce->ce_flags & ZEND_ACC_INTERFACE) ?
"implement interface " : "be an instance of ";
zend_verify_return_error(zf, need_msg, ZSTR_VAL(ce->name), zend_zval_type_name(ret), "");
} else if (ret_info->type_hint == IS_CALLABLE) {
if (!zend_is_callable(ret, IS_CALLABLE_CHECK_SILENT, NULL)) {
zend_verify_return_error(zf, "be callable", "", zend_zval_type_name(ret), "");
}
} else if (ret_info->type_hint == IS_ITERABLE) {
if (!zend_is_iterable(ret)) {
zend_verify_return_error(zf, "be iterable", "", zend_zval_type_name(ret), "");
}
} else if (ret_info->type_hint == _IS_BOOL &&
EXPECTED(Z_TYPE_P(ret) == IS_FALSE || Z_TYPE_P(ret) == IS_TRUE)) {
/* pass */
/* There would be a check here for the IS_VOID type hint, which
* would trigger an error because a value had been returned.
* However, zend_compile.c already does a compile-time check
* that bans `return ...;` within a void function. Thus we can skip
* this part of the runtime check for non-internal functions.
*/
} else if (UNEXPECTED(!zend_verify_scalar_type_hint(ret_info->type_hint, ret, ZEND_RET_USES_STRICT_TYPES()))) {
zend_verify_return_error(zf, "be of the type ", zend_get_type_by_const(ret_info->type_hint), zend_zval_type_name(ret), "");
}
}
zend_class_entry *ce = NULL;
if (UNEXPECTED(!zend_check_type(zf, ret_info, ret, &ce, cache_slot, NULL, 1))) {
zend_verify_return_error(zf, ce, ret);
}
}
static ZEND_COLD int zend_verify_missing_return_type(zend_function *zf, void **cache_slot)
{
zend_arg_info *ret_info = zf->common.arg_info - 1;
char *need_msg;
zend_class_entry *ce;
if (ret_info->type_hint && EXPECTED(ret_info->type_hint != IS_VOID)) {
if (ret_info->type_hint && UNEXPECTED(ret_info->type_hint != IS_VOID)) {
zend_class_entry *ce = NULL;
if (ret_info->class_name) {
if (EXPECTED(*cache_slot)) {
ce = (zend_class_entry*)*cache_slot;
ce = (zend_class_entry*) *cache_slot;
} else {
ce = zend_verify_arg_class_kind(ret_info);
if (UNEXPECTED(!ce)) {
zend_verify_return_error(zf, "be an instance of ", ZSTR_VAL(ret_info->class_name), "none", "");
return 0;
if (ce) {
*cache_slot = (void*)ce;
}
*cache_slot = (void*)ce;
}
need_msg =
(ce->ce_flags & ZEND_ACC_INTERFACE) ?
"implement interface " : "be an instance of ";
zend_verify_return_error(zf, need_msg, ZSTR_VAL(ce->name), "none", "");
return 0;
} else if (ret_info->type_hint == IS_CALLABLE) {
zend_verify_return_error(zf, "be callable", "", "none", "");
} else if (ret_info->type_hint == IS_ITERABLE) {
zend_verify_return_error(zf, "be iterable", "", "none", "");
} else {
zend_verify_return_error(zf, "be of the type ", zend_get_type_by_const(ret_info->type_hint), "none", "");
}
zend_verify_return_error(zf, ce, NULL);
return 0;
}
return 1;
@@ -1353,6 +1334,7 @@ static zend_never_inline void zend_assign_to_string_offset(zval *str, zval *dim,
zend_string_release(old_str);
} else {
SEPARATE_STRING(str);
zend_string_forget_hash_val(Z_STR_P(str));
}
Z_STRVAL_P(str)[offset] = c;
+24 -38
View File
@@ -597,26 +597,24 @@ ZEND_API int zval_update_constant_ex(zval *p, zend_class_entry *scope) /* {{{ */
RESET_CONSTANT_VISITED(p);
return FAILURE;
} else {
zend_string *save = Z_STR_P(p);
char *slash;
size_t actual_len = Z_STRLEN_P(p);
if ((Z_CONST_FLAGS_P(p) & IS_CONSTANT_UNQUALIFIED) && (slash = (char *)zend_memrchr(actual, '\\', actual_len))) {
actual = slash + 1;
actual_len -= (actual - Z_STRVAL_P(p));
if (inline_change) {
zend_string *s = zend_string_init(actual, actual_len, 0);
Z_STR_P(p) = s;
Z_TYPE_FLAGS_P(p) = IS_TYPE_REFCOUNTED | IS_TYPE_COPYABLE;
}
}
if ((Z_CONST_FLAGS_P(p) & IS_CONSTANT_UNQUALIFIED) == 0) {
zend_throw_error(NULL, "Undefined constant '%s'", ZSTR_VAL(save));
if (inline_change) {
zend_string_release(save);
}
zend_throw_error(NULL, "Undefined constant '%s'", Z_STRVAL_P(p));
RESET_CONSTANT_VISITED(p);
return FAILURE;
} else {
zend_string *save = Z_STR_P(p);
size_t actual_len = Z_STRLEN_P(p);
char *slash = (char *) zend_memrchr(actual, '\\', actual_len);
if (slash) {
actual = slash + 1;
actual_len -= (actual - Z_STRVAL_P(p));
if (inline_change) {
zend_string *s = zend_string_init(actual, actual_len, 0);
Z_STR_P(p) = s;
Z_TYPE_FLAGS_P(p) = IS_TYPE_REFCOUNTED | IS_TYPE_COPYABLE;
}
}
zend_error(E_NOTICE, "Use of undefined constant %s - assumed '%s'", actual, actual);
if (!inline_change) {
ZVAL_STRINGL(p, actual, actual_len);
@@ -790,41 +788,29 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache) /
if (ARG_SHOULD_BE_SENT_BY_REF(func, i + 1)) {
if (UNEXPECTED(!Z_ISREF_P(arg))) {
if (fci->no_separation &&
!ARG_MAY_BE_SENT_BY_REF(func, i + 1)) {
if (i) {
/* hack to clean up the stack */
ZEND_CALL_NUM_ARGS(call) = i;
zend_vm_stack_free_args(call);
}
zend_vm_stack_free_call_frame(call);
zend_error(E_WARNING, "Parameter %d to %s%s%s() expected to be a reference, value given",
i+1,
if (!fci->no_separation) {
/* Separation is enabled -- create a ref */
ZVAL_NEW_REF(arg, arg);
} else if (!ARG_MAY_BE_SENT_BY_REF(func, i + 1)) {
/* By-value send is not allowed -- emit a warning,
* but still perform the call with a by-value send. */
zend_error(E_WARNING,
"Parameter %d to %s%s%s() expected to be a reference, value given", i+1,
func->common.scope ? ZSTR_VAL(func->common.scope->name) : "",
func->common.scope ? "::" : "",
ZSTR_VAL(func->common.function_name));
if (EG(current_execute_data) == &dummy_execute_data) {
EG(current_execute_data) = dummy_execute_data.prev_execute_data;
}
return FAILURE;
}
ZVAL_NEW_REF(arg, arg);
}
Z_ADDREF_P(arg);
} else {
if (Z_ISREF_P(arg) &&
!(func->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE)) {
/* don't separate references for __call */
arg = Z_REFVAL_P(arg);
}
if (Z_OPT_REFCOUNTED_P(arg)) {
Z_ADDREF_P(arg);
}
}
param = ZEND_CALL_ARG(call, i+1);
ZVAL_COPY_VALUE(param, arg);
ZVAL_COPY(param, arg);
}
if (UNEXPECTED(func->op_array.fn_flags & ZEND_ACC_CLOSURE)) {
+1
View File
@@ -1144,6 +1144,7 @@ ZEND_API int zend_gc_collect_cycles(void)
if (EG(objects_store).object_buckets &&
IS_OBJ_VALID(EG(objects_store).object_buckets[obj->handle])) {
EG(objects_store).object_buckets[obj->handle] = SET_OBJ_INVALID(obj);
GC_TYPE(obj) = IS_NULL;
if (!(GC_FLAGS(obj) & IS_OBJ_FREE_CALLED)) {
GC_FLAGS(obj) |= IS_OBJ_FREE_CALLED;
+10 -12
View File
@@ -635,6 +635,16 @@ ZEND_API zend_generator *zend_generator_update_current(zend_generator *generator
zend_throw_exception(zend_ce_ClosedGeneratorException, "Generator yielded from aborted, no return value available", 0);
EG(current_execute_data) = original_execute_data;
if (!((old_root ? old_root : generator)->flags & ZEND_GENERATOR_CURRENTLY_RUNNING)) {
leaf->node.ptr.root = root;
root->node.parent = NULL;
if (old_root) {
OBJ_RELEASE(&old_root->std);
}
zend_generator_resume(leaf);
return leaf->node.ptr.root; /* this may be updated during zend_generator_resume! */
}
} else {
zval_ptr_dtor(&root->value);
ZVAL_COPY(&root->value, &root->node.parent->value);
@@ -970,15 +980,9 @@ ZEND_METHOD(Generator, send)
zval *value;
zend_generator *generator, *root;
#ifndef FAST_ZPP
if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &value) == FAILURE) {
return;
}
#else
ZEND_PARSE_PARAMETERS_START(1, 1)
Z_PARAM_ZVAL(value)
ZEND_PARSE_PARAMETERS_END();
#endif
generator = (zend_generator *) Z_OBJ_P(getThis());
@@ -1014,15 +1018,9 @@ ZEND_METHOD(Generator, throw)
zval *exception, exception_copy;
zend_generator *generator;
#ifndef FAST_ZPP
if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &exception) == FAILURE) {
return;
}
#else
ZEND_PARSE_PARAMETERS_START(1, 1)
Z_PARAM_ZVAL(exception)
ZEND_PARSE_PARAMETERS_END();
#endif
ZVAL_DUP(&exception_copy, exception);
+2 -1
View File
@@ -292,7 +292,8 @@ struct _zend_php_scanner_globals {
int scanned_string_len;
/* hooks */
void (* on_event)(zend_php_scanner_event event, int token, int line);
void (*on_event)(zend_php_scanner_event event, int token, int line, void *context);
void *on_event_context;
};
#endif /* ZEND_GLOBALS_H */
-1
View File
@@ -2444,7 +2444,6 @@ ZEND_API int ZEND_FASTCALL _zend_handle_numeric_str_ex(const char *key, size_t l
register const char *tmp = key;
const char *end = key + length;
ZEND_ASSERT(*end == '\0');
if (*tmp == '-') {
tmp++;
+1 -1
View File
@@ -260,7 +260,7 @@ ZEND_API int zend_parse_ini_string(char *str, zend_bool unbuffered_errors, int s
%}
%expect 0
%pure_parser
%pure-parser
%token TC_SECTION
%token TC_RAW
+1 -1
View File
@@ -43,7 +43,7 @@ static YYSIZE_T zend_yytnamerr(char*, const char*);
%}
%pure_parser
%pure-parser
%expect 0
%code requires {
File diff suppressed because it is too large. Load diff
+2 -1
View File
@@ -51,7 +51,8 @@ typedef struct _zend_lex_state {
const zend_encoding *script_encoding;
/* hooks */
void (* on_event)(zend_php_scanner_event event, int token, int line);
void (*on_event)(zend_php_scanner_event event, int token, int line, void *context);
void *on_event_context;
zend_ast *ast;
zend_arena *ast_arena;
+8 -2
View File
@@ -226,6 +226,7 @@ ZEND_API void zend_save_lexical_state(zend_lex_state *lex_state)
lex_state->script_encoding = SCNG(script_encoding);
lex_state->on_event = SCNG(on_event);
lex_state->on_event_context = SCNG(on_event_context);
lex_state->ast = CG(ast);
lex_state->ast_arena = CG(ast_arena);
@@ -265,6 +266,7 @@ ZEND_API void zend_restore_lexical_state(zend_lex_state *lex_state)
SCNG(script_encoding) = lex_state->script_encoding;
SCNG(on_event) = lex_state->on_event;
SCNG(on_event_context) = lex_state->on_event_context;
CG(ast) = lex_state->ast;
CG(ast_arena) = lex_state->ast_arena;
@@ -284,7 +286,9 @@ ZEND_API void zend_destroy_file_handle(zend_file_handle *file_handle)
ZEND_API void zend_lex_tstring(zval *zv)
{
if (SCNG(on_event)) SCNG(on_event)(ON_FEEDBACK, T_STRING, 0);
if (SCNG(on_event)) {
SCNG(on_event)(ON_FEEDBACK, T_STRING, 0, SCNG(on_event_context));
}
ZVAL_STRINGL(zv, (char*)SCNG(yy_text), SCNG(yy_leng));
}
@@ -1082,7 +1086,9 @@ static int zend_scan_escape_string(zval *zendlval, char *str, int len, char quot
static zend_always_inline int emit_token(int token, int token_line)
{
if(SCNG(on_event)) SCNG(on_event)(ON_TOKEN, token, token_line);
if (SCNG(on_event)) {
SCNG(on_event)(ON_TOKEN, token, token_line, SCNG(on_event_context));
}
return token;
}
+1 -10
View File
@@ -182,6 +182,7 @@ ZEND_API HashTable *zend_std_get_debug_info(zval *object, int *is_temp) /* {{{ *
return ht;
}
zend_clear_exception();
zend_error_noreturn(E_ERROR, ZEND_DEBUGINFO_FUNC_NAME "() must return an array");
return NULL; /* Compilers are dumb and don't understand that noreturn means that the function does NOT need a return value... */
@@ -200,12 +201,8 @@ static void zend_std_call_getter(zval *object, zval *member, zval *retval) /* {{
it should return whether the call was successful or not
*/
if (Z_REFCOUNTED_P(member)) Z_ADDREF_P(member);
zend_call_method_with_1_params(object, ce, &ce->__get, ZEND_GET_FUNC_NAME, retval, member);
zval_ptr_dtor(member);
EG(fake_scope) = orig_fake_scope;
}
/* }}} */
@@ -219,9 +216,6 @@ static int zend_std_call_setter(zval *object, zval *member, zval *value) /* {{{
EG(fake_scope) = NULL;
if (Z_REFCOUNTED_P(member)) Z_ADDREF_P(member);
if (Z_REFCOUNTED_P(value)) Z_ADDREF_P(value);
/* __set handler is called with two arguments:
property name
value to be set
@@ -230,9 +224,6 @@ static int zend_std_call_setter(zval *object, zval *member, zval *value) /* {{{
*/
zend_call_method_with_2_params(object, ce, &ce->__set, ZEND_SET_FUNC_NAME, &retval, member, value);
zval_ptr_dtor(member);
zval_ptr_dtor(value);
if (Z_TYPE(retval) != IS_UNDEF) {
result = i_zend_is_true(&retval) ? SUCCESS : FAILURE;
zval_ptr_dtor(&retval);
+12 -26
View File
@@ -299,8 +299,8 @@ CWD_API int php_sys_stat_ex(const char *path, zend_stat_t *buf, int lstat) /* {{
WIN32_FILE_ATTRIBUTE_DATA data;
LARGE_INTEGER t;
const size_t path_len = strlen(path);
ALLOCA_FLAG(use_heap_large);
wchar_t *pathw = php_win32_ioutil_any_to_w(path);
ALLOCA_FLAG(use_heap_large)
if (!pathw) {
return -1;
@@ -328,32 +328,19 @@ CWD_API int php_sys_stat_ex(const char *path, zend_stat_t *buf, int lstat) /* {{
buf->st_dev = buf->st_rdev = 0;
} else {
wchar_t cur_path[MAXPATHLEN+1];
DWORD len = sizeof(cur_path);
wchar_t *tmp = cur_path;
while(1) {
DWORD r = GetCurrentDirectoryW(len, tmp);
if (r < len) {
if (tmp[1] == L':') {
if (pathw[0] >= L'A' && pathw[0] <= L'Z') {
buf->st_dev = buf->st_rdev = pathw[0] - L'A';
} else {
buf->st_dev = buf->st_rdev = pathw[0] - L'a';
}
if (NULL != _wgetcwd(cur_path, sizeof(cur_path)/sizeof(wchar_t))) {
if (cur_path[1] == L':') {
if (pathw[0] >= L'A' && pathw[0] <= L'Z') {
buf->st_dev = buf->st_rdev = pathw[0] - L'A';
} else {
buf->st_dev = buf->st_rdev = -1;
buf->st_dev = buf->st_rdev = pathw[0] - L'a';
}
break;
} else if (!r) {
buf->st_dev = buf->st_rdev = -1;
break;
} else {
len = r+1;
tmp = (wchar_t*)malloc(len*sizeof(wchar_t));
buf->st_dev = buf->st_rdev = -1;
}
}
if (tmp != cur_path) {
free(tmp);
} else {
buf->st_dev = buf->st_rdev = -1;
}
}
@@ -934,7 +921,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
wchar_t * reparsetarget;
BOOL isVolume = FALSE;
char *printname = NULL, *substitutename = NULL;
int printname_len, substitutename_len;
int substitutename_len;
int substitutename_off = 0;
if(++(*ll) > LINK_MAX) {
@@ -969,7 +956,6 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
if(pbuffer->ReparseTag == IO_REPARSE_TAG_SYMLINK) {
reparsetarget = pbuffer->SymbolicLinkReparseBuffer.ReparseTarget;
printname_len = pbuffer->MountPointReparseBuffer.PrintNameLength / sizeof(WCHAR);
isabsolute = (pbuffer->SymbolicLinkReparseBuffer.Flags == 0) ? 1 : 0;
printname = php_win32_ioutil_w_to_any(reparsetarget + pbuffer->MountPointReparseBuffer.PrintNameOffset / sizeof(WCHAR));
if (!printname) {
@@ -992,7 +978,6 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
else if(pbuffer->ReparseTag == IO_REPARSE_TAG_MOUNT_POINT) {
isabsolute = 1;
reparsetarget = pbuffer->MountPointReparseBuffer.ReparseTarget;
printname_len = pbuffer->MountPointReparseBuffer.PrintNameLength / sizeof(WCHAR);
printname = php_win32_ioutil_w_to_any(reparsetarget + pbuffer->MountPointReparseBuffer.PrintNameOffset / sizeof(WCHAR));
if (!printname) {
free_alloca(pbuffer, use_heap_large);
@@ -1406,6 +1391,7 @@ verify:
tmp = erealloc(state->cwd, state->cwd_length+1);
if (tmp == NULL) {
CWD_STATE_FREE(&old_state);
#if VIRTUAL_CWD_DEBUG
fprintf (stderr, "Out of memory\n");
#endif
@@ -1939,7 +1925,7 @@ CWD_API FILE *virtual_popen(const char *command, const char *type) /* {{{ */
#else /* Unix */
CWD_API FILE *virtual_popen(const char *command, const char *type) /* {{{ */
{
int command_length;
size_t command_length;
int dir_length, extra = 0;
char *command_line;
char *ptr, *dir;
+77 -36
View File
@@ -216,9 +216,22 @@ ZEND_VM_HANDLER(6, ZEND_SL, CONST|TMPVAR|CV, CONST|TMPVAR|CV)
zend_free_op free_op1, free_op2;
zval *op1, *op2;
op1 = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R);
op2 = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R);
if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)
&& EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)
&& EXPECTED((zend_ulong)Z_LVAL_P(op2) < SIZEOF_ZEND_LONG * 8)) {
ZVAL_LONG(EX_VAR(opline->result.var), Z_LVAL_P(op1) << Z_LVAL_P(op2));
ZEND_VM_NEXT_OPCODE();
}
SAVE_OPLINE();
op1 = GET_OP1_ZVAL_PTR(BP_VAR_R);
op2 = GET_OP2_ZVAL_PTR(BP_VAR_R);
if (OP1_TYPE == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(op1) == IS_UNDEF)) {
op1 = GET_OP1_UNDEF_CV(op1, BP_VAR_R);
}
if (OP2_TYPE == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(op2) == IS_UNDEF)) {
op2 = GET_OP2_UNDEF_CV(op2, BP_VAR_R);
}
shift_left_function(EX_VAR(opline->result.var), op1, op2);
FREE_OP1();
FREE_OP2();
@@ -231,9 +244,22 @@ ZEND_VM_HANDLER(7, ZEND_SR, CONST|TMPVAR|CV, CONST|TMPVAR|CV)
zend_free_op free_op1, free_op2;
zval *op1, *op2;
op1 = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R);
op2 = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R);
if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)
&& EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)
&& EXPECTED((zend_ulong)Z_LVAL_P(op2) < SIZEOF_ZEND_LONG * 8)) {
ZVAL_LONG(EX_VAR(opline->result.var), Z_LVAL_P(op1) >> Z_LVAL_P(op2));
ZEND_VM_NEXT_OPCODE();
}
SAVE_OPLINE();
op1 = GET_OP1_ZVAL_PTR(BP_VAR_R);
op2 = GET_OP2_ZVAL_PTR(BP_VAR_R);
if (OP1_TYPE == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(op1) == IS_UNDEF)) {
op1 = GET_OP1_UNDEF_CV(op1, BP_VAR_R);
}
if (OP2_TYPE == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(op2) == IS_UNDEF)) {
op2 = GET_OP2_UNDEF_CV(op2, BP_VAR_R);
}
shift_right_function(EX_VAR(opline->result.var), op1, op2);
FREE_OP1();
FREE_OP2();
@@ -608,9 +634,21 @@ ZEND_VM_HANDLER(9, ZEND_BW_OR, CONST|TMPVAR|CV, CONST|TMPVAR|CV)
zend_free_op free_op1, free_op2;
zval *op1, *op2;
op1 = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R);
op2 = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R);
if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)
&& EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
ZVAL_LONG(EX_VAR(opline->result.var), Z_LVAL_P(op1) | Z_LVAL_P(op2));
ZEND_VM_NEXT_OPCODE();
}
SAVE_OPLINE();
op1 = GET_OP1_ZVAL_PTR(BP_VAR_R);
op2 = GET_OP2_ZVAL_PTR(BP_VAR_R);
if (OP1_TYPE == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(op1) == IS_UNDEF)) {
op1 = GET_OP1_UNDEF_CV(op1, BP_VAR_R);
}
if (OP2_TYPE == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(op2) == IS_UNDEF)) {
op2 = GET_OP2_UNDEF_CV(op2, BP_VAR_R);
}
bitwise_or_function(EX_VAR(opline->result.var), op1, op2);
FREE_OP1();
FREE_OP2();
@@ -623,9 +661,21 @@ ZEND_VM_HANDLER(10, ZEND_BW_AND, CONST|TMPVAR|CV, CONST|TMPVAR|CV)
zend_free_op free_op1, free_op2;
zval *op1, *op2;
op1 = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R);
op2 = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R);
if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)
&& EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
ZVAL_LONG(EX_VAR(opline->result.var), Z_LVAL_P(op1) & Z_LVAL_P(op2));
ZEND_VM_NEXT_OPCODE();
}
SAVE_OPLINE();
op1 = GET_OP1_ZVAL_PTR(BP_VAR_R);
op2 = GET_OP2_ZVAL_PTR(BP_VAR_R);
if (OP1_TYPE == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(op1) == IS_UNDEF)) {
op1 = GET_OP1_UNDEF_CV(op1, BP_VAR_R);
}
if (OP2_TYPE == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(op2) == IS_UNDEF)) {
op2 = GET_OP2_UNDEF_CV(op2, BP_VAR_R);
}
bitwise_and_function(EX_VAR(opline->result.var), op1, op2);
FREE_OP1();
FREE_OP2();
@@ -638,9 +688,21 @@ ZEND_VM_HANDLER(11, ZEND_BW_XOR, CONST|TMPVAR|CV, CONST|TMPVAR|CV)
zend_free_op free_op1, free_op2;
zval *op1, *op2;
op1 = GET_OP1_ZVAL_PTR_UNDEF(BP_VAR_R);
op2 = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R);
if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)
&& EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
ZVAL_LONG(EX_VAR(opline->result.var), Z_LVAL_P(op1) ^ Z_LVAL_P(op2));
ZEND_VM_NEXT_OPCODE();
}
SAVE_OPLINE();
op1 = GET_OP1_ZVAL_PTR(BP_VAR_R);
op2 = GET_OP2_ZVAL_PTR(BP_VAR_R);
if (OP1_TYPE == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(op1) == IS_UNDEF)) {
op1 = GET_OP1_UNDEF_CV(op1, BP_VAR_R);
}
if (OP2_TYPE == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(op2) == IS_UNDEF)) {
op2 = GET_OP2_UNDEF_CV(op2, BP_VAR_R);
}
bitwise_xor_function(EX_VAR(opline->result.var), op1, op2);
FREE_OP1();
FREE_OP2();
@@ -4626,23 +4688,15 @@ ZEND_VM_C_LABEL(send_array):
if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->func, arg_num)) {
if (UNEXPECTED(!Z_ISREF_P(arg))) {
if (!ARG_MAY_BE_SENT_BY_REF(EX(call)->func, arg_num)) {
zend_error(E_WARNING, "Parameter %d to %s%s%s() expected to be a reference, value given",
/* By-value send is not allowed -- emit a warning,
* but still perform the call. */
zend_error(E_WARNING,
"Parameter %d to %s%s%s() expected to be a reference, value given",
arg_num,
EX(call)->func->common.scope ? ZSTR_VAL(EX(call)->func->common.scope->name) : "",
EX(call)->func->common.scope ? "::" : "",
ZSTR_VAL(EX(call)->func->common.function_name));
if (ZEND_CALL_INFO(EX(call)) & ZEND_CALL_CLOSURE) {
OBJ_RELEASE((zend_object*)EX(call)->func->common.prototype);
}
if (Z_TYPE(EX(call)->This) == IS_OBJECT) {
OBJ_RELEASE(Z_OBJ(EX(call)->This));
}
EX(call)->func = (zend_function*)&zend_pass_function;
Z_OBJ(EX(call)->This) = NULL;
ZEND_SET_CALL_INFO(EX(call), 0, ZEND_CALL_INFO(EX(call)) & ~ZEND_CALL_RELEASE_THIS);
break;
}
}
} else {
@@ -4673,25 +4727,12 @@ ZEND_VM_HANDLER(120, ZEND_SEND_USER, VAR|CV, NUM)
param = ZEND_CALL_VAR(EX(call), opline->result.var);
if (UNEXPECTED(ARG_MUST_BE_SENT_BY_REF(EX(call)->func, opline->op2.num))) {
ZVAL_DEREF(arg);
zend_error(E_WARNING, "Parameter %d to %s%s%s() expected to be a reference, value given",
opline->op2.num,
EX(call)->func->common.scope ? ZSTR_VAL(EX(call)->func->common.scope->name) : "",
EX(call)->func->common.scope ? "::" : "",
ZSTR_VAL(EX(call)->func->common.function_name));
if (ZEND_CALL_INFO(EX(call)) & ZEND_CALL_CLOSURE) {
OBJ_RELEASE((zend_object*)EX(call)->func->common.prototype);
}
if (Z_TYPE(EX(call)->This) == IS_OBJECT) {
OBJ_RELEASE(Z_OBJ(EX(call)->This));
}
ZVAL_UNDEF(param);
EX(call)->func = (zend_function*)&zend_pass_function;
Z_OBJ(EX(call)->This) = NULL;
ZEND_SET_CALL_INFO(EX(call), 0, ZEND_CALL_INFO(EX(call)) & ~ZEND_CALL_RELEASE_THIS);
FREE_OP1();
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
} else {
if (Z_ISREF_P(arg) &&
!(EX(call)->func->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE)) {
+635 -110
View File
File diff suppressed because it is too large. Load diff
+1 -1
View File
@@ -1827,7 +1827,7 @@ function gen_executor($f, $skl, $spec, $kind, $executor_name, $initializer_name)
gen_specs($f, $spec, $kind, $prolog."\t", $specs);
out($f,$prolog."};\n");
out($f,$prolog."zend_opcode_handlers = labels;\n");
out($f,$prolog."\tzend_handlers_count = sizeof(labels) / sizeof(void*);\n");
out($f,$prolog."zend_handlers_count = sizeof(labels) / sizeof(void*);\n");
out($f,$prolog."zend_spec_handlers = specs;\n");
}
break;
+1 -1
View File
@@ -120,7 +120,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
PHP_MAJOR_VERSION=7
PHP_MINOR_VERSION=1
PHP_RELEASE_VERSION=0
PHP_EXTRA_VERSION="-dev"
PHP_EXTRA_VERSION="RC2"
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION`
+1 -1
View File
@@ -92,7 +92,7 @@ typedef struct bc_struct
/* Define the _PROTOTYPE macro if it is needed. */
#ifndef _PROTOTYPE
#ifdef __STDC__
#if defined(__STDC__) || defined(PHP_WIN32) && defined(__clang__)
#define _PROTOTYPE(func, args) func args
#else
#define _PROTOTYPE(func, args) func()
+26 -9
View File
@@ -562,7 +562,8 @@ static PHP_FUNCTION(bzcompress)
Decompresses BZip2 compressed data */
static PHP_FUNCTION(bzdecompress)
{
char *source, *dest;
char *source;
zend_string *dest;
size_t source_len;
int error;
zend_long small = 0;
@@ -589,24 +590,40 @@ static PHP_FUNCTION(bzdecompress)
/* in most cases bz2 offers at least 2:1 compression, so we use that as our base */
bzs.avail_out = source_len * 2;
bzs.next_out = dest = emalloc(bzs.avail_out + 1);
dest = zend_string_alloc(bzs.avail_out + 1, 0);
bzs.next_out = ZSTR_VAL(dest);
while ((error = BZ2_bzDecompress(&bzs)) == BZ_OK && bzs.avail_in > 0) {
/* compression is better then 2:1, need to allocate more memory */
bzs.avail_out = source_len;
size = (bzs.total_out_hi32 * (unsigned int) -1) + bzs.total_out_lo32;
dest = safe_erealloc(dest, 1, bzs.avail_out+1, (size_t) size );
bzs.next_out = dest + size;
#if !ZEND_ENABLE_ZVAL_LONG64
if (size > SIZE_MAX) {
/* no reason to continue if we're going to drop it anyway */
break;
}
#endif
dest = zend_string_safe_realloc(dest, 1, bzs.avail_out+1, (size_t) size, 0);
bzs.next_out = ZSTR_VAL(dest) + size;
}
if (error == BZ_STREAM_END || error == BZ_OK) {
size = (bzs.total_out_hi32 * (unsigned int) -1) + bzs.total_out_lo32;
dest = safe_erealloc(dest, 1, (size_t) size, 1);
dest[size] = '\0';
RETVAL_STRINGL(dest, (int) size);
efree(dest);
#if !ZEND_ENABLE_ZVAL_LONG64
if (UNEXPECTED(size > SIZE_MAX)) {
php_error_docref(NULL, E_WARNING, "Decompressed size too big, max is %zd", SIZE_MAX);
zend_string_free(dest);
RETVAL_LONG(BZ_MEM_ERROR);
} else
#endif
{
dest = zend_string_safe_realloc(dest, 1, (size_t)size, 1, 0);
ZSTR_LEN(dest) = (size_t)size;
ZSTR_VAL(dest)[(size_t)size] = '\0';
RETVAL_STR(dest);
}
} else { /* real error */
efree(dest);
zend_string_free(dest);
RETVAL_LONG(error);
}
+23 -11
View File
@@ -24,10 +24,6 @@
#include "config.h"
#endif
#ifdef PHP_WIN32
#define _WINNLS_
#endif
#include "php.h"
#include "ext/standard/info.h"
#include "php_calendar.h"
@@ -35,6 +31,12 @@
#include <stdio.h>
#ifdef PHP_WIN32
/* This conflicts with a define in winnls.h, but that header is needed
to have GetACP(). */
#undef CAL_GREGORIAN
#endif
/* {{{ arginfo */
ZEND_BEGIN_ARG_INFO_EX(arginfo_unixtojd, 0, 0, 0)
ZEND_ARG_INFO(0, timestamp)
@@ -357,6 +359,10 @@ PHP_FUNCTION(cal_days_in_month)
}
else {
sdn_next = calendar->to_jd(year + 1, 1, 1);
if (cal == CAL_FRENCH && sdn_next == 0) {
/* The French calendar ends on 0014-13-05. */
sdn_next = 2380953;
}
}
}
@@ -414,15 +420,21 @@ PHP_FUNCTION(cal_from_jd)
add_assoc_long(return_value, "year", year);
/* day of week */
dow = DayOfWeek(jd);
add_assoc_long(return_value, "dow", dow);
add_assoc_string(return_value, "abbrevdayname", DayNameShort[dow]);
add_assoc_string(return_value, "dayname", DayNameLong[dow]);
if (cal != CAL_JEWISH || year > 0) {
dow = DayOfWeek(jd);
add_assoc_long(return_value, "dow", dow);
add_assoc_string(return_value, "abbrevdayname", DayNameShort[dow]);
add_assoc_string(return_value, "dayname", DayNameLong[dow]);
} else {
add_assoc_null(return_value, "dow");
add_assoc_string(return_value, "abbrevdayname", "");
add_assoc_string(return_value, "dayname", "");
}
/* month name */
if(cal == CAL_JEWISH) {
/* special case for Jewish calendar */
add_assoc_string(return_value, "abbrevmonth", JEWISH_MONTH_NAME(year)[month]);
add_assoc_string(return_value, "monthname", JEWISH_MONTH_NAME(year)[month]);
add_assoc_string(return_value, "abbrevmonth", (year > 0 ? JEWISH_MONTH_NAME(year)[month] : ""));
add_assoc_string(return_value, "monthname", (year > 0 ? JEWISH_MONTH_NAME(year)[month] : ""));
} else {
add_assoc_string(return_value, "abbrevmonth", calendar->month_name_short[month]);
add_assoc_string(return_value, "monthname", calendar->month_name_long[month]);
@@ -735,7 +747,7 @@ PHP_FUNCTION(jdmonthname)
break;
case CAL_MONTH_JEWISH: /* jewish month */
SdnToJewish(julday, &year, &month, &day);
monthname = JEWISH_MONTH_NAME(year)[month];
monthname = (year > 0 ? JEWISH_MONTH_NAME(year)[month] : "");
break;
case CAL_MONTH_FRENCH: /* french month */
SdnToFrench(julday, &year, &month, &day);
+12
View File
@@ -0,0 +1,12 @@
--TEST--
Bug #67976 (cal_days_month() fails for final month of the French calendar)
--SKIPIF--
<?php
if (!extension_loaded('calendar')) die('skip ext/calendar required');
?>
--FILE--
<?php
var_dump(cal_days_in_month(CAL_FRENCH, 13, 14));
?>
--EXPECT--
int(5)
+32
View File
@@ -0,0 +1,32 @@
--TEST--
Bug #71894 (AddressSanitizer: global-buffer-overflow in zif_cal_from_jd)
--SKIPIF--
<?php
if (!extension_loaded('calendar')) die('skip ext/calendar required');
?>
--FILE--
<?php
var_dump(cal_from_jd(347997, CAL_JEWISH));
var_dump(jdmonthname(347997,CAL_MONTH_JEWISH));?>
--EXPECT--
array(9) {
["date"]=>
string(5) "0/0/0"
["month"]=>
int(0)
["day"]=>
int(0)
["year"]=>
int(0)
["dow"]=>
NULL
["abbrevdayname"]=>
string(0) ""
["dayname"]=>
string(0) ""
["abbrevmonth"]=>
string(0) ""
["monthname"]=>
string(0) ""
}
string(0) ""
@@ -0,0 +1,28 @@
--TEST--
jdtogregorian(): test overflow
--CREDITS--
neweracracker@gmail.com
--SKIPIF--
<?php
if (!extension_loaded('calendar')) die('skip ext/calendar required');
if (PHP_INT_SIZE != 4) die('skip this test is for 32bit platforms only');
?>
--FILE--
<?php
for ($i=536838860; $i<536838870; $i++) {
echo $i, ':', jdtogregorian($i), PHP_EOL;
}
echo 'DONE', PHP_EOL;
?>
--EXPECT--
536838860:10/11/1465102
536838861:10/12/1465102
536838862:10/13/1465102
536838863:10/14/1465102
536838864:10/15/1465102
536838865:10/16/1465102
536838866:10/17/1465102
536838867:0/0/0
536838868:0/0/0
536838869:0/0/0
DONE
@@ -0,0 +1,27 @@
--TEST--
jdtojewish(): test overflow
--CREDITS--
neweracracker@gmail.com
--SKIPIF--
<?php
if (!extension_loaded('calendar')) die('skip ext/calendar required');
?>
--FILE--
<?php
for ($i=324542840; $i<324542850; $i++) {
echo $i, ':', jdtojewish($i), PHP_EOL;
}
echo 'DONE', PHP_EOL;
?>
--EXPECT--
324542840:12/7/887605
324542841:12/8/887605
324542842:12/9/887605
324542843:12/10/887605
324542844:12/11/887605
324542845:12/12/887605
324542846:12/13/887605
324542847:0/0/0
324542848:0/0/0
324542849:0/0/0
DONE
+6 -5
View File
@@ -553,7 +553,10 @@ int php_com_do_invoke_byref(php_com_dotnet_object *obj, zend_internal_function *
for (i = 0, j = 0; i < nargs; i++) {
/* if this was byref, update the zval */
if (f->arg_info[nargs - i - 1].pass_by_reference) {
SEPARATE_ZVAL_IF_NOT_REF(&args[nargs - i - 1]);
zval *arg = &args[nargs - i - 1];
ZVAL_DEREF(arg);
SEPARATE_ZVAL_NOREF(arg);
/* if the variant is pointing at the byref_vals, we need to map
* the pointee value as a zval; otherwise, the value is pointing
@@ -561,14 +564,12 @@ int php_com_do_invoke_byref(php_com_dotnet_object *obj, zend_internal_function *
if (V_VT(&vargs[i]) & VT_BYREF) {
if (vargs[i].byref == &V_UINT(&byref_vals[j])) {
/* copy that value */
php_com_zval_from_variant(&args[nargs - i - 1], &byref_vals[j],
obj->code_page);
php_com_zval_from_variant(arg, &byref_vals[j], obj->code_page);
}
} else {
/* not sure if this can ever happen; the variant we marked as BYREF
* is no longer BYREF - copy its value */
php_com_zval_from_variant(&args[nargs - i - 1], &vargs[i],
obj->code_page);
php_com_zval_from_variant(arg, &vargs[i], obj->code_page);
}
VariantClear(&byref_vals[j]);
j++;
+2 -2
View File
@@ -279,7 +279,6 @@ static union _zend_function *com_method_get(zend_object **object_ptr, zend_strin
f.fn_flags = ZEND_ACC_CALL_VIA_HANDLER;
f.function_name = zend_string_copy(name);
f.handler = PHP_FN(com_method_handler);
zend_set_function_arg_flags((zend_function*)&f);
fptr = &f;
@@ -305,11 +304,12 @@ static union _zend_function *com_method_get(zend_object **object_ptr, zend_strin
for (i = 0; i < bindptr.lpfuncdesc->cParams; i++) {
f.arg_info[i].allow_null = 1;
if (bindptr.lpfuncdesc->lprgelemdescParam[i].paramdesc.wParamFlags & PARAMFLAG_FOUT) {
f.arg_info[i].pass_by_reference = 1;
f.arg_info[i].pass_by_reference = ZEND_SEND_BY_REF;
}
}
f.num_args = bindptr.lpfuncdesc->cParams;
zend_set_function_arg_flags((zend_function*)&f);
ITypeInfo_ReleaseFuncDesc(TI, bindptr.lpfuncdesc);
break;
+16 -50
View File
@@ -1884,38 +1884,6 @@ php_curl *alloc_curl_handle()
/* }}} */
#if LIBCURL_VERSION_NUM >= 0x071301 /* Available since 7.19.1 */
/* {{{ split_certinfo
*/
static void split_certinfo(char *string, zval *hash)
{
char *org = estrdup(string);
char *s = org;
char *split;
if(org) {
do {
char *key;
char *val;
char *tmp;
split = strstr(s, "; ");
if(split)
*split = '\0';
key = s;
tmp = memchr(key, '=', 64);
if(tmp) {
*tmp = '\0';
val = tmp+1;
add_assoc_string(hash, key, val);
}
s = split+2;
} while(split);
efree(org);
}
}
/* }}} */
/* {{{ create_certinfo
*/
static void create_certinfo(struct curl_certinfo *ci, zval *listcode)
@@ -1933,21 +1901,13 @@ static void create_certinfo(struct curl_certinfo *ci, zval *listcode)
int len;
char s[64];
char *tmp;
strncpy(s, slist->data, 64);
tmp = memchr(s, ':', 64);
strncpy(s, slist->data, sizeof(s));
s[sizeof(s)-1] = '\0';
tmp = memchr(s, ':', sizeof(s));
if(tmp) {
*tmp = '\0';
len = strlen(s);
if (!strcmp(s, "Subject") || !strcmp(s, "Issuer")) {
zval hash;
array_init(&hash);
split_certinfo(&slist->data[len+1], &hash);
add_assoc_zval(&certhash, s, &hash);
} else {
add_assoc_string(&certhash, s, &slist->data[len+1]);
}
add_assoc_string(&certhash, s, &slist->data[len+1]);
} else {
php_error_docref(NULL, E_WARNING, "Could not extract hash key from certificate info");
}
@@ -2671,10 +2631,12 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{
}
} ZEND_HASH_FOREACH_END();
if ((*ch->clone) == 1) {
zend_hash_index_update_ptr(ch->to_free->slist, option, slist);
} else {
zend_hash_next_index_insert_ptr(ch->to_free->slist, slist);
if (slist) {
if ((*ch->clone) == 1) {
zend_hash_index_update_ptr(ch->to_free->slist, option, slist);
} else {
zend_hash_next_index_insert_ptr(ch->to_free->slist, slist);
}
}
error = curl_easy_setopt(ch->cp, option, slist);
@@ -3569,7 +3531,7 @@ PHP_FUNCTION(curl_reset)
PHP_FUNCTION(curl_escape)
{
char *str = NULL, *res = NULL;
size_t str_len = 0;
size_t str_len = 0;
zval *zid;
php_curl *ch;
@@ -3581,6 +3543,10 @@ PHP_FUNCTION(curl_escape)
RETURN_FALSE;
}
if (ZEND_SIZE_T_INT_OVFL(str_len)) {
RETURN_FALSE;
}
if ((res = curl_easy_escape(ch->cp, str, str_len))) {
RETVAL_STRING(res);
curl_free(res);
@@ -3608,7 +3574,7 @@ PHP_FUNCTION(curl_unescape)
RETURN_FALSE;
}
if (str_len > INT_MAX) {
if (ZEND_SIZE_T_INT_OVFL(str_len)) {
RETURN_FALSE;
}
+64 -65
View File
@@ -1,4 +1,4 @@
/* Generated by re2c 0.13.5 on Wed Jul 20 13:32:20 2016 */
/* Generated by re2c 0.15.3 on Sun Jul 24 14:52:04 2016 */
#line 1 "ext/date/lib/parse_date.re"
/*
* The MIT License (MIT)
@@ -862,7 +862,6 @@ std:
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
};
if ((YYLIMIT - YYCURSOR) < 31) YYFILL(31);
yych = *YYCURSOR;
switch (yych) {
@@ -973,7 +972,7 @@ yy3:
TIMELIB_DEINIT;
return TIMELIB_TIMEZONE;
}
#line 977 "<stdout>"
#line 976 "<stdout>"
yy4:
yych = *++YYCURSOR;
if (yych <= 'E') {
@@ -1278,7 +1277,7 @@ yy12:
add_error(s, "Unexpected character");
goto std;
}
#line 1282 "<stdout>"
#line 1281 "<stdout>"
yy13:
yych = *++YYCURSOR;
if (yych <= 'R') {
@@ -2296,7 +2295,7 @@ yy49:
{
goto std;
}
#line 2300 "<stdout>"
#line 2299 "<stdout>"
yy50:
yych = *++YYCURSOR;
goto yy49;
@@ -2307,7 +2306,7 @@ yy51:
s->pos = cursor; s->line++;
goto std;
}
#line 2311 "<stdout>"
#line 2310 "<stdout>"
yy53:
yych = *++YYCURSOR;
goto yy12;
@@ -2374,7 +2373,7 @@ yy56:
if (yyaccept <= 4) {
if (yyaccept <= 2) {
if (yyaccept <= 1) {
if (yyaccept <= 0) {
if (yyaccept == 0) {
goto yy3;
} else {
goto yy12;
@@ -2383,7 +2382,7 @@ yy56:
goto yy49;
}
} else {
if (yyaccept <= 3) {
if (yyaccept == 3) {
goto yy72;
} else {
goto yy166;
@@ -2391,13 +2390,13 @@ yy56:
}
} else {
if (yyaccept <= 6) {
if (yyaccept <= 5) {
if (yyaccept == 5) {
goto yy193;
} else {
goto yy198;
}
} else {
if (yyaccept <= 7) {
if (yyaccept == 7) {
goto yy222;
} else {
goto yy294;
@@ -2407,13 +2406,13 @@ yy56:
} else {
if (yyaccept <= 12) {
if (yyaccept <= 10) {
if (yyaccept <= 9) {
if (yyaccept == 9) {
goto yy392;
} else {
goto yy475;
}
} else {
if (yyaccept <= 11) {
if (yyaccept == 11) {
goto yy490;
} else {
goto yy611;
@@ -2421,13 +2420,13 @@ yy56:
}
} else {
if (yyaccept <= 14) {
if (yyaccept <= 13) {
if (yyaccept == 13) {
goto yy656;
} else {
goto yy666;
}
} else {
if (yyaccept <= 15) {
if (yyaccept == 15) {
goto yy763;
} else {
goto yy783;
@@ -2440,7 +2439,7 @@ yy56:
if (yyaccept <= 21) {
if (yyaccept <= 19) {
if (yyaccept <= 18) {
if (yyaccept <= 17) {
if (yyaccept == 17) {
goto yy814;
} else {
goto yy821;
@@ -2449,7 +2448,7 @@ yy56:
goto yy848;
}
} else {
if (yyaccept <= 20) {
if (yyaccept == 20) {
goto yy793;
} else {
goto yy454;
@@ -2457,13 +2456,13 @@ yy56:
}
} else {
if (yyaccept <= 23) {
if (yyaccept <= 22) {
if (yyaccept == 22) {
goto yy973;
} else {
goto yy842;
}
} else {
if (yyaccept <= 24) {
if (yyaccept == 24) {
goto yy1067;
} else {
goto yy1075;
@@ -2473,13 +2472,13 @@ yy56:
} else {
if (yyaccept <= 29) {
if (yyaccept <= 27) {
if (yyaccept <= 26) {
if (yyaccept == 26) {
goto yy1117;
} else {
goto yy1141;
}
} else {
if (yyaccept <= 28) {
if (yyaccept == 28) {
goto yy1294;
} else {
goto yy1417;
@@ -2487,13 +2486,13 @@ yy56:
}
} else {
if (yyaccept <= 31) {
if (yyaccept <= 30) {
if (yyaccept == 30) {
goto yy1420;
} else {
goto yy1500;
}
} else {
if (yyaccept <= 32) {
if (yyaccept == 32) {
goto yy1508;
} else {
goto yy1531;
@@ -2689,7 +2688,7 @@ yy72:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 2693 "<stdout>"
#line 2692 "<stdout>"
yy73:
yych = *++YYCURSOR;
if (yych == 'D') goto yy74;
@@ -3374,7 +3373,7 @@ yy166:
TIMELIB_DEINIT;
return TIMELIB_WEEKDAY;
}
#line 3378 "<stdout>"
#line 3377 "<stdout>"
yy167:
yych = *++YYCURSOR;
if (yych <= 'K') {
@@ -3876,7 +3875,7 @@ yy193:
TIMELIB_DEINIT;
return TIMELIB_DATE_TEXT;
}
#line 3880 "<stdout>"
#line 3879 "<stdout>"
yy194:
++YYCURSOR;
if ((YYLIMIT - YYCURSOR) < 21) YYFILL(21);
@@ -3935,7 +3934,7 @@ yy198:
TIMELIB_DEINIT;
return TIMELIB_DATE_TEXT;
}
#line 3939 "<stdout>"
#line 3938 "<stdout>"
yy199:
yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
@@ -4209,7 +4208,7 @@ yy222:
TIMELIB_DEINIT;
return TIMELIB_SHORTDATE_WITH_TIME;
}
#line 4213 "<stdout>"
#line 4212 "<stdout>"
yy223:
yyaccept = 7;
yych = *(YYMARKER = ++YYCURSOR);
@@ -4874,7 +4873,7 @@ yy277:
TIMELIB_DEINIT;
return TIMELIB_SHORTDATE_WITH_TIME;
}
#line 4878 "<stdout>"
#line 4877 "<stdout>"
yy279:
yych = *++YYCURSOR;
if (yych <= 0x1F) {
@@ -5049,7 +5048,7 @@ yy294:
TIMELIB_DEINIT;
return TIMELIB_DATE_NO_DAY;
}
#line 5053 "<stdout>"
#line 5052 "<stdout>"
yy295:
yych = *++YYCURSOR;
if (yych <= '/') {
@@ -6213,7 +6212,7 @@ yy363:
TIMELIB_DEINIT;
return TIMELIB_PG_TEXT;
}
#line 6217 "<stdout>"
#line 6216 "<stdout>"
yy364:
yych = *++YYCURSOR;
if (yych <= '/') goto yy363;
@@ -6842,7 +6841,7 @@ yy392:
TIMELIB_DEINIT;
return TIMELIB_AGO;
}
#line 6846 "<stdout>"
#line 6845 "<stdout>"
yy393:
yyaccept = 5;
yych = *(YYMARKER = ++YYCURSOR);
@@ -8541,7 +8540,7 @@ yy454:
TIMELIB_DEINIT;
return TIMELIB_ISO_DATE;
}
#line 8545 "<stdout>"
#line 8544 "<stdout>"
yy455:
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
@@ -9088,7 +9087,7 @@ yy475:
TIMELIB_DEINIT;
return TIMELIB_DATE_TEXT;
}
#line 9092 "<stdout>"
#line 9091 "<stdout>"
yy476:
yyaccept = 10;
yych = *(YYMARKER = ++YYCURSOR);
@@ -9232,7 +9231,7 @@ yy487:
TIMELIB_DEINIT;
return TIMELIB_TIME12;
}
#line 9236 "<stdout>"
#line 9235 "<stdout>"
yy489:
yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
@@ -9268,7 +9267,7 @@ yy490:
TIMELIB_DEINIT;
return TIMELIB_TIME24_WITH_ZONE;
}
#line 9272 "<stdout>"
#line 9271 "<stdout>"
yy491:
yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
@@ -9564,7 +9563,7 @@ yy522:
TIMELIB_DEINIT;
return TIMELIB_TIME24_WITH_ZONE;
}
#line 9568 "<stdout>"
#line 9567 "<stdout>"
yy524:
yyaccept = 11;
YYMARKER = ++YYCURSOR;
@@ -9673,7 +9672,7 @@ yy534:
TIMELIB_DEINIT;
return TIMELIB_DATE_FULL;
}
#line 9677 "<stdout>"
#line 9676 "<stdout>"
yy535:
yych = *++YYCURSOR;
if (yych == 'M') goto yy536;
@@ -10348,7 +10347,7 @@ yy604:
TIMELIB_DEINIT;
return TIMELIB_DATE_FULL_POINTED;
}
#line 10352 "<stdout>"
#line 10351 "<stdout>"
yy607:
yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
@@ -10392,7 +10391,7 @@ yy611:
TIMELIB_DEINIT;
return TIMELIB_DATE_FULL_POINTED;
}
#line 10396 "<stdout>"
#line 10395 "<stdout>"
yy612:
yyaccept = 11;
yych = *(YYMARKER = ++YYCURSOR);
@@ -11001,7 +11000,7 @@ yy656:
TIMELIB_DEINIT;
return TIMELIB_ISO_DATE;
}
#line 11005 "<stdout>"
#line 11004 "<stdout>"
yy657:
yyaccept = 13;
yych = *(YYMARKER = ++YYCURSOR);
@@ -11112,7 +11111,7 @@ yy666:
TIMELIB_DEINIT;
return TIMELIB_AMERICAN;
}
#line 11116 "<stdout>"
#line 11115 "<stdout>"
yy667:
yyaccept = 14;
yych = *(YYMARKER = ++YYCURSOR);
@@ -11331,7 +11330,7 @@ yy700:
TIMELIB_DEINIT;
return TIMELIB_CLF;
}
#line 11335 "<stdout>"
#line 11334 "<stdout>"
yy701:
yych = *++YYCURSOR;
if (yych <= '5') {
@@ -11831,7 +11830,7 @@ yy763:
TIMELIB_DEINIT;
return TIMELIB_ISO_DATE;
}
#line 11835 "<stdout>"
#line 11834 "<stdout>"
yy764:
yych = *++YYCURSOR;
if (yych == 'C') goto yy765;
@@ -11875,7 +11874,7 @@ yy770:
TIMELIB_DEINIT;
return TIMELIB_PG_TEXT;
}
#line 11879 "<stdout>"
#line 11878 "<stdout>"
yy772:
yych = *++YYCURSOR;
if (yych == 'V') goto yy765;
@@ -12008,7 +12007,7 @@ yy783:
TIMELIB_DEINIT;
return TIMELIB_CLF;
}
#line 12012 "<stdout>"
#line 12011 "<stdout>"
yy784:
yych = *++YYCURSOR;
switch (yych) {
@@ -12159,7 +12158,7 @@ yy793:
TIMELIB_DEINIT;
return TIMELIB_DATE_NO_DAY;
}
#line 12163 "<stdout>"
#line 12162 "<stdout>"
yy794:
yych = *++YYCURSOR;
if (yych == 'I') goto yy927;
@@ -12371,7 +12370,7 @@ yy814:
TIMELIB_DEINIT;
return TIMELIB_ISO_WEEK;
}
#line 12375 "<stdout>"
#line 12374 "<stdout>"
yy815:
yych = *++YYCURSOR;
if (yych <= '/') goto yy56;
@@ -12396,7 +12395,7 @@ yy816:
TIMELIB_DEINIT;
return TIMELIB_ISO_WEEK;
}
#line 12400 "<stdout>"
#line 12399 "<stdout>"
yy818:
yych = *++YYCURSOR;
if (yych <= '/') goto yy60;
@@ -12469,7 +12468,7 @@ yy821:
TIMELIB_DEINIT;
return TIMELIB_PG_YEARDAY;
}
#line 12473 "<stdout>"
#line 12472 "<stdout>"
yy822:
yych = *++YYCURSOR;
if (yych <= '/') goto yy60;
@@ -12576,7 +12575,7 @@ yy842:
TIMELIB_DEINIT;
return TIMELIB_XMLRPC_SOAP;
}
#line 12580 "<stdout>"
#line 12579 "<stdout>"
yy843:
yych = *++YYCURSOR;
if (yych <= '2') {
@@ -12843,7 +12842,7 @@ yy848:
TIMELIB_DEINIT;
return TIMELIB_DATE_NOCOLON;
}
#line 12847 "<stdout>"
#line 12846 "<stdout>"
yy849:
yych = *++YYCURSOR;
if (yych <= 'H') {
@@ -13650,7 +13649,7 @@ yy973:
TIMELIB_DEINIT;
return TIMELIB_ISO_DATE;
}
#line 13654 "<stdout>"
#line 13653 "<stdout>"
yy974:
yyaccept = 22;
yych = *(YYMARKER = ++YYCURSOR);
@@ -14584,7 +14583,7 @@ yy1067:
TIMELIB_DEINIT;
return TIMELIB_GNU_NOCOLON;
}
#line 14588 "<stdout>"
#line 14587 "<stdout>"
yy1068:
yych = *++YYCURSOR;
if (yych <= '/') goto yy60;
@@ -14687,7 +14686,7 @@ yy1075:
TIMELIB_DEINIT;
return TIMELIB_ISO_NOCOLON;
}
#line 14691 "<stdout>"
#line 14690 "<stdout>"
yy1076:
yyaccept = 25;
yych = *(YYMARKER = ++YYCURSOR);
@@ -15559,7 +15558,7 @@ yy1117:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 15563 "<stdout>"
#line 15562 "<stdout>"
yy1118:
++YYCURSOR;
if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
@@ -15622,7 +15621,7 @@ yy1125:
TIMELIB_DEINIT;
return TIMELIB_WEEK_DAY_OF_MONTH;
}
#line 15626 "<stdout>"
#line 15625 "<stdout>"
yy1127:
yyaccept = 26;
yych = *(YYMARKER = ++YYCURSOR);
@@ -15738,7 +15737,7 @@ yy1141:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 15742 "<stdout>"
#line 15741 "<stdout>"
yy1142:
yych = *++YYCURSOR;
goto yy1117;
@@ -18284,7 +18283,7 @@ yy1294:
TIMELIB_DEINIT;
return TIMELIB_LF_DAY_OF_MONTH;
}
#line 18288 "<stdout>"
#line 18287 "<stdout>"
yy1295:
yyaccept = 28;
yych = *(YYMARKER = ++YYCURSOR);
@@ -18539,7 +18538,7 @@ yy1315:
TIMELIB_DEINIT;
return TIMELIB_LF_DAY_OF_MONTH;
}
#line 18543 "<stdout>"
#line 18542 "<stdout>"
yy1317:
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
@@ -19924,7 +19923,7 @@ yy1387:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 19928 "<stdout>"
#line 19927 "<stdout>"
yy1388:
yych = *++YYCURSOR;
if (yych <= 'N') {
@@ -20341,7 +20340,7 @@ yy1417:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 20345 "<stdout>"
#line 20344 "<stdout>"
yy1418:
yych = *++YYCURSOR;
if (yych <= 'Y') {
@@ -20382,7 +20381,7 @@ yy1420:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 20386 "<stdout>"
#line 20385 "<stdout>"
yy1421:
yych = *++YYCURSOR;
if (yych <= 'S') {
@@ -22322,7 +22321,7 @@ yy1500:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 22326 "<stdout>"
#line 22325 "<stdout>"
yy1501:
yych = *++YYCURSOR;
if (yych <= 'N') {
@@ -22464,7 +22463,7 @@ yy1508:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 22468 "<stdout>"
#line 22467 "<stdout>"
yy1509:
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
@@ -22985,7 +22984,7 @@ yy1531:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 22989 "<stdout>"
#line 22988 "<stdout>"
yy1532:
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
+1
View File
@@ -250,6 +250,7 @@ val_type inifile_fetch(inifile *dba, const key_type *key, int skip) {
if (skip == -1 && dba->next.key.group && dba->next.key.name && !inifile_key_cmp(&dba->next.key, key)) {
/* we got position already from last fetch */
php_stream_seek(dba->fp, dba->next.pos, SEEK_SET);
ln.key.group = estrdup(dba->next.key.group);
} else {
/* specific instance or not same key -> restart search */
/* the slow way: restart and seacrch */
+71
View File
@@ -0,0 +1,71 @@
--TEST--
Bug #70825 (Cannot fetch multiple values with group in ini file)
--SKIPIF--
<?php
if (!extension_loaded('dba')) die('skip dba extension not available');
if (!in_array('inifile', dba_handlers())) die('skip inifile handler not available');
?>
--FILE--
<?php
$filename = __DIR__ . DIRECTORY_SEPARATOR . 'bug70825.ini';
$db = dba_open($filename, 'n', 'inifile');
dba_insert('foo', 23, $db);
dba_insert('foo', 42, $db);
dba_insert('foo', 1337, $db);
var_dump(dba_fetch('foo', -1, $db));
var_dump(dba_fetch('foo', -1, $db));
var_dump(dba_fetch('foo', -1, $db));
dba_close($db);
unlink($filename);
$db = dba_open($filename, 'n', 'inifile');
dba_insert(['foo', 'bar'], 23, $db);
dba_insert(['foo', 'bar'], 42, $db);
dba_insert(['foo', 'bar'], 1337, $db);
var_dump(dba_fetch(['foo', 'bar'], -1, $db));
var_dump(dba_fetch(['foo', 'bar'], -1, $db));
var_dump(dba_fetch(['foo', 'bar'], -1, $db));
dba_close($db);
unlink($filename);
$db = dba_open($filename, 'n', 'inifile');
dba_insert('[foo]bar', 23, $db);
dba_insert('[foo]bar', 42, $db);
dba_insert('[foo]bar', 1337, $db);
var_dump(dba_fetch('[foo]bar', -1, $db));
var_dump(dba_fetch('[foo]bar', -1, $db));
var_dump(dba_fetch('[foo]bar', -1, $db));
dba_close($db);
unlink($filename);
$db = dba_open($filename, 'n', 'inifile');
dba_insert('[foo]bar', 23, $db);
dba_insert('[foo]bar', 42, $db);
dba_insert('[foo]bar', 1337, $db);
var_dump(dba_fetch('[foo]bar', 0, $db));
var_dump(dba_fetch('[foo]bar', 1, $db));
var_dump(dba_fetch('[foo]bar', 2, $db));
dba_close($db);
unlink($filename);
?>
==DONE==
--EXPECT--
string(2) "23"
string(2) "42"
string(4) "1337"
string(2) "23"
string(2) "42"
string(4) "1337"
string(2) "23"
string(2) "42"
string(4) "1337"
string(2) "23"
string(2) "42"
string(4) "1337"
==DONE==
--CLEAN--
<?php
$filename = __DIR__ . DIRECTORY_SEPARATOR . 'bug70825.ini';
unlink($filename);
?>
+28
View File
@@ -0,0 +1,28 @@
--TEST--
Bug #71514 (Bad dba_replace condition because of wrong API usage)
--SKIPIF--
<?php
if (!extension_loaded('dba')) die('skip dba extension not available');
if (!in_array('inifile', dba_handlers())) die('skip inifile handler not available');
?>
--FILE--
<?php
$filename = __DIR__ . DIRECTORY_SEPARATOR . 'bug71514.ini';
$db = dba_open($filename, 'c', 'inifile');
dba_insert('foo', 'value1', $db);
dba_replace('foo', 'value2', $db);
var_dump(dba_fetch('foo', $db));
dba_close($db);
?>
==DONE==
--EXPECT--
string(6) "value2"
==DONE==
--CLEAN--
<?php
$filename = __DIR__ . DIRECTORY_SEPARATOR . 'bug71514.ini';
unlink($filename);
?>
+1 -1
View File
@@ -40,7 +40,7 @@ do {
}
if ($handler != 'cdb') {
$db_writer = dba_open($db_filename, 'c'.$lock_flag, $handler);
if (($dba_reader = @dba_open($db_filename, 'r'.$lock_flag.($lock_flag ? 't' : ''), $handler))===false) {
if (($dba_reader = @dba_open($db_filename, 'r'.$lock_flag.'t', $handler))===false) {
echo "Read during write: not allowed\n";
} else {
echo "Read during write: allowed\n";
+20 -4
View File
@@ -1703,6 +1703,10 @@ static void exif_iif_add_value(image_info_type *image_info, int section_index, c
break;
case TAG_FMT_UNDEFINED:
if (value) {
if (tag == TAG_MAKER_NOTE) {
length = MIN(length, strlen(value));
}
/* do not recompute length here */
info_value->s = estrndup(value, length);
info_data->length = length;
@@ -2713,8 +2717,14 @@ static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * valu
char *dir_start;
for (i=0; i<=sizeof(maker_note_array)/sizeof(maker_note_type); i++) {
if (i==sizeof(maker_note_array)/sizeof(maker_note_type))
return FALSE;
if (i==sizeof(maker_note_array)/sizeof(maker_note_type)) {
#ifdef EXIF_DEBUG
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "No maker note data found. Detected maker: %s (length = %d)", ImageInfo->make, strlen(ImageInfo->make));
#endif
/* unknown manufacturer, not an error, use it as a string */
return TRUE;
}
maker_note = maker_note_array+i;
/*exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "check (%s,%s)", maker_note->make?maker_note->make:"", maker_note->model?maker_note->model:"");*/
@@ -3714,8 +3724,11 @@ static int exif_process_IFD_in_TIFF(image_info_type *ImageInfo, size_t dir_offse
fgot = php_stream_read(ImageInfo->infile, ImageInfo->Thumbnail.data, ImageInfo->Thumbnail.size);
if (fgot < ImageInfo->Thumbnail.size) {
EXIF_ERRLOG_THUMBEOF(ImageInfo)
efree(ImageInfo->Thumbnail.data);
ImageInfo->Thumbnail.data = NULL;
} else {
exif_thumbnail_build(ImageInfo);
}
exif_thumbnail_build(ImageInfo);
}
}
}
@@ -3748,8 +3761,11 @@ static int exif_process_IFD_in_TIFF(image_info_type *ImageInfo, size_t dir_offse
fgot = php_stream_read(ImageInfo->infile, ImageInfo->Thumbnail.data, ImageInfo->Thumbnail.size);
if (fgot < ImageInfo->Thumbnail.size) {
EXIF_ERRLOG_THUMBEOF(ImageInfo)
efree(ImageInfo->Thumbnail.data);
ImageInfo->Thumbnail.data = NULL;
} else {
exif_thumbnail_build(ImageInfo);
}
exif_thumbnail_build(ImageInfo);
}
#ifdef EXIF_DEBUG
exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Read next IFD (THUMBNAIL) done");
+71
View File
@@ -0,0 +1,71 @@
--TEST--
Bug #72627 (Memory Leakage In exif_process_IFD_in_TIFF)
--SKIPIF--
<?php if (!extension_loaded('exif')) print 'skip exif extension not available';?>
--FILE--
<?php
$exif = exif_read_data(__DIR__ . '/bug72627.tiff',0,0,true);
var_dump($exif);
?>
--EXPECTF--
Warning: exif_read_data(%s): Thumbnail goes IFD boundary or end of file reached in %sbug72627.php on line %d
Warning: exif_read_data(%s): Error in TIFF: filesize(x04E2) less than start of IFD dir(x829A0004) in %sbug72627.php on line %d
Warning: exif_read_data(%s): Thumbnail goes IFD boundary or end of file reached in %sbug72627.php on line %d
array(11) {
["FileName"]=>
string(13) "bug72627.tiff"
["FileDateTime"]=>
int(%d)
["FileSize"]=>
int(1250)
["FileType"]=>
int(7)
["MimeType"]=>
string(10) "image/tiff"
["SectionsFound"]=>
string(30) "ANY_TAG, IFD0, THUMBNAIL, EXIF"
["COMPUTED"]=>
array(10) {
["html"]=>
string(24) "width="128" height="132""
["Height"]=>
int(132)
["Width"]=>
int(128)
["IsColor"]=>
int(0)
["ByteOrderMotorola"]=>
int(0)
["ApertureFNumber"]=>
string(5) "f/1.0"
["Thumbnail.FileType"]=>
int(2)
["Thumbnail.MimeType"]=>
string(10) "image/jpeg"
["Thumbnail.Height"]=>
int(132)
["Thumbnail.Width"]=>
int(128)
}
["XResolution"]=>
string(21) "1414812756/1414812756"
["THUMBNAIL"]=>
array(5) {
["ImageWidth"]=>
int(128)
["ImageLength"]=>
int(132)
["JPEGInterchangeFormat"]=>
int(1280)
["JPEGInterchangeFormatLength"]=>
int(100)
["THUMBNAIL"]=>
NULL
}
["ExposureTime"]=>
string(21) "1414812756/1414812756"
["FNumber"]=>
string(21) "1414812756/1414812756"
}
Binary file not shown.
+22
View File
@@ -0,0 +1,22 @@
--TEST--
Bug #69107 (finfo no longer detects PHP files)
--SKIPIF--
<?php
if (!extension_loaded('fileinfo')) die('skip fileinfo extension not available');
?>
--FILE--
<?php
$finfo = new finfo(FILEINFO_MIME_TYPE);
var_dump($finfo->buffer("<?php\nclass A{}"));
var_dump($finfo->buffer("<?php class A{}"));
var_dump($finfo->buffer("<?php\tclass A{}"));
var_dump($finfo->buffer("<?php\n\rclass A{}"));
?>
===DONE===
--EXPECT--
string(10) "text/x-php"
string(10) "text/x-php"
string(10) "text/x-php"
string(10) "text/x-php"
===DONE===
+2 -1
View File
@@ -397,7 +397,7 @@ static void php_zval_filter(zval *value, zend_long filter, zend_long flags, zval
} else {
ZVAL_FALSE(value);
}
return;
goto handle_default;
}
}
@@ -406,6 +406,7 @@ static void php_zval_filter(zval *value, zend_long filter, zend_long flags, zval
filter_func.function(value, flags, options, charset);
handle_default:
if (options && (Z_TYPE_P(options) == IS_ARRAY || Z_TYPE_P(options) == IS_OBJECT) &&
((flags & FILTER_NULL_ON_FAILURE && Z_TYPE_P(value) == IS_NULL) ||
(!(flags & FILTER_NULL_ON_FAILURE) && Z_TYPE_P(value) == IS_FALSE)) &&
+3 -14
View File
@@ -789,8 +789,7 @@ void php_filter_validate_ip(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
if (flags & FILTER_FLAG_NO_PRIV_RANGE) {
if (
(ip[0] == 10) ||
(ip[0] == 169 && ip[1] == 254) ||
(ip[0] == 172 && (ip[1] >= 16 && ip[1] <= 31)) ||
(ip[0] == 172 && ip[1] >= 16 && ip[1] <= 31) ||
(ip[0] == 192 && ip[1] == 168)
) {
RETURN_VALIDATION_FAILED
@@ -800,19 +799,9 @@ void php_filter_validate_ip(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
if (flags & FILTER_FLAG_NO_RES_RANGE) {
if (
(ip[0] == 0) ||
(ip[0] == 10) ||
(ip[0] == 100 && (ip[1] >= 64 && ip[1] <= 127)) ||
(ip[0] >= 240) ||
(ip[0] == 127) ||
(ip[0] == 169 && ip[1] == 254) ||
(ip[0] == 172 && (ip[1] >= 16 && ip[1] <= 31)) ||
(ip[0] == 192 && ip[1] == 0 && ip[2] == 0) ||
(ip[0] == 192 && ip[1] == 0 && ip[2] == 2) ||
(ip[0] == 192 && ip[1] == 88 && ip[2] == 99) ||
(ip[0] == 192 && ip[1] == 168) ||
(ip[0] == 198 && (ip[1] == 18 || ip[1] == 19)) ||
(ip[0] == 198 && ip[1] == 51 && ip[2] == 100) ||
(ip[0] == 203 && ip[1] == 0 && ip[2] == 113) ||
(ip[0] >= 224 && ip[0] <= 255)
(ip[0] == 169 && ip[1] == 254)
) {
RETURN_VALIDATION_FAILED
}
+3 -3
View File
@@ -41,9 +41,9 @@ string(9) "127.0.0.1"
bool(false)
string(12) "192.0.34.166"
bool(false)
bool(false)
bool(false)
bool(false)
string(9) "192.0.0.1"
string(10) "100.64.0.0"
string(15) "100.127.255.255"
string(12) "192.0.34.166"
bool(false)
string(15) "255.255.255.255"
+23
View File
@@ -0,0 +1,23 @@
--TEST--
Bug #73054 (default option ignored when object passed to int filter)
--SKIPIF--
<?php
if (!extension_loaded('filter')) die('skip filter extension not available');
?>
--FILE--
<?php
var_dump(
filter_var(new stdClass, FILTER_VALIDATE_INT, [
'options' => ['default' => 2],
]),
filter_var(new stdClass, FILTER_VALIDATE_INT, [
'options' => ['default' => 2],
'flags' => FILTER_NULL_ON_FAILURE
])
);
?>
===DONE===
--EXPECT--
int(2)
int(2)
===DONE===
+44 -41
View File
@@ -27,51 +27,51 @@ foreach ($privateRanges as $key => $range) {
$reservedRanges = array();
// 0.0.0.0/8
$reserverRanges['0.0.0.0/8'] = array('0.0.0.0', '0.255.255.255');
$reservedRanges['0.0.0.0/8'] = array('0.0.0.0', '0.255.255.255');
// 10.0.0.0/8
$reserverdRanges['10.0.0.0/8'] = array('10.0.0.0', '10.255.255.255');
$reservedRanges['10.0.0.0/8'] = array('10.0.0.0', '10.255.255.255');
// 100.64.0.0/10
$reserverdRanges['10.64.0.0/10'] = array('100.64.0.0', '100.127.255.255');
$reservedRanges['10.64.0.0/10'] = array('100.64.0.0', '100.127.255.255');
// 127.0.0.0/8
$reserverdRanges['127.0.0.0/8'] = array('127.0.0.0', '127.255.255.255');
$reservedRanges['127.0.0.0/8'] = array('127.0.0.0', '127.255.255.255');
// 169.254.0.0/16
$reserverdRanges['169.254.0.0/16'] = array('169.254.0.0', '169.254.255.255');
$reservedRanges['169.254.0.0/16'] = array('169.254.0.0', '169.254.255.255');
// 172.16.0.0/12
$reserverdRanges['172.16.0.0/12'] = array('172.16.0.0', '172.31.0.0');
$reservedRanges['172.16.0.0/12'] = array('172.16.0.0', '172.31.0.0');
// 192.0.0.0/24
$reserverdRanges['192.0.0.0/24'] = array('192.0.0.0', '192.0.0.255');
$reservedRanges['192.0.0.0/24'] = array('192.0.0.0', '192.0.0.255');
// 192.0.0.0/29
$reserverdRanges['192.0.0.0/29'] = array('192.0.0.0', '192.0.0.7');
$reservedRanges['192.0.0.0/29'] = array('192.0.0.0', '192.0.0.7');
// 192.0.2.0/24
$reserverdRanges['192.0.2.0/24'] = array('192.0.2.0', '192.0.2.255');
$reservedRanges['192.0.2.0/24'] = array('192.0.2.0', '192.0.2.255');
// 198.18.0.0/15
$reserverdRanges['198.18.0.0/15'] = array('198.18.0.0', '198.19.255.255');
$reservedRanges['198.18.0.0/15'] = array('198.18.0.0', '198.19.255.255');
// 198.51.100.0/24
$reserverdRanges['198.51.100.0/24'] = array('198.51.100.0', '198.51.100.255');
$reservedRanges['198.51.100.0/24'] = array('198.51.100.0', '198.51.100.255');
// 192.88.99.0/24
$reserverdRanges['192.88.99.0/24'] = array('192.88.99.0', '192.88.99.255');
$reservedRanges['192.88.99.0/24'] = array('192.88.99.0', '192.88.99.255');
// 192.168.0.0/16
$reserverdRanges['192.168.0.0/16'] = array('192.168.0.0', '192.168.255.255');
$reservedRanges['192.168.0.0/16'] = array('192.168.0.0', '192.168.255.255');
// 203.0.113.0/24
$reserverdRanges['203.0.113.0/24'] = array('203.0.113.0', '203.0.113.255');
$reservedRanges['203.0.113.0/24'] = array('203.0.113.0', '203.0.113.255');
// 240.0.0.0/4 + 255.255.255.255/32
$reserverdRanges['240.0.0.0/4'] = array('224.0.0.0', '255.255.255.255');
$reservedRanges['240.0.0.0/4'] = array('224.0.0.0', '255.255.255.255');
foreach ($reserverdRanges as $key => $range) {
foreach ($reservedRanges as $key => $range) {
list($min, $max) = $range;
var_dump($key);
var_dump(filter_var($min, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 | FILTER_FLAG_NO_RES_RANGE));
@@ -85,20 +85,23 @@ string(10) "10.0.0.0/8"
bool(false)
bool(false)
string(14) "168.254.0.0/16"
bool(false)
bool(false)
string(11) "169.254.0.0"
string(15) "169.254.255.255"
string(13) "172.16.0.0/12"
bool(false)
bool(false)
string(14) "192.168.0.0/16"
bool(false)
bool(false)
string(9) "0.0.0.0/8"
bool(false)
bool(false)
string(10) "10.0.0.0/8"
bool(false)
bool(false)
string(8) "10.0.0.0"
string(14) "10.255.255.255"
string(12) "10.64.0.0/10"
bool(false)
bool(false)
string(10) "100.64.0.0"
string(15) "100.127.255.255"
string(11) "127.0.0.0/8"
bool(false)
bool(false)
@@ -106,32 +109,32 @@ string(14) "169.254.0.0/16"
bool(false)
bool(false)
string(13) "172.16.0.0/12"
bool(false)
bool(false)
string(10) "172.16.0.0"
string(10) "172.31.0.0"
string(12) "192.0.0.0/24"
bool(false)
bool(false)
string(9) "192.0.0.0"
string(11) "192.0.0.255"
string(12) "192.0.0.0/29"
bool(false)
bool(false)
string(9) "192.0.0.0"
string(9) "192.0.0.7"
string(12) "192.0.2.0/24"
bool(false)
bool(false)
string(9) "192.0.2.0"
string(11) "192.0.2.255"
string(13) "198.18.0.0/15"
bool(false)
bool(false)
string(10) "198.18.0.0"
string(14) "198.19.255.255"
string(15) "198.51.100.0/24"
bool(false)
bool(false)
string(12) "198.51.100.0"
string(14) "198.51.100.255"
string(14) "192.88.99.0/24"
bool(false)
bool(false)
string(11) "192.88.99.0"
string(13) "192.88.99.255"
string(14) "192.168.0.0/16"
bool(false)
bool(false)
string(11) "192.168.0.0"
string(15) "192.168.255.255"
string(14) "203.0.113.0/24"
bool(false)
bool(false)
string(11) "203.0.113.0"
string(13) "203.0.113.255"
string(11) "240.0.0.0/4"
bool(false)
string(9) "224.0.0.0"
bool(false)
+24 -17
View File
@@ -291,6 +291,9 @@ ftp_login(ftpbuf_t *ftp, const char *user, const char *pass)
#endif
SSL_CTX_set_options(ctx, ssl_ctx_options);
/* allow SSL to re-use sessions */
SSL_CTX_set_session_cache_mode(ctx, SSL_SESS_CACHE_BOTH);
ftp->ssl_handle = SSL_new(ctx);
if (ftp->ssl_handle == NULL) {
php_error_docref(NULL, E_WARNING, "failed to create the SSL handle");
@@ -1637,7 +1640,7 @@ data_accept(databuf_t *data, ftpbuf_t *ftp)
#ifdef HAVE_FTP_SSL
SSL_CTX *ctx;
zend_long ssl_ctx_options = SSL_OP_ALL;
SSL_SESSION *session;
int err, res;
zend_bool retry;
#endif
@@ -1660,31 +1663,40 @@ data_accepted:
/* now enable ssl if we need to */
if (ftp->use_ssl && ftp->use_ssl_for_data) {
ctx = SSL_CTX_new(SSLv23_client_method());
ctx = SSL_get_SSL_CTX(ftp->ssl_handle);
if (ctx == NULL) {
php_error_docref(NULL, E_WARNING, "data_accept: failed to create the SSL context");
php_error_docref(NULL, E_WARNING, "data_accept: failed to retreive the existing SSL context");
return 0;
}
#if OPENSSL_VERSION_NUMBER >= 0x0090605fL
ssl_ctx_options &= ~SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS;
#endif
SSL_CTX_set_options(ctx, ssl_ctx_options);
data->ssl_handle = SSL_new(ctx);
if (data->ssl_handle == NULL) {
php_error_docref(NULL, E_WARNING, "data_accept: failed to create the SSL handle");
SSL_CTX_free(ctx);
return 0;
}
SSL_set_fd(data->ssl_handle, data->fd);
if (ftp->old_ssl) {
SSL_copy_session_id(data->ssl_handle, ftp->ssl_handle);
}
/* get the session from the control connection so we can re-use it */
session = SSL_get_session(ftp->ssl_handle);
if (session == NULL) {
php_error_docref(NULL, E_WARNING, "data_accept: failed to retreive the existing SSL session");
SSL_free(data->ssl_handle);
return 0;
}
/* and set it on the data connection */
res = SSL_set_session(data->ssl_handle, session);
if (res == 0) {
php_error_docref(NULL, E_WARNING, "data_accept: failed to set the existing SSL session");
SSL_free(data->ssl_handle);
return 0;
}
do {
res = SSL_connect(data->ssl_handle);
err = SSL_get_error(data->ssl_handle, res);
@@ -1745,10 +1757,7 @@ data_close(ftpbuf_t *ftp, databuf_t *data)
if (data->listener != -1) {
#ifdef HAVE_FTP_SSL
if (data->ssl_active) {
ctx = SSL_get_SSL_CTX(data->ssl_handle);
SSL_CTX_free(ctx);
/* don't free the data context, it's the same as the control */
SSL_shutdown(data->ssl_handle);
SSL_free(data->ssl_handle);
data->ssl_active = 0;
@@ -1759,9 +1768,7 @@ data_close(ftpbuf_t *ftp, databuf_t *data)
if (data->fd != -1) {
#ifdef HAVE_FTP_SSL
if (data->ssl_active) {
ctx = SSL_get_SSL_CTX(data->ssl_handle);
SSL_CTX_free(ctx);
/* don't free the data context, it's the same as the control */
SSL_shutdown(data->ssl_handle);
SSL_free(data->ssl_handle);
data->ssl_active = 0;
+47 -46
View File
@@ -1,48 +1,49 @@
-----BEGIN CERTIFICATE REQUEST-----
MIIBmzCCAQQCAQAwWzELMAkGA1UEBhMCUFQxCzAJBgNVBAgTAkx4MQswCQYDVQQH
EwJMeDEcMBoGA1UEChMTQSBtaW5oYSBlbXByZXNhLCBTQTEUMBIGA1UECxMLUEhQ
IFFBIFRlYW0wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAM9mfEOSYwXf58ch
4NyO1QOU1XMfquz8OVpvMUITABLAevZpeQn6vZPHNyXHFQC0QC8scydK1rAYd2U+
9K2aPub6ioMjYyjPpAE07l9EAAPUEBlqqsziB/wT8QjWkByyJEkYu+o0Wyjokhfn
BMPvm52wLWUx9nvUeNDCftnKg1wxAgMBAAGgADANBgkqhkiG9w0BAQQFAAOBgQDD
s1FeqPxnF2bWj8/dG8MyPaRfOAMVz1UsCZUciXIVG5LSIvR2qnMC3iEYt3s13sEq
z8VJlNHa8nniE+VFNv093yIu+PlWXMEvb5y5EFqP2AYq3RAT+SJsSxGqIdzPZiKY
INaktLCZmQ/E1v7/4hFzVRq9ydJI82DVS1nv282Whw==
-----END CERTIFICATE REQUEST-----
-----BEGIN CERTIFICATE-----
MIIC4zCCAkygAwIBAgIBADANBgkqhkiG9w0BAQQFADBbMQswCQYDVQQGEwJQVDEL
MAkGA1UECBMCTHgxCzAJBgNVBAcTAkx4MRwwGgYDVQQKExNBIG1pbmhhIGVtcHJl
c2EsIFNBMRQwEgYDVQQLEwtQSFAgUUEgVGVhbTAeFw0wNjExMTkxODIzNTNaFw0w
NzExMTkxODIzNTNaMFsxCzAJBgNVBAYTAlBUMQswCQYDVQQIEwJMeDELMAkGA1UE
BxMCTHgxHDAaBgNVBAoTE0EgbWluaGEgZW1wcmVzYSwgU0ExFDASBgNVBAsTC1BI
UCBRQSBUZWFtMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDPZnxDkmMF3+fH
IeDcjtUDlNVzH6rs/DlabzFCEwASwHr2aXkJ+r2TxzclxxUAtEAvLHMnStawGHdl
PvStmj7m+oqDI2Moz6QBNO5fRAAD1BAZaqrM4gf8E/EI1pAcsiRJGLvqNFso6JIX
5wTD75udsC1lMfZ71HjQwn7ZyoNcMQIDAQABo4G2MIGzMB0GA1UdDgQWBBTIga5L
q+Ub1SWXgNZRYCpq3c8Z+jCBgwYDVR0jBHwweoAUyIGuS6vlG9Ull4DWUWAqat3P
GfqhX6RdMFsxCzAJBgNVBAYTAlBUMQswCQYDVQQIEwJMeDELMAkGA1UEBxMCTHgx
HDAaBgNVBAoTE0EgbWluaGEgZW1wcmVzYSwgU0ExFDASBgNVBAsTC1BIUCBRQSBU
ZWFtggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEEBQADgYEAe6AA8aC3KDI8
smd+7XWjaTSp1Q0uMkEZ2PEBzif2I1aPPqw1CQykJ1iDdC/8PJ1yEIezloP2XQoZ
NjTaCO+uubay03ncoPTZvDUwExN9BYFAYgc2z3tLMHYbA7kM2sIbKys7ZQegLibr
TSKYQOBeYA/FB9GHECJGU3zBRvYi+Og=
MIIDhTCCAm2gAwIBAgIJAN75FFz+owOAMA0GCSqGSIb3DQEBCwUAMFkxCzAJBgNV
BAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBX
aWRnaXRzIFB0eSBMdGQxEjAQBgNVBAMMCTEyNy4wLjAuMTAeFw0xNjA3MjUxMjM3
MTJaFw0yNjA3MjMxMjM3MTJaMFkxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21l
LVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQxEjAQBgNV
BAMMCTEyNy4wLjAuMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALtG
AIrNUDItISfpAqztL2TFEWEHLGTzCEh5Ag2sdMD7UYbqIPHLOE4EINv+dqEMM0Nz
LYnw7ChtVegXT907xCaQcmeDFSdhqze4L8zawDfnn4syB8XAwGYJfpstYwe3nO6+
0WvLSb1A5TYNeyoXjwlAUKElxkeWAo51uhR41GDhDQ9GgpqX1ccAhmSoUhgIRSzf
6f4KE3WTdzl1p12ZtkYHB8Jo2jB/JXnwGOz6isLnpRvkex4B7sUX+7u1MqK/e1X7
Hi1G/VkaAfC2SOfjTePtGBDBXrQ1arYXDPRA04sgFzSh55l7lC/4HasQ/jAb3h95
dcEIqyc69iioaN1c1NcCAwEAAaNQME4wHQYDVR0OBBYEFNv3kefb1H+6/6CpjiBi
+I2s9E90MB8GA1UdIwQYMBaAFNv3kefb1H+6/6CpjiBi+I2s9E90MAwGA1UdEwQF
MAMBAf8wDQYJKoZIhvcNAQELBQADggEBAIzSEWpHSaBs7KduBRXX5+qFxBN6OCPl
7ID0rxAOYfw7ruzbmwgOpBgMIHGn+KqA6CmQI0jh9bZbv5TV2aFpFsUihugPc2lW
5EshCozxlEPmIJNsO8jDqPE4w3m4KiVTscRWjBa5cco+lwLDqboerm2l7vvrtr6B
pgLaZct1c73MouvoJSCGK5EOGW7jsgaxjxJ3UZug+24Ko1wulO2cgBLhda9Ilrnx
CIKI9h8Z2WVWuVQfyCyO1g7XkJgkBec77OhxD+m4onzPY6waqnnhmFOBcS+gKgBV
jHeK9DCvZ9zet3EyEp6fyQOOtsC+gU0piYgfsQL7aCp5oLe+fjTiuUY=
-----END CERTIFICATE-----
-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: DES-EDE3-CBC,928762DB6DE222AD
oOxNUBX0wrqmRqb3IEZMogc1bnVm6JoW6YFjGfHNcIz0jS7UPDhUFDR26y0dYujL
LEgxOcYo8ItvGcXSRbs+3W7lISbosgkB0DOaKx5jVmOGwUVRergUUSY8rbf93FtP
27CEvAfsU6do5HmlJ34mYZW1k+onCznlJXJkupQ5jmiily3GwEdr/5mMIVOmXQ6p
xWkxHySDKyVbR0v4JY3SJLRBuhgofYNG5155PiqZ7KwYY4Aw60eVgINsvJCF9/8b
kEj+lecHbBdAf7N82320Ga+F+VeFnUl0gWFjoIF9UFCO80+7ZvIGdGlyPkr4zMvt
TsC1snJQdHg+IlT3sGayYrQANpTG6GPYhn3KEvK5aqq+bPEe5lija0gw34jbPCo+
TjHR76lToxzubGZODyyF/rjl5KwUbqTCNuv1PX1jTx7n7sCbu+KHpqXMhTHLKtby
+Wh7WAfsVrbIW+P85/mkfhPbPZ2621f9cyStdFGgWU4dHdD00HIGOgAJvUSbC2Au
oVUoKf2818t1s9aA4ptog04sNi+Ixu+z+3yYNLZj51j4ZX3KuXxLIiQvlvFQ8LQi
RHGQk3u2W3iNtDKKUQjMPaB2FlVtC7FmtHBCpRmos6ld240DDyucqMdIDTMaqV0+
sL4X+LIeBM/hP/IquRTuQBHBmgjkN4845ihTUJOanyKx605ANq/roHzXrbIxhR5p
pcJLCBMLMWgdOCJMZRavSq04iXeNfP6Mk/joVpHS62Ljdfc94BBLfsOKOErA20Nq
lfvbZqy2tI5IIDoq05S8FU0DYNqq/hyrv9Udo8IAo+WkBOABm0x/WA==
-----END RSA PRIVATE KEY-----
-----BEGIN PRIVATE KEY-----
MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQC7RgCKzVAyLSEn
6QKs7S9kxRFhByxk8whIeQINrHTA+1GG6iDxyzhOBCDb/nahDDNDcy2J8OwobVXo
F0/dO8QmkHJngxUnYas3uC/M2sA355+LMgfFwMBmCX6bLWMHt5zuvtFry0m9QOU2
DXsqF48JQFChJcZHlgKOdboUeNRg4Q0PRoKal9XHAIZkqFIYCEUs3+n+ChN1k3c5
daddmbZGBwfCaNowfyV58Bjs+orC56Ub5HseAe7FF/u7tTKiv3tV+x4tRv1ZGgHw
tkjn403j7RgQwV60NWq2Fwz0QNOLIBc0oeeZe5Qv+B2rEP4wG94feXXBCKsnOvYo
qGjdXNTXAgMBAAECggEAD7yDISa9fWnjZlojGmrX16zjl/alWVo+sPBSJtn9+ZVk
tWSJHihIc+3O4Q2R5FiFGj7cbcHr5j3BwT3sPRfflKoAowgVx/hiDc2RXrJnAouZ
EXZDxu86e5iCpgF7V9OrATjRmjA74wZH/HHHjrLqFwnrfI8TCULmthfYag35Mqax
qrIEzvSuYdaGxblNe+ZfnVEDW2F9DLBGcma0ffUlJp8AvV7bpo8Rj/JovPxit/VS
UdwSRxwSAugctFpmcGlFkoQfxUx1WdEy8hjopLrayMjCCJvRUL4+C4zT9r9PBHOj
fCSbJ+ajQIoRrgaL9bURk8BFMHY8+yMUsWEYVSmFAQKBgQDtOvPkhvZsNocUB5nJ
ti3SXyDQ6OZQuKKHPSeDV/EvmZKeNlrQ1ZnwXLP3vkcedDOkt1nEVq/hUewpjt08
2MvmMwJBQEnmbTzMf43DtlXsStdP1lhYaFbU4iMM5zRfyBHDu1GPZEPXvKKpJUk0
M+jYIyTAP3mcZhqDKn0mPVP7VwKBgQDKFy9DtWFKxCvhFQvHx7YeZiVWJbIst/O4
ZyuPVAErni0hzSeCkmm7+F9hgEdPSLRcSaeTWP4L0u1cixECKboIhoNs38aft7o3
MdnI2RDSEKtKX2uVuhvpGDNuGpBAc8Qu8iCiv5INSC36ZhD1h++O/TiiUdgRJ3yX
yeG7ej+CgQKBgCR5F95e0aw5hfMSaBaXJ9xcO9Niu2ZVvMdGI7kR4EcNOXmRqczJ
ym0mE5VXb9/Cxd3hQq/pFAl0avbIvEMKoe62kPYvSC1hRiO6yLT6Z6N4rjncHqEZ
CaCZVAI72dWQEQsi1ZtSMwwMOIYA8YxRHs98N75HBA+DszfPZIZoj2zpAoGBAJHp
B3ElhmeLF/tdTLIj2bQ9H/wBH5H2Bvw/UU4c4vNxMzjSfRJjUAAtpgAptFLkNYTk
kR9sA5DZ7BMDPXaIVg9Nv5peP3SWHNc5IPtI7kIdUu9R0cW7J+e2V3vJphlC/ITA
wRuAoZ0BXmEKTHhae3aMEdXwrcZE8kpNsrO/4hcBAoGBAMISiPJPuxAX1UtqcxTa
mDJfnQ2gxRu6AK9VmXqo0X4IBxDSnTjcL0huUlS849wgsE5oTXgdYb2hn+TXM5JJ
NsEXLhV09X1mrk4M4LV1npd0mYxvFsO4+p+IX5YLiahInmQtq0gx3DWE8wouVFER
4yzfp27z8MZT8Qvr/ZI9lzWd
-----END PRIVATE KEY-----
+36 -11
View File
@@ -2,7 +2,7 @@
$socket = null;
$errno = 0;
$context = stream_context_create(array('ssl' => array('local_cert' => dirname(__FILE__).'/cert.pem', 'passphrase' => 'pass')));
$context = stream_context_create(array('ssl' => array('local_cert' => dirname(__FILE__).'/cert.pem')));
for ($i=0; $i<10 && !$socket; ++$i) {
$port = rand(50000, 65535);
@@ -139,7 +139,10 @@ if ($pid) {
$buf = fread($s, 2048);
}
if (!preg_match('/^USER (\w+)\r\n$/', $buf, $m)) {
if ($buf == "AUTH TLS\r\n") {
fputs($s, "500 not supported.\r\n");
return ;
} else if (!preg_match('/^USER (\w+)\r\n$/', $buf, $m)) {
fputs($s, "500 Syntax error, command unrecognized.\r\n");
dump_and_exit($buf);
}
@@ -208,6 +211,10 @@ if ($pid) {
$ascii = true;
fputs($s, "200 OK\r\n");
} elseif ($buf === "AUTH SSL\r\n") {
$ascii = true;
fputs($s, "500 not supported\r\n");
} elseif ($buf === "TYPE I\r\n") {
$ascii = false;
fputs($s, "200 OK\r\n");
@@ -265,7 +272,7 @@ if ($pid) {
} elseif (preg_match("~^NLST(?: ([A-Za-z./]+))?\r\n$~", $buf, $m)) {
if (isset($m[1]) && $m[1] === 'bogusdir') {
if (isset($m[1]) && (($m[1] === 'bogusdir') || ($m[1] === '/bogusdir'))) {
fputs($s, "250 $m[1]: No such file or directory\r\n");
continue;
}
@@ -276,11 +283,20 @@ if ($pid) {
continue;
}
fputs($s, "150 File status okay; about to open data connection\r\n");
if (empty($pasv)) {
fputs($s, "150 File status okay; about to open data connection\r\n");
if (!$fs = stream_socket_client("tcp://$host:$port")) {
fputs($s, "425 Can't open data connection\r\n");
continue;
}
} else {
fputs($s, "125 Data connection already open; transfer starting.\r\n");
$fs=$pasvs;
}
if (!$fs = stream_socket_client("tcp://$host:$port")) {
fputs($s, "425 Can't open data connection\r\n");
continue;
if ((!empty($ssl)) && (!stream_socket_enable_crypto($pasvs, true, STREAM_CRYPTO_METHOD_SSLv23_SERVER))) {
die("SSLv23 handshake failed.\n");
}
if (empty($m[1]) || $m[1] !== 'emptydir') {
@@ -368,7 +384,7 @@ if ($pid) {
}
fputs($s, "226 Closing data Connection.\r\n");
break;
case "mediumfile":
case "mediumfile":
fputs($s, "150 File status okay; about to open data connection.\r\n");
for($i = 0; $i < 150; $i++){
fputs($fs, "This is line $i of the test data.\n");
@@ -384,13 +400,22 @@ if ($pid) {
}elseif (preg_match('/^PASV/', $buf, $matches)) {
$port = $pasv_port;
$p2 = $port % ((int) 1 << 8);
$p1 = ($port-$p2)/((int) 1 << 8);
$pasv=true;
$p2 = $pasv_port % ((int) 1 << 8);
$p1 = ($pasv_port-$p2)/((int) 1 << 8);
$host = "127.0.0.1";
if (!empty($ssl)) {
$soc = stream_socket_server("tcp://127.0.0.1:$pasv_port", $errno, $errstr, STREAM_SERVER_BIND|STREAM_SERVER_LISTEN, $context);
} else {
$soc = stream_socket_server("tcp://127.0.0.1:$pasv_port");
}
fputs($s, "227 Entering Passive Mode. (127,0,0,1,{$p1},{$p2})\r\n");
$pasvs = stream_socket_accept($soc,10);
}elseif (preg_match('/^EPSV/', $buf, $matches)) {
fputs($s, "550 Extended passsive mode not supported.\r\n");
} elseif (preg_match('/^SITE EXEC/', $buf, $matches)) {
fputs($s, "200 OK\r\n");
+54 -23
View File
@@ -361,45 +361,45 @@ ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_imagegif, 0, 0, 1)
ZEND_ARG_INFO(0, im)
ZEND_ARG_INFO(0, filename)
ZEND_ARG_INFO(0, to)
ZEND_END_ARG_INFO()
#ifdef HAVE_GD_PNG
ZEND_BEGIN_ARG_INFO_EX(arginfo_imagepng, 0, 0, 1)
ZEND_ARG_INFO(0, im)
ZEND_ARG_INFO(0, filename)
ZEND_ARG_INFO(0, to)
ZEND_END_ARG_INFO()
#endif
#ifdef HAVE_GD_WEBP
ZEND_BEGIN_ARG_INFO_EX(arginfo_imagewebp, 0, 0, 1)
ZEND_ARG_INFO(0, im)
ZEND_ARG_INFO(0, filename)
ZEND_ARG_INFO(0, to)
ZEND_END_ARG_INFO()
#endif
#ifdef HAVE_GD_JPG
ZEND_BEGIN_ARG_INFO_EX(arginfo_imagejpeg, 0, 0, 1)
ZEND_ARG_INFO(0, im)
ZEND_ARG_INFO(0, filename)
ZEND_ARG_INFO(0, to)
ZEND_ARG_INFO(0, quality)
ZEND_END_ARG_INFO()
#endif
ZEND_BEGIN_ARG_INFO_EX(arginfo_imagewbmp, 0, 0, 1)
ZEND_ARG_INFO(0, im)
ZEND_ARG_INFO(0, filename)
ZEND_ARG_INFO(0, to)
ZEND_ARG_INFO(0, foreground)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_imagegd, 0, 0, 1)
ZEND_ARG_INFO(0, im)
ZEND_ARG_INFO(0, filename)
ZEND_ARG_INFO(0, to)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_imagegd2, 0, 0, 1)
ZEND_ARG_INFO(0, im)
ZEND_ARG_INFO(0, filename)
ZEND_ARG_INFO(0, to)
ZEND_ARG_INFO(0, chunk_size)
ZEND_ARG_INFO(0, type)
ZEND_END_ARG_INFO()
@@ -1444,6 +1444,7 @@ PHP_FUNCTION(imagesetstyle)
gdImagePtr im;
int *stylearr;
int index = 0;
uint32_t num_styles;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "ra", &IM, &styles) == FAILURE) {
return;
@@ -1453,8 +1454,14 @@ PHP_FUNCTION(imagesetstyle)
RETURN_FALSE;
}
num_styles = zend_hash_num_elements(Z_ARRVAL_P(styles));
if (num_styles == 0) {
php_error_docref(NULL, E_WARNING, "styles array must not be empty");
RETURN_FALSE;
}
/* copy the style values in the stylearr */
stylearr = safe_emalloc(sizeof(int), zend_hash_num_elements(Z_ARRVAL_P(styles)), 0);
stylearr = safe_emalloc(sizeof(int), num_styles, 0);
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(styles), item) {
stylearr[index++] = zval_get_long(item);
@@ -1514,7 +1521,7 @@ PHP_FUNCTION(imageistruecolor)
/* }}} */
/* {{{ proto void imagetruecolortopalette(resource im, bool ditherFlag, int colorsWanted)
Convert a true colour image to a palette based image with a number of colours, optionally using dithering. */
Convert a true color image to a palette based image with a number of colors, optionally using dithering. */
PHP_FUNCTION(imagetruecolortopalette)
{
zval *IM;
@@ -1530,18 +1537,18 @@ PHP_FUNCTION(imagetruecolortopalette)
RETURN_FALSE;
}
if (ncolors <= 0) {
php_error_docref(NULL, E_WARNING, "Number of colors has to be greater than zero");
if (ncolors <= 0 || ZEND_LONG_INT_OVFL(ncolors)) {
php_error_docref(NULL, E_WARNING, "Number of colors has to be greater than zero and no more than %d", INT_MAX);
RETURN_FALSE;
}
gdImageTrueColorToPalette(im, dither, ncolors);
gdImageTrueColorToPalette(im, dither, (int)ncolors);
RETURN_TRUE;
}
/* }}} */
/* {{{ proto void imagetruecolortopalette(resource im, bool ditherFlag, int colorsWanted)
Convert a true colour image to a palette based image with a number of colours, optionally using dithering. */
/* {{{ proto void imagepalettetotruecolor(resource im)
Convert a palette based image to a true color image. */
PHP_FUNCTION(imagepalettetotruecolor)
{
zval *IM;
@@ -2674,7 +2681,7 @@ PHP_FUNCTION(imagexbm)
}
/* }}} */
/* {{{ proto bool imagegif(resource im [, string filename])
/* {{{ proto bool imagegif(resource im [, mixed to])
Output GIF image to browser or file */
PHP_FUNCTION(imagegif)
{
@@ -2683,7 +2690,7 @@ PHP_FUNCTION(imagegif)
/* }}} */
#ifdef HAVE_GD_PNG
/* {{{ proto bool imagepng(resource im [, string filename])
/* {{{ proto bool imagepng(resource im [, mixed to])
Output PNG image to browser or file */
PHP_FUNCTION(imagepng)
{
@@ -2694,7 +2701,7 @@ PHP_FUNCTION(imagepng)
#ifdef HAVE_GD_WEBP
/* {{{ proto bool imagewebp(resource im [, string filename[, int quality]] )
/* {{{ proto bool imagewebp(resource im [, mixed to[, int quality]] )
Output WEBP image to browser or file */
PHP_FUNCTION(imagewebp)
{
@@ -2705,7 +2712,7 @@ PHP_FUNCTION(imagewebp)
#ifdef HAVE_GD_JPG
/* {{{ proto bool imagejpeg(resource im [, string filename [, int quality]])
/* {{{ proto bool imagejpeg(resource im [, mixed to [, int quality]])
Output JPEG image to browser or file */
PHP_FUNCTION(imagejpeg)
{
@@ -2714,7 +2721,7 @@ PHP_FUNCTION(imagejpeg)
/* }}} */
#endif /* HAVE_GD_JPG */
/* {{{ proto bool imagewbmp(resource im [, string filename [, int foreground]])
/* {{{ proto bool imagewbmp(resource im [, mixed to [, int foreground]])
Output WBMP image to browser or file */
PHP_FUNCTION(imagewbmp)
{
@@ -2722,7 +2729,7 @@ PHP_FUNCTION(imagewbmp)
}
/* }}} */
/* {{{ proto bool imagegd(resource im [, string filename])
/* {{{ proto bool imagegd(resource im [, mixed to])
Output GD image to browser or file */
PHP_FUNCTION(imagegd)
{
@@ -2730,7 +2737,7 @@ PHP_FUNCTION(imagegd)
}
/* }}} */
/* {{{ proto bool imagegd2(resource im [, string filename [, int chunk_size [, int type]]])
/* {{{ proto bool imagegd2(resource im [, mixed to [, int chunk_size [, int type]]])
Output GD2 image to browser or file */
PHP_FUNCTION(imagegd2)
{
@@ -3032,6 +3039,11 @@ PHP_FUNCTION(imagegammacorrect)
return;
}
if ( input <= 0.0 || output <= 0.0 ) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Gamma values should be positive");
RETURN_FALSE;
}
if ((im = (gdImagePtr)zend_fetch_resource(Z_RES_P(IM), "Image", le_gd)) == NULL) {
RETURN_FALSE;
}
@@ -4059,6 +4071,7 @@ static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type )
dest = VCWD_FOPEN(fn_dest, "wb");
if (!dest) {
php_error_docref(NULL, E_WARNING, "Unable to open '%s' for writing", fn_dest);
fclose(org);
RETURN_FALSE;
}
@@ -4067,6 +4080,8 @@ static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type )
im_org = gdImageCreateFromGif(org);
if (im_org == NULL) {
php_error_docref(NULL, E_WARNING, "Unable to open '%s' Not a valid GIF file", fn_dest);
fclose(org);
fclose(dest);
RETURN_FALSE;
}
break;
@@ -4077,6 +4092,8 @@ static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type )
im_org = gdImageCreateFromJpegEx(org, ignore_warning);
if (im_org == NULL) {
php_error_docref(NULL, E_WARNING, "Unable to open '%s' Not a valid JPEG file", fn_dest);
fclose(org);
fclose(dest);
RETURN_FALSE;
}
break;
@@ -4087,6 +4104,8 @@ static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type )
im_org = gdImageCreateFromPng(org);
if (im_org == NULL) {
php_error_docref(NULL, E_WARNING, "Unable to open '%s' Not a valid PNG file", fn_dest);
fclose(org);
fclose(dest);
RETURN_FALSE;
}
break;
@@ -4094,10 +4113,14 @@ static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type )
default:
php_error_docref(NULL, E_WARNING, "Format not supported");
fclose(org);
fclose(dest);
RETURN_FALSE;
break;
}
fclose(org);
org_width = gdImageSX (im_org);
org_height = gdImageSY (im_org);
@@ -4128,6 +4151,8 @@ static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type )
im_tmp = gdImageCreate (dest_width, dest_height);
if (im_tmp == NULL ) {
php_error_docref(NULL, E_WARNING, "Unable to allocate temporary buffer");
fclose(dest);
gdImageDestroy(im_org);
RETURN_FALSE;
}
@@ -4135,23 +4160,29 @@ static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type )
gdImageDestroy(im_org);
fclose(org);
im_dest = gdImageCreate(dest_width, dest_height);
if (im_dest == NULL) {
php_error_docref(NULL, E_WARNING, "Unable to allocate destination buffer");
fclose(dest);
gdImageDestroy(im_tmp);
RETURN_FALSE;
}
white = gdImageColorAllocate(im_dest, 255, 255, 255);
if (white == -1) {
php_error_docref(NULL, E_WARNING, "Unable to allocate the colors for the destination buffer");
fclose(dest);
gdImageDestroy(im_tmp);
gdImageDestroy(im_dest);
RETURN_FALSE;
}
black = gdImageColorAllocate(im_dest, 0, 0, 0);
if (black == -1) {
php_error_docref(NULL, E_WARNING, "Unable to allocate the colors for the destination buffer");
fclose(dest);
gdImageDestroy(im_tmp);
gdImageDestroy(im_dest);
RETURN_FALSE;
}
+3 -21
View File
@@ -2245,7 +2245,9 @@ void gdImageCopy (gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX,
for (y = 0; (y < h); y++) {
for (x = 0; (x < w); x++) {
int c = gdImageGetTrueColorPixel (src, srcX + x, srcY + y);
gdImageSetPixel (dst, dstX + x, dstY + y, c);
if (c != src->transparent) {
gdImageSetPixel (dst, dstX + x, dstY + y, c);
}
}
}
} else {
@@ -2262,26 +2264,6 @@ void gdImageCopy (gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX,
return;
}
/* Destination is palette based */
if (src->trueColor) { /* But source is truecolor (Ouch!) */
toy = dstY;
for (y = srcY; (y < (srcY + h)); y++) {
tox = dstX;
for (x = srcX; x < (srcX + w); x++) {
int nc;
c = gdImageGetPixel (src, x, y);
/* Get best match possible. */
nc = gdImageColorResolveAlpha(dst, gdTrueColorGetRed(c), gdTrueColorGetGreen(c), gdTrueColorGetBlue(c), gdTrueColorGetAlpha(c));
gdImageSetPixel(dst, tox, toy, nc);
tox++;
}
toy++;
}
return;
}
/* Palette based to palette based */
for (i = 0; i < gdMaxColors; i++) {
colorMap[i] = (-1);
+10 -30
View File
@@ -1509,13 +1509,8 @@ gdImagePtr gdImageScaleBicubicFixed(gdImagePtr src, const unsigned int width, co
src_offset_y[0] = m;
}
if (m < 1) {
src_offset_x[1] = n;
src_offset_y[1] = m;
} else {
src_offset_x[1] = n;
src_offset_y[1] = m;
}
src_offset_x[1] = n;
src_offset_y[1] = m;
if ((m < 1) || (n >= src_w - 1)) {
src_offset_x[2] = n;
@@ -1567,13 +1562,8 @@ gdImagePtr gdImageScaleBicubicFixed(gdImagePtr src, const unsigned int width, co
src_offset_y[8] = m;
}
if (m >= src_h - 1) {
src_offset_x[8] = n;
src_offset_y[8] = m;
} else {
src_offset_x[9] = n;
src_offset_y[9] = m;
}
src_offset_x[9] = n;
src_offset_y[9] = m;
if ((m >= src_h-1) || (n >= src_w-1)) {
src_offset_x[10] = n;
@@ -1599,13 +1589,8 @@ gdImagePtr gdImageScaleBicubicFixed(gdImagePtr src, const unsigned int width, co
src_offset_y[12] = m;
}
if (m >= src_h - 2) {
src_offset_x[13] = n;
src_offset_y[13] = m;
} else {
src_offset_x[13] = n;
src_offset_y[13] = m;
}
src_offset_x[13] = n;
src_offset_y[13] = m;
if ((m >= src_h - 2) || (n >= src_w - 1)) {
src_offset_x[14] = n;
@@ -2014,13 +1999,8 @@ gdImagePtr gdImageRotateBicubicFixed(gdImagePtr src, const float degrees, const
src_offset_y[0] = m;
}
if (m < 1) {
src_offset_x[1] = n;
src_offset_y[1] = m;
} else {
src_offset_x[1] = n;
src_offset_y[1] = m ;
}
src_offset_x[1] = n;
src_offset_y[1] = m;
if ((m < 1) || (n >= src_w-1)) {
src_offset_x[2] = - 1;
@@ -2073,8 +2053,8 @@ gdImagePtr gdImageRotateBicubicFixed(gdImagePtr src, const float degrees, const
}
if (m >= src_h-1) {
src_offset_x[8] = - 1;
src_offset_y[8] = - 1;
src_offset_x[9] = - 1;
src_offset_y[9] = - 1;
} else {
src_offset_x[9] = n;
src_offset_y[9] = m;
+1 -1
View File
@@ -760,7 +760,7 @@ LOCAL (void)
cinfo->colormap[2][icolor] = (JSAMPLE) ((c2total + (total >> 1)) / total);
#else
/* 2.0.16: Paul den Dulk found an occasion where total can be 0 */
if (count)
if (total)
{
nim->red[icolor] = (int) ((c0total + (total >> 1)) / total);
nim->green[icolor] = (int) ((c1total + (total >> 1)) / total);
+1 -1
View File
@@ -329,7 +329,7 @@ han2zen (int *p1, int *p2)
{
if ((*p2 >= 74 && *p2 <= 103) || (*p2 >= 110 && *p2 <= 122))
(*p2)++;
else if (*p2 == 131 && *p2 == 69)
else if (*p2 == 131 || *p2 == 69)
*p2 = 148;
}
else if (handaku && *p2 >= 110 && *p2 <= 122)
+3 -6
View File
@@ -8,16 +8,13 @@ Bug #22544 (TrueColor transparency in PNG images).
?>
--FILE--
<?php
$dest = dirname(realpath(__FILE__)) . '/bug22544私はガラスを食べられます.png';
@unlink($dest);
$image = imageCreateTruecolor(640, 100);
$transparent = imageColorAllocate($image, 0, 0, 0);
$red = imageColorAllocate($image, 255, 50, 50);
imageColorTransparent($image, $transparent);
imageFilledRectangle($image, 0, 0, 640-1, 100-1, $transparent);
imagePng($image, $dest);
echo md5_file($dest) . "\n";
@unlink($dest);
include_once __DIR__ . '/func.inc';
test_image_equals_file(__DIR__ . '/bug22544私はガラスを食べられます.png', $image);
?>
--EXPECT--
10a57d09a2c63fad87b85b38d6b258d6
The images are equal.
+3 -6
View File
@@ -8,16 +8,13 @@ Bug #22544 (TrueColor transparency in PNG images).
?>
--FILE--
<?php
$dest = dirname(realpath(__FILE__)) . '/bug22544.png';
@unlink($dest);
$image = imageCreateTruecolor(640, 100);
$transparent = imageColorAllocate($image, 0, 0, 0);
$red = imageColorAllocate($image, 255, 50, 50);
imageColorTransparent($image, $transparent);
imageFilledRectangle($image, 0, 0, 640-1, 100-1, $transparent);
imagePng($image, $dest);
echo md5_file($dest) . "\n";
@unlink($dest);
include_once __DIR__ . '/func.inc';
test_image_equals_file(__DIR__ . '/bug22544.png', $image);
?>
--EXPECT--
10a57d09a2c63fad87b85b38d6b258d6
The images are equal.
Loaded 100 of 716 files, more files were not shown because too many files have changed in this diff. Show more