1 diff -urN php-7.3.12.orig/ext/pcre/config0.m4 php-7.3.12/ext/pcre/config0.m4
2 --- php-7.3.12.orig/ext/pcre/config0.m4 2019-12-12 21:43:24.775000000 +0100
3 +++ php-7.3.12/ext/pcre/config0.m4 2019-12-12 21:43:36.336000000 +0100
8 - PHP_NEW_EXTENSION(pcre, php_pcre.c, no,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
9 + PHP_NEW_EXTENSION(pcre, php_pcre.c, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
10 PHP_INSTALL_HEADERS([ext/pcre], [php_pcre.h])
11 + EXTRA_LIBS="$EXTRA_LIBS -lpcre2-8"
13 AC_MSG_CHECKING([for PCRE library to use])
14 AC_MSG_RESULT([bundled])
15 diff -urN php-7.3.12.orig/ext/pcre/php_pcre.c php-7.3.12/ext/pcre/php_pcre.c
16 --- php-7.3.12.orig/ext/pcre/php_pcre.c 2019-12-12 21:43:24.775000000 +0100
17 +++ php-7.3.12/ext/pcre/php_pcre.c 2019-12-12 21:43:36.339000000 +0100
21 #include "php_globals.h"
23 +#define COMPILE_DL_PCRE_NOREDIRECT
26 #include "ext/standard/info.h"
27 #include "ext/standard/basic_functions.h"
29 pcre2_set_match_limit(mctx, (uint32_t)PCRE_G(backtrack_limit));
33 + pcre_get_compiled_regex_p = pcre_get_compiled_regex;
34 + pcre_get_compiled_regex_cache_p = pcre_get_compiled_regex_cache;
35 + php_pcre_replace_impl_p = php_pcre_replace_impl;
36 + php_pcre_match_impl_p = php_pcre_match_impl;
37 + php_pcre_split_impl_p = php_pcre_split_impl;
38 + php_pcre_create_match_data_p = php_pcre_create_match_data;
39 + php_pcre_free_match_data_p = php_pcre_free_match_data;
40 + php_pcre_mctx_p = php_pcre_mctx;
46 diff -urN php-7.3.12.orig/ext/pcre/php_pcre.h php-7.3.12/ext/pcre/php_pcre.h
47 --- php-7.3.12.orig/ext/pcre/php_pcre.h 2019-12-12 21:43:24.777000000 +0100
48 +++ php-7.3.12/ext/pcre/php_pcre.h 2019-12-12 21:45:10.506000000 +0100
53 +#if !defined(COMPILE_DL_PCRE_NOREDIRECT)
54 +#define pcre_get_compiled_regex (*pcre_get_compiled_regex_p)
55 +#define pcre_get_compiled_regex_cache (*pcre_get_compiled_regex_cache_p)
56 +#define php_pcre_replace_impl (*php_pcre_replace_impl_p)
57 +#define php_pcre_match_impl (*php_pcre_match_impl_p)
58 +#define php_pcre_split_impl (*php_pcre_split_impl_p)
59 +#define php_pcre_create_match_data (*php_pcre_create_match_data_p)
60 +#define php_pcre_free_match_data (*php_pcre_free_match_data_p)
61 +#define php_pcre_mctx (*php_pcre_mctx_p)
62 +#if !defined(COMPILE_DL_PCRE_NOEXTERN)
63 +# define PCRE_EXTERN extern
70 +extern void *pcre_get_compiled_regex_p;
71 +extern void *pcre_get_compiled_regex_cache_p;
72 +extern void *php_pcre_replace_impl_p;
73 +extern void *php_pcre_match_impl_p;
74 +extern void *php_pcre_split_impl_p;
75 +extern void *php_pcre_create_match_data_p;
76 +extern void *php_pcre_free_match_data_p;
77 +extern void *php_pcre_mctx_p;
80 PHPAPI zend_string *php_pcre_replace(zend_string *regex, zend_string *subject_str, char *subject, size_t subject_len, zend_string *replace_str, size_t limit, size_t *replace_count);
82 PHPAPI pcre2_code* pcre_get_compiled_regex(zend_string *regex, uint32_t *capture_count, uint32_t *options);
83 PHPAPI pcre2_code* pcre_get_compiled_regex_ex(zend_string *regex, uint32_t *capture_count, uint32_t *preg_options, uint32_t *coptions);
87 typedef struct _pcre_cache_entry pcre_cache_entry;
90 PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex);
91 PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache_ex(zend_string *regex, int locale_aware);
94 PHPAPI void php_pcre_match_impl( pcre_cache_entry *pce, char *subject, size_t subject_len, zval *return_value,
95 zval *subpats, int global, int use_flags, zend_long flags, zend_off_t start_offset);
98 PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, zend_string *subject_str, char *subject, size_t subject_len, zend_string *replace_str,
99 size_t limit, size_t *replace_count);
102 PHPAPI void php_pcre_split_impl( pcre_cache_entry *pce, zend_string *subject_str, zval *return_value,
103 zend_long limit_val, zend_long flags);
105 PHPAPI void php_pcre_grep_impl( pcre_cache_entry *pce, zval *input, zval *return_value,
109 PHPAPI pcre2_match_context *php_pcre_mctx(void);
110 PHPAPI pcre2_general_context *php_pcre_gctx(void);
111 PHPAPI pcre2_compile_context *php_pcre_cctx(void);
113 PHPAPI void php_pcre_pce_decref(pcre_cache_entry *);
114 PHPAPI pcre2_code *php_pcre_pce_re(pcre_cache_entry *);
115 /* capture_count can be ignored, re is required. */
117 PHPAPI pcre2_match_data *php_pcre_create_match_data(uint32_t, pcre2_code *);
119 PHPAPI void php_pcre_free_match_data(pcre2_match_data *);
121 ZEND_BEGIN_MODULE_GLOBALS(pcre)
122 diff -urN php-7.3.12.orig/ext/phar/Makefile.frag php-7.3.12/ext/phar/Makefile.frag
123 --- php-7.3.12.orig/ext/phar/Makefile.frag 2019-12-12 21:43:24.654000000 +0100
124 +++ php-7.3.12/ext/phar/Makefile.frag 2019-12-12 21:43:36.358000000 +0100
126 $(top_srcdir)/build/shtool echo -n -- "$(top_builddir)/$(SAPI_CLI_PATH) -n"; \
127 if test "x$(PHP_MODULES)" != "x"; then \
128 $(top_srcdir)/build/shtool echo -n -- " -d extension_dir=$(top_builddir)/modules"; \
129 - for i in spl bz2 zlib phar; do \
130 + for i in pcre spl bz2 zlib phar; do \
131 if test -f "$(top_builddir)/modules/$$i.la"; then \
132 . $(top_builddir)/modules/$$i.la; $(top_srcdir)/build/shtool echo -n -- " -d extension=$$dlname"; \
134 diff -urN php-7.3.12.orig/ext/standard/basic_functions.c php-7.3.12/ext/standard/basic_functions.c
135 --- php-7.3.12.orig/ext/standard/basic_functions.c 2019-12-12 21:43:24.765000000 +0100
136 +++ php-7.3.12/ext/standard/basic_functions.c 2019-12-12 21:43:36.361000000 +0100
138 PHPAPI php_basic_globals basic_globals;
142 +// Declare the pointers in core library
143 +void *pcre_get_compiled_regex_p;
144 +void *pcre_get_compiled_regex_cache_p;
145 +void *php_pcre_replace_impl_p;
146 +void *php_pcre_match_impl_p;
147 +void *php_pcre_split_impl_p;
148 +void *php_pcre_create_match_data_p;
149 +void *php_pcre_free_match_data_p;
150 +void *php_pcre_mctx_p;
153 #include "php_fopen_wrappers.h"
154 #include "streamsfuncs.h"
156 diff -urN php-7.3.12.orig/main/php_ini.c php-7.3.12/main/php_ini.c
157 --- php-7.3.12.orig/main/php_ini.c 2019-12-12 21:43:24.549000000 +0100
158 +++ php-7.3.12/main/php_ini.c 2019-12-12 21:43:36.364000000 +0100
161 void php_ini_register_extensions(void)
163 - zend_llist_apply(&extension_lists.engine, php_load_zend_extension_cb);
164 zend_llist_apply(&extension_lists.functions, php_load_php_extension_cb);
165 + zend_llist_apply(&extension_lists.engine, php_load_zend_extension_cb);
167 zend_llist_destroy(&extension_lists.engine);
168 zend_llist_destroy(&extension_lists.functions);
169 diff -urN php-7.3.12.orig/sapi/cli/tests/018.phpt php-7.3.12/sapi/cli/tests/018.phpt
170 --- php-7.3.12.orig/sapi/cli/tests/018.phpt 2019-12-12 21:43:24.534000000 +0100
171 +++ php-7.3.12/sapi/cli/tests/018.phpt 2019-12-12 21:43:36.364000000 +0100