Commit graph

1449 commits

Author SHA1 Message Date
Christoph M. Becker
a003af5b62 Add missing skip conditions
mbstring can be built without mbregex support, in which case these
tests would fail.  Thus we add respective skip conditions.
2018-08-05 00:01:35 +02:00
Christoph M. Becker
70ecb6e50b Fix #76706: mbstring.http_output_conv_mimetypes is ignored
_php_mb_match_regex() is supposed to return != 0 on success, and 0 on
failure.  pcre2_match() returns >= 0 on success, and < 0 on failure.
We map the result accordingly.

Since this patch fixes four failing tests, there is no need to add
another.
2018-08-04 23:24:04 +02:00
Christoph M. Becker
5dc74d9e70 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #76704: mb_detect_order return value varies based on argument type
2018-08-04 13:50:48 +02:00
Christoph M. Becker
db8bcdba80 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix #76704: mb_detect_order return value varies based on argument type
2018-08-04 12:57:05 +02:00
Christoph M. Becker
c00f5e6531 Fix #76704: mb_detect_order return value varies based on argument type
php_mb_parse_encoding_list() and php_mb_parse_encoding_array() are
supposed to return SUCCESS and FAILURE, not 1 and 0, respectively.
2018-08-04 12:51:57 +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
255e29f3bc Remove unused libmbfl build system related files
PHP build system already builds necessary files also from libmbfl
directory using the mbstring config.m4 file.
2018-07-29 10:07:32 +02:00
Peter Kokot
a5e80b22e1 Fix typos in code comments 2018-07-25 11:57:11 +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
Nikita Popov
e6016ab20d Deprecate undocumented mbereg_* aliases
Part of https://wiki.php.net/rfc/deprecations_php_7_3.
2018-07-21 22:34:09 +02:00
Christoph M. Becker
271ae3eb2b Fix #76574: use of undeclared identifiers INT_MAX and LONG_MAX
As of Oniguruma 6.4.0 <limits.h> is required, so we have to add a check
for this header file to set the respective macro.
2018-07-10 14:28:28 +02:00
Christoph M. Becker
1c01b1ab48 Fix #76594: Bus Error due to unaligned access in zend_ini.c OnUpdateLong
Since commit ea83b69[1] changed the type of mbstring.strict_detection
from `long` to `zend_bool`, we have to update the `on_modify` callback
as well.

[1] http://git.php.net/?p=php-src.git;a=commit;h=ea83b69883f3f77fd27e4663fa854c88f141ab41
2018-07-09 00:54:36 +02:00
Nikita Popov
41a6625c09 Add UPGRADING for mb_ereg changes
Also some minor code cleanup.
2018-07-07 11:06:29 +02:00
ju1ius
8f1782678e adds support for named subpatterns to mb_ereg_replace
Named subpatterns are now passed to `mb_ereg_replace_callback`.

This commit also adds a subset of the oniguruma back-reference syntax
for replacements:
* `\k<name>` and `\k'name'` for named subpatterns.
* `\k<n>` and `\k'n'` for numbered subpatterns
These last two notations allow referencing numbered groups where n > 9.
2018-07-06 23:34:54 +02:00
ju1ius
212f56b7ca adds support for named captures to mb_ereg & mb_ereg_search
`mb_ereg`, `mb_ereg_search_regs` & `mb_ereg_search_getregs`
returned only numbered capturing groups.
Now they return both numbered and named capturing groups.
Fixes Bug #72704.
2018-07-06 23:34:54 +02:00
Anatol Belski
0630e3bc03 Reduce error buffer size
120 bytes is ample, the doc says.
2018-07-05 17:24:38 +02: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
Nikita Popov
a7101415cb Merge branch 'PHP-7.2' 2018-06-28 23:06:08 +02:00
Nikita Popov
00c0d7702c Merge branch 'PHP-7.1' into PHP-7.2 2018-06-28 23:05:09 +02:00
Marcus Schwarz
bf5a802f5a Fixed bug #76532 (excessive memory usage in mb_strimwidth) 2018-06-28 23:02:28 +02:00
Nikita Popov
e357f67faf Remove code duplication
And fix indentation
2018-06-20 15:05:08 +02:00
Nikita Popov
f2be6e732a Update data tables for Unicode 11 2018-06-11 20:25:37 +02:00
Anatol Belski
3b07c6cf87 Skip tests when Oniguruma is disabled 2018-06-11 17:44:34 +02:00
Anatol Belski
a34ba6f30c Fix mbstring fallback when --disable-mbregex used 2018-06-11 17:44:34 +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
Christoph M. Becker
2c4556ee43 Update to Oniguruma 6.8.2 2018-05-26 14:03:20 +02:00
Nikita Popov
9d63f4dec1 Fixed bug #76319
While at it, also make sure that mbstring case conversion takes
into account the specified substitution character and substitution
mode.
2018-05-25 11:33:13 +02:00
Anatol Belski
f9cfc029a5 Rework datatypes wrt warnings 2018-03-20 22:09:48 +01:00
Christoph M. Becker
ec5b408d81 Update to Oniguruma 6.8.1 2018-03-20 17:44:27 +01:00
Christoph M. Becker
8d9f47fb51 Merge branch 'PHP-7.2'
* PHP-7.2:
  Fix #76113: mbstring does not build with Oniguruma 6.8.1
