Commit Graph

2290 Commits

Author SHA1 Message Date
Pierrick Charron
327c95237c
Prepare for PHP 8.3 2022-08-30 11:17:15 -04:00
Christoph M. Becker
c643cbf388
Support test-ini also for phpize builds
Automatically generating and using test INI files is supported for
in-tree build (`buildconf`) for a long time, and this can make sense
for phpize builds too, especially when the build extension is a zend
extension, so it can be properly loaded.

Thus we make `--enable-test-ini` and `--with-test-ini-ext-exclude`
available for phpize, but default to false for full BC.

Closes GH-8787.
2022-08-26 14:25:10 +02:00
dixyes
279a297172
Windows arm64 build system support
Closes GH-9116.
2022-08-09 16:22:14 +02:00
dixyes
02881a76a8
Port win32/codepage.c codes for windows arm64
Closes GH-7702.
2022-07-21 14:02:25 +02:00
David Carlier
bfe6f9e66a Introduction of timing attack safe bcmp implementation.
Nothing new but to refactor usage b/w hash and password
extensions but using volatile pointers to be a bit safer,
allowing to expand its usage eventually.
2022-06-20 16:30:30 +01:00
Christoph M. Becker
8aa7e203ed
Escape problematic characters in CREDITS files
On Windows, the contents of the CREDITS files are passed to rc.exe via
the command line.  To avoid undesired behavior, we need to escape some
characters, most notably `<` (which is sometimes used in CREDITS to
enclose mail addresses), which otherwise is interpreted as redirection
operator, resulting in the hard to understand "The system cannot find
the file specified."

Even more dangerous is not properly escaping percent signs, which makes
it possible for a malicious CREDITS file to inject the values of
environment variables of the build system into the generated binaries.
This is particularly bad, because as of Windows Vista, the comments can
no longer be inspected via explorer.exe, although the binaries still
contain these comments.

We also cater to double-quotes, which need to be escaped as `\"\"` in
this context.

Closes GH-8767.
2022-06-20 16:02:49 +02:00
Christoph M. Becker
7d6821a98a
Remove superfluous snapshot_build_exclusions
These configuration options have been removed, so there is no need to
still cater to them.

