Commit graph

602 commits

Author SHA1 Message Date
Nikita Popov
331e56ce38 Remove mbstring.func_overload
Deprecated in PHP 7.2 as part of
https://wiki.php.net/rfc/deprecations_php_7_2.
2019-01-28 15:58:23 +01:00
Nikita Popov
93a221ec4b Merge branch 'PHP-7.3' 2019-01-14 10:24:11 +01: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
e219ec144e Implement typed properties
RFC: https://wiki.php.net/rfc/typed_properties_v2

This is a squash of PR #3734, which is a squash of PR #3313.

Co-authored-by: Bob Weinand <bobwei9@hotmail.com>
Co-authored-by: Joe Watkins <krakjoe@php.net>
Co-authored-by: Dmitry Stogov <dmitry@zend.com>
2019-01-11 15:49:06 +01:00
Nikita Popov
8f2f80668e Merge branch 'PHP-7.3' 2018-11-15 17:17:06 +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
Gabriel Caruso
5ae1524dc3
Remove unused variables 2018-11-15 12:32:00 -02:00
Nikita Popov
6da3eac56a Add missing null initialization 2018-10-29 20:57:21 +01:00
Nikita Popov
837843ff4a Remove redundant mbfl_string_init calls
No need to do this if we already fully initialize the string.
2018-10-29 20:29:23 +01:00
Nikita Popov
a7d6b2c1fb Use zend_string for mbstring last encoding cache
Saves us a string duplication, as well as case-insensitive string
comparisons for the likely case of an interned string encoding.
2018-10-29 20:29:22 +01:00
Nikita Popov
493b534c84 Merge branch 'PHP-7.3' 2018-10-29 18:56:43 +01:00
Nikita Popov
09c7108f74 Fix mb_strrpos() with encoding passed as 3rd param 2018-10-29 18:56:17 +01:00
Nikita Popov
900ee5705f Remove unnecessary HASH_OF uses in mbstring 2018-10-11 13:04:08 +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
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
Nikita Popov
fea7957d08 Optimize mb_chr()
By avoiding an unnecessary copy between a string an zend_string.
2017-08-04 22:38:54 +02:00
Nikita Popov
f24db7686e Optimize mb_ord()
Don't perform a full encoding conversion into UCS4-BE, instead only
perform an input conversion into a wchar device.
2017-08-04 22:22:58 +02:00
Nikita Popov
840b77c02e Merge branch 'PHP-7.2' 2017-08-04 22:20:11 +02:00
Nikita Popov
6b73b2d6eb Check for empty string in mb_ord() 2017-08-04 22:20:05 +02:00
Nikita Popov
4e4ec31e2e Merge branch 'PHP-7.2' 2017-08-04 13:02:44 +02:00