Commit Graph

2256 Commits

Author SHA1 Message Date
Josh Soref
462da6e09c Fix spelling and grammar mistakes
This PR corrects misspellings identified by the check-spelling action.

The misspellings have been reported at jsoref@b6ba3e2#commitcomment-48946465

The action reports that the changes in this PR would make it happy: jsoref@602417c

Closes GH-6822.
2021-04-13 12:09:37 +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
Ilija Tovilo
269c8dac1d
Implement enums
RFC: https://wiki.php.net/rfc/enumerations

Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>

Closes GH-6489.
2021-03-17 19:08:03 +01:00
Christoph M. Becker
87a5a0e2cb Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix #80751: Comma in recipient name breaks email delivery
2021-03-01 18:50:58 +01:00
Christoph M. Becker
37c9728615 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #80751: Comma in recipient name breaks email delivery
2021-03-01 18:50:11 +01:00
Christoph M. Becker
71297a254b Fix #80751: Comma in recipient name breaks email delivery
So far, `SendText()` simply separates potential email address lists at
any comma, disregarding that commas inside a quoted-string do not
delimit addresses.  We fix that by introducing an own variant of
`strtok_r()` which caters to quoted-strings.

We also make `FormatEmailAddress()` aware of quoted strings.

We do not cater to email address comments, and potentially other quirks
of RFC 5322 email addresses, but catering to quoted-strings is supposed
to solve almost all practical use cases.

Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>

Closes GH-6735.
2021-03-01 18:46:21 +01:00
Christoph M. Becker
23bb95639f Merge branch 'PHP-8.0'
* PHP-8.0:
  Avoid C4090 level 1 warning
2021-02-08 23:13:19 +01:00
Christoph M. Becker
ff8da0dcff Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Avoid C4090 level 1 warning
2021-02-08 23:12:49 +01:00
Christoph M. Becker
4f508003a9 Avoid C4090 level 1 warning
This breaks the build for PHP 8 by default.
2021-02-08 23:11:37 +01:00
Christoph M. Becker
050214b1f1 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix #80706: mail(): Headers after Bcc headers may be ignored
2021-02-08 18:44:20 +01:00
Christoph M. Becker
f731477cd7 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #80706: mail(): Headers after Bcc headers may be ignored
2021-02-08 18:43:51 +01:00
Christoph M. Becker
ca7547c9e2 Fix #80706: mail(): Headers after Bcc headers may be ignored
We need to handle the case where a CRLF after a Bcc header is not the
beginning of a folding marker, because in that case the Bcc header was
not the last "thing".

Closes GH-6666.
2021-02-08 18:42:31 +01:00
David Gebler
7d7fe25003 Add IL compat flag to Windows builds
Enabled by default; use `--disable-vs-link-compat` to disable.

Closes GH-6658.
2021-02-03 11:43:38 +01:00
Nikita Popov
83be073abe Move optimizer into core
This only moves the files, adjusts the build system, exports APIs
and does minor fixups to make sure the code builds.

This does not yet try to make the optimizer usable independently
of opcache.

Closes GH-6642.
2021-01-28 10:38:25 +01:00
Nikita Popov
3e01f5afb1 Replace zend_bool uses with bool
We're starting to see a mix between uses of zend_bool and bool.
Replace all usages with the standard bool type everywhere.

Of course, zend_bool is retained as an alias.
2021-01-15 12:33:06 +01:00
Remi Collet
9bf43c4590 rename COMPILER and ARCHITECTURE macro (too generic) 2021-01-04 10:13:54 +01:00
Christoph M. Becker
38b80aaf85 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix #72964: White space not unfolded for CC/Bcc headers
2020-11-19 19:27:12 +01:00
Christoph M. Becker
c7343510e4 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #72964: White space not unfolded for CC/Bcc headers
2020-11-19 19:26:56 +01:00
Christoph M. Becker
881e43a03c Fix #72964: White space not unfolded for CC/Bcc headers
`\r\n` does only terminate a header, if not followed by `\t` or ` `.
We have to cater to that when determining the end position of the
respective headers.

