Skip to content

Commit

Permalink
Merge branch 'master' into zppFailOnOverflow
Browse files Browse the repository at this point in the history
  • Loading branch information
hikari-no-yume committed Nov 29, 2014
2 parents 65c8edd + 719083b commit 01554bf
Show file tree
Hide file tree
Showing 412 changed files with 10,002 additions and 4,908 deletions.
2 changes: 1 addition & 1 deletion CODING_STANDARDS
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Exceptions:

4. When writing functions that deal with strings, be sure to remember
that PHP holds the length property of each string, and that it
shouldn't be calculated with strlen(). Write your functions in a such
shouldn't be calculated with strlen(). Write your functions in such
a way so that they'll take advantage of the length property, both
for efficiency and in order for them to be binary-safe.
Functions that change strings and obtain their new lengths while
Expand Down
2 changes: 1 addition & 1 deletion INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ Table of Contents
a list of all available options along with short explanations running
./configure --help. Our manual documents the different options
separately. You will find the core options in the appendix, while the
different extension specific options are descibed on the reference
different extension specific options are described on the reference
pages.

When PHP is configured, you are ready to build the module and/or
Expand Down
52 changes: 33 additions & 19 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 20??, PHP 7.0.0

-Fileinfo:
. Fixed bug #66242 (libmagic: don't assume char is signed). (ArdB)

- CLI server:
. Refactor MIME type handling to use a hash table instead of linear search.
(Adam)
Expand All @@ -20,37 +17,54 @@ PHP NEWS
. Implemented FR #38409 (parse_ini_file() looses the type of booleans). (Tjerk)
. Fixed #67959 (Segfault when calling phpversion('spl')). (Florian)
. Implemented the RFC `Catchable "Call to a member function bar() on a
non-object"` (Timm)

- Reflection
. Fixed inheritance chain of Reflector interface (Tjerk)
non-object"`. (Timm)
. Added options parameter for unserialize allowing to specify acceptable
classes (https://wiki.php.net/rfc/secure_unserialize). (Stas)
. Fixed bug #68185 ("Inconsistent insteadof definition."- incorrectly triggered). (Julien)
. Fixed bug #65419 (Inside trait, self::class != __CLASS__). (Julien)

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

- DOM:
. Made DOMNode::textContent writeable. (Tjerk)

- GD:
. Made fontFetch's path parser thread-safe. (Sara)

- Fileinfo:
. Fixed bug #66242 (libmagic: don't assume char is signed). (ArdB)

- Filter:
. New FILTER_VALIDATE_DOMAIN and better RFC conformance for FILTER_VALIDATE_URL. (Kevin Dunglas)

- FPM:
. Fixed bug #65933 (Cannot specify config lines longer than 1024 bytes). (Chris Wright)

- Standard:
. Removed call_user_method() and call_user_method_array() functions. (Kalle)
. Fix user session handlers (See rfc:session.user.return-value). (Sara)
. Added intdiv() function. (Andrea)
. Improved precision of log() function for base 2 and 10. (Marc Bennewitz)

- XSL:
. Fixed bug #64776 (The XSLT extension is not thread safe). (Mike)
- LiteSpeed:
. Updated LiteSpeed SAPI code from V5.5 to V6.6. (George Wang)

- GD:
. Made fontFetch's path parser thread-safe. (Sara)
- Reflection
. Fixed inheritance chain of Reflector interface (Tjerk)

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

- SOAP:
. Fixed bug #68361 (Segmentation fault on SoapClient::__getTypes).
(Laruence)

- SPL:
. Implemented #67886 (SplPriorityQueue/SplHeap doesn't expose extractFlags
nor curruption state). (Julien)

- DOM:
. Made DOMNode::textContent writeable. (Tjerk)
- Standard:
. Removed call_user_method() and call_user_method_array() functions. (Kalle)
. Fix user session handlers (See rfc:session.user.return-value). (Sara)
. Added intdiv() function. (Andrea)
. Improved precision of log() function for base 2 and 10. (Marc Bennewitz)

- XSL:
. Fixed bug #64776 (The XSLT extension is not thread safe). (Mike)

<<< NOTE: Insert NEWS from last stable release here prior to actual release! >>>
2 changes: 1 addition & 1 deletion README.TESTING
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ [email protected]
TMPDIR=/var/tmp
TODAY=`date +"%Y%m%d"`

# Make sure compilation enviroment is correct
# Make sure compilation environment is correct
CONFIGURE_OPTS='--disable-all --enable-cli --with-pcre'
export MAKE=gmake
export CC=gcc
Expand Down
6 changes: 3 additions & 3 deletions README.TESTING2
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ the original run-tests.php script. server-tests is *not* used by
'make test'. server-tests was developed to provide support for
testing PHP under it's primary environment, HTTP, and can run the
PHP tests under any of the SAPI modules that are direct executables,
or are accessable via HTTP.
or are accessible via HTTP.

