Commit Graph

608 Commits

Author SHA1 Message Date
Christoph M. Becker
9a2bd2f453 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #77147: Fix for 60494 ignores ICONV_MIME_DECODE_CONTINUE_ON_ERROR
2018-11-14 14:59:30 +01:00
Christoph M. Becker
211c6189f6 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix #77147: Fix for 60494 ignores ICONV_MIME_DECODE_CONTINUE_ON_ERROR
2018-11-14 14:57:40 +01:00
Christoph M. Becker
a56cdd0a82 Fix #77147: Fix for 60494 ignores ICONV_MIME_DECODE_CONTINUE_ON_ERROR
If the `ICONV_MIME_DECODE_CONTINUE_ON_ERROR` flag is set, parsing
should not fail, if there are illegal characters in the headers;
instead we silently ignore these like before.
2018-11-14 14:55:38 +01:00
Peter Kokot
787dfd0909 Remove unused test.inc in ext/iconv/tests 2018-10-15 17:57:22 +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
Christoph M. Becker
7022f3a34f Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix #66828: iconv_mime_encode Q-encoding longer than it should be
2018-09-22 15:57:28 +02:00
Christoph M. Becker
150e2b8c8c Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #66828: iconv_mime_encode Q-encoding longer than it should be
2018-09-22 15:56:49 +02:00
Christoph M. Becker
7c2cc9aa56 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix #66828: iconv_mime_encode Q-encoding longer than it should be
2018-09-22 15:31:02 +02:00
Christoph M. Becker
9cbe1283f7 Fix #66828: iconv_mime_encode Q-encoding longer than it should be
Before the fix for bug 48289 has been applied, the algorithm to
construct a Q-encoded-word has been optimistic, i.e. try to encode as
many bytes that *may* fit in the remaining space, calculate the actual
length of the Q-encoded word, and if it's too long, try again with a
reduced size.  However, the fix for the mentioned bug replaced this by
a pessimistic algorithm, which always terminates[1] the for loop[2]
during the first iteration (which renders the following 3 lines as dead
code), and as such easily produces unnecessarily short encoded-words.
Instead the proper fix for the bug would have been to make sure that
`out_size` is always decremented, if the space isn't sufficient for the
encoded-word.

[1] <https://github.com/php/php-src/blob/php-7.3.0beta3/ext/iconv/iconv.c#L1421>
[2] <https://github.com/php/php-src/blob/php-7.3.0beta3/ext/iconv/iconv.c#L1360>
2018-09-22 15:20:20 +02:00
Peter Kokot
7dd62811ce Remove HAVE_STDLIB_H
The C89 and later standard defines the `<stdlib.h>` header as part of
the standard headers [1] and on current systems it is always present
and the `HAVE_STDLIB_H` symbol can be removed.

Also Autoconf suggests doing this and relying on C89 or above [2] and [3].

[1] https://port70.net/~nsz/c/c89/c89-draft.html#4.1.2
[2] http://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/headers.m4
[3] https://www.gnu.org/software/autoconf/manual/autoconf-2.69/autoconf.html
2018-09-16 20:53:53 +02:00
Nikita Popov
153e292e10 Escape trigraph sequence
??= is a trigraph for #, so it needs to be escaped. To stay
consistent I'm escaping all question marks in this literal, even
though one of the latter two would suffice.
2018-09-04 05:07:43 +02:00
Christoph M. Becker
4d6b0b5031 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #68180: iconv_mime_decode can return extra characters in a header
2018-08-26 13:23:51 +02:00
Christoph M. Becker
20849b0b0f Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix #68180: iconv_mime_decode can return extra characters in a header
2018-08-26 13:21:22 +02:00
Christoph M. Becker
efb86aef12 Fix #68180: iconv_mime_decode can return extra characters in a header
Basically, the algorithm to append a converted string to an existing
`smart_str` works by increasing the `smart_str` buffer, to let `iconv`
convert characters until there is no more space, to set the new length
of the `smart_str` and to repeat until there is no more input.

