summaryrefslogtreecommitdiff
path: root/ext/pcre/php_pcre.c
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'PHP-8.0'Nikita Popov2021-03-181-1/+1
|\ | | | | | | | | * PHP-8.0: Fix locale switch back to C in pcre
| * Merge branch 'PHP-7.4' into PHP-8.0Nikita Popov2021-03-181-1/+1
| |\ | | | | | | | | | | | | * PHP-7.4: Fix locale switch back to C in pcre
| | * Fix locale switch back to C in pcreNikita Popov2021-03-181-1/+1
| | | | | | | | | | | | | | | | | | The compile context is shared between patterns, so we need to set the character tables unconditionally in case we switched from a non-C locale to the C locale.
* | | Merge branch 'PHP-8.0'Nikita Popov2021-03-151-0/+4
|\ \ \ | |/ / | | | | | | | | | * PHP-8.0: Fix bug #80866
| * | Merge branch 'PHP-7.4' into PHP-8.0Nikita Popov2021-03-151-0/+4
| |\ \ | | |/ | | | | | | | | | * PHP-7.4: Fix bug #80866
| | * Fix bug #80866Dharman2021-03-151-0/+4
| | | | | | | | | | | | Closes GH-6774.
* | | Replace zend_bool uses with boolNikita Popov2021-01-151-8/+8
| | | | | | | | | | | | | | | | | | | | | 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.
* | | Remove Z_PARAM separate params where they don't make senseNikita Popov2021-01-141-1/+1
|/ / | | | | | | | | | | | | | | | | Separation can only possibly make sense for array parameters (or something that can contain arrays, like zval parameters). It never makes sense to separate a bool. The deref parameters are also of dubious utility, but leaving them for now.
* | Don't leak pcre error_code across requestsNikita Popov2020-10-221-0/+1
| |
* | Review parameter names in ext/pcreMáté Kocsis2020-10-021-1/+1
| | | | | | | | Closes GH-6259
* | Fix preg_replace_callback_array() with array subjectNikita Popov2020-09-151-19/+44
| | | | | | | | Apparently this "feature" was completely untested...
* | Consolidate new union type ZPP macro namesMáté Kocsis2020-09-111-5/+5
| | | | | | | | | | | | | | They will now follow the canonical order of types. Older macros are left intact due to maintaining BC. Closes GH-6112
* | Allocate temporary PCRE match data using ZMMNikita Popov2020-09-071-11/+29
| | | | | | | | | | | | | | | | | | | | | | Create a separate general context that uses ZMM as allocator and use it to allocate temporary PCRE match data (there is still one global match data). There is no requirement that the match data and the compiled regex / match context use the same general context. This makes sure that we do not leak persistent memory on bailout and fixes oss-fuzz #25296, on which half the libfuzzer runs currently get stuck.
* | Promote warnings to exceptions in ext/pcreMáté Kocsis2020-08-251-5/+3
| | | | | | | | Closes GH-6006
* | Implement named parametersNikita Popov2020-07-311-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From an engine perspective, named parameters mainly add three concepts: * The SEND_* opcodes now accept a CONST op2, which is the argument name. For now, it is looked up by linear scan and runtime cached. * This may leave UNDEF arguments on the stack. To avoid having to deal with them in other places, a CHECK_UNDEF_ARGS opcode is used to either replace them with defaults, or error. * For variadic functions, EX(extra_named_params) are collected and need to be freed based on ZEND_CALL_HAS_EXTRA_NAMED_PARAMS. RFC: https://wiki.php.net/rfc/named_params Closes GH-5357.
* | Use ZPP string|array union check in PCRE extensionGeorge Peter Banyard2020-07-091-114/+113
| |
* | Remove no_separation flagNikita Popov2020-07-071-1/+0
| |
* | Disallow separation in a number of callbacksNikita Popov2020-07-071-1/+1
| | | | | | | | All of these clearly do not need separation support.
* | Remove proto comments from C filesMax Semenik2020-07-061-50/+25
| | | | | | | | Closes GH-5758
* | Use ZPP callable check for preg_replace_callback() $callback argumentGeorge Peter Banyard2020-06-221-14/+2
| |
* | Add helper APIs for maybe-interned string creationtwosee2020-06-081-7/+1
| | | | | | | | | | | | | | | | | | | | | | | | Add ZVAL_CHAR/RETVAL_CHAR/RETURN_CHAR as a shortcut for using ZVAL_INTERNED_STRING and ZSTR_CHAR. Add zend_string_init_fast() as a helper for the empty string / one char interned string / zend_string_init() pattern. Also add corresponding ZVAL_STRINGL_FAST etc macros. Closes GH-5684.
* | Constify char * arguments of APIstwosee2020-06-081-11/+11
| | | | | | | | Closes GH-5676.
* | Ensure ctype_string is NULL for C localeNikita Popov2020-05-071-2/+1
| | | | | | | | | | | | | | | | | | We already document that this is the case, but currently it's only true if setlocale() has not been called. Make sure ctype_string is always NULL, even with an explicit "C" locale call, so we can more efficiently check whether we are in the "C" locale. Closes GH-5542.
* | Rename locale_string to ctype_stringNikita Popov2020-05-071-5/+5
| | | | | | | | | | To make it more obvious that this only refers to the LC_CTYPE locale.
* | Add zend_string_concat2 APINikita Popov2020-04-141-3/+3
| |
* | Generate function entries for another batch of extensionsMáté Kocsis2020-04-051-27/+12
| | | | | | | | Closes GH-5352
* | Improve error messages of various extensionsMáté Kocsis2020-03-231-1/+1
| | | | | | | | Closes GH-5278
* | Add preg_last_error_msg() functionNicolas Oelgart2020-02-251-11/+38
| | | | | | | | | | | | | | | | Provides the last PCRE error as a human-readable message, similar to functionality existing in other extensions, such as json_last_error_msg(). Closes GH-5185.
* | Merge branch 'PHP-7.4'Nikita Popov2020-02-111-5/+17
|\ \ | |/ | | | | | | * PHP-7.4: Fixed bug #79257
| * Fixed bug #79257Nikita Popov2020-02-111-5/+17
| | | | | | | | Replace an existing entry for a given name only if we have a match.
* | Merge branch 'PHP-7.4'Nikita Popov2020-02-071-4/+23
|\ \ | |/ | | | | | | | | * PHP-7.4: PCRE: Only remember valid UTF-8 if start offset zero PCRE: Check whether start offset is on char boundary
| * PCRE: Only remember valid UTF-8 if start offset zeroNikita Popov2020-02-071-4/+7
| | | | | | | | | | | | | | PCRE only validates the string starting from the start offset (minus maximum look-behind, but let's ignore that), so we can only remember that the string is fully valid UTF-8 is the original start offset is zero.
| * PCRE: Check whether start offset is on char boundaryNikita Popov2020-02-071-1/+17
| | | | | | | | | | | | We need not just the whole string to be UTF-8, but the start position to be on a character boundary as well. Check this by looking for a continuation byte.
* | Merge branch 'PHP-7.4'Nikita Popov2020-02-051-18/+16
|\ \ | |/ | | | | | | * PHP-7.4: Fixed bug #79188
| * Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2020-02-051-18/+16
| |\ | | | | | | | | | | | | * PHP-7.3: Fixed bug #79188
| | * Fixed bug #79188Nikita Popov2020-02-051-18/+16
| | |
* | | Use RETURN_THROWS() after zend_type_error()Máté Kocsis2020-01-011-1/+1
| | |
* | | Merge branch 'PHP-7.4'Christoph M. Becker2019-11-221-1/+5
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fix #78853: preg_match() may return integer > 1
| * | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2019-11-221-1/+5
| |\ \ | | |/ | | | | | | | | | * PHP-7.3: Fix #78853: preg_match() may return integer > 1
| | * 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>
* | | Merge branch 'PHP-7.4'Nikita Popov2019-11-071-2/+4
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fix php_pcre_mutex_free()
| * | Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2019-11-071-2/+4
| |\ \ | | |/ | | | | | | | | | * PHP-7.3: Fix php_pcre_mutex_free()
| | * 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.4'Nikita Popov2019-10-081-2/+10
|\ \ \ | |/ /
| * | Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2019-10-081-2/+10
| |\ \ | | |/
| | * 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.
* | | | Remove most uses of ZEND_PARSE_PARAMETERS_END_EX()Nikita Popov2019-10-071-2/+2
| | | | | | | | | | | | | | | | | | | | As ZPP now throws, it makes no sense to specify an explicit return value.
* | | | Merge branch 'PHP-7.4'Nikita Popov2019-10-041-0/+6
|\ \ \ \ | |/ / /
| * | | Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2019-10-041-0/+6
| |\ \ \ | | |/ /