Compare commits

...

18 Commits
rawhide ... f30

Author SHA1 Message Date
Remi Collet 93d34767a7 Update to 7.3.18 - http://www.php.net/releases/7_3_18.php
(cherry picked from commit 120f6e22fe)
2020-05-12 12:06:02 +02:00
Remi Collet 264113cbca Update to 7.3.17 - http://www.php.net/releases/7_3_17.php
(cherry picked from commit 24be58c742)
2020-04-14 11:05:29 +02:00
Remi Collet eae6c13fd7 Update to 7.3.16 - http://www.php.net/releases/7_3_16.php
(cherry picked from commit bcf29cd348)
2020-03-17 11:57:20 +01:00
Remi Collet d27d55298e v7.3.15
(cherry picked from commit 459562e93b)
2020-02-18 11:25:02 +01:00
Remi Collet e5b268fdee Update to 7.3.14 - http://www.php.net/releases/7_3_14.php
(cherry picked from commit 0be8ef1145)
2020-01-21 12:14:25 +01:00
Remi Collet 5f2a586b5f Update to 7.3.13 - http://www.php.net/releases/7_3_13.php
(cherry picked from commit 53fb0fd96b)
2019-12-17 14:18:59 +01:00
Remi Collet ba7c19ab57 Update to 7.3.12 - http://www.php.net/releases/7_3_12.php
(cherry picked from commit 0f7b1a923f)
2019-11-19 11:58:09 +01:00
Remi Collet 19a5312693 Update to 7.3.11 - http://www.php.net/releases/7_3_11.php
(cherry picked from commit a41f37db89)
2019-10-22 11:36:02 +02:00
Remi Collet 0c2dfa34fb Merge branch 'master' into f31
(cherry picked from commit 38bf35ed49)
2019-09-24 12:15:13 +02:00
Remi Collet 0ad213687e Update to 7.3.9 - http://www.php.net/releases/7_3_9.php 2019-08-28 09:47:26 +02:00
Remi Collet 751f8de6a8 Update to 7.3.8 - http://www.php.net/releases/7_3_8.php 2019-07-30 13:43:59 +02:00
Remi Collet 70abab340c bump release for new sources
(cherry picked from commit 98b4f820c1)
2019-07-03 14:01:54 +02:00
Remi Collet 3262e71c64 Update to 7.3.7 - http://www.php.net/releases/7_3_7.php 2019-07-02 14:23:33 +02:00
Remi Collet ce208eb997 Update to 7.3.6 - http://www.php.net/releases/7_3_6.php
(cherry picked from commit 307c0bffbb)
2019-05-28 12:44:12 +02:00
Remi Collet f7f1ea63d7 fix devel dep for consistency
(cherry picked from commit 26e3f78111)
2019-05-14 07:12:49 +02:00
Remi Collet d6a669687f cleanup old patch
(cherry picked from commit 3a9de485e5)
2019-05-14 07:06:20 +02:00
Carl George 74a5b4802d Fix library typo 2019-05-07 12:21:33 +02:00
Remi Collet b8a545aeab Update to 7.3.5 - http://www.php.net/releases/7_3_5.php 2019-05-01 07:47:19 +02:00
6 changed files with 55 additions and 1677 deletions

2
.gitignore vendored
View File

@ -3,4 +3,4 @@ TODO
*.md
php-5.*.xz
php-7.*.xz
/opcache-default.blacklist
php-7.*.xz.asc

View File