Formerly, the new length calculation has been wrong, though, since we
would have to take the old `out_len` into account (`buf_growth -
old_out_len - out_len`).  However, since there is no need to take the
old `out_len` into account when increasing the `smart_str` buffer, we
can simplify the fix, avoiding an additional variable.
2018-08-26 13:18:35 +02:00
Christoph M. Becker
b5afc99afb Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #60494: iconv_mime_decode does ignore special characters
2018-08-25 17:52:16 +02:00
Christoph M. Becker
314b8ecf8b Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix #60494: iconv_mime_decode does ignore special characters
2018-08-25 17:47:29 +02:00
Christoph M. Becker
e29c946c29 Fix #60494: iconv_mime_decode does ignore special characters
We must not ignore erroneous characters in mime headers, but rather let
iconv_mime_decode() fail in this case, issuing the usual notice
regarding illegal characters.
2018-08-25 17:40:39 +02:00
Christoph M. Becker
065eee16b5 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #63839: iconv_mime_decode_headers function is skipping headers
2018-08-25 14:54:32 +02:00
Christoph M. Becker
7e176ddb57 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix #63839: iconv_mime_decode_headers function is skipping headers
2018-08-25 14:52:54 +02:00
Christoph M. Becker
8754d44167 Fix #63839: iconv_mime_decode_headers function is skipping headers
We have to cater to the possibility that `=?` is not the start of an
encoded-word, but rather a literal `=?`.  If a line break is found
while we're still looking for the charset, we can safely assume that
it's a literal `=?`, and act accordingly.
2018-08-25 14:51:13 +02:00
Christoph M. Becker
50fec3be0e Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #55146: iconv_mime_decode_headers() skips some headers
2018-08-25 14:43:13 +02:00
Christoph M. Becker
6922cae4ae Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix #55146: iconv_mime_decode_headers() skips some headers
2018-08-25 14:41:38 +02:00
Christoph M. Becker
6e1980e152 Fix #55146: iconv_mime_decode_headers() skips some headers
If we're expecting the start of an encoded word (`=?`), but instead of
the question mark get a line break (CR or LF), we must not append it to
the `pretval`.
2018-08-25 14:40:07 +02:00
Christoph M. Becker
eb03290754 Fix #53891: iconv_mime_encode() fails to Q-encode UTF-8 string
The minimum length of an encoded-word is actually the pure encoding
overhead plus the length of the `output-charset` plus the minimum unit
of encoded text, which is 4 for B-encoding and (for simplicity) 3 for
Q-encoding.  We also cater to the possibility that we need further
encoded words, which would be split by the `line-break-chars` followed
by a space character.  Obviously, the former `out_charset_len + 12` is
too simplistic and wrong in the given case (where the magic number
would be 13).

These simplifications are somewhat wasteful, but iconv_mime_encode()
with Q-encoding is wasteful anyway (see bug 66828[1]), and the proper
solution to convert the whole input to the desired output charset
upfront, and applying the encoding afterwards appears too much a change
for the stable releases.

[1] <https://bugs.php.net/66828>
2018-08-25 14:30:07 +02:00
Peter Kokot
f2e4de8b56 Fix AC_RUN_IFELSE calls when cross-compiling
AC_RUN_IFELSE program can't be run when cross-compiling. This fix removes
warnings given by autotools scripts.
2018-07-30 06:38:59 +02:00
Peter Kokot
4371945b8b Replace obsolete AC_TRY_FOO with AC_FOO_IFELSE
Autoconf 2.50 released in 2001 made several macros obsolete including
the AC_TRY_RUN, AC_TRY_COMPILE and AC_TRY_LINK:
http://git.savannah.gnu.org/cgit/autoconf.git/tree/ChangeLog.2

These macros should be replaced with the current AC_FOO_IFELSE instead:
- AC_TRY_RUN with AC_RUN_IFELSE and AC_LANG_SOURCE
- AC_TRY_LINK with AC_LINK_IFELSE and AC_LANG_PROGRAM
- AC_TRY_COMPILE with AC_COMPILE_IFELSE and AC_LANG_PROGRAM

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 therefore systems
should be well supported by now.

This patch was created with the help of autoupdate script:
autoupdate <file>

