Commit Graph

929 Commits

Author SHA1 Message Date
Dmitry Stogov
f626a783b6 Avoid string duplication in preg_split() 2017-06-28 00:43:55 +03:00
Tom Van Looy
04fb3f28ff Remove superfluous semicolons 2017-06-26 00:23:25 +02:00
Nikita Popov
035a27cbc6 Only compute callback name in error cases
Mostly the callback name is only used to report an error. Try to
avoid calculating it if no error occurred.
2017-06-25 18:45:59 +02:00
Dmitry Stogov
71daef93bc preg_replace() optimization 2017-06-07 13:50:16 +03:00
Dmitry Stogov
81a6ee9aa4 Avoid string reallocations in preg_quote() 2017-06-06 13:56:19 +03:00
Dmitry Stogov
4f947e1f40 PCRE_EXTRA_MARK is useful only for preg_replace_callbakc().
Removed branch expectations.
2017-06-02 14:34:31 +03:00
Dmitry Stogov
8dc6b41011 Added support for PCRE JIT fast path API 2017-06-02 13:14:33 +03:00
Dmitry Stogov
32200e0b69 Avoid double copying 2017-05-31 02:14:17 +03:00
Dmitry Stogov
c45e3632a2 Don't allocate empty strings, use single interned string instead. 2017-05-30 10:02:04 +03:00
Remi Collet
cb28a0ab2d missing fix for test 2017-05-29 11:41:16 +02:00
Nicolas Grekas
3c43510b19 add PREG_UNMATCHED_AS_NULL flag to allow distinguish between unmatched subpatterns and empty matches 2017-05-29 11:40:29 +02:00
Dmitry Stogov
dd4a78b631 Don't separate output arguments 2017-05-23 17:18:05 +03:00
Nikita Popov
06a0340162 Deprecate each() 2017-02-03 21:02:52 +01:00
Nikita Popov
eaeecc523b Deprecate create_function() 2017-02-03 18:52:57 +01:00
Anatol Belski
f7bb3b5cbd Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Revert "Test request47456.phpt for PR 1303" on PHP-7.0 and PHP-7.1
2017-01-07 02:05:37 +01:00
Mitch Hagstrand
4568618030 Revert "Test request47456.phpt for PR 1303" on PHP-7.0 and PHP-7.1
This reverts commit e55e93a1e3.
This change should only apply to master. Not PHP-7.0 or PHP-7.1
2017-01-07 02:04:03 +01:00
Joe Watkins
c50f61b9b0
Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Test request47456.phpt for PR 1303
2017-01-06 16:22:58 +00:00
Mitch Hagstrand
e55e93a1e3
Test request47456.phpt for PR 1303
After merging PR 1303 unmatched subpatterns are set to NULL
2017-01-06 16:22:11 +00:00
Christoph M. Becker
cba33121f2 Fix test case
Unmatched subpatterns are reported as NULL as of commit ee6aaee8, so we
adjust the test accordingly.
2017-01-06 11:50:30 +01:00
Joe Watkins
ee6aaee83a
Merge branch 'pull-request/1303'
* pull-request/1303:
  Distinguish between unmatched subpatterns and empty matches in preg_*()
  news entry for PR #1303
2017-01-06 05:48:31 +00:00
Sammy Kaye Powers
dac6c639bb Update copyright headers to 2017 2017-01-04 11:23:42 -06:00
Sammy Kaye Powers
478f119ab9 Update copyright headers to 2017 2017-01-04 11:14:55 -06:00
Sammy Kaye Powers
9e29f841ce Update copyright headers to 2017 2017-01-02 09:30:12 -06:00
Christoph M. Becker
1b7e014d1c Merge branch 'PHP-7.1' 2016-11-26 16:11:08 +01:00
Christoph M. Becker
09085ac02c Merge branch 'PHP-7.0' into PHP-7.1 2016-11-26 16:09:45 +01:00
Christoph M. Becker
003727d851 Fix #73612: preg_*() may leak memory
We have to make sure that collectible zvals end up in the GC root
buffer, to avoid memory leaks.
2016-11-26 15:34:27 +01:00
Nikita Popov
45f7b2bcc8 Fix CRLF line-endings in tests
Also fix a single instance of CRLF in ibase_query.c.
2016-11-20 22:31:24 +01:00
Pedro Magalhães
9c5af4e4cb Remove the b prefix from literals on unrelated tests 2016-11-20 21:11:53 +01:00
Xinchen Hui
6ee8581a0e Removed not used field 2016-11-20 15:52:52 +08:00
Xinchen Hui
0f5d03025f Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #73483 (Segmentation fault on pcre_replace_callback)
  Fix #73219 (fix acinclude when / is present)
  make it possible to show specific help pages without interactive session

Conflicts:
	acinclude.m4
