Commit Graph

1352 Commits

Author SHA1 Message Date
Anatol Belski
1aa30bb71c Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix phar:// include handling with file cache
2019-04-10 14:56:29 +02:00
Anatol Belski
f31d7ca85e Fix phar:// include handling with file cache 2019-04-10 14:55:15 +02:00
rjhdby
e86cdce549 Make zend_hash_sort() return void
This function always succeeds, so remove the success indicator
return value.
2019-03-22 09:51:47 +01:00
Kalle Sommer Nielsen
e632537c83 Remove usage of HAVE_HASH_EXT and COMPILE_DL_HASH as ext/hash is always available (master only) 2019-03-20 20:43:35 +02:00
Peter Kokot
6426420f61 Merge branch 'PHP-7.4'
* PHP-7.4:
  Replace dirname(__FILE__) by __DIR__ in tests
2019-03-15 23:36:47 +01:00
Fabien Villepinte
26dfce7f36 Replace dirname(__FILE__) by __DIR__ in tests 2019-03-15 22:55:30 +01:00
Nikita Popov
585f4cbb21 Merge branch 'PHP-7.3' into PHP-7.4 2019-03-15 17:08:01 +01:00
Xinchen Hui
9f9b2573ed Merge branch 'PHP-7.3'
* PHP-7.3:
  Fixed bug #77697 (Crash on Big_Endian platform)
2019-03-15 16:58:42 +08:00
Xinchen Hui
b419590893 Fixed bug #77697 (Crash on Big_Endian platform) 2019-03-15 16:58:08 +08:00
Nikita Popov
852485d8ec Adjust tests for zpp TypeError change 2019-03-11 11:32:20 +01:00
Peter Kokot
d0fd9fe977 Merge branch 'PHP-7.4'
* PHP-7.4:
  Add AS_HELP_STRING to *nix build configure options
2019-03-07 20:38:04 +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
19e4abd7ec Merge branch 'PHP-7.4' 2019-03-07 15:55:13 +01:00
Nikita Popov
c8e10c6119 More zpp error/variation test removals 2019-03-07 15:54:31 +01:00
Anatol Belski
4a7a79b37a Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix test portability
2019-03-04 14:30:55 +01:00
Anatol Belski
53c44a43dd Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix test portability
2019-03-04 14:30:32 +01:00
Anatol Belski
a976283c34 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix test portability
2019-03-04 14:30:01 +01:00
Anatol Belski
040196972c Fix test portability 2019-03-04 14:28:47 +01:00
Stanislav Malyshev
d2a8904146 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix bug #77586 - phar_tar_writeheaders_int() buffer overflow
  Update NEWS
  Fix test error message
  Fix bug #77563 - Uninitialized read in exif_process_IFD_in_MAKERNOTE
  Fix bug #77540 - Invalid Read on exif_process_SOFn
  Fix integer overflows on 32-bits
  Fix #77431 SplFileInfo::__construct() accepts NUL bytes
  Fix bug #77396 - Null Pointer Dereference in phar_create_or_parse_filename
2019-03-03 23:34:00 -08:00
Stanislav Malyshev
ad4f312d2f Fix bug #77396 - Null Pointer Dereference in phar_create_or_parse_filename 2019-03-03 23:34:00 -08:00
Stanislav Malyshev
071e18c697 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix bug #77586 - phar_tar_writeheaders_int() buffer overflow
2019-03-03 23:33:54 -08:00
Stanislav Malyshev
6d60ed69a1 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix bug #77586 - phar_tar_writeheaders_int() buffer overflow
2019-03-03 23:33:48 -08:00
Stanislav Malyshev
3e8d8f7fb3 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix bug #77586 - phar_tar_writeheaders_int() buffer overflow
2019-03-03 23:33:43 -08:00
Stanislav Malyshev
e0f5d62bd6 Fix bug #77586 - phar_tar_writeheaders_int() buffer overflow 2019-03-03 23:05:32 -08:00
Stanislav Malyshev
534a18c08f Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Update NEWS
  Fix test error message
  Fix bug #77563 - Uninitialized read in exif_process_IFD_in_MAKERNOTE
  Fix bug #77540 - Invalid Read on exif_process_SOFn
  Fix integer overflows on 32-bits
  Fix #77431 SplFileInfo::__construct() accepts NUL bytes
  Fix bug #77396 - Null Pointer Dereference in phar_create_or_parse_filename
2019-03-03 22:20:49 -08:00
Stanislav Malyshev
e3f7c352dc Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Update NEWS
  Fix test error message
  Fix bug #77563 - Uninitialized read in exif_process_IFD_in_MAKERNOTE
  Fix bug #77540 - Invalid Read on exif_process_SOFn
  Fix integer overflows on 32-bits
  Fix #77431 SplFileInfo::__construct() accepts NUL bytes
  Fix bug #77396 - Null Pointer Dereference in phar_create_or_parse_filename
2019-03-03 22:20:42 -08:00
Stanislav Malyshev
8363df3703 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Update NEWS
  Fix test error message
  Fix bug #77563 - Uninitialized read in exif_process_IFD_in_MAKERNOTE
  Fix bug #77540 - Invalid Read on exif_process_SOFn
  Fix integer overflows on 32-bits
  Fix #77431 SplFileInfo::__construct() accepts NUL bytes
  Fix bug #77396 - Null Pointer Dereference in phar_create_or_parse_filename
2019-03-03 22:20:35 -08:00
Stanislav Malyshev
7f0ab7c20c Fix bug #77396 - Null Pointer Dereference in phar_create_or_parse_filename 2019-03-03 18:22:32 -08:00
Nikita Popov
93ee216966 Merge branch 'PHP-7.4' 2019-02-22 11:26:26 +01:00
Nikita Popov
e2cc0b823c Fix more file name collisions in phar tests 2019-02-22 11:25:52 +01:00
Nikita Popov
3b5e566e62 Merge branch 'PHP-7.4' 2019-02-22 10:53:28 +01:00
Nikita Popov
d3e00decd4 Use separate files in phar tests 2019-02-22 10:50:56 +01:00
Peter Kokot
17baa87fad Merge branch 'PHP-7.4'
* PHP-7.4:
  Update and fix remaining year ranges (2019)
