Commit Graph

11886 Commits

Author SHA1 Message Date
Fabien Villepinte
b6f9ade9f2 Remove unused variables 2019-03-17 23:29:51 +01:00
Fabien Villepinte
26dfce7f36 Replace dirname(__FILE__) by __DIR__ in tests 2019-03-15 22:55:30 +01:00
Nikita Popov
cc354a0790 Merge branch 'PHP-7.3' into PHP-7.4 2019-03-11 15:36:40 +01:00
Nikita Popov
6818ca3c02 Merge branch 'PHP-7.2' into PHP-7.3 2019-03-11 15:36:27 +01:00
Nikita Popov
1fd32e9c2f Fixed bug #76717
Print INT_MIN as -INT_MAX-1 to avoid it getting parsed as a float
literal due to integer overflow.
2019-03-11 15:35:02 +01:00
c9s
9f6f6fe219 Remove function_table var from the caller
function_table var is not used in call_user_function macro anymore
hence replace the usage with NULL
2019-03-11 10:00:39 +01:00
Gabriel Caruso
6c4e2079c0 Use EXPECT when possible
EXPECTF logic in run-tests.php is considerable, so let's avoid it.
2019-03-11 00:05:44 -03:00
johnstevenson
b37a6aafce Fix bc break in Windows readlink
GetFinalPathNameByHandleW is given a file handle to a symbolic link,
rather than one to the target, and therefore returns an incorrect path.

Fix symlink with relative path and add test
2019-03-10 15:48:31 +01:00
Nikita Popov
59dd1979ef More zpp error/variation test removals 2019-03-08 13:46:39 +01:00
Kalle Sommer Nielsen
aa33ab9696 Give Peter credit for his work on the Unix build system 2019-03-07 23:27:10 +02:00
Peter Kokot
f5fa9ddbd5 Clean *nix build system
- remove some outdated and not used macro calls
- remove some unused variables
- Remove not needed comment from tokenizer config.m4
- Remove not needed comment
- remove not needed local variables for editors and syntax highlighting
2019-03-07 20:58:14 +01:00
Peter Kokot
9df6a1e4dd Add AS_HELP_STRING to *nix build configure options
The Autoconf's default AS_HELP_STRING macro can properly format help
strings [1] so watching out if columns are aligned manually is not
anymore.

[1] https://www.gnu.org/software/autoconf/manual/autoconf.html#Pretty-Help-Strings
2019-03-07 20:36:59 +01:00
Nikita Popov
2580a7ba09 More zpp error/variation test removals 2019-03-07 17:09:43 +01:00
Nikita Popov
c8e10c6119 More zpp error/variation test removals 2019-03-07 15:54:31 +01:00
Peter Kokot
bebcdcc745 Remove legacy AC_CHECK_TYPE calls for uint and ulong
The AC_CHECK_TYPE was refactored in more recent versions of Autoconf
and the call with two arguments is obsolete and not recommended anymore.

This patch also refactors some leftovers of using ulong and uint which
are not standard nor common usages of types in C.

The ulong can be used as zend_ulong and uint usage is actually
`unsigned int`.

The usage of HAVE_ULONG removed since it is not used in current code
base.

Legacy edgecase for some legacy HPUX systems removed:
- sys/stream.h header is not checked and the HAVE_SYS_STREAM_H is
  not defined with current build system.

