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

123085 Commits

Author SHA1 Message Date
Dylan T
e5551d50e7 zend_compile.c: fix typo
Don't mind me, I just happened to be browsing this code. 🙃

Closes GH-6721.

[ci skip]
2021-02-24 10:10:19 +01:00
Max Semenik
dda0cea5cd run-tests: add skip cache
Currently every --SKIPIF-- section in every test file results in 1
extra execution of PHP, every --EXTENSIONS-- section - in 2 executions.
This is quite wasteful, as skip checking code is extremely repetitive
and extensions are fixed for every binary/ini/command parameters
combination.

This patch adds caching to all such checks.

On my machine, the gains are quite noticeable: 36s instead of 43s
with -j16, 292s instead of 337s without concurrency. Cache stats are
3780 hits, 1247 misses in the latter case. In the future, tests could
be adjusted to have more uniform skip checks to improve performance even
more.

Closes GH-6681.
2021-02-23 15:05:49 +01:00
Christoph M. Becker
b84e3b1ced Merge branch 'PHP-8.0'
* PHP-8.0:
  run-tests: fixed exit code not being set on BORKED tests
2021-02-23 13:23:22 +01:00
Christoph M. Becker
8162c3d1fd Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  run-tests: fixed exit code not being set on BORKED tests
2021-02-23 13:22:50 +01:00
Christoph M. Becker
67bb06cc9b Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  run-tests: fixed exit code not being set on BORKED tests
2021-02-23 13:15:30 +01:00
Dylan K. Taylor
729cd8bacd run-tests: fixed exit code not being set on BORKED tests
When no test paths are specified this shows up when 'make test' is used on a PECL extension without specifying tests to run (or in php-src too, I guess...)

Closes GH-6717.
2021-02-23 12:50:03 +01:00
Nikita Popov
fc1a012c49 Fix Windows build
Don't add to a void pointer.
2021-02-23 12:23:08 +01:00
Christoph M. Becker
062c09e198 Merge branch 'PHP-8.0'
* PHP-8.0:
  Update php_version.h to proper version number
2021-02-23 12:18:03 +01:00
Christoph M. Becker
3f282e57ec Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Update php_version.h to proper version number
2021-02-23 12:16:15 +01:00
Christoph M. Becker
81396ea890 Update php_version.h to proper version number 2021-02-23 12:09:06 +01:00
Nikita Popov
771b0bd1df Remove free_chunk API
This API only works in very limited circumstances -- relying on
it will invariably lead to leaks. The correct way to "free" something
from the pool is to use the checkpoint API.
2021-02-23 11:46:34 +01:00
Nikita Popov
6e6d6bb4fc Remove resize_chunk API
The last user has been dropped in the previous commit. This has
never worked meaningfully in the first place.
2021-02-23 11:18:48 +01:00
Nikita Popov
1fc4c89214 Fixed bug #80761
When row data split across multiple packets, allocate a temporary
buffer that can be reallocated, and only copy into the row buffer
pool arena once we know the final size. This avoids quadratic
memory usage for very large results.
2021-02-23 11:17:31 +01:00
Nikita Popov
8be711be47 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fixed bug #80786
2021-02-23 10:22:20 +01:00
Nikita Popov
79cf2c56d3 Fixed bug #80786
Don't use r0 as temporary register in math_double_long if it is
already used for a memory result.

This was already done in one branch, but not the other.
2021-02-23 10:22:00 +01:00
Cameron Porter
24e7299c9d Fixed bug #80724
FilesystemIterator::FOLLOW_SYMLINKS is currently treated as a directory
key mode flag, even though it does not change the way that the key
during iteration is set. To address this, FOLLOW_SYMLINKS has been
converted into an OTHER flag.

Closes GH-6695.
2021-02-23 09:50:36 +01:00
Darek Slusarczyk
da011a312a Fix #80329: Add option to specify LOAD DATA LOCAL white list folder
* allow the user to specify a folder where files that can be sent
   via LOAD DATA LOCAL can exist
 * add mysqli.local_infile_directory for mysqli
   (ignored if mysqli.allow_local_infile is enabled)
 * add PDO::MYSQL_ATTR_LOCAL_INFILE_DIRECTORY for pdo_mysql
   (ignored if PDO::MYSQL_ATTR_LOCAL_INFILE is enabled)
 * add related tests
 * fixes for building with libmysql 8.x
 * small improvement in existing tests
 * update php.ini-[development|production] files

Closes GH-6448.

Co-authored-by: Nikita Popov <nikic@php.net>
2021-02-23 09:30:46 +01:00
Christoph M. Becker
7f8ea83ef4 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix #75776: Flushing streams with compression filter is broken
2021-02-22 15:33:57 +01:00
Christoph M. Becker
b418fe266d Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #75776: Flushing streams with compression filter is broken
2021-02-22 15:32:17 +01:00
Christoph M. Becker
963e50c8c4 Fix #75776: Flushing streams with compression filter is broken
First, the `bzip2.compress` filter has the same issue as `zlib.deflate`
so we port the respective fix[1] to ext/bz2.

Second, there is still an issue, if a stream with an attached
compression filter is flushed before it is closed, without any writes
in between.  In that case, the compression is never finalized.  We fix
this by enforcing a `_php_stream_flush()` with the `closing` flag set
in `_php_stream_free()`, whenever a write filter is attached.  This
call is superfluous for most write filters, but does not hurt, even
when it is unnecessary.

[1] <http://git.php.net/?p=php-src.git;a=commit;h=20e75329f2adb11dd231852c061926d0e4080929>