2019-02-08 23:15:49 +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
Dmitry Stogov
91ef4124e5 Refactor zend_object_handlers API to pass zend_object* and zend_string* insted of zval(s). 2019-02-04 13:20:25 +03:00
Peter Kokot
623911f993 Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove local variables
2019-02-03 21:23:18 +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
0dfd918ee7 Remove support for __autoload()
There are probably some improvements we can do to the SPL
implementation now that __autoload() is gone. In particular having
EG(autoload_func) as a property zend function, rather than a simple
callback probably doesn't make sense.
2019-01-30 14:00:16 +01:00
jvoisin
fbdaabba62 Fix some sign-related issues in comparisons 2019-01-09 10:01:12 +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
78bd347774 Fix bug #77247 (heap buffer overflow in phar_detect_phar_fname_ext) 2019-01-06 11:38:46 -08:00
Dmitry Stogov
c706adaaab Added missing invalidations. 2018-12-28 00:14:49 +03:00
Dmitry Stogov
675a8a64c3 Use HT_IS_INITIALIZED() and HT_INVALIDATE() macros instead of hackish HT_FLAGS assumtions. 2018-12-27 22:48:25 +03:00
Dmitry Stogov
c2179309f4 Removed useless check 2018-12-27 22:35:37 +03:00
Stanislav Malyshev
c3ca95dad2 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix bug #77143 - add more checks to buffer reads
  Fix bug #77143 - add more checks to buffer reads
  Fix #77020: null pointer dereference in imap_mail
2018-12-03 00:43:00 -08:00
Stanislav Malyshev
3d8d13f7b9 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix bug #77143 - add more checks to buffer reads
  Fix bug #77143 - add more checks to buffer reads
  Fix #77020: null pointer dereference in imap_mail
  Don't need interactive progress on git clones in Travis
  Fix TSRM signature - php_stream_stat macro has it's own TSRM
  Regenerate certificates for openssl tests
  Improve test for bug77022
2018-12-03 00:42:55 -08:00
Stanislav Malyshev
8fff90250b Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix bug #77143 - add more checks to buffer reads
  Fix bug #77143 - add more checks to buffer reads
  Fix #77020: null pointer dereference in imap_mail
2018-12-03 00:42:50 -08:00
Stanislav Malyshev
8ab5d22332 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fix bug #77143 - add more checks to buffer reads
  Fix bug #77143 - add more checks to buffer reads
  Fix #77020: null pointer dereference in imap_mail
2018-12-03 00:42:45 -08:00
Stanislav Malyshev
5718d73dbb Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix bug #77143 - add more checks to buffer reads
2018-12-03 00:42:35 -08:00
Stanislav Malyshev
48f0f73f75 Fix bug #77143 - add more checks to buffer reads 2018-12-03 00:41:46 -08:00
Stanislav Malyshev
66a0f061f6 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix bug #77143 - add more checks to buffer reads
  Fix #77020: null pointer dereference in imap_mail
2018-12-03 00:39:03 -08:00
Stanislav Malyshev
54212674b9 Fix bug #77143 - add more checks to buffer reads 2018-12-03 00:03:10 -08:00
Gabriel Caruso
cdd8368d6f Clean up unnecessary ternary expressions and simplify some returns
- Simplify conditions
- Use ZEND_HASH_APPLY_* instead of hard-coded booleans
- Use ZEND_NORMALIZE_BOOL
- Drop sign in favor of ZEND_NORMALIZE_BOOL
2018-12-03 01:22:14 +01:00
Stanislav Malyshev
377562fc6f Merge branch 'PHP-7.2'
* PHP-7.2:
  Fix TSRM signature - php_stream_stat macro has it's own TSRM
  Regenerate certificates for openssl tests
  Improve test for bug77022
2018-12-02 15:12:21 -08:00
Stanislav Malyshev
1225467d8a Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix TSRM signature - php_stream_stat macro has it's own TSRM
  Regenerate certificates for openssl tests
  Improve test for bug77022
2018-12-02 15:12:15 -08:00
Stanislav Malyshev
f8eac1f438 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fix TSRM signature - php_stream_stat macro has it's own TSRM
  Regenerate certificates for openssl tests
  Improve test for bug77022
2018-12-02 13:38:59 -08:00
Stanislav Malyshev
6e3f5d57d4 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix TSRM signature - php_stream_stat macro has it's own TSRM
  Regenerate certificates for openssl tests
  Improve test for bug77022
2018-12-02 13:18:07 -08:00
Stanislav Malyshev
aabdb71dc3 Fix TSRM signature - php_stream_stat macro has it's own TSRM 2018-12-02 12:54:19 -08:00
Stanislav Malyshev
2fba1e2f59 Improve test for bug77022 2018-12-02 12:06:13 -08:00
Stanislav Malyshev
494d5d2429 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix bug #77022 - use file mode or umask for new files
2018-12-01 21:49:53 -08:00
Stanislav Malyshev
b1446521d7 Fix bug #77022 - use file mode or umask for new files 2018-12-01 21:48:49 -08:00
Stanislav Malyshev
e614b12712 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
2018-12-01 21:48:44 -08:00
Stanislav Malyshev
c5869fd1c8 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
2018-12-01 21:48:40 -08:00
Stanislav Malyshev
09885f78c6 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
2018-12-01 21:48:35 -08:00
Stanislav Malyshev
cea277048d Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix bug #77022 - use file mode or umask for new files
2018-12-01 21:48:27 -08:00
Stanislav Malyshev
cc84d893c7 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix bug #77022 - use file mode or umask for new files
2018-12-01 21:47:49 -08:00
Stanislav Malyshev
8136d130b6 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix bug #77022 - use file mode or umask for new files
2018-12-01 21:47:44 -08:00
Stanislav Malyshev
1aec05defd Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fix bug #77022 - use file mode or umask for new files
2018-12-01 21:47:37 -08:00
Stanislav Malyshev
67f3615102 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix bug #77022 - use file mode or umask for new files
2018-12-01 21:08:38 -08:00
Stanislav Malyshev
69f5e7992b Fix bug #77022 - use file mode or umask for new files 2018-12-01 21:06:45 -08:00
Nikita Popov
2fac9d9ec1 Remove some mentions of RECOVERABLE_ERROR in tests
Mostly drop error handlers that are no longer necessary.
2018-11-15 22:13:46 +01:00
Dmitry Stogov
0f7f1498be Use ZEND_THIS macro to hide implementation details in extensions code. 2018-11-15 19:54:19 +03:00
Dmitry Stogov
c6ad0b92b7 Replace getThis() by EX(This), when additional check is not necessary. 2018-11-14 02:44:25 +03:00
Peter Kokot
f0251a8b16 Remove lexer files generated by RE2C
This patch removes generated lexer files by re2c during the build
process so they are not tracked by Git yet can be still shipped when
PHP is released. The genfiles script additionally provides generation
of these lexer files when creating a release of the PHP source code.