- flags are unsigned int
- max_allowed_packet changed to unsigned int
2019-03-06 22:49:16 +01:00
Nikita Popov
8c62c69265 More zpp error/variation test removals
Some of these tests also check non-zpp conditions -- however, there is
always some other test that also checks those error conditions.
2019-03-06 13:40:22 +01:00
Nikita Popov
6be93b29eb Don't generate script for proc_open_pipes tests
Commit the generated script instead, which is much simpler than
the code generating it...
2019-03-04 10:52:50 +01:00
Nikita Popov
15711a4db0 Use separate directories for win32 dir tests
Also remove one redundant piece of cleanup code.
2019-03-04 10:36:55 +01:00
Nikita Popov
5e6846cad7 Merge branch 'PHP-7.3' into PHP-7.4 2019-02-28 09:59:07 +01:00
Nikita Popov
019fd1d9ba Merge branch 'PHP-7.2' into PHP-7.3 2019-02-28 09:58:47 +01:00
Nikita Popov
9ad9cc71ff Fixed bug #77669 2019-02-28 09:58:01 +01:00
Nikita Popov
b4cbf6faca Fix tests bareword fallback with error suppression
Re-merge commit a369326003 into PHP-7.4
(cherry picked from commit aad39879f2)
(cherry picked from commit 76f8a908bb)
2019-02-25 17:43:07 +01:00
Nikita Popov
a8daef51e1 Merge branch 'PHP-7.3' into PHP-7.4 2019-02-25 13:02:58 +01:00
Nikita Popov
251e948946 Fix some directory collisions in dir tests 2019-02-25 09:34:20 +01:00
Xinchen Hui
3c3d59aa39 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fixed bug #77664 (Segmentation fault when using undefined constant in custom wrapper)
2019-02-25 14:42:01 +08:00
Xinchen Hui
4a72dd782d Fixed bug #77664 (Segmentation fault when using undefined constant in custom wrapper) 2019-02-25 14:41:46 +08:00
Peter Kokot
b33fa18eab Remove unused PHP_AC_BROKEN_SPRINTF and AC_ZEND_BROKEN_SPRINTF
The sprintf function has been normalized to php_sprintf via
61364b5bb1.

This patch removes the checks to make a custom sprintf function

The ZEND_BROKEN_SPRINTF has been removed and the
hardcoded #define zend_sprintf sprintf is used.

The php_sprintf and zend_sprintf are now symbols to sprintf.

This patch now removes the custom PHP definitions of the php_sprintf and
zend_sprintf functions in favor of the C99 sprintf which is also
standardized in C89 already. Once, on some systems sprintf didn't behave
in same way.
2019-02-23 22:26:47 +01:00
Nikita Popov
914c1ec1d4 Stricter validation for popen mode argument on Windows
Context: The ext/standard/tests/file/popen_pclose_error-win32.phpt
test often fails under parallel testing, because the "is not recognized
as an internal or external command" message doesn't actually have a
guaranteed position in the output.

While looking into this, I noticed that this test on Windows tests
something very different (invalid comand) than on Linux (invalid mode).
Here I'm adjusting the Windows popen implementation so it immediately
fails on a `rw` mode, just like it does on Linux.
2019-02-22 10:50:56 +01:00
Christoph M. Becker
f319419d51 Properly clean up test case
If we had to create an initial $start directory, we should remove it
at the end of the test.
2019-02-22 09:43:12 +01:00
Nikita Popov
be6f1f68bd Remove use of file resources from string function tests
These tests are pointless (they don't even have anything to do
with resources, they just use get_resource_type() as a peculiar way
to create a string), and cause unnecessary IO dependency.
2019-02-21 15:50:35 +01:00
Nikita Popov
cc4c313886 Make (v)fprintf tests more robust
By using a separate file for each test. Also drop some unnecessary
SKIPIF checks for file creation. We assume that files can be created in
the test directories all over the place, so don't check for it here.
2019-02-21 15:40:43 +01:00
Nikita Popov
2210c6823c Merge branch 'PHP-7.3' into PHP-7.4 2019-02-21 12:06:48 +01:00
Nikita Popov
af324e24df Fix issue mentioned in #77302
Apparently Serializable::serialize() can return NULL, which is encoded
as N;. As we do not allow back-references to non-object values in
PHP 7.3 we need to make sure that any references are also compiled to
N;.
2019-02-21 12:04:49 +01:00
Nikita Popov
152e5393e5 Add special "all" conflict
If a test conflicts with "all", then no other tests may be run in
parallel. This is needed for windows_mb_path tests, which rely on
the console codepage, which is shared across all parallel workers.

