1 diff -urNp -x '*.orig' php-7.0.33.org/ext/pcre/config0.m4 php-7.0.33/ext/pcre/config0.m4
2 --- php-7.0.33.org/ext/pcre/config0.m4 2018-12-04 18:22:58.000000000 +0100
3 +++ php-7.0.33/ext/pcre/config0.m4 2021-08-23 23:36:40.675466313 +0200
4 @@ -11,7 +11,7 @@ PHP_ARG_WITH(pcre-regex,,
6 if test "$PHP_PCRE_REGEX" != "yes" && test "$PHP_PCRE_REGEX" != "no"; then
7 AC_MSG_CHECKING([for PCRE headers location])
8 - for i in $PHP_PCRE_REGEX $PHP_PCRE_REGEX/include $PHP_PCRE_REGEX/include/pcre $PHP_PCRE_REGEX/local/include; do
9 + for i in $PHP_PCRE_REGEX $PHP_PCRE_REGEX/include $PHP_PCRE_REGEX/include/pcre $PHP_PCRE_REGEX/local/include /usr/include; do
10 test -f $i/pcre.h && PCRE_INCDIR=$i
13 @@ -21,7 +21,7 @@ PHP_ARG_WITH(pcre-regex,,
14 AC_MSG_RESULT([$PCRE_INCDIR])
16 AC_MSG_CHECKING([for PCRE library location])
17 - for j in $PHP_PCRE_REGEX $PHP_PCRE_REGEX/$PHP_LIBDIR; do
18 + for j in $PHP_PCRE_REGEX $PHP_PCRE_REGEX/$PHP_LIBDIR /usr/$PHP_LIBDIR; do
19 test -f $j/libpcre.a || test -f $j/libpcre.$SHLIB_SUFFIX_NAME && PCRE_LIBDIR=$j
22 @@ -43,12 +43,13 @@ PHP_ARG_WITH(pcre-regex,,
23 AC_MSG_ERROR([The PCRE extension requires PCRE library version >= 6.6])
26 - PHP_ADD_LIBRARY_WITH_PATH(pcre, $PCRE_LIBDIR)
27 + PHP_ADD_LIBRARY_WITH_PATH(pcre, $PCRE_LIBDIR, PCRE_SHARED_LIBADD)
29 AC_DEFINE(HAVE_PCRE, 1, [ ])
30 PHP_ADD_INCLUDE($PCRE_INCDIR)
31 - PHP_NEW_EXTENSION(pcre, php_pcre.c, no,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
32 + PHP_NEW_EXTENSION(pcre, php_pcre.c, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
33 PHP_INSTALL_HEADERS([ext/pcre], [php_pcre.h])
34 + EXTRA_LIBS="$EXTRA_LIBS -lpcre"
36 AC_MSG_CHECKING([for PCRE library to use])
37 AC_MSG_RESULT([bundled])
38 @@ -61,7 +62,7 @@ PHP_ARG_WITH(pcre-regex,,
39 pcrelib/pcre_version.c pcrelib/pcre_xclass.c \
40 pcrelib/pcre_jit_compile.c"
41 PHP_PCRE_CFLAGS="-DHAVE_CONFIG_H -I@ext_srcdir@/pcrelib -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"
42 - PHP_NEW_EXTENSION(pcre, $pcrelib_sources php_pcre.c, no,,$PHP_PCRE_CFLAGS)
43 + PHP_NEW_EXTENSION(pcre, $pcrelib_sources php_pcre.c, $ext_shared,,$PHP_PCRE_CFLAGS)
44 PHP_ADD_BUILD_DIR($ext_builddir/pcrelib)
45 PHP_INSTALL_HEADERS([ext/pcre], [php_pcre.h pcrelib/])
46 AC_DEFINE(HAVE_BUNDLED_PCRE, 1, [ ])
47 diff -urNp -x '*.orig' php-7.0.33.org/ext/pcre/php_pcre.c php-7.0.33/ext/pcre/php_pcre.c
48 --- php-7.0.33.org/ext/pcre/php_pcre.c 2018-12-04 18:22:58.000000000 +0100
49 +++ php-7.0.33/ext/pcre/php_pcre.c 2021-08-23 23:36:40.675466313 +0200
52 #if HAVE_PCRE || HAVE_BUNDLED_PCRE
55 +#undef pcre_get_compiled_regex
56 +PHPAPI pcre* pcre_get_compiled_regex(zend_string *regex, pcre_extra **extra, int *options);
59 #include "ext/standard/php_string.h"
61 #define PREG_PATTERN_ORDER 1
62 @@ -202,6 +207,10 @@ static PHP_MINIT_FUNCTION(pcre)
63 REGISTER_LONG_CONSTANT("PREG_JIT_STACKLIMIT_ERROR", PHP_PCRE_JIT_STACKLIMIT_ERROR, CONST_CS | CONST_PERSISTENT);
64 REGISTER_STRING_CONSTANT("PCRE_VERSION", (char *)pcre_version(), CONST_CS | CONST_PERSISTENT);
67 + pcre_get_compiled_regex_p = pcre_get_compiled_regex;
73 @@ -610,6 +619,7 @@ PHPAPI pcre_cache_entry* pcre_get_compil
78 /* {{{ pcre_get_compiled_regex
80 PHPAPI pcre* pcre_get_compiled_regex(zend_string *regex, pcre_extra **extra, int *preg_options)
81 diff -urNp -x '*.orig' php-7.0.33.org/ext/pcre/php_pcre.h php-7.0.33/ext/pcre/php_pcre.h
82 --- php-7.0.33.org/ext/pcre/php_pcre.h 2018-12-04 18:22:58.000000000 +0100
83 +++ php-7.0.33/ext/pcre/php_pcre.h 2021-08-23 23:36:40.675466313 +0200
87 PHPAPI zend_string *php_pcre_replace(zend_string *regex, zend_string *subject_str, char *subject, int subject_len, zval *replace_val, int is_callable_replace, int limit, int *replace_count);
89 +#define pcre_get_compiled_regex pcre_get_compiled_regex_p
90 +extern PHPAPI pcre* (*pcre_get_compiled_regex)(zend_string *regex, pcre_extra **extra, int *options);
92 PHPAPI pcre* pcre_get_compiled_regex(zend_string *regex, pcre_extra **extra, int *options);
94 PHPAPI pcre* pcre_get_compiled_regex_ex(zend_string *regex, pcre_extra **extra, int *preg_options, int *coptions);
96 extern zend_module_entry pcre_module_entry;
97 diff -urNp -x '*.orig' php-7.0.33.org/ext/standard/browscap.c php-7.0.33/ext/standard/browscap.c
98 --- php-7.0.33.org/ext/standard/browscap.c 2018-12-04 18:22:44.000000000 +0100
99 +++ php-7.0.33/ext/standard/browscap.c 2021-08-23 23:36:40.675466313 +0200
100 @@ -65,6 +65,11 @@ ZEND_END_MODULE_GLOBALS(browscap)
101 ZEND_DECLARE_MODULE_GLOBALS(browscap)
102 #define BROWSCAP_G(v) ZEND_MODULE_GLOBALS_ACCESSOR(browscap, v)
105 +// will be visible in here
106 +PHPAPI pcre* (*pcre_get_compiled_regex_p)(zend_string *regex, pcre_extra **extra, int *options);
109 #define DEFAULT_SECTION_NAME "Default Browser Capability Settings"
111 /* OBJECTS_FIXME: This whole extension needs going through. The use of objects looks pretty broken here */
112 diff -urNp -x '*.orig' php-7.0.33.org/main/php_ini.c php-7.0.33/main/php_ini.c
113 --- php-7.0.33.org/main/php_ini.c 2021-08-23 23:36:39.715453953 +0200
114 +++ php-7.0.33/main/php_ini.c 2021-08-23 23:36:40.675466313 +0200
115 @@ -771,8 +771,8 @@ int php_shutdown_config(void)
117 void php_ini_register_extensions(void)
119 - zend_llist_apply(&extension_lists.engine, php_load_zend_extension_cb);
120 zend_llist_apply(&extension_lists.functions, php_load_php_extension_cb);
121 + zend_llist_apply(&extension_lists.engine, php_load_zend_extension_cb);
123 zend_llist_destroy(&extension_lists.engine);
124 zend_llist_destroy(&extension_lists.functions);
125 diff -urNp -x '*.orig' php-7.0.33.org/sapi/cli/tests/018.phpt php-7.0.33/sapi/cli/tests/018.phpt
126 --- php-7.0.33.org/sapi/cli/tests/018.phpt 2018-12-04 18:23:02.000000000 +0100
127 +++ php-7.0.33/sapi/cli/tests/018.phpt 2021-08-23 23:36:40.675466313 +0200
128 @@ -20,8 +20,6 @@ echo "Done\n";