Closes GH-6420.
2020-11-19 19:25:03 +01:00
Christoph M. Becker
dc8fb9dc8b Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix #80345: PHPIZE configuration has outdated PHP_RELEASE_VERSION
2020-11-19 16:28:27 +01:00
Christoph M. Becker
2e27bb8682 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #80345: PHPIZE configuration has outdated PHP_RELEASE_VERSION
2020-11-19 16:26:45 +01:00
Christoph M. Becker
c2b1182879 Fix #80345: PHPIZE configuration has outdated PHP_RELEASE_VERSION
We must not redefine the version "constants" for phpize builds, because
these have already generated in phpize.js, from where we pass these
variables forward to configure.js.

We also add `PHP_EXTRA_VERSION` and `PHP_VERSION_STRING` to the files
for completeness.

Closes GH-6419.
2020-11-19 16:23:20 +01:00
Christoph M. Becker
9b5f96e465 Fix inclusion order for phpize builds on Windows
`configure` for `phpize` builds on Windows creates Makefile and
config.pickle.h and includes the latter via the command line option
`/FI`.  That implies that config.pickle.h is always included before
config.w32.h, which means that standard definitions always override
extension specific definitions, while it should be the other way round.

Therefore, we change the inclusion order by including config.pickle.h
at the end of config.w32.h if the former is available, and also make
sure to avoid any potential C4005 warnings by `#undef`ining the macros
before defining them.

Closes GH-6269.
2020-11-18 12:50:26 +01:00
Christoph M. Becker
1e0610fe24 Merge branch 'PHP-8.0'
* PHP-8.0:
  Strip trailing line breaks and periods from Windows error messages
2020-11-12 16:43:57 +01:00
Christoph M. Becker
a08a2b48b4 Strip trailing line breaks and periods from Windows error messages
PHP error messages should not contain line breaks, so we remove these
from the Windows specific error messages.  We also remove trailing
periods for the same reason.

Closes GH-6423.
2020-11-12 16:42:28 +01:00
Gabriel Caruso
14806e0824
Prepare for PHP 8.1
Closes GH-6305.
2020-10-09 11:37:27 +02:00
George Peter Banyard
1e9db80d72 Tweak some macro definition on Windows
Closes GH-5606
2020-09-22 23:05:12 +01:00
Christoph M. Becker
3e33e1e86d Check linker compatibility directly from HMODULE
Checking the linker compatibility with extranous `ImageLoad()` calls is
possible, but unnecessary, since the modules are either already loaded
or loaded shortly afterwards, so that we can get the required
information directly from the module handles.  And actually, doing
`ImageLoad()` as well as `LoadLibrary()` leaves a tiny room for a race
condition, because both functions will lookup the module in the search
path, so there is no *guarantee* that both are dealing with the same
module.  Dropping the `ImageLoad()` calls also has the advantage to no
longer face the issue reported in bug #79557.  A very minor additional
advantage is that we no longer have to link against Imagehlp.dll.

Furthermore, there is no need to check for CRT compatibility multiple
times, so we can simplify the signature of `php_win32_crt_compatible`,
and at the same time clean up main.c a bit.

These changes require to change the signature of the exported
`php_win32_image_compatible` and `php_win32_crt_compatible` functions,
which now expect a `HMODULE` and nothing, respectively, instead of the
module name.
2020-09-21 16:25:31 +02:00
Sammy Kaye Powers
12306728c5
Add system ID entropy API
The `zend_system_id` is a (true global) system ID that fingerprints a process state. When extensions add engine hooks during MINIT/startup, entropy is added the system ID for each hook. This allows extensions to identify that changes have been made to the engine since the last PHP process restart.

Closes GH-5871
2020-09-18 14:26:44 -07:00
Levi Morrison
66c3e900e2 Add zend_observer API
Closes GH-5857.

Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
Co-authored-by: Sammy Powers <sammyk@datadoghq.com>
2020-09-01 09:59:59 -06:00
George Peter Banyard
1b2ec73c1d Drop various unused macros/APIs
Also convert_libmagic_pattern() to return a zend_string*