Also add support for comments in the CONFLICTS section/file.
2019-02-21 11:04:43 +01:00
Nikita Popov
c0e15a3b7f Implement fine-grained conflict handling
Tests can specify conflict keys, either in --CONFLICTS-- or
a per-directory CONFLICTS file. Non-conflicting tests may be run
in parallel.
2019-02-20 11:20:40 +01:00
Nikita Popov
0513d59ed3 Make proc_open_bug69900.phpt more robust against parallelization
With multiple workers running this might take more than 1ms. Bump
this up to the same threshold that was already used for CI.
2019-02-20 11:20:14 +01:00
Nikita Popov
d9094d4d64 Avoid port conflicts in stream socket tests
Also drop some useless --CLEAN-- sections.
2019-02-19 15:55:13 +01:00
Nikita Popov
2f447dd61f Remove spurious + before --CREDITS-- 2019-02-19 15:55:00 +01:00
Nikita Popov
7207686fcf Avoid file conflicts in mail tests 2019-02-19 15:54:46 +01:00
Tyson Andre
9249d82019 Fix typos in code comments [skip ci] 2019-02-18 17:48:12 +01:00
Andrea Faulds
39792f5bb7 run-tests.php: experimental parallel testing support 2019-02-18 14:58:53 +01:00
Tom Van Herreweghe
5b15908ed7 Test the warning for giving full path to dl() 2019-02-17 20:22:23 +01:00
Robrecht Plaisier
31a01302dd Added basic stream_filter_register test 2019-02-14 20:03:35 +01:00
rjhdby
6bf1f434f0 use local resources instead remote 2019-02-14 19:51:40 +01:00
Nikita Popov
96daef0458 Make ABI of SIMD optimized functions independent of compiler flags
Always export these as normal functions and only use function pointers
internally if necessary.
2019-02-14 11:49:21 +01:00
Nikita Popov
8b6dba25c7 Merge branch 'PHP-7.3' into PHP-7.4 2019-02-14 10:43:45 +01:00
Nikita Popov
eb063c8a9f Fixed bug #77612
Port php_setcookie() to use the smart_str API to ensure that there
can be no string truncation issues.
2019-02-14 10:42:59 +01:00
Manuel Kea Baldassarri
ea3cda0315 http_build_query add type cases 2019-02-13 22:00:09 +01:00
Nikita Popov
aaebf3b653 Merge branch 'PHP-7.3' into PHP-7.4 2019-02-12 11:43:53 +01:00
Nikita Popov
5297bed454 Merge branch 'PHP-7.2' into PHP-7.3 2019-02-12 11:43:34 +01:00
DanielCiochiu
07877c46e3 Fixed bug #75546
By respecting the SILENT flag when checking the visibility of a
class constant.
2019-02-12 11:42:33 +01:00
Nikita Popov
9848f24a6a Merge branch 'PHP-7.3' into PHP-7.4 2019-02-12 10:50:29 +01:00
Nikita Popov
2ea5a9cc64 Merge branch 'PHP-7.2' into PHP-7.3 2019-02-12 10:50:22 +01:00
Nikita Popov
8e34de4756 Fixed bug #77608
Remove special handling of doubles and escape them as usual instead.
2019-02-12 10:49:20 +01:00
Nikita Popov
52c2d47c90 Merge branch 'PHP-7.3' into PHP-7.4 2019-02-11 11:33:18 +01:00
Nikita Popov
be64a06b1c Merge branch 'PHP-7.2' into PHP-7.3 2019-02-11 11:33:04 +01:00
johnstevenson
fe4d7248cc Fix #77552: Uninitialized buffer in stat functions 2019-02-11 11:31:55 +01:00
Guilliam Xavier
b3935ed2af Fix tests bareword fallback with error suppression
(cherry picked from commit aad39879f2)
(cherry picked from commit 76f8a908bb)
2019-02-11 09:36:03 +01:00
Mark Niebergall
f28bf785fd Added test for non existent file for iptcembed 2019-02-10 22:43:12 +01:00
Tom Van Herreweghe
3f93f1591e Tests the 'Dynamically loaded extensions are not enabled' warning for dl()
Signed-off-by: Tom Van Herreweghe <tom.van.herreweghe@dx-solutions.be>
2019-02-10 20:13:12 +01:00
Rodrigo Prado
27b366c9e4 Test function quotemeta() - using an empty string is given as str.
Rodrigo Prado de Jesus <royopa [at] gmail [dot] com>
User Group: PHPSP #PHPTestFestBrasil

