Commit Graph

2242 Commits

Author SHA1 Message Date
Christoph M. Becker
21f2ff79de
Fix #81120: PGO data for main PHP DLL are not used
We need to look for the right file.  To avoid total confusion, we also
rename the variables; however, the right solution would have been to
drop the version suffixes, since they don't help (major + minor maybe,
but not major only).
2021-06-10 22:57:09 +02: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
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
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
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
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
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
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
Christoph M. Becker
5a04796f76 Fix MSVC level 1 (severe) warnings
We fix (hopefully) all instances of:

* <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4005>
* <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4024>
* <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4028>
* <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4047>
* <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4087>
* <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4090>
* <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4273>
* <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4312>

`zend_llist_add_element()` and `zend_llist_prepend_element()` now
explicitly expect a *const* pointer.

We use the macro `ZEND_VOIDP()` instead of a `(void*)` cast to suppress
C4090; this should prevent accidential removal of the cast by
clarifying the intention, and makes it easier to remove the casts if
the issue[1] will be resolved sometime.

[1] <https://developercommunity.visualstudio.com/content/problem/390711/c-compiler-incorrect-propagation-of-const-qualifie.html>
2020-06-05 11:17:05 +02:00
Benjamin Eberlei
a7908c2d11 Add Attributes
Co-authored-by: Martin Schröder <m.schroeder2007@gmail.com>
2020-06-04 18:19:49 +02:00
Christoph M. Becker
6b769a3dc6 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix PVS-Studio integration
2020-05-28 15:35:47 +02:00
Christoph M. Becker
8068fad481 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix PVS-Studio integration
2020-05-28 15:34:09 +02:00
Christoph M. Becker
744f9016c4 Fix PVS-Studio integration
Without this configuration option, PVS-Studio looks for preprocessed
files (*.i), but these do not exists.
2020-05-28 15:23:37 +02:00
Christoph M. Becker
ca6dd7e984 Fix --disable-ipv6 support on Windows
`HAVE_IPV6` and `HAVE_GAI_STRERROR` are supposed to be undefined now,
if not supported.
2020-05-20 15:13:53 +02:00
Christoph M. Becker
4631b4e813 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #79557: extension_dir = ./ext now use current directory for base
2020-05-15 09:24:07 +02:00
Christoph M. Becker
8c6d006b55 Fix #79557: extension_dir = ./ext now use current directory for base
For some reason, `ImageLoad()` fails to load images with a relative
path starting with `.\`  or `./`.  We work around this issue by
stripping those leading characters.
2020-05-15 09:23:18 +02:00
Christoph M. Becker
f6ae728f56 Remove unused variable 2020-05-14 17:55:31 +02:00
George Peter Banyard
8d346f7679 Use ZPP int|string and add ValueError for Windows codepages
Closes GH-5517
2020-05-04 12:44:54 +02:00
Christoph M. Becker
54cf9a26c1 Use libenchant2 if available on Windows
This is basically the same as commit 3427545[1], but for Windows.

[1] <http://git.php.net/?p=php-src.git;a=commitdiff;h=342754575237da912874f781a24eefe76434ce5a>
2020-05-04 11:27:00 +02:00
Christoph M. Becker
38ecfe0245 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #79532: sizeof off_t can be wrong
2020-04-29 10:43:35 +02:00
Christoph M. Becker
67f9b0b754 Fix #79532: sizeof off_t can be wrong
We have to actually determine the proper `SIZEOF_OFF_T`.
Interestingly, it is `4` on Windows x64.

We also have to prevent the redefinition in pg_config.h.  The clean
solution would likely be to not include pg_config.h at all, but that's
out of scope for BC reasons for now.
2020-04-29 10:40:59 +02:00
Christoph M. Becker
e2f1586225 Add gen_stub.php to devel pack 2020-04-26 12:33:33 +02:00