Skip to content

Commit b9ad000

Browse files
committed
Merge branch 'master' into jsond
2 parents 0bfa245 + 855d296 commit b9ad000

File tree

608 files changed

+43742
-41129
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

608 files changed

+43742
-41129
lines changed

.travis.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
language: php
2-
3-
php:
4-
# We only specify one version so we only get one worker
5-
- 5.4
1+
language: c
62

73
branches:
84
except:
@@ -33,6 +29,7 @@ before_install:
3329
- sudo apt-get install -y libenchant-dev libaspell-dev libpspell-dev librecode-dev
3430
- sudo cp ./travis/de /var/lib/locales/supported.d/de
3531
- sudo dpkg-reconfigure locales
32+
- ./travis/install.sh
3633

3734
before_script:
3835
# Compile PHP
@@ -46,5 +43,5 @@ before_script:
4643

4744
# Run PHPs run-tests.php
4845
script:
49-
- ./sapi/cli/php run-tests.php -p `pwd`/sapi/cli/php -g "FAIL,XFAIL,BORK,WARN,LEAK,SKIP" --show-diff --set-timeout 120 -s
46+
- ./sapi/cli/php run-tests.php -p `pwd`/sapi/cli/php -g "FAIL,XFAIL,BORK,WARN,LEAK,SKIP" --show-diff --set-timeout 120
5047
- ./sapi/cli/php sapi/phpdbg/tests/run-tests.php -diff2stdout --phpdbg sapi/phpdbg/phpdbg

CODING_STANDARDS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Exceptions:
4242

4343
4. When writing functions that deal with strings, be sure to remember
4444
that PHP holds the length property of each string, and that it
45-
shouldn't be calculated with strlen(). Write your functions in a such
45+
shouldn't be calculated with strlen(). Write your functions in such
4646
a way so that they'll take advantage of the length property, both
4747
for efficiency and in order for them to be binary-safe.
4848
Functions that change strings and obtain their new lengths while

INSTALL

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ Table of Contents
155155
a list of all available options along with short explanations running
156156
./configure --help. Our manual documents the different options
157157
separately. You will find the core options in the appendix, while the
158-
different extension specific options are descibed on the reference
158+
different extension specific options are described on the reference
159159
pages.
160160

161161
When PHP is configured, you are ready to build the module and/or

NEWS

Lines changed: 58 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
33
?? ??? 20??, PHP 7.0.0
44

5-
-Fileinfo:
6-
. Fixed bug #66242 (libmagic: don't assume char is signed). (ArdB)
7-
85
- CLI server:
96
. Refactor MIME type handling to use a hash table instead of linear search.
107
(Adam)
@@ -20,37 +17,81 @@ PHP NEWS
2017
. Implemented FR #38409 (parse_ini_file() looses the type of booleans). (Tjerk)
2118
. Fixed #67959 (Segfault when calling phpversion('spl')). (Florian)
2219
. Implemented the RFC `Catchable "Call to a member function bar() on a
23-
non-object"` (Timm)
20+
non-object"`. (Timm)
21+
. Added options parameter for unserialize allowing to specify acceptable
22+
classes (https://wiki.php.net/rfc/secure_unserialize). (Stas)
23+
. Fixed bug #68185 ("Inconsistent insteadof definition."- incorrectly triggered). (Julien)
24+
. Fixed bug #65419 (Inside trait, self::class != __CLASS__). (Julien)
25+
. Fixed bug #65576 (Constructor from trait conflicts with inherited
26+
constructor). (dunglas at gmail dot com)
27+
. Removed ZEND_ACC_FINAL_CLASS, promoting ZEND_ACC_FINAL as final class
28+
modifier. (Guilherme Blanco)
2429

25-
- Reflection
26-
. Fixed inheritance chain of Reflector interface (Tjerk)
30+
- Date:
31+
. Fixed day_of_week function as it could sometimes return negative values
32+
internally. (Derick)
2733

2834
- DBA:
2935
. Fixed bug #62490 (dba_delete returns true on missing item (inifile)). (Mike)
3036

