Commit graph

900 commits

Author SHA1 Message Date
Ilija Tovilo
94c1e559f9
Merge branch 'PHP-8.3'
* PHP-8.3:
  Implement diagnostic ignore macro for Clang
2023-10-18 17:38:12 +02:00
Ilija Tovilo
80b4c73030
Implement diagnostic ignore macro for Clang
Newer versions of Clang now also complain about -Wscript-prototypes for included
headers.

Closes GH-12467
2023-10-18 17:37:15 +02:00
Ilija Tovilo
f39b5c4c25
Close PHP tags in tests
Closes GH-12422
2023-10-18 17:34:10 +02:00
Niels Dossche
4863d93c96 Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix GH-11630: proc_nice_basic.phpt only works at certain nice levels
  Fix GH-11629: bug77020.phpt tries to send mail
  Fix GH-11625: DOMElement::replaceWith() doesn't replace node with DOMDocumentFragment but just deletes node or causes wrapping <></> depending on libxml2 version
2023-07-10 13:42:44 +02:00
Niels Dossche
57ff1c354e Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix GH-11630: proc_nice_basic.phpt only works at certain nice levels
  Fix GH-11629: bug77020.phpt tries to send mail
  Fix GH-11625: DOMElement::replaceWith() doesn't replace node with DOMDocumentFragment but just deletes node or causes wrapping <></> depending on libxml2 version
