1
0
mirror of https://github.com/php/php-src.git synced 2026-04-21 15:08:16 +02:00
Commit Graph

58045 Commits

Author SHA1 Message Date
Nikita Popov dbe5725ff3 Rename zend-test to zend_test
The extension name should match the name of the ext/ directory,
otherwise it will not get picked up by run-tests. It would be possible
to remap this in run-tests, but I think it's better to rename the
extension to follow the standard format. Other extensions also
use underscore instead of hyphen (e.g. pdo_mysql and not pdo-mysql).
Of course, the ./configure option remains hyphenated.

Closes GH-6613.
2021-01-19 15:28:15 +01:00
Nikita Popov d1fe9ae05f Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix observer tests on Windows
2021-01-19 15:27:38 +01:00
Nikita Popov f3415758d1 Fix observer tests on Windows
Use %e instead of a hardcoded forward slash.
2021-01-19 15:27:14 +01:00
Nikita Popov 8c3d279cb3 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fixed bug #80644: ResourceBundle::get() doesn't reset error state
2021-01-19 15:21:09 +01:00
Nikita Popov 05d168013a Fixed bug #80644: ResourceBundle::get() doesn't reset error state 2021-01-19 15:20:55 +01:00
George Peter Banyard a6e8ebf99a Use standard C99 64bits int types
Closes GH-6622
2021-01-19 13:44:36 +00:00
George Peter Banyard b44e29f843 php_pdo_register_driver() might fail
Therefore correctly report failure in MINIT for the drivers which didn't.
2021-01-19 12:55:07 +00:00
George Peter Banyard 424b4802d2 Remove unnecessary (char*) casts
The functions accepts a const char*
2021-01-19 12:40:50 +00:00
George Peter Banyard a78aea8948 Refactor PDO's last inserted ID handler to use and return zend_string
Closes GH-6617
2021-01-19 11:54:25 +00:00
George Peter Banyard 94ea8e247b Refactor PDO doer handler to use zend_string 2021-01-19 11:42:39 +00:00
Nikita Popov 9be0ee4309 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fixed bug #42560
2021-01-19 11:44:49 +01:00
Nikita Popov 1bdd8f7ae4 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fixed bug #42560
2021-01-19 11:44:22 +01:00
sj-i 5d31ee302d Fixed bug #42560
Check open_basedir after the fallback to the system's temporary
directory in tempnam().

In order to preserve the current behavior of upload_tmp_dir
(do not check explicitly specified dir, but check fallback),
new flags are added to check open_basedir for explicit dir
and for fallback.

Closes GH-6526.
2021-01-19 11:41:58 +01:00
Christoph M. Becker a4992cbf66 Merge branch 'PHP-8.0'
* PHP-8.0:
  ldap_search() and friends can return array
2021-01-19 10:35:35 +01:00
Christoph M. Becker f33105dcb6 ldap_search() and friends can return array
See the description of <https://www.php.net/ldap-search>, and also the
implementation.

Closes GH-6620.
2021-01-19 10:35:17 +01:00
Christoph M. Becker e1a1918f26 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix #69279: Compressed ZIP Phar extractTo() creates garbage files
2021-01-19 10:31:06 +01:00
Christoph M. Becker cfae999f1b Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #69279: Compressed ZIP Phar extractTo() creates garbage files
2021-01-19 10:30:28 +01:00
Christoph M. Becker 68f5289e9e Fix #69279: Compressed ZIP Phar extractTo() creates garbage files
When extracting compressed files from an uncompressed Phar, we must not
use the direct file pointer, but rather get an uncompressed file
pointer.

We also add a test to show that deflated and stored entries are
properly extracted.

This also fixes #79912, which appears to be a duplicate of #69279.

Co-authored-by: Anna Filina <afilina@gmail.com>

Closes GH-6599.
2021-01-19 10:28:54 +01:00
Nikita Popov e422ab2af7 Merge branch 'PHP-8.0'
* PHP-8.0:
  Keep JIT region executable under ZTS
2021-01-19 10:28:42 +01:00
Dylan K. Taylor 872f302b8d Keep JIT region executable under ZTS
When one thread tries to compile a script, another thread may
already be executing JITed code. In this case we can't make the
memory non-executable.

This violates the W^X principle, but doesn't seem to be avoidable
for ZTS builds for now. The same problem does not exist for NTS,
as it's a different process executing there, which has it's own
memory protection mapping.

Closes GH-6595.
2021-01-19 10:25:42 +01:00
Nikita Popov 29cf59895a Merge branch 'PHP-8.0'
* PHP-8.0:
  Observe unused return values in JIT
2021-01-19 10:10:08 +01:00
Nikita Popov fbd8e20ed5 Observe unused return values in JIT
Even if the return value is not used, it should still be available
to the observer.
2021-01-19 10:09:53 +01:00
Nikita Popov 64a4128c16 Merge branch 'PHP-8.0'
* PHP-8.0:
  Disable opcache optimizations during some observer tests
2021-01-19 10:03:28 +01:00
Nikita Popov dd7d829896 Disable opcache optimizations during some observer tests
Opcache inlines functions that only return a constant. Disable
optimizations to prevent differences in tests where such functions
are used (or rewrite the test to not depend on it).
2021-01-19 10:02:08 +01:00
Dmitry Stogov b3bbb8fe3b Mark classes cached by opcache by ZEND_ACC_CACHED flag and prevent useless copying and desrpoying of immutable data. 2021-01-19 11:55:09 +03:00
Dmitry Stogov c195fcd678 Avoid modification of trait info 2021-01-19 11:54:01 +03:00
Nikita Popov a9efcb1561 gen_stub: Also verify implementation-alias
This makes --verify also check @implementation-alias. Failures are
ignored using @no-verify instead. Some mistakes have been made that
would have been caught by this...