37+
- DOM:
38+
. Made DOMNode::textContent writeable. (Tjerk)
39+
40+
- GD:
41+
. Made fontFetch's path parser thread-safe. (Sara)
42+
43+
- Fileinfo:
44+
. Fixed bug #66242 (libmagic: don't assume char is signed). (ArdB)
45+
46+
- Filter:
47+
. New FILTER_VALIDATE_DOMAIN and better RFC conformance for FILTER_VALIDATE_URL. (Kevin Dunglas)
48+
3149
- FPM:
3250
. Fixed bug #65933 (Cannot specify config lines longer than 1024 bytes). (Chris Wright)
51+
. Implement request #67106 (Split main fpm config). (Elan Ruusamäe, Remi)
3352

34-
- Standard:
35-
. Removed call_user_method() and call_user_method_array() functions. (Kalle)
36-
. Fix user session handlers (See rfc:session.user.return-value). (Sara)
37-
. Added intdiv() function. (Andrea)
38-
. Improved precision of log() function for base 2 and 10. (Marc Bennewitz)
53+
- LiteSpeed:
54+
. Updated LiteSpeed SAPI code from V5.5 to V6.6. (George Wang)
3955

40-
- XSL:
41-
. Fixed bug #64776 (The XSLT extension is not thread safe). (Mike)
56+
- Mcrypt:
57+
. Fixed possible read after end of buffer and use after free. (Dmitry)
4258

43-
- GD:
44-
. Made fontFetch's path parser thread-safe. (Sara)
59+
- pcntl:
60+
. Fixed bug #60509 (pcntl_signal doesn't decrease ref-count of old handler
61+
when setting SIG_DFL). (Julien)
62+
63+
- PDO_mysql:
64+
. Fixed bug #68424 (Add new PDO mysql connection attr to control multi
65+
statements option). (peter dot wolanin at acquia dot com)
66+
67+
- Reflection
68+
. Fixed inheritance chain of Reflector interface (Tjerk)
4569

4670
- Session:
4771
. Fixed bug #67694 (Regression in session_regenerate_id()). (Tjerk)
4872

73+
- SOAP:
74+
. Fixed bug #68361 (Segmentation fault on SoapClient::__getTypes).
75+
(Laruence)
76+
4977
- SPL:
5078
. Implemented #67886 (SplPriorityQueue/SplHeap doesn't expose extractFlags
5179
nor curruption state). (Julien)
80+
. Fixed bug #66405 (RecursiveDirectoryIterator::CURRENT_AS_PATHNAME
81+
breaks the RecursiveIterator). (Paul Garvin)
82+
. Fixed bug #68479 (Added escape parameter to SplFileObject::fputcsv). (Salathe)
5283

53-
- DOM:
54-
. Made DOMNode::textContent writeable. (Tjerk)
84+
- Standard:
85+
. Removed call_user_method() and call_user_method_array() functions. (Kalle)
86+
. Fix user session handlers (See rfc:session.user.return-value). (Sara)
87+
. Added intdiv() function. (Andrea)
88+
. Improved precision of log() function for base 2 and 10. (Marc Bennewitz)
89+
90+
- Streams:
91+
. Fixed bug #68532 (convert.base64-encode omits padding bytes).
92+
(blaesius at krumedia dot de)
93+
94+
- XSL:
95+
. Fixed bug #64776 (The XSLT extension is not thread safe). (Mike)
5596

5697
<<< NOTE: Insert NEWS from last stable release here prior to actual release! >>>

README.TESTING

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ MYMAIL=qa-test@domain.com
123123
TMPDIR=/var/tmp
124124
TODAY=`date +"%Y%m%d"`
125125

126-
# Make sure compilation enviroment is correct
126+
# Make sure compilation environment is correct
127127
CONFIGURE_OPTS='--disable-all --enable-cli --with-pcre'
128128
export MAKE=gmake
129129
export CC=gcc

README.TESTING2

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ the original run-tests.php script. server-tests is *not* used by
88
'make test'. server-tests was developed to provide support for
99
testing PHP under it's primary environment, HTTP, and can run the
1010
PHP tests under any of the SAPI modules that are direct executables,
11-
or are accessable via HTTP.
11+
or are accessible via HTTP.
1212

