Commit graph

1630 commits

Author SHA1 Message Date
Stanislav Malyshev
d517c559fc Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78633: Heap buffer overflow (read) in mb_eregi
2019-10-20 23:20:16 -07:00
Christoph M. Becker
4f50d58cab Fix #78633: Heap buffer overflow (read) in mb_eregi
We backport kkos/oniguruma@15c4228aa2.
2019-10-20 22:47:38 -07:00
Nikita Popov
5b067163be Limit retry_limit test to oniguruma >= 6.9.3
This test is somewhat fragile in that it depends on how well a
particular regex is optimized. Apparently on 6.9.1 this regex
would hit the default retry_limit of 1000000 already. I'm limiting
this to 6.9.3 because that's the version that works for me.
2019-10-07 10:49:34 +02:00
Nikita Popov
6623e7ac51 Add support for mbstring.regex_retry_limit
This is very similar to the existing mbstring.regex_stack_limit,
but for backtracking. The default value matches pcre.backtrack_limit.
Only used on libonig >= 2.8.0.
2019-10-06 10:06:33 +02:00
Christoph M. Becker
3d89f92784 Skip tests for old versions instead of marking them XFAIL
According to commit 0eea9a6[1], these tests fail with old Oniguruma
versions; we are not sure which version of Oniguruma is required to let
them pass, but at least 6.9.3 is sufficient.

[1] <http://git.php.net/?p=php-src.git;a=commit;h=0eea9a642941ab5d4c612f8092f186977afbb73e>
2019-09-30 14:14:23 +02:00
Christoph M. Becker
70f367d48a Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78609: mb_check_encoding() no longer supports stringable objects
2019-09-30 13:06:57 +02:00
Christoph M. Becker
2046b3ce4f Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #78609: mb_check_encoding() no longer supports stringable objects
2019-09-30 13:04:54 +02:00
Christoph M. Becker
45db6fa567 Fix #78609: mb_check_encoding() no longer supports stringable objects
We apply type juggling for other types than array.
2019-09-30 12:42:04 +02:00
Stanislav Malyshev
e7befd38d4 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78559: Heap buffer overflow in mb_eregi
2019-09-23 21:51:12 -07:00
Christoph M. Becker
8f949eba80 Fix #78559: Heap buffer overflow in mb_eregi
We backport kkos/oniguruma@d3e402928b.
2019-09-23 21:49:55 -07:00
Christoph M. Becker
6dea11acd8 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78579: mb_decode_numericentity: args number inconsistency
2019-09-21 16:17:45 +02:00
Christoph M. Becker
698088ca7c Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #78579: mb_decode_numericentity: args number inconsistency
2019-09-21 16:16:52 +02:00
Christoph M. Becker
398b308316 Fix #78579: mb_decode_numericentity: args number inconsistency
mb_decode_numericentity() accepts a fourth optional parameter, which is
unused, however.  Since this parameter doesn't do any harm, and to avoid
the small BC break, we're keeping this parameter for PHP 7, but adjust
the arginfo.

For PHP 8, we will remove this parameter.
2019-09-21 16:15:23 +02:00
Fabien Villepinte
db4f5e44e1 Add missing SKIPIF (mbstring) 2019-09-04 08:51:03 +02:00
Stanislav Malyshev
5748cec3ee Upgrade oniguruma lib to 6.9.3 2019-08-27 23:40:46 -07:00
Stanislav Malyshev
d3f2cfe20a Update Oniguruma to 6.9.1 2019-08-25 00:02:32 -07:00
Stanislav Malyshev
5704eca6f7 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix CVE-2019-13224: don't allow different encodings for onig_new_deluxe()
  set version for release
2019-08-24 23:16:09 -07:00
Stanislav Malyshev
087cb7bab2 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix CVE-2019-13224: don't allow different encodings for onig_new_deluxe()
  set version for release
2019-08-24 23:15:36 -07:00
Stanislav Malyshev
1258303e66 Fix CVE-2019-13224: don't allow different encodings for onig_new_deluxe()
Backport from 0f7f61ed1b
2019-08-24 23:11:45 -07:00
Nikita Popov
7b152990b6 Don't short-circuit MBFL_OUTPUTFILTER_ILLEGAL_MODE_NONE
Make sure we always go through mbfl_filt_conv_illegal_output(), so
that the number of illegal characters gets counted.
2019-08-09 16:33:21 +02:00
Nikita Popov
39e756e7fe Deprecate encoding as 3rd param to mb_strrpos() 2019-07-22 11:39:52 +02:00
Christoph M. Becker
737c1b492c Put oniguruma include path to proper CFLAGS 2019-07-19 20:04:47 +02:00
Christoph M. Becker
504cd03fc3 Move Oniguruma related config stuff to where it belongs
Oniguruma is exclusively used by ext/mbstring, and only if mbregex is
enabled.  Therefore it is unnecessary and confusing to have Oniguruma
related config stuff scattered elsewhere.

While we're at it, we also remove the referral to the bundled libonig
which is removed as of PHP 7.4.0, and the duplicated call to
`PHP_INSTALL_HEADERS()`.
2019-07-19 19:30:41 +02:00
Peter Kokot
359a78b16c Remove unused defines
Used in php-src the past and today removed and not used anymore:
- HAVE_CURL_EASY_STRERROR
- HAVE_CURL_MULTI_STRERROR
- HAVE_NEW_MIME2TEXT
- HAVE_MBSTR_CN
- HAVE_MBSTR_JA
- HAVE_MBSTR_KR
- HAVE_MBSTR_RU
- HAVE_MBSTR_TW

Part of oniguruma which doesn't use these anymore
- NOT_RUBY
- HAVE_STDARG_PROTOTYPES