Closes GH-6615.
2021-01-19 09:48:33 +01:00
Nikita Popov d340be0d32 Merge branch 'PHP-8.0'
* PHP-8.0:
  SplFileObject::fgets() cannot return false
2021-01-18 16:47:47 +01:00
Nikita Popov f2364f316d SplFileObject::fgets() cannot return false
spl_filesystem_file_read() is called with silent=0, so it will
throw on failure.
2021-01-18 16:47:21 +01:00
Nikita Popov f0d6151918 gen_stub: Don't use $aliasMap during verification
Some functions have multiple aliases, while the $aliasMap can
only record one.

Methodsynopsis generation probably shouldn't use it either, but
at least that case seems to only be interested in whether there
is an alias at all.
2021-01-18 16:04:14 +01:00
Nikita Popov 2b677aaa34 Merge branch 'PHP-8.0'
* PHP-8.0:
  Sync gzgets signature with fgets
2021-01-18 15:47:31 +01:00
Nikita Popov 7290dc4dcf Sync gzgets signature with fgets 2021-01-18 15:47:12 +01:00
Craig Francis 50eca61f68 Use ENT_QUOTES|ENT_SUBSTITUTE default for HTML encoding and decoding functions
htmlspecialchars() etc now use ENT_QUOTES | ENT_SUBSTITUTE rather
than ENT_COMPAT by default.

Closes GH-6583.
2021-01-18 15:45:28 +01:00
Nikita Popov 49e030d551 Merge branch 'PHP-8.0'
* PHP-8.0:
  Sync datefmt_get_calendar_object signature
  Sync intlcal_create_instance() and IntlCalendar::createInstance()
  Sync date_diff and DateTime::diff return type
2021-01-18 14:39:51 +01:00
Nikita Popov ebf461a025 Sync datefmt_get_calendar_object signature
In this case, it's only a matter of using the same type order
in both cases.
2021-01-18 14:39:32 +01:00
Nikita Popov 39077deea5 Sync intlcal_create_instance() and IntlCalendar::createInstance()
Remove the explicit mention of IntlGregorianCalendar in the latter.
It is a subclass of IntlCalendar, and as such covered if only
IntlCalendar is used as the return type.
2021-01-18 14:39:32 +01:00
Nikita Popov c31f9f7ee4 Sync date_diff and DateTime::diff return type
This function/method cannot return false.
2021-01-18 14:39:32 +01:00
Nikita Popov 0f26f9b340 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix parameter name of PharData::getMetadata()
2021-01-18 14:16:33 +01:00
Nikita Popov 48e2e5324e Fix parameter name of PharData::getMetadata()
The name should be the same as for Phar::getMetadata().
2021-01-18 14:09:00 +01:00
Nikita Popov 37aaf2ffff Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix stub for Phar::setStub()
2021-01-18 13:01:01 +01:00
Dylan K. Taylor 0aad77418d Fix stub for Phar::setStub()
This fixes multiple issues:
 * The first parameter may be resource|string.
 * It's an overloaded signature. The second parameter cannot be
   passed if the first one is a string. Use UNKNOWN default
   value for that reason.
 * Make parameter names in PharData::setStub() match those in
   Phar.

Closes GH-6596.
2021-01-18 12:59:18 +01:00
Christoph M. Becker d0e3fb495f Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix #80595: Resetting POSTFIELDS to empty array breaks request
2021-01-18 11:01:39 +01:00
Christoph M. Becker c321896a37 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #80595: Resetting POSTFIELDS to empty array breaks request
2021-01-18 11:01:01 +01:00
Christoph M. Becker 38ad37ad43 Fix #80595: Resetting POSTFIELDS to empty array breaks request
This is mainly to work around https://github.com/curl/curl/issues/6455,
but not building the mime structure for empty hashtables is a general
performance optimization, so we do not restrict it to affected cURL
versions (7.56.0 to 7.75.0).

The minor change to bug79033.phpt is unexpected, but should not matter
in practice.

Closes GH-6606.
2021-01-18 10:57:56 +01:00
David Carlier ebca8deaaf posix: adding freebsd specific rlimit constants
Respectively number of kqueues, pty limits per user.

Closes GH-6608.
2021-01-18 10:44:21 +01:00
Nikita Popov 35dece02bb Remove redundant posix_getrlimit_basic.phpt
It is identical to posix_getrlimit.phpt, apart from one extra
message being printed.
2021-01-18 10:41:07 +01:00
Nikita Popov e8a0ae186f Fix memsize check for xxh32
Copy-paste mistake: The memsize limit for xxh32 should be 16,
rather than 32 (which is correct for xxh64).

Probably fixes oss-fuzz #29661.
2021-01-18 10:35:01 +01:00
David CARLIER a3e55286a6 hrtime implementation update for Mac
Using a more modern and simpler api available since Sierra (2016).

Closes GH-6609.
2021-01-18 10:01:21 +01:00
Ayesh Karunaratne 3dad63b5b2 Curl: Add CURLOPT_DOH_URL option
From libcurl version 7.62.0 and later, it supports DNS-over-HTTPS with
[`CURLOPT_DOH_URL`](https://curl.se/libcurl/c/CURLOPT_DOH_URL.html) option.
This adds integration with the `CURLOPT_DOH_URL` option if libcurl version
is >= 7.62.0 (0x073E00).

For reference, Ubuntu 20.04+ `libcurl4-openssl-dev`-based PHP builds use Curl 7.68.

Closes GH-6612.
2021-01-18 10:00:31 +01:00
Tyson Andre 81d20d003c Skip bug77423 if filter extension is unavailable. 2021-01-17 10:44:45 -05:00