1
0
mirror of https://github.com/php/php-src.git synced 2026-03-30 20:22:36 +02:00
Commit Graph

536 Commits

Author SHA1 Message Date
Christoph M. Becker
9bae8933a3 Fix GH-16991: Getting typeinfo of non DISPATCH variant segfaults
We must not assume that any `VARIANT` implements `IDispatch`.

Closes GH-16992.
2024-11-29 16:29:11 +01:00
Christoph M. Becker
1ee56bdd5a Fix out of bound writes to SafeArray data
Converting PHP arrays to Variants originally supported almost arbitrary
numeric arrays, possibly filling gaps with NULL values.  This is broken
as of PHP 7.0.0[1] so that the SafeArray only has as many elements as
the PHP array.  Thus, unless the array is a list, some elements may be
written outside of the SafeArray data.

To avoid breaking userland code after that long time, we do not restore
the original behavior, but instead only suppress the erroneous writes.

To avoid the need to split the regression test for 32bit and 64bit
Windows, we suppress the "max number 4294967295 of elements in safe
array exceeded" warning, which only occurs for 64bit versions.

[1] <c865472ef0>

Closes GH-16309.
2024-10-09 21:14:44 +02:00
Niels Dossche
98288a27bc Skip .NET tests if mscoree is not available (#14281) 2024-05-20 23:26:52 +02:00
Peter Kokot
218a93b898 Use EXTENSIONS instead of SKIPIF sections in *.phpt
This also fixes skipped tests due to different naming "zend-test"
instead of "zend_test" and "PDO" instead of "pdo":

- ext/dom/tests/libxml_global_state_entity_loader_bypass.phpt
- ext/simplexml/tests/libxml_global_state_entity_loader_bypass.phpt
- ext/xmlreader/tests/libxml_global_state_entity_loader_bypass.phpt
- ext/zend_test/tests/observer_sqlite_create_function.phpt

EXTENSIONS section is used for the Windows build to load the non-static
extensions.

Closes GH-13276
2024-01-31 11:18:21 +01:00
Bob Weinand
a01dd9feda Revert "Port all internally used classes to use default_object_handlers"
This reverts commit 94ee4f9834.

The commit was a bit too late to be included in PHP 8.2 RC1. Given it's a massive ABI break, we decide to postpone the change to PHP 8.3.
2022-09-14 11:13:23 +02:00
Bob Weinand
94ee4f9834 Port all internally used classes to use default_object_handlers
Signed-off-by: Bob Weinand <bobwei9@hotmail.com>
2022-08-31 16:45:27 +02:00
Máté Kocsis
b4ec3e9bc0 Do not generate CONST_CS when registering constants (#9439) 2022-08-28 08:27:19 +02:00
Máté Kocsis
e328c68305 Rename @cname to @cvalue in stubs (#9043)
@cname currently refers to the constant name in C. However, it is not always a (constant) name, but sometimes a function invocation, so naming it as @cvalue would be more appropriate.
2022-07-19 15:11:42 +02:00
Christoph M. Becker
56804e3221 Fix GH-8750: Can not create VT_ERROR variant type
We add support for creating `VT_ERROR` variants via `__construct()`,
and allow casting to int via `variant_cast()` and `variant_set_type()`.
We do not, however, allow type conversion by other means, to avoid
otherwise easily introduced type confusion.  VB(A) also only allows
explicit type conversion.

We also introduce `DISP_E_PARAMNOTFOUND` which might be the most
important `scode` for this purpose, since this allows to skip optional
parameters in method calls.

Closes GH-8886.
2022-07-12 16:43:14 +02:00
Christoph M. Becker
84c160dd90 Increase test portability
The test as is can only work if com_dotnet is built dynamically, and
not already loaded via the php.ini file.  While this is given on
AppVeyor, it may not be given in other environments.

Closes GH-8879.
2022-06-27 17:12:42 +02:00
Ilija Tovilo
3b92a96610 Convert return type of various object handlers from int to zend_result (#8755) 2022-06-26 01:00:19 +02:00
Christoph M. Becker
790be97fc9 Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix GH-8778: Integer arithmethic with large number variants fails
2022-06-18 11:51:52 +02:00
Christoph M. Becker
5869e8a0ca Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-8778: Integer arithmethic with large number variants fails
2022-06-18 11:50:14 +02:00
Christoph M. Becker
651e0cc187 Fix GH-8778: Integer arithmethic with large number variants fails
When casting a `variant` to `int`, we need to heed the proper `zval`
type, which is an signed 64bit integer on x64, while `VT_INT` is only
a signed 32bit integer.

Closes GH-8779.
2022-06-18 11:48:49 +02:00
Pierrick Charron
1bcd8d394a Update gen_stub to support #if around classes 2022-06-13 16:34:12 -04:00
Pierrick Charron
6fd2b39397 Indent with TAB in .h files generated by gen_stub 2022-06-13 08:55:54 -04:00
Máté Kocsis
7d6ce85aa9 Declare ext/com_dotnet constants in stubs (#8675) 2022-06-06 15:56:24 +02:00
Christoph M. Becker
057737c92f Merge branch 'PHP-8.1'
* PHP-8.1:
  Prevent strict interpretation of tentative definition
2021-12-26 16:43:34 +01:00
Christoph M. Becker
0cd1741004 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Prevent strict interpretation of tentative definition
2021-12-26 16:42:33 +01:00
Christoph M. Becker
e76ddbd2f6 Prevent strict interpretation of tentative definition
This header declaration is never supposed to be interpreted as
definition; otherwise, the handlers are not properly initialized, what
happens, for instance, with ASan instrumented MSVC builds.

Closes GH-7827.
2021-12-26 16:41:25 +01:00
George Peter Banyard
f6616846e1 Revert "Refactor php_com_cache_typelib()"
As php_com_typelibraries is a persistent HashTable we need to insert
a persistent string, therefore initialising a new one.

This reverts commit 0497b2bf4b.
2021-11-03 20:44:12 +00: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
George Peter Banyard
0497b2bf4b Refactor php_com_cache_typelib() 2021-11-03 17:58:18 +00:00
George Peter Banyard
da012ba324 Refactor php_com_locate_typeinfo()
Use zend_string pointers
Use bool
2021-09-29 13:17:20 +01:00
George Peter Banyard
816d4ac7a8 Voidify php_com_saproxy_create() 2021-09-29 13:17:20 +01:00
George Peter Banyard
68702b7e78 Voidify php_com_persist_minit() 2021-09-29 13:17:19 +01:00
George Peter Banyard
bc8703d861 Use standard bool/zend_result instead of int 2021-09-29 13:17:16 +01:00
George Peter Banyard
9409c8f11b Refactor php_com_olestring_to_string()
Return a zend_string* instead of a char* with an out-param for the length
2021-09-29 13:16:26 +01:00
George Peter Banyard
3dc4863f2b Refactor php_com_get_id_of_name()
Use zend_string*
2021-09-29 13:11:51 +01:00
George Peter Banyard
f3ca081379 Refactor php_com_do_invoke()
Use zend_string*
Return zend_result
2021-09-29 13:11:50 +01:00
Máté Kocsis
ad471fb22d Merge branch 'PHP-8.1'
* PHP-8.1:
  Remove extra space before param default values
  Fix class synopsis generation for interfaces
2021-09-08 12:25:13 +02:00
Máté Kocsis
a5e5483439 Remove extra space before param default values 2021-09-08 12:24:47 +02:00
Nikita Popov
768265cd22 Fix some more CLEAN sections 2021-09-06 17:03:35 +02:00
DmitryMaksimov
bdf53cc91f Dispatch using LANG_NEUTRAL instead of LOCALE_SYSTEM_DEFAULT
This is relevant wrt. case insensitive identifiers.

Closes GH-7391.
2021-08-23 14:07:23 +02:00
Máté Kocsis
2378f35787 Use single line phpdoc in stubs where possible 2021-07-20 13:16:56 +02:00
Joe Watkins
570d9b63e9 Not serializable flag permeation 2021-07-20 12:28:35 +02:00
Patrick Allaert
aff365871a Fixed some spaces used instead of tabs 2021-06-29 11:30:26 +02:00
Christoph M. Becker
139a73b5a4 Improve performance of AppVeyor test runs
We only load a minimum set of extensions, and rely on dynamic loading
of others due to `--EXTENSION--` triggers.  We do not run the imap,
ldap and snmp test suites, because most of the tests would be skipped
after timeouts anyway.

Closes GH-7150.
2021-06-14 23:36:17 +02:00
Máté Kocsis
532c60cb92 Add support for tentative return types of internal methods
RFC: https://wiki.php.net/rfc/internal_method_return_types

Closses GH-6971
2021-05-14 15:55:25 +02: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
Max Semenik
56f90492d6 Migrate skip checks to --EXTENSIONS--, p1
For rationale, see https://github.com/php/php-src/pull/6787

Extensions migrated in this part:
* bcmath
* bz2
* calendar
* com_dotnet
* ctype

Closes GH-6797.
2021-03-22 17:51:02 +01:00
George Peter Banyard
a74e248c43 Use zend_string_equals() API instead of strcmp() in COM extension 2021-03-17 16:36:16 +00:00
Máté Kocsis
4c6533c257 Generate class entries from stubs for com, standard, xmlreader, xmlwriter, xsl, zip, Zend
Closes GH-6706
2021-02-22 15:24:03 +01:00
Christoph M. Becker
062a891be7 Merge branch 'PHP-8.0'
* PHP-8.0:
  Add missing stub for com_exception
2021-01-24 16:07:34 +01:00
Christoph M. Becker
bff7761653 Add missing stub for com_exception 2021-01-24 16:06:49 +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
Christoph M. Becker
807775b641 Fix COMPersistHelper::__construct() stub
`$variant` is optional.
2020-11-24 00:23:29 +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
Christoph M. Becker
2da00fadc8 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #62474: com_event_sink crashes on certain arguments
2020-10-26 11:55:29 +01:00
Christoph M. Becker
f9ba2ca136 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #62474: com_event_sink crashes on certain arguments
2020-10-26 11:54:45 +01:00