Commit Graph

818 Commits

Author SHA1 Message Date
Niels Dossche
1e5f46fb20
Fix test conflict between gzfile_basic.phpt and gzfile_basic2.phpt
[ci skip]

This should fix the nightly failure.
2024-07-06 01:59:32 +02:00
Remi Collet
5e12844d4d
Fix GH-13217 Test failure with zlib-ng
As compressed result may be different
- drop or relax expectations on compressed data
- rely on uncompressed result of compressed data
2024-03-05 10:13:22 +01:00
Ilija Tovilo
c442a1f18e
Temporarily disable failing zlib tests on travis (#10738) 2023-11-17 13:24:20 +00:00
David Carlier
bb2177e248 Merge branch 'PHP-8.1' into PHP-8.2 2023-02-23 18:48:25 +00:00
Niels Dossche
c510083c8c Fix incorrect string length for output_handler in zlib ini code
The length of "output_handler" is supposed to be passed, but as sizeof
is used, the resulting number includes the NUL character, so the length
is off-by-one. Subtract one to pass the correct length.

Closes GH-10667.
2023-02-23 18:47:26 +00:00
Bob Weinand
a01dd9feda Revert "Port all internally used classes to use default_object_handlers"
This reverts commit 94ee4f9834.

The commit was a bit too late to be included in PHP 8.2 RC1. Given it's a massive ABI break, we decide to postpone the change to PHP 8.3.
2022-09-14 11:13:23 +02:00
Máté Kocsis
ce058273ba
Add support for validation of missing method synopses (#9491) 2022-09-07 17:40:36 +02:00
Bob Weinand
94ee4f9834 Port all internally used classes to use default_object_handlers
Signed-off-by: Bob Weinand <bobwei9@hotmail.com>
2022-08-31 16:45:27 +02:00
Máté Kocsis
b4ec3e9bc0
Do not generate CONST_CS when registering constants (#9439) 2022-08-28 08:27:19 +02:00
Máté Kocsis
1362fefc85
Declare ext/zlib constants in stubs (#9147) 2022-07-27 00:42:19 +02:00
David Carlier
42c57123e9 Merge branch 'PHP-8.1' 2022-06-25 07:40:19 +01:00
David Carlier
af6325f68e Merge branch 'PHP-8.0' into PHP-8.1 2022-06-25 07:39:55 +01:00
Grégoire Paris
13f55d5c1b Use proper grammar in error message
Drop period in error messages

2 reasons:
- These error messages are not regular sentences.
- Having the offending value between parenthesis after the period looks weird.
Closes GH-8858.
2022-06-25 07:39:31 +01:00
Arnaud Le Blanc
efc8f0ebf8
Deprecate zend_atol() / add zend_ini_parse_quantity() (#7951)
Add zend_ini_parse_quantity() and deprecate zend_atol(), zend_atoi()

zend_atol() and zend_atoi() don't just do number parsing.
They also check for a 'K', 'M', or 'G' at the end of the string,
and multiply the parsed value out accordingly.

Unfortunately, they ignore any other non-numerics between the
numeric component and the last character in the string.
This means that numbers such as the following are both valid
and non-intuitive in their final output.

* "123KMG" is interpreted as "123G" -> 132070244352
* "123G " is interpreted as "123 " -> 123
* "123GB" is interpreted as "123B" -> 123
* "123 I like tacos." is also interpreted as "123." -> 123

Currently, in php-src these functions are used only for parsing ini values.

In this change we deprecate zend_atol(), zend_atoi(), and introduce a new
function with the same behavior, but with the ability to report invalid inputs
to the caller. The function's name also makes the behavior less unexpected:
zend_ini_parse_quantity().

Co-authored-by: Sara Golemon <pollita@php.net>
2022-06-17 14:12:53 +02:00
Christoph M. Becker
f107f968ec
Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix GH-8218: ob_end_clean does not reset Content-Encoding header
2022-04-25 14:30:26 +02:00
Christoph M. Becker
e063243d2e
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-8218: ob_end_clean does not reset Content-Encoding header
2022-04-25 14:29:44 +02:00
Christoph M. Becker
30f4c725cb
Fix GH-8218: ob_end_clean does not reset Content-Encoding header
The fix for GH-7953 introduced a regression by being to deliberate
adding the respective headers.  These must only be added, if the
handler starts, but is not finalizing.

Closes GH-8353.
2022-04-25 14:26:56 +02:00
Christoph M. Becker
d67698a063
Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix GH-7953: ob_clean() only does not set Content-Encoding
2022-02-03 16:13:28 +01:00
Christoph M. Becker
8009b216e9
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-7953: ob_clean() only does not set Content-Encoding
2022-02-03 16:13:11 +01:00
Christoph M. Becker
9bd468da63
Fix GH-7953: ob_clean() only does not set Content-Encoding
If an output handler has not yet been started, calling `ob_clean()`
causes it to start.  If that happens, we must not forget to set the
`Content-Encoding` and `Vary` headers.

Closes GH-7960.
2022-02-03 16:09:00 +01:00
Dmitry Stogov
067df26344 Use memrchr() when available
On x86_64 glibc memrchr() uses SSE/AVX CPU extensions and works much
faster then naive loop. On x86 32-bit we still use inlined version.

memrchr() is a GNU extension. Its prototype  becomes available when
<string.h> is included with defined _GNU_SOURCE macro. Previously, we
defined it in "php_config.h", but some sources may include <string.h>
befire it. To avod mess we also pass -D_GNU_SOURCE to C compiler.
2021-11-24 16:13:34 +03:00
Máté Kocsis
fdc6082902
Generate optimizer func info from stubs for various extensions (#7409)
ext/hash, ext/iconv, ext/mbstring, ext/xml, ext/zlib
2021-08-26 19:52:11 +02:00
Máté Kocsis
b1822899fc
Add support for generating optimizer function info from stubs (#7367) 2021-08-24 16:35:33 +02:00
Joe Watkins
570d9b63e9
Not serializable flag permeation 2021-07-20 12:28:35 +02:00
Nikita Popov
a733b1ada7 Restore zend_atoi()
I dropped this in preparation for changes that I didn't end up
doing. Restore the function for now to avoid unnecessary churn for
extensions.
2021-07-16 14:46:56 +02:00
Nikita Popov
1cba7764b4
Remove zend_atoi() (#7232)
It's the same as (int) zend_atol() -- it doesn't try to do anything
integer size specific. Canonicalize to one function in preparation
for renaming zend_atol() to something less misleading.

FFI test is adjusted to use a zend_test function. It just calls
zend_atol() internally, but could really be anything.

Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
2021-07-13 09:22:31 +02:00
Patrick Allaert
aff365871a Fixed some spaces used instead of tabs 2021-06-29 11:30:26 +02:00
Nikita Popov
9871a624bf Clean up some more function_exists() checks 2021-06-14 15:47:08 +02:00
Nikita Popov
6600ad6067 Add some missing EXTENSIONS sections to misc tests 2021-06-14 14:52:44 +02:00
Nikita Popov
39131219e8
Migrate more SKIPIF -> EXTENSIONS (#7139)
This is a mix of more automated and manual migration. It should remove all applicable extension_loaded() checks outside of skipif.inc files.
2021-06-11 12:58:44 +02:00
Nikita Popov
7485978339
Migrate SKIPIF -> EXTENSIONS (#7138)
This is an automated migration of most SKIPIF extension_loaded checks.
2021-06-11 11:57:42 +02:00
George Peter Banyard
b6958bb847
Implement "Deprecate implicit non-integer-compatible float to int conversions" RFC. (#6661)
RFC: https://wiki.php.net/rfc/implicit-float-int-deprecate

Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
2021-05-31 15:48:45 +01:00
George Peter Banyard
aca6aefd85
Remove 'register' type qualifier (#6980)
The compiler should be smart enough to optimize this on its own
2021-05-14 13:38:01 +01:00
KsaR
01b3fc03c3
Update http->https in license (#6945)
1. Update: http://www.php.net/license/3_01.txt to https, as there is anyway server header "Location:" to https.
2. Update few license 3.0 to 3.01 as 3.0 states "php 5.1.1, 4.1.1, and earlier".
3. In some license comments is "at through the world-wide-web" while most is without "at", so deleted.
4. fixed indentation in some files before |
2021-05-06 12:16:35 +02:00
Christoph M. Becker
93e6796fc0
Merge branch 'PHP-8.0'
* PHP-8.0:
  Export gzfwrite()
2021-04-26 12:12:48 +02:00
Christoph M. Becker
fe219d912e
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Export gzfwrite()
2021-04-26 12:12:04 +02:00
Christoph M. Becker
a2771296c0
Export gzfwrite()
Extensions calling `gzfwrite()` cannot be built when linked against
php.dll (built with zlib support) otherwise.

Closes GH-6880.
2021-04-26 12:09:31 +02:00
Nikita Popov
4ce5d2ea88 Add known strings for jit autoglobals
We always create interned strings for all autoglobals anyway, so
we might as well add known strings to make them more widely usable.
2021-04-09 15:37:59 +02:00
George Peter Banyard
09efad615b
Use zend_string_equals_(literal_)ci() API more often
Also drive-by usage of zend_ini_parse_bool()

Closes GH-6844
2021-04-09 02:34:50 +01:00
George Peter Banyard
5caaf40b43
Introduce pseudo-keyword ZEND_FALLTHROUGH
And use it instead of comments
2021-04-07 00:46:29 +01:00
George Peter Banyard
8a86fe11da
Add missing break; in Zlib extension 2021-04-07 00:46:17 +01:00
Levi Morrison
8d743d5281
Revert "Revert "Revert "[skip-ci] Fix typo"""
This reverts commit 2b0f239b21.
2021-03-28 11:53:30 -06:00
Nikita Popov
2b0f239b21 Revert "Revert "[skip-ci] Fix typo""
This reverts commit 046827a7e8.
2021-03-28 18:15:57 +02:00
Nikita Popov
046827a7e8 Revert "[skip-ci] Fix typo"
This reverts commit c730aa26bd.

This looks like the result of a compromised git account. Commit
access has already been revoked.
2021-03-28 11:16:39 +02:00
Rasmus Lerdorf
c730aa26bd [skip-ci] Fix typo
Fixes minor typo.

Signed-off-by: Rasmus Lerdorf <rasmus@lerdorf.com>
2021-03-28 05:57:07 +02: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
Nikita Popov
ce0bc58c22 Merge branch 'PHP-8.0'
* PHP-8.0:
  Mark resource-like objects as non-comparable
2021-02-16 14:22:03 +01:00
Nikita Popov
b63ea1047a Mark resource-like objects as non-comparable
As these hold on to some internal resource, there can't be two
"equal" objects with different identity. Make sure the lack of
public properties doesn't result in these being treated as always
equal.
2021-02-16 14:20:45 +01:00
Nikita Popov
b10416a652 Deprecate passing null to non-nullable arg of internal function
This deprecates passing null to non-nullable scale arguments of
internal functions, with the eventual goal of making the behavior
consistent with userland functions, where null is never accepted
for non-nullable arguments.

This change is expected to cause quite a lot of fallout. In most
cases, calling code should be adjusted to avoid passing null. In
some cases, PHP should be adjusted to make some function arguments
nullable. I have already fixed a number of functions before landing
this, but feel free to file a bug if you encounter a function that
doesn't accept null, but probably should. (The rule of thumb for
this to be applicable is that the function must have special behavior
for 0 or "", which is distinct from the natural behavior of the
parameter.)

RFC: https://wiki.php.net/rfc/deprecate_null_to_scalar_internal_arg

Closes GH-6475.
2021-02-11 21:46:13 +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