2016-11-20 15:46:53 +08:00
Xinchen Hui
ebfd93f725 Fixed bug #73483 (Segmentation fault on pcre_replace_callback) 2016-11-20 15:44:27 +08:00
Xinchen Hui
6b671ca3ed Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Skip if no jit is built
2016-10-29 14:23:47 +08:00
Xinchen Hui
66caa61188 Skip if no jit is built 2016-10-29 14:23:25 +08:00
Xinchen Hui
7778bdcd04 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #73392 (A use-after-free in zend allocator management)
2016-10-28 21:21:35 +08:00
Xinchen Hui
e5aa365147 Fixed bug #73392 (A use-after-free in zend allocator management) 2016-10-28 21:21:24 +08:00
Nikita Popov
b1fc1fb937 Normalize preg_replace_callback() return value
One particular error case was returning the argument without
casting to string.
2016-10-15 23:58:26 +02:00
Anatol Belski
dd604015be rename publicly exposed symbol to avoid name conflicts
(cherry picked from commit 730288ae41)
2016-10-14 02:08:14 +02:00
Stanislav Malyshev
0362d61ab7 Fix potential overflows in php_pcre_replace_impl
(cherry picked from commit 9c50ba42d6)
2016-10-14 01:57:55 +02:00
Anatol Belski
730288ae41 rename publicly exposed symbol to avoid name conflicts 2016-10-13 15:23:50 +02:00
Stanislav Malyshev
9c50ba42d6 Fix potential overflows in php_pcre_replace_impl 2016-10-12 23:07:47 -07:00
Stanislav Malyshev
29e2a204fb Fixed bug #73174 - heap overflow in php_pcre_replace_impl 2016-09-28 22:29:59 -07:00
Anatol Belski
f7e5481a10 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fix bug #73121 Bundled PCRE doesn't compile because JIT isn't supported on s390
2016-09-23 01:55:17 +02:00
Anatol Belski
54d8053ac5 Fix bug #73121 Bundled PCRE doesn't compile because JIT isn't supported on s390 2016-09-23 01:52:42 +02:00
Stanislav Malyshev
19866fb76c Fix various int size overflows.
Add function for detection of string zvals with length that does not fit
INT_MAX.
2016-09-12 21:04:23 -07:00
Andrea Faulds
fc5497cb92 Merge branch 'PHP-7.0' into PHP-7.1 2016-09-11 22:46:20 +01:00
Andrea Faulds
d690014bf3 Remove zpp fallback code (always use Fast ZPP)
Squashed commit of the following:

commit 3e27fbb3d2
Author: Andrea Faulds <ajf@ajf.me>
Date:   Sun Sep 11 19:14:37 2016 +0100

    Keep dummy FAST_ZPP macro for compatibility

commit 8a7cfd00de
Author: Andrea Faulds <ajf@ajf.me>
Date:   Mon Sep 5 22:36:03 2016 +0100

    Remove FAST_ZPP macro and plain zpp fallback code
2016-09-11 22:44:46 +01:00
Christoph M. Becker
68d3501381 Merge branch 'pull-request/2115' into PHP-7.1 2016-09-06 14:14:23 +02:00
Stanislav Malyshev
9650b8e241 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Implement #47456: Missing PCRE option 'J'
2016-09-05 00:39:01 -07:00
Stanislav Malyshev
92db92c620 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Implement #47456: Missing PCRE option 'J'
2016-09-05 00:38:57 -07:00
Christoph M. Becker
39423e425d Implement #47456: Missing PCRE option 'J'
While it is possible to force the same behavior by setting the internal
option (?J), having a dedicated modifier appears to be useful. After all,
J is even listed on the "Pattern Modifiers" man page[1], but the description
referrs to (?J).

[1] <http://php.net/manual/en/reference.pcre.pattern.modifiers.php>
2016-09-05 00:30:48 -07:00
Christoph M. Becker
727b422ad9 Fix #72948: Uncatchable "Catchable" fatal error for class to string conversions
E_RECOVERABLE errors are reported as "Catchable fatal error". This is
misleading, because they actually can't be caught via try-catch statements.
Therefore we change the wording to "Recoverable fatal error" as suggested by
Nikita.
2016-09-03 13:05:37 +02:00
Anatol Belski
a747578497 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  fix possible memory leak
2016-08-29 15:29:52 +02:00
Anatol Belski
1d7ec685c1 fix possible memory leak 2016-08-29 15:28:09 +02:00
Anatol Belski
db9baae4fb Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  update NEWS
  Revert "upgraded to PCRE 8.39"
2016-07-31 15:00:18 +02:00
Anatol Belski
5f9df47ea8 Revert "upgraded to PCRE 8.39"
This reverts commit 2fba646837.

PCRE-8.39 throws weird valgrind backtraces on some systems, see
http://news.php.net/php.cvs/93494 . Those could be false positives
due to some changes in JIT, still i couldn't 100% ensure this.
Thus, better we continue to ship 8.38 bundled for now, and apply
patches, if needed.
2016-07-31 14:55:17 +02:00
Christoph M. Becker
15f94e93e7 Merge branch 'PHP-7.0' into PHP-7.1 2016-07-27 19:06:36 +02:00
Christoph M. Becker
40afd77826 Merge branch 'PHP-5.6' into PHP-7.0
# Resolved conflicts:
#	ext/pcre/php_pcre.c
2016-07-27 19:00:38 +02:00
Christoph M. Becker
315c0536c2 Fix #72688: preg_match missing group names in matches
We have to multiply with 0x100 to properly scale the high byte.
2016-07-27 18:50:52 +02:00
Anatol Belski
2fba646837 upgraded to PCRE 8.39
(cherry picked from commit 9d4fe9672a)
2016-07-26 15:07:04 +02:00
Matteo Beccati
e2e72e1f5c Merge branch 'PHP-7.0'
* PHP-7.0:
  Rewrite test to avoid sending emails
2016-07-06 07:10:10 +02:00
Matteo Beccati
ff7c981d19 Rewrite test to avoid sending emails
A properly configured email server was generating bounce emails when running
the test.
2016-07-06 07:08:43 +02:00
Anatol Belski
4ac29543d6 Merge branch 'PHP-7.0'
* PHP-7.0:
  yet another test rewrite
2016-06-23 09:42:50 +02:00
Anatol Belski
056c2ce349 yet another test rewrite 2016-06-23 09:42:17 +02:00
Xinchen Hui
dad500ef6a Merge branch 'PHP-7.0'
* PHP-7.0:
  Fixed bug #72476 (Memleak in jit_stack)
