1
0
mirror of https://github.com/php/php-src.git synced 2026-04-26 09:28:21 +02:00
Commit Graph

523 Commits

Author SHA1 Message Date
Nikita Popov 1388751f10 Use fast zpp in mb_strlen()
For short strings this function is now sufficiently fast for zpp
to be a bottleneck.
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 77cb7bd837 Free last_used_encoding_name in RSHUTDOWN
efree() cannot be used in GSHUTDOWN
2017-07-20 18:12:04 +02:00
Nikita Popov ba383b8239 Add basic mbstring encoding cache
Store the last used encoding and compare against it. It's quite
likely that an application is going to be using the same encoding
again and again.

The actual mbfl_name2encoding() function could also be optimized
to use a hash lookup rather than a linear scan, but we don't have
a hashtable implmentation in libmbfl...
2017-07-20 13:58:40 +02:00
Nikita Popov 264387e31e Add php_mb_get_no_encoding() helper function 2017-07-20 13:58:40 +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
Nikita Popov 9c73be898d Directly accept encoding in php_unicode_convert_case()
As a side-effect mb_strtolower() and mb_strtoupper() now correctly
handle a NULL encoding parameter by using the internal encoding.
This is what caused the two test changes.
2017-07-19 23:59:42 +02:00
Nikita Popov 4128746b94 Add php_mb_get_encoding() convenience function 2017-07-19 23:59:42 +02:00
Nikita Popov dead4f0b1b Avoid unnecessary encoding lookups in mbstring
Extract part of php_mb_convert_encoding that does the actual work
and use it whenever we already know the encoding.
2017-07-19 23:59:42 +02:00
Thomas Punt 9f08aff3fd Remove superfluous allocation checks around ZMM-based functions 2017-04-02 00:58:19 +02:00
Nikita Popov edcabf6d07 Drop unnecessary allocator return value checks 2017-03-13 22:07:15 +01:00
Nikita Popov a8239ff232 Deprecate mbstring.func_overload 2017-02-03 21:02:52 +01:00
Nikita Popov 2df9346e7f Deprecate mb_parse_str() without second argument 2017-02-03 18:52:57 +01:00
Joe Watkins c8aa6f3a9a Merge branch 'pull-request/2268'
* pull-request/2268:
  Update copyright headers to 2017
2017-01-04 10:00:53 +00:00
Joe Watkins f9a435a06d Merge branch 'pull-request/1094'
* pull-request/1094:
  added php_mb_check_code_point for mb_substitute_character
  news entry for PR #1094