@ -13,7 +13,7 @@ $debug = (isset($_SERVER['argv'][2]) && $_SERVER['argv'][2]==-'d');
$text = explode("\n", $text);
$in=false;
foreach ($text as $line) {
if (preg_match('/(^[0-9]+ ... 20[0-9][0-9])[,]* PHP (.*)$/', $line, $reg)) {
if (preg_match('/(^[0-9]+ .* 20[0-9][0-9])[,]* PHP (.*)$/', $line, $reg)) {
if ($in) {
break;
}

View File

@ -1,280 +0,0 @@
Adapted for 7.2 from 7.3 by remi
From 0ea4013f101d64fbeb9221260b36e98f10ed1ddd Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Wed, 4 Jul 2018 08:48:38 +0200
Subject: [PATCH] Fixed bug #62596 add getallheaders (apache_request_headers)
missing function in FPM add sapi_add_request_header in public API (was
add_request_header) fix arginfo for fastcgi_finish_request fucntion
---
main/SAPI.c | 50 +++++++++++++++++++++++++++++
main/SAPI.h | 1 +
sapi/cgi/cgi_main.c | 51 +----------------------------
sapi/fpm/fpm/fpm_main.c | 25 ++++++++++++++-
sapi/fpm/tests/getallheaders.phpt | 67 +++++++++++++++++++++++++++++++++++++++
5 files changed, 143 insertions(+), 51 deletions(-)
create mode 100644 sapi/fpm/tests/getallheaders.phpt
diff --git a/main/SAPI.c b/main/SAPI.c
index b6c3329..7e0c7c8 100644
--- a/main/SAPI.c
+++ b/main/SAPI.c
@@ -1104,6 +1104,56 @@ SAPI_API void sapi_terminate_process(void) {
}
}
+SAPI_API void sapi_add_request_header(char *var, unsigned int var_len, char *val, unsigned int val_len, void *arg) /* {{{ */
+{
+ zval *return_value = (zval*)arg;
+ char *str = NULL;
+
+ ALLOCA_FLAG(use_heap)
+
+ if (var_len > 5 &&
+ var[0] == 'H' &&
+ var[1] == 'T' &&
+ var[2] == 'T' &&
+ var[3] == 'P' &&
+ var[4] == '_') {
+
+ char *p;
+
+ var_len -= 5;
+ p = var + 5;
+ var = str = do_alloca(var_len + 1, use_heap);
+ *str++ = *p++;
+ while (*p) {
+ if (*p == '_') {
+ *str++ = '-';
+ p++;
+ if (*p) {
+ *str++ = *p++;
+ }
+ } else if (*p >= 'A' && *p <= 'Z') {
+ *str++ = (*p++ - 'A' + 'a');
+ } else {
+ *str++ = *p++;
+ }
+ }
+ *str = 0;
+ } else if (var_len == sizeof("CONTENT_TYPE")-1 &&
+ memcmp(var, "CONTENT_TYPE", sizeof("CONTENT_TYPE")-1) == 0) {
+ var = "Content-Type";
+ } else if (var_len == sizeof("CONTENT_LENGTH")-1 &&
+ memcmp(var, "CONTENT_LENGTH", sizeof("CONTENT_LENGTH")-1) == 0) {
+ var = "Content-Length";
+ } else {
+ return;
+ }
+ add_assoc_stringl_ex(return_value, var, var_len, val, val_len);
+ if (str) {
+ free_alloca(var, use_heap);
+ }
+}
+/* }}} */
+
/*
* Local variables:
* tab-width: 4
diff --git a/main/SAPI.h b/main/SAPI.h
index f829fd7..4b8e223 100644
--- a/main/SAPI.h
+++ b/main/SAPI.h
@@ -151,6 +151,7 @@ SAPI_API void sapi_shutdown(void);
SAPI_API void sapi_activate(void);
SAPI_API void sapi_deactivate(void);
SAPI_API void sapi_initialize_empty_request(void);
+SAPI_API void sapi_add_request_header(char *var, unsigned int var_len, char *val, unsigned int val_len, void *arg);
END_EXTERN_C()
/*
diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c
index 2e9cefe..350846d 100644
--- a/sapi/cgi/cgi_main.c
+++ b/sapi/cgi/cgi_main.c
@@ -1591,54 +1591,6 @@ PHP_FUNCTION(apache_child_terminate) /*
}
/* }}} */
-static void add_request_header(char *var, unsigned int var_len, char *val, unsigned int val_len, void *arg) /* {{{ */
-{
- zval *return_value = (zval*)arg;
- char *str = NULL;
- char *p;
- ALLOCA_FLAG(use_heap)
-
- if (var_len > 5 &&
- var[0] == 'H' &&
- var[1] == 'T' &&
- var[2] == 'T' &&
- var[3] == 'P' &&
- var[4] == '_') {
-
- var_len -= 5;
- p = var + 5;
- var = str = do_alloca(var_len + 1, use_heap);
- *str++ = *p++;
- while (*p) {
- if (*p == '_') {
- *str++ = '-';
- p++;
- if (*p) {
- *str++ = *p++;
- }
- } else if (*p >= 'A' && *p <= 'Z') {
- *str++ = (*p++ - 'A' + 'a');
- } else {
- *str++ = *p++;
- }
- }
- *str = 0;
- } else if (var_len == sizeof("CONTENT_TYPE")-1 &&
- memcmp(var, "CONTENT_TYPE", sizeof("CONTENT_TYPE")-1) == 0) {
- var = "Content-Type";
- } else if (var_len == sizeof("CONTENT_LENGTH")-1 &&
- memcmp(var, "CONTENT_LENGTH", sizeof("CONTENT_LENGTH")-1) == 0) {
- var = "Content-Length";
- } else {
- return;
- }
- add_assoc_stringl_ex(return_value, var, var_len, val, val_len);
- if (str) {
- free_alloca(var, use_heap);
- }
-}
-/* }}} */
-
PHP_FUNCTION(apache_request_headers) /* {{{ */
{
if (zend_parse_parameters_none()) {
@@ -1648,7 +1600,7 @@ PHP_FUNCTION(apache_request_headers) /*
if (fcgi_is_fastcgi()) {
fcgi_request *request = (fcgi_request*) SG(server_context);
- fcgi_loadenv(request, add_request_header, return_value);
+ fcgi_loadenv(request, sapi_add_request_header, return_value);
} else {
char buf[128];
char **env, *p, *q, *var, *val, *t = buf;
diff --git a/sapi/fpm/fpm/fpm_main.c b/sapi/fpm/fpm/fpm_main.c
index 3256660..e815be4 100644
--- a/sapi/fpm/fpm/fpm_main.c
+++ b/sapi/fpm/fpm/fpm_main.c
@@ -1533,6 +1533,10 @@ PHP_FUNCTION(fastcgi_finish_request) /* {{{ */
{
fcgi_request *request = (fcgi_request*) SG(server_context);
+ if (zend_parse_parameters_none() == FAILURE) {
+ return;
+ }
+
if (!fcgi_is_closed(request)) {
php_output_end_all();
php_header();
@@ -1547,8 +1551,27 @@ PHP_FUNCTION(fastcgi_finish_request) /* {{{ */
}
/* }}} */
+ZEND_BEGIN_ARG_INFO(cgi_fcgi_sapi_no_arginfo, 0)
+ZEND_END_ARG_INFO()
+
+PHP_FUNCTION(apache_request_headers) /* {{{ */
+{
+ fcgi_request *request;
+
+ if (zend_parse_parameters_none() == FAILURE) {
+ return;
+ }
+
+ array_init(return_value);
+ if ((request = (fcgi_request*) SG(server_context))) {
+ fcgi_loadenv(request, sapi_add_request_header, return_value);
+ }
+} /* }}} */
+
static const zend_function_entry cgi_fcgi_sapi_functions[] = {
- PHP_FE(fastcgi_finish_request, NULL)
+ PHP_FE(fastcgi_finish_request, cgi_fcgi_sapi_no_arginfo)
+ PHP_FE(apache_request_headers, cgi_fcgi_sapi_no_arginfo)
+ PHP_FALIAS(getallheaders, apache_request_headers, cgi_fcgi_sapi_no_arginfo)
PHP_FE_END
};
diff --git a/sapi/fpm/tests/getallheaders.phpt b/sapi/fpm/tests/getallheaders.phpt
new file mode 100644
index 0000000..b41f1c6
--- /dev/null
+++ b/sapi/fpm/tests/getallheaders.phpt
@@ -0,0 +1,67 @@
+--TEST--
+FPM: Function getallheaders basic test
+--SKIPIF--
+<?php include "skipif.inc"; ?>
+--FILE--
+<?php
+
+require_once "tester.inc";
+
+$cfg = <<<EOT
+[global]
+error_log = {{FILE:LOG}}
+[unconfined]
+listen = {{ADDR}}
+pm = dynamic
+pm.max_children = 5
+pm.start_servers = 1
+pm.min_spare_servers = 1
+pm.max_spare_servers = 3
+EOT;
+
+$code = <<<EOT
+<?php
+echo "Test Start\n";
+var_dump(getallheaders());
+echo "Test End\n";
+EOT;
+
+$headers = [];
+$tester = new FPM\Tester($cfg, $code);
+$tester->start();
+$tester->expectLogStartNotices();
+$tester->request(
+ '',
+ [
+ 'HTTP_X_FOO' => 'BAR',
+ 'HTTP_FOO' => 'foo'
+ ]
+ )->expectBody(
+ [
+ 'Test Start',
+ 'array(4) {',
+ ' ["Foo"]=>',
+ ' string(3) "foo"',
+ ' ["X-Foo"]=>',
+ ' string(3) "BAR"',
+ ' ["Content-Length"]=>',
+ ' string(1) "0"',
+ ' ["Content-Type"]=>',
+ ' string(0) ""',
+ '}',
+ 'Test End',
+ ]
+ );
+$tester->terminate();
+$tester->expectLogTerminatingNotices();
+$tester->close();
+
+?>
+Done
+--EXPECT--
+Done
+--CLEAN--
+<?php
+require_once "tester.inc";
+FPM\Tester::clean();
+?>
--
2.1.4

File diff suppressed because it is too large Load Diff

View File

@ -10,7 +10,6 @@
%global apiver 20180731
%global zendver 20180731
%global pdover 20170320
# Extension version
%global jsonver 1.7.0
# we don't want -z defs linker flag
@ -35,12 +34,12 @@
# needed at srpm build time, when httpd-devel not yet installed
%{!?_httpd_mmn: %{expand: %%global _httpd_mmn %%(cat %{_includedir}/httpd/.mmn 2>/dev/null || echo 0-0)}}
%global with_argon2 1
%global with_dtrace 1
%global with_libgd 1
%global with_zip 0
%global with_libzip 0
%if 0%{?fedora}
%global with_argon2 1
%global with_zts 1
%global with_firebird 1
%global with_imap 1
@ -49,6 +48,7 @@
%global with_pspell 1
%global with_lmdb 1
%else
%global with_argon2 0
%global with_zts 0
%global with_firebird 0
%global with_imap 0
@ -58,7 +58,7 @@
%global with_lmdb 0
%endif
%global upver 7.3.4
%global upver 7.3.18
#global rcver RC1
Summary: PHP scripting language for creating dynamic web sites
@ -74,7 +74,7 @@ Release: 1%{?dist}
License: PHP and Zend and BSD and MIT and ASL 1.0 and NCSA
URL: http://www.php.net/
Source0: http://www.php.net/distributions/php-%{upver}%{?rcver}.tar.xz
Source0: https://www.php.net/distributions/php-%{upver}%{?rcver}.tar.xz
Source1: php.conf
Source2: php.ini
Source3: macros.php
@ -111,7 +111,6 @@ Patch46: php-7.2.4-fixheader.patch
Patch47: php-5.6.3-phpinfo.patch
# Upstream fixes (100+)
Patch100: php-upstream.patch
# Security fixes (200+)
@ -280,7 +279,9 @@ Requires: gcc-c++
Requires: libtool
# see "php-config --libs"
Requires: krb5-devel%{?_isa}
%if %{with_argon2}
Requires: libargon2-devel%{?_isa}
%endif
Requires: libedit-devel%{?_isa}
Requires: libxml2-devel%{?_isa}
Requires: openssl-devel%{?_isa}
@ -609,7 +610,7 @@ Provides: php-pdo_dblib, php-pdo_dblib%{?_isa}
%description pdo-dblib
The php-pdo-dblib package contains a dynamic shared object
that implements the PHP Data Objects (PDO) interface to enable access from
PHP to Microsoft SQL Server and Sybase databases through the FreeTDS libary.
PHP to Microsoft SQL Server and Sybase databases through the FreeTDS library.
%endif
%package embedded
@ -722,7 +723,6 @@ low-level PHP extension for the libsodium cryptographic library.
%patch47 -p1 -b .phpinfo
# upstream patches
%patch100 -p1 -b .up
# security patches
@ -1388,7 +1388,7 @@ sed -e "s/@PHP_APIVER@/%{apiver}-%{__isa_bits}/" \
%endif
< %{SOURCE3} > macros.php
install -m 644 -D macros.php \
$RPM_BUILD_ROOT%{_rpmconfigdir}/macros.d/macros.php
$RPM_BUILD_ROOT%{_rpmmacrodir}/macros.php
# Remove unpackaged files
rm -rf $RPM_BUILD_ROOT%{_libdir}/php/modules/*.a \
@ -1511,7 +1511,7 @@ systemctl try-restart php-fpm.service >/dev/null 2>&1 || :
%{_mandir}/man1/zts-phpize.1*
%endif
%{_mandir}/man1/php-config.1*
%{_rpmconfigdir}/macros.d/macros.php
%{_rpmmacrodir}/macros.php
%files embedded
%{_libdir}/libphp7.so
@ -1567,6 +1567,48 @@ systemctl try-restart php-fpm.service >/dev/null 2>&1 || :
%changelog
* Tue May 12 2020 Remi Collet <remi@remirepo.net> - 7.3.18-1
- Update to 7.3.18 - http://www.php.net/releases/7_3_18.php
* Tue Apr 14 2020 Remi Collet <remi@remirepo.net> - 7.3.17-1
- Update to 7.3.17 - http://www.php.net/releases/7_3_17.php
* Tue Mar 17 2020 Remi Collet <remi@remirepo.net> - 7.3.16-1
- Update to 7.3.16 - http://www.php.net/releases/7_3_16.php
* Tue Feb 18 2020 Remi Collet <remi@remirepo.net> - 7.3.15-1
- Update to 7.3.15 - http://www.php.net/releases/7_3_15.php
* Tue Jan 21 2020 Remi Collet <remi@remirepo.net> - 7.3.14-1
- Update to 7.3.14 - http://www.php.net/releases/7_3_14.php
* Tue Dec 17 2019 Remi Collet <remi@remirepo.net> - 7.3.13-1
- Update to 7.3.13 - http://www.php.net/releases/7_3_13.php
* Tue Nov 19 2019 Remi Collet <remi@remirepo.net> - 7.3.12-1
- Update to 7.3.12 - http://www.php.net/releases/7_3_12.php
* Tue Oct 22 2019 Remi Collet <remi@remirepo.net> - 7.3.11-1
- Update to 7.3.11 - http://www.php.net/releases/7_3_11.php
* Tue Sep 24 2019 Remi Collet <remi@remirepo.net> - 7.3.10-1
- Update to 7.3.10 - http://www.php.net/releases/7_3_10.php
* Wed Aug 28 2019 Remi Collet <remi@remirepo.net> - 7.3.9-1
- Update to 7.3.9 - http://www.php.net/releases/7_3_9.php
* Tue Jul 30 2019 Remi Collet <remi@remirepo.net> - 7.3.8-1
- Update to 7.3.8 - http://www.php.net/releases/7_3_8.php
* Wed Jul 3 2019 Remi Collet <remi@remirepo.net> - 7.3.7-2
- Update to 7.3.7 - http://www.php.net/releases/7_3_7.php
* Tue May 28 2019 Remi Collet <remi@remirepo.net> - 7.3.6-1
- Update to 7.3.6 - http://www.php.net/releases/7_3_6.php
* Wed May 1 2019 Remi Collet <remi@remirepo.net> - 7.3.5-1
- Update to 7.3.5 - http://www.php.net/releases/7_3_5.php
* Tue Apr 2 2019 Remi Collet <remi@remirepo.net> - 7.3.4-1
- Update to 7.3.4 - http://www.php.net/releases/7_3_4.php

View File

@ -1,2 +1,2 @@
SHA512 (opcache-default.blacklist) = 1dbdc189e5f9ee2397e879cd0ca23abdedc4a8b27285f8231f049f2b73535190851710db3f8c373ecd130c49a645c2a04a5c3f28f5879bdcc08fc6cc6306e974
SHA512 (php-7.3.4.tar.xz) = fc45cd6cb273ca7a959a3ab0d2d15febedc60e9e289803f5f4340149b5fe8f52ca23119b128513194d769c842cd0941f8086c338db115d585c2f4e791e83b141
SHA512 (php-7.3.18.tar.xz) = e626091c835f6d165ff48ae3be8ddf7a66b0a320c6d77dc98fb73235d560814c180112a9e5478a5b3b6bb01ed99a50f8025fdc3d1ef80cca59e04ac248f9b0bf
SHA512 (php-7.3.18.tar.xz.asc) = e64d21cde7ba5e7e3678893c5da60b6b81a454b859cb9dda6a5aedf59eccc2dd721f6ea4e49aa939c97a5147cf3933d79b731880294e3d58022a7c1375cfcba6