Skip to content

Commit

Permalink
Merge branch 'master' of git.php.net:php-src
Browse files Browse the repository at this point in the history
* 'master' of git.php.net:php-src: (270 commits)
  Fixed bug #65939 (Space before ";" breaks php.ini parsing). (brainstorm at nopcode dot org)
  exif NEWS
  add tests for bug #62523
  Merged PR #293 (Exif crash on unknown encoding was fixed) By: 	Draal Conflicts: 	configure.in 	main/php_version.h
  fix bug #65936 (dangling context pointer causes crash)
  remove TRAVIS check in test source
  Fixed compilation warning
  Just SKIP that test on travis
  Fixed issue #115 (path issue when using phar).
  fix memory leak on error (from Coverity scan)
  fix argument type & remove warning
  fix const warnings in intl methods
  Fix coverity issue with -1 returned by findOffset not being handled by getPreferredTag
  fix possibility of access to *storedType without initialization
  Fix coverity issue with -1 returned by findOffset not being handled by getPreferredTag
  5.4.21 release date
  fix argument type & remove warning
  fix const warnings in intl methods
  When src->src is null this doesn't get initialized but it is still used, so the passed in *ze will point to unitialized memory. Hopefully src->src is never null, but just in case this initialization doesn't hurt.
  Fix coverity issue with -1 returned by findOffset not being handled by getPreferredTag
  ...
  • Loading branch information
Yasuo Ohgaki committed Oct 22, 2013
2 parents 09ed50f + b3a2b44 commit fa11c7c
Show file tree
Hide file tree
Showing 514 changed files with 13,887 additions and 7,520 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ before_script:
- . ./travis/ext/pdo_pgsql/setup.sh

# Run PHPs run-tests.php
script: ./sapi/cli/php run-tests.php -p `pwd`/sapi/cli/php -g "FAIL,XFAIL,BORK,WARN,LEAK,SKIP" --show-diff
script: ./sapi/cli/php run-tests.php -p `pwd`/sapi/cli/php -g "FAIL,XFAIL,BORK,WARN,LEAK,SKIP" --show-diff --set-timeout 120
2 changes: 1 addition & 1 deletion CODING_STANDARDS
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ Naming Conventions

7. Classes should be given descriptive names. Avoid using abbreviations where
possible. Each word in the class name should start with a capital letter,
without underscore delimiters (CampelCaps starting with a capital letter).
without underscore delimiters (CamelCaps starting with a capital letter).
The class name should be prefixed with the name of the 'parent set' (e.g.
the name of the extension)::

