1
0
mirror of https://github.com/php/php-src.git synced 2026-04-22 23:48:14 +02:00
Commit Graph

286 Commits

Author SHA1 Message Date
Peter Kokot d679f02295 Sync leading and final newlines in *.phpt sections
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines in all
*.phpt sections.

According to POSIX, a line is a sequence of zero or more non-' <newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.

C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."

Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
2018-10-15 04:33:09 +02:00
Peter Kokot d7a3edd45d Trim trailing whitespace in *.phpt 2018-10-14 19:46:15 +02:00
Gabriel Caruso 9c144e0d82 Trim trailing whitespace in tests 2018-10-14 12:07:20 -03:00
Peter Kokot 1ad08256f3 Sync leading and final newlines in source code files
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines.

According to POSIX, a line is a sequence of zero or more non-' <newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.

C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."

Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
2018-10-14 12:56:38 +02:00
Nikita Popov 01cc547f44 Merge branch 'PHP-7.3' 2018-10-08 13:16:54 +02:00
Nikita Popov d982bbe175 Fix ref ID handling when serializing $GLOBALS
This was already broken previously, but in PHP 7.3 stricter
validation during unserialization made this into an error.
2018-10-08 13:16:23 +02:00
Peter Kokot 5da3ed69a6 Rename *.p5c files to *.inc
When including files in PHP tests a good practice so far has been to use
the *.inc extension. This patch renames few *.p5c files that are
included in phpt files.
2018-09-21 23:21:14 +02:00
Peter Kokot bfa2c7158f Fix permissions
Certain files don't need to be executables.
2018-09-21 14:12:25 +02:00
Gabriel Caruso aac5cdc7d7 Remove superfluous SKIPIF sections of always available interfaces 2018-07-29 18:03:34 -03:00
Nikita Popov 2cc6922cbf Merge branch 'PHP-7.2' 2018-07-02 17:59:33 +02:00
Nikita Popov 3a236d0587 Merge branch 'PHP-7.1' into PHP-7.2 2018-07-02 17:59:15 +02:00
Nikita Popov 787593b708 Fix test after serialization change
And move it to a more appropriate location.
2018-07-02 17:58:26 +02:00
Nikita Popov a57b5e82a9 Merge branch 'PHP-7.2' 2018-07-02 17:30:07 +02:00
Nikita Popov 09bb2527e9 Merge branch 'PHP-7.1' into PHP-7.2 2018-07-02 17:29:32 +02:00
Nikita Popov c793885b76 Fixed bug #74670
Validate that "C" serialization payload is followed by "}" prior to
calling the unserialize() handler. This mitigates issues caused by
unserialize() not correctly handling strings that are not NUL
terminated. Making sure that there is a "}" at the end avoids the
problem.
2018-07-02 17:27:43 +02:00
Pedro Magalhães 13e9a471d7 Fix #76300 - Dont attempt to change visibility of a parent private 2018-06-17 15:53:55 -07:00
Stanislav Malyshev 7d7b7e801e Merge branch 'PHP-7.2'
* PHP-7.2:
  Fix #76300 - Dont attempt to change visibility of a parent private
2018-06-17 15:47:06 -07:00
Pedro Magalhães 2dca8671e4 Fix #76300 - Dont attempt to change visibility of a parent private 2018-05-03 21:54:44 +01:00
Gabriel Caruso ded3d984c6 Use EXPECT instead of EXPECTF when possible
EXPECTF logic in run-tests.php is considerable, so let's avoid it.
2018-02-20 21:53:48 +01:00
Nikita Popov 1a3bdb4a2c Remove some references to E_STRICT in tests
run-tests.php enforces error_reporting=E_ALL (including E_STRICT),
setting this explicitly in not necessary. Conversely, after the
removal of some E_STRICT errors, explicitly excluding it is no
longer necessary in some places.
2018-02-03 18:17:12 +01:00
Christoph M. Becker a0e5af70a7 Add missing SKIPIF section
The test requires the session extension, which may not be available, in
which case the test would fail, which is expected anyway, but not for
the expected reasons.
2018-02-03 13:34:58 +01:00
Dmitry Stogov f26fc527da Fixed unzserialize(), to disable creation of unsupported data structures through manually crafted strings. (Dmitry) 2017-10-13 15:53:11 +03:00
Anatol Belski 689f9956da Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix test failure on 32-bit
2017-09-12 18:19:34 +02:00
Anatol Belski fcad6a97b8 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fix test failure on 32-bit
2017-09-12 18:18:44 +02:00
Anatol Belski 7674b5e574 Fix test failure on 32-bit 2017-09-12 18:17:28 +02:00
Anatol Belski 2f5129cacb Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix test portability
2017-09-11 12:40:11 +02:00
Anatol Belski d33194d2aa Fix test portability
The message comes from the C runtime, so it is not reliable to check the
exact wording.
2017-09-11 12:38:20 +02:00
Xinchen Hui 82d4727dbb Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed bug #75152 (signed integer overflow in parse_iv)

Conflicts:
	ext/standard/var_unserializer.c