Closes GH-8792.
2022-06-18 14:26:51 +02:00
Christoph M. Becker
9e9141f712
Use HTTPS URLs in resource files
Although it is unlikely that anybody ever sees these URLs, since they
are not shown in the file property sheet, it's overdue to switch to
HTTPS.
2022-06-15 17:56:14 +02:00
Levi Morrison
280fd680c8
Make vm_interrupt and timed_out atomic (#8327)
This is done by adding a new zend_atomic_bool type. The type
definition is only available for compiler alignment and size info; it
should be treated as opaque and only the zend_atomic_bool_* family of
functions should be used.

Note that directly using atomic_bool is complicated. All C++ compilers
stdlibs that I checked typedef atomic_bool to std::atomic<bool>, which
can't be used in an extern "C" section, and there's at least one usage
of this in core, and probably more outside of it.

So, instead use platform specific functions, preferring compiler
intrinsics.
2022-06-01 09:43:25 -06:00
Calvin Buckley
2920a26636
Quote when adding to connection string in (PDO_)ODBC
Because the UID= and PWD= values are appended to the SQLDriverConnect
case when credentials are passed, we have to append them to the string
in case users are relying on this behaviour. However, they must be
quoted, or the arguments will be invalid (or possibly more injected).
This means users had to quote arguments or append credentials to the raw
connection string themselves.

It seems that ODBC quoting rules are consistent enough (and that
Microsoft trusts them enough to encode into the .NET BCL) that we can
actually check if the string is already quoted (in case a user is
already quoting because of this not being fixed), and if not, apply the
appropriate ODBC quoting rules.

This is because the code exists in main/, and are shared between
both ODBC extensions, so it doesn't make sense for it to only exist
in one or the other. There may be a better spot for it.

Closes GH-8307.
2022-05-27 16:56:44 +02:00
George Peter Banyard
9f06bb3bb6
Drop remaining usage of u_char in favour of standard C99 uint8_t (#8611)
Plus minor drive-by fixes
2022-05-23 21:57:31 +01:00
George Peter Banyard
de41d6b0ce
I shall never touch anything Windows related 2022-05-22 16:46:33 +01:00
George Peter Banyard
892927eb14
Use proper function prototypes in win32/glob.c
This just confused the hell out of me
2022-05-22 16:34:26 +01:00
George Peter Banyard
265c88b9e7
Don't initialise pointers to zend_stat_t 2022-05-22 16:13:44 +01:00
George Peter Banyard
2ecd46f48f
Initialise zend_stat_t to fix MSAN build 2022-05-22 16:06:27 +01:00
Christoph M. Becker
81d1a1b47b
Update bug tracker links
The new php-src bugtracker is on Github.

Closes GH-8277.
2022-05-12 14:55:11 +02:00
Max Kellermann
d87ba95acd
sapi/*: move duplicate "--define" code to library 2022-04-18 16:52:08 +02:00
George Peter Banyard
2c2ecba063
Determine value of ZEND_MM_* during config and fix sign conversion (#6981)
Also add a new ZEND_MM_NEED_EIGHT_BYTE_REALIGNMENT definition.

This fixes many [-Wsign-conversion] warnings.

Co-authored-by: Guillaume Charifi <guillaume.charifi@sfr.fr>
Co-authored-by: Bob Weinand <bobwei9@hotmail.com>
2022-04-01 15:43:42 +01:00
Christoph M. Becker
9e80947e34
VS 17 == MSVC v143 == Visual Studio 2022 == cl 19.3x 2022-01-08 20:02:28 +01:00
Christoph M. Becker
71b55d7dd8
[ci skip] supportedOs Id for Windows 10 and 11 are the same
Cf. <https://docs.microsoft.com/en-us/windows/win32/sysinfo/targeting-your-application-at-windows-8-1>.
2021-12-27 15:18:47 +01:00
Dmitry Stogov
cddb65b54e Merge branch 'PHP-8.1'
* PHP-8.1:
  Fixed bug #81634 (ZEND_ENABLE_STATIC_TSRMLS_CACHE produces extensionswith the STATIC_TLS flag)
2021-11-24 20:45:09 +03:00
Dmitry Stogov
72f8dbb312 Fixed bug #81634 (ZEND_ENABLE_STATIC_TSRMLS_CACHE produces extensionswith the STATIC_TLS flag) 2021-11-24 20:43:30 +03:00
DmitryMaksimov
2b32cafd88
Use neutral language instead of default on Windows
Most notably, this affects some Windows specific error messages, which
are no longer in the default language of the system, to better match
error messages provided by PHP which are not localized anyway.

This also affects the com_dotnet extension, where it could fix some
DCOM related issues.  Furthermore, the constant `LOCALE_NEUTRAL` is
added, which can be used for `variant_cmp()`.

Closes GH-7613.
2021-11-03 19:39:20 +01:00
Dmitry Stogov
90b7bde615 Use more compact representation for packed arrays.
- for packed arrays we store just an array of zvals without keys.
- the elements of packed array are accessible throuf as ht->arPacked[i]
  instead of ht->arData[i]
- in addition to general ZEND_HASH_FOREACH_* macros, we introduced similar
  familied for packed (ZEND_HASH_PACKED_FORECH_*) and real hashes
  (ZEND_HASH_MAP_FOREACH_*)
- introduced an additional family of macros to access elements of array
  (packed or real hashes) ZEND_ARRAY_ELEMET_SIZE, ZEND_ARRAY_ELEMET_EX,
  ZEND_ARRAY_ELEMET, ZEND_ARRAY_NEXT_ELEMENT, ZEND_ARRAY_PREV_ELEMENT
- zend_hash_minmax() prototype was changed to compare only values

Because of smaller data set, this patch may show performance improvement
on some apps and benchmarks that use packed arrays. (~1% on PHP-Parser)

TODO:
    - sapi/phpdbg needs special support for packed arrays (WATCH_ON_BUCKET).
    - zend_hash_sort_ex() may require converting packed arrays to hash.
2021-11-03 15:18:26 +03:00
Patrick Allaert
a93e12f8a6
Prepare for PHP 8.2 (bis) 2021-09-01 11:09:30 +02:00
Joe Watkins
00c668a15d
Drop TsHashTable (#7351) 2021-08-08 10:45:44 +02:00
Patrick Allaert
aff365871a Fixed some spaces used instead of tabs 2021-06-29 11:30:26 +02:00
Patrick Allaert
ceb6fa6dc0 Convert some recently introduced zend_bool to bool
As well as `scripts/dev/check_parameters.php` utility.

Cfr. 3e01f5afb1
2021-06-18 15:21:39 +01:00
Christoph M. Becker
16feae57a1
Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix #81120: PGO data for main PHP DLL are not used
2021-06-10 22:58:18 +02:00
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
Nikita Popov
7db146eea7
Remove "inline" defines on Windows (#7071)
Newer MSVC versions support the `inline` keyword, so we do not need to explicitly define it. We also shouldn't define `inline` to `__forceinline`, as we already have `zend_always_inline` to indicate this requirement.
2021-05-31 10:05:18 +02:00
twosee
9066d695e9
Remove all *_EXTERN_C() in C source files (#7054) 2021-05-27 15:52:54 +08: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
Aaron Piotrowski
c276c16b66
Implement Fibers
RFC: https://wiki.php.net/rfc/fibers

Closes GH-6875.
2021-04-26 11:07:06 -05:00
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