The genfiles script refactorings:
- added file header
- echoing steps instead of comments
- cleaning only lines starting with `#line`
- eval removed in favor of direct executed commands
- the debug mode `set -x` removed
- script can be called from any path
- improved comments
2018-11-11 02:55:46 +01:00
Zeev Suraski
9afce019e0 Future-proof email addresses 2018-11-01 18:35:32 +02:00
Zeev Suraski
67e0138c0d Future-proof email addresses... 2018-11-01 18:30:28 +02:00
Peter Kokot
d6c05c6cd1 Rename two *.php files in tests folders
Current run-tests.php script produces the `*.php` files from the
*.phpt. So all *.php files in tests folders are ignored by Git.

To avoid confusion and to for bettere consistency this patch renames
two remaining tests/*/*.php files to *.inc and *.phar as current
practice in *.phpt files.

- The `ext/curl/tests/resonder/get.php` to .inc extension
- The `ext/phar/tests/files/pear2coverage.phar.php` to .phar extension
2018-10-20 10:11:29 +02:00
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
b746e69887 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:32:30 +02:00
Peter Kokot
f1d7e3ca0b 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:31:31 +02:00
Peter Kokot
113213f027 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:29:24 +02:00
Peter Kokot
d7a3edd45d Trim trailing whitespace in *.phpt 2018-10-14 19:46:15 +02:00
Peter Kokot
782352c54a Trim trailing whitespace in *.phpt 2018-10-14 19:45:12 +02:00
Peter Kokot
17ccbeec32 Trim trailing whitespace in *.phpt 2018-10-14 19:44:14 +02:00
Peter Kokot
7af945e271 Trim trailing whitespace in *.phpt 2018-10-14 19:43:12 +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
Peter Kokot
1c850bfcca 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:55:24 +02:00
Peter Kokot
60a69daec6 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:54:08 +02:00
Peter Kokot
03f3b8479b 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:51:01 +02:00
Peter Kokot
37c329d715 Trim trailing whitespace in source code files 2018-10-13 14:17:28 +02:00
Peter Kokot
3362620b5f Trim trailing whitespace in source code files 2018-10-13 14:16:33 +02:00
Peter Kokot
902d39a3a7 Trim trailing whitespace in source code files 2018-10-13 14:14:50 +02:00
Peter Kokot
7f6387b59a Trim trailing whitespace in source code files 2018-10-13 14:12:55 +02:00
Peter Kokot
3f72c77ce4 Convert CRLF line endings to LF
This patch simplifies line endings tracked in the Git repository and
syncs them to all include the LF style instead of the CRLF files.

Newline characters:
- LF (\n) (*nix and Mac)
- CRLF (\r\n) (Windows)
- CR (\r) (old Mac, obsolete)

To see which line endings are in the index and in the working copy the
following command can be used:
`git ls-files --eol`

Git additionally provides `.gitattributes` file to specify if some files
need to have specific line endings on all platforms (either CRLF or LF).

Changed files shouldn't cause issues on modern Windows platforms because
also Git can do output conversion is core.autocrlf=true is set on
Windows and use CRLF newlines in all files in the working tree.

Unless CRLF files are tracked specifically, Git by default tracks all
files in the index using LF newlines.
2018-10-13 11:21:27 +02:00
Peter Kokot
c951836721 Remove unused files
- ext/simplexml/tests/bug25756_1.xml
- ext/simplexml/tests/bug25756_2.xml
- ext/simplexml/tests/bug25756.xsd
Added via 503d74aa29 and then removed via
9e29f17493

- ext/mysqli/tests/cacert.pem
- ext/mysqli/tests/client-cert.pem
- ext/mysqli/tests/client-key.pem
Added via e9f9f66f2e and then removed via
6d51b7b2e3

- ext/gd/tests/simpletext私はガラスを食べられます.jpg
Added via 3d3f11ede4 and never used

- ext/gd/tests/src.png
Added via cc938b5df0 and never used

- ext/zlib/tests/gzgetss.test
Added via d536ecac5c as a file content of the
ext/zlib/tests/gzgetss.gzbut but never used in tests directly. Removed for
better clarity of zlib tests

- ext/soap/tests/interop/Round3/GroupD/round3_groupD_import2_absolute.wsdl
- ext/soap/tests/interop/Round4/GroupG/round4_groupG_mimerpc.wsdl
- ext/soap/tests/interop/Round4/GroupG/round4_groupG_mimedoc.wsdl
Added via 1d25fc5c7b and never used

- ext/reflection/tests/exception.inc
Removed via 9f8ba2e8a1

- ext/phar/tests/files/extracted.inc
Removed via 549bf83bd1

- ext/phar/tests/cache_list/files/extracted.inc
Added via 05c3104097 and never used
2018-09-26 12:54:20 +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
f72b6c5e19
Use EXPECT instead of EXPECTF when possible 2018-09-16 15:39:18 -03:00
Tyson Andre
26f952b175 Fix a typo in a class catch in Phar 2018-09-13 11:48:42 +02:00
Nikita Popov
4cbabb6852 Merge branch 'PHP-7.2' into PHP-7.3 2018-09-04 05:32:52 +02:00
Nikita Popov
08addfea86 Merge branch 'PHP-7.1' into PHP-7.2 2018-09-04 05:32:42 +02:00
Nikita Popov
f1f39d7ed7 Fix parenthesis warning 2018-09-04 05:32:25 +02:00
Anatol Belski
1ccc4ff260 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix stack underflow in phar
2018-08-30 19:34:01 +02:00
Anatol Belski
7fb7869e13 Fix stack underflow in phar
The checks can issue reads below and above the temporary buffer. A read
itself doesn't seem dangerous, but the condition result can be
arbitrary. Such reads have to be avoided. Likely this patch should be
backported.

(cherry picked from commit b053beee7e)
2018-08-30 19:33:07 +02:00
Peter Kokot
3ceecaa9a0 Replace HAVE_ST_BLOCKS with HAVE_STRUCT_STAT_ST_BLOCKS
Since Autoconf 2.50+ macro AC_STRUCT_ST_BLOCKS defines the new
HAVE_STRUCT_STAT_ST_BLOCKS symbol and has deprecated the previous
HAVE_ST_BLOCKS.

PHP 5.3 required Autoconf 2.13 (released in 1999) or newer, since PHP
5.4 the autoconf 2.59 (released in 2003) or newer was required, and
since PHP 7.2, autoconf 2.64 (released in 2008) or newer is required.
2018-08-24 18:33:23 +02:00
Anatol Belski
2dfb74682f Merge branch 'PHP-7.3'
* PHP-7.3:
  Sync with e0fe6674
2018-08-13 09:22:07 +02:00
Anatol Belski
fdaa540fd8 Sync with e0fe6674 2018-08-13 09:18:38 +02:00
Gabriel Caruso
84b195d9fc Fix some misspellings 2018-08-12 16:15:45 +02:00
Peter Kokot
f689223b4e Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix bug #76030 RE2C_FLAGS rarely honoured
2018-08-12 11:16:06 +02:00
Cristian Rodríguez
e0fe667421 Fix bug #76030 RE2C_FLAGS rarely honoured
Since PHP 5.3 the default lexer generator is RE2C. On Unix-alike build
systems there is also optional configure option --enable-re2c-cgoto
which enables optimized conditional jumps using non-standard computed
goto extension. It is available since RE2C 0.10.3 so it's well covered
by RE2C versions PHP uses. This patch syncs usage of -g option accross
the PHP Unix-alike build system.
2018-08-12 11:15:18 +02:00
Levi Morrison
29b56a878a Quell GCC warning on mixing || and && 2018-08-11 16:54:21 -06:00
Gabriel Caruso
f47cdd1ee0
Remove invalid SKIPIF sections and make more tests run 2018-08-07 21:23:21 -03:00
Anatol Belski
8d9541b6c8 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix stack underflow in phar
2018-08-06 22:44:32 +02:00
Anatol Belski
b053beee7e Fix stack underflow in phar
The checks can issue reads below and above the temporary buffer. A read
itself doesn't seem dangerous, but the condition result can be
arbitrary. Such reads have to be avoided. Likely this patch should be
backported.
2018-08-06 22:43:45 +02:00
Gabriel Caruso
0e0019f694
Remove superfluous checks of always available functions 2018-08-03 00:13:01 -03:00
Peter Kokot
d2184efb7b Replace obsolete AC_STRUCT_ST_BLKSIZE and AC_STRUCT_ST_RDEV
Autoconf 2.50 released in 2001 has made several macros obsolete. Instead
of the AC_STRUCT_ST_BLKSIZE and AC_STRUCT_ST_RDEV the new
AC_CHECK_MEMBERS should be used.

When checking for the presence of stat struct members st_blkzize and
st_rdev the new AC_CHECK_MEMBERS macro defines new constants
HAVE_STRUCT_STAT_ST_BLKSIZE and HAVE_STRUCT_STAT_ST_RDEV.

Old constants HAVE_ST_BLKSIZE and HAVE_ST_RDEV need to be replaced
respectively in PHP code (this patch) and in PHP extenstions if they use
them.

PHP 5.4 to 7.1 require Autoconf 2.59+ version, PHP 7.2 and above require
2.64+ version, and the PHP 7.2 phpize script requires 2.59+ version which
are all greater than above mentioned 2.50 version.
2018-07-29 13:59:40 +02:00
Peter Kokot
8d3f8ca12a Remove unused Git attributes ident
The $Id$ keywords were used in Subversion where they can be substituted
with filename, last revision number change, last changed date, and last
user who changed it.

In Git this functionality is different and can be done with Git attribute
ident. These need to be defined manually for each file in the
.gitattributes file and are afterwards replaced with 40-character
hexadecimal blob object name which is based only on the particular file
contents.

This patch simplifies handling of $Id$ keywords by removing them since
they are not used anymore.
2018-07-25 00:53:25 +02:00
Gabriel Caruso
49c193eeb3
Make more tests run and fix SKIPIF sections 2018-07-16 00:01:46 -03:00
Dmitry Stogov
67b4c3379a Uze ZVAL_COPY_DEREF() instead of ZVAL_DEREF() and ZVAL_COPY() 2018-07-09 12:46:46 +03:00
Dmitry Stogov
169d454593 Use zval_ptr_dtor() imstead of zval_dtor() 2018-07-05 17:55:54 +03:00
Dmitry Stogov
43d5a3665d It's safer to use zval_ptr_dtor() for iterator keys. 2018-07-05 16:56:52 +03:00
Dmitry Stogov
3780b027dd Use zval_ptr_dtor() instead of zval_dtor() in internal functions that destroy new created object (This is safer and produces less code) 2018-07-05 14:25:17 +03:00
Dmitry Stogov
b6fb584505 Replace zval_dtor() with specialized destructors 2018-07-05 13:32:39 +03:00
Dmitry Stogov
4a475a4976 Replace legacy zval_dtor() by zval_ptr_dtor_nogc() or even more specialized destructors.
zval_dtor() doesn't make a lot of sense in PHP-7.* and it's used incorrectly in some places.
Its occurances should be replaced by zval_ptr_dtor() or zval_ptr_dtor_nogc(), or even more specialized destructors.
2018-07-04 19:22:24 +03:00
Peter Kokot
7c04219098 Fix pecl vs ext typo in phar
Phar phpinfo output lists also info about bz2 extension if it's
disabled and a quick info about installation. Instead of not maintained
pecl package bz2 the ext/bz2 should be mentioned. Also some outdated
pecl/phar are updated to ext/phar instead in test comments.
2018-06-30 15:35:43 +02:00
Peter Kokot
3f96f01e9e Bump phar and hash extension version to match PHP version 2018-06-21 13:15:32 +02:00
David Carlier
80bb649ad1 phar module, unsignedness check changes.
while at it, correcting seemingly subtle bug when checking
extension validity.
2018-06-18 14:08:50 +00:00
Peter Kokot
7bf091c5c2 Remove SVN revision from phar phpinfo output
The SVN revision was utilized with Subversion. The Git ident
attribute applies only for particular file and since other core
extensions don't output this information anymore this patch
removes it from the phpinfo output to sync and make the phpinfo
core extensions more consistent.
2018-06-16 12:47:33 +02:00
Dmitry Stogov
0b90cf85a6 Removed "dead" code (zend_hash_update() never fails) 2018-06-01 11:58:57 +03:00
Dmitry Stogov
5eb1f92f31 Use zend_string_release_ex() instread of zend_string_release() in places, where we sure about string persistence. 2018-05-28 16:27:12 +03:00
Stanislav Malyshev
99f1d904a0 Merge branch 'PHP-7.2'
* PHP-7.2:
  Fix tsrm_ls
  Fix #76129 - remove more potential unfiltered outputs for phar
  Fix test
  Fix bug #76248 - Malicious LDAP-Server Response causes Crash
  Fix bug #76249 - fail on invalid sequences
  Fix #76130: Heap Buffer Overflow (READ: 1786) in exif_iif_add_value
  Fix bug #75981: prevent reading beyond buffer start
2018-04-23 22:04:22 -07:00
Stanislav Malyshev
4c06d929c0 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix tsrm_ls
  Fix #76129 - remove more potential unfiltered outputs for phar
  Fix test
  Fix bug #76248 - Malicious LDAP-Server Response causes Crash
  Fix bug #76249 - fail on invalid sequences
  Fix #76130: Heap Buffer Overflow (READ: 1786) in exif_iif_add_value
  Fix bug #75981: prevent reading beyond buffer start
2018-04-23 22:03:33 -07:00
Stanislav Malyshev
95ee9efa57 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fix tsrm_ls
  Fix #76129 - remove more potential unfiltered outputs for phar
  Fix test
  Fix bug #76248 - Malicious LDAP-Server Response causes Crash
  Fix bug #76249 - fail on invalid sequences
  Fix #76130: Heap Buffer Overflow (READ: 1786) in exif_iif_add_value
  Fix bug #75981: prevent reading beyond buffer start
2018-04-23 22:00:24 -07:00
Stanislav Malyshev
5a18d7a0df Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix tsrm_ls
  Fix #76129 - remove more potential unfiltered outputs for phar
  Fix test
  Fix bug #76248 - Malicious LDAP-Server Response causes Crash
  Fix bug #76249 - fail on invalid sequences
  Fix #76130: Heap Buffer Overflow (READ: 1786) in exif_iif_add_value
  Fix bug #75981: prevent reading beyond buffer start
2018-04-23 21:59:57 -07:00
Stanislav Malyshev
6e64aba47f Fix #76129 - remove more potential unfiltered outputs for phar 2018-04-23 13:43:43 -07:00
Stanislav Malyshev
03108697b8 Merge branch 'PHP-7.2'
* PHP-7.2:
  Add a bit of defensive conding for bug #76155
2018-04-22 20:28:44 -07:00
Stanislav Malyshev
83e7618f05 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Add a bit of defensive conding for bug #76155
2018-04-22 20:28:35 -07:00
Stanislav Malyshev
ff83c00715 Add a bit of defensive conding for bug #76155
Even though it should not be ever negative, since strlen() is size_t
better to be safe than sorry.
2018-04-22 20:27:42 -07:00
Anatol Belski
2e5ac355b9 Move to unsigned types in phar
Preventing integer overflows in principle, which allows to avoid additional
range checks. The phar format is based on 32-bit lengths, so the storage
sizes was kept same.
2018-04-18 20:15:05 +02:00
solotandem
94b4abdbc4
Be consistent in is_executable on a directory in any stream wrapper.
Current code treats the 'local files' stream wrapper ('php_plain_files_wrapper')
  different than all other stream wrappers. For the 'local' stream wrapper,
  is_executable only checks the mode key in the filestat array on the file or
  directory in question. For other stream wrappers, is_executable always returns
  FALSE on a directory. This treatment is inconsistent on its face.

  Also, for a custom stream wrapper that also points to local files, the result
  of is_executable is always FALSE even though it may be TRUE if the function were
  called on the same item using the 'local' stream wrapper from PHP.

  NOTE: patch does not attempt to add a test for this as there are no tests of
  is_executable for stream wrappers.
2018-03-27 21:49:26 +02:00
Niklas Keller
e459d27315 Drop double CHECK_NULL_PATH check for PHARs 2018-03-23 19:04:47 +01:00
Xinchen Hui
f4da273c76 Merge branch 'PHP-7.2'
* PHP-7.2:
  Fixed bug #76085 (Segmentation fault in buildFromIterator when directory name contains a \n)
2018-03-13 12:56:27 +08:00
Xinchen Hui
e547c9f139 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed bug #76085 (Segmentation fault in buildFromIterator when directory name contains a \n)
2018-03-13 12:52:07 +08:00
Xinchen Hui
4ee9098514 Fixed bug #76085 (Segmentation fault in buildFromIterator when directory name contains a \n) 2018-03-13 12:51:26 +08:00
Gabriel Caruso
701437a948
Remove return types from some magic method in protos
__construct, __destruct, __wakeup does not have return types defined.
2018-03-09 12:04:46 +01:00
Gabriel Caruso
b895690dfa
remove support for string|unicode in tests 2018-02-22 08:11:30 +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
Gabriel Caruso
21e3b0c70c Remove trailing whitespace in inc files 2018-02-10 19:20:23 +01:00
Joe
c8e844be35
Merge branch 'PHP-7.2'
* PHP-7.2:
  Fixed bug #65414
2018-02-08 10:34:38 +01:00
Bishop Bettini
d806d0315f
Fixed bug #65414 2018-02-08 10:32:08 +01:00
Bishop Bettini
4765ba7dc3
Fixed bug #65414 2018-02-08 10:29:56 +01:00
Gabriel Caruso
fef879a2d6 Use bool instead of boolean while throwing a type error
PHP requires boolean typehints to be written "bool" and disallows
"boolean" as an alias. This changes the error messages to match
the actual type name and avoids confusing messages like "must be
of type boolean, boolean given".

This a followup to ce1d69a1f6, which
implements the same change for integer->int.
2018-02-04 23:09:40 +01:00
Gabriel Caruso
ce1d69a1f6 Use int instead of integer in type errors
PHP requires integer typehints to be written "int" and does not
allow "integer" as an alias. This changes type error messages to
match the actual type name and avoids confusing messages like
"must be of the type integer, integer given".
2018-02-04 19:08:23 +01:00
Gabriel Caruso
9a4cc52c23 Remove superfluous PHP version check in tests
Also remove tests that target only old PHP versions.
2018-02-04 16:58:54 +01:00
Gabriel Caruso
84488d921b Remove superfluous SKIPIF sections in more tests 2018-02-04 16:57:08 +01:00
Nikita Popov
4a7dacb5ee Don't loop over indexes in Phar::extractTo()
Instead use a more idiomatic foreach loop. The behavior is not
strictly the same, but I see no reason why this specific case
should enforce continuously indexed integer keys.

Also handle references in the array while at it.
2018-01-28 22:05:44 +01:00
Nikita Popov
d79a0bf748 Merge branch 'PHP-7.2' 2018-01-28 21:53:38 +01:00
Bishop Bettini
fa586cee3e Fixed bug #54289
If a directory is passed to Phar::extractTo(), loop over all
entries and extract all files with the given prefix.
2018-01-28 21:51:25 +01:00
Dmitry Stogov
9cbb521094 Access HashTable.u.flags through HT_FLAGS() macro. 2018-01-22 13:36:15 +03:00
Anatol Belski
89463341c8 Merge branch 'PHP-7.2'
* PHP-7.2:
  Allow pecl like usage in ext/phar, closes #2955
2018-01-15 14:26:22 +01:00
Anatol Belski
c5768a7e24 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Allow pecl like usage in ext/phar, closes #2955
2018-01-15 14:25:45 +01:00
Anatol Belski
2d4fb56c1d Allow pecl like usage in ext/phar, closes #2955 2018-01-15 14:23:46 +01:00
Bishop Bettini
cb7387275f Add test for bug #66960 2018-01-15 12:20:10 +01:00
Xinchen Hui
a76eeea736 Merge branch 'PHP-7.2'
* PHP-7.2:
  Happy new year (Update copyright to 2018)

Conflicts:
	ext/phar/LICENSE
2018-01-03 16:02:15 +08:00
Xinchen Hui
0e62639d28 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Happy new year (Update copyright to 2018)
2018-01-03 16:00:34 +08:00
Lior Kaplan
fbfdd1e1c4 Happy new year (Update copyright to 2018) 2018-01-02 23:42:29 +02:00
Xinchen Hui
a7fe2570d3 Merge branch 'master' of git.php.net:/php-src
* 'master' of git.php.net:/php-src:
  Update NEWS
  Fixed bug #75571: Potential infinite loop in gdImageCreateFromGifCtx
  Fix bug #74782: remove file name from output to avoid XSS
2018-01-02 13:50:40 +08:00
Xinchen Hui
e8eb52dc98 Merge branch 'PHP-7.2' of git.php.net:/php-src into PHP-7.2
* 'PHP-7.2' of git.php.net:/php-src:
  Update NEWS
  Fixed bug #75571: Potential infinite loop in gdImageCreateFromGifCtx
  Fix bug #74782: remove file name from output to avoid XSS
2018-01-02 13:50:18 +08:00
Xinchen Hui
bd23bcec3e Merge branch 'PHP-7.1' of git.php.net:/php-src into PHP-7.1
* 'PHP-7.1' of git.php.net:/php-src:
  Update NEWS
  Fixed bug #75571: Potential infinite loop in gdImageCreateFromGifCtx
  Fix bug #74782: remove file name from output to avoid XSS
2018-01-02 13:49:58 +08:00
Stanislav Malyshev
05eb5cda50 Merge branch 'PHP-7.2'
* PHP-7.2:
  Update NEWS
  Fixed bug #75571: Potential infinite loop in gdImageCreateFromGifCtx
  Fix bug #74782: remove file name from output to avoid XSS
2018-01-01 21:07:30 -08:00
Stanislav Malyshev
a68dc899bb Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Update NEWS
  Fixed bug #75571: Potential infinite loop in gdImageCreateFromGifCtx
  Fix bug #74782: remove file name from output to avoid XSS
2018-01-01 21:07:21 -08:00
Xinchen Hui
a6519d0514 year++ 2018-01-02 12:57:58 +08:00
Xinchen Hui
7a7ec01a49 year++ 2018-01-02 12:55:14 +08:00
Xinchen Hui
ccd4716ec7 year++ 2018-01-02 12:53:31 +08:00
Stanislav Malyshev
92c19f8a26 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Update NEWS
  Fixed bug #75571: Potential infinite loop in gdImageCreateFromGifCtx
  Fix bug #74782: remove file name from output to avoid XSS
2018-01-01 20:52:34 -08:00
Stanislav Malyshev
459ab2eef4 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Update NEWS
  Fixed bug #75571: Potential infinite loop in gdImageCreateFromGifCtx
  Fix bug #74782: remove file name from output to avoid XSS
2018-01-01 20:28:01 -08:00
Stanislav Malyshev
73ca9b3773 Fix bug #74782: remove file name from output to avoid XSS 2018-01-01 19:51:02 -08:00
Dmitry Stogov
b864e6b58c Move constants into read-only data segment 2017-12-15 01:55:00 +03:00
Dmitry Stogov
0f06df310c Turn "php_stream_wrapper"s into constants
Keep non-constant "php_stream_wrapper"s in API functions and callbacks for compatibility.
2017-12-14 22:46:22 +03:00
Dmitry Stogov
83e495e0fd Move constants into read-only data segment 2017-12-14 22:14:36 +03:00
Dmitry Stogov
9e709e2fa0 Move constants into read-only data segment 2017-12-14 18:43:44 +03:00
Peter Kokot
2783b1c823 Remove outdated TODO files
Some extensions included TODO files that has been present for several
years in the repository tree without changes. This included:

- ext/phar
- ext/intl
- ext/zip
- ext/soap
- ext/pdo
- ext/spl
- ext/dom
- ext/gmp
- ext/xmlwriter
- ext/xmlreader

ext/phar feature request has been created instead, and for others it
would be better to use wiki and RFC workflow instead based on current
feature requests and further PHP development requirements.

[ci skip]
2017-12-09 19:18:58 +01:00
Nikita Popov
95e9cc2871 Backport some printf() fixes to 7.2 2017-11-16 21:26:33 +01:00
Nikita Popov
26f8fc833b Enable and fix printf() format warnings
Add _unchecked() variants of zend_spprintf and zend_strpprintf for
cases where we specifically want to disable these checks, such as
use of %H.
2017-11-16 21:15:36 +01:00
Dmitry Stogov
238916b5c9 Use persistent strings for preloaded phar files 2017-11-02 19:28:34 +03:00
Peter Kokot
8d587f09c0
Refactor ext/phar License info 2017-10-19 11:59:12 +01:00
Anatol Belski
05b9f967a9 Merge branch 'PHP-7.2'
* PHP-7.2:
  Fix path in makefile fragment
2017-10-10 14:33:31 +02:00
Anatol Belski
ad279bd180 Fix path in makefile fragment 2017-10-10 14:32:19 +02:00
Kalle Sommer Nielsen
cf1d42e001 Kill compiler warnings in ext/phar 2017-08-24 02:31:52 +02:00
Kalle Sommer Nielsen
c34ba92782 Get rid of all these old package[2].xml files, most of these had no had a release since PHP4, or any release at all in close to 10 years, some even did not have a package registered at pecl
OCI, PDO_OCI and zip are left as they are actively developed and released there
2017-08-17 22:09:29 +02:00
Xinchen Hui
513b0093c2 Refactor php_url struct to save memory dup in common cases 2017-08-06 17:48:05 +08:00
Anatol Belski
87192f0fab Merge branch 'PHP-7.2'
* PHP-7.2:
  add missing makefile fragment for .w32
2017-07-28 07:30:23 +02:00
Anatol Belski
80d839d25a add missing makefile fragment for .w32
ensure correct dir
2017-07-28 07:26:11 +02:00
Anatol Belski
827284ec36 fix up porting mistakes 2017-07-27 23:38:04 +02:00
Anatol Belski
49d9b3013f Move cwd_state and path related routines to size_t
Having `int` there is no real profit in the size or speed, while unsigned
improves security and overall integration. ZPP supplied strings can
be then accepted directly and structs can be still handled with smaller
unsigned types for size reasons, which is safe. Yet some related places
are to go.

basic move tsrm_realpath_r to size_t

fix conditions and sync with affected places

touch ocurrences of php_sys_readlink usage

follow up on phar path handling

remove duplicated check

move zend_resolve_path and related pieces to size_t

touch yet resolve path related places

remove cast

missing pieces

missing piece

yet cleanups for php_sys_readlink for ssize_t

fix wrong return
2017-07-27 20:11:21 +02:00
Joe Watkins
d3060a00d1
Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix bug #74991 - include_path has a 4096 char (minus "__DIR__:") limit, in some PHAR cases
2017-07-26 10:47:49 +01:00
Joe Watkins
bb9ea4e88b
Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fix bug #74991 - include_path has a 4096 char (minus "__DIR__:") limit, in some PHAR cases
2017-07-26 10:47:22 +01:00
Benjamin W. Broersma
6b1fbafdf0
Fix bug #74991 - include_path has a 4096 char (minus "__DIR__:") limit, in some PHAR cases 2017-07-26 10:46:50 +01:00
Joe Watkins
515b396889
Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Update copyright year to 2017
2017-07-24 17:24:22 +01:00
Joe Watkins
b44484b912
Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Update copyright year to 2017
2017-07-24 17:24:10 +01:00
Peter Kokot
924ff6164e
Update copyright year to 2017 2017-07-24 17:23:57 +01:00
Tom Van Looy
04fb3f28ff Remove superfluous semicolons 2017-06-26 00:23:25 +02:00
Dmitry Stogov
db4561bfff Introduced "zif_handler" type (zif = zend internal function). 2017-06-08 16:52:39 +03:00
Sara Golemon
a86c87df2d Escape value passed to exec()
getmypid() is safe, but no harm being EXTRA safe.
2017-06-01 15:43:25 -07:00
Sara Golemon
a9294d36bc Ignore spurious stderr output from lsof
lsof may report errors trying to stat files owned by other
users in other processes, even when asking for files
associated to a specific process.  Boo.
2017-06-01 15:43:25 -07:00
Joe Watkins
2a64f548da
Merge branch 'PHP-7.1'
* PHP-7.1:
  Fix Bug #74386Phar::__construct(): wrong number of parameters by reflection
2017-05-29 08:32:23 +01:00
Fabien Villepinte
d6922ef8e3
Fix Bug #74386Phar::__construct(): wrong number of parameters by reflection 2017-05-29 08:31:47 +01:00
Fabien Villepinte
2dee44c74c
Fix Bug #74386 Phar::__construct(): wrong number of parameters by reflection 2017-05-29 08:29:30 +01:00
Dmitry Stogov
27e7aea412 "Countable" interface is moved from SPL to Core 2017-05-25 12:47:43 +03:00
Anatol Belski
627f870161 Merge branch 'PHP-7.1'
* PHP-7.1:
  Fixed bug #51918 Phar::webPhar() does not handle requests sent through PUT and DELETE method
2017-05-02 14:47:08 +02:00
Anatol Belski
64adba3b3f Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #51918 Phar::webPhar() does not handle requests sent through PUT and DELETE method
2017-05-02 14:46:15 +02:00
Christian Weiske
c0c0871911 Fixed bug #51918 Phar::webPhar() does not handle requests sent through PUT and DELETE method
phar: Support DELETE, HEAD and PUT HTTP methods in Phar::webPhar

Up to now only GET and POST requests could be handled with Phar::webPhar(),
which is insufficient for today's REST APIs.
This patch expands the list of supported HTTP methods.
2017-05-02 14:44:47 +02:00
Mitch Hagstrand
a9fdf3d6b4
Fix for Bug 74196: PharData->decompress() does not correctly support dot names
1. Fixed phar_rename_archive to no longer remove everything after a "." in the filename
2. Removed unused "zend_bool compress" parameter
3. Added Test
4. Fixed tests that had a work around for this problem
2017-04-10 06:43:26 +01:00
Joe Watkins
b0f9dba2d9
Merge branch 'PHP-7.1'
* PHP-7.1:
  Fix of Bug #74383: Wrong reflection on Phar::running
2017-04-10 06:33:42 +01:00
Joe Watkins
9fe4d2d9cb
Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fix of Bug #74383: Wrong reflection on Phar::running
2017-04-10 06:32:40 +01:00
Mitch Hagstrand
d9a05807d2
Fix of Bug #74383: Wrong reflection on Phar::running 2017-04-10 06:32:15 +01:00
Mitch Hagstrand
775afd5e2d
Fix of Bug #74383: Wrong reflection on Phar::running 2017-04-10 06:24:57 +01:00
Jakub Zelenka
cdc33251d2 Add OpenSSL 1.1.0 support to PHP 7.0 2017-04-07 19:21:33 +01:00
Nikita Popov
162aa1a5fc Deprecate __autoload() 2017-02-03 18:52:57 +01:00
Anatol Belski
6eaa55db79 Merge branch 'PHP-7.1'
* PHP-7.1:
  fix remaining tests for Opcache runs
2017-01-13 17:23:05 +01:00
Anatol Belski
929819aaac Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  fix remaining tests for Opcache runs
2017-01-13 17:21:01 +01:00
Anatol Belski
aaaef22db6 fix remaining tests for Opcache runs
The fail reason here is the TMP change while both top and test
run same binary with opcache enabled.
2017-01-13 17:16:15 +01:00
Christoph M. Becker
583950336a Merge branch 'PHP-7.1'
* PHP-7.1:
  Fix #70417: PharData::compress() doesn't close temp file
2017-01-05 18:52:03 +01:00
Christoph M. Becker
e7ce861def Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fix #70417: PharData::compress() doesn't close temp file
2017-01-05 18:51:04 +01:00
Christoph M. Becker
995ecffbb2 Fix #70417: PharData::compress() doesn't close temp file
According to the comment, it has not been deemed necessary to close compressed
files. However, we don't want to keep unclosed file handles to save ressources.
So we're also closing compressed archives, if they're not aliased.
2017-01-05 14:12:31 +01:00
Sammy Kaye Powers
dac6c639bb Update copyright headers to 2017 2017-01-04 11:23:42 -06:00
Sammy Kaye Powers
478f119ab9 Update copyright headers to 2017 2017-01-04 11:14:55 -06:00
Sammy Kaye Powers
1e3624290a Resolve conflict 2017-01-03 08:01:05 -06:00
Stanislav Malyshev
0de25147d3 Merge branch 'PHP-7.1'
* PHP-7.1:
  Fix bug #73737 FPE when parsing a tag format
  Fix bug #73773 - Seg fault when loading hostile phar
  Fix bug #73825 - Heap out of bounds read on unserialize in finish_nested_data()
  Fix bug #73768 - Memory corruption when loading hostile phar
  Fix int overflows in phar (bug #73764)
2017-01-02 21:26:20 -08:00
Stanislav Malyshev
2075fb2b73 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fix bug #73737 FPE when parsing a tag format
  Fix bug #73773 - Seg fault when loading hostile phar
  Fix bug #73825 - Heap out of bounds read on unserialize in finish_nested_data()
  Fix bug #73768 - Memory corruption when loading hostile phar
  Fix int overflows in phar (bug #73764)
2017-01-02 21:07:01 -08:00
Stanislav Malyshev
7f0de1a138 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix bug #73737 FPE when parsing a tag format
  Fix bug #73773 - Seg fault when loading hostile phar
  Fix bug #73825 - Heap out of bounds read on unserialize in finish_nested_data()
  Fix bug #73768 - Memory corruption when loading hostile phar
  Fix int overflows in phar (bug #73764)
2017-01-02 21:01:35 -08:00
Sammy Kaye Powers
9e29f841ce Update copyright headers to 2017 2017-01-02 09:30:12 -06:00
Stanislav Malyshev
e5246580a8 Fix bug #73773 - Seg fault when loading hostile phar 2016-12-31 18:47:50 -08:00
Stanislav Malyshev
b28b8b2fee Fix bug #73768 - Memory corruption when loading hostile phar 2016-12-30 15:57:24 -08:00
Stanislav Malyshev
ca46d0acbc Fix int overflows in phar (bug #73764) 2016-12-30 15:39:48 -08:00
Anatol Belski
758af77e9d Path handling related refactorings
Primarily related to the path handling datatypes, to avoid unnecessary
casts, where possible. Also some rework to avoid code dup. Probably
more places are to go, even not path related, primarily to have less
casts and unsigned integers where possible. That way, we've not only
less warnings and casts, but are also safer with regard to the
integer overflows. OFC it's not a panacea, but still significantly
reduces the vulnerability potential.
2016-12-22 14:56:47 +01:00
Sara Golemon
5004ae2b62 Silence warning from unhandled enum
(cherry picked from commit 57bbe2c140)
2016-12-17 00:12:33 +01:00
Anatol Belski
2f9e928af8 fix leaking streams and memory mapped files
(cherry picked from commit f1ff23095b)
2016-12-17 00:12:19 +01:00
Sara Golemon
587f1b2427 Silence warning from unhandled enum
(cherry picked from commit 57bbe2c140)
2016-12-16 22:55:13 +01:00
Anatol Belski
9cdf64c225 fix leaking streams and memory mapped files
(cherry picked from commit f1ff23095b)
2016-12-16 22:55:02 +01:00
Sara Golemon
57bbe2c140 Silence warning from unhandled enum 2016-12-12 23:25:57 -08:00
Anatol Belski
f1ff23095b fix leaking streams and memory mapped files 2016-12-11 02:52:02 +01:00
Anatol Belski
b204b3abd1 further normalizations, uint vs uint32_t
fix merge mistake

yet one more replacement run
2016-11-26 17:29:01 +01:00
Stanislav Malyshev
b1ff0c5270 Fix more size_t/int implicit conversions
Now the conversions are explicit and do checks. Not sure it's
the best way but at least we can see them now in the open.
2016-11-25 18:58:06 -08:00
Stanislav Malyshev
fe994fd9a4 Fix int/size_t confusion in isValidPharFilename (bug #73580) 2016-11-25 18:57:18 -08:00
Stanislav Malyshev
f9a80a0a29 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fix more size_t/int implicit conversions
2016-11-25 15:32:59 -08:00
Stanislav Malyshev
8be94d46f8 Fix more size_t/int implicit conversions
Now the conversions are explicit and do checks. Not sure it's
the best way but at least we can see them now in the open.
2016-11-25 15:31:50 -08:00
Stanislav Malyshev
bcc913fa8b Fix int/size_t confusion in isValidPharFilename (bug #73580) 2016-11-25 15:31:50 -08:00