2023-07-10 13:34:21 +02:00
Niels Dossche
06d87e4c14 Fix GH-11629: bug77020.phpt tries to send mail
Closes GH-11636.
2023-07-10 13:29:49 +02:00
Michael Orlitzky
893ca537b0
ext/imap/tests/*mutf7*.phpt: update for missing utf8_to_mutf7() (#11654)
Our ./configure script (ext/imap/config.m4) checks for the
utf8_to_mutf7() function in the c-client library, and defines
HAVE_IMAP_MUTF7 only if it exists. The two corresponding PHP
functions are disabled when it does not, but their tests do
not account for that. Here we add two SKIPIFs to hand that
scenario.
2023-07-10 09:43:07 +01:00
George Peter Banyard
6c25257db0 ext/imap: Refactor common conditional property assignment
By introducing new functions and doing some preprocessor black magic
2023-06-18 13:05:02 +01:00
George Peter Banyard
cc9ab53308 ext/imap: Narrow return type to true
Those functions always return true as of PHP 8.0.
2023-06-18 13:05:02 +01:00
George Peter Banyard
d714ae8964 ext/imap: Refactor imap_fetch_overview()
Reduce level of indentations by using early guards to return/continue
2023-06-18 13:05:02 +01:00
George Peter Banyard
b1f24e3bea ext/imap: Add const qualifier for header_injection()
Also reformat long if condition to make it clearer
2023-06-18 13:05:02 +01:00
George Peter Banyard
b1dd9b8a39 ext/imap: Do not condition on number of arguments but on pointer being set or not 2023-06-18 13:05:02 +01:00
George Peter Banyard
0b99bc21e5 ext/imap: Cleanup custom implementation of rfc822_write_address()
This is used only when c-client does not have this feature, maybe this is something we should asume nowadays?
2023-06-18 13:05:02 +01:00
George Peter Banyard
9798dc20e2 ext/imap: Use propery API instead of php_imap_hash_add_object()
It was only ever used to update an object property table and never an associative array.
2023-06-18 13:05:02 +01:00
George Peter Banyard
5d0304876f ext/imap: Remove php_imap_list_add_object() function
The symtable was always an array so use appropriate HashTable API
2023-06-18 13:05:02 +01:00
George Peter Banyard
85a4a80da3
ext/imap: Refactor + Update to modern property write API (#11415)
Use common functions for creating and setting up similar objects

The increase in verbosity compared to the ``add_property_*()`` version is somewhat unfortunate, but the behaviour of ``add_property_str()`` releasing the zend_string is suboptimal, confusing, and has me concerned.
2023-06-14 05:50:23 +01:00
Ilija Tovilo
50f58c8923
Add ASAN XLEAK support
Only disable LSAN instead of skipping the test. This way we can still detect
memory issues which is arguably more important anyway.

Closes GH-10996
2023-04-03 08:02:19 +02:00
George Peter Banyard
dfae7f9835
Merge branch 'PHP-8.2'
* PHP-8.2:
  ext/imap/config.m4: -Werror=implicit-function-declaration compatibility.
2023-03-28 15:20:03 +01:00
George Peter Banyard
0ff059c553
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  ext/imap/config.m4: -Werror=implicit-function-declaration compatibility.
2023-03-28 15:19:43 +01:00
Michael Orlitzky
f9cbeaa033
ext/imap/config.m4: -Werror=implicit-function-declaration compatibility.
The recent clang-16 throws errors for implicitly defined functions by
default. In many ./configure tests, an undefined function (which is
"implicitly defined" when you try to call it) is undefined because it
really does not exist. But in one case, utf8_to_mutf7() is undefined
because we forgot to include the header that defines it.

This commit updates the test for utf8_to_mutf7:

  * We now include the header (c-client.h) that defines it.
  * A "checking... yes/no" message was added to the test.
  * The test was switched from PHP_IMAP_TEST_BUILD to AC_COMPILE_IFELSE.
    This was the easiest way to avoid a return-type mismatch that runs
    afoul of -Werror=implicit-int.
  * CPPFLAGS is temporarily amended with the -I flag needed to find
    c-client.h.

Fixes GH-10947.

Closes GH-10948

Signed-off-by: George Peter Banyard <girgias@php.net>
2023-03-28 15:18:18 +01:00
Ilija Tovilo
9d5f2f1343
Use new ZSTR_INIT_LITERAL macro (#10879) 2023-03-20 16:19:05 +01:00
Ilija Tovilo
d98963a071
Switch to Ubuntu 22.04 for GitHub actions jobs
Closes GH-10814
2023-03-10 00:17:23 +01:00
Máté Kocsis
7936c8085e
Fix GH-8329 Print true/false instead of bool in error and debug messages (#8385) 2023-01-23 10:52:14 +01:00
George Peter Banyard
4a365132e7
Merge branch 'PHP-8.2'
* PHP-8.2:
  Add a new imap_is_open() function to check that a connection object is still valid
2022-12-13 23:48:48 +00:00
George Peter Banyard
52a891aeaa
Add a new imap_is_open() function to check that a connection object is still valid 2022-12-13 23:48:03 +00:00
Christoph M. Becker
e4ef394c6b
Drop superfluous check for imap_stream
`GET_IMAP_STREAM` already checks whether `.imap_stream` is `NULL`, and
bails out in that case.

Closes GH-10053.
2022-12-06 11:01:18 +01:00
Máté Kocsis
e733ebf30e
Add parenthesis around preprocessor conditions in stubs
gen_stub.php concatenates nested #ifs into one #if so let's make sure the semantics remain the same.
2022-09-02 16:21:28 +02:00
Máté Kocsis
b4ec3e9bc0
Do not generate CONST_CS when registering constants (#9439) 2022-08-28 08:27:19 +02:00
Christoph M. Becker
e885831670
Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix GH-9309: Segfault when connection is used after imap_close()
2022-08-12 16:25:46 +02:00
Christoph M. Becker
71c22efae7
Fix GH-9309: Segfault when connection is used after imap_close()
We actually need to check whether `php_imap_object.imap_stream` is
`NULL` to detect that the connection has already been closed.

Closes GH-9313.
2022-08-12 16:24:30 +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
Eric Norris
09237f6126
Update request startup error messages 2022-07-18 23:19:59 +01:00
Remi Collet
55a88f36b6
add SensitiveParameter as known string and use it in arginfo 2022-07-18 11:43:33 +02:00
Tim Düsterhus
342e18f105
Support the actual #[\SensitiveParameter] attribute in stubs (#8836) 2022-07-12 12:43:44 +02:00
Pierrick Charron
6fd2b39397
Indent with TAB in .h files generated by gen_stub 2022-06-13 08:55:54 -04:00
Tim Düsterhus
176a484df2 Mark parameter in ext/imap as sensitive 2022-06-13 11:09:12 +02:00
Máté Kocsis
e7d482d896
Declare ext/imap constants in stubs (#8715) 2022-06-06 13:08:32 +02:00
Christoph M. Becker
d2bb59cc66
Test standard mail and imap on Windows CI
We setup the currently latest version of hMailServer[1] as mail server,
and configure according to imap_include.inc.  To not require further
configuration, we adapt mail_skipif.inc and mail_include.inc to match
that configuration.  However, we also change the default domain to the
reserved `example.com`.

We also update the standard mail tests to use the `--EXTENSIONS--`
section (instead of skipping the tests if ext/imap is not available).

Finally, we fix bug80751.phpt to expect the configured To and Cc mail
addresses.

[1] <https://www.hmailserver.com/>

Closes GH-8357.
2022-05-12 14:58:22 +02:00
Christoph M. Becker
80f18665e4
Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix #81649: imap_(un)delete accept sequences, not single numbers
2021-11-25 18:31:29 +01:00
Christoph M. Becker
df5e95b4d1
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix #81649: imap_(un)delete accept sequences, not single numbers
2021-11-25 18:31:14 +01:00
Christoph M. Becker
179030d167
Fix #81649: imap_(un)delete accept sequences, not single numbers
As such, the parameter name `$message_num` is utmost misleading; it
should be `$message_nums` as for other functions.

Closes GH-7686.
2021-11-25 18:29:43 +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
Nikita Popov
2a4dba7b14 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix maybe-uninitialized warning
2021-08-17 12:27:39 +02:00
Nikita Popov
b66168e86b Fix maybe-uninitialized warning
Some GCC versions don't like zend_try in loop. Avoid the issue
by pulling it out of the loop, we don't particularly care about
skipping further warnings if a bailout occurs, just that it
does not interrupt shutdown.

Closes GH-7380.
2021-08-17 12:27:32 +02:00
Nikita Popov
f603934a5e Merge branch 'PHP-8.0'
* PHP-8.0:
  Prevent bailout during imap shutdown error reporting
2021-08-17 10:35:16 +02:00
Nikita Popov
85eafc31e8 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Prevent bailout during imap shutdown error reporting
2021-08-17 10:35:07 +02:00
Nikita Popov
bcc2f0705d Prevent bailout during imap shutdown error reporting
This is a non-intrusive, minimal fix for bug #81316, which prevents
a bailout during imap RSHUTDOWN and prevents the basic shutdown
handler from being skipped.

I wasn't able to make the issue reproduce in a small test.
2021-08-17 10:33:39 +02:00
Kamil Tekiela
cd0cd3d31e
Fix typos (#7327) 2021-08-01 18:03:30 +01:00
Máté Kocsis
663536d7d9
Improve class inheritance error messages (#7307) 2021-07-27 09:42:37 +02:00
Máté Kocsis
2378f35787
Use single line phpdoc in stubs where possible 2021-07-20 13:16:56 +02:00