Commit graph

1606 commits

Author SHA1 Message Date
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
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
Stanislav Malyshev
e12c069d33 Add fallbacks for older oniguruma versions 2019-03-30 23:18:33 -07:00
Matteo Beccati
263c587854 Fixed SKIPIF when --disable-mbregex is used 2019-03-30 18:29:49 +01:00
Matteo Beccati
f030f34622 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fixed SKIPIF when --disable-mbregex is used
2019-03-30 18:29:44 +01:00
Matteo Beccati
0dbb581cf4 Fixed SKIPIF when --disable-mbregex is used 2019-03-30 18:28:33 +01:00
Matteo Beccati
4726c35ca3 Removed declaration inside for loops 2019-03-29 14:24:09 +01:00
Matteo Beccati
16b40a1806 Fixed SKIPIF when --disable-mbregex is used 2019-03-29 14:09:39 +01:00
Stanislav Malyshev
66c35b083b Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Validate subject encoding in mb_split and mb_ereg_match
  Validate pattern against mbregex encoding
  SQLite3: add DEFENSIVE config for SQLite >= 3.26.0 as a mitigation strategy against potential security flaws
2019-03-28 00:42:56 -07:00
Stanislav Malyshev
402adc1df1 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Validate subject encoding in mb_split and mb_ereg_match
  Validate pattern against mbregex encoding
  SQLite3: add DEFENSIVE config for SQLite >= 3.26.0 as a mitigation strategy against potential security flaws
2019-03-28 00:35:22 -07:00
Yasuo Ohgaki
738016bd88 Implement RF bug #72777 - ensure stack limits on mbstring functions.
The patch creates new config: mbstring.regex_stack_limit, which
defaults to 100000.
2019-03-28 00:31:57 -07:00
Nikita Popov
0ecac37c40 Validate subject encoding in mb_split and mb_ereg_match
We were already validating the subject encoding in most functions,
but not these two.
2019-03-27 23:20:27 -07:00
Nikita Popov
40fe50daf6 Validate pattern against mbregex encoding
Oniguruma does not consistently perform this validation itself (at least
on older versions), so make sure we check pattern encoding validity on the
PHP side.
2019-03-27 23:19:46 -07:00
Nikita Popov
e7e2056d1a Remove HAVE_PCRE/HAVE_BUNDLED_PCRE checks
PCRE is always available.
2019-03-22 10:29:18 +01:00
Fabien Villepinte
26dfce7f36 Replace dirname(__FILE__) by __DIR__ in tests 2019-03-15 22:55:30 +01:00
Anatol Belski
e10349152b Sync with ZEND_ENABLE_STATIC_TSRMLS_CACHE enablement in ext/mbstring 2019-03-12 21:33:43 +01:00
Dmitry Stogov
7139c381f1 Fixed ZTS cache usage 2019-03-12 16:58:02 +03:00
Gabriel Caruso
c67c2c4d8f Fix tests filenames 2019-03-10 23:57:32 -03:00
Peter Kokot
9df6a1e4dd Add AS_HELP_STRING to *nix build configure options
The Autoconf's default AS_HELP_STRING macro can properly format help
strings [1] so watching out if columns are aligned manually is not
anymore.

[1] https://www.gnu.org/software/autoconf/manual/autoconf.html#Pretty-Help-Strings
2019-03-07 20:36:59 +01:00
Gabriel Caruso
e907fbaf7c Remove unnecessary check for always available extension 2019-03-05 12:54:24 -03:00
Nikita Popov
7e3f4a2390 Remove more zpp error/variation tests 2019-03-05 14:09:33 +01:00
Nikita Popov
4bd18db8cc Remove custom error handler in mbstring tests
To make it more obvious what is tested and what the error messages
are.
2019-03-05 11:41:53 +01:00
Nikita Popov
b26df0e395 Remove tests for zpp failure conditions
These tests only check zpp error conditions, so drop them per
zpp testing policy.
2019-03-05 10:22:23 +01:00
Peter Kokot
a700451706 Remove obsolescent AC_HEADER_STDC and memcpy check
Autoconf 2.59d (released in 2006) [1] started promoting several macros
as not relevant for newer systems anymore, including the `AC_HEADER_STDC`.

This macro checks if given system has C89 compliant header files such
as `<string.h>`, `<stdlib.h>`, `<stdarg.h>`, `<float.h>`,... and defines
the `STDC_HEADERS` symbol [2]. Case is that current systems should be
well supported with at least C89 standard headers [3].

Given headers are still additionally checked with the `AC_PROG_CC`
macro, yet not needed anyway.

Additionally, the HAVE_MEMCPY check has been removed. The memcpy
function is standardized by C89 and later.

Refs:
[1] http://git.savannah.gnu.org/cgit/autoconf.git/tree/NEWS
[2] https://www.gnu.org/software/autoconf/manual/autoconf-2.69/autoconf.html
[3] https://port70.net/~nsz/c/c89/c89-draft.html#4.1.2
2019-03-01 19:22:44 +01:00