Commit Graph

239 Commits

Author SHA1 Message Date
Antony Dovgal
b4974d5e68 MFH: fix #39112 (typo in error message) 2006-10-10 12:44:02 +00:00
Nuno Lopes
c55eda9f3b fix memleak of pcre study data 2006-09-06 16:30:59 +00:00
Antony Dovgal
f231b76ba6 fix leak, add test 2006-08-30 16:46:59 +00:00
Marcus Boerger
6fb763c4f9 - MFH Clean up (after consulting Andrei)
. Change the handlers SPL uses to php_pcre_*_impl(pcre_cache_entry*,....)
  . All refactored funcs (match, split, replace, grep) use the above
  . Change (zend|php)_error() to php_error_docref()
  . Move from old to new param parsing api
  . Fix memleaks in unicode mode
2006-07-20 22:53:07 +00:00
Marcus Boerger
bf4c9ef686 - MFH: Little bit refactoring: Two new PHPAPI functions:
. php_pcre_match
  . php_pcre_split
2006-07-16 21:09:30 +00:00
Dmitry Stogov
1dbaae2795 Added automatic module globals management 2006-06-15 18:33:09 +00:00
Nuno Lopes
c3ed91477a fix bug #37800: preg_replace() limit parameter odd behaviour
#this is a regression in PHP_5_2 and HEAD branches only
2006-06-15 15:33:25 +00:00
Nuno Lopes
a943d234f5 fix memory leak uncovered by the pcre_extra.phpt test 2006-06-14 17:52:56 +00:00
Antony Dovgal
43b660b6ea MFH: no need to check it for not-NULL 2006-05-29 21:31:49 +00:00
Antony Dovgal
8ca3826a28 MFH: return NULL in case of error 2006-05-29 20:26:32 +00:00
Marcus Boerger
0de69fe97d - MFH pcre_get_compiled_regex_cache() support 2006-05-09 23:53:40 +00:00
Andrei Zmievski
f9de2cc142 MFH 2006-05-09 18:29:26 +00:00
Andrei Zmievski
6a4faee367 MFH 2006-04-11 21:33:46 +00:00
Andrei Zmievski
d288f66c7c Fix a bug that would not fill in the fifth argument to preg_replace()
properly, if the variable was not declared previously.
2006-04-06 21:10:45 +00:00
Andrei Zmievski
f10bab6f97 MFH. 2006-02-17 21:18:09 +00:00
Andrei Zmievski
6c180238fd TODO 2006-02-06 19:02:53 +00:00
foobar
5bd93221a8 bump year and license version 2006-01-01 12:51:34 +00:00
foobar
3e669bc950 MFH: nuke php3 legacy 2005-12-06 02:28:41 +00:00
Dmitry Stogov
36a14076a8 Fixed bug #34725 (CLI segmentation faults during cleanup in ZTS if ext/pcre is DSO) 2005-10-28 08:30:41 +00:00
Dmitry Stogov
631da59b50 Fixed bug #34790 (preg_match_all(), named capturing groups, variable assignment/return => crash) 2005-10-11 06:47:48 +00:00
foobar
9477097564 MFH: Nuked EOLs from error messages 2005-08-18 13:34:41 +00:00
foobar
23e671a51e - Bumber up year 2005-08-03 14:08:58 +00:00
foobar
156a908997 - Fixed bug #33200 (preg_replace(): magic_quotes_sybase=On makes 'e' modifier misbehave) 2005-05-31 12:54:56 +00:00
Andrei Zmievski
79742f81a2 Flush regexp cache if we detect corruption. 2005-05-24 21:07:32 +00:00
Andrey Hristov
9e939133d2 FR 32275 - fifth parameter to preg_replace() to count number of replaces
made.
#it would be nice if someone of the doc team documents it. thanks!
2005-03-12 12:03:50 +00:00
Antony Dovgal
ffb2cf7a94 return empty string when got empty parameter 2004-12-24 19:45:54 +00:00
Ilia Alshanetsky
5484568c5c Avoid causing a crash. 2004-12-10 00:36:51 +00:00
Antony Dovgal
5dbe3f6f4f fix 1-byte leak 2004-12-09 15:07:56 +00:00
Andrei Zmievski
ace6ff598c MFB. 2004-08-25 20:48:48 +00:00
Marcus Boerger
1d913a9c0b MFB: TSRM fix 2004-08-24 21:49:09 +00:00
Andrei Zmievski
f30355a7df MFB. 2004-08-24 20:58:59 +00:00
Andi Gutmans
56f8195fe5 - Nuke empty_string. It is a reminanent from the time where RETURN_FALSE()
used to return "" and not bool(false). It's not worth keeping it because
  STR_FREE() and zval_dtor() always have to check for it and it slows down
  the general case. In addition, it seems that empty_string has been abused
  quite a lot, and was used not only for setting zval's but generally in
  PHP code instead of "", which wasn't the intention. Last but not least,
  nuking empty_string should improve stability as I doubt every place
  correctly checked if they are not mistakenly erealloc()'ing it or
  calling efree() on it.
  NOTE: Some code is probably broken. Each extension maintainer should
  check and see that my changes are OK. Also, I haven't had time to touch
  PECL yet. Will try and do it tomorrow.
