Commit Graph

11561 Commits

Author SHA1 Message Date
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
Christoph M. Becker
dcd6a6ff36 Merge branch 'PHP-7.2'
* PHP-7.2:
  Fix #76643: Segmentation fault when using `output_add_rewrite_var`
2018-07-24 12:41:35 +02:00
Christoph M. Becker
a96ca13963 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix #76643: Segmentation fault when using `output_add_rewrite_var`
2018-07-24 12:28:22 +02:00
Christoph M. Becker
40bd84d3e3 Fix #76643: Segmentation fault when using output_add_rewrite_var
We have to check whether _SERVER is actually an array before we're
going to use it as such.
2018-07-24 12:20:13 +02:00
Xinchen Hui
1638a6e118 Give a meaningful name 2018-07-24 12:51:36 +08:00
Xinchen Hui
4aada3993c Micro-optmization 2018-07-24 12:16:35 +08:00
Xinchen Hui
3ca9aaf24e Merge branch 'PHP-7.2'
* PHP-7.2:
  Update NEWs
  Fixed bug #68553 (array_column: null values in $index_key become incrementing keys in result)

Conflicts:
	ext/standard/array.c
2018-07-24 11:37:09 +08:00
Xinchen Hui
2a181b5ea0 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed bug #68553 (array_column: null values in $index_key become incrementing keys in result)
2018-07-24 11:35:22 +08:00
Xinchen Hui
38d97557da Fixed bug #68553 (array_column: null values in $index_key become incrementing keys in result) 2018-07-24 11:34:57 +08:00
Dmitry Stogov
7ef8e3f87f Fixed tests 2018-07-23 17:00:33 +03:00
Dmitry Stogov
d4e60a1ffd Avoid code duplication 2018-07-23 16:53:44 +03:00
Dmitry Stogov
b121405960 Use better destructor (key may be only IS_STRING or IS_LONG). 2018-07-23 15:57:06 +03:00
Gabriel Caruso
c93aba042f
Give a reason why the test was skipped
This will help us debug why a test was skipped in GCOV
(http://gcov.php.net/viewer.php?version=PHP_HEAD&func=skip), and maybe
put them to run again
2018-07-22 16:41:41 -03:00
Nikita Popov
4a5b2101e5 Deprecate string.strip_tags filter
Part of https://wiki.php.net/rfc/deprecations_php_7_3.
2018-07-21 22:38:39 +02:00
Nikita Popov
d9acfa45b8 Deprecate fgetss() and gzgetss()
SplFileObject::fgetss() will also generate a deprecation notice
through an internal call to fgetss().

Part of RFC https://wiki.php.net/rfc/deprecations_php_7_3.
2018-07-21 22:38:35 +02:00
Nikita Popov
f4a9da389b Deprecate non-string needles in string search functions
Part of https://wiki.php.net/rfc/deprecations_php_7_3.
2018-07-21 22:34:09 +02:00
Christoph M. Becker
9f957fd303 Improve implementation of array_key_first() and array_key_last()
Firstly, we must not separate the $stack argument for performance
reasons.  Secondly, we prefer `Z_ARRVAL_P` over `HASH_OF` to clarify
our intention.

Thanks to Nikita, for catching these issues!
2018-07-17 11:53:06 +02:00
Enno Woortmann
50516a6e1f Add implementation and tests for new methods - array_key_first(array $a) Returns the key of the first element or null - array_key_last(array $a) Returns the key of the last element or null 2018-07-17 11:31:00 +02:00
Stanislav Malyshev
28d8b8de71 Merge branch 'PHP-7.2'
* PHP-7.2:
  Fixed bug #76459 windows linkinfo lacks openbasedir check
  Add NEWS
  Fixed bug #76459 windows linkinfo lacks openbasedir check
  Fix bug #76557: heap-buffer-overflow (READ of size 48) while reading exif data
  Fix bug #76423 - Int Overflow lead to Heap OverFlow in exif_thumbnail_extract of exif.c
2018-07-16 16:54:31 -07:00
Stanislav Malyshev
a536d6d61b Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed bug #76459 windows linkinfo lacks openbasedir check
  Add NEWS
  Fixed bug #76459 windows linkinfo lacks openbasedir check
  Fix bug #76557: heap-buffer-overflow (READ of size 48) while reading exif data
  Fix bug #76423 - Int Overflow lead to Heap OverFlow in exif_thumbnail_extract of exif.c
2018-07-16 16:53:57 -07:00
Stanislav Malyshev
4e92cd172a Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #76459 windows linkinfo lacks openbasedir check
  Add NEWS
  Fixed bug #76459 windows linkinfo lacks openbasedir check
  Fix bug #76557: heap-buffer-overflow (READ of size 48) while reading exif data
  Fix bug #76423 - Int Overflow lead to Heap OverFlow in exif_thumbnail_extract of exif.c
2018-07-16 16:52:36 -07:00
Anatol Belski
f151e048ed Fixed bug #76459 windows linkinfo lacks openbasedir check 2018-07-16 15:11:56 -07:00
Nikita Popov
a632ecd224 Remove use of case-insensitive constants in tests 2018-07-16 19:16:55 +02:00
Dmitry Stogov
5cf6474277 Flatten strip_tags state machine (GCC overoptimized this function, producing enormpous amount of code). 2018-07-16 13:22:17 +03:00
Gabriel Caruso
59456974f2
Test http_response_code function 2018-07-15 23:51:16 -03:00
Christoph M. Becker
9c2b4985b1 Merge branch 'PHP-7.2'
* PHP-7.2:
  Fix #73817: Incorrect entries in get_html_translation_table
2018-07-15 23:41:15 +02:00
Christoph M. Becker
8efd3c3387 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix #73817: Incorrect entries in get_html_translation_table
2018-07-15 23:19:37 +02:00
Christoph M. Becker
0f8c1ee76d Fix #73817: Incorrect entries in get_html_translation_table
Due to incorrect string termination and length handling, several HTML
entities missed the trailing semicolon.

We also fix the obviously wrong expectations in two already existing
tests.
2018-07-15 23:06:38 +02:00
Anatol Belski
644ab58d0f Merge branch 'PHP-7.2'
* PHP-7.2:
  Fixed RecursiveDirectoryIterator with long path or with edge case length
2018-07-12 19:58:43 +02:00
Anatol Belski
f28aeaee05 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed RecursiveDirectoryIterator with long path or with edge case length
2018-07-12 19:57:08 +02:00
Anatol Belski
99fe18503a Fixed RecursiveDirectoryIterator with long path or with edge case length
The search path needs to be appended with the wild card. Till now, an
edge case existed, so then if a path is 259 bytes long, which is smaller
_MAX_PATH, the suffix would cause the final search path to become longer
than _MAX_PATH. It is an edge case, when the starting path happens to
have a specific length. If the starting path was longer than _MAX_PATH
or the addition of "\\*" would not exceed _MAX_PATH, the function was
correct. Except for rewind, which was broken in the case of the long
path.
2018-07-12 19:49:32 +02:00
Andrea Faulds
e4e9cd8355 Export stdClass objects using (object) cast (fixes #48016)
Before this change, var_export()'s output for stdClass objects calls
the non-existent stdClass::__set_state method, and is therefore useless.

This commit makes var_export() output an (object) cast from an array
instead, which when evaluated, will produce a stdClass object. Other
classes see unchanged output.
2018-07-12 13:22:26 +02:00
Dmitry Stogov
67b4c3379a Uze ZVAL_COPY_DEREF() instead of ZVAL_DEREF() and ZVAL_COPY() 2018-07-09 12:46:46 +03:00
Anatol Belski
0fbbdd3aa1 [ci skip] Fix EOL 2018-07-07 17:14:54 +02:00
seliver
95013042bf Fixed bug #76136 (stream_socket_get_name enclosed IPv6 in brackets)
The IPv6 IP of a socket is provided by inet_ntop() as a string, but
this function doesn't enclose the IP in brackets. This patch adds
them in the php_network_populate_name_from_sockaddr() function.
2018-07-07 11:47:50 +02:00
Zenju
69a49af0d3 Fix out-of bounds access
Test case: strnatcmp_ex(L"333", 3, L"333 ", 4, true)
The reason this bug didn't come up earlier is probably because most input strings are null-terminated.
2018-07-06 19:02:19 +02:00
Christoph M. Becker
b37dafcc23 Add test for PR #2382 2018-07-06 18:59:04 +02:00
Anatol Belski
1870a61a91 Fix coding style 2018-07-06 17:57:08 +02:00
David Carlier
9da4e30c75 random_bytes improvements for FreeBSD (from 12.x serie)
giving the possiblity to pre-fill the buffer. A new getrandom
function was added for future version with a similar interface
than Linux's syscall.
2018-07-06 17:47:59 +02:00
Xinchen Hui
e3355ac5ec Revert "Rename _zval_dtor_func to _ref_dtor_func"
This reverts commit a362ae6b12.
2018-07-06 18:37:45 +08:00
Xinchen Hui
a362ae6b12 Rename _zval_dtor_func to _ref_dtor_func 2018-07-06 18:32:27 +08:00
Nikita Popov
f3dc67b255 Merge branch 'PHP-7.1' into PHP-7.2 2018-07-05 19:11:25 +02:00
Nikita Popov
0c4ab798de Merge branch 'PHP-7.2' 2018-07-05 19:10:24 +02:00
Nikita Popov
0504594a28 Merge branch 'PHP-7.1' into PHP-7.2 2018-07-05 19:09:40 +02:00
Nikita Popov
791f07e4f0 Fix string.strip_tags filter
Was segfaulting if no allowed tags are specified and performing an
out of bounds read if they were.
2018-07-05 19:08:00 +02:00
Dmitry Stogov
83f6f8563c Use zval_ptr_dtor() instead of legacy zval_dtor(), to destroy unused values returned from PHP functions (they may be circular data structures). 2018-07-05 14:09:47 +03:00
Dmitry Stogov
b6fb584505 Replace zval_dtor() with specialized destructors 2018-07-05 13:32:39 +03:00
Dmitry Stogov
265c3ed6cf Fixed incorrrecr zval_dtor() usage to replace value of argument passed by reference, that may lead to memory leaks. 2018-07-05 10:57:49 +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
Dmitry Stogov
af341213f7 se zval_ptr_dtor_str() instead of zend_string_release_ex(Z_STR(*), 0) 2018-07-04 12:08:07 +03:00