Unused:
- HAVE_MPIR

Closes GH-4427
2019-07-18 02:21:39 +02:00
Nikita Popov
7defd5f69c Fix unused variable warnings when mbregex disabled 2019-07-01 11:14:35 +02:00
Nikita Popov
46bad1d679 Fix region leak in mb_ereg_replace 2019-06-25 10:25:44 +02:00
Nikita Popov
ae2bc6297e Fix shift UB in mbfilter_utf32.c 2019-06-19 15:09:00 +02:00
Dmitry Stogov
457392fa64 Cheaper checks for exceptions thrown from __toString() 2019-06-06 01:47:22 +03:00
Nikita Popov
a31f46421d Allow exceptions in __toString()
RFC: https://wiki.php.net/rfc/tostring_exceptions

And convert some object to string conversion related recoverable
fatal errors into Error exceptions.

Improve exception safety of internal code performing string
conversions.
2019-06-05 14:25:07 +02:00
Peter Kokot
75fb74860d Normalize comments in *nix build system m4 files
Normalization include:
- Use dnl for everything that can be ommitted when configure is built in
  favor of the shell comment character # which is visible in the output.
- Line length normalized to 80 columns
- Dots for most of the one line sentences
- Macro definitions include similar pattern header comments now
2019-05-12 18:43:03 +02:00
Peter Kokot
f7cdac6c97 Remove unused symbol definition 2019-05-11 19:47:54 +02:00
Peter Kokot
9219e56063 Remove redundant memory.h file
The memory.h file is part of the pre-C89 era and is on today's systems
only a simple wrapper for including the final string.h header file.
2019-05-11 19:47:54 +02:00
Peter Kokot
3a4df95793 Simplify ext/mbstring/libmbfl/config.h creation
- The config.h.in is part of the standalone libmbfl library and it is
  forked and bundled.
2019-05-11 19:44:40 +02:00
Peter Kokot
ab257ed320 Integrate libmbfl docs to README.md and LICENSE
- All credits, license info preserved, only merged together to not have
  to many places to edit.
- Changelogs integrated in the readme since they are not used anymore.
2019-05-11 18:29:30 +02:00
Peter Kokot
975cb57930 [ci skip] Move OpenLDAP license to redistributable info file 2019-05-06 23:02:46 +02:00
Peter Kokot
36c7946522 Move ucgendata README to generator file header 2019-04-20 22:35:25 +02:00
Dmitry Stogov
4c1a25ad5f Fixed compatibility with phpdbg 2019-04-18 01:33:56 +03:00
Nikita Popov
487d4d07b4 Remove some uses of deprecated internal_encoding settings in tests 2019-04-17 14:24:11 +02:00
Nikita Popov
f73f190c3f Fix internal_encoding fallback in mbstring
By introducing a hook that is called whenever one of
internal_encoding / input_encoding / output_encoding changes, so
that mbstring can adjust it's internal state.

This also makes internal_encoding work with zend multibyte.
2019-04-17 14:05:53 +02:00
Peter Kokot
69b20f51e1 Disable PACKAGE_* preprocessor symbols
Autoconf defines PACKAGE_* symbols:
- PACKAGE_NAME
- PACKAGE_VERSION
- PACKAGE_TARNAME
- PACKAGE_STRING
- PACKAGE_BUGREPORT
- PACKAGE_URL

and appends them to the generated config.h.in files. With AC_INIT change
via afd52f9d99 where package version, URL,
bug report location and similar meta data are defined, these
preprocessor macros are then non empty strings in the generated
configuration header file. When using phpize, PHP shares the config
files in extensions, warnings of redefined macros appear, such as:
- `warning: 'PACKAGE_NAME' macro redefined`

This patch now disables these non utilized symbols in the generated
config header files.

Better practice would be to include only API specific headers where
needed but this would require even more refactorings. Some extensions
such as pcre, pgsql, and pdo_pgsql solve this issue by undefining some
of these symbols before including the library configuration headers in
the code also. Because these symbols can be defined by any library which
uses Autotools.

Additionally, the unused PACKAGE_* symbols were cleaned for the bundled
libmbfl library and with this patch not needed undef code removed.
2019-04-13 07:00:17 +02:00
Nikita Popov
339b0af429 Avoid misc uninitialized variable warnings 2019-04-12 15:12:39 +02:00
Nikita Popov
1ef5b79b6b Merge branch 'PHP-7.3' into PHP-7.4 2019-04-12 10:37:17 +02:00
Nikita Popov
354a1c27aa Merge branch 'PHP-7.2' into PHP-7.3 2019-04-12 10:37:08 +02:00
Nikita Popov
3b53d28e60 Fix key leaks in mb_convert_encoding() 2019-04-12 10:36:58 +02:00
Nikita Popov
8e8d129d7f Use EMPTY_SWITCH_DEFAULT_CASE in php_unicode.c
Avoids a potentially uninitialized variable warning.
2019-04-12 10:26:11 +02:00
Nikita Popov
ca47732eee Remove incorrect mbstring includes
And thus fix unused variable warnings.
2019-04-11 15:47:41 +02:00
Nikita Popov
44a1cd4fcd Remove unused function prototype 2019-04-11 15:39:24 +02:00
Nikita Popov
cd8312a77e Merge branch 'PHP-7.3' into PHP-7.4 2019-04-11 12:36:01 +02:00
Nikita Popov
a61d24e4d8 Avoid onig match param unused variable warning 2019-04-11 12:35:24 +02:00
Stanislav Malyshev
0eea9a6429 Unfortunately, travis CI has old oniguruma library
So we can't test it there.
2019-04-01 00:30:56 -07:00