Reference docs:
- https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Obsolete-Macros.html
- https://www.gnu.org/software/autoconf/manual/autoconf-2.59/autoconf.pdf
2018-07-30 02:36:38 +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
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
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
5651b1a7ca Remove Git ident attribute from the iconv extension 2018-06-16 12:49:55 +02: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
Dmitry Stogov
524f5245c5 Avoid useless checks, using zend_string_efree(), in cases where the string is known to be a temporary allocated zend_string. 2018-05-08 17:30:15 +03:00
Anatol Belski
1de1c86688 Merge branch 'PHP-7.2'
* PHP-7.2:
  Fix test portability
2018-04-24 10:49:34 +02:00
Anatol Belski
1df43a086f Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix test portability
2018-04-24 10:49:15 +02:00
Anatol Belski
919ead1157 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fix test portability
2018-04-24 10:48:49 +02:00
Anatol Belski
3070883bcf Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix test portability
2018-04-24 10:48:22 +02:00
Anatol Belski
4371af3e19 Fix test portability 2018-04-24 10:47:32 +02: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
ee76a5ae5a Fix tsrm_ls 2018-04-23 16:48:27 -07:00
Stanislav Malyshev
8dca5ae5ec Fix test 2018-04-22 22:19:51 -07:00
Stanislav Malyshev
06d309fd7a Fix bug #76249 - fail on invalid sequences 2018-04-22 21:26:39 -07: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
Anatol Belski
b2cd274122 Remove unnecessary cast 2018-02-17 14:19:06 +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
c6c9e71a5b Add missing SKIPIF sections 2018-02-03 13:54:34 +01:00
Nikita Popov
466196d454 Merge branch 'PHP-7.2' 2018-01-26 22:28:54 +01:00
Nikita Popov
fd255b8878 Merge branch 'PHP-7.1' into PHP-7.2 2018-01-26 22:28:48 +01:00
Philip Prindeville
aad76a9b79 Be consistent in clearing out in php_iconv_string() 2018-01-26 22:28:27 +01: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
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
Dmitry Stogov
6a9d2b2190 Cleanup type conversion 2017-12-07 19:24:55 +03:00
Nikita Popov
edcabf6d07 Drop unnecessary allocator return value checks 2017-03-13 22:07:15 +01:00
David Carlier
ea91c08232 Drop unnecessary checks of pemalloc() return value 2017-03-12 17:06:25 +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
9e29f841ce Update copyright headers to 2017 2017-01-02 09:30:12 -06: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
Pedro Magalhães
9c5af4e4cb Remove the b prefix from literals on unrelated tests 2016-11-20 21:11:53 +01:00
Kalle Sommer Nielsen
2104bea5d7 Remove Netware support
If this does not break the Unix system somehow, I'll be amazed. This should get most of it out, apologies for any errors this may cause on non-Windows ends which I cannot test atm.
2016-11-12 11:20:01 +01:00
Stanislav Malyshev
1fd18821e0 More string length checks & fixes 2016-11-03 21:35:09 -07:00
Anatol Belski
42b7912f03 catch up with stream datatypes 2016-10-05 22:53:21 +02:00
Anatol Belski
a989091880 remove useless assignment 2016-09-01 23:45:31 +02:00
Christoph M. Becker
ec8bbba9c6 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-30 01:18:59 +02:00
Christoph M. Becker
a837b2f6a3 Fix #72320: iconv_substr returns false for empty strings
For consistency with substr() and mb_substr(), iconv_substr() should return
an empty string instead of FALSE, when $offset == iconv_strlen($str).
2016-07-29 11:33:50 +02:00
Francois Laupretre
570bbed98e Add negative offset support to iconv_strpos() 2016-03-09 14:41:38 +01:00
Francois Laupretre
56fce8990f strpos()/stripos(): Add support for negative offsets 2016-03-09 14:41:37 +01:00
Nikita Popov
1ac152938c Move semicolon into TSRMLS_CACHE_EXTERN/DEFINE
Also re bug #71575.
2016-03-03 16:50:01 +01:00
Nikita Popov
c9357f82d3 Format string fixes
Conflicts:
	ext/pgsql/pgsql.c
