Fix #66828: iconv_mime_encode Q-encoding longer than it should be
Before the fix for bug 48289 has been applied, the algorithm to
construct a Q-encoded-word has been optimistic, i.e. try to encode as
many bytes that *may* fit in the remaining space, calculate the actual
length of the Q-encoded word, and if it's too long, try again with a
reduced size. However, the fix for the mentioned bug replaced this by
a pessimistic algorithm, which always terminates[1] the for loop[2]
during the first iteration (which renders the following 3 lines as dead
code), and as such easily produces unnecessarily short encoded-words.
Instead the proper fix for the bug would have been to make sure that
`out_size` is always decremented, if the space isn't sufficient for the
encoded-word.
Peter Kokot [Fri, 21 Sep 2018 17:07:49 +0000 (19:07 +0200)]
Rename *.p5c files to *.inc
When including files in PHP tests a good practice so far has been to use
the *.inc extension. This patch renames few *.p5c files that are
included in phpt files.
Peter Kokot [Tue, 18 Sep 2018 17:26:19 +0000 (19:26 +0200)]
Remove HAVE_TIME_H
The `<time.h>` header file is part of the standard C89 headers [1] and
on current systems can be included unconditionally.
Since PHP requires at least C89 or greater, the `HAVE_TIME_H` symbol
defined by Autoconf in ext/pdo_sqlite/config.m4 [2] can be ommitted and
simplifed.
Additionally, since PHP didn't define `HAVE_TIME_H` prior in the
configure.ac the occurrence of this symbol in cli can be removed.
Newer MySQL versions are stricter about invalid values. Three issues
are fixed:
* Don't use negative values with ZEROFILL. ZEROFILL implies UNSIGNED.
* Use a legal TIMESTAMP value. TIMESTAMP does not accept a Unix timestamp.
* Specify BIGINT values as strings, to avoid overflows.
Fix intermittent failures in mysqli_stmt_bind_result_format.phpt
There were two distinct issues here:
* $trend was compared against 'NULL' using !=, which does not work
as intended in the case where $trend==0.0.
* current_targets was declared as double(17,0), which means that
the fractional part was rounded, so that the same comparison in
SQL (rounded) and in PHP (not rounded) did not necessarily
match.
Please don't write mt_rand based tests, it takes ages to debug this
crap...
get_method() may modify the object pointer passed to it if method
forwarding is used. In this case we do not want to modify the
passed zval, so make sure that we copy the object into a temporary
first.
As far as I know server-tests.php is unmaintained and no longer
used for anything nowadays. Some of the new sections are supported
by run-tests.php itself nowadays and some server-based tests
(using the CLI server or php-fpm) are performed through different
means.
Dropping server-tests.php has been discussed in a bunch of PR
discussions already, so let's go ahead with it...
Peter Kokot [Mon, 17 Sep 2018 02:39:01 +0000 (04:39 +0200)]
Remove HAVE_STDARG_H
The C89 standard and later defines the `<stdarg.h>` header as part of
the standard headers [1]. On current systems it is always present and
can be included unconditionally.
Checking for presence and functionality of the `<stdarg.h>` header and
variadic function is not relevant anymore on current systems since this
is always available.
Also Autoconf suggests relying on at least C89 or above [2] and [3].
The following files were regenerated with re2c 1.0.3:
- Zend/zend_language_scanner.c
- Zend/zend_language_scanner_defs.h
Peter Kokot [Sat, 15 Sep 2018 23:14:08 +0000 (01:14 +0200)]
Remove HAVE_STRING_H
The C89 standard and later defines the `<string.h>` header as part of
the standard headers [1] and on current systems it is always present.
Code included also `<strings.h>` header as an alterinative in some
files. This kind of check was relevant on some older systems where the
`<strings.h>` file included definitions for the C89 compliant
`<string.h>`. Today such alternative check is not required anymore. The
`<strings.h>` file is part of the POSIX definition these days.
Also Autoconf suggests doing this and relying on C89 or above [2] and [3].
This patch also cleans few unused `<strings.h>` inclusions in the libmbfl.
Peter Kokot [Tue, 18 Sep 2018 03:21:19 +0000 (05:21 +0200)]
Fix config.guess and config.sub files in .gitignore
Files `config.guess` and `config.sub` are committed in the php-src
repository so these don't need to be ignored for the root directory.
For the extensions these can be ignored in case of building extension
inside the php-src with phpize.
This is an internal glibc macro, it should not be necessary to use
it if we already define _GNU_SOURCE (we do through
AC_USE_SYSTEM_EXTENSIONS). Needing to use __USE_GNU generally
indicates an inclusion order problem (libc header included before
config.h).
Newer MySQL versions are stricter about invalid values. Three issues
are fixed:
* Don't use negative values with ZEROFILL. ZEROFILL implies UNSIGNED.
* Use a legal TIMESTAMP value. TIMESTAMP does not accept a Unix timestamp.
* Specify BIGINT values as strings, to avoid overflows.
Support for libt1 has been removed from ext/gd in PHP 7.0 by 7dcfdbbee431c93c52605e1df323d18e0c6088e9, so we no longer need
to install this package. It is also no longer available on newer
Ubuntu versions.
HAVE_STDDEF_H guards have been removed by 6c1ff61a368a26c8f2cbf383aa8a26fc30cf59ef, because the header is
always available in C89. This removes a __GNUC__ guard for the
same header.
The FormatMessage API needs to LocalFree the delivered error messages.
In cases where messages are delivered in non ASCII compatible encoding,
the messages might be unreadable. This aligns the error message encoding
with the encoding settings in PHP, the focus is UTF-8 as default.