2004-07-19 07:19:50 +00:00
Andrei Zmievski
279770743f MFB (better error checking in pcre_fullinfo() calls). 2004-06-22 22:21:58 +00:00
Rasmus Lerdorf
191a661f8c MFB: Fix for bug #27810 2004-04-23 18:08:58 +00:00
Sebastian Bergmann
e4ad9209ed ZTS fix. 2004-02-01 08:34:47 +00:00
Moriyoshi Koizumi
0330fb2cbf - Fix bug #27103 (preg_split('//u') incorrectly splits UTF-8 strings into octets). 2004-01-31 22:36:33 +00:00
Moriyoshi Koizumi
8e44a6ba0a - POSIX / ISOX compliancy. This is needed to correctly handle UTF-8 characters. 2004-01-31 21:56:42 +00:00
Ilia Alshanetsky
e691cbd4ee Fixed bug #27011 (64bit int/long confusion in preg_match*() functions). 2004-01-28 21:47:36 +00:00
Ilia Alshanetsky
0715651785 Fixed Bug #26927 (preg_quote() does not escape \0). 2004-01-16 02:29:50 +00:00
Andi Gutmans
dbeb4158d2 - A belated happy holidays and PHP 5 2004-01-08 08:18:22 +00:00
Andrei Zmievski
9fc9e4b2cf MFB 2003-12-16 22:20:30 +00:00
Andrei Zmievski
e9fb9a7fa7 *** empty log message *** 2003-12-16 21:53:27 +00:00
foobar
78cb38105d style fix 2003-11-25 20:02:22 +00:00
foobar
df8809650c - Fixed bug #25504 (pcre_match_all() crashes when passed only 2 parameters) 2003-09-12 01:31:54 +00:00
Zeev Suraski
8767205afa Fix Win32 linkage problems 2003-08-31 12:41:53 +00:00
Sascha Schumann
b9a67764d5 Fix error message 2003-08-28 17:09:44 +00:00
Andrei Zmievski
505fd434ac MFB 2003-06-29 00:09:41 +00:00
James Cox
f68c7ff249 updating license information in the headers. 2003-06-10 20:04:29 +00:00
Ilia Alshanetsky
2e361db1fe Fixed bug #23788 (str|preg_replace clober the array elements).
# Should this be MFBed to 4.3 branch?
2003-05-25 21:48:57 +00:00
Andrei Zmievski
8571f5eac2 Put some guards in place. 2003-05-20 18:11:09 +00:00
Sebastian Bergmann
5ca078779a Eliminate some TSRMLS_FETCH() calls. Tested with Win32 build of SAPI/CGI and SAPI/CLI on Win32. 2003-03-25 08:07:13 +00:00
Ilia Alshanetsky
4fde1b8de1 zend_error() -> php_error_docref(). 2003-01-24 05:21:08 +00:00
Moriyoshi Koizumi
e3e364f77b Fixed bug #21758 2003-01-20 16:45:21 +00:00
Ilia Alshanetsky
3d8e54f3a2 Changed php_error to php_error_docref. 2003-01-19 00:45:53 +00:00
Ilia Alshanetsky
b2ecf47755 Fixed bug #21732 (Added a sanity check, that prevents parameter mismatch). 2003-01-18 20:48:52 +00:00
Sebastian Bergmann
b506f5c8f8 Bump year. 2002-12-31 16:08:15 +00:00
Ilia Alshanetsky
c7dd366c1a Fixed bug #20528. 2002-11-21 23:51:52 +00:00
Derick Rethans
a88e5c6e8d - Remove \n from error messages 2002-11-10 21:24:54 +00:00
Andrei Zmievski
a60968287c Fix memory leak in non-ZTS mode. 2002-11-09 00:43:37 +00:00
Marcus Boerger
15b2e277a4 fix compiler warning 2002-10-24 19:15:40 +00:00
Andrei Zmievski
6863d70ef3 Use a copy of locale instead of the original. Fixes bug #19482. 2002-10-07 17:16:23 +00:00
Andrei Zmievski
3f4a2b1b6a @- Added ability to use Perl-style ${n} subpattern references in the
@  replacement string for preg_replace(). Takes care of bug #18442. (Andrei)
2002-09-11 14:41:25 +00:00
Andrei Zmievski
3650bab76f Fix Bug #18341.
@- Fixed cases where preg_split() incorrectly terminated final element if
@  it contained null byte. (Andrei)
2002-07-14 22:36:47 +00:00
foobar
b5e46c5e05 Fix build in ZTS mode 2002-06-13 01:04:40 +00:00
Andrei Zmievski
4f4b983a39 This patch adds ability to capture string offsets in the preg_match_*()
results.
2002-06-12 20:04:20 +00:00
Markus Fischer
9b1ec11184 - Typo. 2002-06-10 22:43:49 +00:00
Andrei Zmievski
001b4c71e4 This code adds string offset capturing in preg_split() results. Original
patch by David Brown, modified by me.
2002-05-23 17:22:05 +00:00
Andrei Zmievski
1668570e4d Changing email address. 2002-05-13 17:28:38 +00:00
Andrei Zmievski
4acbbcf5a9 Revert bogus patch. 2002-04-19 17:23:22 +00:00
Derick Rethans
18a3f085aa - Fix warnings in VC 2002-04-19 14:57:46 +00:00
Sebastian Bergmann
90613d2282 Maintain headers. 2002-02-28 08:29:35 +00:00
Andrei Zmievski
260aee10fe Fix a long-standing infelicity that resulted in extra regex information
not being passed to PCRE functions.
2002-02-12 03:15:27 +00:00
Andrei Zmievski
51f1739983 Expose pcre_get_compiled_regex as an API function. 2002-02-12 03:00:05 +00:00
Andrei Zmievski
d0ed5b984c - Fixed a bug with matching string containing null bytes. 2002-01-15 15:40:31 +00:00
Zeev Suraski
2f8284ca0a Fix a warning and remove a printf() that slipped in... 2001-12-22 03:04:14 +00:00
Andrei Zmievski
0858fb4b73 @- Added flags parameter to preg_grep(). The only flag currently is
@  PREG_GREP_INVERT that will make the function return entries that
@  did not match. (Andrei)
2001-12-18 19:17:57 +00:00
Sebastian Bergmann
38933514e1 Update headers. 2001-12-11 15:32:16 +00:00
Andrei Zmievski
3942e2a8bd Fixed bug #13635. 2001-11-10 23:45:00 +00:00
Andrei Zmievski
a90e5f5a6b @- Fixed a bug in preg_replace() that would change the type of the replacement
@  array entries to string. (Andrei)
2001-10-17 18:20:19 +00:00
Stig Bakken
689252082c * zend_module_entry change: apino, debug and zts are moved first,
see README.EXTENSIONS file for upgrade help.
@Introduced extension version numbers (Stig)
2001-10-11 23:33:59 +00:00
Derick Rethans
78747bd2df - Don't wrap lines... this is annoying while coding. 2001-09-09 13:29:31 +00:00
Sascha Schumann
23b9300fd1 more tsrm cleanup 2001-08-06 03:50:52 +00:00
Andrei Zmievski
8fca87adb5 Updated to match TSRM changes. 2001-07-30 15:41:11 +00:00
Zeev Suraski
c43806f415 Zend compatibility patch 2001-07-30 08:24:42 +00:00
Zeev Suraski
b0224d51da Zend compatibility patch 2001-07-30 05:36:18 +00:00
Zeev Suraski
1c25b8dd53 Avoid TSRMLS_FETCH()'s, and clean up a bit of stale extern's and layout on the way 2001-07-30 01:56:43 +00:00
Zeev Suraski
d87cc976e1 Redesigned thread safety mechanism - nua nua 2001-07-28 11:36:37 +00:00
Zeev Suraski
fe6f8712a4 - Get rid of ELS_*(), and use TSRMLS_*() instead.
- Move to the new ts_allocate_id() API
This patch is *bound* to break some files, as I must have had typos somewhere.
If you use any uncommon extension, please try to build it...
2001-07-27 10:16:41 +00:00
Rui Hirokawa
86ae8add13 added an option to support utf-8 in pcre. 2001-07-13 03:37:18 +00:00
Rasmus Lerdorf
81e2cf03ac Fix folding and clean up some extensions 2001-06-06 13:06:12 +00:00
Rasmus Lerdorf
25c3a3a39d vim-6 does folding - clean up a bunch of missing folding tags plus
some misguided RINIT and RSHUTDOWN calls in a few fringe extensions
2001-06-05 13:12:10 +00:00
Stig Bakken
1beda9ee1e * include "config.h" if HAVE_CONFIG_H is defined (for standalone dso build) 2001-05-24 10:07:29 +00:00
Andrei Zmievski
e1f671fb5c Properly free callback_name only when necessary. 2001-05-20 01:21:44 +00:00
Andrei Zmievski
58f7df0ae4 Revert previous commit - callback_name does need to be checked because
it is set conditional on is_callable_replace.
2001-05-15 18:00:35 +00:00
Andrei Zmievski
eba50153ef No need for check since callback_name is always filled in. 2001-05-14 12:58:48 +00:00
Wez Furlong
340c56e5c7 Fixed leak. 2001-05-12 00:45:55 +00:00
Andrei Zmievski
0eecec7773 @- Fixed a bug in preg_split() that would incorrectly limit the number of
@  results when used along with PREG_SPLIT_NO_EMPTY flag. (Andrei)

- Fixed a bug in preg_split() that would incorrectly limit the number of
  results when used along with PREG_SPLIT_NO_EMPTY flag. (Andrei)
- Also made limit = -1 when limit = 0, to emulate Perl.
2001-05-04 16:43:53 +00:00
Sascha Schumann
c44da99842 Fix freeing of a NULL pointer 2001-04-22 17:20:03 +00:00
Andrei Zmievski
1a1018452c @- Fixed a bug with /e modifier in preg_replace(), that would not correctly
@  replace two-digit references if single digit references were present
@  before them. This fixed bug #10218. (Andrei)
2001-04-16 04:56:31 +00:00
Frank M. Kromann
f49d04fb12 Fixing compiler warning on win32 2001-03-13 16:39:47 +00:00