2016-02-14 14:45:53 +01:00
Lior Kaplan
ed35de784f Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Happy new year (Update copyright to 2016)
2016-01-01 19:48:25 +02:00
Lior Kaplan
49493a2dcf Happy new year (Update copyright to 2016) 2016-01-01 19:21:47 +02:00
Anatol Belski
2b9c7f881a fix tests 2015-08-21 15:13:39 +02:00
Julien Pauli
aae9004ebd Removed dead code 2015-08-17 17:18:25 +02:00
Xinchen Hui
fb3d14460b Fixed condition 2015-07-30 15:09:56 +08:00
Anatol Belski
4e66cce87c switch to the unified globals accessor where appropriate 2015-07-29 13:26:35 +02:00
Dmitry Stogov
4a2e40bb86 Use ZSTR_ API to access zend_string elements (this is just renaming without semantick changes). 2015-06-30 04:05:24 +03:00
Christoph M. Becker
c9554b90e4 added regression test for bug #69840 2015-06-17 13:40:19 +02:00
Kalle Sommer Nielsen
ff9e290438 Fixed bug #69840 (iconv_substr() doesn't work with UTF-16BE) 2015-06-17 09:39:45 +02:00
Nikita Popov
5d3cf577aa Make convert_to_* safe with rc>1
This only involves switching zval_dtor to zval_ptr_dtor for arrays
and making the convert_to_object for arrays a bit more generic.

All the other changes outside zend_operators.c just make use of
this new ability (use COPY instead of DUP).

What's still missing: Proper references handling. I've seen many
convert_to* calls that will break when a reference is used.

Also fixes bug #69788.
2015-06-11 23:23:57 +02:00
Stanislav Malyshev
f69e5d3b19 Merge branch 'PHP-5.6'
* PHP-5.6:
  fix bad copypaste
2015-06-11 01:52:39 -07:00
Stanislav Malyshev
9d162550ac Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fix bad copypaste
2015-06-11 01:52:23 -07:00
Stanislav Malyshev
cd927cca50 fix bad copypaste 2015-06-11 01:51:55 -07:00
Stanislav Malyshev
33594b78ec Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fix #48147 - implement manual handling of  //IGNORE for broken libc
2015-05-09 18:57:18 -07:00
Stanislav Malyshev
473ec539a1 Fix #48147 - implement manual handling of //IGNORE for broken libc
Conflicts:
	ext/iconv/iconv.c
2015-05-09 18:54:40 -07:00
Stanislav Malyshev
f8f1d275cf Fix #48147 - implement manual handling of //IGNORE for broken libc 2015-05-08 12:55:39 -07:00
Nikita Popov
40e465e357 Clean up some type conversions
While at it also fix some type checks in iconv and drop dead and
unported code in standard/filters.
2015-04-27 18:50:08 +02:00
Anatol Belski
2d78023244 cleanup the mod version macros, round 2 2015-03-23 20:33:54 +01:00
Anatol Belski
f195870a9e implemented --with-all-shared option 2015-03-23 15:09:01 +01:00
Dmitry Stogov
d146d15003 Optimize zend_string_realloc() add more specialized versions zend_string_extend() and zend_string_truncate() 2015-03-20 02:02:42 +03:00
Dmitry Stogov
8633685675 Use specialized macro for string zval creation 2015-03-12 16:53:51 +03:00
Anatol Belski
af3ca74501 made ZEND_TSRMLS_CACHE_* macros look like function calls
which also comply with the current semantics for such macros
2015-02-16 17:19:32 +01:00
Michael Wallner
b72b4084a5 fix warnings 2015-01-30 20:04:04 +01:00
Xinchen Hui
fc33f52d8c bump year 2015-01-15 23:27:30 +08:00
Xinchen Hui
0579e8278d bump year 2015-01-15 23:26:37 +08:00
Xinchen Hui
73c1be2653 Bump year 2015-01-15 23:26:03 +08:00
Stanislav Malyshev
b7a7b1a624 trailing whitespace removal 2015-01-10 15:07:38 -08:00
Anatol Belski
c71cd8f8e0 remove the extra comma 2014-12-26 13:08:57 +01:00
Xinchen Hui
898cae2e63 Merge branch 'PHP-5.6' 2014-12-25 06:21:48 -05:00
Xinchen Hui
316f72ce28 Merge branch 'PHP-5.5' into PHP-5.6 2014-12-25 06:21:14 -05:00
Xinchen Hui
80260bcfa6 Fixed test 2014-12-25 06:20:52 -05:00
Andrea Faulds
e5eb9530ab Use "float" and "integer" in typehint and zpp errors 2014-12-21 13:23:02 +00:00
Anatol Belski
bdeb220f48 first shot remove TSRMLS_* things 2014-12-13 23:06:14 +01:00
Anatol Belski
bb66f385d0 Merge remote-tracking branch 'origin/master' into native-tls
* origin/master: (37 commits)
  NEWS
  NEWS
  Fix bug #68601 buffer read overflow in gd_gif_in.c
  Fixed compilation warnings
  Removed unnecessary checks
  pcntl_signal_dispatch: Speed up by preventing system calls when unnecessary
  Merged PR #911.
  Removed ZEND_ACC_FINAL_CLASS which is unnecessary. This also fixed some currently defined classes as final which were just not being considered as such before.
  Updated NEWS
  Updated NEWS
  Updated NEWS
  Fix bug #68532: convert.base64-encode omits padding bytes
  Updated NEWS
  Updated NEWS
  Updated NEWS
  Fixed Bug #65576 (Constructor from trait conflicts with inherited constructor)
  Updated NEWS
  Updated NEWS
  Fix MySQLi tests
  Fixed gd test
  ...
