Commit graph

910 commits

Author SHA1 Message Date
Nikita Popov
2fab3302ae Use ZEND_PARSE_PARAMETERS_NONE in pcre
Instead of the manual ZEND_PARSE_PARAMETERS_START(0, 0) form.
2019-01-02 11:18:35 +01:00
Nikita Popov
27e9c05e81 Remove preg_options param from pcre_get_compiled_regex()
This parameter is always zero and not necessary to call pcre2_match.

I'm leaving the parameter behind on the _ex() variant, so the preg_flags
are still accessible in some way.
2018-12-26 17:20:13 +01:00
Nikita Popov
fc30c0f7ad Merge branch 'PHP-7.3' 2018-12-26 17:13:21 +01:00
Nikita Popov
b1deb98c42 Fixed bug #77338
Set preg_options to 0 in php_pcre_get_compiled_regex(_ex). These
options are intended to be passed to pcre2_match. However, we do
not have any flags that actually need to be set during matching
(all relevant flags are set during compilation), and the preg_flags
value is used for PHP-specific flags instead.

This parameter should be removed entirely in master to avoid confusion.
2018-12-26 17:11:27 +01:00
Eli Schwartz
c1a22f3d4e Require pkg-config for external PCRE
Use standard PKG_CHECK_MODULES macro and remove the fallback case.
The option is renamed to --with-external-pcre and no longer accepts
an explicit path -- it should be specified through pkg-config instead.
2018-12-26 13:51:15 +01:00
Anatol Belski
31f28961a7 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fixed bug #77193 Infinite loop in preg_replace_callback
2018-12-01 10:28:56 +01:00
Anatol Belski
ef1269d5c1 Fixed bug #77193 Infinite loop in preg_replace_callback
Don't return preallocated match data more than once in nested calls.
2018-12-01 10:24:06 +01:00
Anatol Belski
c364edf7f2 Merge branch 'PHP-7.3'
* PHP-7.3:
  Implement handling for JIT recognition when cross compiling
2018-11-05 01:16:54 +01:00
Anatol Belski
68ad401b34 Implement handling for JIT recognition when cross compiling 2018-11-05 01:15:09 +01:00
Anatol Belski
d4761b64e7 Merge branch 'PHP-7.3'
* PHP-7.3:
  Change the way JIT availability is checked
2018-11-03 20:51:22 +01:00
Anatol Belski
aea411657e Change the way JIT availability is checked
The pcre2_jit_compile_8 sysmbol is always available, even JIT might be
not. If JIT is not enabled explicitly and is enabled in the PHP runtime,
this will lead to a malfunction. This approach ensures JIT is indeed
available on the given platform. For cross compilation this might get
complicated, as it would require an explicit processor architecture and
PCRE2 version check.

Another solution for this case is to run pcre2_config at runtime. That
however would require more condition checks that would impact
architectures where JIT is available.
2018-11-03 20:50:05 +01:00
Peter Kokot
d679f02295 Sync leading and final newlines in *.phpt sections
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines in all
*.phpt sections.

According to POSIX, a line is a sequence of zero or more non-' <newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.

C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."

Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
2018-10-15 04:33:09 +02:00
Peter Kokot
b746e69887 Sync leading and final newlines in *.phpt sections
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines in all
*.phpt sections.

According to POSIX, a line is a sequence of zero or more non-' <newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.

C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."

Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
2018-10-15 04:32:30 +02:00
Peter Kokot
d7a3edd45d Trim trailing whitespace in *.phpt 2018-10-14 19:46:15 +02:00
Peter Kokot
782352c54a Trim trailing whitespace in *.phpt 2018-10-14 19:45:12 +02:00
Gabriel Caruso
9c144e0d82
Trim trailing whitespace in tests 2018-10-14 12:07:20 -03:00
Peter Kokot
1ad08256f3 Sync leading and final newlines in source code files
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines.

According to POSIX, a line is a sequence of zero or more non-' <newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.

C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."

Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
2018-10-14 12:56:38 +02:00
Peter Kokot
1c850bfcca Sync leading and final newlines in source code files
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines.

According to POSIX, a line is a sequence of zero or more non-' <newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.

C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."

Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
2018-10-14 12:55:24 +02:00
Peter Kokot
be2ddc6b65 Convert CRLF line endings to LF
This patch simplifies line endings tracked in the Git repository and
syncs them to all include the LF style instead of the CRLF files.

Newline characters:
- LF (\n) (*nix and Mac)
- CRLF (\r\n) (Windows)
- CR (\r) (old Mac, obsolete)

To see which line endings are in the index and in the working copy the
following command can be used:
`git ls-files --eol`

Git additionally provides `.gitattributes` file to specify if some files
need to have specific line endings on all platforms (either CRLF or LF).

Changed files shouldn't cause issues on modern Windows platforms because
also Git can do output conversion is core.autocrlf=true is set on
Windows and use CRLF newlines in all files in the working tree.

Unless CRLF files are tracked specifically, Git by default tracks all
files in the index using LF newlines.
2018-10-13 11:23:52 +02:00
Peter Kokot
85290bbfcc Convert CRLF line endings to LF
This patch simplifies line endings tracked in the Git repository and
syncs them to all include the LF style instead of the CRLF files.

Newline characters:
- LF (\n) (*nix and Mac)
- CRLF (\r\n) (Windows)
- CR (\r) (old Mac, obsolete)

To see which line endings are in the index and in the working copy the
following command can be used:
`git ls-files --eol`

Git additionally provides `.gitattributes` file to specify if some files
need to have specific line endings on all platforms (either CRLF or LF).