2018-03-20 17:02:52 +01:00
Christoph M. Becker
8f5c34cd39 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix #76113: mbstring does not build with Oniguruma 6.8.1
2018-03-20 16:53:17 +01:00
Christoph M. Becker
4072b27870 Fix #76113: mbstring does not build with Oniguruma 6.8.1
As of Oniguruma 6.8.1, the regex structure has been moved from the
public `oniguruma.h` to the private `regint.h`.  Thus, it is no longer
possible to directly access the struct's members, and actually, there
is no need to, since there are respective accessor functions available
at least of 2.3.1.
2018-03-20 16:42:28 +01:00
Christoph M. Becker
9004985273 Merge branch 'PHP-7.2'
* PHP-7.2:
  Fix #75944: Wrong cp1251 detection
2018-03-19 14:48:10 +01:00
Christoph M. Becker
cd2912af5e Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix #75944: Wrong cp1251 detection
2018-03-19 14:34:09 +01:00
Christoph M. Becker
47461368ca Fix #75944: Wrong cp1251 detection
`\xFF` is a valid character of CP-1251.
2018-03-19 14:24:27 +01:00
Christoph M. Becker
ef01ec08f0 Merge branch 'PHP-7.2'
* PHP-7.2:
  Fix #62545: wrong unicode mapping in some charsets
2018-03-11 18:05:08 +01:00
Christoph M. Becker
2b02e6dff3 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix #62545: wrong unicode mapping in some charsets
2018-03-11 17:54:45 +01:00
Christoph M. Becker
01ea314e8c Fix #62545: wrong unicode mapping in some charsets
Undefined characters are best mapped to Unicode REPLACEMENT characters.
2018-03-11 17:38:28 +01:00
Christoph M. Becker
d48b233991 Update to Oniguruma 6.7.1
We also apply the still relevant parts of `oniguruma.patch` and update
the patch accordingly.
2018-03-10 01:07:00 +01:00
Gabriel Caruso
e1cc4863d9 Remove duplicated tests 2018-02-22 13:03:21 +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
Anatol Belski
0bc4cf901c Fix unsigned comparisons 2018-02-17 13:02:50 +01:00
Gabriel Caruso
21e3b0c70c Remove trailing whitespace in inc files 2018-02-10 19:20:23 +01:00
Gabriel Caruso
2d48d734a2 Fix some misspellings 2018-02-06 16:59:00 +01:00
Nikita Popov
d7fe32500e Match strpos() behavior with mbstring.func_overload
mb_strpos() specifically emulates strpos() behavior when function
overloading is enabled. However, the condition was not changed
when strpos() behavior changed in PHP 7.
2018-02-05 20:58:15 +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
Stanislav Malyshev
3616b6b935 Cleanup some tests - remove unnecessary sections
Also unify credits - all are under --CREDITS-- now.
2018-02-04 02:21:40 -08:00