1
0
mirror of https://github.com/php/php-src.git synced 2026-04-23 07:58:20 +02:00
Commit Graph

1219 Commits

Author SHA1 Message Date
Gabriel Caruso 5d6e923d46 Remove mention of PHP major version in Copyright headers
Closes GH-4732.
2019-09-25 14:51:43 +02:00
Nikita Popov 790ed7d540 Enable display_startup_errors by default 2019-09-06 14:33:03 +02:00
Benjamin Eberlei 58d661cd7d Cleanup unnecessary if guard clause to free buffer. 2019-08-18 12:28:40 +02:00
Nikita Popov 2e4f76dc80 Merge branch 'PHP-7.4' 2019-08-13 10:23:32 +02:00
Nikita Popov b01824e596 Fixed bug #78406 2019-08-13 10:22:32 +02:00
Nikita Popov 9a3aef3c21 Merge branch 'PHP-7.4' 2019-07-29 17:15:35 +02:00
Nikita Popov 6df1665bb3 Merge branch 'PHP-7.3' into PHP-7.4 2019-07-29 17:14:40 +02:00
Nikita Popov bbed5564eb Merge branch 'PHP-7.2' into PHP-7.3 2019-07-29 16:57:57 +02:00
Nikita Popov 38f1288b64 Fix Zend signals unblocking
There are a few parts here:
 * opcache should not be blocking signals while invoking compile_file,
   otherwise signals may remain blocked on a compile error. While at
   it, also protect SHM memory during compile_file.
 * We should deactivate Zend signals at the end of the request, to make
   sure that we gracefully recover from a missing unblock and signals
   don't remain blocked forever.
 * We don't use a critical section in deactivation, because it should
   not be necessary. Additionally we want to clean up the signal queue,
   if it is non-empty.
 * Enable SIGG(check) in debug builds so we notice issues in the future.
2019-07-29 15:17:32 +02:00
Nikita Popov 36db71df47 Merge branch 'PHP-7.4' 2019-07-22 12:28:40 +02:00
Nikita Popov b3f74b0b7d Deprecate allow_url_include 2019-07-22 11:39:52 +02:00
Nikita Popov 3c2f433b2b Merge branch 'PHP-7.4' 2019-07-17 12:02:30 +02:00
Nikita Popov 856c5d2837 Revert "Avoid unused fstat() call"
This reverts commit 5a90dc77b8.

Let's try to go with the reverse direction here and actually trust
the reported size...
2019-07-17 11:49:10 +02:00
Nikita Popov 995b391621 Merge branch 'PHP-7.4' 2019-07-17 11:22:41 +02:00
Nikita Popov 5a90dc77b8 Avoid unused fstat() call
If we're including a file via PHP streams, we're not going to trust
the reported file size anyway and populate in a loop -- so don't
bother determining the file size in the first place. Only do this
for non-tty HANDLE_FP now, which is the only case where this
information was used.
2019-07-17 11:22:31 +02:00
Nikita Popov b32e9a9227 Merge branch 'PHP-7.4' 2019-07-17 10:41:34 +02:00
Nikita Popov a986e70991 Avoid double buffering in Zend streams
Disable buffering in PHP streams, to avoid storing and copying the
file contents twice.

This will call stream_set_option() on custom stream wrapper as
well, so the method needs to be implemented to avoid a warning.
2019-07-17 10:40:04 +02:00
Nikita Popov c4a6998c62 Merge branch 'PHP-7.4' 2019-07-16 17:45:03 +02:00
Nikita Popov b317f0eb59 Remove ZEND_HANDLE_MAPPED
The buf/len members are now simply used in addition to the main
stream, without changing the handle kind.
2019-07-16 17:44:32 +02:00
Nikita Popov e0eca26285 Drop free_filename field from zend_file_handle
free_filename was always zero.
2019-07-16 17:07:26 +02:00
Nikita Popov 3faa903d47 Merge branch 'PHP-7.4' 2019-07-16 16:44:46 +02:00
Nikita Popov 49bac9b77b Introduce zend_stream_init_filename()
Avoid more ad-hoc initialization of zend_file_handle structures.
2019-07-16 16:44:37 +02:00
Nikita Popov 06cf349dc3 Merge branch 'PHP-7.4' 2019-07-16 15:48:24 +02:00
Nikita Popov 5161cebe28 Fix bug #52752 by not using mmap() to lex files
Using mmap() is unsafe under concurrent modification. If the file
is truncated, access past the end of the file may occur, which will
generate a SIGBUS error. Even if the length does not change, the
contents may, which is a situation that the lexer certainly is not
prepared to deal with either.

Reproduce with test.php:

    <?php
    file_put_contents(__DIR__ . '/test.tpl',
        'AAA<?php $string = "' .
        str_repeat('A', mt_rand(1, 256 * 1024)) .
        '"; ?>BBB' . "\r\n");
    require_once __DIR__ . '/test.tpl';

And:

    for ((n=0;n<100;n++)); do sapi/cli/php test.php & done
2019-07-16 15:47:10 +02:00
Peter Kokot ccac19ed6c Merge branch 'PHP-7.4'
* PHP-7.4:
  Small typo and proto name fix
2019-07-15 18:15:58 +02:00
George Peter Banyard 548d1ec27c Small typo and proto name fix
Closes GH-4415
2019-07-15 18:15:17 +02:00
Nikita Popov 9207aef60c Merge branch 'PHP-7.4' 2019-07-15 16:26:25 +02:00
Nikita Popov c5f1b384b5 Move shebang handling into the lexer
Instead of handling shebang lines by adjusting the file pointer in
individual SAPIs, move the handling into the lexer, where this is
both a lot simpler and more robust. Whether the shebang should be
skipped is controlled by CG(skip_shebang) -- we might want to do
that in more cases.

