1
0
mirror of https://github.com/php/php-src.git synced 2026-04-23 07:58:20 +02:00
Commit Graph

1101 Commits

Author SHA1 Message Date
Máté Kocsis 36935e42ea Improve undefined variable error messages
Closes GH-5312
2020-03-31 13:02:32 +02:00
Máté Kocsis bb6f374048 Improve argument error messages in ext/standard
Closes GH-5198
2020-03-18 19:56:10 +01:00
Philipp Tanlak 1668ad7cb1 Add str_contains() function
RFC: https://wiki.php.net/rfc/str_contains

Closes GH-5179.
2020-03-16 11:05:26 +01:00
Nikita Popov e8678fcb42 Fixed bug #75902
Don't special-case nested arrays/objects in str_replace(), instead
perform a string cast on them as well. For arrays, this will always
result in the usual conversion warning.

This behavior is consistent with preg_replace(). If we didn't want
to cast the array to string here, we should instead perform the
replacement recursively. Silently copying it is just confusing.
2020-03-10 16:49:17 +01:00
Nicolas Grekas 9e775db025 Define Stringable with __toString():string method 2020-03-02 15:25:32 +01:00
Máté Kocsis 960318ed95 Change argument error message format
Closes GH-5211
2020-02-26 15:00:08 +01:00
Nikita Popov a939805641 Use serialize_precision for var_dump()
var_dump() is debugging functionality, so it should print
floating-point numbers accurately. We do this by switching
to serialize_precision, which (by default) will print with
as much precision as necessary to preserve the exact value
of the float.

This also affects debug_zval_dump().

Closes GH-5172.
2020-02-25 09:51:32 +01:00
Máté Kocsis ac0853eb26 Make type error messages more consistent
Closes GH-5092
2020-02-17 14:22:17 +01:00
Nikita Popov f8d795820e Reindent phpt files 2020-02-03 22:52:20 +01:00
Máté Kocsis 9942f45b7a Fix indentation/trailing whitespaces of 32-bit tests 2020-02-03 16:50:59 +01:00
Máté Kocsis 0253a232c3 Fix indentation/trailing whitespaces of tests 2020-02-03 15:04:02 +01:00
Máté Kocsis 2015c7a48e Fix another batch of indentation in tests 2020-02-02 23:33:40 +01:00
Máté Kocsis 8b36be268d Fix indentation and whitespaces in tests
In preparation for GH-5074
2020-01-31 17:47:14 +01:00
Máté Kocsis 99db00b1f2 Fix #78880 Another round 2020-01-19 18:28:43 +01: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
Máté Kocsis afdaa91170 Fix #78880: Final spelling fixes 2020-01-16 19:14:31 +01:00
Máté Kocsis 0b4778c377 Fix #78880: Another bunch of spelling errors 2020-01-16 09:46:47 +01:00
Islam Israfilov f553e676ec Fixed #78385: Distinguish absent/empty query/fragment
http://example.com/foo   => query = null, fragment = null
http://example.com/foo?  => query = "",   fragment = null
http://example.com/foo#  => query = null, fragment = ""
http://example.com/foo?# => query = "",   fragment = ""

Closes GH-5078.
2020-01-13 10:18:23 +01:00
Nikita Popov 4388add2c8 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix test
2020-01-13 10:10:16 +01:00
Nikita Popov c247898949 Fix test
Hopefully (32-bit)
2020-01-13 10:09:58 +01:00
Nikita Popov ddc5553ecd Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove unnecessary whitespace sensitivtiy from some tests
2020-01-10 17:38:39 +01:00
Nikita Popov e748a5a0e6 Remove unnecessary whitespace sensitivtiy from some tests 2020-01-10 17:36:46 +01:00
Christoph M. Becker dabc28d182 Fix #78880: Spelling error report
We fix the most often occuring typos according to a recent codespell
report[1] in tests, code comments and documentation.

