Dmitry Stogov
4a2ae84188
Add "const". Move constant strings to read-only memory.
2020-09-07 21:35:48 +03:00
Máté Kocsis
7aacc705d0
Add many missing closing PHP tags to tests
...
Closes GH-5958
2020-08-09 22:03:36 +02:00
Nikita Popov
8bc505cf47
Remove some duplicate iconv path logic
...
PHP_SETUP_ICONV already adds the include path to INCLUDES and the
library path to SHARED_LIBADD.
2020-08-07 18:10:29 +02:00
Nikita Popov
7bd1d70341
Remove PHP_ICONV_H_PATH
...
Directly include <iconv.h> instead, now that the giconv.h
distinction no longer exists.
2020-08-07 17:03:41 +02:00
Nikita Popov
2d359749a4
Remove giconv support
...
The best information I was able to find about this is this mail
from 2009 which indicates that giconv is an old FreeBSD iconv
implementation that has long since been superseded by libiconv.
https://lists.samba.org/archive/samba-technical/2009-June/065177.html
2020-08-07 17:03:41 +02:00
Nikita Popov
65592840f0
Remove more leftovers of PHP_DEFINE handling
2020-08-07 17:03:41 +02:00
Nikita Popov
e6f7784210
Don't use PHP_DEFINE in iconv
...
iconv is the only consumer of this custom define mechanism that
puts every define into a single file. Use the standard mechanism
instead.
2020-08-07 14:29:04 +02:00
Max Semenik
2b5de6f839
Remove proto comments from C files
...
Closes GH-5758
2020-07-06 21:13:34 +02:00
Máté Kocsis
b5c7a83dca
Remove unnecessary PHPDoc-alike blocks from tests
...
Closes GH-5759
2020-06-24 13:13:44 +02:00
Nikita Popov
c9b9f525a9
Include stub hash in generated arginfo files
...
The hash is used to check whether the arginfo file needs to be
regenerated. PHP-Parser will only be downloaded if this is actually
necessary.
This ensures that release artifacts will never try to regenerate
stubs and thus fetch PHP-Parser, as long as you do not modify any
files.
Closes GH-5739.
2020-06-24 09:55:19 +02:00
George Peter Banyard
c803499e23
Remove depreacted curly brace offset syntax
...
Closes GH-5221
2020-05-22 16:52:17 +02:00
George Peter Banyard
9cc24baa1c
Fix [-Wundef] warning in Iconv extension
2020-05-20 18:22:09 +02:00
Máté Kocsis
3ebce8e9fc
Fix UNKNOWN default values in various extensions
...
Closes GH-5514
2020-05-05 19:08:20 +02:00
Máté Kocsis
1f48feebb9
Improve some TypeError and ValueError messages
...
Closes GH-5377
2020-04-14 14:38:45 +02:00
Máté Kocsis
3709e74b5e
Store default parameter values of internal functions in arg info
...
Closes GH-5353. From now on, PHP will have reflection information
about default values of parameters of internal functions.
Co-authored-by: Nikita Popov <nikita.ppv@gmail.com >
2020-04-08 18:37:51 +02:00
Máté Kocsis
5322de1ba8
Generate functions entries from stubs for another set of extensions
...
Closes GH-5351
2020-04-05 00:59:44 +02:00
Christoph M. Becker
324337a3b1
Merge branch 'PHP-7.4'
...
* PHP-7.4:
Fix #79200 : Some iconv functions cut Windows-1258
2020-03-23 14:31:16 +01:00
Christoph M. Becker
a7bbfc95eb
Merge branch 'PHP-7.3' into PHP-7.4
...
* PHP-7.3:
Fix #79200 : Some iconv functions cut Windows-1258
2020-03-23 14:13:42 +01:00
Christoph M. Becker
32a2644305
Fix #79200 : Some iconv functions cut Windows-1258
...
To cater to potentially state-dependent encodings, we have to reset the
conversion descriptor into its initial shift state to properly finish
the conversion. Furthermore, state-dependent encodings may not show
progress when comparing `in_left` before and after the conversion; we
rather have to see whether `out_left` has decreased. Also we have to
cater to the fact that the final potentially state resetting call does
not signal failure, but we still have to break respective loops
afterwards.
2020-03-23 14:12:37 +01:00
Christoph M. Becker
66d8d0c7d7
Drop support for iconv without proper errno setting
...
It is hard to impossible to work around iconv() implementations which
do not properly set errno according to POSIX. We therefore do no
longer allow to build against such iconv() implementations.
Co-Authored-By: Nikita Popov <nikita.ppv@googlemail.com >
2020-03-17 14:02:29 +01:00
George Peter Banyard
e4e1746b3f
Remove unnecessary condition as always true.
...
ZSTR_LEN(str) is an unsigned integer therefor it is always greater
or equal than 0.
Detected by -Wtype-limits compiler warning.
2020-02-05 17:44:20 +01:00
Nikita Popov
f8d795820e
Reindent phpt files
2020-02-03 22:52:20 +01:00
Máté Kocsis
d1764ca330
Make error messages more consistent by fixing capitalization
...
Closes GH-5066 As a first step, let's capitalize their initial letter when it is applicable.
2020-01-17 14:52:46 +01:00
Máté Kocsis
aadd3aaed9
Use RETURN_THROWS() in various places
2020-01-03 21:10:24 +01:00
Máté Kocsis
345703724c
Use RETURN_THROWS() during ZPP in most of the extensions
...
Except for some bigger ones: reflection, sodium, spl
2019-12-31 11:46:11 +01:00
Máté Kocsis
f3d5a5a9d3
Promote warnings to exceptions in string search related functions
...
GH-5004
2019-12-20 16:43:40 +01:00
Christoph M. Becker
dccd137e1a
iconv_strlen() cannot return a string
2019-11-11 15:40:59 +01:00
Máté Kocsis
27e83d0fb8
Add union return types for function stubs
2019-11-11 14:54:55 +01:00
Fabien Villepinte
a555cc0b3d
Clean DONE tags from tests
...
Remove most of the `===DONE===` tags and its variations.
Keep `===DONE===` if the test output otherwise becomes empty.
Closes GH-4872.
2019-11-07 21:31:47 +01:00
Colin O'Dell
e6d3146bdc
Accept null lengths for substr functions()
...
If a null $length is passed to any of these functions, behave as if no
parameter was passed:
- substr()
- substr_count()
- substr_compare()
- iconv_substr()
2019-10-22 12:09:04 +02:00
Christoph M. Becker
8548a1bdec
Merge branch 'PHP-7.4'
...
* PHP-7.4:
Fix #78642 : Wrong libiconv version displayed
2019-10-08 12:11:19 +02:00
Christoph M. Becker
346be2cf59
Merge branch 'PHP-7.3' into PHP-7.4
...
* PHP-7.3:
Fix #78642 : Wrong libiconv version displayed
2019-10-08 12:10:58 +02:00
Christoph M. Becker
d6fdc17f7f
Merge branch 'PHP-7.2' into PHP-7.3
...
* PHP-7.2:
Fix #78642 : Wrong libiconv version displayed
2019-10-08 12:10:06 +02:00
Christoph M. Becker
195c2008e8
Fix #78642 : Wrong libiconv version displayed
...
The high byte of `_libiconv_version` specifies the major version; the
low byte the minor version.
2019-10-08 12:09:11 +02:00
Gabriel Caruso
5d6e923d46
Remove mention of PHP major version in Copyright headers
...
Closes GH-4732.
2019-09-25 14:51:43 +02:00
Christoph M. Becker
bba7f38c4f
Don't explicitly set return value on ZPP failure in ext/iconv
...
Failing ZPP throws as of PHP 8.0.0, so explicitly setting a return
value is useless, and also slightly confusing.
2019-08-23 18:14:46 +02:00
Christoph M. Becker
d420336115
Add ext/iconv stubs
2019-08-23 18:14:45 +02:00
Christoph M. Becker
3f3aac1d07
Merge branch 'PHP-7.4'
...
* PHP-7.4:
Fix #78342 : Bus error in configure test for iconv //IGNORE
2019-07-29 08:52:11 +02:00
Christoph M. Becker
fec71e3f25
Merge branch 'PHP-7.3' into PHP-7.4
...
* PHP-7.3:
Fix #78342 : Bus error in configure test for iconv //IGNORE
2019-07-29 08:51:33 +02:00
Christoph M. Becker
585131f901
Merge branch 'PHP-7.2' into PHP-7.3
...
* PHP-7.2:
Fix #78342 : Bus error in configure test for iconv //IGNORE
2019-07-29 08:50:39 +02:00
Christoph M. Becker
30eb4b3563
Fix #78342 : Bus error in configure test for iconv //IGNORE
...
We have to check the return value of iconv_open() for error, to avoid
that and potentially other undesired behavior of iconv().
2019-07-29 08:48:13 +02:00
Nikita Popov
a1e2c8870e
Merge branch 'PHP-7.4'
2019-07-22 17:26:01 +02:00
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
Dmitry Stogov
e029cc4dd4
Merge branch 'PHP-7.4'
...
* PHP-7.4:
Cheaper checks for exceptions thrown from __toString()
2019-06-06 02:23:17 +03:00
Dmitry Stogov
457392fa64
Cheaper checks for exceptions thrown from __toString()
2019-06-06 01:47:22 +03:00
Nikita Popov
7686b0b889
Merge branch 'PHP-7.4'
2019-06-05 14:53:50 +02:00
Nikita Popov
a31f46421d
Allow exceptions in __toString()
...
RFC: https://wiki.php.net/rfc/tostring_exceptions
And convert some object to string conversion related recoverable
fatal errors into Error exceptions.
Improve exception safety of internal code performing string
conversions.
2019-06-05 14:25:07 +02:00
Stanislav Malyshev
12d68d0272
Merge branch 'PHP-7.4'
...
* PHP-7.4:
Update NEWS
Fix bug #78069 - Out-of-bounds read in iconv.c:_php_iconv_mime_decode() due to integer overflow
Fix #77973 : Uninitialized read in gdImageCreateFromXbm
2019-05-27 16:49:37 -07:00
Stanislav Malyshev
5e3dc08826
Merge branch 'PHP-7.3' into PHP-7.4
...
* PHP-7.3:
Update NEWS
Fix bug #78069 - Out-of-bounds read in iconv.c:_php_iconv_mime_decode() due to integer overflow
Fix #77973 : Uninitialized read in gdImageCreateFromXbm
2019-05-27 16:49:31 -07:00
Stanislav Malyshev
c7eb0feed8
Merge branch 'PHP-7.2' into PHP-7.3
...
* PHP-7.2:
Update NEWS
Fix bug #78069 - Out-of-bounds read in iconv.c:_php_iconv_mime_decode() due to integer overflow
Fix #77973 : Uninitialized read in gdImageCreateFromXbm
2019-05-27 16:49:25 -07:00