Commit Graph

120247 Commits

Author SHA1 Message Date
Dmitry Stogov
a02237d2a9 Removed outdated/duplicated code 2020-08-17 15:24:33 +03:00
Dmitry Stogov
8202b4ed09 Properly patch jmp tables 2020-08-17 13:50:03 +03:00
George Peter Banyard
4522cbb789 Promote various OpenSSL warnings into Errors
Closes GH-5111
2020-08-16 18:59:52 +02:00
Tyson Andre
0461c1574a Add run-tests.php --context [n] option.
Mentioned in https://github.com/php/php-src/pull/5965#discussion_r467621123

This PR proposes 3 lines of context so the impact can be seen in tests.
Other `diff` programs show around 3 lines of context.
(This helps indicate exactly which position a test should be updated
to add a new expected line at)

Use the mapping for choosing order to display diffs

Properly include context in cases where the expected output had more lines than
the actual output, e.g.

```
--FILE--
A
A1
A
C
NEARBY
--EXPECTF--
A
B
A1
B
A
B
A
B
NEARBY
```

Closes GH-5968
2020-08-16 09:31:38 -04:00
Máté Kocsis
517c9938af
Promote warnings to exceptions in ext/curl
Closes GH-5963
2020-08-14 17:40:35 +02:00
Nikita Popov
124260c165 Merge branch 'PHP-7.4'
* PHP-7.4:
  Null terminate the sodium_crypto_kx_keypair() result
