1
0
mirror of https://github.com/php/php-src.git synced 2026-04-21 23:18:13 +02:00
Commit Graph

607 Commits

Author SHA1 Message Date
George Peter Banyard 6031b08240 Revert "Fix Bug #79448 0 is a valid Unicode codepoint, but mb_substitute_character(0) fails"
This commit brings some substantial changes in behaviour due to the weird implementation.
This will be fixed in master due to BC concerns.

This reverts commit 1333b46d6d.
2020-04-07 22:23:24 +02:00
George Peter Banyard 1333b46d6d Fix Bug #79448 0 is a valid Unicode codepoint, but mb_substitute_character(0) fails 2020-04-03 21:18:45 +02:00
George Peter Banyard 18dc9044f5 Fix bug 79441 2020-04-01 04:29:20 +02:00
Nikita Popov a62c06c4cf Fix mb_ord() crash if internal encoding not supported
enc_name can be NULL here. Take the name from the mbfl_encoding
instead.
2020-01-29 16:18:46 +01:00
Christoph M. Becker f1bf4bf6eb Don't leak encoding_str 2020-01-22 11:15:16 +01:00
Christoph M. Becker 9be31a582a Fix #79154: mb_convert_encoding() can modify $from_encoding
We must not modify arrays passed by value.
2020-01-22 10:28:07 +01: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
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
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 a61d24e4d8 Avoid onig match param unused variable warning 2019-04-11 12:35:24 +02:00
Stanislav Malyshev e12c069d33 Add fallbacks for older oniguruma versions 2019-03-30 23:18:33 -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 d6212835f2 Merge branch 'PHP-7.2' into PHP-7.3 2019-01-14 10:23:44 +01:00
Nikita Popov 3ad0ebdf5c Fixed bug #77454 2019-01-14 10:22:48 +01:00
Nikita Popov dee5a450d9 Fixed bug #77165
Also add some helper macros for PROTECT/UNPROTECT that check for
IMMUTABLE. These checks are needed for nearly any use of
PROTECT/UNPROTECT.
2018-11-15 17:16:39 +01:00
Nikita Popov 09c7108f74 Fix mb_strrpos() with encoding passed as 3rd param 2018-10-29 18:56:17 +01: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 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
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
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
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
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 0bc4cf901c Fix unsigned comparisons 2018-02-17 13:02:50 +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
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 b864e6b58c Move constants into read-only data segment 2017-12-15 01:55:00 +03: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 185478d07e Use cheaper SEPARATE macros 2017-12-07 22:35:17 +03:00
Dmitry Stogov 6a9d2b2190 Cleanup type conversion 2017-12-07 19:24:55 +03:00
Joe Watkins 21e4ab1977 Merge branch 'PHP-7.2'
* PHP-7.2:
  Fix proto documents for new global functions
2017-11-06 07:24:51 +00:00
Tyson Andre 5cdf37e603 Fix proto documents for new global functions
See NEWS and UPGRADING (or arginfo/implementation) for details.
2017-11-06 07:24:42 +00:00
Dmitry Stogov 3b2e858304 Overlad functions once in MINIT (instead of on each requestr in RINIT) 2017-11-02 14:09:06 +03:00
Nikita Popov 251c1b1a44 Fix invalid read in mb_ord() 2017-10-28 16:44:32 +02:00
Dmitry Stogov 9cf87aa196 Avoid HashTable allocations for empty arrays (using zend_empty_array). 2017-10-24 17:27:31 +03:00
Peter Kokot a57de26c3d Refactor mbstring READMEs 2017-10-08 17:51:02 +02:00
Dmitry Stogov 45ee78e040 mb_convert_variables() refactored to use simple recursion.
Fixed incorrect recursion protection (previous implementation kept protection flag or apply counter in non-zero state).
2017-10-06 12:08:55 +03:00
Dmitry Stogov cb9d81ef4f Refactored recursion pretection 2017-10-06 01:34:50 +03:00
Dmitry Stogov 44e0b79ac6 Refactored array creation API. array_init() and array_init_size() are converted into macros calling zend_new_array(). They are not functions anymore and don't return any values. 2017-09-20 02:25:56 +03:00