Closes GH-6029
2020-08-26 12:59:43 +02:00
George Peter Banyard
dae83cd7cb Use ZPP callable check for Windows specific functions 2020-08-13 21:14:50 +02:00
Christoph M. Becker
2538e31b58 Fix signature of callback function
Cf. <https://docs.microsoft.com/en-us/windows/win32/api/imagehlp/nc-imagehlp-pimagehlp_status_routine>.
2020-08-10 23:26:54 +02:00
Christoph M. Becker
4293dd5d34 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #79884: PHP_CONFIG_FILE_PATH is meaningless
2020-07-23 15:43:02 +02:00
Christoph M. Becker
3deb6b555a Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79884: PHP_CONFIG_FILE_PATH is meaningless
2020-07-23 15:41:20 +02:00
Christoph M. Becker
15efb96d4c Fix #79884: PHP_CONFIG_FILE_PATH is meaningless
It does not make sense to make assumptions about `PHP_CONFIG_FILE_PATH`
during build time, since that value is never used during run time on
Windows.  Since there is no `--with-config-file-path` on Windows
either, we define `PHP_CONFIG_FILE_PATH` as `""`.
2020-07-23 15:39:22 +02:00
twosee
6e92487f66 Fix warnings of strict-prototypes
Closes GH-5887.
2020-07-23 00:59:00 +08:00
Christoph M. Becker
b31c787401 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix readlink related memory leak
2020-07-16 09:18:45 +02:00
Christoph M. Becker
27bb0d9164 Fix readlink related memory leak 2020-07-16 09:16:48 +02:00
Martin Schröder
547d98b81d Support socketpairs in proc_open()
Closes GH-5777.
2020-07-14 10:35:45 +02:00
Christoph M. Becker
340e2ead77 Export php_gd_libgdimageptr_from_zval_p()
Some extension may need to retrieve the `gdImagePtr` from an `GdImage`
object; thus, we export the respective function.  To not being forced
to include gd.h in php_gd.h, we use the opaque `struct gdImageStruct *`
as return type.

We also rename php_gd2.dll to php_gd.dll, since there's not really much
point in giving the DLL a version number, since there is no php_gd.dll
for years (if there ever has been).  Renaming, on the other hand,
matches the name on other systems (gd.so), and allows to actually use
`ADD_EXTENSION_DEP()`.
2020-07-11 19:33:20 +02:00
Christoph M. Becker
f23bd48892 Don't use deprecated curly brace offset syntax
(cherry picked from commit 7ec3aa1871)

Better safe than sorry in case someone ever builds PHP 7.3 with a
future version of PHP SDK with bundled PHP 8.
2020-07-07 13:55:08 +02:00
Christoph M. Becker
af32f96c23 Merge branch 'PHP-7.4'
* PHP-7.4:
  Don't use deprecated curly brace offset syntax
2020-07-07 13:26:42 +02:00
Christoph M. Becker
7ec3aa1871 Don't use deprecated curly brace offset syntax 2020-07-07 13:24:41 +02:00
Max Semenik
2b5de6f839
Remove proto comments from C files
Closes GH-5758
2020-07-06 21:13:34 +02:00
Christoph M. Becker
6cef9331fd define build system and provider on Windows 2020-07-06 10:54:43 +02:00
Christoph M. Becker
07ff243f07 Fix macro redifinition warnings in debug builds
MSVC considers these warnings[1] to be severe (level 1), so we better
fix the respective code.

[1] <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4005?view=vs-2019>
2020-06-29 19:11:22 +02:00
Christoph M. Becker
68dd6cc92b Control VCRT leak reporting via environment variable in debug builds
Formerly, this had to be enabled by passing the configuration flag
`--enable-crt-debug`; now it can be enabled by setting the environment
variable `PHP_WIN32_DEBUG_HEAP`.  The advantage is that it is no longer
necessary to do separate builds, at the cost of a very minor
performance penalty during process startup.
2020-06-10 09:05:17 +02:00
twosee
88355dd338 Constify char * arguments of APIs
Closes GH-5676.
2020-06-08 10:38:45 +02:00
Christoph M. Becker
3a031e0b03 Drop hard-coded /W3 default in favor of custom CFLAGS
Building with `/W3` shows an awful lot of warnings on Windows, so it's
really hard to spot the more important ones.  Since it is not possible
to override the hard-coded `/W3`, we drop it altogether, so MSVC uses
the default `/W1`.  Users are encouraged to increase the warning level
via the environment variable `CFLAGS` before doing configure.

We also enable `/WX` (treat warnings as errors) for AppVeyor CI, using
`/W1` for now, since otherwise the build would fail.
2020-06-05 11:17:06 +02:00