Commit Graph

112766 Commits

Author SHA1 Message Date
Nikita Popov
d59aac58b3 Report errors from stream read and write operations
The php_stream_read() and php_stream_write() functions now return
an ssize_t value, with negative results indicating failure. Functions
like fread() and fwrite() will return false in that case.

As a special case, EWOULDBLOCK and EAGAIN on non-blocking streams
should not be regarded as error conditions, and be reported as
successful zero-length reads/writes instead. The handling of EINTR
remains unclear and is internally inconsistent (e.g. some code-paths
will automatically retry on EINTR, while some won't).

I'm landing this now to make sure the stream wrapper ops API changes
make it into 7.4 -- however, if the user-facing changes turn out to
be problematic we have the option of clamping negative returns to
zero in php_stream_read() and php_stream_write() to restore the
old behavior in a relatively non-intrusive manner.
2019-07-22 17:17:28 +02:00
Nikita Popov
c817b8020c Special-case rc=1 self-referential arrays in ReflectionReference
New fix for bug #78263. This is special-cased elsewhere in the engine,
so we need to mirror it here.
2019-07-22 16:59:23 +02:00
Nikita Popov
19588a8f3b Revert "Add ReflectionReference::getRefcount()"
This reverts commit 428cfdd181.
2019-07-22 16:49:08 +02:00
Remi Collet
31d85b8417 cleanup gd build with system libgd - drop need to use libpng with system libgd - drop need to use libjpeg with system libgd - drop need to use libXpm with system libgd - drop need to use libfreetype with system libgd - improve configure comments 2019-07-22 16:14:19 +02:00
Peter Kokot
a2b758dab5 Remove HAVE_PQPUTCOPYEND
Symbol is not used anywhere in the code and also Postgresql 7.x is
EOL anyway.

Closes GH-4453
2019-07-22 16:05:26 +02:00
Peter Kokot
9b8bf13b3a Fix internals upgrading log 2019-07-22 16:04:07 +02:00
Peter Kokot
4b03e102c5 Remove HAVE_DSA_DEFAULT_METHOD
Last usage removed via 6a81363405.

Closes GH-4455
2019-07-22 16:02:55 +02:00
Christoph M. Becker
f8202b5513 Remove superfluous HAVE_GD_BUNDLED checks
If we're compiling the bundled libgd, `HAVE_GD_BUNDLED` is set, so
there is no need to check for this macro again.
2019-07-22 15:59:44 +02:00
Nikita Popov
72b9105d30 Merge branch 'PHP-7.3' into PHP-7.4 2019-07-22 12:41:15 +02:00
Nikita Popov
b59a9381b9 Remove test for bug #77185
Seems to be very unreliable in CI.
2019-07-22 12:40:26 +02:00
Nikita Popov
6572c00b81 Merge branch 'PHP-7.4' of git.php.net:/php-src into PHP-7.4 2019-07-22 12:29:00 +02:00
Christoph M. Becker
d3d3404db7 Drop superfluous ENABLE_GD_TTF
If we `HAVE_LIBFREETYPE`, we define `ENABLE_GD_TTF` if it is not
defined.  Therefore we can check for `HAVE_LIBFREETYPE` in the first
place.
2019-07-22 12:01:24 +02:00
Nikita Popov
23bb9f4e2f Add deprecations to UPGRADING 2019-07-22 11:53:50 +02:00
Nikita Popov
28cf080701 Deprecate unbinding $this from non-static closure 2019-07-22 11:39:52 +02:00
Nikita Popov
b3f74b0b7d Deprecate allow_url_include 2019-07-22 11:39:52 +02:00
Nikita Popov
964de035a7 Deprecate restore_include_path() 2019-07-22 11:39:52 +02:00
Nikita Popov
b3668aabf7 Deprecate convert_cyr_string() 2019-07-22 11:39:52 +02:00
Nikita Popov
e41b7f6db4 Deprecate (real) cast 2019-07-22 11:39:52 +02:00
Nikita Popov
46b982409a Deprecate implode() with swapped parameter order 2019-07-22 11:39:52 +02:00
Nikita Popov
cd2f2cd7d0 Deprecate FILTER_SANITIZE_MAGIC_QUOTES 2019-07-22 11:39:52 +02:00
Nikita Popov
4e190691e2 Deprecate is_real() function 2019-07-22 11:39:52 +02:00
Nikita Popov
b1cdf06673 Deprecate money_format() 2019-07-22 11:39:52 +02:00
Nikita Popov
4e4d8a4a6c Deprecate hebrevc() 2019-07-22 11:39:52 +02:00
Nikita Popov
e9e2fa4ad4 Deprecate ezmlm_hash() 2019-07-22 11:39:52 +02:00
Nikita Popov
39e756e7fe Deprecate encoding as 3rd param to mb_strrpos() 2019-07-22 11:39:52 +02:00
Nikita Popov
3121b7174f Deprecate Reflection export() methods
And remove the Reflector::export() interface method.
2019-07-22 11:39:52 +02:00
Nikita Popov
0ba7c3eadf Deprecate array_key_exists() on objects 2019-07-22 11:39:52 +02:00
Nikita Popov
b2ea507bea Deprecate get_magic_quotes_gpc() and get_magic_quotes_runtime() 2019-07-22 11:39:52 +02:00
Nikita Popov
b2915fc332 Merge branch 'PHP-7.3' into PHP-7.4 2019-07-22 11:19:24 +02:00
Nikita Popov
5e4dbce586 Reduce number of workers in test
4 seems to be enough to reliably reproduce the issue. Let's see
if this works better in CI.
2019-07-22 11:18:38 +02:00
Dmitry Stogov
60dca2295d Initialize static_members_table 2019-07-22 12:02:16 +03:00
Dmitry Stogov
2f51764e5d Evaluate constant in class scope 2019-07-22 11:59:24 +03:00
Nikita Popov
97b80bd83b Merge branch 'PHP-7.3' into PHP-7.4 2019-07-22 10:34:32 +02:00
Maksim Nikulin
bdf24f8d6d Prevent use after free in fpm_event_epoll_wait
epoll event backend does not guarantee that child input/output events
are reported before SIGCHILD due to finished worker. While a bunch of
events received by epoll is being processed, child-related structures
may be removed before dispatching of an I/O event for the same child.
The result may be attempt to access to memory region allocated for
another purpose, segfault of the master process, and unavailable web
sites.

Postpone processing of SIGCHILD events till other events in the same
bunch are processed.

Fix Bug #62418 php-fpm master process crashes
Fix Bug #65398 Race condition between SIGCHLD and child stdout/stderr event leads to segfault
Fix Bug #75112 php-fpm crashing, hard to reproduce
Fix Bug #77114 php-fpm master segfaults in fpm_event_epoll_wait/fpm_event_fire
Fix Bug #77185 Use-after-free in FPM master event handling
2019-07-22 10:32:58 +02:00
Remi Collet
fff6b18657 improve temporary fix for system libgd
- PHP_GD_PNG needed to set include path for png.h
- PHP_GD_JPEG needed to set include path for jpeglib.h
2019-07-22 09:11:32 +02:00
Peter Kokot
ef165b4422 Remove build.mk usage
First step when creating the `configure` script is currently using
make. This is helpful when developing buildsystem to only rebuild
`configure` and `main/php_config.h.in` files when one of the *.m4
or configure.ac file changes and saves the developer time a little.

Realistically however, it is not needed that much considering the
times of several seconds to fully rebuild the configure script and
configuration header. The next step when running the `configure`
script is much more time consuming so performance on buildconf
level is a bit questionable and won't be noticed on today's
systems.

Additionally:
- buildconf now removes cache and all targets and uses -f option on
  the first step i.e. autoconf. The autoheader does not need the -f
  option in this case.

Closes GH-4437
2019-07-21 11:40:23 +02:00
Peter Kokot
1b969a74d0 Remove some unused HAVE_* symbols
- HAVE_NET_SNMP removed via cab643f615
- HAVE_CRYPTO_AEAD_AES256GCM ad120c5ae9
- Remove HAVE_FREETDS and HAVE_LIBDNET_STUB (not used in current
  extension; copy paste from other removed extensions)

Closes GH-4448
2019-07-21 11:34:18 +02:00
Peter Kokot
15782b27b8 Remove HAVE_LIBZIP
The libzip library is now always used from the system.

Closes GH-4450
2019-07-21 11:32:13 +02:00
George Wang
30de357fa1 Merge branch 'PHP-7.3' into PHP-7.4 2019-07-21 00:01:39 -04:00
George Wang
82f35ab089 Merge branch 'PHP-7.2' into PHP-7.3 2019-07-21 00:01:06 -04:00
George Wang
eb7e45f662 Checked in LiteSpeed SAPI 7.5, addressed two main problems in "clean shutdown" introduced in 7.4.3,
1. falls in an infinite loop because PHP engine's inconsistent state, now override the ITIMER_PROF to 0.1 second, clean shutdown must finish before that.
2. generate too much error log, we completely disable "error_reporting" before calling php_request_shutdown().
2019-07-20 23:59:43 -04:00
George Peter Banyard
1a031a242c Renamed MySQLi test to remove duplicate 'mysqli_'
Closes GH-4441
2019-07-21 01:10:31 +02:00
Markus Staab
577ed5bfa4 Fix typos
Closes GH-4447
2019-07-21 01:01:36 +02:00
Peter Kokot
b1643e166d Fix failed tests for phar
- when $status is boolean, E_NOTICE appears and tests fail
- opcache is never enabled on these tests anyway.
- Add opcache.revalidate_freq=0 to testing script

  Instead of checking this in the tests files it can be used directly in
  the main testing script. Also this fixes failed tests.

- Use opcache_invalidate() instead of sleep() delay in some tests. Some
  delays are still used since the opcache_invalidate seems to be buggy
  and not working as expected.

Closes GH-4392
2019-07-21 00:49:35 +02:00
Peter Kokot
f5227c5863 Move HAVE_SQLITE3_CLOSE_V2 to pdo_sqlite
Closes GH-4444
2019-07-21 00:40:59 +02:00
Remi Collet
a85e4d5336 Fixed bug #78314 (missing freetype support/functions with external gd) 2019-07-20 07:57:13 +02:00
Peter Kokot
6de97402b5 Remove unused sqlite symbols
- HAVE_SQLITE3_KEY is no longer used in php-src
- SQLITE_ENABLE_COLUMN_METADATA is no longer used in php-src

Closes GH-4443
2019-07-20 00:27:10 +02:00
Peter Kokot
81fd1c5206 Fix typos in FFI
Closes GH-4438
2019-07-19 23:07:04 +02:00
Christoph M. Becker
737c1b492c Put oniguruma include path to proper CFLAGS 2019-07-19 20:04:47 +02:00
Christoph M. Becker
504cd03fc3 Move Oniguruma related config stuff to where it belongs
Oniguruma is exclusively used by ext/mbstring, and only if mbregex is
enabled.  Therefore it is unnecessary and confusing to have Oniguruma
related config stuff scattered elsewhere.

While we're at it, we also remove the referral to the bundled libonig
which is removed as of PHP 7.4.0, and the duplicated call to
`PHP_INSTALL_HEADERS()`.
2019-07-19 19:30:41 +02:00