summaryrefslogtreecommitdiff
path: root/ext/pcre/php_pcre.c
Commit message (Collapse)AuthorAgeFilesLines
* 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
| |\ \ \ | | |/ /
| | * | 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.
* | | | Remove mention of PHP major version in Copyright headersGabriel Caruso2019-09-251-2/+0
| | | | | | | | | | | | | | | | Closes GH-4732.
* | | | Merge branch 'PHP-7.4'Nikita Popov2019-08-131-0/+1
|\ \ \ \ | |/ / /
| * | | Mark PCRE locale key as local persistentNikita Popov2019-08-131-0/+1
| | | |
* | | | Use TypeError for preg_replace type checkNikita Popov2019-08-111-2/+2
| | | | | | | | | | | | | | | | | | | | This is a type violation warning, and as such should use TypeError in PHP 8.
* | | | Add stubs for PCRE extensionStephen Reay2019-08-111-64/+1
| | | | | | | | | | | | | | | | Closes GH-4501.
* | | | Ref #77388: Don't pass BAD_ESCAPE_IS_LITERALSjon Hortensius2019-07-181-21/+1
|/ / / | | | | | | | | | | | | | | | | | | This option is considered dangerous and unwanted. To allow for more graceful migration don't error on now ignored X modifier. Closes GH-4430.
* | | Split destructorDmitry Stogov2019-07-041-2/+11
| | |
* | | Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2019-06-171-1/+1
|\ \ \ | |/ /
| * | 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.
* | | Add specialized pair construction APINikita Popov2019-06-111-20/+13
| | | | | | | | | | | | Closes GH-3990.
* | | Allow exceptions in __toString()Nikita Popov2019-06-051-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Use ZEND_TRY_ASSIGN_REF_... macros for arguments passed to internal function ↵Dmitry Stogov2019-04-241-3/+3
| | | | | | | | | | | | by reference
* | | Remove checks for locale.h, setlocale, localeconvPeter Kokot2019-04-071-35/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `<loccale.h>` header file, setlocale, and localeconv are part of the standard C89 [1] and on current systems can be used unconditionally. Since PHP 7.4 requires at least C89 or greater, the `HAVE_LOCALE_H`, `HAVE_SETLOCALE`, and `HAVE_LOCALECONV` symbols defined by Autoconf in configure.ac [2] can be ommitted and simplifed. The bundled libmagic (file) has also been patched already in version 5.35 and up in upstream location so when it will be patched also in php-src the check for locale.h header is still left in the configure.ac and in windows headers definition file. [1] https://port70.net/~nsz/c/c89/c89-draft.html#4.4 [2] https://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/headers.m4 Omit the bundled libmagic files
* | | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2019-03-311-0/+1
|\ \ \ | |/ / | | | | | | | | | * PHP-7.3: Fix #77827: preg_match does not ignore \r in regex flags
| * | 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
| | |