Test function quotemeta() - using an empty string is given as str.
This test coverage line 2722 from file /ext/standard/string.c and is not a ZPP test.
http://gcov.php.net/PHP_HEAD/lcov_html/ext/standard/string.c.gcov.php#L2722
2019-02-10 20:06:35 +01:00
Pete Albrecht
76703ae5a1 fnmatch error when pattern or filename too long
i3logix PHP Testfest 2017
2019-02-10 19:38:46 +01:00
Anatol Belski
12bfd9a5f5 Implement FR #77377 handle CTRL+C in Windows 2019-02-08 18:10:31 -08:00
David Stockton
e1dd8cd678 Add test for null return on version_compare with bad operator 2019-02-09 02:52:17 +01:00
Peter Kokot
c245898bfa Update and fix remaining year ranges (2019)
This patch follows previous license year ranges updates. With new
approach source code files now have simplified headers with license
information without year ranges.
2019-02-08 23:14:29 +01:00
Nikita Popov
fa123b51cc Fix invalid free 2019-02-08 10:49:54 +01:00
Nikita Popov
b5f852a8cb Some more test removals
Noticed these while implementing error handler changes.
2019-02-05 12:42:18 +01:00
Nikita Popov
8bc663f43b Remove zpp variation tests 2019-02-05 09:38:55 +01: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
Nikita Popov
340c6d3927 Revert "Don't silence fatal errors with @"
This reverts commit abd36289e2.

This wasn't ready for merging yet, there are still some test
failures.
2019-01-31 09:39:10 +01:00
Nikita Popov
abd36289e2
Don't silence fatal errors with @ 2019-01-31 07:11:05 +01:00
Joe Watkins
b8e683e868
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #77546 iptcembed broken function
2019-01-30 17:10:33 +01:00
Guillaume Degoulet
f27f902266
Fix #77546 iptcembed broken function 2019-01-30 17:09:12 +01:00
Zeev Suraski
0cf7de1c70 Remove yearly range from copyright notice 2019-01-30 11:03:12 +02:00
Nikita Popov
8eeb1102d0 Avoid mention of php7 in credits script 2019-01-28 11:26:45 +01:00
Andreas Treichel
b1e9c73b27 Allow strip_tags with an array of allowed tagnames 2019-01-24 15:56:32 +01:00
Dmitry Stogov
ab9a9a6b20 Disallow PHP startup, in case some ext ext/standard sub-module is not initialized sucessfully. 2019-01-24 15:59:33 +03:00
Gabriel Caruso
04723f2101
Make more tests run os MacOS 2019-01-22 19:17:27 -02:00
Nikita Popov
89a4c172e2 Remove the "o" serialization format
We never generate the "o" format during serialization, so let's not
keep this unnecessary attack surface around.
2019-01-22 18:09:49 +01:00
Anatol Belski
1bd7a9d6d1 Merge branch 'PHP-7.3'
* PHP-7.3:
  Skip test on unsuitable build
2019-01-19 13:56:51 +01:00
Anatol Belski
52730fa30a Skip test on unsuitable build
This test reveals a difference between TS and NTS through all the
versions, which is probably too late to fix at this stage of 7.3.
While NTS always relies on the system getcwd(), TS uses a fake CWD
which might get out of sync when the real dir is deleted. Thus,
skip test on unsuitable build. Investigate possibilities to fix this
edge case for later versions.
2019-01-19 13:53:32 +01:00
Anatol Belski
52057c3aa2 Merge branch 'PHP-7.3'
* PHP-7.3:
  Make test output more reliable
2019-01-19 03:34:36 +01:00
Anatol Belski
4254bf87ba Make test output more reliable 2019-01-19 03:33:37 +01:00
Anatol Belski
1f4a04fb3f Merge branch 'PHP-7.3'
* PHP-7.3:
  Fixed bug #77484 Zend engine crashes when calling realpath in invalid working dir