2016-06-23 14:07:08 +08:00
Xinchen Hui
bd74e7d013 Fixed bug #72476 (Memleak in jit_stack) 2016-06-23 14:06:48 +08:00
Anatol Belski
0b0758cc31 Merge branch 'PHP-7.0'
* PHP-7.0:
  rewrite test
2016-06-22 19:47:59 +02:00
Anatol Belski
4edbac6ec5 rewrite test 2016-06-22 19:46:02 +02:00
Anatol Belski
d20372cf6c Merge branch 'PHP-7.0'
* PHP-7.0:
  Fixed bug #72463 mail fails with invalid argument
2016-06-22 19:10:57 +02:00
Anatol Belski
e453904251 Fixed bug #72463 mail fails with invalid argument 2016-06-22 19:06:33 +02:00
Anatol Belski
9d4fe9672a upgraded to PCRE 8.39 2016-06-19 20:38:31 +02:00
Xinchen Hui
0b3a4c6101 Revert "Revert "fix #72143 (preg_replace uses int instead of size_t on zend_string_allocs)""
obviously I read the change is in argument lists by mistake :<

This reverts commit 9e7afa7514.
2016-05-16 06:22:13 -07:00
Xinchen Hui
9e7afa7514 Revert "fix #72143 (preg_replace uses int instead of size_t on zend_string_allocs)"
ABI break

This reverts commit fb951553be.
2016-05-16 11:24:16 +08:00
Joe Watkins
90f46f2c5b fix #72143 (preg_replace uses int instead of size_t on zend_string_allocs) 2016-05-14 08:21:32 +01:00
Joe Watkins
fb951553be fix #72143 (preg_replace uses int instead of size_t on zend_string_allocs) 2016-05-14 08:20:41 +01:00
Dmitry Stogov
37f7c71f3e Simplified condition 2016-04-29 12:33:54 +03:00
Anatol Belski
241ba9dcb1 if there's no JIT support, no RINIT is really needed 2016-03-22 21:42:21 +01:00
Anatol Belski
e988239634 decrease the default PCRE JIT stack to 64K 2016-03-21 18:59:39 +01:00
Anatol Belski
e23a41225f Increase PCRE JIT stack size
It is done by implementing the custom stack usage. This makes the
JIT with mode on more compatible with the JIT mode off. Until now, the
default PCRE JIT stack was used which is 32kb big by default. There
are situations where some patterns would fail with JIT while working
correctly without JIT.

