summaryrefslogtreecommitdiff
path: root/ext/pcre/php_pcre.c
Commit message (Collapse)AuthorAgeFilesLines
* Fixed bug #79188Nikita Popov2020-02-051-18/+16
|
* Fix #78853: preg_match() may return integer > 1Christoph M. Becker2019-11-221-1/+5
| | | | | | | Commit 54ebebd[1] optimized the match loop, but for this case it has been overlooked, that we must only loop if we're doing global matching. [1] <http://git.php.net/?p=php-src.git;a=commit;h=54ebebd686255c5f124af718c966edb392782d4a>
* Fix php_pcre_mutex_free()Nikita Popov2019-11-071-2/+4
| | | | | | We should only set the mutex to NULL if we actually freed it. Due to missing braces non-main threads may currently set it to NULL first.
* Merge branch 'PHP-7.2' into PHP-7.3Nikita Popov2019-10-081-2/+10
|\
| * Add pcre_get_compiled_regex_cache_ex() with local_aware flagSergei Turchanov2019-10-081-2/+10
| | | | | | | | | | | | | | | | | | A new function `pcre_get_compiled_regex_cache_ex()` is introduced, which allows to compile regexp pattern using the "C" locale instead of a current locale. This will be needed to replace setlocale() usage in fileinfo, which is not thread-safe.
* | Improve diagnostic on PCRE JIT mmap failureNikita Popov2019-10-041-0/+6
| | | | | | | | | | | | | | | | | | | | | | Print a more informative message that indicates that this is likely a permission issue, and also indicate that pcre.jit=0 can be used to work around it. Also automatically disable the JIT, so that this message is only shown once. See bug #78630.
* | Merge branch 'PHP-7.2' into PHP-7.3Nikita Popov2019-06-171-1/+1
|\ \ | |/
| * Accept null for preg_quote delimiter argumentNikita Popov2019-06-171-1/+1
| | | | | | | | Related to bug #78163.
* | Merge branch 'PHP-7.2' into PHP-7.3Christoph M. Becker2019-03-311-0/+1
|\ \ | |/ | | | | | | * PHP-7.2: Fix #77827: preg_match does not ignore \r in regex flags
| * Fix #77827: preg_match does not ignore \r in regex flagsChristoph M. Becker2019-03-311-0/+1
| |
| * Fixed possible incorrect "mark" usageDmitry Stogov2018-01-091-0/+5
| |
| * year++Xinchen Hui2018-01-021-1/+1
| |
| * Merge branch 'PHP-7.1' into PHP-7.2Anatol Belski2017-12-061-1/+3
| |\ | | | | | | | | | | | | * PHP-7.1: Fix yet one data race in PCRE
| | * Fix yet one data race in PCREAnatol Belski2017-12-061-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | PCRE 8.x initializes the pattern compiler on demand during the first pcre_study call. It could be worse, but since the compiled patterns are cached, the locking impact is minimal. PCRE 10.x always compiles the pattern and thread sanitizer doesn't complain about the compiler initialization, thus the newer PCRE version seems to be unafected.
* | | Fixed bug #76127Nikita Popov2019-03-191-1/+7
| | | | | | | | | | | | | | | Per documentation, and consistent with other preg functions, we should return false if an error occurred.
* | | Fixed bug #77338Nikita Popov2018-12-261-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Set preg_options to 0 in php_pcre_get_compiled_regex(_ex). These options are intended to be passed to pcre2_match. However, we do not have any flags that actually need to be set during matching (all relevant flags are set during compilation), and the preg_flags value is used for PHP-specific flags instead. This parameter should be removed entirely in master to avoid confusion.
* | | Fixed bug #77193 Infinite loop in preg_replace_callbackAnatol Belski2018-12-011-8/+14
| | | | | | | | | | | | Don't return preallocated match data more than once in nested calls.
* | | Make a copy unconditionallyAnatol Belski2018-09-091-1/+1
| | |
* | | Fix memory leak in pcre cacheAnatol Belski2018-09-091-2/+7
| | |
* | | Fixed bug #76850 Exit code mangled by set locale/preg_matchAnatol Belski2018-09-081-1/+4
| | |
* | | Remove unused Git attributes identPeter Kokot2018-07-251-2/+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.
* | | Removed redundand codeDmitry Stogov2018-07-191-21/+0
| | |
* | | Matching loops optimizationDmitry Stogov2018-07-191-156/+233
| | |
* | | Micro optimizationsDmitry Stogov2018-07-191-28/+36
| | |
* | | Reorder conditionsDmitry Stogov2018-07-181-44/+66
| | |
* | | Move "/e" modifier check into regex compilerDmitry Stogov2018-07-181-10/+12
| | |
* | | Merge "no_utf_check" and "g_notempty" into single "options".Dmitry Stogov2018-07-181-65/+52
| | |
* | | Mark conditions unexpectedAnatol Belski2018-07-111-2/+2
| | |
* | | Reduce error buffer sizeAnatol Belski2018-07-051-1/+1
| | | | | | | | | | | | 120 bytes is ample, the doc says.
* | | Check return value of pcre2_maketables()Anatol Belski2018-06-291-0/+7
| | |
* | | If there's no setlocale, char tables are not usedAnatol Belski2018-06-221-0/+2
| | |
* | | Don't discard char tables just generatedAnatol Belski2018-06-221-10/+1
| | |
* | | Improve locale character tables handling and reduce pattern cache sizeAnatol Belski2018-06-221-15/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a locale other than C is active, character tables are saved into the compile context. Every compiled pattern will have a pointer to the character table, that was present in the context at the time of the pattern compilation. Thus, the cache entries don't need to carry char tables pointer, which reduces their size to 8 bytes on 64-bit. Instead, the generated character tables are tracked in a separate HashTable. If a character table was generated before, it'll be assigned to the compile context when the locale changes. Otherwise a new char table will be generated and cached.
* | | Fixed bug #76514 Regression in preg_match makes it fail with ↵Anatol Belski2018-06-221-1/+1
| | | | | | | | | | | | | | | | | | | | | PREG_JIT_STACKLIMIT_ERROR Looks like some patterns might require more stack for JIT execution. It is a regression, as the same pattern was passing using JIT.
* | | Fix #76512: \w no longer includes unicode charactersChristoph M. Becker2018-06-211-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | The migration from PCRE to PCRE2 missed to rename once occurrence of `PCRE_UCP` to `PCRE2_UCP`. We fix that. We also revert the changes to bug52971.phpt which had been incorrectly made in commit a5bc5ae[1]. [1] <http://git.php.net/?p=php-src.git;a=commit;h=a5bc5aed71f7a15f14f33bb31b8e17bf5f327e2d>
* | | Use zend_string_release_ex() instread of zend_string_release() in places, ↵Dmitry Stogov2018-05-281-23/+23
| | | | | | | | | | | | where we sure about string persistence.
* | | Reduce var scopeAnatol Belski2018-02-171-1/+2
| | |
* | | year++Xinchen Hui2018-01-021-1/+1
| | |
* | | Use zend_hash_find() instead of zend_hash_find_ptr() to avoid double checkDmitry Stogov2017-12-271-8/+6
| | |
* | | Fixed bug #75355: preg_quote() does not quote # control characterMichael Moravec2017-12-161-0/+2
| | |
* | | Merge branch 'PHP-7.2'Anatol Belski2017-12-051-1/+1
|\ \ \ | |/ / | | | | | | | | | * PHP-7.2: Fix use after free revealed by phpdbg
| * | Merge branch 'PHP-7.1' into PHP-7.2Anatol Belski2017-12-051-1/+1
| |\ \ | | |/ | | | | | | | | | * PHP-7.1: Fix use after free revealed by phpdbg
| | * Fix use after free revealed by phpdbgAnatol Belski2017-12-051-1/+1
| | |
| | * Fixed bug #75601 Thread race in PCRE JIT supportAnatol Belski2017-12-051-0/+18
| | |
| * | Fixed bug #75601 Thread race in PCRE JIT supportAnatol Belski2017-12-051-0/+18
| | |
* | | Fixed bug #75601 Thread race in PCRE JIT supportAnatol Belski2017-12-051-0/+19
| | |
* | | Fix macro nameAnatol Belski2017-11-211-8/+8
| | |
* | | Merge branch 'PHP-7.2'Anatol Belski2017-11-211-0/+8
|\ \ \ | |/ / | | | | | | | | | * PHP-7.2: Fixed #75539 and #74183 - preg_last_error not returning error code after error
| * | Merge branch 'PHP-7.1' into PHP-7.2Anatol Belski2017-11-211-0/+8
| |\ \ | | |/ | | | | | | | | | * PHP-7.1: Fixed #75539 and #74183 - preg_last_error not returning error code after error
| | * Merge branch 'PHP-7.0' into PHP-7.1Anatol Belski2017-11-211-0/+8
| | |\ | | | | | | | | | | | | | | | | * PHP-7.0: Fixed #75539 and #74183 - preg_last_error not returning error code after error