2019-01-19 02:39:42 +01:00
Anatol Belski
8b20e7b68b Fixed bug #77484 Zend engine crashes when calling realpath in invalid working dir 2019-01-19 02:36:51 +01:00
Nikita Popov
1bc86bcdd8 Merge branch 'PHP-7.3' 2019-01-18 15:03:00 +01:00
Nikita Popov
986b9b5ae3 Add additional no_sanitize_address attributes
To fix bug #77447 in release mode as well.
2019-01-18 15:02:30 +01:00
Nikita Popov
345936aeb1 Merge branch 'PHP-7.3' 2019-01-18 12:49:08 +01:00
Nikita Popov
14b5302591 Merge branch 'PHP-7.2' into PHP-7.3 2019-01-18 12:48:52 +01:00
Lauri Kenttä
dbe7f2a41a Fix seeking in php://input 2019-01-18 12:44:47 +01:00
Dmitry Stogov
e6182bd4ea Improved ZEND_TRY_ASSIGN... API to avoid unnecessary double copying and reduce code bloat. 2019-01-18 00:53:48 +03:00
Nikita Popov
e219ec144e Implement typed properties
RFC: https://wiki.php.net/rfc/typed_properties_v2

This is a squash of PR #3734, which is a squash of PR #3313.

Co-authored-by: Bob Weinand <bobwei9@hotmail.com>
Co-authored-by: Joe Watkins <krakjoe@php.net>
Co-authored-by: Dmitry Stogov <dmitry@zend.com>
2019-01-11 15:49:06 +01:00
Nikita Popov
e88a081641 Remove unnecessary Z_PARAM_ZVAL_DEREFs 2019-01-10 15:35:00 +01:00
Nikita Popov
cf3317c790 Merge branch 'PHP-7.3' 2019-01-10 10:58:07 +01:00
Nikita Popov
00e5d0e859 Merge branch 'PHP-7.2' into PHP-7.3 2019-01-10 10:57:41 +01:00
Nikita Popov
5d33024a5d Fixed bug #77439 2019-01-10 10:57:04 +01:00
Stanislav Malyshev
0f148839b5 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix #77367: Negative size parameter in mb_split
  Fix #77369 - memcpy with negative length via crafted DNS response
  Fix more issues with encodilng length
  Fix #77270: imagecolormatch Out Of Bounds Write on Heap
  Fix bug #77380  (Global out of bounds read in xmlrpc base64 code)
  Fix bug #77371 (heap buffer overflow in mb regex functions - compile_string_node)
  Fix bug #77370 - check that we do not read past buffer end when parsing multibytes
  Fix #77269: Potential unsigned underflow in gdImageScale
  Fix bug #77247 (heap buffer overflow in phar_detect_phar_fname_ext)
  Fix bug #77242 (heap out of bounds read in xmlrpc_decode())
  Regenerate certs for openssl tests
2019-01-06 12:50:10 -08:00
Stanislav Malyshev
e40027ef0f Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #77369 - memcpy with negative length via crafted DNS response
  Fix more issues with encodilng length
  Fix #77270: imagecolormatch Out Of Bounds Write on Heap
  Fix bug #77380  (Global out of bounds read in xmlrpc base64 code)
  Fix bug #77371 (heap buffer overflow in mb regex functions - compile_string_node)
  Fix bug #77370 - check that we do not read past buffer end when parsing multibytes
  Fix #77269: Potential unsigned underflow in gdImageScale
  Fix bug #77247 (heap buffer overflow in phar_detect_phar_fname_ext)
  Fix bug #77242 (heap out of bounds read in xmlrpc_decode())
  Regenerate certs for openssl tests
2019-01-06 12:23:53 -08:00
Stanislav Malyshev
fe820fcba6 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix #77369 - memcpy with negative length via crafted DNS response
  Fix more issues with encodilng length
  Fix #77270: imagecolormatch Out Of Bounds Write on Heap
  Fix bug #77380  (Global out of bounds read in xmlrpc base64 code)
  Fix bug #77371 (heap buffer overflow in mb regex functions - compile_string_node)
  Fix bug #77370 - check that we do not read past buffer end when parsing multibytes
  Fix #77269: Potential unsigned underflow in gdImageScale
  Fix bug #77247 (heap buffer overflow in phar_detect_phar_fname_ext)
  Fix bug #77242 (heap out of bounds read in xmlrpc_decode())
  Regenerate certs for openssl tests
2019-01-06 11:57:16 -08:00
Stanislav Malyshev
8d3dfabef4 Fix #77369 - memcpy with negative length via crafted DNS response 2019-01-06 11:39:09 -08:00