1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

166 Commits

Author SHA1 Message Date
Weilin Du
4f793ba1c3 [skip ci] Fix duplicate words typos (GH-20800) 2025-12-31 02:22:09 +01:00
Gina Peter Banyard
77d306ef38 win32/sendmail.c/PostHeader(): refactor function
Input as zend_string
Use smart_str to concatenate strings
Change return type to bool
2025-12-27 00:36:26 +00:00
Gina Peter Banyard
fc276aee68 win32/sendmail.c/SendText(): use zend_string for stripped_headers
This prevents some copying and is in preparation of other refactoring preventing strlen() recomputations
2025-12-27 00:36:26 +00:00
Gina Peter Banyard
8aa64bb976 win32/sendmail.c/SendText(): move posting of DATA prior to stripped header computation
Removes some error handling and work if it fails
2025-12-27 00:36:26 +00:00
Gina Peter Banyard
004c630106 win32/sendmail.c/addToHeader(): voidify function
It always returns 1 and thus a bunch of error handling code is useless
2025-12-27 00:36:26 +00:00
Gina Peter Banyard
6bd9c555ee win32/sendmail.c/SendText(): move string duplication code to a more logical place 2025-12-27 00:36:26 +00:00
Gina Peter Banyard
f1a8944fcd win32/sendmail.c/SendText(): use zend_string* for headers{_lc} parameters
This prevents some strlen() reconputations
2025-12-27 00:36:26 +00:00
Gina Peter Banyard
84e63bfd9b win32/sendmail.c/php_win32_mail_trim_header(): use ZSTR_INIT_LITERAL() 2025-12-27 00:36:26 +00:00
Gina Peter Banyard
4431aa94b7 win32/sendmail.c: remove mailCc parameter that is always NULL 2025-12-27 00:36:26 +00:00
Gina Peter Banyard
0e19bc1bfd win32/sendmail.c: remove mailBbc parameter that is always NULL 2025-12-27 00:36:26 +00:00
Gina Peter Banyard
6f28370d2f win32/sendmail.c: remove mailRPath parameter that is always NULL 2025-12-27 00:36:26 +00:00
Gina Peter Banyard
4dad723c41 win32/sendmail.c/Post(): refactor function
Change return type to bool as it only ever returns two values
2025-12-27 00:36:26 +00:00
Gina Peter Banyard
7e8c636b30 win32/sendmail.c: mark error messages array as const 2025-12-27 00:36:26 +00:00
Christoph M. Becker
4e6a3cecf5 Don't forward declare static functions in sendmail.h (GH-17684)
sendmail.h is not only included by sendmail.c, but also by
php_win32_globals.h, because that header uses some of the defined
macros.  However, the forward declarations of the static functions are
not needed anywhere else than in sendmail.c, and Clang warns about the
unused functions elsewhere (`-Wunused-function`).  Thus we move the
forward declarations to sendmail.c.
2025-02-03 16:50:32 +01:00
Christoph M. Becker
3fa9e283a0 Drop unused local variables (GH-17682) 2025-02-03 16:42:29 +01:00
Christoph M. Becker
c264679fb4 Remove braces around string initializers (#GH-17451)
While MSVC is apparently fine with that, Clang complains about it (`-Wbraced-scalar-init`).
2025-01-12 19:40:15 +01:00
Christoph M. Becker
d98c4b6ebe Fix comments in win32/sendmail.c (GH-15326)
These use a mixed style of block and line comments, and clang warns
about this (`-Wcomment`), so we fix that.
2024-08-10 13:59:06 +02:00
Niels Dossche
26fcb5f2b2 win32: change uses of sprintf into snprintf 2024-06-14 08:12:03 -07:00
Jorg Sowa
9c4beac8d3 Remove inet_aton
This removes the deprecated inet_aton and its Windows implementation.
The inet_aton can be replaced with platform agnostic inet_pton.

Closes GH-13479
2024-02-23 23:16:43 +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
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
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
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
twosee
6e92487f66 Fix warnings of strict-prototypes
Closes GH-5887.
2020-07-23 00:59:00 +08:00
twosee
88355dd338 Constify char * arguments of APIs
Closes GH-5676.
2020-06-08 10:38:45 +02:00
Máté Kocsis
afdaa91170 Fix #78880: Final spelling fixes 2020-01-16 19:14:31 +01:00
Máté Kocsis
c3cf01b553 Fix #78880: Yet another batch of spelling errors 2020-01-16 12:04:00 +01:00
Máté Kocsis
0b4778c377 Fix #78880: Another bunch of spelling errors 2020-01-16 09:46:47 +01:00
Christoph M. Becker
5d3be966f9 Use proper printf() specifiers 2020-01-15 18:18:36 +01:00
Stanislav Malyshev
d9f57e8316 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #78910
  Fix #78878: Buffer underflow in bc_shift_addsub
  Fix test
  Fix #78862: link() silently truncates after a null byte on Windows
  Fix #78863: DirectoryIterator class silently truncates after a null byte
  Fix #78943: mail() may release string with refcount==1 twice
2019-12-16 00:39:37 -08:00
Christoph M. Becker
518a160b65 Fix #78943: mail() may release string with refcount==1 twice
Since we need `headers_lc` as well as `headers_trim` in the following,
we do not release the former even if they are the same string, to avoid
complicating the release logic even more.

A new test case is not necessary, since we already have
mail_basic_alt2-win32.phpt and others.
2019-12-15 13:13:30 -08:00
Sebastian Jennen
a2b2aaa67a file encoding cleanup: remove bom in win32 files
These two files have been: "UTF-8 Unicode (with BOM) text".
By applying `dos2unix` on these files the BOM has been removed.

I checked the whole source code with dos2unix:
These were the only two text files affected.
2019-07-27 10:12:54 +02:00
Peter Kokot
9219e56063 Remove redundant memory.h file
The memory.h file is part of the pre-C89 era and is on today's systems
only a simple wrapper for including the final string.h header file.
2019-05-11 19:47:54 +02:00
Stanislav Malyshev
f7d59844e1 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #77821: Potential heap corruption in TSendMail()
2019-04-29 22:09:15 -07:00
Stanislav Malyshev
506a764089 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #77821: Potential heap corruption in TSendMail()
2019-04-29 22:09:10 -07:00
Stanislav Malyshev
2c3933821f Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix #77821: Potential heap corruption in TSendMail()
2019-04-29 22:09:04 -07:00
Christoph M. Becker
6c631ccfef Fix #77821: Potential heap corruption in TSendMail()
`zend_string_tolower()` returns a copy (not a duplicate) of the given
string, if it is already in lower case.  In this case we must not not
`zend_string_free()` both strings.  The cleanest solution is to call
` zend_string_release()` on both strings, which properly handles the
refcount.
2019-04-29 22:08:19 -07:00
Peter Kokot
92ac598aab Remove local variables
This patch removes the so called local variables defined per
file basis for certain editors to properly show tab width, and
similar settings. These are mainly used by Vim and Emacs editors
yet with recent changes the once working definitions don't work
anymore in Vim without custom plugins or additional configuration.
Neither are these settings synced across the PHP code base.

A simpler and better approach is EditorConfig and fixing code
using some code style fixing tools in the future instead.

This patch also removes the so called modelines for Vim. Modelines
allow Vim editor specifically to set some editor configuration such as
syntax highlighting, indentation style and tab width to be set in the
first line or the last 5 lines per file basis. Since the php test
files have syntax highlighting already set in most editors properly and
EditorConfig takes care of the indentation settings, this patch removes
these as well for the Vim 6.0 and newer versions.

With the removal of local variables for certain editors such as
Emacs and Vim, the footer is also probably not needed anymore when
creating extensions using ext_skel.php script.

Additionally, Vim modelines for setting php syntax and some editor
settings has been removed from some *.phpt files.  All these are
mostly not relevant for phpt files neither work properly in the
middle of the file.
2019-02-03 21:03:00 +01:00
Gabriel Caruso
84b195d9fc Fix some misspellings 2018-08-12 16:15:45 +02:00
Peter Kokot
8d3f8ca12a Remove unused Git attributes ident
The $Id$ keywords were used in Subversion where they can be substituted
with filename, last revision number change, last changed date, and last
user who changed it.

In Git this functionality is different and can be done with Git attribute
ident. These need to be defined manually for each file in the
.gitattributes file and are afterwards replaced with 40-character
hexadecimal blob object name which is based only on the particular file
contents.

This patch simplifies handling of $Id$ keywords by removing them since
they are not used anymore.
2018-07-25 00:53:25 +02:00
Anatol Belski
3e1e3ab728 Remove conflicting declaration 2018-07-09 12:32:45 +02:00
Dmitry Stogov
5eb1f92f31 Use zend_string_release_ex() instread of zend_string_release() in places, where we sure about string persistence. 2018-05-28 16:27:12 +03:00
Gabriel Caruso
2d48d734a2 Fix some misspellings 2018-02-06 16:59:00 +01:00