The starting size of the JIT stack is still set to 32kb, while the
max is set to the permissive 256kb (and can be increased up to 1mb).
As until now no suchlike bugs regarding JIT were reported, it is expected,
that the stack usage will stay by 32kb in most cases. Though providing
the custom stack, applications will have more room for some sporadic
stack increase, thus more compatibility.
2016-03-21 17:31:26 +01:00
Nikita Popov
5a6da79fd0 Fix bug #71659 2016-03-09 23:00:53 +01:00
James Titcumb
c4b188871e Fix bug #71575 removing extra semicolons outside macros 2016-03-03 16:41:03 +01:00
Xinchen Hui
0490d4a404 Happy Year of Monkey (Forgot test of #71537) 2016-02-08 10:22:16 +08:00
Xinchen Hui
336e39f2b1 Fixed bug #71537 (PCRE segfault from Opcache) 2016-02-07 23:19:24 +08:00
Stanislav Malyshev
916c1fb3af Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Upgrade bundled PCRE to 8.38
  Fixed NEWS file entry
  fix the fix for bug #70976 (imagerotate)

Conflicts:
	ext/pcre/pcrelib/config.h
2016-01-31 21:39:24 -08:00
Stanislav Malyshev
00788f9cfb Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Upgrade bundled PCRE to 8.38
  Fixed NEWS file entry
  fix the fix for bug #70976 (imagerotate)
2016-01-31 21:06:31 -08:00
Stanislav Malyshev
ca02d9c2d6 Upgrade bundled PCRE to 8.38 2016-01-31 20:37:47 -08:00
Lior Kaplan
ed35de784f Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Happy new year (Update copyright to 2016)
2016-01-01 19:48:25 +02:00
Lior Kaplan
49493a2dcf Happy new year (Update copyright to 2016) 2016-01-01 19:21:47 +02:00
Xinchen Hui
817513af4e Fixed bug #71178 (preg_replace with arrays creates [0] in replace array if not already set) 2015-12-21 18:10:48 +08:00
Anatol Belski
c0ca731d7a add comment to test 2015-10-07 09:43:28 +02:00
Dmitry Stogov
560e4fa393 Removed or simplified incorrect SEPARATE_*() macros usage. 2015-09-29 11:17:43 +03:00
Stanislav Malyshev
9b1a224d4e Merge branch 'PHP-5.6'
* PHP-5.6: (21 commits)
  fix unit tests
  update NEWS
  add NEWS for fixes
  Improve fix for #70172
  Fix bug #70312 - HAVAL gives wrong hashes in specific cases
  fix test
  add test
  Fix bug #70366 - use-after-free vulnerability in unserialize() with SplDoublyLinkedList
  Fix bug #70365 - use-after-free vulnerability in unserialize() with SplObjectStorage
  Fix bug #70172 - Use After Free Vulnerability in unserialize()
  Fix bug #70388 - SOAP serialize_function_call() type confusion
  Fixed bug #70350: ZipArchive::extractTo allows for directory traversal when creating directories
  Improve fix for #70385
  Fix bug #70345 (Multiple vulnerabilities related to PCRE functions)
  Fix bug #70385 (Buffer over-read in exif_read_data with TIFF IFD tag byte value of 32 bytes)
  Fix bug #70219 (Use after free vulnerability in session deserializer)
  Fix bug ##70284 (Use after free vulnerability in unserialize() with GMP)
  Fix for bug #69782
  Add CVE IDs asigned (post release) to PHP 5.4.43
  Add CVE IDs asigned to #69085 (PHP 5.4.39)
  ...

Conflicts:
	ext/exif/exif.c
	ext/gmp/gmp.c
	ext/pcre/php_pcre.c
	ext/session/session.c
	ext/session/tests/session_decode_variation3.phpt
	ext/soap/soap.c
	ext/spl/spl_observer.c
	ext/standard/var.c
	ext/standard/var_unserializer.c
	ext/standard/var_unserializer.re
	ext/xsl/xsltprocessor.c
2015-09-02 00:37:20 -07:00
Stanislav Malyshev
a6c063d663 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  More fixes for bug #70219
2015-09-01 12:51:48 -07:00
Stanislav Malyshev
c19d59c550 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  update NEWS
  add NEWS for fixes
  Improve fix for #70172
  Fix bug #70312 - HAVAL gives wrong hashes in specific cases
  fix test
  add test
  Fix bug #70366 - use-after-free vulnerability in unserialize() with SplDoublyLinkedList
  Fix bug #70365 - use-after-free vulnerability in unserialize() with SplObjectStorage
  Fix bug #70172 - Use After Free Vulnerability in unserialize()
  Fix bug #70388 - SOAP serialize_function_call() type confusion
  Fixed bug #70350: ZipArchive::extractTo allows for directory traversal when creating directories
  Improve fix for #70385
  Fix bug #70345 (Multiple vulnerabilities related to PCRE functions)
  Fix bug #70385 (Buffer over-read in exif_read_data with TIFF IFD tag byte value of 32 bytes)
  Fix bug #70219 (Use after free vulnerability in session deserializer)
  Fix for bug #69782
  Add CVE IDs asigned (post release) to PHP 5.4.43
  Add CVE IDs asigned to #69085 (PHP 5.4.39)
  5.4.45 next

Conflicts:
	ext/pcre/php_pcre.c
	ext/standard/var_unserializer.c
	ext/standard/var_unserializer.re
	ext/zip/php_zip.c
2015-09-01 12:06:41 -07:00
Stanislav Malyshev
33d3acaae7 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Improve fix for #70172
  Fix bug #70312 - HAVAL gives wrong hashes in specific cases
  fix test
  add test
  Fix bug #70366 - use-after-free vulnerability in unserialize() with SplDoublyLinkedList
  Fix bug #70365 - use-after-free vulnerability in unserialize() with SplObjectStorage
  Fix bug #70172 - Use After Free Vulnerability in unserialize()
  Fix bug #70388 - SOAP serialize_function_call() type confusion
  Fixed bug #70350: ZipArchive::extractTo allows for directory traversal when creating directories
  Improve fix for #70385
  Fix bug #70345 (Multiple vulnerabilities related to PCRE functions)
  Fix bug #70385 (Buffer over-read in exif_read_data with TIFF IFD tag byte value of 32 bytes)
  Fix bug #70219 (Use after free vulnerability in session deserializer)
  Fix for bug #69782
  Add CVE IDs asigned (post release) to PHP 5.4.43
  Add CVE IDs asigned to #69085 (PHP 5.4.39)
  5.4.45 next

Conflicts:
	configure.in
	ext/pcre/php_pcre.c
	ext/standard/var_unserializer.c
	ext/standard/var_unserializer.re
	main/php_version.h
2015-09-01 11:42:19 -07:00
Stanislav Malyshev
6935058a98 Merge branch 'PHP-5.4.45' into PHP-5.5.29
* PHP-5.4.45:
  add test
  Fix bug #70366 - use-after-free vulnerability in unserialize() with SplDoublyLinkedList
  Fix bug #70365 - use-after-free vulnerability in unserialize() with SplObjectStorage
  Fix bug #70172 - Use After Free Vulnerability in unserialize()
  Fix bug #70388 - SOAP serialize_function_call() type confusion
  Fixed bug #70350: ZipArchive::extractTo allows for directory traversal when creating directories
  Improve fix for #70385
  Fix bug #70345 (Multiple vulnerabilities related to PCRE functions)
  Fix bug #70385 (Buffer over-read in exif_read_data with TIFF IFD tag byte value of 32 bytes)

Conflicts:
	ext/pcre/php_pcre.c
	ext/standard/var_unserializer.c
2015-09-01 00:28:39 -07:00
Stanislav Malyshev
03964892c0 Fix bug #70345 (Multiple vulnerabilities related to PCRE functions) 2015-08-28 22:52:50 -07:00
Anatol Belski
1553ce2093 add some range checks to pcre 2015-08-26 16:39:53 +02:00
Christoph M. Becker
1ec40e84d4 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix #70232: Incorrect bump-along behavior with \K and empty string match

Resolved conflicts:
	ext/pcre/php_pcre.c
2015-08-13 14:28:16 +02:00
Christoph M. Becker
b9f23c2152 Fix #70232: Incorrect bump-along behavior with \K and empty string match
To do global matching (/g), for every empty match we have to do a second match
with PCRE_NOTEMPTY turned on. That may fail, however, when the \K escape
sequence is involved. For this purpose libpcre 8.0 introduced the
PCRE_NOTEMPTY_ATSTART flag, which we will use if available, and otherwise fall
back to the old (possibly buggy) behavior.
2015-08-13 14:20:04 +02:00
Christoph M. Becker
5be8872f44 allow to skip slow tests 2015-07-26 17:33:09 +02:00
Christoph M. Becker
6855e2f08b Merge branch 'pull-request/1439'
* pull-request/1439:
  fixed broken test
  add new error constant PREG_JIT_STACKLIMIT_ERROR
2015-07-29 18:21:46 +02:00
Anatol Belski
0787cd60ed first stone on using the unified globals accessor 2015-07-29 10:36:30 +02:00
Christoph M. Becker
e6f55339cc add new error constant PREG_JIT_STACKLIMIT_ERROR 2015-07-26 23:40:38 +02:00
Christoph M. Becker
d73287be18 Merge branch 'PHP-5.6'
* PHP-5.6:
  allow to skip slow tests
2015-07-26 17:35:23 +02:00
Dmitry Stogov
4a2e40bb86 Use ZSTR_ API to access zend_string elements (this is just renaming without semantick changes). 2015-06-30 04:05:24 +03:00
Dmitry Stogov
4bd22cf1c1 Improved zend_string API (Francois Laupretre)
Squashed commit of the following:

commit d96eab8d79
Author: Francois Laupretre <francois@tekwire.net>
Date:   Fri Jun 26 01:23:31 2015 +0200

    Use the new 'ZSTR' macros in the rest of the code.

    Does not change anything to the generated code (thanks to compat macros) but cleaner.

commit b352643910
Author: Francois Laupretre <francois@tekwire.net>
Date:   Thu Jun 25 13:45:06 2015 +0200

    Improve zend_string API

    Add missing methods
2015-06-29 16:44:54 +03:00
Christoph M. Becker
ca049e0ae9 Merge branch 'PHP-5.6'
* PHP-5.6:
  updated NEWS
  Fixed Bug #53823 (preg_replace: * qualifier on unicode replace garbles the string)
2015-06-23 19:41:02 +02:00
Christoph M. Becker
e1561c490e Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  updated NEWS
  Fixed Bug #53823 (preg_replace: * qualifier on unicode replace garbles the string)
2015-06-23 19:32:57 +02:00
Christoph M. Becker
23e25f3319 Fixed Bug #53823 (preg_replace: * qualifier on unicode replace garbles the string)
When advancing after empty matches, php_pcre_match_impl() as well as
php_pcre_replace_impl() always have to advance to the next code point when the
u modifier is given, instead of to the next byte.
2015-06-23 19:28:09 +02:00
Christoph M. Becker
ec8731c46b Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed bug #69864 (Segfault in preg_replace_callback)
2015-06-23 16:50:52 +02:00
Christoph M. Becker
bc47f10a97 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  updated NEWS
  Fixed bug #69864 (Segfault in preg_replace_callback)
2015-06-23 16:36:35 +02:00
Christoph M. Becker
a39beaa251 Fixed bug #69864 (Segfault in preg_replace_callback)
When preg_replace_callback() is used, cache entries which are in use must not
be removed. We ensure that by deploying a simple refcounting mechanism.
2015-06-23 13:00:17 +02:00
Xinchen Hui
05c24d5dfa Fixed Bug #69883 (Compilation failed on PCRE) 2015-06-19 20:33:14 +08:00
Xinchen Hui
327e3b338c Micro optimizations for pcre 2015-06-19 09:56:42 +08:00
Lior Kaplan
7a02d138a6 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed bug #69689 (Align PCRE_MINOR with current version)
2015-06-18 17:36:46 +03:00
Lior Kaplan
3930e1f2fa Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed bug #69689 (Align PCRE_MINOR with current version)
2015-06-18 17:35:54 +03:00
Lior Kaplan
ca33ae3eb2 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fixed bug #69689 (Align PCRE_MINOR with current version)
2015-06-18 17:34:53 +03:00
Lior Kaplan
cc7194dd10 Fixed bug #69689 (Align PCRE_MINOR with current version) 2015-06-18 17:30:21 +03:00
Dmitry Stogov
8c8ad8f40e Use better hash functions (reuse key and avoid hash value recalculation) 2015-06-17 12:06:33 +03:00
Stanislav Malyshev
66153ba153 Merge branch 'PHP-5.6'
* PHP-5.6:
  Update PCRE version (bug #69689)
  move test
  NEWS 5.4
  fix new test
  Fixed Bug #69667 segfault in php_pgsql_meta_data
  5.4.42 next
2015-05-30 21:19:05 -07:00
Stanislav Malyshev
60c925fd41 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Update PCRE version (bug #69689)
  move test
  NEWS 5.4
  fix new test
  Fixed Bug #69667 segfault in php_pgsql_meta_data
  5.4.42 next
2015-05-30 21:18:50 -07:00
Stanislav Malyshev
930fb8b1f3 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Update PCRE version (bug #69689)
  move test
  NEWS 5.4
  fix new test
  Fixed Bug #69667 segfault in php_pgsql_meta_data
  5.4.42 next

Conflicts:
	configure.in
	main/php_version.h
2015-05-30 21:18:28 -07:00
Stanislav Malyshev
f38ca75a3c Update PCRE version (bug #69689) 2015-05-30 21:17:16 -07:00
Christoph M. Becker
5ca664abbf added test to clearly show distinction between unset (aka unmatched) subpattern and an empty match 2015-05-23 20:34:06 +02:00
Christoph M. Becker
303b3655e6 adjusted other tests to cater to changed behavior 2015-05-23 19:47:47 +02:00
Christoph M. Becker
6f33594978 changed preg_*() to yield NULL instead of '' for unset substrings 2015-05-23 19:44:42 +02:00
Christoph M. Becker
911366eb5f added failing tests for bug #61780 2015-05-23 19:28:14 +02:00
olshevskiy87
8bdec7a248 fix typos
Signed-off-by: olshevskiy87 <olshevskiy87@bk.ru>
2015-05-13 22:28:35 +04:00
Stanislav Malyshev
98fe9405e2 Merge branch 'PHP-5.6'
* PHP-5.6:
  Upgrade to PCRE 8.37 due to various bugfixes

Conflicts:
	ext/pcre/config.w32
	ext/pcre/config0.m4
	ext/pcre/pcrelib/pcre_jit_compile.c
	ext/pcre/pcrelib/sljit/sljitConfig.h
	ext/pcre/pcrelib/sljit/sljitConfigInternal.h
	ext/pcre/pcrelib/sljit/sljitLir.c
	ext/pcre/pcrelib/sljit/sljitLir.h
	ext/pcre/pcrelib/sljit/sljitNativeARM_32.c
	ext/pcre/pcrelib/sljit/sljitNativeARM_64.c
	ext/pcre/pcrelib/sljit/sljitNativeARM_T2_32.c
	ext/pcre/pcrelib/sljit/sljitNativeMIPS_common.c
	ext/pcre/pcrelib/sljit/sljitNativePPC_common.c
	ext/pcre/pcrelib/sljit/sljitNativeSPARC_common.c
	ext/pcre/pcrelib/sljit/sljitNativeTILEGX_64.c
	ext/pcre/pcrelib/sljit/sljitNativeX86_32.c
	ext/pcre/pcrelib/sljit/sljitNativeX86_64.c
	ext/pcre/pcrelib/sljit/sljitNativeX86_common.c
	ext/pcre/pcrelib/sljit/sljitUtils.c
2015-04-29 22:34:54 -07:00
Stanislav Malyshev
428d0983cd Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Upgrade to PCRE 8.37 due to various bugfixes
2015-04-29 22:28:04 -07:00
Stanislav Malyshev
ce6db558f9 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Upgrade to PCRE 8.37 due to various bugfixes
2015-04-29 22:27:21 -07:00
Stanislav Malyshev
95fa727992 Upgrade to PCRE 8.37 due to various bugfixes 2015-04-29 22:27:07 -07:00
Anatol Belski
7ccafe40c2 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fix VC9 build with PCRE
  Revert "Fix segfault in ext/date since 957aa2"
2015-04-28 14:38:45 +02:00
Anatol Belski
768bbedf82 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  fix VC9 build with PCRE
2015-04-28 14:38:21 +02:00
Anatol Belski
9c5c3ff022 fix VC9 build with PCRE 2015-04-28 13:15:39 +02:00
Stanislav Malyshev
c34aba472c Merge branch 'PHP-5.6'
* PHP-5.6:
  Upgrade PCRE to 8.36, it fixes some crashes

Conflicts:
	ext/pcre/pcrelib/config.h
	ext/pcre/pcrelib/pcre_ucd.c
2015-04-27 23:41:18 -07:00
Stanislav Malyshev
19ad1389aa Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Upgrade PCRE to 8.36, it fixes some crashes
2015-04-27 23:30:57 -07:00
Stanislav Malyshev
13c32a102c Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Upgrade PCRE to 8.36, it fixes some crashes
2015-04-27 23:25:32 -07:00
Stanislav Malyshev
23917b451b Upgrade PCRE to 8.36, it fixes some crashes
We probably will need to go to 8.37 once it is released.
2015-04-27 23:16:54 -07:00
Xinchen Hui
38d79e9449 Drop unused num index 2015-04-28 11:26:58 +08:00
Dmitry Stogov
770cb1da71 Keep realpath and PCRE caches in consistency with opcache SHM. 2015-04-22 02:29:06 +03:00
Dmitry Stogov
e44ccde39a "C" is the default locale 2015-04-16 21:44:50 +03:00
Lior Kaplan
3b8b1435ad Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix typo: unitialized -> uninitialized
  Fix typo: unitialized -> uninitialized

Conflicts:
	ext/xmlwriter/php_xmlwriter.c
2015-04-01 18:30:55 +03:00
Lior Kaplan
2fd74c7f03 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fix typo: unitialized -> uninitialized
2015-04-01 18:20:26 +03:00
Lior Kaplan
59c2a55ec7 Fix typo: unitialized -> uninitialized 2015-04-01 18:17:53 +03:00
Andrea Faulds
db76b708cf Deprecate PHP 4 constructors 2015-03-31 17:55:27 +02:00
Anatol Belski
19360f386e cleanup mod version macros, round 3 2015-03-23 20:54:55 +01:00
Xinchen Hui
784c60ab6d Improve test scripts 2015-03-21 21:11:14 +08:00
Xinchen Hui
a4529cc0e5 Fixed memleak 2015-03-21 20:17:04 +08:00
Xinchen Hui
4180226117 More error conditions 2015-03-21 16:54:45 +08:00
Xinchen Hui
2f6dbfc26b Improved impelmentation(and cleanup behaviro with errors conditions) 2015-03-21 15:56:42 +08:00
Xinchen Hui
c524dd6d1e Merge branch 'rfc-preg-replace-callback-array' of https://github.com/zxcvdavid/php-src
Conflicts:
	Zend/zend_vm_gen.php
	ext/pcre/php_pcre.c
2015-03-21 14:01:11 +08:00
Anatol Belski
a43a9c9137 use correct api 2015-03-20 17:11:36 +01:00
Dmitry Stogov
d146d15003 Optimize zend_string_realloc() add more specialized versions zend_string_extend() and zend_string_truncate() 2015-03-20 02:02:42 +03:00
Wei Dai
25566c67fe Implement preg_replace_callback_array function 2015-03-13 11:52:36 +08:00
Dmitry Stogov
8633685675 Use specialized macro for string zval creation 2015-03-12 16:53:51 +03:00
Reeze Xia
609f05fc19 ZTS cleanup 2015-03-08 19:25:55 +08:00
Anatol Belski
30830bcefd Fixed bug #69115 crash in mail
There were two issues

- php_pcre_replace could be used directly and sbject_str could be NULL
- the Windows sendmail variant was freeing something passed from the outside
2015-02-27 10:42:20 +01:00
Dmitry Stogov
4241a090ad Avoid reallocation in preg_replace() if nothing was replaced 2015-02-10 13:30:25 +03:00
Anatol Belski
be718e45b0 added PCRE JIT availability info to phpinfo()
and a test to ensure it's enabled
2015-02-07 11:04:53 +01:00
Dmitry Stogov
da5439b9c8 Re-enable PCRE JIT disabled by b436c714c6 2015-02-06 14:02:15 +03:00
Arjen Schol
b436c714c6 Upgrade pcre to 8.36 2015-02-04 14:08:41 +01:00
Nikita Popov
cb9c99ebd0 Remove preg_replace /e modifier 2015-01-26 21:00:23 +01:00
Xinchen Hui
020610ee40 Remove addslashes_str 2015-01-20 10:11:48 +08:00
Xinchen Hui
da7d8f45b2 Optimized php_addslashes 2015-01-19 10:46:39 -05:00
Xinchen Hui
fc33f52d8c bump year 2015-01-15 23:27:30 +08:00
Xinchen Hui
0579e8278d bump year 2015-01-15 23:26:37 +08:00
Xinchen Hui
73c1be2653 Bump year 2015-01-15 23:26:03 +08:00
Stanislav Malyshev
b7a7b1a624 trailing whitespace removal 2015-01-10 15:07:38 -08:00
Xinchen Hui
d7fd940691 Fixed #68704 2015-01-08 16:26:20 +08:00
Anatol Belski
3485925a3a Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed bug #66679 Alignment Bug in PCRE 8.34 upstream
  remove BOM from NEWS
2014-12-30 16:51:06 +01:00
Anatol Belski
d5123415f6 Fixed bug #66679 Alignment Bug in PCRE 8.34 upstream 2014-12-30 16:50:22 +01:00
Dmitry Stogov
7624fb6e8b Fixed possible crash (pcre cache must keep permanent strings) 2014-12-23 14:38:30 +03:00
Andrea Faulds
e5eb9530ab Use "float" and "integer" in typehint and zpp errors 2014-12-21 13:23:02 +00:00
Dmitry Stogov
4514ba016f Improved setlocale(). Eliminated locale comparison in ext/pcre if it's not necessary. 2014-12-19 18:00:16 +03:00
Dmitry Stogov
92655be7cf Enabled JIT for preg_split(). Use better zend_hash_*() functions. 2014-12-19 14:51:41 +03:00
Anatol Belski
2eef2abee5 Merge remote-tracking branch 'origin/master' into native-tls
* origin/master:
  Optimize argument passing handlers:
  Fix pcre non-FAST_ZPP build

Conflicts:
	Zend/zend_compile.c
	Zend/zend_execute.h
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
	ext/pcre/php_pcre.c
2014-12-16 17:13:47 +01:00
Andrea Faulds
ea7f768b2f Fix pcre non-FAST_ZPP build 2014-12-16 12:45:41 +00:00
Anatol Belski
bdeb220f48 first shot remove TSRMLS_* things 2014-12-13 23:06:14 +01:00
Anatol Belski
3ca0ca1548 Merge remote-tracking branch 'origin/master' into native-tls
* origin/master: (102 commits)
  fix dir separator in test
  fix TS build
  fix TS build
  Better fix for bug #68446
  Revert "Merge remote-tracking branch 'origin/PHP-5.6'"
  Revert NEWS and set test to XFAIL
  Revert "Fix bug #68446 (bug with constant defaults and type hints)"
  Improved zend_hash_clean() and added new optimized zend_symtable_clean()
  Use inline version of zval_ptr_dtor()
  Added new optimized zend_array_destroy() function
  Moved i_zval_ptr_dtor() from zend_execute.h to zend_variables.h
  fix REGISTER_NS_*_CONSTANT macros
  Removed useless assert. EG(uninitialized_zval) can't be refcounted.
  Use specialized destructors when types of zvals are known.
  move tests into proper place
  Improved assignment to object property
  Reuse zend_assign_to_variable() in zend_std_write_property()
  cleanup comments from svn/cvs era
  fix dir separator in test
  fork test for windows
  ...
2014-11-26 08:17:35 +01:00
Veres Lajos
06fdf359e3 typo fixes - https://github.com/vlajos/misspell_fixer 2014-11-23 14:52:47 -08:00
Veres Lajos
4dc994571d typo fixes - https://github.com/vlajos/misspell_fixer
Conflicts:
	ext/ftp/ftp.h
	ext/pcre/pcrelib/pcre_printint.c
	ext/pcre/pcrelib/sljit/sljitLir.c
	ext/pcre/pcrelib/sljit/sljitLir.h
	ext/pcre/pcrelib/sljit/sljitNativeARM_32.c
	ext/pcre/pcrelib/sljit/sljitNativeTILEGX_64.c
	ext/pgsql/pgsql.c
	ext/phar/func_interceptors.c
	ext/soap/soap.c
	ext/standard/image.c
2014-11-23 14:33:43 -08:00
Anatol Belski
c6bad96f30 Merge remote-tracking branch 'origin/master' into native-tls
* origin/master: (398 commits)
  NEWS
  add test for bug #68381
  Fixed bug #68381 Set FPM log level earlier during init
  proper dllexport
  move to size_t where zend_string is used internally
  fix some datatype mismatches
  return after the warning, to fix uninitialized salt usage
  fix datatype mismatches
  add missing type specifier
  fix datatype mismatches
  fix unsigned check
  "extern" shouldn't be used for definitions
  joined identical conditional blocks
  simplify fpm tests
  SEND_VAR_NO_REF optimization
  Add test for bug #68442
  Add various tests for FPM - covering recent bugs (68420, 68421, 68423, 68428) - for UDS - for ping and status URI - for multi pool and multi mode
  Include small MIT FastCGI client library from https://github.com/adoy/PHP-FastCGI-Client
  Get rid of zend_free_op structure (use zval* instead). Get rid of useless TSRMLS arguments.
  Add new FPM test for IPv4/IPv6
  ...

Conflicts:
	win32/build/config.w32
2014-11-18 21:18:52 +01:00
Stanislav Malyshev
bf59acdea7 Merge branch 'PHP-5.6'
* PHP-5.6:
  Initialize the offset table - PCRE may sometimes miss offsets
  set default response code to 200
  set default response code to 200
  set default response code to 200
  fix NEWS & version
  NEWS
  Fix bug #68283: fileinfo: out-of-bounds read in elf note headers
  Fix bug #68113 (Heap corruption in exif_thumbnail())
  Fix bug #68089 - do not accept options with embedded \0
  Fixed bug #68044: Integer overflow in unserialize() (32-bits only)
  Fix bug #68027 - fix date parsing in XMLRPC lib

Conflicts:
	ext/pcre/php_pcre.c
2014-11-03 11:40:15 -08:00
Stanislav Malyshev
90ba99a2c2 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Initialize the offset table - PCRE may sometimes miss offsets
  set default response code to 200
  set default response code to 200
  fix NEWS & version
  NEWS
  Fix bug #68283: fileinfo: out-of-bounds read in elf note headers
  Fix bug #68113 (Heap corruption in exif_thumbnail())
  Fix bug #68089 - do not accept options with embedded \0
  Fixed bug #68044: Integer overflow in unserialize() (32-bits only)
  Fix bug #68027 - fix date parsing in XMLRPC lib
2014-11-03 11:38:29 -08:00
Stanislav Malyshev
279550ee85 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Initialize the offset table - PCRE may sometimes miss offsets
  set default response code to 200
  fix NEWS & version
  NEWS
  Fix bug #68283: fileinfo: out-of-bounds read in elf note headers
  Fix bug #68113 (Heap corruption in exif_thumbnail())
  Fix bug #68089 - do not accept options with embedded \0
  Fixed bug #68044: Integer overflow in unserialize() (32-bits only)
  Fix bug #68027 - fix date parsing in XMLRPC lib

Conflicts:
	configure.in
	ext/curl/interface.c
	main/php_version.h
2014-11-03 11:37:43 -08:00
Stanislav Malyshev
c351b47ce8 Initialize the offset table - PCRE may sometimes miss offsets 2014-11-03 11:31:02 -08:00
Anatol Belski
9d21ff6b9e fix datatype mismatches
PCRE uses plain datatypes, no typedefs.
2014-10-29 15:30:11 +01:00
Anatol Belski
7a6a3d923b fix arg order, CFLAGS is the fifth arg in m4 2014-10-17 16:03:40 +02:00
Anatol Belski
0490a32249 more exts converted for static tsrm ls pointer
mbstring, pcre, reflection
2014-10-15 19:19:23 +02:00
Nikita Popov
e33f3d3b7c Move smart_str implementation into Zend/
So we can use it there as well...

For now I've retained the zend_smart_str_public.h header, though
it would probably be better to just move that one struct into
zend_types.h.
2014-09-21 20:49:39 +02:00
Johannes Schlüter
d0cb715373 s/PHP 5/PHP 7/ 2014-09-19 18:33:14 +02:00
Anatol Belski
d8de53d498 avoid unnecessary strlen calls in loop 2014-09-19 12:36:23 +02:00
Anatol Belski
3234480827 first show to make 's' work with size_t 2014-08-27 20:49:31 +02:00
Anatol Belski
6f9f0bf205 master renames phase 2 2014-08-25 19:28:33 +02:00
Anatol Belski
c3e3c98ec6 master renames phase 1 2014-08-25 19:24:55 +02:00
Anatol Belski
7ef536e4c9 Merge remote-tracking branch 'php/master'
Conflicts:
	Zend/zend_exceptions.c
2014-08-21 13:54:15 +02:00
krakjoe
1ba509ce19 use a suitable number of patterns to show the bug is resolved, not a stupid number that could cause memory limit to be exceeded or other side effects 2014-08-21 09:14:46 +01:00
Anatol Belski
77eb6e7278 Merge branch 'master' of git.php.net:php-src
# By Veres Lajos (2) and Lior Kaplan (1)
# Via Lior Kaplan
* 'master' of git.php.net:php-src:
  Correct typo in comments: 'initialized'
  typofixes
  typofixes
2014-08-17 21:40:39 +02:00
Anatol Belski
f2182ab845 some more pure naming replacements 2014-08-17 21:16:27 +02:00