2020-08-14 15:52:31 +02:00
Nikita Popov
5885eecf23 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Null terminate the sodium_crypto_kx_keypair() result
2020-08-14 15:52:15 +02:00
Nikita Popov
f6d7af21a3 Null terminate the sodium_crypto_kx_keypair() result 2020-08-14 15:51:31 +02:00
Nikita Popov
86072d60de Reduce cost factors in sodium password_hash tests
Drop the 4x factors to make these tests a bit less obscenely
slow.
2020-08-14 15:39:42 +02:00
Christoph M. Becker
5072321c55 Improve test portability
We have to ensure that the attempted connection to the MySQL server
fails, and do that by passing an unknown host instead of falling back
to localhost.
2020-08-14 15:33:02 +02:00
Nikita Popov
2ca5d663f3 Avoid fatal error in session handler 2020-08-14 15:19:18 +02:00
Nikita Popov
cfaa270da5 Use variadic signature for PDOStatement::fetchAll()
The current signature is incorrect, because the $ctor_args parameter
is not required to be an array (it can at least also be null, and
isn't enforced by an exception anyway).

I'm going for the variadic signature here, because we already use
the same variadic signature in PDO::query() and
PDOStatement::setFetchMode(), all of them accepting essentially the
same arguments.
2020-08-14 15:19:18 +02:00
Nikita Popov
ca20f36b2a Fix types in openssl stub
These two $recipcert parameters don't use proper union types
right now. They are a bit tricky due to the $recipkey -> $recipcert
fallback.
2020-08-14 15:19:18 +02:00
Christoph M. Becker
64368f4786 Fix newly introduced test for Windows
The warning message is rather different there, but since that is
irrelevant for this test case, we just suppress the warning.
2020-08-14 14:36:32 +02:00
Máté Kocsis
d72161505c
Add a few callable method parameter types to ext/sqlite3
Closes GH-5988
2020-08-14 13:43:11 +02:00
Nikita Popov
ce38d3a919 Don't assert mysql->mysql is non-null
There is an edge case in constructor behavior where we can end up
with mysql->mysql being NULL (rather than mysql itself already being
NULL). I think that ultimately that's a bug in the constructor code,
and we should probably be destroying the outer structure on
construction failure as well. However it's pretty hard to unravel
with when considering all the construction permutations.
2020-08-14 12:44:13 +02:00
Nikita Popov
196671a2b2 Simplify mysqli_stmt_bind_param() implementation
By using zpp.
2020-08-14 11:45:08 +02:00
Nikita Popov
179bc21f5f Use normal zpp in mysqli_result::__construct()
This method doesn't need any special handling...
2020-08-14 11:15:36 +02:00
Nikita Popov
6570fc2cf8 Remove dummy aliases for mysqli constructors
These are only available as methods. Directly declare them as
such instead of aliasing to functions that don't actually exist.
2020-08-14 11:12:41 +02:00
Nikita Popov
07539685b9 Return empty string from SplFileInfo::getPathname()
Instead of false. This is consistent with how other methods like
SplFileInfo::getPath() behave. It's also a requirement before
SplFileInfo::__toString() calls SplFileInfo::getPathname() and
needs to return a string.
2020-08-14 11:09:30 +02:00
Nikita Popov
0a439fa932 Merge branch 'PHP-7.4'
* PHP-7.4:
  Add missing initialization check to RegexIterator::getRegex()
2020-08-14 10:42:14 +02:00
Nikita Popov
a0c231c0f5 Add missing initialization check to RegexIterator::getRegex() 2020-08-14 10:41:36 +02:00
Nikita Popov
964f66942c Fix test after is_callable change 2020-08-14 10:40:20 +02:00
Nikita Popov
befe10fd21 Fix bug #78770
Refactor the zend_is_callable implementation to check callability
at a particular frame (this is an implementation detail for now,
but could be exposed in the API if useful). Pick the first parent
user frame as the one to check.
2020-08-14 10:24:06 +02:00
Máté Kocsis
f83368c6d9
Fix ZPP for mhash()
Closes GH-5985
2020-08-14 10:02:45 +02:00
George Peter Banyard
96c7d42a3c Use ZPP callable check for ldap_set_rebind_proc() 2020-08-13 21:14:51 +02:00
George Peter Banyard
dae83cd7cb Use ZPP callable check for Windows specific functions 2020-08-13 21:14:50 +02:00
George Peter Banyard
9cb522166c Allow number_format to be only passed 3 arguments
Closes GH-5977
2020-08-13 18:07:17 +02:00
Tyson Andre
7be61bec80 Colorize --show-diff, only on stdout
Don't add colors to the saved `.diff` file.

Related to a41cf3e1d2
2020-08-13 11:27:32 -04:00
Nikita Popov
c3ddda4e3c Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed bug #79724
2020-08-13 17:26:20 +02:00
Nikita Popov
8bda799d6f Fixed bug #79724 2020-08-13 17:25:51 +02:00
Nikita Popov
e40c9d4918 Add some missing DatePeriod initialization checks 2020-08-13 17:23:23 +02:00
Nikita Popov
8f61854108 Add a missing null check in simplexml 2020-08-13 16:46:08 +02:00
Nikita Popov
8fbc618a3c Fix invalid zpp calls in pcntl_get/setpriority 2020-08-13 16:46:02 +02:00
Nikita Popov
b03e300a29 Fix test after PDOStatement::fetchObject() change 2020-08-13 16:45:32 +02:00
Nikita Popov
396b47061f Use zpp C in pg_fetch_object 2020-08-13 16:24:08 +02:00
Nikita Popov
670036e2a9 Use Z_PARAM_CLASS in PDOStatement::fetchObject()
Instead of implementing custom logic.
2020-08-13 16:20:29 +02:00
Nikita Popov
1511bdae96 Throw Error on uninitialized XMLWriter 2020-08-13 16:13:02 +02:00
Nikita Popov
fc7bab3aee Throw on uninitialized SimpleXMLElement
Elevate this warning into an Error, as usual. Add a few checks
in places that were missing them.
2020-08-13 16:13:02 +02:00
Nikita Popov
f5e6f9bd27 Avoid fatal error on not found class in mysqli_fetch_object()
Instead use C zpp modifier and throw TypeError.
2020-08-13 16:13:02 +02:00
Máté Kocsis
a10f8876ef
Check missing parameter types in stubs
[skip ci] Closes GH-5627
2020-08-13 15:17:31 +02:00
Máté Kocsis
cb2f689778
Fix param name in PHPDoc 2020-08-13 14:54:48 +02:00
Máté Kocsis
2803c8fb8d
Add all the missing parameter types to stubs
Closes GH-5955
2020-08-13 14:47:18 +02:00
Nikita Popov
f3d6203b0b Use a dedicated method for MultipleIterator::countIterators()
This method has a different signature from
SplObjectStorage::count(), so don't share implementations.
2020-08-13 14:44:03 +02:00
Nikita Popov
f0bf3d4672 Replace fatal error in SplFileInfo with exception
Using RuntimeException here, because the same error condition
uses that in many other places in this file.
2020-08-13 14:43:45 +02:00
Nikita Popov
634dd38289 Throw Error exception in DOM_GET_OBJ
Per general convention for handling of uninitialized objects.
2020-08-13 14:43:40 +02:00
Nikita Popov
e17ff61962 Switch to mime-db as source of extension => MIME map
The Apache MIME type map is not actively maintained anymore, so
this switches to jshttp/mime-db, which seems to be the de-facto
standard in this area now. This avoid the need to patch in our
own MIME types over time.

The preference algorithm is based on:
47b62ac45e/index.js (L154)

Closes GH-5764.
2020-08-13 12:37:33 +02:00
Nikita Popov
cdc4e49b84 Make strftime tests musl compatible
* Remove usage of strftime() in favor of date() in cases where
   we are not specifically testing strftime(). We implement
   date() ourselves, and as such are insulated from implementation-
   defined behavior.
 * Add skipif for broken strftime() %Z support. We have decided
   not to work around the issue for musl using manual expansion,
   as people should not be using this function anyway, and it is
   slated for future deprecation.
 * Don't test strftime() with invalid format specifier. The
   behavior is implementation-dependent.
2020-08-13 12:02:27 +02:00
Remi Collet
f16c1dc7ee fix test expectation 2020-08-13 09:36:42 +02:00
George Peter Banyard
90330a4460 Drop redundant arg count check 2020-08-13 02:37:00 +02:00