Commit Graph

837 Commits

Author SHA1 Message Date
Gabriel Caruso
ce1d69a1f6 Use int instead of integer in type errors
PHP requires integer typehints to be written "int" and does not
allow "integer" as an alias. This changes type error messages to
match the actual type name and avoids confusing messages like
"must be of the type integer, integer given".
2018-02-04 19:08:23 +01:00
Gabriel Caruso
53dbc69a8d Use %d when expecting line number in tests 2018-02-02 22:35:13 +01:00
Gabriel Caruso
2238403892 Trailing whitespaces on ext/*
Signed-off-by: Gabriel Caruso <carusogabriel34@gmail.com>
2018-01-04 02:38:32 -02:00
Gabriel Caruso
6400264856 Trailing whitespaces
Signed-off-by: Gabriel Caruso <carusogabriel34@gmail.com>
2018-01-03 14:38:00 +01:00
Xinchen Hui
a6519d0514 year++ 2018-01-02 12:57:58 +08:00
Dmitry Stogov
856ad54f45 Use zend_hash_find() instead of zend_hash_find_ptr() to avoid double check 2017-12-27 13:25:21 +03:00
Michael Moravec
84235344f9 Fixed bug #75355: preg_quote() does not quote # control character 2017-12-16 17:34:41 +01:00
Anatol Belski
9c8ffbf1af Merge branch 'PHP-7.2'
* PHP-7.2:
  Fix use after free revealed by phpdbg
2017-12-05 18:35:16 +01:00
Anatol Belski
d4af204637 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix use after free revealed by phpdbg
2017-12-05 18:34:39 +01:00
Anatol Belski
092fd44474 Fix use after free revealed by phpdbg 2017-12-05 18:32:32 +01:00
Anatol Belski
9cca85ff07 Fixed bug #75601 Thread race in PCRE JIT support 2017-12-05 17:41:08 +01:00
Anatol Belski
75a2ee7f7b Fixed bug #75601 Thread race in PCRE JIT support 2017-12-05 17:40:00 +01:00
Anatol Belski
31b2b14a71 Fixed bug #75601 Thread race in PCRE JIT support 2017-12-05 17:38:18 +01:00
Anatol Belski
6db15b7dba Fix test 2017-11-21 21:44:09 +01:00
Anatol Belski
c029bd3342 Fix macro name 2017-11-21 20:27:17 +01:00
Anatol Belski
54e7b0a6f7 Merge branch 'PHP-7.2'
* PHP-7.2:
  Fixed #75539 and #74183 - preg_last_error not returning error code after error
2017-11-21 20:15:30 +01:00
Anatol Belski
f6b0d365a7 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed #75539 and #74183 - preg_last_error not returning error code after error
2017-11-21 20:11:21 +01:00
Anatol Belski
f5c0754f6e Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed #75539 and #74183 - preg_last_error not returning error code after error
2017-11-21 20:10:49 +01:00
Nester
8fdef981ef Fixed #75539 and #74183 - preg_last_error not returning error code after error 2017-11-21 20:10:18 +01:00
David Carlier
d006270040 seemingly a tiny typo error in pcre module. 2017-11-21 12:28:15 +01:00
Nikita Popov
26f8fc833b Enable and fix printf() format warnings
Add _unchecked() variants of zend_spprintf and zend_strpprintf for
cases where we specifically want to disable these checks, such as
use of %H.
2017-11-16 21:15:36 +01:00
Dmitry Stogov
73bde7bbd0 Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src:
  Fix (*NO_JIT) usage when JIT is enabled
  Refactor ASCII to wide conversion
2017-11-16 17:10:04 +03:00
Dmitry Stogov
ccc12b82da Avoid unnecessary reference-counting on strings. 2017-11-16 17:09:32 +03:00
Anatol Belski
a370a6af64 Fix (*NO_JIT) usage when JIT is enabled
If (*NO_JIT) is put into the pattern, the JIT compilation will still
succeed but produce no code. The pattern will still have to be
interpreted and is not suitable for the JIT fast path. This means,
we still need to check the pattern info after JIT compilation and only
set the flags when the JIT code was produced.
2017-11-16 14:12:05 +01:00
Anatol Belski
ce85d0f24f Add missing ifdef 2017-11-15 20:21:40 +01:00
Anatol Belski
691a5a9c4c Initialize jit global 2017-11-14 21:47:56 +01:00
Anatol Belski
91407fb82d Fix wrong return 2017-11-14 21:44:46 +01:00
Anatol Belski
13696d7aae Use already available pattern length, fix signedness warnings 2017-11-14 16:36:33 +01:00
Anatol Belski
19c56e42c5 Add skipif as this test became only valid with JIT compiled in
Without JIT, the depth limit is respected, but for JIT it's irrelevant.
2017-11-14 15:53:06 +01:00
Anatol Belski
a385993c0c Merge branch 'PHP-7.2'
* PHP-7.2:
  Fix UTF check in pcre_grep
2017-11-14 13:56:25 +01:00
Anatol Belski
0d13323915 Fix UTF check in pcre_grep
In this case it loops through different subjects without looking for sub
matches and matches are done against the same pattern. Thus, don't reset
the UTF check flag but use it to check whether JIT should be used and
otherwise let PCRE to do the job according to what was saved into the
pattern.
2017-11-14 13:49:06 +01:00
Anatol Belski
0618d7d2ee Merge branch 'PHP-7.2'
* PHP-7.2:
  Fix uninitialized flag when JIT is disabled
2017-11-14 10:14:09 +01:00
Anatol Belski
3c241ea326 Fix uninitialized flag when JIT is disabled 2017-11-14 10:12:55 +01:00
Anatol Belski
5a6c49474e Remove unused file 2017-11-14 09:14:17 +01:00
Xinchen Hui
266f19babb Added PCRE_JIT_SUPPORT flag 2017-11-14 11:02:16 +08:00
Anatol Belski
e8ac7d8dd5 Fix calculation as sync with 48cee6d1 2017-11-14 00:01:52 +01:00
Dmitry Stogov
81dd6de3a9 Eliminated redundand code 2017-11-14 01:43:54 +03:00
Dmitry Stogov
48cee6d1e9 We don't need to calculate size of offset array, because pcre2_match_data_create() already takes size in pairs. 2017-11-14 00:49:03 +03:00
Anatol Belski
f4edd0899f Put hardcoded value into macro 2017-11-13 21:33:13 +01:00
Anatol Belski
a5bc5aed71 Patch core for PCRE2 support
RFC https://wiki.php.net/rfc/pcre2-migration
2017-11-13 19:37:38 +01:00
Dmitry Stogov
f5664a1492 PCRE cache is "thread-local" 2017-11-01 15:13:49 +03:00
Xinchen Hui
a8a17a72b0 RC manipulation cleanup 2017-11-01 10:25:10 +08:00
Dmitry Stogov
160f6d6267 single check is enough 2017-10-31 11:07:42 +03:00
Dmitry Stogov
2e83924682 Added zend_hash_add_new_mem/zend_hash_str_add_new_mem. Use them to add new elements into PCRE cache (we checked the existance before). 2017-10-31 10:43:10 +03:00
Remi Collet
7c8357929c Fixed bug #75285i Broken build when system libpcre don't have jit support
Detect JIT support in system library,
So --with-pcre-jit is only for bundled library.
2017-09-29 15:47:50 +02:00
Anatol Belski
c3a1cc382a Revert --with-pcre-valgrind by default in debug build
After quite a few people reported this option enabled to be in many cases
not handy by default, it's reverted to no by default everywhere. If enabled,
it requires Valgrind dev packages, where just a few have Valgrind itself
installed or care. Still for PCRE related work this option is a must,
though will have to be turned on by hand.

Revert "fix default args for --with-pcre-valgrind"

This reverts commit 24de0fe9f4.

Revert "Enable valgrind support for PCRE by default in debug builds"

This reverts commit 850bb998d9.
2017-09-29 12:17:38 +02:00
Anatol Belski
4f1ea03528 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Apply upstream patch for CVE-2016-1283
2017-09-28 15:45:09 +02:00
Anatol Belski
db9778dfb2 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Apply upstream patch for CVE-2016-1283
2017-09-28 15:44:40 +02:00
Anatol Belski
d11fceab15 Apply upstream patch for CVE-2016-1283
Fix bug #75207, see also
https://bugzilla.redhat.com/show_bug.cgi?id=1295385
https://vcs.pcre.org/pcre?view=revision&revision=1636
2017-09-28 15:40:49 +02:00
Dmitry Stogov
ef90e37bd1 Fixed bug #75089 (preg_grep() is not reporting PREG_BAD_UTF8_ERROR after first input string) 2017-08-18 14:56:28 +03:00