1
0
mirror of https://github.com/php/php-src.git synced 2026-04-22 07:28:09 +02:00
Commit Graph

54622 Commits

Author SHA1 Message Date
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
Christoph M. Becker 737f7dd8f6 Prevent imap mail tests from borking instead of skipping
As of commit e49593a[1], run-tests.php is rather picky regarding the
output of SKIPIF sections, so we have to suppress warnings for failing
imap_open().

[1] <http://git.php.net/?p=php-src.git;a=commit;h=e49593a7c3159a5673ce74b4e5133f1264dc313f>
2020-04-02 12:51:22 +02:00
Remi Collet 59e0674185 use a better setter for zip_error_t 2020-04-02 12:26:44 +02:00
Nikita Popov 184fdac7c2 Remove <default> prefix from reflection dump
This really doesn't add anything, and only makes for confusing
terminology. Only marking properties as dynamic is sufficient.
2020-04-02 11:25:41 +02:00
Nikita Popov 083b0c38a0 Display property default value in reflection dumps 2020-04-02 11:21:48 +02:00
Nikita Popov b5991d3382 Show property type in reflection export 2020-04-02 11:05:04 +02:00
Christoph M. Becker 919adcf161 Merge branch 'PHP-7.4'
* PHP-7.4:
  Enable error diagnostic for check_default_conf_path.phpt
2020-04-01 19:21:46 +02:00
Christoph M. Becker 71e1d37938 Enable error diagnostic for check_default_conf_path.phpt
Otherwise we have no clue why the test failed, if the regex didn't
match.
2020-04-01 19:20:35 +02:00
Nikita Popov 1ed132e2e5 Unify checks for binary operator errors for ct eval
Move everything into one function and share it with opcache.
This fixes some discrepancies.
2020-04-01 14:42:58 +02:00
Nikita Popov 56b18d478e Don't convert binop operand types in opcache
This may produce different behavior if operator overloading is
involved, and may change the error message.

If there's strong interest, this could be done in the DFA pass
with available type information. It does not look particularly
practically useful to me though.
2020-04-01 14:39:41 +02:00
Nikita Popov 2d8f9f34dd Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix literal compaction collision between string and double
2020-04-01 14:23:07 +02:00
Nikita Popov 59c8d6a863 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix literal compaction collision between string and double
2020-04-01 14:22:27 +02:00
Nikita Popov 14b770d407 Fix literal compaction collision between string and double
For the sake of simplicity I'm using a separate hashtable, rather
than trying to do hash perturabation on the double strings.
2020-04-01 14:20:59 +02:00
Nikita Popov cdaf35033d Improve "unsupported operands" error
By mentioning the operand types. We can do that now, as the
original operand types now remain available.

Closes GH-5330.
2020-04-01 11:26:43 +02:00
George Peter Banyard a54ee6e591 Merge branch 'PHP-7.4' 2020-04-01 04:55:35 +02:00
George Peter Banyard cc0052678a Merge branch 'PHP-7.3' into PHP-7.4 2020-04-01 04:34:09 +02:00
George Peter Banyard 18dc9044f5 Fix bug 79441 2020-04-01 04:29:20 +02:00
George Peter Banyard 229dff9f08 Promote unsupported encoding warnings to ValueError 2020-04-01 00:54:36 +02:00
George Peter Banyard 21227dc1f1 Use php_mb_get_encoding instead of mbfl_name2encoding to get encoding
This reduces the number of places where the error message template is used.
Also promote the mb_check_encoding() warning to ValueError and add a test to cover the behaviour.
2020-03-31 23:39:39 +02:00
Nikita Popov 11f0e1d1cb Move encoding fetching out of php_mb_convert_encoding() 2020-03-31 21:47:55 +02:00
Nikita Popov 857fe616fa Remove unnecesary check in php_mb_check_encoding()
The caller makes sure that this is not NULL.
2020-03-31 21:02:00 +02:00
George Peter Banyard daf45f68d2 Use explicit helper 2020-03-31 20:27:10 +02:00
George Peter Banyard affc5a024a Encoding argument is always MBREX(current_mbctype) 2020-03-31 20:27:10 +02:00
Máté Kocsis b6229fbca2 Display nullability in type error messages for internal functions
Closes GH-5327
2020-03-31 16:55:36 +02:00
George Peter Banyard 90eeca2531 Convert some unknown encoding warnings to ValueErrors in ext/mbstring
Promotes only the warnings where the encoding comes only from a string.
Functions which accept an array of encodings will be fixed at a later stage.