Closes GH-6703.
2021-02-22 15:28:46 +01:00
Máté Kocsis
4c6533c257 Generate class entries from stubs for com, standard, xmlreader, xmlwriter, xsl, zip, Zend
Closes GH-6706
2021-02-22 15:24:03 +01:00
Christoph M. Becker
d03be8bf86 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix #80771: phpinfo(INFO_CREDITS) displays nothing in CLI
2021-02-22 14:34:45 +01:00
Christoph M. Becker
1d2bbce532 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #80771: phpinfo(INFO_CREDITS) displays nothing in CLI
2021-02-22 14:34:21 +01:00
Christoph M. Becker
073b6ea818 Fix #80771: phpinfo(INFO_CREDITS) displays nothing in CLI
There is no good reason not to show the credits in text based SAPIs,
except for brevity.  Thus, we suppress the credits from `php -i`.

Closes GH-6710.
2021-02-22 14:31:51 +01:00
Christoph M. Becker
59d030c55b Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix #80774: session_name() problem with backslash
2021-02-22 12:36:43 +01:00
Christoph M. Becker
6dcd640f35 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #80774: session_name() problem with backslash
2021-02-22 12:35:23 +01:00
Christoph M. Becker
d7c98ca1ac Fix #80774: session_name() problem with backslash
Since we do no longer URL decode cookie names[1], we must not URL
encode the session name.  We need to prevent broken Set-Cookie headers,
by rejecting names which contain invalid characters.

[1] <http://git.php.net/?p=php-src.git;a=commit;h=6559fe912661ca5ce5f0eeeb591d928451428ed0>

Closes GH-6711.
2021-02-22 12:32:56 +01:00
Nikita Popov
8e8e0017b9 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix trampoline leak on dynamic static call of non-static method
2021-02-22 10:33:16 +01:00
Nikita Popov
ab98944195 Fix trampoline leak on dynamic static call of non-static method
Fixes oss-fuzz #30317.
2021-02-22 10:32:59 +01:00
Nikita Popov
b3f4a3105c Don't resolve special class names
Adjust zend_resolve_class_name() to not resolve special class names.
This avoids the need to only call this function after a preliminary
check for non-default fetch types. Doing so is somewhat fragile
when dynamic class names are involved.

Fixes oss-fuzz #31139.
2021-02-22 10:11:14 +01:00
Nikita Popov
de03bc8eb7 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fixed bug #80781
2021-02-22 09:38:44 +01:00
Nikita Popov
ed4f90f0c7 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fixed bug #80781
2021-02-22 09:38:34 +01:00
Nikita Popov
6dd85f83f7 Fixed bug #80781
zend_find_array_dim_slow() may throw, make sure to handle this.
This backports the code we already use for this on PHP-8.0,
and also backports an exception check that makes this easier to
catch.
2021-02-22 09:36:43 +01:00
Markus Staab
fd3692ba41 Fix typo [ci skip]
Closes GH-6713.
2021-02-22 09:02:31 +01:00
Anatol Belski
6ffa9b118a NEWS: Associate FR to xxHash additions
[ci skip]

Signed-off-by: Anatol Belski <ab@php.net>
2021-02-21 13:50:59 +01:00
Anatol Belski
6055b72d0e UPGRADING: Add note about xxHash secret and fix a typo
[ci skip]

Signed-off-by: Anatol Belski <ab@php.net>
2021-02-21 13:36:28 +01:00
Anatol Belski
20501c72c8 hash: Implement secret support for xxh3 and xxh128
A secret can be passed through the options array. The length is
currently in the range of 136 to 256 bytes. The concerned algos are
already marked as non serializable.

Signed-off-by: Anatol Belski <ab@php.net>
2021-02-20 23:26:59 +01:00
Dmitry Stogov
3b29f5164d Revert "Remove class validation. zend_lookup_class_ex() performs it anyway."
This reverts commit 61cf1355fd.

Class name validation is only performed if key is not passed. Here, lc_name is passed as key.
2021-02-20 18:51:03 +03:00
Dmitry Stogov
61cf1355fd Remove class validation. zend_lookup_class_ex() performs it anyway. 2021-02-20 17:01:16 +03:00
Dmitry Stogov
ac7e967b67 Reduce ZPP API overhead 2021-02-20 13:59:29 +03:00
Nikita Popov
f37fe68e63 Fix closure GC handler for fake closures
Fixes oss-fuzz #31135.
2021-02-20 11:16:37 +01:00
Dmitry Stogov
59590663d7 Fixed NULL pointer dereference 2021-02-20 11:20:29 +03:00
Dmitry Stogov
bb1d61a848 Attempt to fix ext\standard\tests\file\basename_bug66395_variation2-win32.phpt and ext\standard\tests\file\pathinfo_basic1-win32.phpt 2021-02-19 21:48:19 +03:00
Dmitry Stogov
5e01542526 Improve basename(). Avoid calling mblen() for ASCII compatible locales. 2021-02-19 15:42:21 +03:00
Anton Vasiliev
be9200998f Fix typo
Closes GH-6708

Signed-off-by: George Peter Banyard <girgias@php.net>
2021-02-18 18:04:51 +00:00
Nikita Popov
a843c8a4b6 Fix crash during default value evaluation 2021-02-18 16:44:10 +01:00
Dmitry Stogov
9619562dbc Properly relove self::CONSTANT at compile time 2021-02-18 17:18:57 +03:00
Nikita Popov
db2e2af13a Fixed bug #53826
We should handle the case where the method doesn't exist, and
where it is not visible the same way.
2021-02-18 14:17:47 +01:00
Dmitry Stogov
6e988eaefb We don't need map_ptr slots for op_array.run_time_cache during preloading. 2021-02-18 15:46:48 +03:00
Máté Kocsis
4f4c031f62 Generate ext/spl class entries from stubs
Closes GH-6709
2021-02-18 13:01:51 +01:00