2017-09-11 12:47:47 +08:00
Xinchen Hui 6b2813c3a7 Fixed bug #75152 (signed integer overflow in parse_iv) 2017-09-11 12:46:11 +08:00
Dmitry Stogov 389ea45b12 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Made test 32/64-bit independent
2017-08-15 13:13:27 +03:00
Dmitry Stogov 3bc1226804 Made test 32/64-bit independent 2017-08-15 13:12:54 +03:00
Nikita Popov a871badf2a Merge branch 'PHP-7.1' into PHP-7.2 2017-08-12 13:17:24 +02:00
Nikita Popov 4fb7665c09 Merge branch 'PHP-7.0' into PHP-7.1 2017-08-12 13:15:48 +02:00
Nikita Popov 1a23ebc1ff Fixed bug #74103 and bug #75054
Directly fail unserialization when trying to acquire an r/R
reference to an UNDEF HT slot. Previously this left an UNDEF and
later deleted the index/key from the HT.

What actually caused the issue here is a combination of two
factors: First, the key deletion was performed using the hash API,
rather than the symtable API, such that the element was not actually
removed if it used an integral string key. Second, a subsequent
deletion operation, while collecting trailing UNDEF ranges, would
mark the element as available for reuse (leaving a corrupted HT
state with nNumOfElemnts > nNumUsed).

Fix this by failing early and dropping the deletion code.
2017-08-12 13:11:35 +02:00
Pedro Magalhães 7cb5bdf64a Fix #49649 - Handle property visibility changes on unserialization 2017-07-10 07:27:09 +01:00
Stanislav Malyshev d75dbb0e31 Merge branch 'PHP-7.1'
* PHP-7.1:
  Improve fix for #74145
  Fix wddx
  Fix tests
  Fixed bug #74111
  Fix bug #74603 - use correct buffer size
  Fix bug #74651 - check EVP_SealInit as it can return -1
  Update NEWS
  Fix bug #74087
  Fixed parsing of strange formats with mixed month/day and time strings
  Fix bug #74145 - wddx parsing empty boolean tag leads to SIGSEGV
  Fixed bug #74111
  Fix #74435: Buffer over-read into uninitialized memory
  Fix bug #74603 - use correct buffer size
  Fix bug #74651 - check EVP_SealInit as it can return -1
  Update NEWS
  Fix bug #73807
2017-07-04 21:23:16 -07:00
Stanislav Malyshev 0ba04f7737 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Improve fix for #74145
  Fix wddx
  Fix tests
  Fixed bug #74111
  Fix bug #74603 - use correct buffer size
  Fix bug #74651 - check EVP_SealInit as it can return -1
  Update NEWS
  Fix bug #74087
  Fixed parsing of strange formats with mixed month/day and time strings
  Fix bug #74145 - wddx parsing empty boolean tag leads to SIGSEGV
  Fixed bug #74111
  Fix #74435: Buffer over-read into uninitialized memory
  Fix bug #74603 - use correct buffer size
  Fix bug #74651 - check EVP_SealInit as it can return -1
  Update NEWS
  Fix bug #73807
2017-07-04 21:18:10 -07:00
Stanislav Malyshev 0496f5407f Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Update NEWS
  Fix bug #74087
  Fixed parsing of strange formats with mixed month/day and time strings
  Fix bug #74145 - wddx parsing empty boolean tag leads to SIGSEGV
  Fixed bug #74111
  Fix #74435: Buffer over-read into uninitialized memory
  Fix bug #74603 - use correct buffer size
  Fix bug #74651 - check EVP_SealInit as it can return -1
  Update NEWS
  Fix bug #73807
2017-07-04 19:44:51 -07:00
Nikita Popov 3a25a56a92 Fixed bug #74111 2017-07-04 19:38:42 -07:00
Nikita Popov f8c514ba6b Fixed bug #74111 2017-07-04 19:06:16 -07:00
Remi Collet 1be0563087 Merge branch 'PHP-7.1'
* PHP-7.1:
  Adapt for 32-bits which fails at different offset (49 vs 38)
2017-07-04 20:27:10 +02:00
Remi Collet 1fa8e74d6e Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Adapt for 32-bits which fails at different offset (49 vs 38)
2017-07-04 20:26:53 +02:00
Remi Collet 4b38feabe7 Adapt for 32-bits which fails at different offset (49 vs 38) 2017-07-04 20:25:59 +02:00
Anatol Belski b28c6515a6 Merge branch 'PHP-7.1'
* PHP-7.1:
  Fixed bug #74101 and bug #74614
2017-07-04 10:44:50 +02:00
Anatol Belski 2dc24005d9 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #74101 and bug #74614
2017-07-04 10:42:48 +02:00
Nikita Popov d02f953faf Fixed bug #74101 and bug #74614 2017-07-04 10:39:41 +02:00
Nikita Popov 81d8c37b03 Add test for previous commit 2017-03-23 22:37:17 +01:00
xKhorasan 6a1d4cd47a Fixed bug #74300 2017-03-23 22:06:46 +01:00
Nikita Popov 1e196110d3 Fix __sleep() returning undefined declared properties 2017-03-12 22:20:08 +01:00
Nikita Popov 162aa1a5fc Deprecate __autoload() 2017-02-03 18:52:57 +01:00