summaryrefslogtreecommitdiff
path: root/ext/intl/grapheme
Commit message (Collapse)AuthorAgeFilesLines
* Replace zend_bool uses with boolNikita Popov2021-01-151-2/+2
| | | | | | | We're starting to see a mix between uses of zend_bool and bool. Replace all usages with the standard bool type everywhere. Of course, zend_bool is retained as an alias.
* Fix out of bounds offset handling with empty needleNikita Popov2020-10-011-2/+2
| | | | For strrpos with positive out of bounds offsets was not detected.
* Allow empty needle in grapheme_str*pos, grapheme_str*strChristian Schneider2020-10-012-25/+11
| | | | | | | For consistency with str* and mb_str* functions. Closes GH-6245. Closes php/php-tasks#20.
* Normalize substr() behaviorNikita Popov2020-09-252-50/+26
| | | | | | | | | | | | Make the behavior of substr(), mb_substr(), iconv_substr() and grapheme_substr() consistent when it comes to the handling of out of bounds offsets. substr() will now always clamp out of bounds offsets to the string boundary. Cases that previously returned false will now return an empty string. This means that substr() itself *always* returns a string now (like mb_substr() already did before.) Closes GH-6182.
* Handle out-of-bounds offset consistently in grapheme_* APINikita Popov2020-09-222-32/+21
| | | | | | Make sure we throw the same kind of error regardless of whether the offset is out-of-bounds in the fast path or in the slow path.
* Fix grapheme out of bounds checkNikita Popov2020-09-221-1/+1
| | | | An offset equal to the string length is not out of bounds.
* Consolidate the usage of "either" and "one of" in error messagesMáté Kocsis2020-09-201-1/+1
| | | | Closes GH-6173
* Promote warnings to exceptions in ext/intlMáté Kocsis2020-09-071-33/+33
| | | | Closes GH-5972
* Remove proto comments from C filesMax Semenik2020-07-061-18/+9
| | | | Closes GH-5758
* Generate method entries for ext/intlMáté Kocsis2020-04-141-10/+0
| | | | Closes GH-5370
* Do not include the same stub multiple timesMáté Kocsis2020-04-032-58/+0
| | | | Closes GH-5322
* Add stubs for various intl functionsMáté Kocsis2020-01-032-0/+58
| | | | | | | | | | | | Closes GH-4819 - Add stubs for idn functions - Add stubs for grapheme functions - Add stubs for Spoofchecker - Add stubs for Normalizer - Add stubs for ResourceBundle - Fix arginfos - Add support for union return types - Fix arginfo for resourcebundle_create()
* Use RETURN_THROWS() during ZPP in most of the extensionsMáté Kocsis2019-12-311-8/+8
| | | | Except for some bigger ones: reflection, sodium, spl
* Cleanup return values for Intl when parameter parsing is unsuccessfulMáté Kocsis2019-10-301-8/+8
| | | | Closes GH-4871.
* Remove mention of PHP major version in Copyright headersGabriel Caruso2019-09-254-8/+0
| | | | Closes GH-4732.
* Intl: Don't separately report "bad arguments" errorsNikita Popov2019-03-111-18/+0
| | | | | zpp will be throwing for these now, don't report them in addition to that.
* Remove local variablesPeter Kokot2019-02-032-18/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes the so called local variables defined per file basis for certain editors to properly show tab width, and similar settings. These are mainly used by Vim and Emacs editors yet with recent changes the once working definitions don't work anymore in Vim without custom plugins or additional configuration. Neither are these settings synced across the PHP code base. A simpler and better approach is EditorConfig and fixing code using some code style fixing tools in the future instead. This patch also removes the so called modelines for Vim. Modelines allow Vim editor specifically to set some editor configuration such as syntax highlighting, indentation style and tab width to be set in the first line or the last 5 lines per file basis. Since the php test files have syntax highlighting already set in most editors properly and EditorConfig takes care of the indentation settings, this patch removes these as well for the Vim 6.0 and newer versions. With the removal of local variables for certain editors such as Emacs and Vim, the footer is also probably not needed anymore when creating extensions using ext_skel.php script. Additionally, Vim modelines for setting php syntax and some editor settings has been removed from some *.phpt files. All these are mostly not relevant for phpt files neither work properly in the middle of the file.
* Sync leading and final newlines in source code filesPeter Kokot2018-10-142-2/+0
| | | | | | | | | | | | | | | | | | | | | | This patch adds missing newlines, trims multiple redundant final newlines into a single one, and trims redundant leading newlines. According to POSIX, a line is a sequence of zero or more non-' <newline>' characters plus a terminating '<newline>' character. [1] Files should normally have at least one final newline character. C89 [2] and later standards [3] mention a final newline: "A source file that is not empty shall end in a new-line character, which shall not be immediately preceded by a backslash character." Although it is not mandatory for all files to have a final newline fixed, a more consistent and homogeneous approach brings less of commit differences issues and a better development experience in certain text editors and IDEs. [1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206 [2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2 [3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
* Require ICU ≥ 50.1Christoph M. Becker2018-09-151-2/+0
| | | | | | | | | | | | | | | | | Given that ICU is a set of lively developed libraries, that ICU 50.1 has been released on 2012-11-05, and PHP 7.4 is scheduled to be released seven years after it, we consider it appropriate to ditch these legacy versions. Particularly, that would be a reasonable groundwork to implement part two of the “Deprecate and remove INTL_IDNA_VARIANT_2003” RFC[1], namely to default idn_to_ascii()'s and idn_to_utf8()'s $variant parameter to INTL_IDNA_VARIANT_UTS46, which is not defined in ICU < 4.6. See also the related discussion on internals@[2]. [1] <https://wiki.php.net/rfc/deprecate-and-remove-intl_idna_variant_2003> [2] <http://news.php.net/php.internals/101626>ff
* Use recommended way to handle utf*.h headers and obsolete symbolsAnatol Belski2018-04-051-2/+5
|
* Reduce var scopeAnatol Belski2018-02-162-3/+3
|
* Fixed wrong usage of old ZPP API.Dmitry Stogov2017-06-191-2/+1
|
* Merge branch 'PHP-7.0' into PHP-7.1Stanislav Malyshev2017-01-161-1/+2
|\ | | | | | | | | | | * PHP-7.0: Fix bug #73634 - grapheme_strpos illegal memory access Fix typo
| * Fix bug #73634 - grapheme_strpos illegal memory accessStanislav Malyshev2017-01-161-1/+2
| |
* | Merge branch 'PHP-7.0' into PHP-7.1Dmitry Stogov2016-12-011-3/+3
|\ \ | |/ | | | | | | * PHP-7.0: Fixed bad merge
| * Fixed bad mergeDmitry Stogov2016-12-011-3/+3
| |
* | Merge branch 'PHP-7.0' into PHP-7.1Dmitry Stogov2016-12-011-3/+3
|\ \ | |/ | | | | | | | | * PHP-7.0: Workaround for GCC-4.9.2 bug oops, changed in wrong place
| * Merge branch 'PHP-5.6' into PHP-7.0Dmitry Stogov2016-12-011-3/+3
| |\ | | | | | | | | | | | | | | | * PHP-5.6: Workaround for GCC-4.9.2 bug oops, changed in wrong place
| | * oops, changed in wrong placeStanislav Malyshev2016-11-271-3/+3
| | |
* | | Merge branch 'PHP-7.0' into PHP-7.1Stanislav Malyshev2016-11-271-50/+28
|\ \ \ | |/ / | | | | | | | | | | | | * PHP-7.0: add NEWS Fix #68447: grapheme_extract take an extra trailing character
| * | Merge branch 'PHP-5.6' into PHP-7.0Stanislav Malyshev2016-11-271-50/+28
| |\ \ | | |/ | | | | | | | | | * PHP-5.6: Fix #68447: grapheme_extract take an extra trailing character
| | * Merge branch 'pull-request/1974' into PHP-5.6Stanislav Malyshev2016-11-271-53/+32
| | |\ | | | | | | | | | | | | | | | | * pull-request/1974: Fix #68447: grapheme_extract take an extra trailing character
| | | * Fix #68447: grapheme_extract take an extra trailing characterSATO Kentaro2016-07-011-49/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | grapheme_extract() converts UTF-8 string in the argument to UTF-16 to iterate through graphemes, and count each UTF-16 character as one Unicode character, which is not correct for UTF-16 surrogate pairs. The patch removes the conversion and counts UTF-8 directly if needed.
* | | | Merge branch 'PHP-7.0' into PHP-7.1Christoph M. Becker2016-08-201-1/+1
|\ \ \ \ | |/ / /
| * | | Merge branch 'PHP-5.6' into PHP-7.0Christoph M. Becker2016-08-201-1/+1
| |\ \ \ | | |/ /
| | * | Fix #65732: grapheme_*() is not Unicode compliant on CR LF sequenceChristoph M. Becker2016-08-201-1/+1
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | According to the Unicode specification (at least as of 5.1), CRLF sequences are considered to be a single grapheme. We cater to that special case by letting grapheme_ascii_check() fail. While it would be trivial to fix grapheme_ascii_check() wrt. grapheme_strlen(), grapheme_substr() and grapheme_strrpos() would be much harder to handle, so we accept the slight performance penalty if CRLF is involved.
* | | Fixed compilation warningsDmitry Stogov2016-06-223-6/+4
| | |
* | | Merge branch 'PHP-7.0'Anatol Belski2016-04-271-4/+5
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * PHP-7.0: fix merge Fix memory leak Fix bug #72099: xml_parse_into_struct segmentation fault 5.5.36 now Fix bug #72094 - Out of bounds heap read access in exif header processing Fix bug #72093: bcpowmod accepts negative scale and corrupts _one_ definition Fix bug #72061 - Out-of-bounds reads in zif_grapheme_stripos with negative offset Fix for bug #71912 (libgd: signedness vulnerability) Typo in NEWS
| * | Merge branch 'PHP-5.6' into PHP-7.0Anatol Belski2016-04-271-3/+5
| |\ \ | | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * PHP-5.6: Fix memory leak Fix bug #72099: xml_parse_into_struct segmentation fault 5.5.36 now Fix bug #72094 - Out of bounds heap read access in exif header processing Fix bug #72093: bcpowmod accepts negative scale and corrupts _one_ definition Fix bug #72061 - Out-of-bounds reads in zif_grapheme_stripos with negative offset Fix for bug #71912 (libgd: signedness vulnerability) Typo in NEWS
| | * Fix bug #72061 - Out-of-bounds reads in zif_grapheme_stripos with negative ↵Stanislav Malyshev2016-04-241-5/+7
| | | | | | | | | | | | offset
* | | Add negative offset support to grapheme_strpos/stripos/extract()Francois Laupretre2016-03-091-14/+19
|/ /
* | Fix/improve zpp usageNikita Popov2015-10-021-2/+2
| | | | | | | | | | | | The ext/interbase changes are done blindly, fingers crossed. Some of these are bug fixes, some make zpp usage more idiomatic.
* | Removed or simplified incorrect SEPARATE_*() macros usage.Dmitry Stogov2015-09-291-1/+1
| |
* | Cleanup (avoid string reallocations)Dmitry Stogov2015-07-011-23/+9
| |
* | s/PHP Version 5/PHP Version 7/gLior Kaplan2015-03-131-1/+1
| | | | | | | | Follow up for d0cb7153
* | trailing whitespace removalStanislav Malyshev2015-01-102-23/+23
| |
* | cleanup intl typesStanislav Malyshev2014-12-293-146/+120
| |
* | first shot remove TSRMLS_* thingsAnatol Belski2014-12-134-67/+67
| |
* | s/PHP 5/PHP 7/Johannes Schlüter2014-09-193-3/+3
| |
* | 's' works with size_t round 3Anatol Belski2014-08-271-8/+11
| |