Commit Graph

217 Commits

Author SHA1 Message Date
Gina Peter Banyard
25a5146180
Clean-up unused headers (#14365)
* ext/mbstring.c: clean-up headers and include intrinsics
2024-06-01 17:12:42 +01:00
Gina Peter Banyard
48d5ae98e7
ext/standard: Refactor exec.c public APIs to use zend_string pointers (#14353)
* Pull zend_string* from INI directive

* Ensure that mail.force_extra_parameters INI directive does not have any nul bytes

* ext/standard: Make php_escape_shell_cmd() take a zend_string* instead of char*

This saves on an expensive strlen() computation

* Convert E_ERROR to ValueError in php_escape_shell_cmd()

* ext/standard: Make php_escape_shell_arg() take a zend_string* instead of char*

This saves on an expensive strlen() computation

* Convert E_ERROR to ValueError in php_escape_shell_arg()
2024-05-29 10:59:17 +01:00
Cristian Rodríguez
8e62e2b829
Mark multple functions as static (#13864)
* Mark many functions as static

Multiple functions are missing the static qualifier.

* remove unused struct sigactions

struct sigaction act, old_term, old_quit, old_int;
all unused.

* optimizer: minXOR and maxXOR are unused
2024-05-22 13:11:46 +02:00
Saki Takamachi
04eeaa0bc7
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Added validation of `\n` in $additional_headers of mail()
2024-03-04 21:30:27 +09:00
Saki Takamachi
04e8e55f47
Added validation of \n in $additional_headers of mail()
When $additional_headers of mail() is an array, the same validation as
`\r\n` is now applied to `\n` alone too.
2024-03-04 21:30:07 +09:00
Niels Dossche
3ab6e76ed8 Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix GH-10983: State-dependant segfault in ReflectionObject::getProperties
  Fix GH-10990: mail() throws TypeError after iterating over $additional_headers array by reference
  Fix GH-8841: php-cli core dump calling a badly formed function
2023-04-01 20:23:57 +02:00
Niels Dossche
0d12b3db64 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix GH-10990: mail() throws TypeError after iterating over $additional_headers array by reference
  Fix GH-8841: php-cli core dump calling a badly formed function
2023-04-01 20:04:48 +02:00
Niels Dossche
79c5b32d15 Fix GH-10990: mail() throws TypeError after iterating over $additional_headers array by reference
We should dereference the values, otherwise references don't work.

Closes GH-10991.
2023-04-01 19:44:43 +02: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
Jakub Zelenka
cc931af35d
Fix GH-8086: Introduce mail.mixed_lf_and_crlf INI
When this INI option is enabled, it reverts the line separator for
headers and message to LF which was a non conformant behavior in PHP 7.
It is done because some non conformant MTAs fail to parse CRLF line
separator for headers and body.

This is used for mail and mb_send_mail functions.
2023-01-19 19:05:39 +00:00
George Peter Banyard
5171cb435a Fix [-Wundef] warnings in standard extension 2022-04-01 15:48:41 +01:00
Christoph M. Becker
79bf39e917
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-7875: mails are sent even if failure to log throws exception
2022-01-17 22:32:37 +01:00
Christoph M. Becker
478edcdacb
Fix GH-7875: mails are sent even if failure to log throws exception
We explicitly check for an exception after the logging attempt, and
bail out in that case.

Co-authored-by: Tim Düsterhus <timwolla@googlemail.com>

Closes GH-7878.
2022-01-17 22:30:25 +01: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
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
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
521c36c855 Remove IGNORE_URL_WIN macro
This macro is defined to zero as of PHP 5.0.0, and as the comment
indicates, is no longer relevant.  Thus, we remove the definition and
all usages from the core and bundled extensions.

Closes GH-6351.
2020-10-18 23:36:36 +02:00
Máté Kocsis
c37a1cd650
Promote a few remaining errors in ext/standard
Closes GH-6110
2020-09-15 14:26:16 +02:00
Nikita Popov
a79008bd91 Also forbid null bytes in mail()
I've adjusted mb_send_mail() already, but of course the handling
in mail() should be the same.
2020-09-11 15:28:51 +02:00
Máté Kocsis
c98d47696f
Consolidate new union type ZPP macro names
They will now follow the canonical order of types. Older macros are
left intact due to maintaining BC.

Closes GH-6112
2020-09-11 11:00:18 +02:00
Max Semenik
2b5de6f839
Remove proto comments from C files
Closes GH-5758
2020-07-06 21:13:34 +02:00
twosee
88355dd338 Constify char * arguments of APIs
Closes GH-5676.
2020-06-08 10:38:45 +02:00
Christoph M. Becker
6983ae751c Fix #47983: mixed LF and CRLF line endings in mail()
Email headers are supposed to be separated with CRLF.  Period.
2020-04-02 14:51:14 +02:00
Máté Kocsis
d1764ca330
Make error messages more consistent by fixing capitalization
Closes GH-5066 As a first step, let's capitalize their initial letter when it is applicable.
2020-01-17 14:52:46 +01:00
Christoph M. Becker
d7833fd974 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #54298: Using empty additional_headers adding extraneous CRLF
2020-01-06 14:51:14 +01:00
Christoph M. Becker
09ebeba1af Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #54298: Using empty additional_headers adding extraneous CRLF
2020-01-06 14:48:46 +01:00
Christoph M. Becker
ae2150692a Fix #54298: Using empty additional_headers adding extraneous CRLF
If the header string is empty, we pass `NULL` to `php_mail()` to avoid
further checks on the string length.
2020-01-06 14:47:23 +01:00
Máté Kocsis
2ab123b84e
Convert string|array union parameter types
Closes GH-4995
2019-12-20 10:15:52 +01:00
Máté Kocsis
633926021b
Remove ezmlm_hash() function 2019-12-05 13:15:54 +01:00
Gabriel Caruso
5d6e923d46
Remove mention of PHP major version in Copyright headers
Closes GH-4732.
2019-09-25 14:51:43 +02:00
Nikita Popov
001d434449 Finish func_info updates for ext/standard 2019-06-03 11:26:25 +02:00
Peter Kokot
5f8915786f Remove HAVE_SIGNAL_H
The `<signal.h>` header file is part of the standard C89 headers [1] and
on current systems can be included unconditionally.

Since file requires at least C89 or greater, the `HAVE_SIGNAL_H` symbol
defined by Autoconf in Zend.m4 [2] can be ommitted and simplifed.

The bundled libmagic (file) also ommits the usage of HAVE_SIGNAL_H since
5.35 however current version in PHP is very modified 5.34 version and
will be refactored separately. Check for HAVE_SIGNAL_H is therefore
still done in the configure.ac.

Refs:
[1] https://port70.net/~nsz/c/c89/c89-draft.html#4.1.2
[2] https://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/headers.m4
2019-04-07 15:55:34 +02: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
Zeev Suraski
0cf7de1c70 Remove yearly range from copyright notice 2019-01-30 11:03:12 +02:00
Nikita Popov
a27f772a46 Remove redundant HASH_OF in mail.c
And use ZEND_HASH_FOREACH_STR_KEY_VAL where the integer key is not
needed.
2018-10-11 13:04:08 +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
Nikita Popov
22ce955b95 Remove unnnecessary DEREF parameter 2018-06-20 16:03:50 +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
6400264856 Trailing whitespaces
Signed-off-by: Gabriel Caruso <carusogabriel34@gmail.com>
2018-01-03 14:38:00 +01:00
Xinchen Hui
a6519d0514 year++ 2018-01-02 12:57:58 +08:00
Xinchen Hui
3fa0cee640 Revert "Use zend_get_executed_filename_ex"
This reverts commit 2a37625c20.
2017-11-02 12:12:40 +08:00
Xinchen Hui
2a37625c20 Use zend_get_executed_filename_ex 2017-11-01 15:40:54 +08:00
Nikita Popov
36ba96e86c Merge branch 'PHP-7.1' 2017-01-14 13:53:58 +01:00
Tom Sommer
e77a1dbe40 Fix bug #69061
Make mail.log append correct PHP_EOL and remove timestamp when
sending to syslog.
2017-01-14 13:53:09 +01:00
Sammy Kaye Powers
dac6c639bb Update copyright headers to 2017 2017-01-04 11:23:42 -06:00
Sammy Kaye Powers
9e29f841ce Update copyright headers to 2017 2017-01-02 09:30:12 -06:00
Joe Watkins
8d316e6a3e
Merge branch 'PHP-7.1'
* Add subject to mail.log
2017-01-01 14:40:20 +00:00
Joe Watkins
e7d4a8ce8b
Merge branch 'pull-request/1414' into PHP-7.1
* Add subject to mail.log
2017-01-01 14:39:35 +00:00
Sara Golemon
a23f08a33c Use new param API in standard 2016-12-30 17:28:55 -08:00
Anatol Belski
b204b3abd1 further normalizations, uint vs uint32_t
fix merge mistake

yet one more replacement run
2016-11-26 17:29:01 +01:00