1313
[New features]
1414
----------------
@@ -95,7 +95,7 @@ include:
9595
$filename full native path to file, will become PATH_TRANSLATED
9696
$filepath =dirname($filename)
9797
$scriptname this is what will become SCRIPT_NAME unless you override it
98-
$docroot the equivelant of DOCUMENT_ROOT under Apache
98+
$docroot the equivalent of DOCUMENT_ROOT under Apache
9999
$cwd the directory that the test is being initiated from
100100
$this->conf all server-tests configuration vars
101101
$this->env all environment variables that will get passed to the test
@@ -105,7 +105,7 @@ include:
105105
This section is also eval'd, and is similar in nature to --ENV--. However,
106106
this section is used to build the url used in an HTTP request. Valid values
107107
to set in this section would include:
108-
SCRIPT_NAME The inital part of the request url
108+
SCRIPT_NAME The initial part of the request url
109109
PATH_INFO The pathinfo part of a request url
110110
FRAGMENT The fragment section of a url (after #)
111111
QUERY_STRING The query part of a url (after ?)

TSRM/tsrm_win32.c

Lines changed: 58 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -106,31 +106,35 @@ TSRM_API void tsrm_win32_shutdown(void)
106106
char * tsrm_win32_get_path_sid_key(const char *pathname TSRMLS_DC)
107107
{
108108
PSID pSid = TWG(impersonation_token_sid);
109-
DWORD sid_len = pSid ? GetLengthSid(pSid) : 0;
110109
TCHAR *ptcSid = NULL;
111110
char *bucket_key = NULL;
111+
size_t ptc_sid_len, pathname_len;
112+
113+
pathname_len = strlen(pathname);
112114

113115
if (!pSid) {
114-
bucket_key = (char *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, strlen(pathname) + 1);
116+
bucket_key = (char *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, pathname_len + 1);
115117
if (!bucket_key) {
116118
return NULL;
117119
}
118-
memcpy(bucket_key, pathname, strlen(pathname));
120+
memcpy(bucket_key, pathname, pathname_len);
119121
return bucket_key;
120122
}
121123

122124
if (!ConvertSidToStringSid(pSid, &ptcSid)) {
123125
return NULL;
124126
}
125127

126-
bucket_key = (char *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, strlen(pathname) + strlen(ptcSid) + 1);
128+
129+
ptc_sid_len = strlen(ptcSid);
130+
bucket_key = (char *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, pathname_len + ptc_sid_len + 1);
127131
if (!bucket_key) {
128132
LocalFree(ptcSid);
129133
return NULL;
130134
}
131135

132-
memcpy(bucket_key, ptcSid, strlen(ptcSid));
133-
memcpy(bucket_key + strlen(ptcSid), pathname, strlen(pathname) + 1);
136+
memcpy(bucket_key, ptcSid, ptc_sid_len);
137+
memcpy(bucket_key + ptc_sid_len, pathname, pathname_len + 1);
134138

135139
LocalFree(ptcSid);
136140
return bucket_key;
@@ -139,11 +143,8 @@ char * tsrm_win32_get_path_sid_key(const char *pathname TSRMLS_DC)
139143

140144
PSID tsrm_win32_get_token_sid(HANDLE hToken)
141145
{
142-
BOOL bSuccess = FALSE;
143146
DWORD dwLength = 0;
144147
PTOKEN_USER pTokenUser = NULL;
145-
PSID sid;
146-
PSID *ppsid = &sid;
147148
DWORD sid_len;
148149
PSID pResultSid = NULL;
149150

@@ -204,7 +205,6 @@ TSRM_API int tsrm_win32_access(const char *pathname, int mode TSRMLS_DC)
204205
BYTE * psec_desc = NULL;
205206
BOOL fAccess = FALSE;
206207

207-
BOOL bucket_key_alloc = FALSE;
208208
realpath_cache_bucket * bucket = NULL;
209209
char * real_path = NULL;
210210

@@ -242,7 +242,6 @@ TSRM_API int tsrm_win32_access(const char *pathname, int mode TSRMLS_DC)
242242
was impersonating already, this function uses that impersonation context.
243243
*/
244244
if(!OpenThreadToken(GetCurrentThread(), TOKEN_ALL_ACCESS, TRUE, &thread_token)) {
245-
DWORD err = GetLastError();
246245
if (GetLastError() == ERROR_NO_TOKEN) {
247246
if (!OpenProcessToken(GetCurrentProcess(), TOKEN_ALL_ACCESS, &thread_token)) {
248247
TWG(impersonation_token) = NULL;
@@ -722,4 +721,52 @@ TSRM_API char *realpath(char *orig_path, char *buffer)
722721
return buffer;
723722
}
724723

724+
#if HAVE_UTIME
725+
static zend_always_inline void UnixTimeToFileTime(time_t t, LPFILETIME pft) /* {{{ */
726+
{
727+
// Note that LONGLONG is a 64-bit value
728+
LONGLONG ll;
729+
730+
ll = Int32x32To64(t, 10000000) + 116444736000000000;
731+
pft->dwLowDateTime = (DWORD)ll;
732+
pft->dwHighDateTime = ll >> 32;
733+
}
734+
/* }}} */
735+
736+
TSRM_API int win32_utime(const char *filename, struct utimbuf *buf) /* {{{ */
737+
{
738+
FILETIME mtime, atime;
739+
HANDLE hFile;
740+
741+
hFile = CreateFile(filename, GENERIC_WRITE, FILE_SHARE_WRITE|FILE_SHARE_READ, NULL,
742+
OPEN_ALWAYS, FILE_FLAG_BACKUP_SEMANTICS, NULL);
743+
744+
/* OPEN_ALWAYS mode sets the last error to ERROR_ALREADY_EXISTS but
745+
the CreateFile operation succeeds */
746+
if (GetLastError() == ERROR_ALREADY_EXISTS) {
747+
SetLastError(0);
748+
}
749+
750+
if ( hFile == INVALID_HANDLE_VALUE ) {
751+
return -1;
752+
}
753+
754+
if (!buf) {
755+
SYSTEMTIME st;
756+
GetSystemTime(&st);
757+
SystemTimeToFileTime(&st, &mtime);
758+
atime = mtime;
759+
} else {
760+
UnixTimeToFileTime(buf->modtime, &mtime);
761+
UnixTimeToFileTime(buf->actime, &atime);
762+
}
763+
if (!SetFileTime(hFile, NULL, &atime, &mtime)) {
764+
CloseHandle(hFile);
765+
return -1;
766+
}
767+
CloseHandle(hFile);
768+
return 1;
769+
}
770+
/* }}} */
771+
#endif
725772
#endif

TSRM/tsrm_win32.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323

2424
#include "TSRM.h"
2525
#include <windows.h>
26+
#if HAVE_UTIME
27+
# include <sys/utime.h>
28+
#endif
2629

2730
struct ipc_perm {
2831
int key;

UPGRADING

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ PHP X.Y UPGRADE NOTES
6363

6464
- FPM
6565
. Fixed bug #65933 (Cannot specify config lines longer than 1024 bytes).
66+
. Listen = port now listen on all addresses (IPv6 and IPv4-mapped).
6667

6768
========================================
6869
4. Deprecated Functionality
@@ -76,12 +77,18 @@ PHP X.Y UPGRADE NOTES
7677
- parse_ini_file():
7778
- parse_ini_string():
7879
Added scanner mode INI_SCANNER_TYPED to yield typed .ini values.
80+
- unserialize():
81+
Added second parameter for unserialize function
82+
(RFC: https://wiki.php.net/rfc/secure_unserialize) allowing to specify
83+
acceptable classes:
84+
unserialize($foo, ["allowed_classes" => ["MyClass", "MyClass2"]);
7985

8086

8187
========================================
8288
6. New Functions
8389
========================================
84-
90+
- GMP
91+
Added gmp_random_seed()
8592

8693
========================================
8794
7. New Classes and Interfaces
@@ -126,7 +133,7 @@ PHP X.Y UPGRADE NOTES
126133
========================================
127134

128135
- Core
129-
. Instead of being undefined and platform-dependant, NaN and Infinity will
136+
. Instead of being undefined and platform-dependent, NaN and Infinity will
130137
always be zero when casted to integer.
131138
. Calling a method on a non-object no longer raises a fatal error; see
132139
also: https://wiki.php.net/rfc/catchable-call-to-member-of-non-object

0 commit comments

Comments
 (0)