Commit graph

604 commits

Author SHA1 Message Date
Stanislav Malyshev
2bcbc95f03 Fix bug #79037 (global buffer-overflow in mbfl_filt_conv_big5_wchar) 2020-01-20 21:43:42 -08:00
Máté Kocsis
99db00b1f2
Fix #78880 Another round 2020-01-19 18:28:43 +01:00
Máté Kocsis
d1764ca330
Make error messages more consistent by fixing capitalization
Closes GH-5066 As a first step, let's capitalize their initial letter when it is applicable.
2020-01-17 14:52:46 +01:00
Máté Kocsis
afdaa91170
Fix #78880: Final spelling fixes 2020-01-16 19:14:31 +01:00
George Peter Banyard
483efc7e50 Allow empty needles in mb_strpos and mb_strstr function family.
MBstring analogous implementation to 6d578482a9

Closes GH-4977
2020-01-07 22:53:35 +01:00
Máté Kocsis
f3d5a5a9d3
Promote warnings to exceptions in string search related functions
GH-5004
2019-12-20 16:43:40 +01:00
George Peter Banyard
fdf45debdf Remove deprecated behaviour of passing encoding as third parameter in mb_strrpos()
Merged GH-5011
2019-12-13 22:03:27 +01:00
Christoph M. Becker
1979c5d16f Upgrade to Oniguruma 6.9.4
Oniguruma 6.9.4 fixes several CVEs.
2019-11-30 14:00:41 +01:00
Christoph M. Becker
8c4b0ddde5 Add missing skip checks 2019-11-29 23:50:05 +01:00
Christoph M. Becker
ff2140c49d Partially revert "Adapt test cases for Oniguruma 6.9.4"
This partially reverts commit c55d09c2f5,
because `MB_ONIGURUMA_VERSION` is only available as of PHP 7.4.0, so
that change made no sense for PHP-7.3; we keep it for PHP-7.4, though.
We also stick with the modification to bug78633.phpt.
2019-11-29 23:40:30 +01:00
Christoph M. Becker
bf6c2932f4 Merge branch 'PHP-7.4'
* PHP-7.4:
  Adapt test cases for Oniguruma 6.9.4
2019-11-29 17:01:11 +01:00
Christoph M. Becker
2b700841c5 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Adapt test cases for Oniguruma 6.9.4
2019-11-29 17:00:11 +01:00
Christoph M. Becker
c55d09c2f5 Adapt test cases for Oniguruma 6.9.4
Apparently, bug 78633 has now really been fixed; the former fix only
catered to the buffer overflow, but yielded a wrong result.  Also,
the order of the named captures has been fixed.
2019-11-29 16:59:19 +01:00
Fabien Villepinte
a555cc0b3d Clean DONE tags from tests
Remove most of the `===DONE===` tags and its variations.
Keep `===DONE===` if the test output otherwise becomes empty.

Closes GH-4872.
2019-11-07 21:31:47 +01:00
Stanislav Malyshev
c797ed5cc7 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #78633: Heap buffer overflow (read) in mb_eregi
2019-10-20 23:20:26 -07:00
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
Christoph M. Becker
e2100619ac Expect appropriate parameter type in the first place
`mb_encode_numericentity()` and `mb_decode_numericentity()` accepted
arbitrary zvals as `$convmap`, but ignored anything else than arrays.
This appears to be an unresolved relict of their ZPP conversion for
PHP 5.3[1].  We now expect an array in the first place.

We also expect `count($convmap)` to be a multiple of four (else we
throw a `ValueError`), and do no longer special case empty `$convmap`.

[1] <http://git.php.net/?p=php-src.git;a=commit;h=1c77f594294aee9d60e7309279c616c01c39ba9d>
2019-10-07 16:48:08 +02:00
Nikita Popov
2fcd454480 Merge branch 'PHP-7.4' 2019-10-07 10:51:22 +02: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
21e631e473 Merge branch 'PHP-7.4' 2019-10-06 10:07:57 +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
b1468169dc Merge branch 'PHP-7.4'
* PHP-7.4:
  Skip tests for old versions instead of marking them XFAIL
2019-09-30 14:14:59 +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
d0d7508d1b Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #78609: mb_check_encoding() no longer supports stringable objects
2019-09-30 13:07:19 +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
a9dabe0e20 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #78559: Heap buffer overflow in mb_eregi
2019-09-23 21:51:26 -07: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
6bd5567ce7 Merge branch 'PHP-7.4'
* PHP-7.4:
  Add missing SKIPIF (mbstring)
2019-09-04 08:51:24 +02:00
Fabien Villepinte
db4f5e44e1 Add missing SKIPIF (mbstring) 2019-09-04 08:51:03 +02:00
George Peter Banyard
1059e3dc39 Promote warnings to errors in str_repeat() 2019-08-23 20:01:19 +02:00
George Peter Banyard
ab76c613fe Normalise strr(i)pos offset messages with str(i)pos ones. 2019-08-22 12:56:32 +02:00
Nikita Popov
36db71df47 Merge branch 'PHP-7.4' 2019-07-22 12:28:40 +02:00
Nikita Popov
39e756e7fe Deprecate encoding as 3rd param to mb_strrpos() 2019-07-22 11:39:52 +02:00
Nikita Popov
f9e918b17d Merge branch 'PHP-7.4' 2019-04-17 14:25:34 +02:00
Nikita Popov
487d4d07b4 Remove some uses of deprecated internal_encoding settings in tests 2019-04-17 14:24:11 +02:00
Nikita Popov
1d53d6df7e Merge branch 'PHP-7.4' 2019-04-17 14:06:05 +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
Nikita Popov
b8b00263c5 Merge branch 'PHP-7.4' 2019-04-12 10:37:27 +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
Stanislav Malyshev
63e0c22037 Merge branch 'PHP-7.4'
* PHP-7.4:
  Unfortunately, travis CI has old oniguruma library
  Update NEWS & UPGRADING
  Add fallbacks for older oniguruma versions
  Add mbstring.regex_stack_limit to php.ini-*
  Implement RF bug #72777 - ensure stack limits on mbstring functions.
2019-04-01 00:32:49 -07: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
Stanislav Malyshev
077ce33aa9 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Update NEWS & UPGRADING
  Add fallbacks for older oniguruma versions
  Add mbstring.regex_stack_limit to php.ini-*
  Implement RF bug #72777 - ensure stack limits on mbstring functions.
2019-04-01 00:05:36 -07:00
Stanislav Malyshev
bc8f292c05 Merge branch 'mb-limit-73' into PHP-7.3
* mb-limit-73:
  Add fallbacks for older oniguruma versions
  Add mbstring.regex_stack_limit to php.ini-*
  Implement RF bug #72777 - ensure stack limits on mbstring functions.
2019-04-01 00:00:14 -07:00
Matteo Beccati
263c587854 Fixed SKIPIF when --disable-mbregex is used 2019-03-30 18:29:49 +01:00