Expand Down
55 changes: 43 additions & 12 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,28 @@ PHP NEWS
. Improved IS_VAR operands fetching. (Laruence, Dmitry)
. Implemented internal operator overloading
(RFC: https://wiki.php.net/rfc/operator_overloading_gmp). (Nikita)
. Made calls from incompatible context issue an E_DEPRECATED warning instead
of E_STRICT (phase 1 of RFC: https://wiki.php.net/rfc/incompat_ctx).
(Gustavo)
. Uploads equal or greater than 2GB in size are now accepted.
(Ralf Lang, Mike)
. Reduced POST data memory usage by 200-300%. Removed INI setting
always_populate_raw_post_data and the $HTTP_RAW_POST_DATA global
variable. (Mike)
. Implemented dedicated syntax for variadic functions
(RFC: https://wiki.php.net/rfc/variadics). (Nikita)

- Session:
. Fixed Bug #65315 (session.hash_function silently fallback to default md5)
(Yasuo)
. Implemented Request #54649 (Create session_serializer_name()). (Yasuo)
. Implemented Request #17860 (Session write short circuit). (Yasuo)
. Implemented Request #20421 (session_abort() and session_reset() function).
(Yasuo)
. Implemented Request #11100 (session_gc() function). (Yasuo)
- cURL:
. Implemented FR #65646 (re-enable CURLOPT_FOLLOWLOCATION with open_basedir
or safe_mode). (Adam)

- GMP:
. Moved GMP to use object as the underlying structure and implemented various
improvements based on this.
(RFC: https://wiki.php.net/rfc/operator_overloading_gmp). (Nikita)

- Hash:
. Added gost-crypto (CryptoPro S-box) GOST hash algo. (Manuel Mausz)

- mysqlnd:
. Disabled flag for SP OUT variables for 5.5+ servers as they are not natively
Expand All @@ -27,14 +40,32 @@ PHP NEWS
cache_slots) in op_array->literals table. (Laruence, Dmitry)
. Added script level constant replacement optimization pass. (Dmitry)

- Openssl:
. Added crypto_method option for the ssl stream context. (Martin Jansen)
. Added certificate fingerprint support. (Tjerk Meesters)
. Added explicit TLSv1.1 and TLSv1.2 stream transports. (Daniel Lowrey)
. Fixed bug #65729 (CN_match gives false positive). (Tjerk Meesters)

- PDO_pgsql:
. Fixed Bug #42614 (PDO_pgsql: add pg_get_notify support). (Matteo)
. Fixed Bug #63657 (pgsqlCopyFromFile, pgsqlCopyToArray use Postgres < 7.3
syntax). (Matteo)

- GMP:
. Moved GMP to use object as the underlying structure and implemented various
improvements based on this.
(RFC: https://wiki.php.net/rfc/operator_overloading_gmp). (Nikita)
- Session:
. Fixed Bug #65315 (session.hash_function silently fallback to default md5)
(Yasuo)
. Implemented Request #54649 (Create session_serializer_name()). (Yasuo)
. Implemented Request #17860 (Session write short circuit). (Yasuo)
. Implemented Request #20421 (session_abort() and session_reset() function).
(Yasuo)
. Implemented Request #11100 (session_gc() function). (Yasuo)

- Standard:
. Implemented FR #65634 (HTTP wrapper is very slow with protocol_version
1.1). (Adam)

- XMLReader:
. Fixed bug #55285 (XMLReader::getAttribute/No/Ns methods inconsistency).
(Mike)

<<< NOTE: Insert NEWS from last stable release here prior to actual release! >>>
5 changes: 5 additions & 0 deletions README.EXT_SKEL
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ HOW TO USE IT

./buildconf; ./configure --enable-module_name; make

The definition of PHP_MODULE_NAME_VERSION will be present in the
php_module_name.h and injected into the zend_module_entry definition. This
is required by the PECL website for the version string conformity checks
against package.xml

But if you already have planned the overall scheme of your module, what
functions it will contain, their return types and the arguments they take
(a very good idea) and don't want to bother yourself with creating function
Expand Down
15 changes: 15 additions & 0 deletions README.SELF-CONTAINED-EXTENSIONS
Original file line number Diff line number Diff line change
Expand Up @@ -153,3 +153,18 @@ ADDING SHARED MODULE SUPPORT TO A MODULE
#ifdef COMPILE_DL_FOO
ZEND_GET_MODULE(foo)
#endif

PECL SITE CONFORMITY

If you plan to release an extension to the PECL website, there are several
points to be regarded.

1. Add LICENSE or COPYING to the package.xml

2. The following should be defined in one of the extension header files

#define PHP_FOO_VERSION "1.2.3"

This macros has to be used within your foo_module_entry to indicate the
extension version.

36 changes: 36 additions & 0 deletions UPGRADING
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,32 @@ PHP X.Y UPGRADE NOTES
1. Backward Incompatible Changes
========================================

- Core:
Removed $HTTP_RAW_POST_DATA global variable. Restore backwards compatibility
by:
<?php
global $HTTP_RAW_POST_DATA;
if (!isset($HTTP_RAW_POST_DATA)) {
$HTTP_RAW_POST_DATA = file_get_contents("php://input");
}
?>

========================================
2. New Features
========================================

- Added dedicated syntax for variadic functions.
(https://wiki.php.net/rfc/variadics)

- The php://input stream is now re-usable and can be used concurrently with
enable_post_data_reading=0.

- Added gost-crypto (CryptoPro S-box) hash algo.

- Added openssl certificate fingerprint support (inclusive stream context
option).

- Added openssl crypto method stream context option.

========================================
2. Changes in SAPI modules
Expand All @@ -35,6 +56,9 @@ PHP X.Y UPGRADE NOTES
3. Deprecated Functionality
========================================

- Incompatible context calls:
Instance calls from an incompatible context are now deprecated and issue
E_DEPRECATED instead of E_STRICT. See https://wiki.php.net/rfc/incompat_ctx

========================================
4. Changed Functions
Expand All @@ -44,10 +68,16 @@ PHP X.Y UPGRADE NOTES
CURLOPT_SAFE_UPLOAD is now turned on by default and uploads with @file
do not work unless it is explicitly set to false.

- XMLReader:
XMLReader::getAttributeNs and XMLReader::getAttributeNo now return NULL if
the attribute could not be found, just like XMLReader::getAttribute.

========================================
5. New Functions
========================================

- Openssl:
Added string openssl_x509_fingerprint($x509, $type, $binary).

========================================
6. New Classes and Interfaces
Expand Down Expand Up @@ -88,10 +118,16 @@ PHP X.Y UPGRADE NOTES
10. Changes to INI File Handling
========================================

- Core:
Removed always_populate_raw_post_data.

========================================
11. Other Changes
========================================

- File upload:
Uploads equal or greater than 2GB in size are now accepted.

- HTTP stream wrapper:
HTTP 1.1 requests now include a Connection: close header unless explicitly
overridden by setting a Connection header via the header context option.
67 changes: 67 additions & 0 deletions UPGRADING.INTERNALS
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ UPGRADE NOTES - PHP X.Y

1. Internal API changes
a. Addition of do_operation and compare object handlers
b. return_value_ptr now always available, RETVAL_ZVAL_FAST macros
c. POST data handling
d. Arginfo changes

2. Build system changes
a. Unix build system changes
Expand Down Expand Up @@ -43,6 +46,70 @@ UPGRADE NOTES - PHP X.Y

Further docs in the RFC: https://wiki.php.net/rfc/operator_overloading_gmp

b. return_value_ptr now always available, RETVAL_ZVAL_FAST macros

The return_value_ptr argument to internal functions is now always set.
Previously it was only available for functions returning by-reference.
return_value_ptr can now be used to return zvals without copying them.
For this purpose two new macros are provided:

RETVAL_ZVAL_FAST(zv); /* analog to RETVAL_ZVAL(zv, 1, 0) */
RETURN_ZVAL_FAST(zv); /* analog to RETURN_ZVAL(zv, 1, 0) */

The macros behave similarly to the non-FAST variants with copy=1 and
dtor=0, but will try to return the zval without making a copy by utilizing
return_value_ptr.

c. POST data handling

The sapi_request_info's members post_data, post_data_len and raw_post_data as
well as raw_post_data_len have been replaced with a temp PHP stream
request_body.

The recommended way to access raw POST data is to open and use a php://input
stream wrapper. It is safe to be used concurrently and more than once.

d. Arginfo changes

The pass_rest_by_reference argument of the ZEND_BEGIN_ARG_INFO and
ZEND_BEGIN_ARG_INFO_EX() is no longer used. The value passed to it is ignored.

Instead a variadic argument is created using ZEND_ARG_VARIADIC_INFO():

ZEND_ARG_VARIADIC_INFO(0, name) /* pass rest by value */
ZEND_ARG_VARIADIC_INFO(1, name) /* pass rest by reference */
ZEND_ARG_VARIADIC_INFO(ZEND_SEND_PREFER_REF, name)
/* pass rest by prefer-ref */

ZEND_ARG_VARIADIC_INFO() should only be used for the last argument.

The following changes were applied to the zend_arg_info struct:

typedef struct _zend_arg_info {
const char *class_name;
zend_uint class_name_len;
zend_uchar type_hint;
+ zend_uchar pass_by_reference;
zend_bool allow_null;
- zend_bool pass_by_reference;
+ zend_bool is_variadic;
} zend_arg_info;

The following changes were applied to the zend_internal_function_info struct:

typedef struct _zend_internal_function_info {
zend_uint required_num_args;
zend_uchar _type_hint;
zend_bool return_reference;
- zend_bool pass_rest_by_reference;
+ zend_bool _allow_null;
+ zend_bool _is_variadic;
} zend_internal_function_info;

The CHECK_ARG_SEND_TYPE(), ARG_MUST_BE_SENT_BY_REF(),
ARG_SHOULD_BE_SENT_BY_REF() and ARG_MAY_BE_SENT_BY_REF() macros now assume
that the argument passed to them is a zend_function* and that it is non-NULL.

========================
2. Build system changes
========================
Expand Down
6 changes: 3 additions & 3 deletions Zend/RFCs/003.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ Modified: 2001-09-17
1. Background/Need
==================

Many internal function of PHP will reject parameters because of their
Many internal functions of PHP will reject parameters because of their
type (the array and variable function come to mind). For userland
this is not an easy task as there is no uniform way to do it. An
addition to the engine for requiring loose types would allow
delevopers to know that the data passed to their functions is of the
developers to know that the data passed to their functions are of the
correct type and reduce the need for duplicating the same code in
every function to check for the type of data.

Expand Down Expand Up @@ -57,7 +57,7 @@ function foo (array $var){
===========

Mis-matches in type should be reported as fatal errors and should halt
the execution of a script as that function can not be run and code
the execution of a script as that function cannot be run and code
following could not reliably run.


Expand Down
2 changes: 1 addition & 1 deletion Zend/acinclude.m4
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ AC_DEFUN([LIBZEND_BISON_CHECK],[
# non-working versions, e.g. "3.0 3.2";
# remove "none" when introducing the first incompatible bison version an
# separate any following additions by spaces
bison_version_exclude="none"
bison_version_exclude="3.0"
# for standalone build of Zend Engine
test -z "$SED" && SED=sed
Expand Down
30 changes: 30 additions & 0 deletions Zend/tests/bug60598.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
--TEST--
Bug #60598 (cli/apache sapi segfault on objects manipulation)
--FILE--
<?php
define('OBJECT_COUNT', 10000);

$containers = array();

class Object {
protected $_guid = 0;
public function __construct() {
global $containers;
$this->guid = 1;
$containers[spl_object_hash($this)] = $this;
}
public function __destruct() {
global $containers;
$containers[spl_object_hash($this)] = NULL;
}
}

for ($i = 0; $i < OBJECT_COUNT; ++$i) {
new Object();
}

// You probably won't see this because of the "zend_mm_heap corrupted"
?>
If you see this, try to increase OBJECT_COUNT to 100,000
--EXPECT--
If you see this, try to increase OBJECT_COUNT to 100,000
47 changes: 47 additions & 0 deletions Zend/tests/bug64896.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
--TEST--
Bug #64896 (Segfault with gc_collect_cycles using unserialize on certain objects)
--XFAIL--
We can not fix this bug without a significant (performace slow down) change to gc
--FILE--
<?php
$bar = NULL;
class bad
{
private $_private = array();

public function __construct()
{
$this->_private[] = 'php';
}

public function __destruct()
{
global $bar;
$bar = $this;
}
}

$foo = new stdclass;
$foo->foo = $foo;
$foo->bad = new bad;

gc_disable();

unserialize(serialize($foo));
gc_collect_cycles();
var_dump($bar);
/* will output:
object(bad)#4 (1) {
["_private":"bad":private]=>
&UNKNOWN:0
}
*/
?>
--EXPECTF--
bject(bad)#%d (1) {
["_private":"bad":private]=>
array(1) {
[0]=>
string(3) "php"
}
}
Loading

0 comments on commit fa11c7c

Please sign in to comment.