2014-12-13 19:43:45 +01:00
Andrea Faulds
01554bf3e4 Merge branch 'master' into zppFailOnOverflow 2014-11-29 01:45:54 +00:00
Andrea Faulds
f574ad140e skip tests on 32-bit 2014-11-28 23:30:15 +00:00
Anatol Belski
3ca0ca1548 Merge remote-tracking branch 'origin/master' into native-tls
* origin/master: (102 commits)
  fix dir separator in test
  fix TS build
  fix TS build
  Better fix for bug #68446
  Revert "Merge remote-tracking branch 'origin/PHP-5.6'"
  Revert NEWS and set test to XFAIL
  Revert "Fix bug #68446 (bug with constant defaults and type hints)"
  Improved zend_hash_clean() and added new optimized zend_symtable_clean()
  Use inline version of zval_ptr_dtor()
  Added new optimized zend_array_destroy() function
  Moved i_zval_ptr_dtor() from zend_execute.h to zend_variables.h
  fix REGISTER_NS_*_CONSTANT macros
  Removed useless assert. EG(uninitialized_zval) can't be refcounted.
  Use specialized destructors when types of zvals are known.
  move tests into proper place
  Improved assignment to object property
  Reuse zend_assign_to_variable() in zend_std_write_property()
  cleanup comments from svn/cvs era
  fix dir separator in test
  fork test for windows
  ...
2014-11-26 08:17:35 +01:00
Anatol Belski
7582b57c87 Merge branch 'PHP-5.6'
* PHP-5.6:
  fix dir separator in test
  fork test for windows
  update for LiteSpeed
  update for LiteSpeed
2014-11-24 16:27:43 +01:00
Anatol Belski
3578e5b250 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fix dir separator in test
  fork test for windows
  update for LiteSpeed
2014-11-24 16:25:38 +01:00
Anatol Belski
ac8b1a9de1 fork test for windows 2014-11-24 16:09:26 +01:00
Stanislav Malyshev
f782d6710d Merge branch 'PHP-5.6'
* PHP-5.6:
  test to function addcslashes
  test
  Test PHP Init Fail Without Params
  Add my information to this test
  Add a test for the exception cases of readline_read_history
  added some tests to datetime and dateinterval functions
  added various tests for XSLTProcessor and one test for iconv extension
  teste basico da funcao timezone_version_get
2014-11-23 17:26:35 -08:00
Stanislav Malyshev
a8dfb33db8 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Add my information to this test
  Add a test for the exception cases of readline_read_history
  added some tests to datetime and dateinterval functions
  added various tests for XSLTProcessor and one test for iconv extension
  teste basico da funcao timezone_version_get
