summaryrefslogtreecommitdiff
path: root/ext/mbstring/php_mbregex.c
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2020-01-291-0/+1
|\ | | | | | | | | * PHP-7.3: Reset MBREX(search_re) in RSHUTDOWN
| * Reset MBREX(search_re) in RSHUTDOWNNikita Popov2020-01-291-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is going to cause a segfault if reused in the next request. To illustrate the issue, run these two scripts in sequence with the built-in server: // script1.php mb_ereg_search_init('foobar'); mb_ereg_search('foo'); // script2.php var_dump(mb_ereg_search_init("foobar")); var_dump(mb_ereg_search_pos());
* | Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2020-01-291-3/+5
|\ \ | |/ | | | | | | * PHP-7.3: Fix use of mb_ereg_search_getregs() after invalid pattern
| * Fix use of mb_ereg_search_getregs() after invalid patternNikita Popov2020-01-291-3/+5
| | | | | | | | | | This segfaulted because we assumed that if there are matches, there must be a regular expression as well.
* | Add support for mbstring.regex_retry_limitNikita Popov2019-10-061-1/+8
| | | | | | | | | | | | This is very similar to the existing mbstring.regex_stack_limit, but for backtracking. The default value matches pcre.backtrack_limit. Only used on libonig >= 2.8.0.
* | Fix region leak in mb_ereg_replaceNikita Popov2019-06-251-1/+1
| |
* | Allow exceptions in __toString()Nikita Popov2019-06-051-1/+3
| | | | | | | | | | | | | | | | | | | | RFC: https://wiki.php.net/rfc/tostring_exceptions And convert some object to string conversion related recoverable fatal errors into Error exceptions. Improve exception safety of internal code performing string conversions.
* | Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2019-04-111-1/+1
|\ \ | |/
| * Avoid onig match param unused variable warningNikita Popov2019-04-111-1/+1
| |
* | Merge branch 'PHP-7.3' into PHP-7.4Stanislav Malyshev2019-04-011-5/+41
|\ \ | |/ | | | | | | | | | | | | * PHP-7.3: Update NEWS & UPGRADING Add fallbacks for older oniguruma versions Add mbstring.regex_stack_limit to php.ini-* Implement RF bug #72777 - ensure stack limits on mbstring functions.
| * Merge branch 'mb-limit-73' into PHP-7.3Stanislav Malyshev2019-04-011-5/+41
| |\ | | | | | | | | | | | | | | | | | | * mb-limit-73: Add fallbacks for older oniguruma versions Add mbstring.regex_stack_limit to php.ini-* Implement RF bug #72777 - ensure stack limits on mbstring functions.
| | * Add fallbacks for older oniguruma versionsStanislav Malyshev2019-03-301-1/+13
| | |
| | * Implement RF bug #72777 - ensure stack limits on mbstring functions.Yasuo Ohgaki2019-03-281-5/+29
| | | | | | | | | | | | | | | The patch creates new config: mbstring.regex_stack_limit, which defaults to 100000.
| * | Merge branch 'PHP-7.2' into PHP-7.3Stanislav Malyshev2019-03-281-3/+17
| |\ \ | | |/ | |/| | | | | | | | | | | | | * PHP-7.2: Validate subject encoding in mb_split and mb_ereg_match Validate pattern against mbregex encoding SQLite3: add DEFENSIVE config for SQLite >= 3.26.0 as a mitigation strategy against potential security flaws
| | * Merge branch 'PHP-7.1' into PHP-7.2Stanislav Malyshev2019-03-281-3/+17
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | * PHP-7.1: Validate subject encoding in mb_split and mb_ereg_match Validate pattern against mbregex encoding SQLite3: add DEFENSIVE config for SQLite >= 3.26.0 as a mitigation strategy against potential security flaws
| | | * Validate subject encoding in mb_split and mb_ereg_matchNikita Popov2019-03-271-0/+10
| | | | | | | | | | | | | | | | | | | | We were already validating the subject encoding in most functions, but not these two.
| | | * Validate pattern against mbregex encodingNikita Popov2019-03-271-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | Oniguruma does not consistently perform this validation itself (at least on older versions), so make sure we check pattern encoding validity on the PHP side.
| | | * Trim trailing whitespace in source code filesPeter Kokot2018-10-131-1/+1
| | | |
| | * | Trim trailing whitespace in source code filesPeter Kokot2018-10-131-1/+1
| | | |
* | | | Add MB_ONIGURUMA_VERSION and use it in a version dependent testNikita Popov2019-02-111-0/+6
| | | |
* | | | Unbundle onigurumaNikita Popov2019-02-111-7/+0
| | | | | | | | | | | | | | | | And also switch detection over to pkg-config.
* | | | Validate subject encoding in mb_split and mb_ereg_matchNikita Popov2019-02-111-0/+10
| | | | | | | | | | | | | | | | | | | | We were already validating the subject encoding in most functions, but not these two.
* | | | Validate pattern against mbregex encodingNikita Popov2019-02-111-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | Oniguruma does not consistently perform this validation itself (at least on older versions), so make sure we check pattern encoding validity on the PHP side.
* | | | Remove local variablesPeter Kokot2019-02-031-9/+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.
* | | | Deprecate mb_ereg_replace with non-string patternNikita Popov2019-02-011-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I'm counting this towards the non-string needle deprecation from https://wiki.php.net/rfc/deprecations_php_7_3. I wasn't aware that mb_ereg_replace() is also affected by this issue. It's even more ridiculous than usual here, because the integer is interpreted as an ASCII codepoint, even though these are supposed to be multibyte functions :(
* | | | Remove yearly range from copyright noticeZeev Suraski2019-01-301-1/+1
| | | |
* | | | Merge branch 'PHP-7.3'Nikita Popov2019-01-241-2/+1
|\ \ \ \ | |/ / /
| * | | Fixed bug #77514Nikita Popov2019-01-241-2/+1
| | | |
* | | | Implement typed propertiesNikita Popov2019-01-111-3/+5
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Fixed bug #77428Nikita Popov2019-01-081-1/+3
| | | | | | | | | | | | | | | mb_ereg_replace historically has not supported escaping backslashes with backslashes. Go back to that behavior for BC reasons.
* | | Fix #77367: Negative size parameter in mb_splitChristoph M. Becker2019-01-061-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | When adding the last element to the result value of `mb_split`, the `chunk_pos` may point beyond the end of the string, in which case the unsigned `n` would underflow. Therefore, we check whether this is the case in the first place, and only calculate `n` otherwise. Since `n` is no longer used outside the block, we move its declaration inside.
* | | Fix typos in code commentsPeter Kokot2018-07-251-1/+1
| | |
* | | Remove unused Git attributes identPeter Kokot2018-07-251-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Add UPGRADING for mb_ereg changesNikita Popov2018-07-071-20/+14
| | | | | | | | | | | | Also some minor code cleanup.
* | | adds support for named subpatterns to `mb_ereg_replace`ju1ius2018-07-061-30/+135
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Named subpatterns are now passed to `mb_ereg_replace_callback`. This commit also adds a subset of the oniguruma back-reference syntax for replacements: * `\k<name>` and `\k'name'` for named subpatterns. * `\k<n>` and `\k'n'` for numbered subpatterns These last two notations allow referencing numbered groups where n > 9.
* | | adds support for named captures to mb_ereg & mb_ereg_searchju1ius2018-07-061-0/+67
| | | | | | | | | | | | | | | | | | | | | `mb_ereg`, `mb_ereg_search_regs` & `mb_ereg_search_getregs` returned only numbered capturing groups. Now they return both numbered and named capturing groups. Fixes Bug #72704.
* | | Fixed incorrrecr zval_dtor() usage to replace value of argument passed by ↵Dmitry Stogov2018-07-051-1/+1
| | | | | | | | | | | | reference, that may lead to memory leaks.
* | | Replace legacy zval_dtor() by zval_ptr_dtor_nogc() or even more specialized ↵Dmitry Stogov2018-07-041-2/+2
| | | | | | | | | | | | | | | | | | | | | destructors. zval_dtor() doesn't make a lot of sense in PHP-7.* and it's used incorrectly in some places. Its occurances should be replaced by zval_ptr_dtor() or zval_ptr_dtor_nogc(), or even more specialized destructors.
* | | Remove code duplicationNikita Popov2018-06-201-12/+8
| | | | | | | | | | | | And fix indentation
* | | Rework datatypes wrt warningsAnatol Belski2018-03-201-13/+15
| | |
* | | Merge branch 'PHP-7.2'Christoph M. Becker2018-03-201-1/+1
|\ \ \ | |/ / | | | | | | | | | * PHP-7.2: Fix #76113: mbstring does not build with Oniguruma 6.8.1
| * | Merge branch 'PHP-7.1' into PHP-7.2Christoph M. Becker2018-03-201-1/+1
| |\ \ | | |/ | | | | | | | | | * PHP-7.1: Fix #76113: mbstring does not build with Oniguruma 6.8.1
| | * Fix #76113: mbstring does not build with Oniguruma 6.8.1Christoph M. Becker2018-03-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | As of Oniguruma 6.8.1, the regex structure has been moved from the public `oniguruma.h` to the private `regint.h`. Thus, it is no longer possible to directly access the struct's members, and actually, there is no need to, since there are respective accessor functions available at least of 2.3.1.
| | * year++Xinchen Hui2018-01-021-1/+1
| | |
| | * Update copyright headers to 2017Sammy Kaye Powers2017-01-041-1/+1
| | |
| * | year++Xinchen Hui2018-01-021-1/+1
| | |
* | | Trailing whitespacesGabriel Caruso2018-01-031-1/+1
| | | | | | | | | | | | Signed-off-by: Gabriel Caruso <carusogabriel34@gmail.com>
* | | year++Xinchen Hui2018-01-021-1/+1
| | |
* | | Move constants into read-only data segmentDmitry Stogov2017-12-141-3/+3
| | |
* | | Use Zend MM heapDmitry Stogov2017-11-011-4/+4
|/ /