[New features]
----------------
Expand Down Expand Up @@ -95,7 +95,7 @@ include:
$filename full native path to file, will become PATH_TRANSLATED
$filepath =dirname($filename)
$scriptname this is what will become SCRIPT_NAME unless you override it
$docroot the equivelant of DOCUMENT_ROOT under Apache
$docroot the equivalent of DOCUMENT_ROOT under Apache
$cwd the directory that the test is being initiated from
$this->conf all server-tests configuration vars
$this->env all environment variables that will get passed to the test
Expand All @@ -105,7 +105,7 @@ include:
This section is also eval'd, and is similar in nature to --ENV--. However,
this section is used to build the url used in an HTTP request. Valid values
to set in this section would include:
SCRIPT_NAME The inital part of the request url
SCRIPT_NAME The initial part of the request url
PATH_INFO The pathinfo part of a request url
FRAGMENT The fragment section of a url (after #)
QUERY_STRING The query part of a url (after ?)
Expand Down
69 changes: 58 additions & 11 deletions TSRM/tsrm_win32.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,31 +106,35 @@ TSRM_API void tsrm_win32_shutdown(void)
char * tsrm_win32_get_path_sid_key(const char *pathname TSRMLS_DC)
{
PSID pSid = TWG(impersonation_token_sid);
DWORD sid_len = pSid ? GetLengthSid(pSid) : 0;
TCHAR *ptcSid = NULL;
char *bucket_key = NULL;
size_t ptc_sid_len, pathname_len;

pathname_len = strlen(pathname);

if (!pSid) {
bucket_key = (char *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, strlen(pathname) + 1);
bucket_key = (char *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, pathname_len + 1);
if (!bucket_key) {
return NULL;
}
memcpy(bucket_key, pathname, strlen(pathname));
memcpy(bucket_key, pathname, pathname_len);
return bucket_key;
}

if (!ConvertSidToStringSid(pSid, &ptcSid)) {
return NULL;
}

bucket_key = (char *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, strlen(pathname) + strlen(ptcSid) + 1);

ptc_sid_len = strlen(ptcSid);
bucket_key = (char *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, pathname_len + ptc_sid_len + 1);
if (!bucket_key) {
LocalFree(ptcSid);
return NULL;
}

memcpy(bucket_key, ptcSid, strlen(ptcSid));
memcpy(bucket_key + strlen(ptcSid), pathname, strlen(pathname) + 1);
memcpy(bucket_key, ptcSid, ptc_sid_len);
memcpy(bucket_key + ptc_sid_len, pathname, pathname_len + 1);

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

PSID tsrm_win32_get_token_sid(HANDLE hToken)
{
BOOL bSuccess = FALSE;
DWORD dwLength = 0;
PTOKEN_USER pTokenUser = NULL;
PSID sid;
PSID *ppsid = &sid;
DWORD sid_len;
PSID pResultSid = NULL;

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

BOOL bucket_key_alloc = FALSE;
realpath_cache_bucket * bucket = NULL;
char * real_path = NULL;

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

#if HAVE_UTIME
static zend_always_inline void UnixTimeToFileTime(time_t t, LPFILETIME pft) /* {{{ */
{
// Note that LONGLONG is a 64-bit value
LONGLONG ll;

ll = Int32x32To64(t, 10000000) + 116444736000000000;
pft->dwLowDateTime = (DWORD)ll;
pft->dwHighDateTime = ll >> 32;
}
/* }}} */

TSRM_API int win32_utime(const char *filename, struct utimbuf *buf) /* {{{ */
{
FILETIME mtime, atime;
HANDLE hFile;

hFile = CreateFile(filename, GENERIC_WRITE, FILE_SHARE_WRITE|FILE_SHARE_READ, NULL,
OPEN_ALWAYS, FILE_FLAG_BACKUP_SEMANTICS, NULL);

/* OPEN_ALWAYS mode sets the last error to ERROR_ALREADY_EXISTS but
the CreateFile operation succeeds */
if (GetLastError() == ERROR_ALREADY_EXISTS) {
SetLastError(0);
}

if ( hFile == INVALID_HANDLE_VALUE ) {
return -1;
}

if (!buf) {
SYSTEMTIME st;
GetSystemTime(&st);
SystemTimeToFileTime(&st, &mtime);
atime = mtime;
} else {
UnixTimeToFileTime(buf->modtime, &mtime);
UnixTimeToFileTime(buf->actime, &atime);
}
if (!SetFileTime(hFile, NULL, &atime, &mtime)) {
CloseHandle(hFile);
return -1;
}
CloseHandle(hFile);
return 1;
}
/* }}} */
#endif
#endif
3 changes: 3 additions & 0 deletions TSRM/tsrm_win32.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@

#include "TSRM.h"
#include <windows.h>
#if HAVE_UTIME
# include <sys/utime.h>
#endif

struct ipc_perm {
int key;
Expand Down
8 changes: 7 additions & 1 deletion UPGRADING
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ PHP X.Y UPGRADE NOTES

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

========================================
4. Deprecated Functionality
Expand All @@ -76,6 +77,11 @@ PHP X.Y UPGRADE NOTES
- parse_ini_file():
- parse_ini_string():
Added scanner mode INI_SCANNER_TYPED to yield typed .ini values.
- unserialize():
Added second parameter for unserialize function
(RFC: https://wiki.php.net/rfc/secure_unserialize) allowing to specify
acceptable classes:
unserialize($foo, ["allowed_classes" => ["MyClass", "MyClass2"]);


========================================
Expand Down Expand Up @@ -126,7 +132,7 @@ PHP X.Y UPGRADE NOTES
========================================

- Core
. Instead of being undefined and platform-dependant, NaN and Infinity will
. Instead of being undefined and platform-dependent, NaN and Infinity will
always be zero when casted to integer.
. Calling a method on a non-object no longer raises a fatal error; see
also: https://wiki.php.net/rfc/catchable-call-to-member-of-non-object
Expand Down
31 changes: 30 additions & 1 deletion UPGRADING.INTERNALS
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ PHP 7.0 INTERNALS UPGRADE NOTES
h. HashTable API
i. New portable macros for large file support
j. New portable macros for integers
k. get_class_entry object handler info
l. get_class_name object handler info
m. Other portable macros info

2. Build system changes
a. Unix build system changes
Expand Down Expand Up @@ -110,8 +113,34 @@ PHP 7.0 INTERNALS UPGRADE NOTES
The handler is now obligatory, no longer accepts a `parent` argument and
must return a non-NULL zend_string*, which will be released by the caller.

m. Other portable macros info

ZEND_SECURE_ZERO - zeroes chunk of memory
ZEND_VALID_SOCKET - validates a php_socket_t variable

ZEND_FASTCALL is defined to use __vectorcall convention on VS2013 and above
ZEND_NORETURN is defined as __declspec(noreturn) on VS

========================
2. Build system changes
========================


a. Unix build system changes

b. Windows build system changes

- Besides Visual Studio, building with Clang or Intel Composer is now
possible. To enable an alternative toolset, add the option
--with-toolset=[vs,clang,icc] to the configure line. The default
toolset is vs. Still clang or icc need the correct environment
which involves many tools from the vs toolset.

The toolset option is supported by phpize as well.

AWARENESS The only recommended and supported toolset to produce production
ready binaries is Visual Studio. Still other compilers can be used now for
testing and analyzing purposes.

- configure.js now produces response files which are passed to the linker
and library manager. This solves the issues with the long command lines
which can exceed the OS limit.
2 changes: 1 addition & 1 deletion Zend/ZEND_CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -1103,7 +1103,7 @@ Changes in the Zend Engine 1.0
Use ob_start() to begin output buffering, ob_end_flush() to end
buffering and send out the buffered contents, ob_end_clean() to
end buffering without sending the buffered contents, and
ob_get_contents() to retreive the current contents of the output
ob_get_contents() to retrieve the current contents of the output
buffer. Header information (header(), content type, cookies) are
not buffered. By turning on output buffering, you can
effectively send header information all throughout your file,
Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/bug21478.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ stream_filter_append($fp, "myfilter");
fwrite($fp, "This is a test.\n");
print "Done.\n";
fclose($fp);
// Uncommenting the following 'print' line causes the segfault to stop occuring
// Uncommenting the following 'print' line causes the segfault to stop occurring
// print "2\n";
readfile(dirname(__FILE__)."/test.txt");
unlink(dirname(__FILE__)."/test.txt");
Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/bug33512.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class TheObj {
unset($SomeObj->Virtual1);
unset($SomeObj->{'Virtual'.(3)});

//but, these variables are still available??? eventhough they're "unset"-ed
//but, these variables are still available??? even though they're "unset"-ed
print $SomeObj->Virtual1."\n";
print $SomeObj->{'Virtual'.(3)}."\n";
?>
Expand Down
8 changes: 8 additions & 0 deletions Zend/tests/bug38779_1.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ include $filename;

echo "Done\n";
?>
--CLEAN--
<?php

$filename = dirname(__FILE__)."/bug38779.txt";
if (file_exists($filename)) {
@unlink(dirname(__FILE__)."/bug38779.txt");
}
?>
--EXPECTF--
Parse error: %s error%sin %s on line %d
string(6) "flush!"
Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/bug40809.phpt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
Bug #40809 (Poor perfomance of ".=")
Bug #40809 (Poor performance of ".=")
--FILE--
<?php
error_reporting(E_ALL|E_STRICT);
Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/bug43200.phpt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
Bug #43200 (Interface implementation / inheritence not possible in abstract classes)
Bug #43200 (Interface implementation / inheritance not possible in abstract classes)
--FILE--
<?php

Expand Down
Loading

0 comments on commit 01554bf

Please sign in to comment.