2014-11-23 17:26:28 -08:00
Anatol Belski
c6bad96f30 Merge remote-tracking branch 'origin/master' into native-tls
* origin/master: (398 commits)
  NEWS
  add test for bug #68381
  Fixed bug #68381 Set FPM log level earlier during init
  proper dllexport
  move to size_t where zend_string is used internally
  fix some datatype mismatches
  return after the warning, to fix uninitialized salt usage
  fix datatype mismatches
  add missing type specifier
  fix datatype mismatches
  fix unsigned check
  "extern" shouldn't be used for definitions
  joined identical conditional blocks
  simplify fpm tests
  SEND_VAR_NO_REF optimization
  Add test for bug #68442
  Add various tests for FPM - covering recent bugs (68420, 68421, 68423, 68428) - for UDS - for ping and status URI - for multi pool and multi mode
  Include small MIT FastCGI client library from https://github.com/adoy/PHP-FastCGI-Client
  Get rid of zend_free_op structure (use zval* instead). Get rid of useless TSRMLS arguments.
  Add new FPM test for IPv4/IPv6
  ...

Conflicts:
	win32/build/config.w32
2014-11-18 21:18:52 +01:00
Florian MARGAINE
344eba1be8 Fixes iconv tests 2014-11-09 21:29:21 +01:00
Anatol Belski
23f089a6b3 fix datatype mismatches 2014-10-29 15:30:16 +01:00
Anatol Belski
fea10f6a5e ext/iconv, ext/json and ext/session use static tsrmls pointer 2014-10-17 14:16:40 +02:00
Anatol Belski
c00424e427 bring back all the TSRMLS_FETCH() stuff
for better comparability with the mainstream
2014-10-15 09:37:55 +02:00
Anatol Belski
d624b0d5eb Merge remote-tracking branch 'origin/master' into native-tls
* origin/master: (26 commits)
  Micro optimization
  Drop unused INIT_STRING opcode
  Drop unused RAISE_ABSTRACT_ERROR opcode
  CT substitute unqualified true/false/null in namespaces
  Fix a couple compile warnings
  fix test filename
  one more test to illustrate transfer of an arbitrary data amount throug pipes
  fix tests on linux
  better test cleanup
  Use more readable inline functions
  increase the polling period to not to break existing behaviours
  updated NEWS
  Fixed bug #51800 proc_open on Windows hangs forever
  Fixed segfault
  Set an LDAP error code when failing ldap_bind due to null bytes
  Fix segmentation fault in debug_backtrace()
  Drop support for GMP 4.1
  Make gmp_setbit and gmp_clrbit return values consistent
  removed *.dsw and *.dsp files
  Opcache compatibility for coalesce operator
  ...
2014-10-01 01:33:46 +02:00
Rodrigo Prado de Jesus
813830e763 added various tests for XSLTProcessor and one test for iconv extension 2014-09-28 20:29:29 -03:00
Anatol Belski
4b3e198023 removed *.dsw and *.dsp files 2014-09-28 19:02:09 +02:00
Anatol Belski
14eefc82b5 cleanup after the removed PHP_OUTPUT_TSRMLS 2014-09-26 12:11:07 +02:00
Nikita Popov
e33f3d3b7c Move smart_str implementation into Zend/
So we can use it there as well...

For now I've retained the zend_smart_str_public.h header, though
it would probably be better to just move that one struct into
zend_types.h.
2014-09-21 20:49:39 +02:00
Florian MARGAINE
8eb7e7bf7f Merge branch 'master' into issue-67910
Conflicts:
	README.PARAMETER_PARSING_API
	ext/gmp/tests/001.phpt
2014-09-20 10:09:21 +02:00
Florian MARGAINE
cf0303e782 Replaces php5 with php7, without whitespace changes. 2014-09-20 10:01:44 +02:00
Nikita Popov
37aaccad7d Use inline functions for most of smart_str
smart_str_free_ex no longer exists, always use smart_str_free instead.

smart_str_alloc no longer requires a newlen variable to be in scope,
instead it returns the new length.
2014-09-19 23:39:07 +02:00
Johannes Schlüter
d0cb715373 s/PHP 5/PHP 7/ 2014-09-19 18:33:14 +02:00
Anatol Belski
95132bee40 redo the fix casting to size_t 2014-09-16 21:17:21 +02:00
Anatol Belski
8b2f15551d fix signed/unsigned mismatch warnings 2014-09-15 19:46:33 +02:00
Anatol Belski
e056d52acf fix type 2014-09-15 11:30:23 +02:00
Anatol Belski
140d99b467 fix condition 2014-09-15 11:30:22 +02:00