2017-01-04 06:57:34 +00:00
Sammy Kaye Powers 9e29f841ce Update copyright headers to 2017 2017-01-02 09:30:12 -06:00
Dmitry Stogov 3e9bb03a62 Removed IS_TYPE_IMMUTABLE (it's the same as COPYABLE & !REFCOUED) 2016-11-28 22:59:57 +03:00
Anatol Belski b204b3abd1 further normalizations, uint vs uint32_t
fix merge mistake

yet one more replacement run
2016-11-26 17:29:01 +01:00
Anatol Belski bfb9be9bd4 Merge branch 'PHP-7.1'
* PHP-7.1:
  remove TSRMLS_*
2016-11-22 00:33:29 +01:00
Anatol Belski d61db8d602 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  remove TSRMLS_*
2016-11-22 00:32:42 +01:00
Anatol Belski 5e9b4c26a5 remove TSRMLS_* 2016-11-21 23:53:37 +01:00
Dmitry Stogov 222d22f3e1 Merge branch 'PHP-7.1'
* PHP-7.1:
  Prevent modification of immutable arrays (ext/mbstring/tests/bug26639.phpt failure with opcache.protect_memory=1)
2016-11-17 13:35:10 +03:00
Dmitry Stogov a56bba14e0 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Prevent modification of immutable arrays (ext/mbstring/tests/bug26639.phpt failure with opcache.protect_memory=1)
2016-11-17 13:34:32 +03:00
Dmitry Stogov a67637039f Prevent modification of immutable arrays (ext/mbstring/tests/bug26639.phpt failure with opcache.protect_memory=1) 2016-11-17 13:33:05 +03:00
Yasuo Ohgaki 7cb1be2ecd Use proper API 2016-10-16 07:29:33 +09:00
Yasuo Ohgaki 06b20d973a Fix test and cleanup code a little 2016-10-15 20:51:34 +09:00
Yasuo Ohgaki 4af00876f6 mb_check_encoding()/mb_convert_encoding() - Improve and add recursion detection. 2016-10-15 16:52:17 +09:00
Yasuo Ohgaki 6e530502d2 Implemented Bug #68776 mail() does not have mail header injection prevention for additional headers
(PR 2060)
2016-09-15 06:43:57 +09:00
Andrea Faulds 3cc9090101 Remove remaining zpp fallback code (master branch)
Follow-up to d690014bf3
2016-09-11 22:50:24 +01:00
Yasuo Ohgaki 8c26b0a6d2 Merge branch 'PHP-7.1'
* PHP-7.1:
  Fix Bug #72992 mbstring.internal_encoding doesn't inherit default_charset
2016-09-08 13:33:07 +09:00
Yasuo Ohgaki 1ecf361c15 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fix Bug #72992 mbstring.internal_encoding doesn't inherit default_charset
2016-09-08 13:32:47 +09:00
Yasuo Ohgaki 379d9a1cfc Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix Bug #72992 mbstring.internal_encoding doesn't inherit default_charset
2016-09-08 13:32:31 +09:00
Yasuo Ohgaki 8bbd0952e5 Fix Bug #72992 mbstring.internal_encoding doesn't inherit default_charset 2016-09-08 13:17:10 +09:00
Yasuo Ohgaki 98bc11b0cd Fix memleak. 2016-09-06 18:34:52 +09:00
Yasuo Ohgaki 96e59a200e Merge branch 'PHP-7.1'
* PHP-7.1:
  Fixed Bug #66964 mb_convert_variables() cannot detect recursion
2016-09-06 18:22:04 +09:00
Yasuo Ohgaki 2605ceeaca Added array parameter support to mb_convert_encoding() 2016-09-06 18:20:24 +09:00
Yasuo Ohgaki 012232b9a4 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed Bug #66964 mb_convert_variables() cannot detect recursion
2016-09-06 16:42:07 +09:00
Yasuo Ohgaki 6f1a52bfbb Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fixed Bug #66964 mb_convert_variables() cannot detect recursion
2016-09-06 16:41:52 +09:00
Yasuo Ohgaki a25f6f89cd Fixed Bug #66964 mb_convert_variables() cannot detect recursion 2016-09-06 16:05:34 +09:00
Yasuo Ohgaki b651b96738 Allow array input for mb_check_encoding() 2016-09-02 14:18:34 +09:00
Christoph M. Becker 4c75b00025 Merge branch 'PHP-7.1' 2016-08-30 15:13:30 +02:00
Christoph M. Becker ecdef60d00 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-30 15:12:49 +02:00
Christoph M. Becker 972302d2f0 Merge branch 'PHP-5.6' into PHP-7.0 2016-08-30 15:01:12 +02:00
Christoph M. Becker 2f10db36af Fix #66797: mb_substr only takes 32-bit signed integer
`from` and `len` are `long`, but get passed to mbfl_substr() which expects
`int`s. Therefore we clamp the values to avoid the undefined conversion
behavior.
2016-08-30 14:52:47 +02:00
Masaki Kagaya c28a6f44bb add declaration of functions 2016-08-14 08:09:14 +09:00
Masaki Kagaya f49a5a67cf delete duplicate functions 2016-08-14 06:29:23 +09:00
Yasuo Ohgaki 850a0b5fb6 Merge pull request #1098
Fix bug #69086 enhancement for mb_convert_encoding
2016-08-10 14:39:23 +09:00
Yasuo Ohgaki 8ad4ef98b6 pull-request/1099
Request #65081 - implemeting mb_scrub
2016-08-10 14:09:48 +09:00
Yasuo Ohgaki 087dcd9381 pull-request/1100
Request #65081 mb_chr() and mb_ord()

Added test cases and little optimization.
2016-08-10 11:32:10 +09:00
Masaki Kagaya ee6ccea3eb add php_mb_check_encoding 2016-07-17 14:19:45 +02:00