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
Joe Watkins
c898349e16
fixes PR #2722 , no clue how it broke ...
2017-09-06 11:13:27 +01:00
shinemotec@gmail.com
9b77615608
fixed mbstring extension compiled broken with archlinux
2017-09-06 09:50:08 +01: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
633a471ba0
Store input and output filters in mbfl encodings
...
For functions like mb_chr() and mb_ord() just looking up the
input/output filter for the encoding dominates the runtime. This
commit stores the input/output filter for an encoding in the
mbfl encoding structure, so it can be looked up directly, rather
than scanning through filter function lists.
2017-08-04 22:22:58 +02:00
Nikita Popov
e20fbd43ba
Separate mbfl filters into three categories
...
Input filters, output filters and special filters.
2017-08-04 22:22:58 +02:00
Nikita Popov
c98714f19e
Merge branch 'PHP-7.2'
2017-08-03 21:57:35 +02:00
Nikita Popov
fb9bf5b64b
Revert/fix substitution character fallback
...
The introduced checks were not correct in two respects:
* It was checked whether the source encoding of the string matches
the internal encoding, while the actually relevant encoding is
the *target* encoding.
* Even if the correct encoding is used, the checks are still too
conservative. Just because something is not a "Unicode-encoding"
does not mean that it does not map any non-ASCII characters.
I've reverted the added checks and instead adjusted mbfl_convert
to first try to use the provided substitution character and if
that fails, perform the fallback to '?' at that point. This means
that any codepoint mapped in the target encoding should now be
correctly supported and anything else should fall back to '?'.
2017-08-03 21:53:59 +02:00
Nikita Popov
445e13b149
Add MBFL_SUBSTR_TO_END mode to mbfl_substr
...
This takes the substr from the offset to the end of the string.
This avoids pointless searching for the end position and also
saves us a length calculation in the strstr family of functions.
2017-07-23 23:17:12 +02:00
Anatol Belski
7496bad2ac
adjust datatype, used for position handling
2017-07-23 16:37:31 +02:00
Nikita Popov
42ff1aa86c
Fix overflow checks in mbfl_memory_device
...
Also prune out some duplicate code and use strlen() and memcpy()
instead of ad-hoc reimplementations. Remove multiplications by
sizeof(unsigned char), which wrongly imply that this can be
anything but 1.
2017-07-23 11:55:43 +02:00
Anatol Belski
0eea41b6c4
add missing header
2017-07-23 00:23:02 +02:00
Anatol Belski
61784bcb71
sync libmbfl allocator with the size_t changes
2017-07-22 23:53:00 +02:00
Anatol Belski
e0825ec60f
Mitigation for ssize_t issue in 22a5f554a8
...
and some more
2017-07-22 22:34:16 +02:00
Nikita Popov
a319063aae
Only write single terminating byte
...
As far as I could determine this is sufficient. It avoids
reallocating the buffer, if it was perfectly allocated beforehand.
2017-07-20 21:41:52 +02:00
Nikita Popov
b3c1d9d111
Directly use encodings instead of no_encoding in libmbfl
...
In particular strings now store encoding rather than the
no_encoding.
I've also pruned out libmbfl APIs that existed in two forms, one
using no_encoding and the other using encoding. We were not actually
using any of the former.
2017-07-20 21:41:52 +02:00
Nikita Popov
22a5f554a8
Temporary fix for windows build
...
This API should be changed to stop using negative offsets. For now
I'm replacing ssize_t with long.
2017-07-20 18:29:44 +02:00
Nikita Popov
adaea77593
Switch libmbfl to use size_t
...
Switch mbfl_string and related structures to use size_t lengths.
Quite likely that I broke some things along the way...
2017-07-20 13:58:40 +02:00
Anatol Belski
58a945cf68
Merge branch 'PHP-5.6' into PHP-7.0
...
* PHP-5.6:
fix C89 compat
2016-12-17 20:45:22 +01:00
Anatol Belski
79e47aae41
fix C89 compat
2016-12-17 20:43:32 +01:00
Stanislav Malyshev
bc85678df3
Add more mbfl string size checks (bug #73505 )
2016-11-26 14:49:48 -08:00
Stanislav Malyshev
58cdd03d92
Merge branch 'PHP-5.6' into PHP-7.0
...
* PHP-5.6:
Add more mbfl string size checks (bug #73505 )
2016-11-26 14:48:40 -08:00
Stanislav Malyshev
5ee02b207d
Add more mbfl string size checks (bug #73505 )
2016-11-26 14:47:58 -08:00
Stanislav Malyshev
67fbb06311
Merge branch 'PHP-5.5' into PHP-7.0.5
...
* PHP-5.5:
Fixed bug #71704 php_snmp_error() Format String Vulnerability
Fixed bug #71906 : AddressSanitizer: negative-size-param (-1) in mbfl_strcut
Fixed bug #71906 : AddressSanitizer: negative-size-param (-1) in mbfl_strcut
Fix bug #71798 - Integer Overflow in php_raw_url_encode
Fix bug #71860 : Require valid paths for phar filenames
Going for 5.5.34
Conflicts:
configure.in
ext/phar/phar_object.c
ext/phar/tests/badparameters.phpt
ext/phar/tests/create_path_error.phpt
ext/phar/tests/pharfileinfo_construct.phpt
ext/snmp/snmp.c
ext/standard/url.c
main/php_version.h
2016-03-28 23:55:05 -07:00
Stanislav Malyshev
62da5cdf3d
Merge branch 'PHP-5.5' into PHP-5.6
...
* PHP-5.5:
Fixed bug #71906 : AddressSanitizer: negative-size-param (-1) in mbfl_strcut
Fix bug #71798 - Integer Overflow in php_raw_url_encode
Fix bug #71860 : Require valid paths for phar filenames
Going for 5.5.34
Conflicts:
configure.in
ext/phar/tests/create_path_error.phpt
main/php_version.h
2016-03-28 23:21:15 -07:00
Stanislav Malyshev
f8dd10508b
Fixed bug #71906 : AddressSanitizer: negative-size-param (-1) in mbfl_strcut
2016-03-28 23:15:16 -07:00
Stanislav Malyshev
b7a7b1a624
trailing whitespace removal
2015-01-10 15:07:38 -08:00
Veres Lajos
06fdf359e3
typo fixes - https://github.com/vlajos/misspell_fixer
2014-11-23 14:52:47 -08:00
Veres Lajos
4dc994571d
typo fixes - https://github.com/vlajos/misspell_fixer
...
Conflicts:
ext/ftp/ftp.h
ext/pcre/pcrelib/pcre_printint.c
ext/pcre/pcrelib/sljit/sljitLir.c
ext/pcre/pcrelib/sljit/sljitLir.h
ext/pcre/pcrelib/sljit/sljitNativeARM_32.c
ext/pcre/pcrelib/sljit/sljitNativeTILEGX_64.c
ext/pgsql/pgsql.c
ext/phar/func_interceptors.c
ext/soap/soap.c
ext/standard/image.c
2014-11-23 14:33:43 -08:00
Felipe Pena
33d377e701
- Fixed possible uninitialized scalar variable usage (spotted by Coverity)
2013-10-20 08:51:09 -02:00
Xinchen Hui
e4a8fa6a15
Merge branch 'PHP-5.3' into PHP-5.4
2012-10-09 13:29:51 +08:00
Xinchen Hui
6284ef112e
Fixed bug #63236 (Executable permission on various source files)
2012-10-09 13:28:31 +08:00
Rui Hirokawa
3d888412da
MFH: fixed #40685 : removed '&' in mb_decode_numericentity().
2011-09-24 02:20:38 +00:00
Rui Hirokawa
a6a3bd010a
MFH: fixed #40685 : removed '&' in mb_decode_numericentity().
2011-09-24 02:12:17 +00:00
Rui Hirokawa
3826549770
MFH: added alias for *-mobile encodings.
2011-08-31 13:19:03 +00:00
Rui Hirokawa
942dd584d3
MFH: added iso2022jp-mobile and emoji unsuppoted in unicode 6.0.
2011-08-24 15:29:17 +00:00
Rui Hirokawa
e2ccaeb9a6
MFH: removed SJIS-Mobile#*PUA.
2011-08-20 08:28:40 +00:00
Rui Hirokawa
d6303c7962
MFH: updated limbfl to 1.3.2
2011-08-20 07:29:21 +00:00
Rui Hirokawa
bbdf05c1ed
MFH: added gb18030 encoding to mbstring/libmbfl.~
2011-08-14 14:11:29 +00:00
Rui Hirokawa
780d4996f6
MFH:
2011-08-13 13:19:18 +00:00
Rui Hirokawa
7bc77208f3
MFH (updated libmbfl version to 1.3.1).
2011-08-06 01:49:10 +00:00
Rui Hirokawa
c5a650e815
MFH (updated libmbfl for 1.3.0.).
2011-08-02 03:50:10 +00:00
Rui Hirokawa
f191ecaa9c
added numeric entities encode/decode in hex format.
2011-07-18 08:21:48 +00:00
Gustavo André dos Santos Lopes
f2cfb997de
- Fixed bug #54494 : mb_substr() mishandles UTF-32LE and UCS-2LE.
2011-04-09 16:59:36 +00:00
Gustavo André dos Santos Lopes
db01e840c2
- Fixed bug #54494 : mb_substr() mishandles UTF-32LE and UCS-2LE.
2011-04-09 16:59:36 +00:00
Dmitry Stogov
bbc879b587
Fixed multibyte related issues
2011-03-14 16:00:59 +00:00
Moriyoshi Koizumi
bbf3d43c1e
* Refactor zend_multibyte facility.
...
Now mbstring.script_encoding is superseded by zend.script_encoding.
2010-12-19 16:36:37 +00:00
Moriyoshi Koizumi
aef6ac02f5
- Fix bug #53273 (mb_strcut() returns garbage with the excessive length parameter).
2010-11-09 03:23:04 +00:00