This fixed bugs #60677 and #78066.
2019-07-15 16:25:49 +02:00
Peter Kokot e0ea444dd3 Merge branch 'PHP-7.4'
* PHP-7.4:
  Convert all php_error_docref0 to php_error_docref
2019-07-13 02:10:17 +02:00
George Peter Banyard 1c1de0c41a Convert all php_error_docref0 to php_error_docref
Closes GH-4394
2019-07-13 02:05:17 +02:00
Nikita Popov 05ac4acc24 Merge branch 'PHP-7.4' 2019-07-02 10:17:25 +02:00
Nikita Popov b88ef3dc58 Remove unused (module|request)_shutdown_for_exec 2019-07-02 10:10:51 +02:00
Joe Watkins b98cd0719a Merge branch 'PHP-7.4'
* PHP-7.4:
  implement tsrm_is_shutdown API
2019-06-28 10:27:39 +02:00
Joe Watkins 68485f8ab4 implement tsrm_is_shutdown API 2019-06-28 10:27:19 +02:00
Nikita Popov ca8f348646 Merge branch 'PHP-7.4' 2019-06-17 13:14:26 +02:00
Nikita Popov 1b63528d38 Merge branch 'PHP-7.3' into PHP-7.4 2019-06-17 13:14:18 +02:00
Erik Lundin 9f0515c40c Add syslog.filter=raw
This passes through syslog message unchanged, without splitting
messages at newlines.
2019-06-17 13:13:25 +02:00
Peter Kokot 7e22347d0f Merge branch 'PHP-7.4'
* PHP-7.4:
  [ci skip] Migrate Coding standards docs to Markdown
  Move CODING_STANDARDS to CODING_STANDARDS.md
2019-05-18 21:42:45 +02:00
Peter Kokot f45b61b898 [ci skip] Migrate Coding standards docs to Markdown 2019-05-18 21:41:38 +02:00
Nikita Popov 7208826fde Merge branch 'PHP-7.4' 2019-04-23 12:44:26 +02:00
bugreportuser d65f93f92b Remove duplicate zend_unset_timeout() 2019-04-23 12:44:20 +02:00
Nikita Popov 1d53d6df7e Merge branch 'PHP-7.4' 2019-04-17 14:06:05 +02:00
Nikita Popov f73f190c3f Fix internal_encoding fallback in mbstring
By introducing a hook that is called whenever one of
internal_encoding / input_encoding / output_encoding changes, so
that mbstring can adjust it's internal state.

This also makes internal_encoding work with zend multibyte.
2019-04-17 14:05:53 +02:00
Peter Kokot e6f86fb17c Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove checks for locale.h, setlocale, localeconv
2019-04-07 18:34:02 +02:00
Peter Kokot e06836a1a3 Remove checks for locale.h, setlocale, localeconv
The `<loccale.h>` header file, setlocale, and localeconv are part of the
standard C89 [1] and on current systems can be used unconditionally.

Since PHP 7.4 requires at least C89 or greater, the `HAVE_LOCALE_H`,
`HAVE_SETLOCALE`, and `HAVE_LOCALECONV` symbols defined by Autoconf in
configure.ac [2] can be ommitted and simplifed.

The bundled libmagic (file) has also been patched already in version
5.35 and up in upstream location so when it will be patched also in
php-src the check for locale.h header is still left in the configure.ac
and in windows headers definition file.

[1] https://port70.net/~nsz/c/c89/c89-draft.html#4.4
[2] https://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/headers.m4

Omit the bundled libmagic files
2019-04-07 18:32:54 +02:00
Peter Kokot e4a563b0c0 Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove HAVE_SIGNAL_H
2019-04-07 15:57:21 +02:00
Peter Kokot 5f8915786f Remove HAVE_SIGNAL_H
The `<signal.h>` header file is part of the standard C89 headers [1] and
on current systems can be included unconditionally.

Since file requires at least C89 or greater, the `HAVE_SIGNAL_H` symbol
defined by Autoconf in Zend.m4 [2] can be ommitted and simplifed.

The bundled libmagic (file) also ommits the usage of HAVE_SIGNAL_H since
5.35 however current version in PHP is very modified 5.34 version and
will be refactored separately. Check for HAVE_SIGNAL_H is therefore
still done in the configure.ac.

Refs:
[1] https://port70.net/~nsz/c/c89/c89-draft.html#4.1.2
[2] https://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/headers.m4
2019-04-07 15:55:34 +02:00
Anatol Belski 4e4bb56d6c Merge branch 'PHP-7.4'
* PHP-7.4:
  Implement stricter CRT check
2019-03-31 17:34:06 +02:00
Anatol Belski dd0aca0c11 Implement stricter CRT check
This aligns with the recommendations about VS2015, VS2017 and VS2019
compatibility.

More info below
https://devblogs.microsoft.com/cppblog/cpp-binary-compatibility-and-pain-free-upgrades-to-visual-studio-2019/
2019-03-31 17:33:36 +02:00
Dmitry Stogov 2dd2dcaf9c Merge branch 'PHP-7.4'
* PHP-7.4:
  Implemented a faster way to access predefined TSRM resources - CG(), EG(), etc.
2019-03-14 03:02:10 +03:00