[1] <https://fossies.org/linux/test/php-src-master-f8f48ce.191129.tar.gz/codespell.html>.
2019-12-21 11:58:00 +01:00
Máté Kocsis f3d5a5a9d3 Promote warnings to exceptions in string search related functions
GH-5004
2019-12-20 16:43:40 +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 e699b2865f Fix exception message of implode() 2019-12-12 23:05:12 +01:00
Máté Kocsis beee92a887 Remove support for mixing parameter order in implode() 2019-12-12 13:49:05 +01:00
Máté Kocsis 33f7cabbf0 Promote warnings to exceptions in *scanf() functions 2019-12-10 13:01:59 +01:00
Máté Kocsis b2dc833c1a Only accept string as the format parameter of *printf() functions 2019-12-09 19:43:34 +01:00
George Peter Banyard 5fbd49f9ab Convert Errors to ValueErrors
Closes GH-4930
2019-12-05 14:22:54 +01:00
Máté Kocsis 144b41ce88 Remove money_format() function 2019-12-05 13:15:54 +01:00
Máté Kocsis 64468d1e3b Remove convert_cyr_string() function 2019-12-05 13:15:54 +01:00
Máté Kocsis b63c625260 Remove hebrevc() function 2019-12-05 13:15:54 +01:00
Máté Kocsis d2868edae0 Capitalize the initial letter of the error message of htmlspecialchars() function 2019-12-05 13:15:53 +01:00
Nikita Popov a603c06e2e Support "string or array" in zpp
This is one of our more common argument unions. Usage is just
prototyped in a few places, certainly not a full conversion.

I'm removing the str_replace.phpt test, because aparently it was
split up into smaller tests at some point, but the original has
not been removed.

Closes GH-4970.
2019-12-05 12:25:57 +01:00
Christoph M. Becker 8a5601a364 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #78814: strip_tags allows / in tag name => whitelist bypass
2019-12-02 11:39:58 +01:00
Christoph M. Becker 3356dd0575 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78814: strip_tags allows / in tag name => whitelist bypass
2019-12-02 11:39:35 +01:00
Christoph M. Becker 861fa60814 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #78814: strip_tags allows / in tag name => whitelist bypass
2019-12-02 11:38:45 +01:00
Christoph M. Becker 600f1f898f Fix #78814: strip_tags allows / in tag name => whitelist bypass
When normalizing tags to check whether they are contained in the set
of allowable tags, we must not strip slashes, unless they come
immediately after the opening `<`, or immediately before the closing
`>`.
2019-12-02 11:37:25 +01:00
Christoph M. Becker 0dba3a8e43 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #78833: Integer overflow in pack causes out-of-bound access
2019-12-02 11:21:37 +01:00
Christoph M. Becker 4ff242a9a7 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78833: Integer overflow in pack causes out-of-bound access
2019-12-02 11:21:07 +01:00
Christoph M. Becker 3d81c54879 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #78833: Integer overflow in pack causes out-of-bound access
2019-12-02 11:19:15 +01:00
Christoph M. Becker db420cb6a1 Fix #78833: Integer overflow in pack causes out-of-bound access
We check for potential signed integer overflow, and bail out
gracefully, in that case.
2019-12-02 11:18:19 +01:00
Christoph M. Becker b6e79f3724 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #78840: imploding $GLOBALS crashes
2019-11-27 09:34:57 +01:00
Christoph M. Becker 30aa2e8932 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78840: imploding $GLOBALS crashes
2019-11-27 09:33:55 +01:00
Christoph M. Becker fee38633d2 Fix #78840: imploding $GLOBALS crashes
We add support for IS_INDIRECT zvals to implode().
2019-11-27 09:32:16 +01:00
George Peter Banyard 501a72e354 Promote warning to value error in strpbrk()
Closes GH-4598
2019-11-22 00:36:54 +01:00
Fabien Villepinte a555cc0b3d Clean DONE tags from tests
Remove most of the `===DONE===` tags and its variations.
Keep `===DONE===` if the test output otherwise becomes empty.

Closes GH-4872.
2019-11-07 21:31:47 +01:00
Nikita Popov 93ba3abe63 Warn on strtr(["" => "x"])
Previously:
 * If only ["" => "x"] was present, the original string was returned
   without warning.
 * If both ["" => "x"] and at least one more element was present,
   false was returned without warning.

New behavior:
 * Ignore "" keys in the replacement array (and perform any remaining
   replacement).
 * Throw a warning indicating that an empty string replacement has
   been ignored.

Closes GH-4792.
2019-10-30 10:53:45 +01:00
Nikita Popov 778a9c05b6 Try to fix 32-bit fprintf test 2019-10-29 09:52:46 +01:00