Closes GH-5317
2020-03-31 16:34:18 +02:00
George Peter Banyard 55a3e5b99e Promote some warnings to Errors in Zend basic functions
Closes GH-5325
2020-03-31 16:32:58 +02:00
Nikita Popov 8fd7f02ea4 Make cast_object handler required
Avoid subtle differences in behavior depending on whether the
handler is absent or returns FAILURE.

If you previously set cast_object to NULL, create a handler that
always returns FAILURE instead.
2020-03-31 14:37:49 +02:00
Máté Kocsis 36935e42ea Improve undefined variable error messages
Closes GH-5312
2020-03-31 13:02:32 +02:00
Nikita Popov 6bf483a94a Clarify SimpleXML comparison logic 2020-03-31 12:48:57 +02:00
Nikita Popov fb5bfcb75b Add a ZEND_UNCOMPARABLE value
To explicitly indicate that objects are uncomparable. For now
this has no functional difference from the usual 1 return value,
but makes intent clearer.
2020-03-31 12:36:48 +02:00
Nikita Popov 3ca08ee764 Make sure mbstring.internal_encoding deprecation is always thrown
It was not thrown if the setting was specified via -d at least.
2020-03-31 10:47:23 +02:00
Christoph M. Becker 12ca4fe65d Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #79413: session_create_id() fails for active sessions
2020-03-31 08:41:08 +02:00
Christoph M. Becker d533fa15e6 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79413: session_create_id() fails for active sessions
2020-03-31 08:39:54 +02:00
Christoph M. Becker b510250b8e Fix #79413: session_create_id() fails for active sessions
The comment on `PS_VALIDATE_SID_FUNC(files)` is very clear that the
function is supposed to return `SUCCESS` if the session already exists.
So to detect a collision, we have to check for `SUCCESS`, not
`FAILURE`.

We also fix the wrong condition in session_regenerate_id() as well.
2020-03-31 08:38:23 +02:00
George Peter Banyard 457380cae7 Drop wchar header check as always defined since C95 2020-03-31 00:14:56 +02:00
George Peter Banyard aa47543cb4 Fix format for tm member objects as they are stored as integers
Closes GH-5326
2020-03-30 17:09:49 +02:00
Nikita Popov 8a2ce27bba mb_detect_order(): Use proper array|string argument 2020-03-30 16:26:28 +02:00
Nikita Popov 500230fc85 Remove persistent arg from parse_encoding_array()
It is always zero.
2020-03-30 16:17:35 +02:00
Nikita Popov b02b3539e7 mb_check_encoding(): Make var a proper array|string arg 2020-03-30 16:15:12 +02:00
Nikita Popov 50d07ff28c mb_detect_encoding(): Use proper array|string parameter
Needed to add support for nullabiltiy in some places.
2020-03-30 16:15:12 +02:00
Tyson Andre 47ddd95836 Do constant evaluation for str_contains in opcache
Both arguments must be strings.
str_contains deliberately does not emit a warning for an empty needle.

Closes GH-5324
2020-03-30 09:54:38 -04:00
Nikita Popov bb6523693c mb_convert_variables(): Make $from an array|string argument 2020-03-30 15:51:04 +02:00
Nikita Popov 0d24422749 mb_convert_encoding(): Make $input a proper array|string arg 2020-03-30 15:41:55 +02:00
Nikita Popov f24f6cbab9 mb_convert_encoding(): Make $from_encodings a proper array|string arg
Switching to FastZPP, as we don't support this in normal zpp.
2020-03-30 15:39:33 +02:00
Nikita Popov 7cea789cfc Parse mb_convert_encoding() encodings only once
Instead of re-parsing them for every converted value. Also reuse
the generic parse_array() helper.
2020-03-30 14:54:15 +02:00
Nikita Popov cd5a29b820 Properly report unknown encoding in encoding lists
And clean up the related array and list parsing code.
2020-03-30 14:46:59 +02:00
Dmitry Stogov 44390beb42 cleanup 2020-03-30 14:27:01 +03:00
Nikita Popov ed850f2723 Move encoding fetching outside php_mb_stripos() 2020-03-30 12:29:11 +02:00
Dmitry Stogov 4c9ee6a8ca Initialize variable numbers 2020-03-30 12:50:19 +03:00
Nikita Popov f9e4c71506 Merge branch 'PHP-7.4'
* PHP-7.4:
  Don't check directory nlink in stat tests
2020-03-30 10:54:34 +02:00