Commit graph

859 commits

Author SHA1 Message Date
Tom Van Looy
04fb3f28ff Remove superfluous semicolons 2017-06-26 00:23:25 +02:00
Dmitry Stogov
9fb0e6ffe2 Fixed SKIP code 2017-06-22 01:41:59 +03:00
Rowan Collins
1b565f1393 Change 'undefined constant' from E_NOTICE to E_WARNING and mention deprecation
Implements RFC "Deprecate and Remove Bareword (Unquoted) Strings"
[https://wiki.php.net/rfc/deprecate-bareword-strings]
2017-03-23 18:52:43 +01:00
Nikita Popov
b3ca0c2500
zend-test extension to house code that is required for testing internal APIs, but that we would not want to expose for regular builds 2017-03-12 18:58:50 +00:00
Anatol Belski
e7166d1708 Merge branch 'PHP-7.1'
* PHP-7.1:
  dirname() should not normalize paths
2017-01-24 18:00:08 +01:00
Anatol Belski
ec78507bd4 dirname() should not normalize paths
This is the BC piece with the case where dirname() is used with an URL.
2017-01-24 17:56:00 +01:00
Anatol Belski
73bfa264cc Merge branch 'PHP-7.1'
* PHP-7.1:
  Fixed bug #73962 bug with symlink related to cyrillic directory
2017-01-20 23:47:12 +01:00
Anatol Belski
95406c878a Fixed bug #73962 bug with symlink related to cyrillic directory 2017-01-20 23:45:08 +01:00
Joe Watkins
0ca4358ade
Merge branch 'PHP-7.1'
* PHP-7.1:
  Fixed #69442 closing of fd incorrect when PTS enabled
2017-01-06 06:59:32 +00:00
Joe Watkins
e86d355c4c
Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed #69442 closing of fd incorrect when PTS enabled
2017-01-06 06:58:56 +00:00
Joe Watkins
69b1526dfe
Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed #69442 closing of fd incorrect when PTS enabled
2017-01-06 06:57:35 +00:00
Joe Watkins
ff6b309c6f
Merge branch 'pull-request/1588' into PHP-7.0
* pull-request/1588:
  Fixed #69442 closing of fd incorrect when PTS enabled
2017-01-06 06:56:50 +00:00
Anatol Belski
c76bd41c77 Merge branch 'PHP-7.1'
* PHP-7.1:
  cleanup temporary data
2016-12-14 12:36:50 +01:00
Anatol Belski
1820f4b9d1 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  cleanup temporary data
2016-12-14 12:34:14 +01:00
Anatol Belski
d663296e3b cleanup temporary data 2016-12-14 12:33:13 +01:00
Anatol Belski
127cdd44af Merge branch 'PHP-7.1'
* PHP-7.1:
  fix condition
  improve skipif
2016-12-01 13:34:20 +01:00
Anatol Belski
615c9bfe5a fix condition 2016-12-01 13:33:27 +01:00
Anatol Belski
89a7f40849 Merge branch 'PHP-7.1'
* PHP-7.1:
  improve skipif
2016-12-01 13:26:09 +01:00
Anatol Belski
8ecbb660d0 improve skipif 2016-12-01 13:25:28 +01:00
Nikita Popov
5af586bec5 Remove more PHP 6 leftovers from tests 2016-11-24 22:39:39 +01:00
Nikita Popov
45f7b2bcc8 Fix CRLF line-endings in tests
Also fix a single instance of CRLF in ibase_query.c.
2016-11-20 22:31:24 +01:00
Pedro Magalhães
617dcf1b37 Remove the binary cast from unrelated tests 2016-11-20 21:11:53 +01:00
Pedro Magalhães
9c5af4e4cb Remove the b prefix from literals on unrelated tests 2016-11-20 21:11:53 +01:00
Joe Watkins
ff1986e4d7 Merge branch 'pull-request/2198' 2016-11-12 08:16:01 +00:00
Joe Watkins
41e04dbec0 Merge branch 'pull-request/2198' 2016-11-12 08:15:52 +00:00
Mitch Hagstrand
3b830cfb5c Fix the lchwon error test for Travis CI.
The E_WARNING message from the PHP function lchown is passed
from the system function lchown. The error message returned
from lchown can be filesystem dependent.

6053987bc2/ext/standard/filestat.c (L406)
2016-11-11 16:17:07 -08:00
Christoph M. Becker
b281362681 Merge branch 'PHP-7.0' into PHP-7.1 2016-11-01 20:29:11 +01:00
Christoph M. Becker
8957ff36b3 Merge branch 'PHP-5.6' into PHP-7.0 2016-11-01 20:24:10 +01:00
Christoph M. Becker
2eacb53fc4 Fix #73436: Setting allow_url_fopen to Off makes several tests fail
We make sure that these tests run with allow_url_fopen=1.
2016-11-01 20:13:53 +01:00
Christoph M. Becker
9cc11dbded Merge branch 'PHP-7.0' into PHP-7.1 2016-08-31 16:45:15 +02:00
Christoph M. Becker
f93fd8ce32 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-31 16:38:38 +02:00
Christoph M. Becker
b2d267d9ee Fix #71882 amendment 2: Negative ftruncate() on php://memory exhausts memory 2016-08-31 16:33:14 +02:00
Christoph M. Becker
56ed966bc6 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-31 14:32:24 +02:00
Davey Shafik
12ee17d5e0 Implement \ArgumentCountError exception 2016-08-30 19:35:56 -07:00
Christoph M. Becker
38a7c0e0f7 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-30 02:24:43 +02:00
Christoph M. Becker
65f0c163f9 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-30 02:13:48 +02:00
Christoph M. Becker
207dab585a Fix #71882: Negative ftruncate() on php://memory exhausts memory
We must not pass negative sizes to a size_t parameter.
2016-08-30 02:05:45 +02:00
Anatol Belski
096b0a556c extend readdir utf-8 name test 2016-08-21 18:21:49 +02:00
Lauri Kenttä
7a02704c0e Require strict base64 in data URI
As the tests already show, the data URI wrapper is supposed to fail
for corrupt input, but for some reason, one case of invalid input is
still allowed to pass?! Strict base64 makes a lot more sense here.
Also, Chromium and Firefox fail on invalid base64, so it's a logical
choice for PHP as well.
2016-07-22 18:03:55 +02:00
Christoph M. Becker
9c8b2c8689 Merge branch 'PHP-7.0' into PHP-7.1 2016-07-21 18:53:42 +02:00
Christoph M. Becker
4472f9e822 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-21 18:39:27 +02:00
Christoph M. Becker
f2c2a4be9e Fix #72330: CSV fields incorrectly split if escape char followed by UTF chars
We must not forget to properly reset the state for multibyte characters
following an escape character.
2016-07-21 18:37:24 +02:00
Anatol Belski
9c1fba8593 Merge branch 'PHP-7.0'
* PHP-7.0:
  fix test cleanup
2016-06-22 12:23:24 +02:00
Anatol Belski
c196f9cdf7 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix test cleanup
2016-06-22 12:22:03 +02:00
Anatol Belski
4638ba9c07 fix test cleanup 2016-06-22 12:20:02 +02:00
Anatol Belski
3d3f11ede4 Fixed the UTF-8 and long path support in the streams on Windows.
Since long the default PHP charset is UTF-8, however the Windows part is
out of step with this important point. The current implementation in PHP
doesn't technically permit to handle UTF-8 filepath and several other
things. Till now, only the ANSI compatible APIs are being used. Here is more
about it

dd317752%28v=vs.85%29.aspx

The patch fixes not only issues with multibyte filenames under
incompatible codepages, but indirectly also issues with some other multibyte
encodings like BIG5, Shift-JIS, etc. by providing a clean way to access
filenames in UTF-8. Below is a small list of issues from the bug tracker,
that are getting fixed:

https://bugs.php.net/63401
https://bugs.php.net/41199
https://bugs.php.net/50203
https://bugs.php.net/71509
https://bugs.php.net/64699
https://bugs.php.net/64506
https://bugs.php.net/30195
https://bugs.php.net/65358
https://bugs.php.net/61315
https://bugs.php.net/70943
https://bugs.php.net/70903
https://bugs.php.net/63593
https://bugs.php.net/54977
https://bugs.php.net/54028
https://bugs.php.net/43148
https://bugs.php.net/30730
https://bugs.php.net/33350
https://bugs.php.net/35300
https://bugs.php.net/46990
https://bugs.php.net/61309
https://bugs.php.net/69333
https://bugs.php.net/45517
https://bugs.php.net/70551
https://bugs.php.net/50197
https://bugs.php.net/72200
https://bugs.php.net/37672

Yet more related tickets can for sure be found - on bugs.php.net, Stackoverflow
and Github. Some of the bugs are pretty recent, some descend to early
2000th, but  the user comments in there last even till today. Just for example,
bug #30195 was opened in 2004, the latest comment in there was made in 2014. It
is certain, that these bugs descend not only to pure PHP use cases, but get also
redirected from the popular PHP based projects. Given the modern systems (and
those supported by PHP) are always based on NTFS, there is no excuse to keep
these issues unresolved.

The internalization approach on Windows is in many ways different from
UNIX and Linux, while it supports and is based on Unicode. It depends on the
current system code page, APIs used and exact kind how the binary was compiled
The locale doesn't affect the way Unicode or ANSI API work. PHP in particular
is being compiled without _UNICODE defined and this is conditioned by the
way we handle strings. Here is more about it

https://msdn.microsoft.com/en-us/library/tsbaswba.aspx

However, with any system code page ANSI functions automatically convert
paths to UTF-16. Paths in some encodings incompatible with the
current system code page, won't work correctly with ANSI APIs. PHP
till now only uses the ANSI Windows APIs.

For example, on a system with the current code page 1252, the paths
in cp1252 are supported and transparently converted to UTF-16 by the
ANSI functions. Once one wants to handle a filepath encoded with cp932 on
that particular system, an ANSI or a POSIX compatible function used in
PHP will produce an erroneous result. When trying to convert that cp932 path
to UTF-8 and passing to the ANSI functions, an ANSI function would
likely interpret the UTF-8 string as some string in the current code page and
create a filepath that represents every single byte of the UTF-8 string.
These behaviors are not only broken but also disregard the documented
INI settings.

This patch solves the issies with the multibyte paths on Windows by
intelligently enforcing the usage of the Unicode aware APIs. For
functions expect Unicode (fe CreateFileW, FindFirstFileW, etc.), arguments
will be converted to UTF-16 wide chars. For functions returning Unicode
aware data (fe GetCurrentDirectoryW, etc.), resulting wide string is
converted back to char's depending on the current PHP charset settings,
either to the current ANSI codepage (this is the behavior prior to this patch)
or to UTF-8 (the default behavior).

In a particular case, users might have to explicitly set
internal_encoding or default_charset, if filenames in ANSI codepage are
necessary. Current tests show no regressions and witness that this will be an
exotic case, the current default UTF-8 encoding is compatible with any
supported system. The dependency libraries are long switching to Unicode APIs,
so some tests were also added for extensions not directly related to streams.
At large, the patch brings over 150 related tests into the core. Those target
and was run on various environments with European, Asian, etc. codepages.
General PHP frameworks was tested and showed no regressions.

The impact on the current C code base is low, the most places affected
are the Windows only places in the three files tsrm_win32.c, zend_virtual_cwd.c
and plain_wrapper.c. The actual implementation of the most of the wide
char supporting functionality is in win32/ioutil.* and win32/codepage.*,
several  low level functionsare extended in place to avoid reimplementation for
now. No performance impact was sighted. As previously mentioned, the ANSI APIs
used prior the patch perform Unicode conversions internally. Using the
Unicode  APIs directly while doing custom conversions just retains the status
quo. The ways to optimize it are open (fe. by implementing caching for the
strings converted to wide variants).

The long path implementation is user transparent. If a path exceeds the
length of _MAX_PATH, it'll be automatically prefixed with \\?\. The MAXPATHLEN
is set to 2048 bytes.

Appreciation to Pierre Joye, Matt Ficken, @algo13 and others for tips, ideas
and testing.

Thanks.
2016-06-20 12:45:39 +02:00
Dmitry Stogov
ff363e2e7c Implemented RFC: Replace "Missing argument" warning with "Too few arguments" exception
Squashed commit of the following:

commit 8b45fa2acb
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Jun 16 01:52:50 2016 +0300

    Separate slow path of ZEND_RECV into a cold function.

commit 9e18895ee5
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Jun 15 23:26:28 2016 +0300

    Required argument can't be IS_UNDEF anymore.

commit 662db66e39
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Tue May 31 17:14:50 2016 +0300

    Replace "Missing argument" warning by "Too few arguments" exception.
2016-06-16 02:32:02 +03:00
Anatol Belski
33f6fc1790 fix test out 2016-06-09 20:16:09 +02:00
Anatol Belski
4ceffa7204 fix test 2016-06-09 20:12:49 +02:00
Anatol Belski
b34496e08f sync with deleted file 2016-06-09 17:19:40 +02:00