Changed files shouldn't cause issues on modern Windows platforms because
also Git can do output conversion is core.autocrlf=true is set on
Windows and use CRLF newlines in all files in the working tree.

Unless CRLF files are tracked specifically, Git by default tracks all
files in the index using LF newlines.
2018-10-13 11:23:20 +02:00
Remi Collet
1ac97c77cb Merge branch 'PHP-7.3'
* PHP-7.3:
  Allow to disable pcre.jit when system library is used as it is for now broken on some arch (s390x...)
2018-10-04 11:46:37 +02:00
Remi Collet
bbfea4b470 Allow to disable pcre.jit when system library is used
as it is for now broken on some arch (s390x...)
2018-10-04 11:45:35 +02:00
Anatol Belski
5e1c3d62f9 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix test and add skip section
2018-09-22 02:11:06 +02:00
Anatol Belski
9f3aac9e39 Fix test and add skip section 2018-09-22 02:10:43 +02:00
Anatol Belski
4ec7463df6 Merge branch 'PHP-7.3'
* PHP-7.3:
  Add test for bug #76909
  Fixed bug #76909 preg_match difference between 7.3 and < 7.3
  Upgrade PCRE2 to 10.32
2018-09-21 15:58:50 +02:00
Anatol Belski
9c58ab37c7 Add test for bug #76909 2018-09-21 15:57:00 +02:00
Anatol Belski
7a02ecb7fe Fixed bug #76909 preg_match difference between 7.3 and < 7.3
Applied upstream patch, see https://bugs.exim.org/show_bug.cgi?id=2321
2018-09-21 15:55:03 +02:00
Anatol Belski
91b2b6c65d Upgrade PCRE2 to 10.32
(cherry picked from commit d918e0776b)
2018-09-21 15:54:14 +02:00
Anatol Belski
d918e0776b Upgrade PCRE2 to 10.32 2018-09-18 14:16:52 +02:00
Gabriel Caruso
f72b6c5e19
Use EXPECT instead of EXPECTF when possible 2018-09-16 15:39:18 -03:00
Anatol Belski
c126061e4c Merge branch 'PHP-7.3'
* PHP-7.3:
  Skip test on unsuitable env
2018-09-10 09:51:58 +02:00
Anatol Belski
27b270de89 Skip test on unsuitable env 2018-09-10 09:51:36 +02:00
Anatol Belski
d51af6462c Merge branch 'PHP-7.3'
* PHP-7.3:
  Make a copy unconditionally
2018-09-09 10:43:34 +02:00
Anatol Belski
68c34ce0dc Make a copy unconditionally 2018-09-09 10:42:53 +02:00
Anatol Belski
73ecad2f00 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix memory leak in pcre cache
2018-09-09 10:39:15 +02:00
Anatol Belski
9278be148e Fix memory leak in pcre cache 2018-09-09 10:38:36 +02:00
Anatol Belski
c92425dbab Merge branch 'PHP-7.3'
* PHP-7.3:
  Add test for bug #76850
2018-09-08 21:40:14 +02:00
Anatol Belski
4905d5e0df Add test for bug #76850 2018-09-08 21:39:54 +02:00
Anatol Belski
3de0ba7cbf Merge branch 'PHP-7.3'
* PHP-7.3:
  Fixed bug #76850 Exit code mangled by set locale/preg_match
2018-09-08 21:38:05 +02:00
Anatol Belski
c6ddd45650 Fixed bug #76850 Exit code mangled by set locale/preg_match 2018-09-08 21:35:23 +02:00
Peter Kokot
02294f0c84 Make PHP development tools files and scripts executable
This patch makes several scripts and PHP development tools files
executable and adds more proper shebangs to the PHP scripts.

The `#!/usr/bin/env php` shebang provides running the script via
`./script.php` and uses env to find PHP script location on the system.
At the same time it still provides running the script with a user
defined PHP location using `php script.php`.
2018-08-29 20:58:17 +02:00
Gabriel Caruso
2f7003847d
Make more tests run on Linux 2018-08-28 21:20:00 -03:00
Gabriel Caruso
1461f8ef0d
Remove superfluous SKIPIF sections of always available functions 2018-07-29 15:42:19 -03:00
Peter Kokot
cf3b852109 Trim trailing whitespaces in build files
Some editors utilizing .editorconfig automatically trim whitespaces. For
convenience this patch removes whitespaces in certain build files:
- ext/*/config*.m4
- configure.ac
- acinclude.m4
2018-07-29 03:43:45 +02:00
Gabriel Caruso
9e4d590b19
Remove extra semicolons 2018-07-25 21:47:04 -03:00
Peter Kokot
a5e80b22e1 Fix typos in code comments 2018-07-25 11:57:11 +02:00
Peter Kokot
8d3f8ca12a Remove unused Git attributes ident
The $Id$ keywords were used in Subversion where they can be substituted
with filename, last revision number change, last changed date, and last
user who changed it.

In Git this functionality is different and can be done with Git attribute
ident. These need to be defined manually for each file in the
.gitattributes file and are afterwards replaced with 40-character
hexadecimal blob object name which is based only on the particular file
contents.

This patch simplifies handling of $Id$ keywords by removing them since
they are not used anymore.
2018-07-25 00:53:25 +02:00
Dmitry Stogov
5be44312f8 Removed redundand code 2018-07-19 15:47:15 +03:00
Dmitry Stogov
54ebebd686 Matching loops optimization 2018-07-19 15:28:31 +03:00
Dmitry Stogov
b81d712961 Micro optimizations 2018-07-19 11:19:28 +03:00