1
0
mirror of https://github.com/php/php-src.git synced 2026-04-25 08:58:28 +02:00
Commit Graph

1294 Commits

Author SHA1 Message Date
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 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 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 77cb7bd837 Free last_used_encoding_name in RSHUTDOWN
efree() cannot be used in GSHUTDOWN
2017-07-20 18:12:04 +02:00
Nikita Popov c098304e17 Reduce number of encoding conversions in case conversion
Don't indirect through UCS4BE, instead directly work on wchars
using a custom filter.

This replaces the pipeline
  utf8 -> wchar -> ucs4be -> wchar -case-> wchar -> ucs4be -> wchar -> utf8
with
  utf8 -> wchar -case-> -> wchar -> utf8
2017-07-20 15:33:24 +02:00
Nikita Popov 17da862b51 Optimize php_unicode_tolower/upper for ASCII 2017-07-20 13:58:40 +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 79c26d597f Optimize php_unicode_is_lower/upper for ASCII 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 4cf22cbb2d Optimize php_unicode_is_prop()
Do not try to extract the properties from a bitmask. Instead make
the function variadic and pass all properties individually.

Also add a php_unicode_is_prop1() function to check only a single
property.
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
Anatol Belski 1e2764614b add oniguruma.patch to ease future upgrades 2017-07-13 17:34:14 +02:00
Lior Kaplan c2c60fcac7 SIZEOF_SIZE_T doesn't exist on AIX and POWER8 (ppc64le), keep using SIZEOF_LONG 2017-07-13 18:05:47 +03:00
Anatol Belski b8a334f149 reapply platform related onig patches 2017-05-30 15:47:56 +02:00
Remi Collet 0ae2f95b8b Update Oniguruma to latest upstream version 6.3.0
Windows specific changes need to be applied again.
2017-05-30 14:14:57 +02:00
Sara Golemon 9d6b7435e4 Ignore ext/mbstring/oniguruma/oniguruma.h
This is just copied in from ext/mbstring/oniguruma/src/oniguruma.h
and is hasn't been kept in GIT since Nov 2016.
2017-05-02 21:48:47 -07:00
Thomas Punt 9f08aff3fd Remove superfluous allocation checks around ZMM-based functions 2017-04-02 00:58:19 +02:00
Thomas Punt 932c4b35dc Remove more unnecessary checks on Zend's allocator functions 2017-03-16 12:23:55 +01:00
Nikita Popov edcabf6d07 Drop unnecessary allocator return value checks 2017-03-13 22:07:15 +01:00
Anatol Belski 297e435722 remove accidentially commited file 2017-03-07 01:33:19 +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
Brian Evans 2fe9208ee3 Use modern autotools name of configure.ac instead of configure.in
configure.ac was introduced in 2001 with automake-1.15 and autoconf-2.50
to replace the file named configure.in.
Autotools is preparing to remove configure.in in Automake 2.0.
All new software should be using configure.ac.
This also fixes Bug #69770 where extensions are creating configure.in

Signed-off-by: Brian Evans <grknight@gentoo.org>
2017-01-27 06:07:40 +00: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
Anatol Belski 8b7fe6cb8a Merge branch 'PHP-7.1'
* PHP-7.1:
  fix C89 compat
2016-12-17 20:47:05 +01:00
Anatol Belski f86e077ec8 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  fix C89 compat
2016-12-17 20:46:09 +01: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
Xinchen Hui bc6b17148b Merge branch 'PHP-7.1'
* PHP-7.1:
  Fixed bug #73646 (mb_ereg_search_init null pointer dereference)
2016-12-09 15:56:41 +08:00
Xinchen Hui 6a43c61bcd Fixed bug #73646 (mb_ereg_search_init null pointer dereference) 2016-12-09 15:55:07 +08:00
Dmitry Stogov 3e9bb03a62 Removed IS_TYPE_IMMUTABLE (it's the same as COPYABLE & !REFCOUED) 2016-11-28 22:59:57 +03:00
Dmitry Stogov 85a62d54b4 Fixed build 2016-11-28 12:12:54 +03:00
Stanislav Malyshev bc85678df3 Add more mbfl string size checks (bug #73505) 2016-11-26 14:49:48 -08:00
Stanislav Malyshev c4ebe4da04 Merge branch 'PHP-7.1'
* PHP-7.1:
  Add more mbfl string size checks (bug #73505)
2016-11-26 14:48:57 -08:00
Stanislav Malyshev dd7eee0609 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Add more mbfl string size checks (bug #73505)
2016-11-26 14:48:50 -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
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 b8645ef29e fix oniguruma.h copying 2016-11-25 23:55:27 +01:00
Anatol Belski 6a34065bf0 fix tests 2016-11-25 23:04:15 +01:00
Anatol Belski 04eb73638b remove generated file 2016-11-25 22:07:00 +01:00
Anatol Belski 2a76d2282a upgrade to Oniguruma 6.1.2 2016-11-25 22:00:53 +01:00
Nikita Popov 5af586bec5 Remove more PHP 6 leftovers from tests 2016-11-24 22:39:39 +01:00
Anatol Belski bfb9be9bd4 Merge branch 'PHP-7.1'
* PHP-7.1:
  remove TSRMLS_*
2016-11-22 00:33:29 +01:00