summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerick Rethans <github@derickrethans.nl>2012-10-04 08:39:21 +0100
committerDerick Rethans <github@derickrethans.nl>2012-10-04 08:39:21 +0100
commit34eb787828d3ef7a773464ace6db40444dcef9a3 (patch)
treecf31114fe2cb673b9042eb6ff1df9954ecf54a31
parentab62ffa0a2467d8781aca65bd11dbfc034de7c64 (diff)
parent9e3396b85dc5e21fefbe43e161ecf25292da6b8e (diff)
downloadphp-git-34eb787828d3ef7a773464ace6db40444dcef9a3.tar.gz
Merge branch 'PHP-5.4' of git.php.net:/php-src into PHP-5.4
-rw-r--r--.gdbinit72
-rw-r--r--CODING_STANDARDS6
-rw-r--r--NEWS100
-rw-r--r--README.RELEASE_PROCESS37
-rw-r--r--Zend/tests/bug51394.phpt6
-rw-r--r--Zend/tests/bug60909_1.phpt24
-rw-r--r--Zend/tests/bug60909_2.phpt20
-rwxr-xr-xZend/tests/bug61761.phpt3
-rw-r--r--Zend/tests/bug61767.phpt34
-rw-r--r--Zend/tests/bug62907.phpt22
-rw-r--r--Zend/tests/bug62956.phpt20
-rw-r--r--Zend/tests/bug63111.phpt36
-rw-r--r--Zend/tests/bug63173.phpt12
-rw-r--r--Zend/zend.c23
-rw-r--r--Zend/zend_API.c13
-rw-r--r--Zend/zend_alloc.c6
-rw-r--r--Zend/zend_closures.c2
-rw-r--r--Zend/zend_compile.c12
-rw-r--r--Zend/zend_compile.h2
-rw-r--r--Zend/zend_object_handlers.c1
-rw-r--r--Zend/zend_opcode.c15
-rw-r--r--Zend/zend_operators.c3
-rw-r--r--Zend/zend_vm_def.h4
-rw-r--r--Zend/zend_vm_execute.h16
-rw-r--r--Zend/zend_vm_execute.skl2
-rw-r--r--Zend/zend_vm_gen.php7
-rw-r--r--configure.in2
-rw-r--r--ext/curl/interface.c16
-rw-r--r--ext/curl/multi.c3
-rw-r--r--ext/curl/streams.c4
-rw-r--r--ext/curl/tests/bug62839.phpt2
-rw-r--r--ext/date/lib/astro.c2
-rw-r--r--ext/date/lib/dow.c2
-rw-r--r--ext/date/lib/interval.c2
-rw-r--r--ext/date/lib/parse_date.c102
-rw-r--r--ext/date/lib/parse_date.re4
-rw-r--r--ext/date/lib/parse_iso_intervals.c2
-rw-r--r--ext/date/lib/parse_iso_intervals.re2
-rw-r--r--ext/date/lib/parse_tz.c2
-rw-r--r--ext/date/lib/timelib.c2
-rw-r--r--ext/date/lib/timelib.h2
-rw-r--r--ext/date/lib/timelib_structs.h2
-rw-r--r--ext/date/lib/tm2unixtime.c2
-rw-r--r--ext/date/lib/unixtime2tm.c2
-rw-r--r--ext/date/php_date.c16
-rw-r--r--ext/date/tests/bug62561.phpt16
-rw-r--r--ext/date/tests/bug62852.phpt33
-rw-r--r--ext/date/tests/bug62896.phpt40
-rw-r--r--ext/dba/libcdb/cdb.c2
-rw-r--r--ext/dba/libcdb/cdb.h2
-rw-r--r--ext/dba/libcdb/cdb_make.c2
-rw-r--r--ext/dba/libcdb/cdb_make.h2
-rw-r--r--ext/dba/libcdb/uint32.c2
-rw-r--r--ext/dba/libcdb/uint32.h2
-rw-r--r--ext/dba/libflatfile/flatfile.c2
-rw-r--r--ext/dba/libflatfile/flatfile.h2
-rw-r--r--ext/dba/libinifile/inifile.c2
-rw-r--r--ext/dba/libinifile/inifile.h2
-rw-r--r--ext/dom/domerrorhandler.c2
-rw-r--r--ext/fileinfo/libmagic.patch305
-rw-r--r--ext/fileinfo/libmagic/apprentice.c8
-rw-r--r--ext/filter/filter_private.h6
-rw-r--r--ext/filter/logical_filters.c7
-rw-r--r--ext/filter/tests/bug49510.phpt36
-rw-r--r--ext/gd/libgd/xbm.c2
-rw-r--r--ext/intl/common/common_error.c2
-rw-r--r--ext/intl/dateformat/dateformat_class.c2
-rw-r--r--ext/intl/formatter/formatter_class.c2
-rw-r--r--ext/intl/msgformat/msgformat_class.c2
-rw-r--r--ext/intl/php_intl.c4
-rw-r--r--ext/intl/spoofchecker/spoofchecker_class.c2
-rw-r--r--ext/intl/tests/bug62915-2.phpt33
-rw-r--r--ext/intl/transliterator/transliterator_class.c2
-rw-r--r--ext/mbstring/mbstring.c16
-rw-r--r--ext/mbstring/tests/mb_str_functions_opt-parameter.phpt2
-rw-r--r--ext/oci8/config.m48
-rw-r--r--ext/oci8/package.xml29
-rw-r--r--ext/openssl/openssl.c32
-rw-r--r--ext/pcre/php_pcre.c32
-rw-r--r--ext/pcre/tests/null_bytes.phpt42
-rw-r--r--ext/soap/php_encoding.c7
-rw-r--r--ext/soap/tests/bugs/bug50997.phpt16
-rw-r--r--ext/soap/tests/bugs/bug50997.wsdl54
-rw-r--r--ext/sockets/multicast.h5
-rw-r--r--ext/sockets/tests/bug63000.phpt22
-rwxr-xr-xext/spl/spl_array.c80
-rwxr-xr-xext/spl/spl_iterators.c2
-rw-r--r--ext/spl/tests/RecursiveDirectoryIterator_getSubPath_basic.phpt50
-rw-r--r--ext/spl/tests/RecursiveDirectoryIterator_getSubPathname_basic.phpt56
-rw-r--r--ext/spl/tests/arrayObject___construct_basic2.phpt4
-rw-r--r--ext/spl/tests/arrayObject___construct_basic3.phpt4
-rw-r--r--ext/spl/tests/arrayObject___construct_basic4.phpt10
-rw-r--r--ext/spl/tests/arrayObject___construct_basic5.phpt10
-rw-r--r--ext/spl/tests/arrayObject_magicMethods1.phpt4
-rw-r--r--ext/spl/tests/arrayObject_magicMethods3.phpt4
-rw-r--r--ext/spl/tests/arrayObject_magicMethods4.phpt4
-rw-r--r--ext/spl/tests/arrayObject_magicMethods6.phpt4
-rw-r--r--ext/spl/tests/arrayObject_setFlags_basic1.phpt4
-rwxr-xr-xext/spl/tests/array_001.phpt8
-rwxr-xr-xext/spl/tests/array_010.phpt8
-rw-r--r--ext/spl/tests/bug45622.phpt2
-rw-r--r--ext/spl/tests/bug45622b.phpt4
-rw-r--r--ext/spl/tests/bug54323.phpt2
-rw-r--r--ext/spl/tests/bug62978.phpt50
-rwxr-xr-xext/spl/tests/iterator_044.phpt16
-rw-r--r--ext/standard/assert.c48
-rw-r--r--ext/standard/tests/assert/assert04.phpt5
-rw-r--r--ext/standard/tests/assert/assert_basic6.phpt26
-rw-r--r--ext/standard/tests/assert/assert_error1.phpt11
-rw-r--r--ext/standard/tests/assert/assert_error2.phpt30
-rw-r--r--ext/standard/tests/assert/assert_error3.phpt21
-rw-r--r--ext/standard/tests/assert/assert_error4.phpt21
-rw-r--r--ext/standard/tests/general_functions/bug60723.phpt19
-rw-r--r--ext/standard/tests/network/gethostbyname_basic001.phpt1
-rw-r--r--ext/standard/tests/network/gethostbyname_basic002.phpt15
-rw-r--r--ext/standard/tests/network/gethostbyname_error004.phpt1
-rw-r--r--ext/standard/tests/network/getmxrr.phpt1
-rw-r--r--ext/standard/tests/serialize/bug35895.phpt24
-rw-r--r--ext/standard/tests/strings/http_build_query_error.phpt13
-rw-r--r--ext/standard/tests/url/bug63162.phpt38
-rw-r--r--ext/standard/url.c2
-rw-r--r--ext/standard/url_scanner_ex.c4
-rw-r--r--ext/standard/url_scanner_ex.re4
-rw-r--r--ext/standard/var.c8
-rw-r--r--ext/zlib/tests/bug55544-win.phptbin0 -> 427 bytes
-rw-r--r--ext/zlib/tests/bug55544.phptbin361 -> 430 bytes
-rw-r--r--ext/zlib/tests/bug_52944-darwin.phpt24
-rw-r--r--ext/zlib/tests/bug_52944-win.phpt24
-rw-r--r--ext/zlib/tests/bug_52944.phpt189
-rw-r--r--ext/zlib/tests/bug_52944_corrupted_data.inc142
-rw-r--r--main/main.c11
-rw-r--r--main/output.c2
-rw-r--r--main/php_version.h6
-rw-r--r--netware/start.c2
-rwxr-xr-xrun-tests.php5
-rw-r--r--sapi/cli/cli.h2
-rw-r--r--sapi/cli/php_cli_server.c41
-rw-r--r--sapi/cli/php_http_parser.c10
-rw-r--r--sapi/cli/php_http_parser.h3
-rw-r--r--sapi/cli/tests/bug61679.phpt43
-rw-r--r--sapi/cli/tests/php_cli_server_018.phpt44
-rw-r--r--sapi/fpm/config.m46
-rw-r--r--sapi/fpm/fpm/fastcgi.c2
-rw-r--r--sapi/fpm/fpm/fastcgi.h2
-rw-r--r--sapi/fpm/fpm/fpm.c6
-rw-r--r--sapi/fpm/fpm/fpm.h4
-rw-r--r--sapi/fpm/fpm/fpm_conf.c11
-rw-r--r--sapi/fpm/fpm/fpm_conf.h2
-rw-r--r--sapi/fpm/fpm/fpm_main.c40
-rw-r--r--sapi/fpm/fpm/fpm_php_trace.c2
-rw-r--r--sapi/fpm/fpm/fpm_process_ctl.c8
-rw-r--r--sapi/fpm/fpm/fpm_request.c4
-rw-r--r--sapi/fpm/fpm/fpm_scoreboard.c5
-rw-r--r--sapi/fpm/fpm/fpm_scoreboard.h3
-rw-r--r--sapi/fpm/fpm/fpm_signals.c12
-rw-r--r--sapi/fpm/fpm/fpm_signals.h3
-rw-r--r--sapi/fpm/fpm/fpm_sockets.c2
-rw-r--r--sapi/fpm/fpm/fpm_status.c31
-rw-r--r--sapi/fpm/fpm/fpm_unix.c91
-rw-r--r--sapi/fpm/init.d.php-fpm.in4
-rw-r--r--sapi/fpm/php-fpm.8.in23
-rw-r--r--sapi/fpm/php-fpm.service.in12
-rw-r--r--sapi/litespeed/lsapi_main.c6
-rw-r--r--sapi/litespeed/lsapidef.h2
-rw-r--r--sapi/litespeed/lsapilib.c2
-rw-r--r--sapi/litespeed/lsapilib.h2
-rw-r--r--tests/lang/compare_objects_basic2.phpt8
-rw-r--r--win32/build/deplister.c2
-rw-r--r--win32/build/libs_version.txt16
-rw-r--r--win32/build/template.rc2
-rw-r--r--win32/registry.c9
171 files changed, 2054 insertions, 892 deletions
diff --git a/.gdbinit b/.gdbinit
index 4a26d9608b..e7a565dfa9 100644
--- a/.gdbinit
+++ b/.gdbinit
@@ -1,6 +1,19 @@
+define set_ts
+ set $tsrm_ls = $arg0
+end
+
+document set_ts
+ set the ts resource, it is impossible for gdb to
+ call ts_resource_ex while no process is running,
+ but we could get the resource from the argument
+ of frame info.
+end
+
define ____executor_globals
if basic_functions_module.zts
- set $tsrm_ls = ts_resource_ex(0, 0)
+ if !$tsrm_ls
+ set $tsrm_ls = ts_resource_ex(0, 0)
+ end
set $eg = ((zend_executor_globals*) (*((void ***) $tsrm_ls))[executor_globals_id-1])
set $cg = ((zend_compiler_globals*) (*((void ***) $tsrm_ls))[compiler_globals_id-1])
else
@@ -38,12 +51,53 @@ define dump_bt
set $t = $arg0
while $t
printf "[%p] ", $t
- if $t->function_state.function->common.function_name
- if $t->function_state.arguments
- set $count = (int)*($t->function_state.arguments)
- printf "%s(", $t->function_state.function->common.function_name
+ set $fst = $t->function_state
+ if $fst.function->common.function_name
+ if $fst.arguments
+ set $count = (int)*($fst.arguments)
+
+ if $t->object
+ if $fst.function.common.scope
+ printf "%s->", $fst.function.common.scope->name
+ else
+ if !$eg
+ ____executor_globals
+ end
+
+ set $known_class = 0
+ if $eg
+ set $handle = $t->object.value.obj.handle
+ set $handlers = $t->object.value.obj.handlers
+ set $zobj = (zend_object *)$eg.objects_store.object_buckets[$handle].bucket.obj.object
+
+ if $handlers->get_class_entry == &zend_std_object_get_class
+ set $known_class = 1
+
+ if $handlers.get_class_name
+ if $handlers.get_class_name != &zend_std_object_get_class_name
+ set $known_class = 0
+ end
+ end
+
+ if $known_class
+ printf "%s->", $zobj->ce.name
+ end
+ end
+ end
+
+ if !$known_class
+ printf "(Unknown)->"
+ end
+ end
+ else
+ if $fst.function.common.scope
+ printf "%s::", $fst.function.common.scope->name
+ end
+ end
+
+ printf "%s(", $fst.function->common.function_name
while $count > 0
- set $zvalue = *(zval **)($t->function_state.arguments - $count)
+ set $zvalue = *(zval **)($fst.arguments - $count)
set $type = $zvalue->type
if $type == 0
printf "NULL"
@@ -73,7 +127,7 @@ define dump_bt
if $type == 7
printf "resource(#%d)", $zvalue->value.lval
end
- if $type == 8
+ if $type == 8
printf "constant"
end
if $type == 9
@@ -89,7 +143,7 @@ define dump_bt
end
printf ") "
else
- printf "%s() ", $t->function_state.function->common.function_name
+ printf "%s() ", $fst.function->common.function_name
end
else
printf "??? "
@@ -600,7 +654,7 @@ define zmemcheck
end
end
if $not_found
- printf "no such block that begins at %p.\n", $aptr
+ printf "no such block that begins at %p.\n", $aptr
end
if $arg0 == 0
printf "-------------------------------------------------------------------------------\n"
diff --git a/CODING_STANDARDS b/CODING_STANDARDS
index ae8ee04190..7413be453c 100644
--- a/CODING_STANDARDS
+++ b/CODING_STANDARDS
@@ -2,11 +2,11 @@
PHP Coding Standards
========================
-This file lists several standards that any programmer, adding or changing
-code in PHP, should follow. Since this file was added at a very late
+This file lists several standards that any programmer adding or changing
+code in PHP should follow. Since this file was added at a very late
stage of the development of PHP v3.0, the code base does not (yet) fully
follow it, but it's going in that general direction. Since we are now
-well into the version 4 releases, many sections have been recoded to use
+well into version 5 releases, many sections have been recoded to use
these rules.
Code Implementation
diff --git a/NEWS b/NEWS
index b51f28e821..1924864f5b 100644
--- a/NEWS
+++ b/NEWS
@@ -1,8 +1,84 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-?? ??? 2012, PHP 5.4.7
+?? ??? 2012, PHP 5.4.9
+
+?? ??? 2012, PHP 5.4.8
+
+- CLI server:
+ . Changed response to unknown HTTP method to 501 according to RFC.
+ (Niklas Lindgren).
+ . Support HTTP PATCH method. Patch by Niklas Lindgren, GitHub PR #190.
+ (Lars)
+
+- Core:
+ . Added optional second argument for assert() to specify custom message. Patch
+ by Lonny Kapelushnik (lonny@lonnylot.com). (Lars)
+ . Support building PHP with the native client toolchain. (Stuart Langley)
+ . Added --offline option for tests. (Remi)
+ . Fixed bug #63162 (parse_url does not match password component). (husman)
+ . Fixed bug #63111 (is_callable() lies for abstract static method). (Dmitry)
+ . Fixed bug #63093 (Segfault while load extension failed in zts-build).
+ (Laruence)
+ . Fixed bug #62976 (Notice: could not be converted to int when comparing
+ some builtin classes). (Laruence)
+ . Fixed bug #62955 (Only one directive is loaded from "Per Directory Values"
+ Windows registry). (aserbulov at parallels dot com)
+ . Fixed bug #62907 (Double free when use traits). (Dmitry)
+ . Fixed bug #61767 (Shutdown functions not called in certain error
+ situation). (Dmitry)
+ . Fixed bug #60909 (custom error handler throwing Exception + fatal error
+ = no shutdown function). (Dmitry)
+ . Fixed bug #60723 (error_log error time has changed to UTC ignoring default
+ timezone). (Laruence)
+
+- cURL:
+ . Fixed bug #62085 (file_get_contents a remote file by Curl wrapper will
+ cause cpu Soaring). (Pierrick)
+
+- Date:
+ . Fixed bug #62896 ("DateTime->modify('+0 days')" modifies DateTime object)
+ (Lonny Kapelushnik)
+ . Fixed bug #62561 (DateTime add 'P1D' adds 25 hours). (Lonny Kapelushnik)
+
+- DOM:
+ . Fixed bug #63015 (Incorrect arginfo for DOMErrorHandler). (Rob)
+
+- FPM:
+ . Fixed bug #62954 (startup problems fpm / php-fpm). (fat)
+ . Fixed bug #62886 (PHP-FPM may segfault/hang on startup). (fat)
+ . Fixed bug #63085 (Systemd integration and daemonize). (remi, fat)
+ . Fixed bug #62947 (Unneccesary warnings on FPM). (fat)
+ . Fixed bug #62887 (Only /status?plain&full gives "last request cpu"). (fat)
+ . Fixed bug #62216 (Add PID to php-fpm init.d script). (fat)
+
+- OpenSSL:
+ . Implemented FR #61421 (OpenSSL signature verification missing RMD160,
+ SHA224, SHA256, SHA384, SHA512). (Mark Jones)
+
+- SOAP
+ . Fixed bug #50997 (SOAP Error when trying to submit 2nd Element of a choice).
+ (Dmitry)
+
+- SPL:
+ . Bug #62987 (Assigning to ArrayObject[null][something] overrides all
+ undefined variables). (Laruence)
+
+- mbstring:
+ . Allow passing null as a default value to mb_substr() and mb_strcut(). Patch
+ by Alexander Moskaliov via GitHub PR #133. (Lars)
+
+- Filter extension:
+ . Bug #49510: Boolean validation fails with FILTER_NULL_ON_FAILURE with empty
+ string or false. (Lars)
+
+- Sockets
+ . Fixed bug #63000 (MCAST_JOIN_GROUP on OSX is broken, merge of PR 185 by
+ Igor Wiedler). (Lars)
+
+13 Sep 2012, PHP 5.4.7
- Core:
+ . Fixed bug (segfault while build with zts and GOTO vm-kind). (Laruence)
. Fixed bug #62844 (parse_url() does not recognize //). (Andrew Faulds).
. Fixed bug #62829 (stdint.h included on platform where HAVE_STDINT_H is not
set). (Felipe)
@@ -22,15 +98,22 @@ PHP NEWS
constructor). (Stas)
- CURL:
+ . Fixed bug #62912 (CURLINFO_PRIMARY_* AND CURLINFO_LOCAL_* not exposed).
+ (Pierrick)
. Fixed bug #62839 (curl_copy_handle segfault with CURLOPT_FILE). (Pierrick)
-- DateTime:
- . Fixed bug #62852 (Unserialize invalid DateTime causes crash).
- (reeze.xia@gmail.com)
+- Intl:
+ . Fixed Spoofchecker not being registered on ICU 49.1. (Gustavo)
+ . Fix bug #62933 (ext/intl compilation error on icu 3.4.1). (Gustavo)
+ . Fix bug #62915 (defective cloning in several intl classes). (Gustavo)
- Installation:
. Fixed bug #62460 (php binaries installed as binary.dSYM). (Reeze Xia)
+- PCRE:
+ . Fixed bug #55856 (preg_replace should fail on trailing garbage).
+ (reg dot php at alf dot nu)
+
- PDO:
. Fixed bug #62685 (Wrong return datatype in PDO::inTransaction()). (Laruence)
@@ -45,6 +128,10 @@ PHP NEWS
. Fixed bug (segfault due to PS(mod_user_implemented) not be reseted
when close handler call exit). (Laruence)
+- SOAP
+ . Fixed bug #50997 (SOAP Error when trying to submit 2nd Element of a choice).
+ (Dmitry)
+
- SPL:
. Fixed bug #62904 (Crash when cloning an object which inherits SplFixedArray)
(Laruence)
@@ -54,6 +141,9 @@ PHP NEWS
. Fixed bug #62836 (Seg fault or broken object references on unserialize()).
(Laruence)
+- FPM:
+ . Merged PR 121 by minitux to add support for slow request counting on PHP
+ FPM status page. (Lars)
16 Aug 2012, PHP 5.4.6
@@ -188,7 +278,7 @@ PHP NEWS
- Sockets:
. Fixed bug #62025 (__ss_family was changed on AIX 5.3). (Felipe)
-
+
- SPL:
. Fixed bug #62433 (Inconsistent behavior of RecursiveDirectoryIterator to
dot files). (Laruence)
diff --git a/README.RELEASE_PROCESS b/README.RELEASE_PROCESS
index a8e36c2b6f..3fa944ee3b 100644
--- a/README.RELEASE_PROCESS
+++ b/README.RELEASE_PROCESS
@@ -127,33 +127,34 @@ Rolling a stable release
2. Bump the version numbers in ``main/php_version.h``, ``configure.in`` and possibly ``NEWS``.
-3. **Merge** all related sections in NEWS (f.e. merge the 4.4.1RC1 and 4.4.0 sections)
+3. **Merge** all related sections in NEWS (f.e. merge the 5.4.1RC1 and 5.4.0 sections)
4. Commit those changes
5. run the "scripts/dev/credits" script in php-src and commit the changes in the
credits files in ext/standard.
-6. tag the repository with the version f.e. "``cvs tag php_4_4_1``"
+6. tag the repository with the version f.e. "``git tag -s php-5.4.1``"
(of course, you need to change that to the version you're rolling an RC for).
When making 5.X release, you need to tag the Zend directory separately!!
7. Bump up the version numbers in ``main/php_version.h``, ``configure.in`` and
possibly ``NEWS`` again, to the **next** version. F.e. if the release candidate
-was "4.4.1RC1" then the new one should be "4.4.1RC2-dev" - regardless if we get
+was "5.4.1RC1" then the new one should be "5.4.1RC2-dev" - regardless if we get
a new RC or not. This is to make sure ``version_compare()`` can correctly work.
8. Commit those changes
-9. Log in onto the snaps box and go into the correct tree (f.e. the PHP_4_4
-branch if you're rolling 4.4.x releases).
+9. Log in onto the snaps box and go into the correct tree (f.e. the PHP-5.4
+branch if you're rolling 5.5.x releases).
-10. You do not have to update the tree, but of course you can with "``cvs up -dP``".
+10. You do not have to update the tree, but of course you can with "``git pull
+origin <branch>``".
-11. run: ``./makedist php 4.4.1``, this will export the tree, create configure
+11. run: ``./makedist php 5.4.1``, this will export the tree, create configure
and build two tarballs (one gz and one bz2).
-12. Commit those two tarballs to CVS (phpweb/distributions)
+12. Commit those two tarballs to Git (php-distributions.git)
13. Once the release has been tagged, contact the PHP Windows development team
(internals-win@lists.php.net) so that Windows binaries can be created. Once
@@ -171,6 +172,9 @@ Getting the stable release announced
a. ``php bin/bumpRelease 5`` (or ``php bin/bumpRelease 4`` for PHP4)
+ b. In case multiple PHP minor versions are in active development you have
+ to manually copy the old information to include/releases.inc
+
2. Edit ``phpweb/include/version.inc`` and change (X=major release number):
a. ``$PHP_X_VERSION`` to the correct version
@@ -187,7 +191,7 @@ Getting the stable release announced
f. if the windows builds aren't ready yet prefix the "windows" key with a dot (".windows")
3. Update the ChangeLog file for the given major version
-f.e. ``ChangeLog-4.php`` from the NEWS file
+f.e. ``ChangeLog-5.php`` from the NEWS file
a. go over the list and put every element on one line
@@ -207,9 +211,9 @@ f.e. ``ChangeLog-4.php`` from the NEWS file
V. ``s/FR #\([0-9]\+\)/FR <?php bugl(\1); ?>/``
-4. ``cp releases/4_4_0.php releases/4_4_1.php``
+4. ``cp releases/5_4_0.php releases/5_4_1.php``
-5. ``cvs add releases/4_4_1.php``
+5. ``git add releases/5_4_1.php``
6. Update the ``releases/*.php`` file with relevant data. The release
announcement file should list in detail:
@@ -232,17 +236,6 @@ to upgrade.
php-general@lists.php.net and internals@lists.php.net with a text similar to
http://news.php.net/php.internals/17222.
-10. Update ``php-bugs-web/include/functions.php`` to include the new version
-number, and remove the RC from there.
-
-11. Update ``qaweb/include/release-qa.php``
-
- - Update $QA_RELEASES with the appropriate information, which means bumping
- the version number to an upcoming version.
-
- Example: If PHP 5.3.7 is being released, then PHP 5.3.8 is the next QA version,
- so replace 5.3.7 with 5.3.8 within $QA_RELEASES.
-
Re-releasing the same version (or -pl)
--------------------------------------
diff --git a/Zend/tests/bug51394.phpt b/Zend/tests/bug51394.phpt
index 537574c9d5..406de13a9b 100644
--- a/Zend/tests/bug51394.phpt
+++ b/Zend/tests/bug51394.phpt
@@ -13,4 +13,10 @@ function eh()
set_error_handler("eh");
$a = $empty($b);
--EXPECTF--
+Warning: Uncaught exception 'Exception' with message 'error!' in %sbug51394.php:4
+Stack trace:
+#0 %sbug51394.php(9): eh(8, 'Undefined varia...', '%s', 9, Array)
+#1 {main}
+ thrown in %sbug51394.php on line 4
+
Fatal error: Function name must be a string in %sbug51394.php on line 9 \ No newline at end of file
diff --git a/Zend/tests/bug60909_1.phpt b/Zend/tests/bug60909_1.phpt
new file mode 100644
index 0000000000..5150dfc025
--- /dev/null
+++ b/Zend/tests/bug60909_1.phpt
@@ -0,0 +1,24 @@
+--TEST--
+Bug #60909 (custom error handler throwing Exception + fatal error = no shutdown function).
+--FILE--
+<?php
+register_shutdown_function(function(){echo("\n\n!!!shutdown!!!\n\n");});
+set_error_handler(function($errno, $errstr, $errfile, $errline){
+ echo "error($errstr)";
+ throw new Exception("Foo");
+});
+
+require 'notfound.php';
+--EXPECTF--
+error(require(notfound.php): failed to open stream: No such file or directory)
+Warning: Uncaught exception 'Exception' with message 'Foo' in %sbug60909_1.php:5
+Stack trace:
+#0 %sbug60909_1.php(8): {closure}(2, 'require(notfoun...', '%s', 8, Array)
+#1 %sbug60909_1.php(8): require()
+#2 {main}
+ thrown in %sbug60909_1.php on line 5
+
+Fatal error: main(): Failed opening required 'notfound.php' (include_path='%s') in %sbug60909_1.php on line 8
+
+
+!!!shutdown!!!
diff --git a/Zend/tests/bug60909_2.phpt b/Zend/tests/bug60909_2.phpt
new file mode 100644
index 0000000000..d08d9f90fa
--- /dev/null
+++ b/Zend/tests/bug60909_2.phpt
@@ -0,0 +1,20 @@
+--TEST--
+Bug #60909 (custom error handler throwing Exception + fatal error = no shutdown function).
+--FILE--
+<?php
+register_shutdown_function(function(){echo("\n\n!!!shutdown!!!\n\n");});
+set_error_handler(function($errno, $errstr, $errfile, $errline){throw new Exception("Foo");});
+
+class Bad {
+ public function __toString() {
+ throw new Exception('Oops, I cannot do this');
+ }
+}
+
+$bad = new Bad();
+echo "$bad";
+--EXPECTF--
+Fatal error: Method Bad::__toString() must not throw an exception in %sbug60909_2.php on line 0
+
+
+!!!shutdown!!!
diff --git a/Zend/tests/bug61761.phpt b/Zend/tests/bug61761.phpt
index 631f566eaa..24c69ae792 100755
--- a/Zend/tests/bug61761.phpt
+++ b/Zend/tests/bug61761.phpt
@@ -14,5 +14,6 @@ class B extends A
}
?>
+==DONE==
--EXPECTF--
-Strict Standards: Declaration of B::test() should be compatible with A::test($a) in %sbug61761.php on line %d
+==DONE==
diff --git a/Zend/tests/bug61767.phpt b/Zend/tests/bug61767.phpt
new file mode 100644
index 0000000000..5270872e5d
--- /dev/null
+++ b/Zend/tests/bug61767.phpt
@@ -0,0 +1,34 @@
+--TEST--
+Bug #61767 (Shutdown functions not called in certain error situation)
+--FILE--
+<?php
+set_error_handler(function($code, $msg, $file = null, $line = null) {
+ echo "Error handler called ($msg)\n";
+ throw new \ErrorException($msg, $code, 0, $file, $line);
+});
+
+register_shutdown_function(function(){
+ echo "Shutting down\n";
+ print_r(error_get_last());
+});
+
+//$undefined = null; // defined variable does not cause problems
+$undefined->foo();
+--EXPECTF--
+Error handler called (Undefined variable: undefined)
+
+Warning: Uncaught exception 'ErrorException' with message 'Undefined variable: undefined' in %sbug61767.php:13
+Stack trace:
+#0 %sbug61767.php(13): {closure}(8, 'Undefined varia...', '%s', 13, Array)
+#1 {main}
+ thrown in %sbug61767.php on line 13
+
+Fatal error: Call to a member function foo() on a non-object in %sbug61767.php on line 13
+Shutting down
+Array
+(
+ [type] => 1
+ [message] => Call to a member function foo() on a non-object
+ [file] => %sbug61767.php
+ [line] => 13
+)
diff --git a/Zend/tests/bug62907.phpt b/Zend/tests/bug62907.phpt
new file mode 100644
index 0000000000..53ab17cb32
--- /dev/null
+++ b/Zend/tests/bug62907.phpt
@@ -0,0 +1,22 @@
+--TEST--
+Bug #62907 (Double free when use traits)
+--FILE--
+<?php
+function __autoload($name) {
+ if ($name == "B") {
+ eval ("abstract class B extends A { }");
+ } else if ($name == "A") {
+ eval ("abstract class A { use T { T::__construct as __asconstruct; }}");
+ } else if ($name == "T") {
+ eval ("trait T { public function __construct() { } }");
+ }
+ return TRUE;
+}
+
+class C extends B {
+ public function __construct() {
+ }
+}
+echo "okey";
+--EXPECT--
+okey
diff --git a/Zend/tests/bug62956.phpt b/Zend/tests/bug62956.phpt
new file mode 100644
index 0000000000..c8694d5bea
--- /dev/null
+++ b/Zend/tests/bug62956.phpt
@@ -0,0 +1,20 @@
+--TEST--
+Bug #62956: "incompatible" signatures for private methods should not cause E_STRICT
+--FILE--
+<?php
+class Base
+{
+ private function test()
+ {}
+}
+
+class Extension extends Base
+{
+ private function test($arg)
+ {}
+}
+
+?>
+==DONE==
+--EXPECT--
+==DONE==
diff --git a/Zend/tests/bug63111.phpt b/Zend/tests/bug63111.phpt
new file mode 100644
index 0000000000..3f19068668
--- /dev/null
+++ b/Zend/tests/bug63111.phpt
@@ -0,0 +1,36 @@
+--TEST--
+Bug #63111 (is_callable() lies for abstract static method)
+--FILE--
+<?php
+abstract class Foo {
+ abstract static function bar();
+}
+interface MyInterface {
+ static function bar();
+}
+abstract class Bar {
+ static function foo() {
+ echo "ok\n";
+ }
+}
+var_dump(is_callable(array("Foo", "bar")));
+var_dump(is_callable("Foo::bar"));
+var_dump(is_callable(array("MyInterface", "bar")));
+var_dump(is_callable("MyInterface::bar"));
+var_dump(is_callable(array("Bar", "foo")));
+var_dump(is_callable("Bar::foo"));
+Bar::foo();
+Foo::bar();
+?>
+--EXPECTF--
+Strict Standards: Static function Foo::bar() should not be abstract in %sbug63111.php on line 3
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(true)
+bool(true)
+ok
+
+Fatal error: Cannot call abstract method Foo::bar() in %sbug63111.php on line 20
+
diff --git a/Zend/tests/bug63173.phpt b/Zend/tests/bug63173.phpt
new file mode 100644
index 0000000000..36ebf203d2
--- /dev/null
+++ b/Zend/tests/bug63173.phpt
@@ -0,0 +1,12 @@
+--TEST--
+Bug #63173: Crash when invoking invalid array callback
+--FILE--
+<?php
+
+// the important part here are the indexes 1 and 2
+$callback = [1 => 0, 2 => 0];
+$callback();
+
+?>
+--EXPECTF--
+Fatal error: Array callback has to contain indices 0 and 1 in %s on line %d
diff --git a/Zend/zend.c b/Zend/zend.c
index 09338e7f83..9ab879a2a4 100644
--- a/Zend/zend.c
+++ b/Zend/zend.c
@@ -1028,6 +1028,29 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
zend_stack context_stack;
TSRMLS_FETCH();
+ /* Report about uncaught exception in case of fatal errors */
+ if (EG(exception)) {
+ switch (type) {
+ case E_CORE_ERROR:
+ case E_ERROR:
+ case E_RECOVERABLE_ERROR:
+ case E_PARSE:
+ case E_COMPILE_ERROR:
+ case E_USER_ERROR:
+ if (zend_is_executing(TSRMLS_C)) {
+ error_lineno = zend_get_executed_lineno(TSRMLS_C);
+ }
+ zend_exception_error(EG(exception), E_WARNING TSRMLS_CC);
+ EG(exception) = NULL;
+ if (zend_is_executing(TSRMLS_C) && EG(opline_ptr)) {
+ active_opline->lineno = error_lineno;
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
/* Obtain relevant filename and lineno */
switch (type) {
case E_CORE_ERROR:
diff --git a/Zend/zend_API.c b/Zend/zend_API.c
index a231415547..45abcf61e8 100644
--- a/Zend/zend_API.c
+++ b/Zend/zend_API.c
@@ -2265,7 +2265,9 @@ void module_destructor(zend_module_entry *module) /* {{{ */
/* Deinitilaise module globals */
if (module->globals_size) {
#ifdef ZTS
- ts_free_id(*module->globals_id_ptr);
+ if (*module->globals_id_ptr) {
+ ts_free_id(*module->globals_id_ptr);
+ }
#else
if (module->globals_dtor) {
module->globals_dtor(module->globals_ptr TSRMLS_CC);
@@ -2811,7 +2813,14 @@ get_function_via_handler:
if (retval) {
if (fcc->calling_scope && !call_via_handler) {
- if (!fcc->object_ptr && !(fcc->function_handler->common.fn_flags & ZEND_ACC_STATIC)) {
+ if (!fcc->object_ptr && (fcc->function_handler->common.fn_flags & ZEND_ACC_ABSTRACT)) {
+ if (error) {
+ zend_spprintf(error, 0, "cannot call abstract method %s::%s()", fcc->calling_scope->name, fcc->function_handler->common.function_name);
+ retval = 0;
+ } else {
+ zend_error(E_ERROR, "Cannot call abstract method %s::%s()", fcc->calling_scope->name, fcc->function_handler->common.function_name);
+ }
+ } else if (!fcc->object_ptr && !(fcc->function_handler->common.fn_flags & ZEND_ACC_STATIC)) {
int severity;
char *verb;
if (fcc->function_handler->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
diff --git a/Zend/zend_alloc.c b/Zend/zend_alloc.c
index 66cd23c7cb..0b0e8632c1 100644
--- a/Zend/zend_alloc.c
+++ b/Zend/zend_alloc.c
@@ -664,7 +664,7 @@ static void *_zend_mm_realloc_int(zend_mm_heap *heap, void *p, size_t size ZEND_
static inline unsigned int zend_mm_high_bit(size_t _size)
{
-#if defined(__GNUC__) && defined(i386)
+#if defined(__GNUC__) && (defined(__native_client__) || defined(i386))
unsigned int n;
__asm__("bsrl %1,%0\n\t" : "=r" (n) : "rm" (_size));
@@ -690,7 +690,7 @@ static inline unsigned int zend_mm_high_bit(size_t _size)
static inline unsigned int zend_mm_low_bit(size_t _size)
{
-#if defined(__GNUC__) && defined(i386)
+#if defined(__GNUC__) && (defined(__native_client__) || defined(i386))
unsigned int n;
__asm__("bsfl %1,%0\n\t" : "=r" (n) : "rm" (_size));
@@ -2454,7 +2454,7 @@ ZEND_API size_t _zend_mem_block_size(void *ptr TSRMLS_DC ZEND_FILE_LINE_DC ZEND_
return _zend_mm_block_size(AG(mm_heap), ptr ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
}
-#if defined(__GNUC__) && defined(i386)
+#if defined(__GNUC__) && (defined(__native_client__) || defined(i386))
static inline size_t safe_address(size_t nmemb, size_t size, size_t offset)
{
diff --git a/Zend/zend_closures.c b/Zend/zend_closures.c
index 6f2ded3753..c7527b4ff9 100644
--- a/Zend/zend_closures.c
+++ b/Zend/zend_closures.c
@@ -78,7 +78,7 @@ ZEND_METHOD(Closure, __invoke) /* {{{ */
/* {{{ proto Closure Closure::bind(Closure $old, object $to [, mixed $scope = "static" ] )
Create a closure from another one and bind to another object and scope */
-ZEND_METHOD(Closure, bind) /* {{{ */
+ZEND_METHOD(Closure, bind)
{
zval *newthis, *zclosure, *scope_arg = NULL;
zend_closure *closure;
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 09383c12d0..c39d8eaa1e 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -2935,6 +2935,11 @@ static zend_bool zend_do_perform_implementation_check(const zend_function *fe, c
return 1;
}
+ /* If both methods are private do not enforce a signature */
+ if ((fe->common.fn_flags & ZEND_ACC_PRIVATE) && (proto->common.fn_flags & ZEND_ACC_PRIVATE)) {
+ return 1;
+ }
+
/* check number of arguments */
if (proto->common.required_num_args < fe->common.required_num_args
|| proto->common.num_args > fe->common.num_args) {
@@ -3873,10 +3878,10 @@ static int zend_traits_copy_functions(zend_function *fn TSRMLS_DC, int num_args,
&& (zend_binary_strcasecmp(aliases[i]->trait_method->method_name, aliases[i]->trait_method->mname_len, fn->common.function_name, fnname_len) == 0)) {
fn_copy = *fn;
function_add_ref(&fn_copy);
- /* this function_name is never destroyed, because its refcount
- greater than 1 and classes are always destoyed before the
- traits they use */
+ /* this function_name is never destroyed, because ZEND_ACC_ALIAS
+ flag is set */
fn_copy.common.function_name = aliases[i]->alias;
+ fn_copy.common.fn_flags |= ZEND_ACC_ALIAS;
/* if it is 0, no modifieres has been changed */
if (aliases[i]->modifiers) {
@@ -3909,6 +3914,7 @@ static int zend_traits_copy_functions(zend_function *fn TSRMLS_DC, int num_args,
/* is not in hashtable, thus, function is not to be excluded */
fn_copy = *fn;
function_add_ref(&fn_copy);
+ fn_copy.common.fn_flags |= ZEND_ACC_ALIAS;
/* apply aliases which are not qualified by a class name, or which have not
* alias name, just setting visibility */
diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h
index f164122785..79ace0c3c3 100644
--- a/Zend/zend_compile.h
+++ b/Zend/zend_compile.h
@@ -207,6 +207,8 @@ typedef struct _zend_try_catch_element {
#define ZEND_ACC_RETURN_REFERENCE 0x4000000
#define ZEND_ACC_DONE_PASS_TWO 0x8000000
+#define ZEND_ACC_ALIAS 0x10000000
+
char *zend_visibility_string(zend_uint fn_flags);
diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c
index 60095f7062..d82493aeaf 100644
--- a/Zend/zend_object_handlers.c
+++ b/Zend/zend_object_handlers.c
@@ -1490,6 +1490,7 @@ ZEND_API int zend_std_cast_object_tostring(zval *readobj, zval *writeobj, int ty
if (retval) {
zval_ptr_dtor(&retval);
}
+ EG(exception) = NULL;
zend_error_noreturn(E_ERROR, "Method %s::__toString() must not throw an exception", ce->name);
return FAILURE;
}
diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c
index 19fd71e763..4c6a784a88 100644
--- a/Zend/zend_opcode.c
+++ b/Zend/zend_opcode.c
@@ -267,6 +267,15 @@ void _destroy_zend_class_traits_info(zend_class_entry *ce)
}
}
+static int zend_clear_trait_method_name(zend_op_array *op_array TSRMLS_DC)
+{
+ if (op_array->function_name && (op_array->fn_flags & ZEND_ACC_ALIAS) == 0) {
+ efree(op_array->function_name);
+ op_array->function_name = NULL;
+ }
+ return 0;
+}
+
ZEND_API void destroy_zend_class(zend_class_entry **pce)
{
zend_class_entry *ce = *pce;
@@ -298,6 +307,10 @@ ZEND_API void destroy_zend_class(zend_class_entry **pce)
}
zend_hash_destroy(&ce->properties_info);
str_efree(ce->name);
+ if ((ce->ce_flags & ZEND_ACC_TRAIT) == ZEND_ACC_TRAIT) {
+ TSRMLS_FETCH();
+ zend_hash_apply(&ce->function_table, (apply_func_t)zend_clear_trait_method_name TSRMLS_CC);
+ }
zend_hash_destroy(&ce->function_table);
zend_hash_destroy(&ce->constants_table);
if (ce->num_interfaces > 0 && ce->interfaces) {
@@ -387,7 +400,7 @@ ZEND_API void destroy_op_array(zend_op_array *op_array TSRMLS_DC)
}
efree(op_array->opcodes);
- if (op_array->function_name) {
+ if (op_array->function_name && (op_array->fn_flags & ZEND_ACC_ALIAS) == 0) {
efree((char*)op_array->function_name);
}
if (op_array->doc_comment) {
diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c
index f9686251fe..9b01e5fbcb 100644
--- a/Zend/zend_operators.c
+++ b/Zend/zend_operators.c
@@ -1519,6 +1519,9 @@ ZEND_API int compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {
ret = compare_function(result, op1, op_free TSRMLS_CC);
zend_free_obj_get_result(op_free TSRMLS_CC);
return ret;
+ } else if (Z_TYPE_P(op1) == IS_OBJECT) {
+ ZVAL_LONG(result, 1);
+ return SUCCESS;
}
}
if (!converted) {
diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h
index f5567ea990..9d475a688c 100644
--- a/Zend/zend_vm_def.h
+++ b/Zend/zend_vm_def.h
@@ -2412,6 +2412,10 @@ ZEND_VM_HANDLER(59, ZEND_INIT_FCALL_BY_NAME, ANY, CONST|TMP|VAR|CV)
zend_hash_index_find(Z_ARRVAL_P(function_name), 0, (void **) &obj);
zend_hash_index_find(Z_ARRVAL_P(function_name), 1, (void **) &method);
+ if (!obj || !method) {
+ zend_error_noreturn(E_ERROR, "Array callback has to contain indices 0 and 1");
+ }
+
if (Z_TYPE_PP(obj) != IS_STRING && Z_TYPE_PP(obj) != IS_OBJECT) {
zend_error_noreturn(E_ERROR, "First array member is not a valid class name or object");
}
diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h
index 78f3d8496d..4abe6503cd 100644
--- a/Zend/zend_vm_execute.h
+++ b/Zend/zend_vm_execute.h
@@ -1256,6 +1256,10 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_CONST_HANDLER(ZEND_OPCODE
zend_hash_index_find(Z_ARRVAL_P(function_name), 0, (void **) &obj);
zend_hash_index_find(Z_ARRVAL_P(function_name), 1, (void **) &method);
+ if (!obj || !method) {
+ zend_error_noreturn(E_ERROR, "Array callback has to contain indices 0 and 1");
+ }
+
if (Z_TYPE_PP(obj) != IS_STRING && Z_TYPE_PP(obj) != IS_OBJECT) {
zend_error_noreturn(E_ERROR, "First array member is not a valid class name or object");
}
@@ -1558,6 +1562,10 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_TMP_HANDLER(ZEND_OPCODE_H
zend_hash_index_find(Z_ARRVAL_P(function_name), 0, (void **) &obj);
zend_hash_index_find(Z_ARRVAL_P(function_name), 1, (void **) &method);
+ if (!obj || !method) {
+ zend_error_noreturn(E_ERROR, "Array callback has to contain indices 0 and 1");
+ }
+
if (Z_TYPE_PP(obj) != IS_STRING && Z_TYPE_PP(obj) != IS_OBJECT) {
zend_error_noreturn(E_ERROR, "First array member is not a valid class name or object");
}
@@ -1722,6 +1730,10 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_VAR_HANDLER(ZEND_OPCODE_H
zend_hash_index_find(Z_ARRVAL_P(function_name), 0, (void **) &obj);
zend_hash_index_find(Z_ARRVAL_P(function_name), 1, (void **) &method);
+ if (!obj || !method) {
+ zend_error_noreturn(E_ERROR, "Array callback has to contain indices 0 and 1");
+ }
+
if (Z_TYPE_PP(obj) != IS_STRING && Z_TYPE_PP(obj) != IS_OBJECT) {
zend_error_noreturn(E_ERROR, "First array member is not a valid class name or object");
}
@@ -1919,6 +1931,10 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_CV_HANDLER(ZEND_OPCODE_HA
zend_hash_index_find(Z_ARRVAL_P(function_name), 0, (void **) &obj);
zend_hash_index_find(Z_ARRVAL_P(function_name), 1, (void **) &method);
+ if (!obj || !method) {
+ zend_error_noreturn(E_ERROR, "Array callback has to contain indices 0 and 1");
+ }
+
if (Z_TYPE_PP(obj) != IS_STRING && Z_TYPE_PP(obj) != IS_OBJECT) {
zend_error_noreturn(E_ERROR, "First array member is not a valid class name or object");
}
diff --git a/Zend/zend_vm_execute.skl b/Zend/zend_vm_execute.skl
index 426f689795..6d1b2e70e7 100644
--- a/Zend/zend_vm_execute.skl
+++ b/Zend/zend_vm_execute.skl
@@ -5,8 +5,8 @@ ZEND_API void {%EXECUTOR_NAME%}(zend_op_array *op_array TSRMLS_DC)
DCL_OPLINE
zend_execute_data *execute_data;
zend_bool nested = 0;
- zend_bool original_in_execution = EG(in_execution);
{%HELPER_VARS%}
+ {%EXECUTION_STATUS%}
{%INTERNAL_LABELS%}
diff --git a/Zend/zend_vm_gen.php b/Zend/zend_vm_gen.php
index 3163000e47..fde1baf90b 100644
--- a/Zend/zend_vm_gen.php
+++ b/Zend/zend_vm_gen.php
@@ -927,6 +927,13 @@ function gen_executor($f, $skl, $spec, $kind, $executor_name, $initializer_name,
skip_blanks($f, $m[1], $m[3]."\n");
}
break;
+ case "EXECUTION_STATUS":
+ if ($kind != ZEND_VM_KIND_GOTO) {
+ out($f, $m[1] . "zend_bool original_in_execution = EG(in_execution);\n");
+ } else {
+ out($f, $m[1] . "zend_bool original_in_execution = op_array? EG(in_execution) : 0;\n");
+ }
+ break;
case "INTERNAL_LABELS":
if ($kind == ZEND_VM_KIND_GOTO) {
// Emit array of labels of opcode handlers and code for
diff --git a/configure.in b/configure.in
index e5e1cd6375..afe470d30a 100644
--- a/configure.in
+++ b/configure.in
@@ -119,7 +119,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
PHP_MAJOR_VERSION=5
PHP_MINOR_VERSION=4
-PHP_RELEASE_VERSION=7
+PHP_RELEASE_VERSION=9
PHP_EXTRA_VERSION="-dev"
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION`
diff --git a/ext/curl/interface.c b/ext/curl/interface.c
index b57ce1bd07..d75e5c058b 100644
--- a/ext/curl/interface.c
+++ b/ext/curl/interface.c
@@ -713,6 +713,14 @@ PHP_MINIT_FUNCTION(curl)
#if LIBCURL_VERSION_NUM >= 0x071202
REGISTER_CURL_CONSTANT(CURLINFO_REDIRECT_URL);
#endif
+#if LIBCURL_VERSION_NUM >= 0x071300 /* 7.19.0 */
+ REGISTER_CURL_CONSTANT(CURLINFO_PRIMARY_IP);
+#endif
+#if LIBCURL_VERSION_NUM >= 0x071500 /* 7.21.0 */
+ REGISTER_CURL_CONSTANT(CURLINFO_PRIMARY_PORT);
+ REGISTER_CURL_CONSTANT(CURLINFO_LOCAL_IP);
+ REGISTER_CURL_CONSTANT(CURLINFO_LOCAL_PORT);
+#endif
/* cURL protocol constants (curl_version) */
@@ -2447,6 +2455,8 @@ PHP_FUNCTION(curl_getinfo)
create_certinfo(ci, listcode TSRMLS_CC);
CAAZ("certinfo", listcode);
}
+#endif
+#if LIBCURL_VERSION_NUM >= 0x071300 /* 7.19.0 */
if (curl_easy_getinfo(ch->cp, CURLINFO_PRIMARY_IP, &s_code) == CURLE_OK) {
CAAS("primary_ip", s_code);
}
@@ -2473,10 +2483,10 @@ PHP_FUNCTION(curl_getinfo)
} else {
switch (option) {
/* string variable types */
-#if LIBCURL_VERSION_NUM >= 0x071500
+#if LIBCURL_VERSION_NUM >= 0x071300 /* 7.19.0 */
case CURLINFO_PRIMARY_IP:
#endif
-#if LIBCURL_VERSION_NUM >= 0x071500
+#if LIBCURL_VERSION_NUM >= 0x071500 /* 7.21.0 */
case CURLINFO_LOCAL_IP:
#endif
case CURLINFO_PRIVATE:
@@ -2496,7 +2506,7 @@ PHP_FUNCTION(curl_getinfo)
break;
}
/* Long variable types */
-#if LIBCURL_VERSION_NUM >= 0x071500
+#if LIBCURL_VERSION_NUM >= 0x071500 /* 7.21.0 */
case CURLINFO_PRIMARY_PORT:
case CURLINFO_LOCAL_PORT:
#endif
diff --git a/ext/curl/multi.c b/ext/curl/multi.c
index 034aa65c28..53e97b80f8 100644
--- a/ext/curl/multi.c
+++ b/ext/curl/multi.c
@@ -191,6 +191,9 @@ PHP_FUNCTION(curl_multi_select)
FD_ZERO(&exceptfds);
curl_multi_fdset(mh->multi, &readfds, &writefds, &exceptfds, &maxfd);
+ if (maxfd == -1) {
+ RETURN_LONG(-1);
+ }
RETURN_LONG(select(maxfd + 1, &readfds, &writefds, &exceptfds, &to));
}
/* }}} */
diff --git a/ext/curl/streams.c b/ext/curl/streams.c
index 19328d886c..821c2ecad8 100644
--- a/ext/curl/streams.c
+++ b/ext/curl/streams.c
@@ -162,6 +162,10 @@ static size_t php_curl_stream_read(php_stream *stream, char *buf, size_t count T
}
do {
+ FD_ZERO(&curlstream->readfds);
+ FD_ZERO(&curlstream->writefds);
+ FD_ZERO(&curlstream->excfds);
+
/* get the descriptors from curl */
curl_multi_fdset(curlstream->multi, &curlstream->readfds, &curlstream->writefds, &curlstream->excfds, &curlstream->maxfd);
diff --git a/ext/curl/tests/bug62839.phpt b/ext/curl/tests/bug62839.phpt
index 39e6fc9cbe..e6988d6de1 100644
--- a/ext/curl/tests/bug62839.phpt
+++ b/ext/curl/tests/bug62839.phpt
@@ -7,7 +7,7 @@ Bug #62839 (curl_copy_handle segfault with CURLOPT_FILE)
<?php
$curl = curl_init();
-$fd = fopen('/tmp/test', 'wb');
+$fd = tmpfile();
curl_setopt($curl, CURLOPT_FILE, $fd);
curl_copy_handle($curl);
diff --git a/ext/date/lib/astro.c b/ext/date/lib/astro.c
index 0438f98904..064700f912 100644
--- a/ext/date/lib/astro.c
+++ b/ext/date/lib/astro.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2010 The PHP Group |
+ | Copyright (c) 1997-2012 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/date/lib/dow.c b/ext/date/lib/dow.c
index b33e8eab72..9cb9c9cd28 100644
--- a/ext/date/lib/dow.c
+++ b/ext/date/lib/dow.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2010 The PHP Group |
+ | Copyright (c) 1997-2012 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/date/lib/interval.c b/ext/date/lib/interval.c
index af150fc802..451b463191 100644
--- a/ext/date/lib/interval.c
+++ b/ext/date/lib/interval.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2010 The PHP Group |
+ | Copyright (c) 1997-2012 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/date/lib/parse_date.c b/ext/date/lib/parse_date.c
index fbe330700b..4829da6c91 100644
--- a/ext/date/lib/parse_date.c
+++ b/ext/date/lib/parse_date.c
@@ -1,10 +1,10 @@
-/* Generated by re2c 0.13.5 on Mon Dec 5 22:02:27 2011 */
+/* Generated by re2c 0.13.5 on Sun Sep 30 20:14:42 2012 */
#line 1 "ext/date/lib/parse_date.re"
/*
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2010 The PHP Group |
+ | Copyright (c) 1997-2012 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -995,7 +995,7 @@ std:
}
yy2:
YYDEBUG(2, *YYCURSOR);
-#line 1082 "ext/date/lib/parse_date.re"
+#line 1083 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("firstdayof | lastdayof");
TIMELIB_INIT;
@@ -1034,7 +1034,7 @@ yy3:
}
yy4:
YYDEBUG(4, *YYCURSOR);
-#line 1676 "ext/date/lib/parse_date.re"
+#line 1677 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("tzcorrection | tz");
@@ -1358,7 +1358,7 @@ yy12:
if (yych <= '9') goto yy1385;
yy13:
YYDEBUG(13, *YYCURSOR);
-#line 1771 "ext/date/lib/parse_date.re"
+#line 1772 "ext/date/lib/parse_date.re"
{
add_error(s, "Unexpected character");
goto std;
@@ -2420,7 +2420,7 @@ yy49:
if (yych <= '9') goto yy55;
yy50:
YYDEBUG(50, *YYCURSOR);
-#line 1760 "ext/date/lib/parse_date.re"
+#line 1761 "ext/date/lib/parse_date.re"
{
goto std;
}
@@ -2433,7 +2433,7 @@ yy52:
YYDEBUG(52, *YYCURSOR);
++YYCURSOR;
YYDEBUG(53, *YYCURSOR);
-#line 1765 "ext/date/lib/parse_date.re"
+#line 1766 "ext/date/lib/parse_date.re"
{
s->pos = cursor; s->line++;
goto std;
@@ -2825,7 +2825,7 @@ yy72:
if (yych == 's') goto yy74;
yy73:
YYDEBUG(73, *YYCURSOR);
-#line 1744 "ext/date/lib/parse_date.re"
+#line 1745 "ext/date/lib/parse_date.re"
{
timelib_ull i;
DEBUG_OUTPUT("relative");
@@ -3602,7 +3602,7 @@ yy166:
}
yy167:
YYDEBUG(167, *YYCURSOR);
-#line 1607 "ext/date/lib/parse_date.re"
+#line 1608 "ext/date/lib/parse_date.re"
{
const timelib_relunit* relunit;
DEBUG_OUTPUT("daytext");
@@ -4139,7 +4139,7 @@ yy193:
}
yy194:
YYDEBUG(194, *YYCURSOR);
-#line 1666 "ext/date/lib/parse_date.re"
+#line 1667 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("monthtext");
TIMELIB_INIT;
@@ -4199,7 +4199,7 @@ yy198:
}
yy199:
YYDEBUG(199, *YYCURSOR);
-#line 1412 "ext/date/lib/parse_date.re"
+#line 1413 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("datetextual | datenoyear");
@@ -4481,7 +4481,7 @@ yy222:
}
yy223:
YYDEBUG(223, *YYCURSOR);
-#line 1714 "ext/date/lib/parse_date.re"
+#line 1715 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("dateshortwithtimeshort | dateshortwithtimelong | dateshortwithtimelongtz");
@@ -5208,7 +5208,7 @@ yy278:
YYDEBUG(278, *YYCURSOR);
++YYCURSOR;
YYDEBUG(279, *YYCURSOR);
-#line 1690 "ext/date/lib/parse_date.re"
+#line 1691 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("dateshortwithtimeshort12 | dateshortwithtimelong12");
TIMELIB_INIT;
@@ -5409,7 +5409,7 @@ yy294:
++YYCURSOR;
yy295:
YYDEBUG(295, *YYCURSOR);
-#line 1384 "ext/date/lib/parse_date.re"
+#line 1385 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("datenoday");
@@ -6642,7 +6642,7 @@ yy362:
if (yych <= '9') goto yy365;
yy364:
YYDEBUG(364, *YYCURSOR);
-#line 1528 "ext/date/lib/parse_date.re"
+#line 1529 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("pgtextshort");
@@ -7293,7 +7293,7 @@ yy392:
}
yy393:
YYDEBUG(393, *YYCURSOR);
-#line 1586 "ext/date/lib/parse_date.re"
+#line 1587 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("ago");
TIMELIB_INIT;
@@ -9063,7 +9063,7 @@ yy454:
++YYCURSOR;
yy455:
YYDEBUG(455, *YYCURSOR);
-#line 1289 "ext/date/lib/parse_date.re"
+#line 1290 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("iso8601date4 | iso8601date2 | iso8601dateslash | dateslash");
TIMELIB_INIT;
@@ -9634,7 +9634,7 @@ yy475:
}
yy476:
YYDEBUG(476, *YYCURSOR);
-#line 1426 "ext/date/lib/parse_date.re"
+#line 1427 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("datenoyearrev");
TIMELIB_INIT;
@@ -9786,7 +9786,7 @@ yy488:
YYDEBUG(488, *YYCURSOR);
++YYCURSOR;
YYDEBUG(489, *YYCURSOR);
-#line 1144 "ext/date/lib/parse_date.re"
+#line 1145 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("timetiny12 | timeshort12 | timelong12");
TIMELIB_INIT;
@@ -9815,7 +9815,7 @@ yy490:
}
yy491:
YYDEBUG(491, *YYCURSOR);
-#line 1181 "ext/date/lib/parse_date.re"
+#line 1182 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("timeshort24 | timelong24 | iso8601long");
@@ -10150,7 +10150,7 @@ yy523:
YYDEBUG(523, *YYCURSOR);
++YYCURSOR;
YYDEBUG(524, *YYCURSOR);
-#line 1161 "ext/date/lib/parse_date.re"
+#line 1162 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("mssqltime");
TIMELIB_INIT;
@@ -10275,7 +10275,7 @@ yy534:
if (yych <= '9') goto yy541;
yy535:
YYDEBUG(535, *YYCURSOR);
-#line 1343 "ext/date/lib/parse_date.re"
+#line 1344 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("datefull");
@@ -11026,7 +11026,7 @@ yy605:
YYDEBUG(606, *YYCURSOR);
++YYCURSOR;
YYDEBUG(607, *YYCURSOR);
-#line 1358 "ext/date/lib/parse_date.re"
+#line 1359 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("pointed date YYYY");
TIMELIB_INIT;
@@ -11073,7 +11073,7 @@ yy611:
if (yych <= '9') goto yy605;
yy612:
YYDEBUG(612, *YYCURSOR);
-#line 1370 "ext/date/lib/parse_date.re"
+#line 1371 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("pointed date YY");
@@ -11727,7 +11727,7 @@ yy656:
}
yy657:
YYDEBUG(657, *YYCURSOR);
-#line 1329 "ext/date/lib/parse_date.re"
+#line 1330 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("gnudateshort");
@@ -11846,7 +11846,7 @@ yy666:
}
yy667:
YYDEBUG(667, *YYCURSOR);
-#line 1273 "ext/date/lib/parse_date.re"
+#line 1274 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("americanshort | american");
@@ -12094,7 +12094,7 @@ yy700:
if (yych <= ':') goto yy704;
yy701:
YYDEBUG(701, *YYCURSOR);
-#line 1556 "ext/date/lib/parse_date.re"
+#line 1557 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("clf");
@@ -12666,7 +12666,7 @@ yy763:
}
yy764:
YYDEBUG(764, *YYCURSOR);
-#line 1301 "ext/date/lib/parse_date.re"
+#line 1302 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("iso8601date2");
@@ -12718,7 +12718,7 @@ yy771:
YYDEBUG(771, *YYCURSOR);
++YYCURSOR;
YYDEBUG(772, *YYCURSOR);
-#line 1542 "ext/date/lib/parse_date.re"
+#line 1543 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("pgtextreverse");
@@ -12869,7 +12869,7 @@ yy783:
}
yy784:
YYDEBUG(784, *YYCURSOR);
-#line 1577 "ext/date/lib/parse_date.re"
+#line 1578 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("year4");
TIMELIB_INIT;
@@ -13028,7 +13028,7 @@ yy793:
}
yy794:
YYDEBUG(794, *YYCURSOR);
-#line 1398 "ext/date/lib/parse_date.re"
+#line 1399 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("datenodayrev");
@@ -13256,7 +13256,7 @@ yy814:
if (yych <= '7') goto yy817;
yy815:
YYDEBUG(815, *YYCURSOR);
-#line 1509 "ext/date/lib/parse_date.re"
+#line 1510 "ext/date/lib/parse_date.re"
{
timelib_sll w, d;
DEBUG_OUTPUT("isoweek");
@@ -13284,7 +13284,7 @@ yy817:
YYDEBUG(817, *YYCURSOR);
++YYCURSOR;
YYDEBUG(818, *YYCURSOR);
-#line 1490 "ext/date/lib/parse_date.re"
+#line 1491 "ext/date/lib/parse_date.re"
{
timelib_sll w, d;
DEBUG_OUTPUT("isoweekday");
@@ -13366,7 +13366,7 @@ yy821:
}
yy822:
YYDEBUG(822, *YYCURSOR);
-#line 1476 "ext/date/lib/parse_date.re"
+#line 1477 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("pgydotd");
@@ -13482,7 +13482,7 @@ yy842:
++YYCURSOR;
yy843:
YYDEBUG(843, *YYCURSOR);
-#line 1450 "ext/date/lib/parse_date.re"
+#line 1451 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("xmlrpc | xmlrpcnocolon | soap | wddx | exif");
@@ -13769,7 +13769,7 @@ yy848:
}
yy849:
YYDEBUG(849, *YYCURSOR);
-#line 1438 "ext/date/lib/parse_date.re"
+#line 1439 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("datenocolon");
TIMELIB_INIT;
@@ -14700,7 +14700,7 @@ yy973:
if (yych <= '9') goto yy996;
yy974:
YYDEBUG(974, *YYCURSOR);
-#line 1315 "ext/date/lib/parse_date.re"
+#line 1316 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("gnudateshorter");
@@ -15722,7 +15722,7 @@ yy1066:
}
yy1068:
YYDEBUG(1068, *YYCURSOR);
-#line 1207 "ext/date/lib/parse_date.re"
+#line 1208 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("gnunocolon");
TIMELIB_INIT;
@@ -15836,7 +15836,7 @@ yy1075:
}
yy1076:
YYDEBUG(1076, *YYCURSOR);
-#line 1253 "ext/date/lib/parse_date.re"
+#line 1254 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("iso8601nocolon");
@@ -16753,7 +16753,7 @@ yy1117:
}
yy1118:
YYDEBUG(1118, *YYCURSOR);
-#line 1649 "ext/date/lib/parse_date.re"
+#line 1650 "ext/date/lib/parse_date.re"
{
timelib_sll i;
int behavior = 0;
@@ -16820,7 +16820,7 @@ yy1126:
YYDEBUG(1126, *YYCURSOR);
++YYCURSOR;
YYDEBUG(1127, *YYCURSOR);
-#line 1122 "ext/date/lib/parse_date.re"
+#line 1123 "ext/date/lib/parse_date.re"
{
timelib_sll i;
int behavior = 0;
@@ -16949,7 +16949,7 @@ yy1141:
}
yy1142:
YYDEBUG(1142, *YYCURSOR);
-#line 1625 "ext/date/lib/parse_date.re"
+#line 1626 "ext/date/lib/parse_date.re"
{
timelib_sll i;
int behavior = 0;
@@ -19649,7 +19649,7 @@ yy1294:
goto yy1298;
yy1295:
YYDEBUG(1295, *YYCURSOR);
-#line 1099 "ext/date/lib/parse_date.re"
+#line 1100 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("backof | frontof");
TIMELIB_INIT;
@@ -21382,11 +21382,12 @@ yy1387:
s->time->is_localtime = 1;
s->time->zone_type = TIMELIB_ZONETYPE_OFFSET;
s->time->z = 0;
+ s->time->dst = 0;
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
-#line 21390 "ext/date/lib/parse_date.c"
+#line 21391 "ext/date/lib/parse_date.c"
yy1388:
YYDEBUG(1388, *YYCURSOR);
yych = *++YYCURSOR;
@@ -21833,7 +21834,7 @@ yy1417:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
-#line 21837 "ext/date/lib/parse_date.c"
+#line 21838 "ext/date/lib/parse_date.c"
yy1418:
YYDEBUG(1418, *YYCURSOR);
yych = *++YYCURSOR;
@@ -21877,7 +21878,7 @@ yy1420:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
-#line 21881 "ext/date/lib/parse_date.c"
+#line 21882 "ext/date/lib/parse_date.c"
yy1421:
YYDEBUG(1421, *YYCURSOR);
yych = *++YYCURSOR;
@@ -23897,7 +23898,7 @@ yy1500:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
-#line 23901 "ext/date/lib/parse_date.c"
+#line 23902 "ext/date/lib/parse_date.c"
yy1501:
YYDEBUG(1501, *YYCURSOR);
yych = *++YYCURSOR;
@@ -24047,7 +24048,7 @@ yy1508:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
-#line 24051 "ext/date/lib/parse_date.c"
+#line 24052 "ext/date/lib/parse_date.c"
yy1509:
YYDEBUG(1509, *YYCURSOR);
yyaccept = 0;
@@ -24591,7 +24592,7 @@ yy1531:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
-#line 24595 "ext/date/lib/parse_date.c"
+#line 24596 "ext/date/lib/parse_date.c"
yy1532:
YYDEBUG(1532, *YYCURSOR);
yyaccept = 0;
@@ -24764,7 +24765,7 @@ yy1537:
goto yy1531;
}
}
-#line 1775 "ext/date/lib/parse_date.re"
+#line 1776 "ext/date/lib/parse_date.re"
}
@@ -25070,6 +25071,7 @@ timelib_time *timelib_parse_from_format(char *format, char *string, int len, tim
s->time->is_localtime = 1;
s->time->zone_type = TIMELIB_ZONETYPE_OFFSET;
s->time->z = 0;
+ s->time->dst = 0;
break;
case 'e': /* timezone */
diff --git a/ext/date/lib/parse_date.re b/ext/date/lib/parse_date.re
index 16c45a2119..5a8b6134b9 100644
--- a/ext/date/lib/parse_date.re
+++ b/ext/date/lib/parse_date.re
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2010 The PHP Group |
+ | Copyright (c) 1997-2012 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -1073,6 +1073,7 @@ weekdayof = (reltextnumber|reltexttext) space (dayfull|dayabbr) space 'of
s->time->is_localtime = 1;
s->time->zone_type = TIMELIB_ZONETYPE_OFFSET;
s->time->z = 0;
+ s->time->dst = 0;
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
@@ -2077,6 +2078,7 @@ timelib_time *timelib_parse_from_format(char *format, char *string, int len, tim
s->time->is_localtime = 1;
s->time->zone_type = TIMELIB_ZONETYPE_OFFSET;
s->time->z = 0;
+ s->time->dst = 0;
break;
case 'e': /* timezone */
diff --git a/ext/date/lib/parse_iso_intervals.c b/ext/date/lib/parse_iso_intervals.c
index 34de3b409c..d52c24d38f 100644
--- a/ext/date/lib/parse_iso_intervals.c
+++ b/ext/date/lib/parse_iso_intervals.c
@@ -4,7 +4,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2010 The PHP Group |
+ | Copyright (c) 1997-2012 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/date/lib/parse_iso_intervals.re b/ext/date/lib/parse_iso_intervals.re
index 8610803e39..e52868865b 100644
--- a/ext/date/lib/parse_iso_intervals.re
+++ b/ext/date/lib/parse_iso_intervals.re
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2010 The PHP Group |
+ | Copyright (c) 1997-2012 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/date/lib/parse_tz.c b/ext/date/lib/parse_tz.c
index b8d8448c94..009a2ad4e6 100644
--- a/ext/date/lib/parse_tz.c
+++ b/ext/date/lib/parse_tz.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2010 The PHP Group |
+ | Copyright (c) 1997-2012 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/date/lib/timelib.c b/ext/date/lib/timelib.c
index 5e65a6e4cf..43eedf780c 100644
--- a/ext/date/lib/timelib.c
+++ b/ext/date/lib/timelib.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2010 The PHP Group |
+ | Copyright (c) 1997-2012 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/date/lib/timelib.h b/ext/date/lib/timelib.h
index 9667fa2dae..671d37fd9e 100644
--- a/ext/date/lib/timelib.h
+++ b/ext/date/lib/timelib.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2010 The PHP Group |
+ | Copyright (c) 1997-2012 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/date/lib/timelib_structs.h b/ext/date/lib/timelib_structs.h
index 4f67b7a6cb..6662d91b1b 100644
--- a/ext/date/lib/timelib_structs.h
+++ b/ext/date/lib/timelib_structs.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2010 The PHP Group |
+ | Copyright (c) 1997-2012 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/date/lib/tm2unixtime.c b/ext/date/lib/tm2unixtime.c
index c4830bbef0..6085bb14da 100644
--- a/ext/date/lib/tm2unixtime.c
+++ b/ext/date/lib/tm2unixtime.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2010 The PHP Group |
+ | Copyright (c) 1997-2012 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/date/lib/unixtime2tm.c b/ext/date/lib/unixtime2tm.c
index a76fa80991..48709f42fc 100644
--- a/ext/date/lib/unixtime2tm.c
+++ b/ext/date/lib/unixtime2tm.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2010 The PHP Group |
+ | Copyright (c) 1997-2012 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/date/php_date.c b/ext/date/php_date.c
index 7c4e7820bb..13e7b753d3 100644
--- a/ext/date/php_date.c
+++ b/ext/date/php_date.c
@@ -2467,9 +2467,6 @@ static int php_date_initialize_from_hash(zval **return_value, php_date_obj **dat
if (zend_hash_find(myht, "timezone_type", 14, (void**) &z_timezone_type) == SUCCESS) {
convert_to_long(*z_timezone_type);
if (zend_hash_find(myht, "timezone", 9, (void**) &z_timezone) == SUCCESS) {
- zend_error_handling error_handling;
-
- zend_replace_error_handling(EH_THROW, NULL, &error_handling TSRMLS_CC);
convert_to_string(*z_timezone);
switch (Z_LVAL_PP(z_timezone_type)) {
@@ -2477,9 +2474,9 @@ static int php_date_initialize_from_hash(zval **return_value, php_date_obj **dat
case TIMELIB_ZONETYPE_ABBR: {
char *tmp = emalloc(Z_STRLEN_PP(z_date) + Z_STRLEN_PP(z_timezone) + 2);
snprintf(tmp, Z_STRLEN_PP(z_date) + Z_STRLEN_PP(z_timezone) + 2, "%s %s", Z_STRVAL_PP(z_date), Z_STRVAL_PP(z_timezone));
- php_date_initialize(*dateobj, tmp, Z_STRLEN_PP(z_date) + Z_STRLEN_PP(z_timezone) + 1, NULL, NULL, 1 TSRMLS_CC);
+ php_date_initialize(*dateobj, tmp, Z_STRLEN_PP(z_date) + Z_STRLEN_PP(z_timezone) + 1, NULL, NULL, 0 TSRMLS_CC);
efree(tmp);
- break;
+ return 1;
}
case TIMELIB_ZONETYPE_ID:
@@ -2493,15 +2490,10 @@ static int php_date_initialize_from_hash(zval **return_value, php_date_obj **dat
tzobj->tzi.tz = tzi;
tzobj->initialized = 1;
- php_date_initialize(*dateobj, Z_STRVAL_PP(z_date), Z_STRLEN_PP(z_date), NULL, tmp_obj, 1 TSRMLS_CC);
+ php_date_initialize(*dateobj, Z_STRVAL_PP(z_date), Z_STRLEN_PP(z_date), NULL, tmp_obj, 0 TSRMLS_CC);
zval_ptr_dtor(&tmp_obj);
- break;
- default:
- zend_restore_error_handling(&error_handling TSRMLS_CC);
- return 0;
+ return 1;
}
- zend_restore_error_handling(&error_handling TSRMLS_CC);
- return 1;
}
}
}
diff --git a/ext/date/tests/bug62561.phpt b/ext/date/tests/bug62561.phpt
new file mode 100644
index 0000000000..0ed32c15a1
--- /dev/null
+++ b/ext/date/tests/bug62561.phpt
@@ -0,0 +1,16 @@
+--TEST--
+Bug #62561 Unixtimestamp may take on local times DST flag (this test will only be valid during EDT)
+--FILE--
+<?php
+$tz = new DateTimeZone('America/New_York');
+$ts = new DateTime('@1341115200', $tz);
+$int = new DateInterval('P1D');
+$dayFromTs = new DateTime('@1341115200', new DateTimeZone('America/New_York'));
+$dayFromTs->add($int);
+
+echo 'ts: '.$ts->format('Y-m-d H:i:s')."\n";
+echo 'day from ts: '.$dayFromTs->format('Y-m-d H:i:s')."\n";
+?>
+--EXPECT--
+ts: 2012-07-01 04:00:00
+day from ts: 2012-07-02 04:00:00
diff --git a/ext/date/tests/bug62852.phpt b/ext/date/tests/bug62852.phpt
index 6426a80fb8..26de510215 100644
--- a/ext/date/tests/bug62852.phpt
+++ b/ext/date/tests/bug62852.phpt
@@ -2,14 +2,35 @@
Bug #62852 (Unserialize invalid DateTime causes crash)
--INI--
date.timezone=GMT
+--XFAIL--
+bug is not fixed yet
--FILE--
<?php
-try {
- $datetime = unserialize('O:8:"DateTime":3:{s:4:"date";s:20:"10007-06-07 03:51:49";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}');
- var_dump($datetime);
-} catch (Exception $e) {
- var_dump($e->getMessage());
+$s1 = 'O:8:"DateTime":3:{s:4:"date";s:20:"10007-06-07 03:51:49";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}';
+$s2 = 'O:3:"Foo":3:{s:4:"date";s:20:"10007-06-07 03:51:49";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}';
+
+global $foo;
+
+class Foo extends DateTime {
+ function __wakeup() {
+ global $foo;
+ $foo = $this;
+ parent::__wakeup();
+ }
}
+
+// Old test case
+try {
+ unserialize( $s1 );
+} catch ( Exception $e ) {}
+
+// My test case
+try {
+ unserialize( $s2 );
+} catch ( Exception $e ) {}
+var_dump( $foo );
+
+echo "okey";
?>
--EXPECTF--
-string(%d) "DateTime::__wakeup(): Failed to parse time string (%s) at position 12 (0): Double time specification"
+okey
diff --git a/ext/date/tests/bug62896.phpt b/ext/date/tests/bug62896.phpt
new file mode 100644
index 0000000000..7584546b5a
--- /dev/null
+++ b/ext/date/tests/bug62896.phpt
@@ -0,0 +1,40 @@
+--TEST--
+Bug #62896 Unixtimestamp may take on local times DST flag (this test will only be valid during CEST)
+--FILE--
+<?php
+ $tz = new DateTimeZone('Europe/Berlin');
+
+ echo "FROM TIMESTAMP, NO TZ:\n";
+
+ $date = new DateTime('@'.strtotime('2012-08-22 00:00:00 CEST'));
+ echo $date->format('Y-m-d H:i:s T').' (offset '.$date->getOffset().")\n";
+
+ $date->modify('+0 days');
+ echo $date->format('Y-m-d H:i:s T').' (offset '.$date->getOffset().")\n";
+
+ echo "FROM TIMESTAMP, WITH TZ:\n";
+
+ $date = new DateTime('@'.strtotime('2012-08-22 00:00:00 CEST'));
+ $date->setTimezone($tz);
+ echo $date->format('Y-m-d H:i:s T').' (offset '.$date->getOffset().")\n";
+
+ $date->modify('+0 days');
+ echo $date->format('Y-m-d H:i:s T').' (offset '.$date->getOffset().")\n";
+
+ echo "FROM STRING:\n";
+
+ $date = new DateTime('2012-08-22 00:00:00 CEST', $tz);
+ echo $date->format('Y-m-d H:i:s T').' (offset '.$date->getOffset().")\n";
+
+ $date->modify('+0 days');
+ echo $date->format('Y-m-d H:i:s T').' (offset '.$date->getOffset().")\n";
+--EXPECT--
+FROM TIMESTAMP, NO TZ:
+2012-08-21 22:00:00 GMT+0000 (offset 0)
+2012-08-21 22:00:00 GMT+0000 (offset 0)
+FROM TIMESTAMP, WITH TZ:
+2012-08-22 00:00:00 CEST (offset 7200)
+2012-08-22 00:00:00 CEST (offset 7200)
+FROM STRING:
+2012-08-22 00:00:00 CEST (offset 7200)
+2012-08-22 00:00:00 CEST (offset 7200)
diff --git a/ext/dba/libcdb/cdb.c b/ext/dba/libcdb/cdb.c
index 5c26b4fd9f..cfce91e080 100644
--- a/ext/dba/libcdb/cdb.c
+++ b/ext/dba/libcdb/cdb.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2010 The PHP Group |
+ | Copyright (c) 1997-2012 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/dba/libcdb/cdb.h b/ext/dba/libcdb/cdb.h
index 3530cb493c..7cdca00498 100644
--- a/ext/dba/libcdb/cdb.h
+++ b/ext/dba/libcdb/cdb.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2010 The PHP Group |
+ | Copyright (c) 1997-2012 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/dba/libcdb/cdb_make.c b/ext/dba/libcdb/cdb_make.c
index 600b8dd0f9..014db032eb 100644
--- a/ext/dba/libcdb/cdb_make.c
+++ b/ext/dba/libcdb/cdb_make.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2010 The PHP Group |
+ | Copyright (c) 1997-2012 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/dba/libcdb/cdb_make.h b/ext/dba/libcdb/cdb_make.h
index 828abe0315..062cffb05c 100644
--- a/ext/dba/libcdb/cdb_make.h
+++ b/ext/dba/libcdb/cdb_make.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2010 The PHP Group |
+ | Copyright (c) 1997-2012 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/dba/libcdb/uint32.c b/ext/dba/libcdb/uint32.c
index e869d512fb..b56cbf26f8 100644
--- a/ext/dba/libcdb/uint32.c
+++ b/ext/dba/libcdb/uint32.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2010 The PHP Group |
+ | Copyright (c) 1997-2012 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/dba/libcdb/uint32.h b/ext/dba/libcdb/uint32.h
index 692590e227..68ea1c0cd8 100644
--- a/ext/dba/libcdb/uint32.h
+++ b/ext/dba/libcdb/uint32.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2010 The PHP Group |
+ | Copyright (c) 1997-2012 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/dba/libflatfile/flatfile.c b/ext/dba/libflatfile/flatfile.c
index bf851847d5..c17a295438 100644
--- a/ext/dba/libflatfile/flatfile.c
+++ b/ext/dba/libflatfile/flatfile.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2010 The PHP Group |
+ | Copyright (c) 1997-2012 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/dba/libflatfile/flatfile.h b/ext/dba/libflatfile/flatfile.h
index e7ce3a7640..65d099fbc7 100644
--- a/ext/dba/libflatfile/flatfile.h
+++ b/ext/dba/libflatfile/flatfile.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2010 The PHP Group |
+ | Copyright (c) 1997-2012 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/dba/libinifile/inifile.c b/ext/dba/libinifile/inifile.c
index 35930d1028..cd53f4adf0 100644
--- a/ext/dba/libinifile/inifile.c
+++ b/ext/dba/libinifile/inifile.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2010 The PHP Group |
+ | Copyright (c) 1997-2012 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/dba/libinifile/inifile.h b/ext/dba/libinifile/inifile.h
index e69fd08b06..5b7e377d86 100644
--- a/ext/dba/libinifile/inifile.h
+++ b/ext/dba/libinifile/inifile.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2010 The PHP Group |
+ | Copyright (c) 1997-2012 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/dom/domerrorhandler.c b/ext/dom/domerrorhandler.c
index f1ab2871a8..e282f30146 100644
--- a/ext/dom/domerrorhandler.c
+++ b/ext/dom/domerrorhandler.c
@@ -29,7 +29,7 @@
/* {{{ arginfo */
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_domerrorhandler_handle_error, 0, 0, 1)
- ZEND_ARG_OBJ_INFO(0, error, DOMError, 0)
+ ZEND_ARG_OBJ_INFO(0, error, DOMDomError, 0)
ZEND_END_ARG_INFO();
/* }}} */
diff --git a/ext/fileinfo/libmagic.patch b/ext/fileinfo/libmagic.patch
index 30364fb978..15f6a6dadd 100644
--- a/ext/fileinfo/libmagic.patch
+++ b/ext/fileinfo/libmagic.patch
@@ -1,6 +1,6 @@
diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
---- libmagic.origin/apprentice.c 2012-07-15 18:17:24.802087661 +0800
-+++ libmagic/apprentice.c 2012-07-15 18:22:49.650087425 +0800
+--- libmagic.origin/apprentice.c 2012-09-11 11:09:26.000000000 +0800
++++ libmagic/apprentice.c 2012-09-11 11:36:51.000000000 +0800
@@ -29,6 +29,8 @@
* apprentice - make one pass through /etc/magic, learning its secrets.
*/
@@ -317,13 +317,13 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
const char *fn, int action)
{
- int errs = 0;
-+ int errs = 0, mflen = 0;
++ int errs = 0;
struct magic_entry *marray;
uint32_t marraycount, i, mentrycount = 0, starttest;
- size_t slen, files = 0, maxfiles = 0;
- char **filearr = NULL, *mfn;
+ size_t files = 0, maxfiles = 0;
-+ char **filearr = NULL, mfn[MAXPATHLEN];
++ char **filearr = NULL;
struct stat st;
DIR *dir;
struct dirent *d;
@@ -341,7 +341,7 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
marraycount = 0;
/* print silly verbose header for USG compat. */
-@@ -778,14 +773,16 @@
+@@ -778,14 +773,18 @@
(void)fprintf(stderr, "%s\n", usg_hdr);
/* load directory or file */
@@ -349,6 +349,8 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
+ /* FIXME: Read file names and sort them to prevent
+ non-determinism. See Debian bug #488562. */
+ if (php_sys_stat(fn, &st) == 0 && S_ISDIR(st.st_mode)) {
++ int mflen;
++ char mfn[MAXPATHLEN];
dir = opendir(fn);
if (!dir) {
errs++;
@@ -360,7 +362,7 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
file_oomem(ms,
strlen(fn) + strlen(d->d_name) + 2);
errs++;
-@@ -793,7 +790,6 @@
+@@ -793,7 +792,6 @@
goto out;
}
if (stat(mfn, &st) == -1 || !S_ISREG(st.st_mode)) {
@@ -368,7 +370,7 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
continue;
}
if (files >= maxfiles) {
-@@ -803,20 +799,19 @@
+@@ -803,20 +801,19 @@
if ((filearr = CAST(char **,
realloc(filearr, mlen))) == NULL) {
file_oomem(ms, mlen);
@@ -379,7 +381,7 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
}
}
- filearr[files++] = mfn;
-+ filearr[files++] = estrndup(mfn, mflen);
++ filearr[files++] = estrndup(mfn, (mflen > sizeof(mfn) - 1)? sizeof(mfn) - 1: mflen);
}
closedir(dir);
qsort(filearr, files, sizeof(*filearr), cmpstrp);
@@ -391,7 +393,7 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
}
free(filearr);
} else
-@@ -882,12 +877,7 @@
+@@ -882,12 +879,7 @@
for (i = 0; i < marraycount; i++)
mentrycount += marray[i].cont_count;
@@ -405,7 +407,7 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
mentrycount = 0;
for (i = 0; i < marraycount; i++) {
-@@ -896,9 +886,14 @@
+@@ -896,9 +888,14 @@
mentrycount += marray[i].cont_count;
}
out:
@@ -423,7 +425,7 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
if (errs) {
*magicp = NULL;
*nmagicp = 0;
-@@ -1175,14 +1170,13 @@
+@@ -1175,14 +1172,13 @@
return -1;
}
me = &(*mentryp)[*nmentryp - 1];
@@ -442,7 +444,7 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
me->mp = m = nm;
me->max_count = CAST(uint32_t, cnt);
}
-@@ -1194,23 +1188,13 @@
+@@ -1194,23 +1190,13 @@
struct magic_entry *mp;
maxmagic += ALLOC_INCR;
@@ -469,7 +471,7 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
me->mp = m;
me->max_count = ALLOC_CHUNK;
} else
-@@ -1353,6 +1337,10 @@
+@@ -1353,6 +1339,10 @@
if (m->type == FILE_INVALID) {
if (ms->flags & MAGIC_CHECK)
file_magwarn(ms, "type `%s' invalid", l);
@@ -480,7 +482,7 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
return -1;
}
-@@ -1361,7 +1349,7 @@
+@@ -1361,7 +1351,7 @@
m->mask_op = 0;
if (*l == '~') {
@@ -489,7 +491,7 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
m->mask_op |= FILE_OPINVERSE;
else if (ms->flags & MAGIC_CHECK)
file_magwarn(ms, "'~' invalid for string types");
-@@ -1370,7 +1358,7 @@
+@@ -1370,7 +1360,7 @@
m->str_range = 0;
m->str_flags = m->type == FILE_PSTRING ? PSTRING_1_LE : 0;
if ((op = get_op(*l)) != -1) {
@@ -498,7 +500,7 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
uint64_t val;
++l;
m->mask_op |= op;
-@@ -1558,11 +1546,6 @@
+@@ -1558,11 +1548,6 @@
if (check_format(ms, m) == -1)
return -1;
}
@@ -510,7 +512,7 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
m->mimetype[0] = '\0'; /* initialise MIME type to none */
if (m->cont_level == 0)
++(*nmentryp); /* make room for next */
-@@ -2195,56 +2178,69 @@
+@@ -2195,56 +2180,69 @@
/*
* handle a compiled file.
@@ -603,7 +605,7 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
ptr = (uint32_t *)(void *)*magicp;
if (*ptr != MAGICNO) {
if (swap4(*ptr) != MAGICNO) {
-@@ -2259,35 +2255,55 @@
+@@ -2259,35 +2257,55 @@
else
version = ptr[1];
if (version != VERSIONNO) {
@@ -675,7 +677,7 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
return -1;
}
-@@ -2301,42 +2317,49 @@
+@@ -2301,42 +2319,49 @@
apprentice_compile(struct magic_set *ms, struct magic **magicp,
uint32_t *nmagicp, const char *fn)
{
@@ -736,7 +738,7 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
return rv;
}
-@@ -2349,6 +2372,7 @@
+@@ -2349,6 +2374,7 @@
{
const char *p, *q;
char *buf;
@@ -744,7 +746,7 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
if (strip) {
if ((p = strrchr(fn, '/')) != NULL)
-@@ -2370,14 +2394,14 @@
+@@ -2370,14 +2396,14 @@
q++;
/* Compatibility with old code that looked in .mime */
if (ms->flags & MAGIC_MIME) {
@@ -763,7 +765,7 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
/* Compatibility with old code that looked in .mime */
if (strstr(p, ".mime") != NULL)
-@@ -2467,7 +2491,7 @@
+@@ -2467,7 +2493,7 @@
m->offset = swap4((uint32_t)m->offset);
m->in_offset = swap4((uint32_t)m->in_offset);
m->lineno = swap4((uint32_t)m->lineno);
@@ -773,8 +775,8 @@ diff -u libmagic.origin/apprentice.c libmagic/apprentice.c
m->str_flags = swap4(m->str_flags);
}
diff -u libmagic.origin/ascmagic.c libmagic/ascmagic.c
---- libmagic.origin/ascmagic.c 2012-07-15 18:17:24.762087659 +0800
-+++ libmagic/ascmagic.c 2012-07-15 18:20:42.730087520 +0800
+--- libmagic.origin/ascmagic.c 2012-09-11 11:09:26.000000000 +0800
++++ libmagic/ascmagic.c 2012-09-11 11:33:55.000000000 +0800
@@ -139,10 +139,8 @@
/* malloc size is a conservative overestimate; could be
improved, or at least realloced after conversion. */
@@ -799,8 +801,8 @@ diff -u libmagic.origin/ascmagic.c libmagic/ascmagic.c
return rv;
}
diff -u libmagic.origin/cdf.c libmagic/cdf.c
---- libmagic.origin/cdf.c 2012-07-15 18:17:24.822087659 +0800
-+++ libmagic/cdf.c 2012-07-15 18:20:42.730087520 +0800
+--- libmagic.origin/cdf.c 2012-09-11 11:09:26.000000000 +0800
++++ libmagic/cdf.c 2012-09-11 11:33:55.000000000 +0800
@@ -43,7 +43,17 @@
#include <err.h>
#endif
@@ -863,8 +865,8 @@ diff -u libmagic.origin/cdf.c libmagic/cdf.c
(void)fprintf(stderr, "timestamp %s\n", buf);
} else {
diff -u libmagic.origin/cdf.h libmagic/cdf.h
---- libmagic.origin/cdf.h 2012-07-15 18:17:25.046087660 +0800
-+++ libmagic/cdf.h 2012-07-15 18:20:42.730087520 +0800
+--- libmagic.origin/cdf.h 2012-09-11 11:09:26.000000000 +0800
++++ libmagic/cdf.h 2012-09-11 11:33:55.000000000 +0800
@@ -35,7 +35,7 @@
#ifndef _H_CDF_
#define _H_CDF_
@@ -901,8 +903,8 @@ diff -u libmagic.origin/cdf.h libmagic/cdf.h
void cdf_swap_header(cdf_header_t *);
void cdf_unpack_header(cdf_header_t *, char *);
diff -u libmagic.origin/cdf_time.c libmagic/cdf_time.c
---- libmagic.origin/cdf_time.c 2012-07-15 18:17:24.734087660 +0800
-+++ libmagic/cdf_time.c 2012-07-15 18:20:42.734087519 +0800
+--- libmagic.origin/cdf_time.c 2012-09-11 11:09:26.000000000 +0800
++++ libmagic/cdf_time.c 2012-09-11 11:33:55.000000000 +0800
@@ -96,7 +96,7 @@
}
@@ -960,8 +962,8 @@ diff -u libmagic.origin/cdf_time.c libmagic/cdf_time.c
static const char *ref = "Sat Apr 23 01:30:00 1977";
char *p, *q;
diff -u libmagic.origin/compress.c libmagic/compress.c
---- libmagic.origin/compress.c 2012-07-15 18:17:24.730087657 +0800
-+++ libmagic/compress.c 2012-07-15 18:20:42.734087519 +0800
+--- libmagic.origin/compress.c 2012-09-11 11:09:26.000000000 +0800
++++ libmagic/compress.c 2012-09-11 11:33:55.000000000 +0800
@@ -32,6 +32,7 @@
* uncompress(method, old, n, newch) - uncompress old into new,
* using method, return sizeof new
@@ -1122,9 +1124,10 @@ diff -u libmagic.origin/compress.c libmagic/compress.c
}
-#endif
+#endif /* if PHP_FILEINFO_UNCOMPRESS */
+Only in libmagic: diff
diff -u libmagic.origin/file.h libmagic/file.h
---- libmagic.origin/file.h 2012-07-15 18:17:25.046087660 +0800
-+++ libmagic/file.h 2012-07-15 18:20:42.734087519 +0800
+--- libmagic.origin/file.h 2012-09-11 11:09:26.000000000 +0800
++++ libmagic/file.h 2012-09-11 11:33:55.000000000 +0800
@@ -33,11 +33,9 @@
#ifndef __file_h__
#define __file_h__
@@ -1296,8 +1299,8 @@ diff -u libmagic.origin/file.h libmagic/file.h
+
#endif /* __file_h__ */
diff -u libmagic.origin/fsmagic.c libmagic/fsmagic.c
---- libmagic.origin/fsmagic.c 2012-07-15 18:17:24.730087657 +0800
-+++ libmagic/fsmagic.c 2012-07-15 18:20:42.734087519 +0800
+--- libmagic.origin/fsmagic.c 2012-09-11 11:09:26.000000000 +0800
++++ libmagic/fsmagic.c 2012-09-11 11:33:55.000000000 +0800
@@ -59,27 +59,21 @@
# define minor(dev) ((dev) & 0xff)
#endif
@@ -1508,10 +1511,10 @@ diff -u libmagic.origin/fsmagic.c libmagic/fsmagic.c
-#else
- if (file_printf(ms, "block special") == -1)
- return -1;
- #endif
+-#endif
- }
- return 1;
--#endif
+ #endif
- /* TODO add code to handle V7 MUX and Blit MUX files */
+
#ifdef S_IFIFO
@@ -1621,8 +1624,8 @@ diff -u libmagic.origin/fsmagic.c libmagic/fsmagic.c
/*
diff -u libmagic.origin/funcs.c libmagic/funcs.c
---- libmagic.origin/funcs.c 2012-07-15 18:17:25.046087660 +0800
-+++ libmagic/funcs.c 2012-07-15 18:20:42.734087519 +0800
+--- libmagic.origin/funcs.c 2012-09-11 11:09:26.000000000 +0800
++++ libmagic/funcs.c 2012-09-11 11:33:55.000000000 +0800
@@ -41,52 +41,42 @@
#if defined(HAVE_WCTYPE_H)
#include <wctype.h>
@@ -1916,10 +1919,9 @@ diff -u libmagic.origin/funcs.c libmagic/funcs.c
+ return rep_cnt;
}
+
-Common subdirectories: libmagic.origin/.libs and libmagic/.libs
diff -u libmagic.origin/magic.c libmagic/magic.c
---- libmagic.origin/magic.c 2012-07-15 18:17:25.046087660 +0800
-+++ libmagic/magic.c 2012-07-15 18:20:42.734087519 +0800
+--- libmagic.origin/magic.c 2012-09-11 11:09:26.000000000 +0800
++++ libmagic/magic.c 2012-09-11 11:33:55.000000000 +0800
@@ -25,11 +25,6 @@
* SUCH DAMAGE.
*/
@@ -2296,8 +2298,8 @@ diff -u libmagic.origin/magic.c libmagic/magic.c
public const char *
magic_error(struct magic_set *ms)
diff -u libmagic.origin/magic.h libmagic/magic.h
---- libmagic.origin/magic.h 2012-07-15 18:17:24.734087660 +0800
-+++ libmagic/magic.h 2012-07-15 18:20:42.734087519 +0800
+--- libmagic.origin/magic.h 2012-09-11 11:09:26.000000000 +0800
++++ libmagic/magic.h 2012-09-11 11:33:55.000000000 +0800
@@ -85,6 +85,7 @@
const char *magic_getpath(const char *, int);
@@ -2315,8 +2317,8 @@ diff -u libmagic.origin/magic.h libmagic/magic.h
int magic_errno(magic_t);
diff -u libmagic.origin/print.c libmagic/print.c
---- libmagic.origin/print.c 2012-07-15 18:21:02.846087501 +0800
-+++ libmagic/print.c 2012-07-15 18:20:42.734087519 +0800
+--- libmagic.origin/print.c 2012-09-11 11:09:26.000000000 +0800
++++ libmagic/print.c 2012-09-11 11:33:55.000000000 +0800
@@ -29,6 +29,9 @@
* print.c - debugging printout routines
*/
@@ -2509,206 +2511,9 @@ diff -u libmagic.origin/print.c libmagic/print.c
}
protected const char *
-diff -u libmagic.origin/print.c.rej libmagic/print.c.rej
---- libmagic.origin/print.c.rej 2012-07-15 18:17:24.762087659 +0800
-+++ libmagic/print.c.rej 2012-07-15 18:20:27.186087168 +0800
-@@ -1,12 +1,184 @@
----- libmagic/print.c 2012-05-29 14:34:03.770376387 +0200
--+++ libmagic.orig/print.c 2012-05-29 14:40:41.710960045 +0200
--@@ -29,9 +29,6 @@
-- * print.c - debugging printout routines
-- */
-+--- libmagic.orig/print.c 2012-05-29 14:40:41.710960045 +0200
-++++ libmagic/print.c 2012-05-29 14:34:03.770376387 +0200
-+@@ -48,174 +51,21 @@
-
---#include "php.h"
---#include "main/snprintf.h"
-+ #define SZOF(a) (sizeof(a) / sizeof(a[0]))
-+
-+-#ifndef COMPILE_ONLY
-+-protected void
-+-file_mdump(struct magic *m)
-+-{
-+- private const char optyp[] = { FILE_OPS };
-+-
-+- (void) fprintf(stderr, "%u: %.*s %u", m->lineno,
-+- (m->cont_level & 7) + 1, ">>>>>>>>", m->offset);
-+-
-+- if (m->flag & INDIR) {
-+- (void) fprintf(stderr, "(%s,",
-+- /* Note: type is unsigned */
-+- (m->in_type < file_nnames) ?
-+- file_names[m->in_type] : "*bad*");
-+- if (m->in_op & FILE_OPINVERSE)
-+- (void) fputc('~', stderr);
-+- (void) fprintf(stderr, "%c%u),",
-+- ((size_t)(m->in_op & FILE_OPS_MASK) <
-+- SZOF(optyp)) ?
-+- optyp[m->in_op & FILE_OPS_MASK] : '?',
-+- m->in_offset);
-+- }
-+- (void) fprintf(stderr, " %s%s", (m->flag & UNSIGNED) ? "u" : "",
-+- /* Note: type is unsigned */
-+- (m->type < file_nnames) ? file_names[m->type] : "*bad*");
-+- if (m->mask_op & FILE_OPINVERSE)
-+- (void) fputc('~', stderr);
-+-
-+- if (IS_STRING(m->type)) {
-+- if (m->str_flags) {
-+- (void) fputc('/', stderr);
-+- if (m->str_flags & STRING_COMPACT_WHITESPACE)
-+- (void) fputc(CHAR_COMPACT_WHITESPACE, stderr);
-+- if (m->str_flags & STRING_COMPACT_OPTIONAL_WHITESPACE)
-+- (void) fputc(CHAR_COMPACT_OPTIONAL_WHITESPACE,
-+- stderr);
-+- if (m->str_flags & STRING_IGNORE_LOWERCASE)
-+- (void) fputc(CHAR_IGNORE_LOWERCASE, stderr);
-+- if (m->str_flags & STRING_IGNORE_UPPERCASE)
-+- (void) fputc(CHAR_IGNORE_UPPERCASE, stderr);
-+- if (m->str_flags & REGEX_OFFSET_START)
-+- (void) fputc(CHAR_REGEX_OFFSET_START, stderr);
-+- if (m->str_flags & STRING_TEXTTEST)
-+- (void) fputc(CHAR_TEXTTEST, stderr);
-+- if (m->str_flags & STRING_BINTEST)
-+- (void) fputc(CHAR_BINTEST, stderr);
-+- if (m->str_flags & PSTRING_1_BE)
-+- (void) fputc(CHAR_PSTRING_1_BE, stderr);
-+- if (m->str_flags & PSTRING_2_BE)
-+- (void) fputc(CHAR_PSTRING_2_BE, stderr);
-+- if (m->str_flags & PSTRING_2_LE)
-+- (void) fputc(CHAR_PSTRING_2_LE, stderr);
-+- if (m->str_flags & PSTRING_4_BE)
-+- (void) fputc(CHAR_PSTRING_4_BE, stderr);
-+- if (m->str_flags & PSTRING_4_LE)
-+- (void) fputc(CHAR_PSTRING_4_LE, stderr);
-+- if (m->str_flags & PSTRING_LENGTH_INCLUDES_ITSELF)
-+- (void) fputc(
-+- CHAR_PSTRING_LENGTH_INCLUDES_ITSELF,
-+- stderr);
-+- }
-+- if (m->str_range)
-+- (void) fprintf(stderr, "/%u", m->str_range);
-+- }
-+- else {
-+- if ((size_t)(m->mask_op & FILE_OPS_MASK) < SZOF(optyp))
-+- (void) fputc(optyp[m->mask_op & FILE_OPS_MASK], stderr);
-+- else
-+- (void) fputc('?', stderr);
-+-
-+- if (m->num_mask) {
-+- (void) fprintf(stderr, "%.8llx",
-+- (unsigned long long)m->num_mask);
-+- }
-+- }
-+- (void) fprintf(stderr, ",%c", m->reln);
-+-
-+- if (m->reln != 'x') {
-+- switch (m->type) {
-+- case FILE_BYTE:
-+- case FILE_SHORT:
-+- case FILE_LONG:
-+- case FILE_LESHORT:
-+- case FILE_LELONG:
-+- case FILE_MELONG:
-+- case FILE_BESHORT:
-+- case FILE_BELONG:
-+- (void) fprintf(stderr, "%d", m->value.l);
-+- break;
-+- case FILE_BEQUAD:
-+- case FILE_LEQUAD:
-+- case FILE_QUAD:
-+- (void) fprintf(stderr, "%" INT64_T_FORMAT "d",
-+- (unsigned long long)m->value.q);
-+- break;
-+- case FILE_PSTRING:
-+- case FILE_STRING:
-+- case FILE_REGEX:
-+- case FILE_BESTRING16:
-+- case FILE_LESTRING16:
-+- case FILE_SEARCH:
-+- file_showstr(stderr, m->value.s, (size_t)m->vallen);
-+- break;
-+- case FILE_DATE:
-+- case FILE_LEDATE:
-+- case FILE_BEDATE:
-+- case FILE_MEDATE:
-+- (void)fprintf(stderr, "%s,",
-+- file_fmttime(m->value.l, 1));
-+- break;
-+- case FILE_LDATE:
-+- case FILE_LELDATE:
-+- case FILE_BELDATE:
-+- case FILE_MELDATE:
-+- (void)fprintf(stderr, "%s,",
-+- file_fmttime(m->value.l, 0));
-+- break;
-+- case FILE_QDATE:
-+- case FILE_LEQDATE:
-+- case FILE_BEQDATE:
-+- (void)fprintf(stderr, "%s,",
-+- file_fmttime((uint32_t)m->value.q, 1));
-+- break;
-+- case FILE_QLDATE:
-+- case FILE_LEQLDATE:
-+- case FILE_BEQLDATE:
-+- (void)fprintf(stderr, "%s,",
-+- file_fmttime((uint32_t)m->value.q, 0));
-+- break;
-+- case FILE_FLOAT:
-+- case FILE_BEFLOAT:
-+- case FILE_LEFLOAT:
-+- (void) fprintf(stderr, "%G", m->value.f);
-+- break;
-+- case FILE_DOUBLE:
-+- case FILE_BEDOUBLE:
-+- case FILE_LEDOUBLE:
-+- (void) fprintf(stderr, "%G", m->value.d);
-+- break;
-+- case FILE_DEFAULT:
-+- /* XXX - do anything here? */
-+- break;
-+- default:
-+- (void) fputs("*bad*", stderr);
-+- break;
-+- }
-+- }
-+- (void) fprintf(stderr, ",\"%s\"]\n", m->desc);
-+-}
-+-#endif
-+-
-+ /*VARARGS*/
-+ protected void
-+ file_magwarn(struct magic_set *ms, const char *f, ...)
-+ {
-+ va_list va;
-++ char *expanded_format;
-++ TSRMLS_FETCH();
-+
-+- /* cuz we use stdout for most, stderr here */
-+- (void) fflush(stdout);
- -
-- #include "file.h"
-+- if (ms->file)
-+- (void) fprintf(stderr, "%s, %lu: ", ms->file,
-+- (unsigned long)ms->line);
-+- (void) fprintf(stderr, "Warning: ");
-+ va_start(va, f);
-+- (void) vfprintf(stderr, f, va);
-++ vasprintf(&expanded_format, f, va);
-+ va_end(va);
-+- (void) fputc('\n', stderr);
-++
-++ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Warning: %s", expanded_format);
-++
-++ free(expanded_format);
-+ }
-
-- #ifndef lint
-+ protected const char *
diff -u libmagic.origin/readcdf.c libmagic/readcdf.c
---- libmagic.origin/readcdf.c 2012-07-15 18:17:24.734087660 +0800
-+++ libmagic/readcdf.c 2012-07-15 18:20:42.734087519 +0800
+--- libmagic.origin/readcdf.c 2012-09-11 11:09:26.000000000 +0800
++++ libmagic/readcdf.c 2012-09-11 11:33:55.000000000 +0800
@@ -30,7 +30,11 @@
#endif
@@ -2755,8 +2560,8 @@ diff -u libmagic.origin/readcdf.c libmagic/readcdf.c
if ((ec = strchr(c, '\n')) != NULL)
*ec = '\0';
diff -u libmagic.origin/readelf.c libmagic/readelf.c
---- libmagic.origin/readelf.c 2012-07-15 18:17:25.046087660 +0800
-+++ libmagic/readelf.c 2012-07-15 18:20:42.734087519 +0800
+--- libmagic.origin/readelf.c 2012-09-11 11:09:26.000000000 +0800
++++ libmagic/readelf.c 2012-09-11 11:33:55.000000000 +0800
@@ -49,7 +49,7 @@
off_t, int *, int);
private int doshn(struct magic_set *, int, int, int, off_t, int, size_t,
@@ -2912,8 +2717,8 @@ diff -u libmagic.origin/readelf.c libmagic/readelf.c
if (fstat(fd, &st) == -1) {
diff -u libmagic.origin/softmagic.c libmagic/softmagic.c
---- libmagic.origin/softmagic.c 2012-07-15 18:17:24.722087658 +0800
-+++ libmagic/softmagic.c 2012-07-15 18:20:42.734087519 +0800
+--- libmagic.origin/softmagic.c 2012-09-11 11:09:26.000000000 +0800
++++ libmagic/softmagic.c 2012-09-11 11:33:55.000000000 +0800
@@ -41,6 +41,11 @@
#include <stdlib.h>
#include <time.h>
diff --git a/ext/fileinfo/libmagic/apprentice.c b/ext/fileinfo/libmagic/apprentice.c
index 98bde27a2d..d11bd159a8 100644
--- a/ext/fileinfo/libmagic/apprentice.c
+++ b/ext/fileinfo/libmagic/apprentice.c
@@ -753,11 +753,11 @@ private int
apprentice_load(struct magic_set *ms, struct magic **magicp, uint32_t *nmagicp,
const char *fn, int action)
{
- int errs = 0, mflen = 0;
+ int errs = 0;
struct magic_entry *marray;
uint32_t marraycount, i, mentrycount = 0, starttest;
size_t files = 0, maxfiles = 0;
- char **filearr = NULL, mfn[MAXPATHLEN];
+ char **filearr = NULL;
struct stat st;
DIR *dir;
struct dirent *d;
@@ -776,6 +776,8 @@ apprentice_load(struct magic_set *ms, struct magic **magicp, uint32_t *nmagicp,
/* FIXME: Read file names and sort them to prevent
non-determinism. See Debian bug #488562. */
if (php_sys_stat(fn, &st) == 0 && S_ISDIR(st.st_mode)) {
+ int mflen;
+ char mfn[MAXPATHLEN];
dir = opendir(fn);
if (!dir) {
errs++;
@@ -804,7 +806,7 @@ apprentice_load(struct magic_set *ms, struct magic **magicp, uint32_t *nmagicp,
goto out;
}
}
- filearr[files++] = estrndup(mfn, mflen);
+ filearr[files++] = estrndup(mfn, (mflen > sizeof(mfn) - 1)? sizeof(mfn) - 1: mflen);
}
closedir(dir);
qsort(filearr, files, sizeof(*filearr), cmpstrp);
diff --git a/ext/filter/filter_private.h b/ext/filter/filter_private.h
index daa688b4ac..2ec2f62fae 100644
--- a/ext/filter/filter_private.h
+++ b/ext/filter/filter_private.h
@@ -99,12 +99,14 @@
} \
return; \
-#define PHP_FILTER_TRIM_DEFAULT(p, len) { \
+#define PHP_FILTER_TRIM_DEFAULT(p, len) PHP_FILTER_TRIM_DEFAULT_EX(p, len, 1);
+
+#define PHP_FILTER_TRIM_DEFAULT_EX(p, len, return_if_empty) { \
while ((len > 0) && (*p == ' ' || *p == '\t' || *p == '\r' || *p == '\v' || *p == '\n')) { \
p++; \
len--; \
} \
- if (len < 1) { \
+ if (len < 1 && return_if_empty) { \
RETURN_VALIDATION_FAILED \
} \
while (p[len-1] == ' ' || p[len-1] == '\t' || p[len-1] == '\r' || p[len-1] == '\v' || p[len-1] == '\n') { \
diff --git a/ext/filter/logical_filters.c b/ext/filter/logical_filters.c
index 5c3811ab25..4de6b83e00 100644
--- a/ext/filter/logical_filters.c
+++ b/ext/filter/logical_filters.c
@@ -235,12 +235,15 @@ void php_filter_boolean(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
int len = Z_STRLEN_P(value);
int ret;
- PHP_FILTER_TRIM_DEFAULT(str, len);
+ PHP_FILTER_TRIM_DEFAULT_EX(str, len, 0);
/* returns true for "1", "true", "on" and "yes"
* returns false for "0", "false", "off", "no", and ""
* null otherwise. */
switch (len) {
+ case 0:
+ ret = 0;
+ break;
case 1:
if (*str == '1') {
ret = 1;
@@ -286,7 +289,7 @@ void php_filter_boolean(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
ret = -1;
}
- if (ret == -1) {
+ if (ret == -1) {
RETURN_VALIDATION_FAILED
} else {
zval_dtor(value);
diff --git a/ext/filter/tests/bug49510.phpt b/ext/filter/tests/bug49510.phpt
new file mode 100644
index 0000000000..3f365cc431
--- /dev/null
+++ b/ext/filter/tests/bug49510.phpt
@@ -0,0 +1,36 @@
+--TEST--
+#49510 boolean validation fails with FILTER_NULL_ON_FAILURE
+--FILE--
+<?php
+var_dump(filter_var(false, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE));
+var_dump(filter_var(0, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE));
+var_dump(filter_var("0", FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE));
+var_dump(filter_var("off", FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE));
+var_dump(filter_var("", FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE));
+var_dump(filter_var("false", FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE));
+var_dump(filter_var("no", FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE));
+
+var_dump(filter_var(true, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE));
+var_dump(filter_var(1, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE));
+var_dump(filter_var("1", FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE));
+var_dump(filter_var("on", FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE));
+var_dump(filter_var("yes", FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE));
+
+var_dump(filter_var("invalid", FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE));
+?>
+==DONE==
+--EXPECT--
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+NULL
+==DONE==
diff --git a/ext/gd/libgd/xbm.c b/ext/gd/libgd/xbm.c
index c83b0ad13e..f4165d52b7 100644
--- a/ext/gd/libgd/xbm.c
+++ b/ext/gd/libgd/xbm.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2010 The PHP Group |
+ | Copyright (c) 1997-2012 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/intl/common/common_error.c b/ext/intl/common/common_error.c
index a0ee7c145f..282172224c 100644
--- a/ext/intl/common/common_error.c
+++ b/ext/intl/common/common_error.c
@@ -240,7 +240,9 @@ void intl_expose_icu_error_codes( INIT_FUNC_ARGS )
INTL_EXPOSE_CONST( U_IDNA_ACE_PREFIX_ERROR );
INTL_EXPOSE_CONST( U_IDNA_VERIFICATION_ERROR );
INTL_EXPOSE_CONST( U_IDNA_LABEL_TOO_LONG_ERROR );
+#if U_ICU_VERSION_MAJOR_NUM > 3 || U_ICU_VERSION_MAJOR_NUM == 3 && U_ICU_VERSION_MINOR_NUM >= 6
INTL_EXPOSE_CONST( U_IDNA_ZERO_LENGTH_LABEL_ERROR );
+#endif
#if U_ICU_VERSION_MAJOR_NUM > 3 || U_ICU_VERSION_MAJOR_NUM == 3 && U_ICU_VERSION_MINOR_NUM >= 8
INTL_EXPOSE_CONST( U_IDNA_DOMAIN_NAME_TOO_LONG_ERROR );
#endif
diff --git a/ext/intl/dateformat/dateformat_class.c b/ext/intl/dateformat/dateformat_class.c
index 801ca3379e..49f316f787 100644
--- a/ext/intl/dateformat/dateformat_class.c
+++ b/ext/intl/dateformat/dateformat_class.c
@@ -92,7 +92,7 @@ zend_object_value IntlDateFormatter_object_clone(zval *object TSRMLS_DC)
DATE_FORMAT_METHOD_FETCH_OBJECT_NO_CHECK;
- new_obj_val = IntlDateFormatter_ce_ptr->create_object(IntlDateFormatter_ce_ptr TSRMLS_CC);
+ new_obj_val = IntlDateFormatter_ce_ptr->create_object(Z_OBJCE_P(object) TSRMLS_CC);
new_dfo = (IntlDateFormatter_object *)zend_object_store_get_object_by_handle(new_obj_val.handle TSRMLS_CC);
/* clone standard parts */
zend_objects_clone_members(&new_dfo->zo, new_obj_val, &dfo->zo, handle TSRMLS_CC);
diff --git a/ext/intl/formatter/formatter_class.c b/ext/intl/formatter/formatter_class.c
index 8f399a6773..2246cd29a5 100644
--- a/ext/intl/formatter/formatter_class.c
+++ b/ext/intl/formatter/formatter_class.c
@@ -86,7 +86,7 @@ zend_object_value NumberFormatter_object_clone(zval *object TSRMLS_DC)
NumberFormatter_object *nfo, *new_nfo;
FORMATTER_METHOD_FETCH_OBJECT_NO_CHECK;
- new_obj_val = NumberFormatter_ce_ptr->create_object(NumberFormatter_ce_ptr TSRMLS_CC);
+ new_obj_val = NumberFormatter_ce_ptr->create_object(Z_OBJCE_P(object) TSRMLS_CC);
new_nfo = (NumberFormatter_object *)zend_object_store_get_object_by_handle(new_obj_val.handle TSRMLS_CC);
/* clone standard parts */
zend_objects_clone_members(&new_nfo->zo, new_obj_val, &nfo->zo, handle TSRMLS_CC);
diff --git a/ext/intl/msgformat/msgformat_class.c b/ext/intl/msgformat/msgformat_class.c
index da1e1e595a..bb3b55f39c 100644
--- a/ext/intl/msgformat/msgformat_class.c
+++ b/ext/intl/msgformat/msgformat_class.c
@@ -84,7 +84,7 @@ zend_object_value MessageFormatter_object_clone(zval *object TSRMLS_DC)
MessageFormatter_object *mfo, *new_mfo;
MSG_FORMAT_METHOD_FETCH_OBJECT_NO_CHECK;
- new_obj_val = MessageFormatter_ce_ptr->create_object(MessageFormatter_ce_ptr TSRMLS_CC);
+ new_obj_val = MessageFormatter_ce_ptr->create_object(Z_OBJCE_P(object) TSRMLS_CC);
new_mfo = (MessageFormatter_object *)zend_object_store_get_object_by_handle(new_obj_val.handle TSRMLS_CC);
/* clone standard parts */
zend_objects_clone_members(&new_mfo->zo, new_obj_val, &mfo->zo, handle TSRMLS_CC);
diff --git a/ext/intl/php_intl.c b/ext/intl/php_intl.c
index efe0ddd242..90e3573c1b 100644
--- a/ext/intl/php_intl.c
+++ b/ext/intl/php_intl.c
@@ -70,7 +70,7 @@
#include "idn/idn.h"
-#if U_ICU_VERSION_MAJOR_NUM > 3 && U_ICU_VERSION_MINOR_NUM >=2
+#if U_ICU_VERSION_MAJOR_NUM * 1000 + U_ICU_VERSION_MINOR_NUM >= 4002
# include "spoofchecker/spoofchecker_class.h"
# include "spoofchecker/spoofchecker.h"
# include "spoofchecker/spoofchecker_create.h"
@@ -646,7 +646,7 @@ PHP_MINIT_FUNCTION( intl )
/* Expose IDN constants to PHP scripts. */
idn_register_constants(INIT_FUNC_ARGS_PASSTHRU);
-#if U_ICU_VERSION_MAJOR_NUM > 3 && U_ICU_VERSION_MINOR_NUM >=2
+#if U_ICU_VERSION_MAJOR_NUM * 1000 + U_ICU_VERSION_MINOR_NUM >= 4002
/* Register 'Spoofchecker' PHP class */
spoofchecker_register_Spoofchecker_class( TSRMLS_C );
diff --git a/ext/intl/spoofchecker/spoofchecker_class.c b/ext/intl/spoofchecker/spoofchecker_class.c
index 507a2ca98e..6c2b79034d 100644
--- a/ext/intl/spoofchecker/spoofchecker_class.c
+++ b/ext/intl/spoofchecker/spoofchecker_class.c
@@ -127,7 +127,7 @@ static zend_object_value spoofchecker_clone_obj(zval *object TSRMLS_DC) /* {{{ *
sfo = (Spoofchecker_object *) zend_object_store_get_object(object TSRMLS_CC);
intl_error_reset(SPOOFCHECKER_ERROR_P(sfo) TSRMLS_CC);
- new_obj_val = Spoofchecker_ce_ptr->create_object(Spoofchecker_ce_ptr TSRMLS_CC);
+ new_obj_val = Spoofchecker_ce_ptr->create_object(Z_OBJCE_P(object) TSRMLS_CC);
new_sfo = (Spoofchecker_object *)zend_object_store_get_object_by_handle(new_obj_val.handle TSRMLS_CC);
/* clone standard parts */
zend_objects_clone_members(&new_sfo->zo, new_obj_val, &sfo->zo, handle TSRMLS_CC);
diff --git a/ext/intl/tests/bug62915-2.phpt b/ext/intl/tests/bug62915-2.phpt
new file mode 100644
index 0000000000..bcb069cab6
--- /dev/null
+++ b/ext/intl/tests/bug62915-2.phpt
@@ -0,0 +1,33 @@
+--TEST--
+Bug #62915: cloning of several classes is defective
+--SKIPIF--
+<?php
+if (!extension_loaded('intl'))
+ die('skip intl extension not enabled');
+--FILE--
+<?php
+class A extends IntlDateFormatter {
+ static $ARGS = array("en_US" ,IntlDateFormatter::FULL, IntlDateFormatter::FULL,
+ 'America/Los_Angeles', IntlDateFormatter::GREGORIAN);
+}
+class B extends NumberFormatter {
+ static $ARGS = array('de_DE', NumberFormatter::DECIMAL);
+}
+class C extends MessageFormatter {
+ static $ARGS = array("en_US", "foo");
+}
+class D extends Spoofchecker {
+ static $ARGS = array();
+}
+
+foreach (range('A', 'D') as $subclass) {
+ $rc = new ReflectionClass($subclass);
+ $obj = $rc->newInstanceArgs($subclass::$ARGS);
+ $clone = clone $obj;
+ var_dump(get_class($clone));
+}
+--EXPECT--
+string(1) "A"
+string(1) "B"
+string(1) "C"
+string(1) "D"
diff --git a/ext/intl/transliterator/transliterator_class.c b/ext/intl/transliterator/transliterator_class.c
index 8d4d0649e9..5ef80fb482 100644
--- a/ext/intl/transliterator/transliterator_class.c
+++ b/ext/intl/transliterator/transliterator_class.c
@@ -162,7 +162,7 @@ static zend_object_value Transliterator_clone_obj( zval *object TSRMLS_DC )
to_orig = zend_object_store_get_object( object TSRMLS_CC );
intl_error_reset( INTL_DATA_ERROR_P( to_orig ) TSRMLS_CC );
- ret_val = Transliterator_ce_ptr->create_object( Transliterator_ce_ptr TSRMLS_CC );
+ ret_val = Transliterator_ce_ptr->create_object( Z_OBJCE_P( object ) TSRMLS_CC );
to_new = zend_object_store_get_object_by_handle( ret_val.handle TSRMLS_CC );
zend_objects_clone_members( &to_new->zo, ret_val,
diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c
index 0d2b53a7ca..76654edbf8 100644
--- a/ext/mbstring/mbstring.c
+++ b/ext/mbstring/mbstring.c
@@ -2715,9 +2715,10 @@ PHP_FUNCTION(mb_substr)
char *str, *encoding;
long from, len;
int mblen, str_len, encoding_len;
+ zval **z_len = NULL;
mbfl_string string, result, *ret;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl|ls", &str, &str_len, &from, &len, &encoding, &encoding_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl|Zs", &str, &str_len, &from, &z_len, &encoding, &encoding_len) == FAILURE) {
return;
}
@@ -2736,8 +2737,11 @@ PHP_FUNCTION(mb_substr)
string.val = (unsigned char *)str;
string.len = str_len;
- if (argc < 3) {
+ if (argc < 3 || Z_TYPE_PP(z_len) == IS_NULL) {
len = str_len;
+ } else {
+ convert_to_long_ex(z_len);
+ len = Z_LVAL_PP(z_len);
}
/* measures length */
@@ -2788,13 +2792,14 @@ PHP_FUNCTION(mb_strcut)
char *encoding;
long from, len;
int encoding_len;
+ zval **z_len = NULL;
mbfl_string string, result, *ret;
mbfl_string_init(&string);
string.no_language = MBSTRG(language);
string.no_encoding = MBSTRG(current_internal_encoding)->no_encoding;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl|ls", (char **)&string.val, (int **)&string.len, &from, &len, &encoding, &encoding_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl|Zs", (char **)&string.val, (int **)&string.len, &from, &z_len, &encoding, &encoding_len) == FAILURE) {
return;
}
@@ -2806,8 +2811,11 @@ PHP_FUNCTION(mb_strcut)
}
}
- if (argc < 3) {
+ if (argc < 3 || Z_TYPE_PP(z_len) == IS_NULL) {
len = string.len;
+ } else {
+ convert_to_long_ex(z_len);
+ len = Z_LVAL_PP(z_len);
}
/* if "from" position is negative, count start position from the end
diff --git a/ext/mbstring/tests/mb_str_functions_opt-parameter.phpt b/ext/mbstring/tests/mb_str_functions_opt-parameter.phpt
index e4a235df30..5fb642f9b2 100644
--- a/ext/mbstring/tests/mb_str_functions_opt-parameter.phpt
+++ b/ext/mbstring/tests/mb_str_functions_opt-parameter.phpt
@@ -28,5 +28,3 @@ baz
baz
foo
==DONE==
---XFAIL--
-mb functions fail to allow null instead of actual value
diff --git a/ext/oci8/config.m4 b/ext/oci8/config.m4
index 0634e96288..976eb9e846 100644
--- a/ext/oci8/config.m4
+++ b/ext/oci8/config.m4
@@ -49,8 +49,8 @@ AC_DEFUN([AC_OCI8_CHECK_LIB_DIR],[
AC_DEFUN([AC_OCI8IC_VERSION],[
AC_MSG_CHECKING([Oracle Instant Client library version compatibility])
OCI8_LCS_BASE=$PHP_OCI8_INSTANT_CLIENT/libclntsh.$SHLIB_SUFFIX_NAME
- OCI8_LCS=`ls $OCI8_LCS_BASE.*.1 2> /dev/null | tail -1` # Oracle 10g, 11g etc
- OCI8_NNZ=`ls $PHP_OCI8_INSTANT_CLIENT/libnnz*.$SHLIB_SUFFIX_NAME 2> /dev/null | tail -1`
+ OCI8_LCS=`ls $OCI8_LCS_BASE.*.1 2> /dev/null | tail -n1` # Oracle 10g, 11g etc
+ OCI8_NNZ=`ls $PHP_OCI8_INSTANT_CLIENT/libnnz*.$SHLIB_SUFFIX_NAME 2> /dev/null | tail -n1`
if test -f "$OCI8_NNZ" && test -f "$OCI8_LCS"; then
if test ! -f "$OCI8_LCS_BASE"; then
AC_MSG_ERROR([Link from $OCI8_LCS_BASE to $OCI8_LCS_BASE.*.1 not found])
@@ -65,7 +65,7 @@ AC_DEFUN([AC_OCI8IC_VERSION],[
AC_DEFUN([AC_OCI8_ORACLE_VERSION],[
AC_MSG_CHECKING([Oracle library version compatibility])
OCI8_LCS_BASE=$OCI8_DIR/$OCI8_LIB_DIR/libclntsh.$SHLIB_SUFFIX_NAME
- OCI8_LCS=`ls $OCI8_LCS_BASE.*.1 2> /dev/null | tail -1` # Oracle 10g, 11g etc
+ OCI8_LCS=`ls $OCI8_LCS_BASE.*.1 2> /dev/null | tail -n1` # Oracle 10g, 11g etc
if test -s "$OCI8_DIR/orainst/unix.rgs"; then
OCI8_ORACLE_VERSION=`grep '"ocommon"' $OCI8_DIR/orainst/unix.rgs | $PHP_OCI8_SED 's/[ ][ ]*/:/g' | cut -d: -f 6 | cut -c 2-4`
test -z "$OCI8_ORACLE_VERSION" && OCI8_ORACLE_VERSION=7.3
@@ -278,7 +278,7 @@ if test "$PHP_OCI8" != "no"; then
dnl user must pass in the library directory. But on Linux we default
dnl to the most recent version in /usr/lib which is where the Oracle
dnl Instant Client RPM gets installed.
- PHP_OCI8_INSTANT_CLIENT=`ls -d /usr/lib/oracle/*/client${PHP_OCI8_IC_LIBDIR_SUFFIX}/lib/libclntsh.* 2> /dev/null | tail -1 | $PHP_OCI8_SED -e 's#/libclntsh[^/]*##'`
+ PHP_OCI8_INSTANT_CLIENT=`ls -d /usr/lib/oracle/*/client${PHP_OCI8_IC_LIBDIR_SUFFIX}/lib/libclntsh.* 2> /dev/null | tail -n1 | $PHP_OCI8_SED -e 's#/libclntsh[^/]*##'`
if test -z "$PHP_OCI8_INSTANT_CLIENT"; then
AC_MSG_ERROR([Oracle Instant Client directory /usr/lib/oracle/.../client${PHP_OCI8_IC_LIBDIR_SUFFIX}/lib libraries not found. Try --with-oci8=instantclient,DIR])
fi
diff --git a/ext/oci8/package.xml b/ext/oci8/package.xml
index d3a912832f..eac3f06552 100644
--- a/ext/oci8/package.xml
+++ b/ext/oci8/package.xml
@@ -37,8 +37,8 @@ http://pear.php.net/dtd/package-2.0.xsd">
<time>12:00:00</time>
<version>
- <release>1.4.7</release>
- <api>1.4.7</api>
+ <release>1.4.8</release>
+ <api>1.4.8</api>
</version>
<stability>
<release>stable</release>
@@ -46,11 +46,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
</stability>
<license uri="http://www.php.net/license">PHP</license>
<notes>
- Fixed bug #59985 (show normal warning text for OCI_NO_DATA)
- Fixed OCI8 part of bug #55748 (CVE-2011-4153: multiple NULL pointer dereferences with zend_strndup)
- Fixed OCI8 part of bug #55301 (multiple null pointer dereferences with calloc)
- Increased maximum Oracle error message buffer length for new Oracle 11.2.0.3 size
- Improve internal initalization failure error messages
+ Fixed bug #60901 (Improve "tail" syntax for AIX installation)
</notes>
<contents>
<dir name="/">
@@ -416,6 +412,25 @@ http://pear.php.net/dtd/package-2.0.xsd">
<release>
<version>
+ <release>1.4.7</release>
+ <api>1.4.7</api>
+ </version>
+ <stability>
+ <release>stable</release>
+ <api>stable</api>
+ </stability>
+ <license uri="http://www.php.net/license">PHP</license>
+ <notes>
+ Fixed bug #59985 (show normal warning text for OCI_NO_DATA)
+ Fixed OCI8 part of bug #55748 (CVE-2011-4153: multiple NULL pointer dereferences with zend_strndup)
+ Fixed OCI8 part of bug #55301 (multiple null pointer dereferences with calloc)
+ Increased maximum Oracle error message buffer length for new Oracle 11.2.0.3 size
+ Improve internal initalization failure error messages
+ </notes>
+</release>
+
+<release>
+ <version>
<release>1.4.6</release>
<api>1.4.6</api>
</version>
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index 7187a9601e..2b8cfd571a 100644
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@ -69,7 +69,13 @@
#define OPENSSL_ALGO_MD2 4
#endif
#define OPENSSL_ALGO_DSS1 5
-
+#if OPENSSL_VERSION_NUMBER >= 0x0090708fL
+#define OPENSSL_ALGO_SHA224 6
+#define OPENSSL_ALGO_SHA256 7
+#define OPENSSL_ALGO_SHA384 8
+#define OPENSSL_ALGO_SHA512 9
+#define OPENSSL_ALGO_RMD160 10
+#endif
#define DEBUG_SMIME 0
/* FIXME: Use the openssl constants instead of
@@ -954,6 +960,23 @@ static EVP_MD * php_openssl_get_evp_md_from_algo(long algo) { /* {{{ */
case OPENSSL_ALGO_DSS1:
mdtype = (EVP_MD *) EVP_dss1();
break;
+#if OPENSSL_VERSION_NUMBER >= 0x0090708fL
+ case OPENSSL_ALGO_SHA224:
+ mdtype = (EVP_MD *) EVP_sha224();
+ break;
+ case OPENSSL_ALGO_SHA256:
+ mdtype = (EVP_MD *) EVP_sha256();
+ break;
+ case OPENSSL_ALGO_SHA384:
+ mdtype = (EVP_MD *) EVP_sha384();
+ break;
+ case OPENSSL_ALGO_SHA512:
+ mdtype = (EVP_MD *) EVP_sha512();
+ break;
+ case OPENSSL_ALGO_RMD160:
+ mdtype = (EVP_MD *) EVP_ripemd160();
+ break;
+#endif
default:
return NULL;
break;
@@ -1048,6 +1071,13 @@ PHP_MINIT_FUNCTION(openssl)
REGISTER_LONG_CONSTANT("OPENSSL_ALGO_MD2", OPENSSL_ALGO_MD2, CONST_CS|CONST_PERSISTENT);
#endif
REGISTER_LONG_CONSTANT("OPENSSL_ALGO_DSS1", OPENSSL_ALGO_DSS1, CONST_CS|CONST_PERSISTENT);
+#if OPENSSL_VERSION_NUMBER >= 0x0090708fL
+ REGISTER_LONG_CONSTANT("OPENSSL_ALGO_SHA224", OPENSSL_ALGO_SHA224, CONST_CS|CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("OPENSSL_ALGO_SHA256", OPENSSL_ALGO_SHA256, CONST_CS|CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("OPENSSL_ALGO_SHA384", OPENSSL_ALGO_SHA384, CONST_CS|CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("OPENSSL_ALGO_SHA512", OPENSSL_ALGO_SHA512, CONST_CS|CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("OPENSSL_ALGO_RMD160", OPENSSL_ALGO_RMD160, CONST_CS|CONST_PERSISTENT);
+#endif
/* flags for S/MIME */
REGISTER_LONG_CONSTANT("PKCS7_DETACHED", PKCS7_DETACHED, CONST_CS|CONST_PERSISTENT);
diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c
index c9d707280c..f61364cde9 100644
--- a/ext/pcre/php_pcre.c
+++ b/ext/pcre/php_pcre.c
@@ -275,7 +275,8 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(char *regex, int regex_le
get to the end without encountering a delimiter. */
while (isspace((int)*(unsigned char *)p)) p++;
if (*p == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty regular expression");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ p < regex + regex_len ? "Null byte in regex" : "Empty regular expression");
return NULL;
}
@@ -292,21 +293,18 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(char *regex, int regex_le
delimiter = pp[5];
end_delimiter = delimiter;
+ pp = p;
+
if (start_delimiter == end_delimiter) {
/* We need to iterate through the pattern, searching for the ending delimiter,
but skipping the backslashed delimiters. If the ending delimiter is not
found, display a warning. */
- pp = p;
while (*pp != 0) {
if (*pp == '\\' && pp[1] != 0) pp++;
else if (*pp == delimiter)
break;
pp++;
}
- if (*pp == 0) {
- php_error_docref(NULL TSRMLS_CC,E_WARNING, "No ending delimiter '%c' found", delimiter);
- return NULL;
- }
} else {
/* We iterate through the pattern, searching for the matching ending
* delimiter. For each matching starting delimiter, we increment nesting
@@ -314,7 +312,6 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(char *regex, int regex_le
* reach the end of the pattern without matching, display a warning.
*/
int brackets = 1; /* brackets nesting level */
- pp = p;
while (*pp != 0) {
if (*pp == '\\' && pp[1] != 0) pp++;
else if (*pp == end_delimiter && --brackets <= 0)
@@ -323,10 +320,17 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(char *regex, int regex_le
brackets++;
pp++;
}
- if (*pp == 0) {
- php_error_docref(NULL TSRMLS_CC,E_WARNING, "No ending matching delimiter '%c' found", end_delimiter);
- return NULL;
+ }
+
+ if (*pp == 0) {
+ if (pp < regex + regex_len) {
+ php_error_docref(NULL TSRMLS_CC,E_WARNING, "Null byte in regex");
+ } else if (start_delimiter == end_delimiter) {
+ php_error_docref(NULL TSRMLS_CC,E_WARNING, "No ending delimiter '%c' found", delimiter);
+ } else {
+ php_error_docref(NULL TSRMLS_CC,E_WARNING, "No ending matching delimiter '%c' found", delimiter);
}
+ return NULL;
}
/* Make a copy of the actual pattern. */
@@ -337,7 +341,7 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(char *regex, int regex_le
/* Parse through the options, setting appropriate flags. Display
a warning if we encounter an unknown modifier. */
- while (*pp != 0) {
+ while (pp < regex + regex_len) {
switch (*pp++) {
/* Perl compatible options */
case 'i': coptions |= PCRE_CASELESS; break;
@@ -368,7 +372,11 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(char *regex, int regex_le
break;
default:
- php_error_docref(NULL TSRMLS_CC,E_WARNING, "Unknown modifier '%c'", pp[-1]);
+ if (pp[-1]) {
+ php_error_docref(NULL TSRMLS_CC,E_WARNING, "Unknown modifier '%c'", pp[-1]);
+ } else {
+ php_error_docref(NULL TSRMLS_CC,E_WARNING, "Null byte in regex");
+ }
efree(pattern);
return NULL;
}
diff --git a/ext/pcre/tests/null_bytes.phpt b/ext/pcre/tests/null_bytes.phpt
new file mode 100644
index 0000000000..9a3f433ffb
--- /dev/null
+++ b/ext/pcre/tests/null_bytes.phpt
@@ -0,0 +1,42 @@
+--TEST--
+Zero byte test
+--FILE--
+<?php
+
+preg_match("\0//i", "");
+preg_match("/\0/i", "");
+preg_match("//\0i", "");
+preg_match("//i\0", "");
+preg_match("/\\\0/i", "");
+
+preg_match("\0[]i", "");
+preg_match("[\0]i", "");
+preg_match("[]\0i", "");
+preg_match("[]i\0", "");
+preg_match("[\\\0]i", "");
+
+preg_replace("/foo/e\0/i", "echo('Eek');", "");
+
+?>
+--EXPECTF--
+Warning: preg_match(): Null byte in regex in %snull_bytes.php on line 3
+
+Warning: preg_match(): Null byte in regex in %snull_bytes.php on line 4
+
+Warning: preg_match(): Null byte in regex in %snull_bytes.php on line 5
+
+Warning: preg_match(): Null byte in regex in %snull_bytes.php on line 6
+
+Warning: preg_match(): Null byte in regex in %snull_bytes.php on line 7
+
+Warning: preg_match(): Null byte in regex in %snull_bytes.php on line 9
+
+Warning: preg_match(): Null byte in regex in %snull_bytes.php on line 10
+
+Warning: preg_match(): Null byte in regex in %snull_bytes.php on line 11
+
+Warning: preg_match(): Null byte in regex in %snull_bytes.php on line 12
+
+Warning: preg_match(): Null byte in regex in %snull_bytes.php on line 13
+
+Warning: preg_replace(): Null byte in regex in %snull_bytes.php on line 15
diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c
index 84d603b591..5addec4ff2 100644
--- a/ext/soap/php_encoding.c
+++ b/ext/soap/php_encoding.c
@@ -1818,11 +1818,12 @@ static int model_to_xml_object(xmlNodePtr node, sdlContentModelPtr model, zval *
zend_hash_internal_pointer_reset_ex(model->u.content, &pos);
while (zend_hash_get_current_data_ex(model->u.content, (void**)&tmp, &pos) == SUCCESS) {
- if (!model_to_xml_object(node, *tmp, object, style, (*tmp)->min_occurs > 0 TSRMLS_CC)) {
- if ((*tmp)->min_occurs > 0) {
+ if (!model_to_xml_object(node, *tmp, object, style, strict && ((*tmp)->min_occurs > 0) TSRMLS_CC)) {
+ if (!strict || (*tmp)->min_occurs > 0) {
return 0;
}
}
+ strict = 1;
zend_hash_move_forward_ex(model->u.content, &pos);
}
return 1;
@@ -1845,7 +1846,7 @@ static int model_to_xml_object(xmlNodePtr node, sdlContentModelPtr model, zval *
return ret;
}
case XSD_CONTENT_GROUP: {
- return model_to_xml_object(node, model->u.group->model, object, style, model->min_occurs > 0 TSRMLS_CC);
+ return model_to_xml_object(node, model->u.group->model, object, style, strict && model->min_occurs > 0 TSRMLS_CC);
}
default:
break;
diff --git a/ext/soap/tests/bugs/bug50997.phpt b/ext/soap/tests/bugs/bug50997.phpt
new file mode 100644
index 0000000000..0508aaccdc
--- /dev/null
+++ b/ext/soap/tests/bugs/bug50997.phpt
@@ -0,0 +1,16 @@
+--TEST--
+Bug #50997 (SOAP Error when trying to submit 2nd Element of a choice)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--INI--
+soap.wsdl_cache_enabled=0
+--FILE--
+<?php
+$soapClient = new SoapClient(__DIR__ . '/bug50997.wsdl', array('trace' => 1, 'exceptions'=>0));
+$params = array('code'=>'foo');
+$soapClient->newOperation($params);
+echo $soapClient->__getLastRequest();
+?>
+--EXPECT--
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.example.org/service2/"><SOAP-ENV:Body><ns1:NewOperation><code>foo</code></ns1:NewOperation></SOAP-ENV:Body></SOAP-ENV:Envelope>
diff --git a/ext/soap/tests/bugs/bug50997.wsdl b/ext/soap/tests/bugs/bug50997.wsdl
new file mode 100644
index 0000000000..16c6d36752
--- /dev/null
+++ b/ext/soap/tests/bugs/bug50997.wsdl
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.example.org/service2/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="service2" targetNamespace="http://www.example.org/service2/">
+ <wsdl:types>
+ <xsd:schema targetNamespace="http://www.example.org/service2/">
+ <xsd:element name="NewOperation">
+ <xsd:complexType>
+ <xsd:choice>
+ <xsd:sequence>
+ <xsd:element name="firstName" type="xsd:string"> </xsd:element>
+ <xsd:element name="surName" type="xsd:string"/>
+ </xsd:sequence>
+ <xsd:element name="code" type="xsd:string"/>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="NewOperationResponse">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="out" type="xsd:string"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ </wsdl:types>
+ <wsdl:message name="NewOperationRequest">
+ <wsdl:part element="tns:NewOperation" name="parameters"/>
+ </wsdl:message>
+ <wsdl:message name="NewOperationResponse">
+ <wsdl:part element="tns:NewOperationResponse" name="parameters"/>
+ </wsdl:message>
+ <wsdl:portType name="service2">
+ <wsdl:operation name="NewOperation">
+ <wsdl:input message="tns:NewOperationRequest"/>
+ <wsdl:output message="tns:NewOperationResponse"/>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="service2SOAP" type="tns:service2">
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="NewOperation">
+ <soap:operation soapAction="http://www.example.org/service2/NewOperation"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="service2">
+ <wsdl:port binding="tns:service2SOAP" name="service2SOAP">
+ <soap:address location="test://"/>
+ </wsdl:port>
+ </wsdl:service>
+ </wsdl:definitions>
diff --git a/ext/sockets/multicast.h b/ext/sockets/multicast.h
index ccd9b1d2a8..5619c9c7fb 100644
--- a/ext/sockets/multicast.h
+++ b/ext/sockets/multicast.h
@@ -19,11 +19,12 @@
/* $Id$ */
#if defined(MCAST_JOIN_GROUP) && \
- (!defined(PHP_WIN32) || (_WIN32_WINNT >= 0x600 && SOCKETS_ENABLE_VISTA_API))
+ (!defined(PHP_WIN32) || (_WIN32_WINNT >= 0x600 && SOCKETS_ENABLE_VISTA_API)) && \
+ !defined(__APPLE__)
#define RFC3678_API 1
/* has block/unblock and source membership, in this case for both IPv4 and IPv6 */
#define HAS_MCAST_EXT 1
-#elif defined(IP_ADD_SOURCE_MEMBERSHIP)
+#elif defined(IP_ADD_SOURCE_MEMBERSHIP) && !defined(__APPLE__)
/* has block/unblock and source membership, but only for IPv4 */
#define HAS_MCAST_EXT 1
#endif
diff --git a/ext/sockets/tests/bug63000.phpt b/ext/sockets/tests/bug63000.phpt
new file mode 100644
index 0000000000..c806ba4c08
--- /dev/null
+++ b/ext/sockets/tests/bug63000.phpt
@@ -0,0 +1,22 @@
+--TEST--
+Bug #63000: Multicast on OSX
+--SKIPIF--
+<?php
+if (!extension_loaded('sockets')) {
+ die('skip sockets extension not available.');
+}
+if (PHP_OS !== 'Darwin') {
+ die('is not OSX.');
+}
+--FILE--
+<?php
+$socket = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
+socket_bind($socket, '0.0.0.0', 31057);
+
+$so = socket_set_option($socket, IPPROTO_IP, MCAST_JOIN_GROUP, array(
+ "group" => '224.0.0.251',
+ "interface" => 0,
+));
+var_dump($so);
+--EXPECTF--
+bool(true)
diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c
index 1e4577a3f9..3c6b41edbc 100755
--- a/ext/spl/spl_array.c
+++ b/ext/spl/spl_array.c
@@ -306,41 +306,41 @@ static zval **spl_array_get_dimension_ptr_ptr(int check_inherited, zval *object,
long index;
HashTable *ht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
-/* We cannot get the pointer pointer so we don't allow it here for now
- if (check_inherited && intern->fptr_offset_get) {
- return zend_call_method_with_1_params(&object, Z_OBJCE_P(object), &intern->fptr_offset_get, "offsetGet", NULL, offset);
- }*/
-
if (!offset) {
return &EG(uninitialized_zval_ptr);
}
if ((type == BP_VAR_W || type == BP_VAR_RW) && (ht->nApplyCount > 0)) {
zend_error(E_WARNING, "Modification of ArrayObject during sorting is prohibited");
- return &EG(uninitialized_zval_ptr);;
+ return &EG(error_zval_ptr);;
}
switch(Z_TYPE_P(offset)) {
+ case IS_NULL:
+ Z_STRVAL_P(offset) = "";
+ Z_STRLEN_P(offset) = 0;
case IS_STRING:
if (zend_symtable_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, (void **) &retval) == FAILURE) {
- if (type == BP_VAR_W || type == BP_VAR_RW) {
- zval *value;
- ALLOC_INIT_ZVAL(value);
- zend_symtable_update(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, (void**)&value, sizeof(void*), NULL);
- if (zend_symtable_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, (void **) &retval) != FAILURE) {
- return retval;
- } else {
- return &EG(uninitialized_zval_ptr);
+ switch (type) {
+ case BP_VAR_R:
+ zend_error(E_NOTICE, "Undefined index: %s", Z_STRVAL_P(offset));
+ case BP_VAR_UNSET:
+ case BP_VAR_IS:
+ retval = &EG(uninitialized_zval_ptr);
+ break;
+ case BP_VAR_RW:
+ zend_error(E_NOTICE,"Undefined index: %s", Z_STRVAL_P(offset));
+ case BP_VAR_W: {
+ zval *value;
+ ALLOC_INIT_ZVAL(value);
+ zend_symtable_update(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, (void**)&value, sizeof(void*), (void **)&retval);
}
- } else {
- zend_error(E_NOTICE, "Undefined index: %s", Z_STRVAL_P(offset));
- return &EG(uninitialized_zval_ptr);
}
- } else {
- return retval;
}
- case IS_DOUBLE:
+ return retval;
case IS_RESOURCE:
+ zend_error(E_STRICT, "Resource ID#%ld used as offset, casting to integer (%ld)", Z_LVAL_P(offset), Z_LVAL_P(offset));
+ case IS_DOUBLE:
case IS_BOOL:
case IS_LONG:
if (offset->type == IS_DOUBLE) {
@@ -349,26 +349,27 @@ static zval **spl_array_get_dimension_ptr_ptr(int check_inherited, zval *object,
index = Z_LVAL_P(offset);
}
if (zend_hash_index_find(ht, index, (void **) &retval) == FAILURE) {
- if (type == BP_VAR_W || type == BP_VAR_RW) {
- zval *value;
- ALLOC_INIT_ZVAL(value);
- zend_hash_index_update(ht, index, (void**)&value, sizeof(void*), NULL);
- if (zend_hash_index_find(ht, index, (void **) &retval) != FAILURE) {
- return retval;
- } else {
- return &EG(uninitialized_zval_ptr);
- }
- } else {
- zend_error(E_NOTICE, "Undefined offset: %ld", index);
- return &EG(uninitialized_zval_ptr);
+ switch (type) {
+ case BP_VAR_R:
+ zend_error(E_NOTICE, "Undefined offset: %ld", index);
+ case BP_VAR_UNSET:
+ case BP_VAR_IS:
+ retval = &EG(uninitialized_zval_ptr);
+ break;
+ case BP_VAR_RW:
+ zend_error(E_NOTICE, "Undefined offset: %ld", index);
+ case BP_VAR_W: {
+ zval *value;
+ ALLOC_INIT_ZVAL(value);
+ zend_hash_index_update(ht, index, (void**)&value, sizeof(void*), (void **)&retval);
+ }
}
- } else {
- return retval;
}
- break;
+ return retval;
default:
zend_error(E_WARNING, "Illegal offset type");
- return &EG(uninitialized_zval_ptr);
+ return (type == BP_VAR_W || type == BP_VAR_RW) ?
+ &EG(error_zval_ptr) : &EG(uninitialized_zval_ptr);
}
} /* }}} */
@@ -519,11 +520,11 @@ static void spl_array_unset_dimension_ex(int check_inherited, zval *object, zval
}
if (ht == &EG(symbol_table)) {
if (zend_delete_global_variable(Z_STRVAL_P(offset), Z_STRLEN_P(offset) TSRMLS_CC)) {
- zend_error(E_NOTICE,"Undefined index: %s", Z_STRVAL_P(offset));
+ zend_error(E_NOTICE,"Undefined index: %s", Z_STRVAL_P(offset));
}
} else {
if (zend_symtable_del(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1) == FAILURE) {
- zend_error(E_NOTICE,"Undefined index: %s", Z_STRVAL_P(offset));
+ zend_error(E_NOTICE,"Undefined index: %s", Z_STRVAL_P(offset));
} else {
spl_array_object *obj = intern;
@@ -569,7 +570,7 @@ static void spl_array_unset_dimension_ex(int check_inherited, zval *object, zval
return;
}
if (zend_hash_index_del(ht, index) == FAILURE) {
- zend_error(E_NOTICE,"Undefined offset: %ld", Z_LVAL_P(offset));
+ zend_error(E_NOTICE,"Undefined offset: %ld", Z_LVAL_P(offset));
}
break;
default:
@@ -713,7 +714,6 @@ SPL_METHOD(Array, offsetSet)
spl_array_write_dimension_ex(0, getThis(), index, value TSRMLS_CC);
} /* }}} */
-
void spl_array_iterator_append(zval *object, zval *append_value TSRMLS_DC) /* {{{ */
{
spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC);
diff --git a/ext/spl/spl_iterators.c b/ext/spl/spl_iterators.c
index e5dc030730..098d7dc1e2 100755
--- a/ext/spl/spl_iterators.c
+++ b/ext/spl/spl_iterators.c
@@ -2820,7 +2820,7 @@ SPL_METHOD(CachingIterator, offsetGet)
}
if (zend_symtable_find(HASH_OF(intern->u.caching.zcache), arKey, nKeyLength+1, (void**)&value) == FAILURE) {
- zend_error(E_NOTICE, "Undefined index: %s", arKey);
+ zend_error(E_NOTICE, "Undefined index: %s", arKey);
return;
}
diff --git a/ext/spl/tests/RecursiveDirectoryIterator_getSubPath_basic.phpt b/ext/spl/tests/RecursiveDirectoryIterator_getSubPath_basic.phpt
new file mode 100644
index 0000000000..f0b2b0182c
--- /dev/null
+++ b/ext/spl/tests/RecursiveDirectoryIterator_getSubPath_basic.phpt
@@ -0,0 +1,50 @@
+--TEST--
+RecursiveDirectoryIterator::getBasePath() - basic test
+--CREDITS--
+Pawel Krynicki <pawel [dot] krynicki [at] xsolve [dot] pl>
+#testfest AmsterdamPHP 2012-06-23
+--FILE--
+<?php
+$depth0 = "depth0";
+$depth1 = 'depth1';
+$depth2 = 'depth2';
+$targetDir = __DIR__ . DIRECTORY_SEPARATOR . $depth0 . DIRECTORY_SEPARATOR . $depth1 . DIRECTORY_SEPARATOR . $depth2;
+mkdir($targetDir, 0777, true);
+touch($targetDir . DIRECTORY_SEPARATOR . 'getSubPath_test.tmp');
+$iterator = new RecursiveDirectoryIterator(__DIR__ . DIRECTORY_SEPARATOR . $depth0);
+$it = new RecursiveIteratorIterator($iterator);
+
+$list = [];
+while($it->valid()) {
+ $list[] = $it->getSubPath();
+ $it->next();
+}
+asort($list);
+foreach ($list as $item) {
+ echo $item . "\n";
+}
+?>
+--CLEAN--
+<?php
+function rrmdir($dir) {
+ foreach(glob($dir . '/*') as $file) {
+ if(is_dir($file)) {
+ rrmdir($file);
+ } else {
+ unlink($file);
+ }
+ }
+
+ rmdir($dir);
+}
+
+$targetDir = __DIR__.DIRECTORY_SEPARATOR . "depth0";
+rrmdir($targetDir);
+?>
+
+--EXPECTF--
+depth1
+depth1
+depth1%cdepth2
+depth1%cdepth2
+depth1%cdepth2
diff --git a/ext/spl/tests/RecursiveDirectoryIterator_getSubPathname_basic.phpt b/ext/spl/tests/RecursiveDirectoryIterator_getSubPathname_basic.phpt
new file mode 100644
index 0000000000..7b12672e14
--- /dev/null
+++ b/ext/spl/tests/RecursiveDirectoryIterator_getSubPathname_basic.phpt
@@ -0,0 +1,56 @@
+--TEST--
+RecursiveDirectoryIterator::getBasePathname() - basic test
+--CREDITS--
+Pawel Krynicki <pawel [dot] krynicki [at] xsolve [dot] pl>
+#testfest AmsterdamPHP 2012-06-23
+--FILE--
+<?php
+$depth0 = "depth0";
+$depth1 = "depth1";
+$depth2 = "depth2";
+$targetDir = __DIR__ . DIRECTORY_SEPARATOR . $depth0 . DIRECTORY_SEPARATOR . $depth1 . DIRECTORY_SEPARATOR . $depth2;
+mkdir($targetDir, 0777, true);
+touch($targetDir . DIRECTORY_SEPARATOR . 'getSubPathname_test_2.tmp');
+touch(__DIR__ . DIRECTORY_SEPARATOR . $depth0 . DIRECTORY_SEPARATOR . $depth1 . DIRECTORY_SEPARATOR . 'getSubPathname_test_3.tmp');
+touch(__DIR__ . DIRECTORY_SEPARATOR . $depth0 . DIRECTORY_SEPARATOR . 'getSubPathname_test_1.tmp');
+$iterator = new RecursiveDirectoryIterator(__DIR__ . DIRECTORY_SEPARATOR . $depth0);
+$it = new RecursiveIteratorIterator($iterator);
+
+$list = [];
+$it->rewind(); //see https://bugs.php.net/bug.php?id=62914
+while($it->valid()) {
+ $list[] = $it->getSubPathname();
+ $it->next();
+}
+asort($list);
+foreach ($list as $item) {
+ echo $item . "\n";
+}
+?>
+--CLEAN--
+<?php
+function rrmdir($dir) {
+ foreach(glob($dir . '/*') as $file) {
+ if(is_dir($file)) {
+ rrmdir($file);
+ } else {
+ unlink($file);
+ }
+ }
+
+ rmdir($dir);
+}
+
+$targetDir = __DIR__ . DIRECTORY_SEPARATOR . "depth0";
+rrmdir($targetDir);
+?>
+--EXPECTF--
+.
+..
+depth1%c.
+depth1%c..
+depth1%cdepth2%c.
+depth1%cdepth2%c..
+depth1%cdepth2%cgetSubPathname_test_2.tmp
+depth1%cgetSubPathname_test_3.tmp
+getSubPathname_test_1.tmp
diff --git a/ext/spl/tests/arrayObject___construct_basic2.phpt b/ext/spl/tests/arrayObject___construct_basic2.phpt
index 9ff0e4257a..bd27c42774 100644
--- a/ext/spl/tests/arrayObject___construct_basic2.phpt
+++ b/ext/spl/tests/arrayObject___construct_basic2.phpt
@@ -63,7 +63,7 @@ bool(true)
Notice: Undefined property: ArrayObject::$prop in %s on line 40
-Notice: Undefined index: prop in %s on line 40
+Notice: Undefined index: prop in %s on line 40
NULL
NULL
- After:
@@ -91,7 +91,7 @@ bool(true)
Notice: Undefined property: MyArrayObject::$prop in %s on line 40
-Notice: Undefined index: prop in %s on line 40
+Notice: Undefined index: prop in %s on line 40
NULL
NULL
- After:
diff --git a/ext/spl/tests/arrayObject___construct_basic3.phpt b/ext/spl/tests/arrayObject___construct_basic3.phpt
index 1abd1a1ab1..11a17a6dc4 100644
--- a/ext/spl/tests/arrayObject___construct_basic3.phpt
+++ b/ext/spl/tests/arrayObject___construct_basic3.phpt
@@ -63,7 +63,7 @@ bool(true)
Notice: Undefined property: ArrayObject::$prop in %s on line 40
-Notice: Undefined index: prop in %s on line 40
+Notice: Undefined index: prop in %s on line 40
NULL
NULL
- After:
@@ -91,7 +91,7 @@ bool(true)
Notice: Undefined property: MyArrayObject::$prop in %s on line 40
-Notice: Undefined index: prop in %s on line 40
+Notice: Undefined index: prop in %s on line 40
NULL
NULL
- After:
diff --git a/ext/spl/tests/arrayObject___construct_basic4.phpt b/ext/spl/tests/arrayObject___construct_basic4.phpt
index 80f5e0861e..b0809de0d4 100644
--- a/ext/spl/tests/arrayObject___construct_basic4.phpt
+++ b/ext/spl/tests/arrayObject___construct_basic4.phpt
@@ -61,11 +61,11 @@ bool(true)
bool(true)
- Unset:
-Notice: Undefined index: prop in %s on line 39
+Notice: Undefined index: prop in %s on line 39
-Notice: Undefined index: prop in %s on line 40
+Notice: Undefined index: prop in %s on line 40
-Notice: Undefined index: prop in %s on line 40
+Notice: Undefined index: prop in %s on line 40
NULL
NULL
- After:
@@ -91,9 +91,9 @@ bool(true)
bool(true)
- Unset:
-Notice: Undefined index: prop in %s on line 40
+Notice: Undefined index: prop in %s on line 40
-Notice: Undefined index: prop in %s on line 40
+Notice: Undefined index: prop in %s on line 40
NULL
NULL
- After:
diff --git a/ext/spl/tests/arrayObject___construct_basic5.phpt b/ext/spl/tests/arrayObject___construct_basic5.phpt
index 5368d250a1..8c44ee2ce4 100644
--- a/ext/spl/tests/arrayObject___construct_basic5.phpt
+++ b/ext/spl/tests/arrayObject___construct_basic5.phpt
@@ -61,11 +61,11 @@ bool(true)
bool(true)
- Unset:
-Notice: Undefined index: prop in %s on line 39
+Notice: Undefined index: prop in %s on line 39
-Notice: Undefined index: prop in %s on line 40
+Notice: Undefined index: prop in %s on line 40
-Notice: Undefined index: prop in %s on line 40
+Notice: Undefined index: prop in %s on line 40
NULL
NULL
- After:
@@ -91,9 +91,9 @@ bool(true)
bool(true)
- Unset:
-Notice: Undefined index: prop in %s on line 40
+Notice: Undefined index: prop in %s on line 40
-Notice: Undefined index: prop in %s on line 40
+Notice: Undefined index: prop in %s on line 40
NULL
NULL
- After:
diff --git a/ext/spl/tests/arrayObject_magicMethods1.phpt b/ext/spl/tests/arrayObject_magicMethods1.phpt
index b1de4a951e..ec4812f107 100644
--- a/ext/spl/tests/arrayObject_magicMethods1.phpt
+++ b/ext/spl/tests/arrayObject_magicMethods1.phpt
@@ -102,7 +102,7 @@ object(ArrayObject)#2 (1) {
--> Read existent, non-existent and dynamic:
string(7) "changed"
-Notice: Undefined index: nonexistent in %s on line 42
+Notice: Undefined index: nonexistent in %s on line 42
NULL
string(11) "new.changed"
Original wrapped object:
@@ -171,7 +171,7 @@ object(ArrayObject)#2 (1) {
--> Unset existent, non-existent and dynamic:
-Notice: Undefined index: nonexistent in %s on line 60
+Notice: Undefined index: nonexistent in %s on line 60
Original wrapped object:
object(UsesMagic)#1 (3) {
["b"]=>
diff --git a/ext/spl/tests/arrayObject_magicMethods3.phpt b/ext/spl/tests/arrayObject_magicMethods3.phpt
index 16a6a3b80c..6231ceabb7 100644
--- a/ext/spl/tests/arrayObject_magicMethods3.phpt
+++ b/ext/spl/tests/arrayObject_magicMethods3.phpt
@@ -102,7 +102,7 @@ object(ArrayObject)#2 (1) {
--> Read existent, non-existent and dynamic:
string(7) "changed"
-Notice: Undefined index: nonexistent in %s on line 42
+Notice: Undefined index: nonexistent in %s on line 42
NULL
string(11) "new.changed"
Original wrapped object:
@@ -171,7 +171,7 @@ object(ArrayObject)#2 (1) {
--> Unset existent, non-existent and dynamic:
-Notice: Undefined index: nonexistent in %s on line 60
+Notice: Undefined index: nonexistent in %s on line 60
Original wrapped object:
object(UsesMagic)#1 (3) {
["b"]=>
diff --git a/ext/spl/tests/arrayObject_magicMethods4.phpt b/ext/spl/tests/arrayObject_magicMethods4.phpt
index 3c9f78781a..9580dc5ae7 100644
--- a/ext/spl/tests/arrayObject_magicMethods4.phpt
+++ b/ext/spl/tests/arrayObject_magicMethods4.phpt
@@ -107,7 +107,7 @@ object(UsesMagic)#2 (2) {
--> Read existent, non-existent and dynamic:
string(7) "changed"
-Notice: Undefined index: nonexistent in %s on line 45
+Notice: Undefined index: nonexistent in %s on line 45
NULL
string(11) "new.changed"
Original wrapped object:
@@ -180,7 +180,7 @@ object(UsesMagic)#2 (2) {
--> Unset existent, non-existent and dynamic:
-Notice: Undefined index: nonexistent in %s on line 63
+Notice: Undefined index: nonexistent in %s on line 63
Original wrapped object:
object(C)#1 (3) {
["b"]=>
diff --git a/ext/spl/tests/arrayObject_magicMethods6.phpt b/ext/spl/tests/arrayObject_magicMethods6.phpt
index 45a0e4a768..b43f56c2b0 100644
--- a/ext/spl/tests/arrayObject_magicMethods6.phpt
+++ b/ext/spl/tests/arrayObject_magicMethods6.phpt
@@ -107,7 +107,7 @@ object(UsesMagic)#2 (2) {
--> Read existent, non-existent and dynamic:
string(7) "changed"
-Notice: Undefined index: nonexistent in %s on line 45
+Notice: Undefined index: nonexistent in %s on line 45
NULL
string(11) "new.changed"
Original wrapped object:
@@ -180,7 +180,7 @@ object(UsesMagic)#2 (2) {
--> Unset existent, non-existent and dynamic:
-Notice: Undefined index: nonexistent in %s on line 63
+Notice: Undefined index: nonexistent in %s on line 63
Original wrapped object:
object(C)#1 (3) {
["b"]=>
diff --git a/ext/spl/tests/arrayObject_setFlags_basic1.phpt b/ext/spl/tests/arrayObject_setFlags_basic1.phpt
index d8d4f2e96d..391b0eeae7 100644
--- a/ext/spl/tests/arrayObject_setFlags_basic1.phpt
+++ b/ext/spl/tests/arrayObject_setFlags_basic1.phpt
@@ -44,8 +44,8 @@ string(21) "array element.changed"
--> Remove the array element and try access again:
bool(false)
-Notice: Undefined index: p in %s on line 10
+Notice: Undefined index: p in %s on line 10
NULL
-Notice: Undefined index: p in %s on line 12
+Notice: Undefined index: p in %s on line 12
string(8) ".changed"
diff --git a/ext/spl/tests/array_001.phpt b/ext/spl/tests/array_001.phpt
index d9fb57c4ce..b55fcba1fd 100755
--- a/ext/spl/tests/array_001.phpt
+++ b/ext/spl/tests/array_001.phpt
@@ -79,15 +79,15 @@ object(ArrayObject)#%d (1) {
}
int(0)
-Notice: Undefined offset: 6 in %sarray_001.php on line %d
+Notice: Undefined offset: 6 in %sarray_001.php on line %d
NULL
-Notice: Undefined index: b in %sarray_001.php on line %d
+Notice: Undefined index: b in %sarray_001.php on line %d
NULL
-Notice: Undefined offset: 7 in %sarray_001.php on line %d
+Notice: Undefined offset: 7 in %sarray_001.php on line %d
-Notice: Undefined index: c in %sarray_001.php on line %d
+Notice: Undefined index: c in %sarray_001.php on line %d
object(ArrayObject)#%d (1) {
["storage":"ArrayObject":private]=>
array(2) {
diff --git a/ext/spl/tests/array_010.phpt b/ext/spl/tests/array_010.phpt
index 6b331e4b51..d2f3de7f6d 100755
--- a/ext/spl/tests/array_010.phpt
+++ b/ext/spl/tests/array_010.phpt
@@ -94,10 +94,10 @@ int(1)
string(3) "3rd"
int(4)
-Notice: Undefined index: 5th in %sarray_010.php on line %d
+Notice: Undefined index: 5th in %sarray_010.php on line %d
NULL
-Notice: Undefined offset: 6 in %sarray_010.php on line %d
+Notice: Undefined offset: 6 in %sarray_010.php on line %d
NULL
===offsetSet===
WRITE 1
@@ -128,9 +128,9 @@ array(6) {
string(9) "changed 6"
}
-Notice: Undefined offset: 7 in %sarray_010.php on line %d
+Notice: Undefined offset: 7 in %sarray_010.php on line %d
-Notice: Undefined index: 8th in %sarray_010.php on line %d
+Notice: Undefined index: 8th in %sarray_010.php on line %d
array(4) {
[0]=>
string(3) "1st"
diff --git a/ext/spl/tests/bug45622.phpt b/ext/spl/tests/bug45622.phpt
index c47b62cbdf..a8fe2c4641 100644
--- a/ext/spl/tests/bug45622.phpt
+++ b/ext/spl/tests/bug45622.phpt
@@ -42,7 +42,7 @@ bool(true)
--> Remove the array element and try access again:
bool(false)
-Notice: Undefined index: p in %s on line %d
+Notice: Undefined index: p in %s on line %d
NULL
--> Re-add the real property:
diff --git a/ext/spl/tests/bug45622b.phpt b/ext/spl/tests/bug45622b.phpt
index 9d49392111..f101a8459d 100644
--- a/ext/spl/tests/bug45622b.phpt
+++ b/ext/spl/tests/bug45622b.phpt
@@ -25,9 +25,9 @@ isset($ao->prop4);
--EXPECTF--
Doesn't trigger __get.
-Notice: Undefined index: prop1 in %s on line 11
+Notice: Undefined index: prop1 in %s on line 11
Doesn't trigger __set.
Doesn't trigger __unset.
-Notice: Undefined index: prop3 in %s on line 17
+Notice: Undefined index: prop3 in %s on line 17
Shouldn't trigger __isset. \ No newline at end of file
diff --git a/ext/spl/tests/bug54323.phpt b/ext/spl/tests/bug54323.phpt
index 35a16a4637..df6416a0f1 100644
--- a/ext/spl/tests/bug54323.phpt
+++ b/ext/spl/tests/bug54323.phpt
@@ -19,6 +19,6 @@ function testAccess($c, $ao) {
--EXPECTF--
Notice: Undefined property: C::$prop in %sbug54323.php on line 14
-Notice: Undefined index: prop in %sbug54323.php on line 14
+Notice: Undefined index: prop in %sbug54323.php on line 14
NULL
NULL
diff --git a/ext/spl/tests/bug62978.phpt b/ext/spl/tests/bug62978.phpt
new file mode 100644
index 0000000000..0d91609f88
--- /dev/null
+++ b/ext/spl/tests/bug62978.phpt
@@ -0,0 +1,50 @@
+--TEST--
+Bug #62987 (Assigning to ArrayObject[null][something] overrides all undefined variables)
+--FILE--
+<?php
+$a = new ArrayObject();
+
+$b = array();
+
+$a[null]['hurr'] = 'durr';
+
+var_dump($a['epic_magic']);
+var_dump($b['epic_magic']);
+var_dump($c['epic_magic']); // Undefined var!!
+
+$d = array();
+var_dump($a['epic_magic']); // more magic!
+var_dump($d['epic_magic']);
+
+$e = 'srsly?';
+var_dump($a['epic_magic']); // srsly.
+var_dump(isset($a['epic_magic']));
+
+$fp = fopen(__FILE__, 'r');
+var_dump($a[$fp]);
+
+fclose($fp);
+--EXPECTF--
+Notice: Undefined index: epic_magic in %sbug62978.php on line %d
+NULL
+
+Notice: Undefined index: epic_magic in %sbug62978.php on line %d
+NULL
+
+Notice: Undefined variable: c in %sbug62978.php on line %d
+NULL
+
+Notice: Undefined index: epic_magic in %sbug62978.php on line %d
+NULL
+
+Notice: Undefined index: epic_magic in %sbug62978.php on line %d
+NULL
+
+Notice: Undefined index: epic_magic in %sbug62978.php on line %d
+NULL
+bool(false)
+
+Strict Standards: Resource ID#%d used as offset, casting to integer (%d) in %sbug62978.php on line %d
+
+Notice: Undefined offset: %d in %sbug62978.php on line %d
+NULL
diff --git a/ext/spl/tests/iterator_044.phpt b/ext/spl/tests/iterator_044.phpt
index 6d25531175..1271ccaa64 100755
--- a/ext/spl/tests/iterator_044.phpt
+++ b/ext/spl/tests/iterator_044.phpt
@@ -81,7 +81,7 @@ NULL
int(0)
bool(false)
-Notice: Undefined index: 0 in %siterator_044.php on line %d
+Notice: Undefined index: 0 in %siterator_044.php on line %d
NULL
===1===
object(stdClass)#%d (0) {
@@ -97,31 +97,31 @@ object(MyFoo)#%d (0) {
}
bool(false)
-Notice: Undefined index: foo in %siterator_044.php on line %d
+Notice: Undefined index: foo in %siterator_044.php on line %d
NULL
===3===
NULL
bool(false)
-Notice: Undefined index: in %siterator_044.php on line %d
+Notice: Undefined index: in %siterator_044.php on line %d
NULL
===4===
int(2)
bool(false)
-Notice: Undefined index: 2 in %siterator_044.php on line %d
+Notice: Undefined index: 2 in %siterator_044.php on line %d
NULL
===5===
string(3) "foo"
bool(false)
-Notice: Undefined index: foo in %siterator_044.php on line %d
+Notice: Undefined index: foo in %siterator_044.php on line %d
NULL
===6===
int(3)
bool(false)
-Notice: Undefined index: 3 in %siterator_044.php on line %d
+Notice: Undefined index: 3 in %siterator_044.php on line %d
NULL
===FILL===
===0===
@@ -146,7 +146,7 @@ int(1)
NULL
bool(false)
-Notice: Undefined index: in %siterator_044.php on line %d
+Notice: Undefined index: in %siterator_044.php on line %d
NULL
===4===
int(2)
@@ -160,6 +160,6 @@ int(1)
int(3)
bool(false)
-Notice: Undefined index: 3 in %siterator_044.php on line %d
+Notice: Undefined index: 3 in %siterator_044.php on line %d
NULL
===DONE===
diff --git a/ext/standard/assert.c b/ext/standard/assert.c
index a2c50d5cb6..15fbefd51c 100644
--- a/ext/standard/assert.c
+++ b/ext/standard/assert.c
@@ -136,20 +136,20 @@ PHP_MINFO_FUNCTION(assert) /* {{{ */
}
/* }}} */
-/* {{{ proto int assert(string|bool assertion)
+/* {{{ proto int assert(string|bool assertion[, string description])
Checks if assertion is false */
PHP_FUNCTION(assert)
{
zval **assertion;
- int val;
+ int val, description_len = 0;
char *myeval = NULL;
- char *compiled_string_description;
+ char *compiled_string_description, *description = NULL;
if (! ASSERTG(active)) {
RETURN_TRUE;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z", &assertion) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z|s", &assertion, &description, &description_len) == FAILURE) {
return;
}
@@ -167,7 +167,11 @@ PHP_FUNCTION(assert)
compiled_string_description = zend_make_compiled_string_description("assert code" TSRMLS_CC);
if (zend_eval_stringl(myeval, Z_STRLEN_PP(assertion), &retval, compiled_string_description TSRMLS_CC) == FAILURE) {
efree(compiled_string_description);
- php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Failure evaluating code: %s%s", PHP_EOL, myeval);
+ if (description_len == 0) {
+ php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Failure evaluating code: %s%s", PHP_EOL, myeval);
+ } else {
+ php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Failure evaluating code: %s%s:\"%s\"", PHP_EOL, description, myeval);
+ }
if (ASSERTG(bail)) {
zend_bailout();
}
@@ -196,7 +200,7 @@ PHP_FUNCTION(assert)
}
if (ASSERTG(callback)) {
- zval *args[3];
+ zval **args = safe_emalloc(description_len == 0 ? 3 : 4, sizeof(zval **), 0);
zval *retval;
int i;
uint lineno = zend_get_executed_lineno(TSRMLS_C);
@@ -214,19 +218,38 @@ PHP_FUNCTION(assert)
ZVAL_FALSE(retval);
/* XXX do we want to check for error here? */
- call_user_function(CG(function_table), NULL, ASSERTG(callback), retval, 3, args TSRMLS_CC);
+ if (description_len == 0) {
+ call_user_function(CG(function_table), NULL, ASSERTG(callback), retval, 3, args TSRMLS_CC);
+ for (i = 0; i <= 2; i++) {
+ zval_ptr_dtor(&(args[i]));
+ }
+ } else {
+ MAKE_STD_ZVAL(args[3]);
+ ZVAL_STRINGL(args[3], SAFE_STRING(description), description_len, 1);
- for (i = 0; i <= 2; i++) {
- zval_ptr_dtor(&(args[i]));
+ call_user_function(CG(function_table), NULL, ASSERTG(callback), retval, 4, args TSRMLS_CC);
+ for (i = 0; i <= 3; i++) {
+ zval_ptr_dtor(&(args[i]));
+ }
}
+
+ efree(args);
zval_ptr_dtor(&retval);
}
if (ASSERTG(warning)) {
- if (myeval) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Assertion \"%s\" failed", myeval);
+ if (description_len == 0) {
+ if (myeval) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Assertion \"%s\" failed", myeval);
+ } else {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Assertion failed");
+ }
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Assertion failed");
+ if (myeval) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s: \"%s\" failed", description, myeval);
+ } else {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s failed", description);
+ }
}
}
@@ -321,3 +344,4 @@ PHP_FUNCTION(assert_options)
* vim600: sw=4 ts=4 fdm=marker
* vim<600: sw=4 ts=4
*/
+
diff --git a/ext/standard/tests/assert/assert04.phpt b/ext/standard/tests/assert/assert04.phpt
index 0da23186e6..bffadcb97c 100644
--- a/ext/standard/tests/assert/assert04.phpt
+++ b/ext/standard/tests/assert/assert04.phpt
@@ -15,7 +15,7 @@ assert(1);
/* Wrong parameter count in assert */
assert_options(ASSERT_ACTIVE, 1);
-assert(2,3);
+assert(2, "failure", 3);
/* Wrong parameter count in assert_options */
assert_options(ASSERT_ACTIVE, 0, 2);
@@ -36,7 +36,7 @@ echo "not reached\n";
?>
--EXPECTF--
-Warning: assert() expects exactly 1 parameter, 2 given in %s on line %d
+Warning: assert() expects at most 2 parameters, 3 given in %s on line %d
Warning: assert_options() expects at most 2 parameters, 3 given in %s on line %d
@@ -45,3 +45,4 @@ Warning: assert_options() expects parameter 1 to be long, %unicode_string_option
Warning: assert(): Assertion failed in %s on line %d
Warning: assert(): Assertion failed in %s on line %d
+
diff --git a/ext/standard/tests/assert/assert_basic6.phpt b/ext/standard/tests/assert/assert_basic6.phpt
new file mode 100644
index 0000000000..2a73713437
--- /dev/null
+++ b/ext/standard/tests/assert/assert_basic6.phpt
@@ -0,0 +1,26 @@
+--TEST--
+assert() - basic - Test that bailout works
+--INI--
+assert.active = 1
+assert.warning = 1
+assert.callback = f1
+assert.quiet_eval = 1
+assert.bail = 0
+--FILE--
+<?php
+function f1($message)
+{
+ echo "f1 called\n";
+}
+
+//bail out on error
+var_dump($rao = assert_options(ASSERT_BAIL, 1));
+$sa = "0 != 0";
+var_dump($r2 = assert($sa, "0 is 0"));
+echo "If this is printed BAIL hasn't worked";
+--EXPECTF--
+int(0)
+f1 called
+
+Warning: assert(): 0 is 0: "0 != 0" failed in %s on line 10
+
diff --git a/ext/standard/tests/assert/assert_error1.phpt b/ext/standard/tests/assert/assert_error1.phpt
index 6211f1c918..657b411f67 100644
--- a/ext/standard/tests/assert/assert_error1.phpt
+++ b/ext/standard/tests/assert/assert_error1.phpt
@@ -20,19 +20,19 @@ function handler($errno, $errstr) {
//Wrong number of parameters for assert_options()
assert_options(ASSERT_WARNING, 1);
-var_dump($rao=assert_options(ASSERT_CALLBACK,"f1",1));
+var_dump($rao = assert_options(ASSERT_CALLBACK, "f1", 1));
//Unknown option for assert_options()
-var_dump($rao=assert_options("F1","f1"));
+var_dump($rao=assert_options("F1", "f1"));
//Wrong number of parameters for assert()
$sa="0 != 0";
-var_dump($r2=assert($sa,1));
+var_dump($r2 = assert($sa, "message", 1));
//Catch recoverable error with handler
-var_dump($rc=assert('aa=sd+as+safsafasfaçsafçsafç'));
+var_dump($rc = assert('aa=sd+as+safsafasfaçsafçsafç'));
--EXPECTF--
Warning: assert_options() expects at most 2 parameters, 3 given in %s on line %d
NULL
@@ -40,5 +40,6 @@ NULL
Warning: assert_options() expects parameter 1 to be long, string given in %s on line %d
NULL
-Warning: assert() expects exactly 1 parameter, 2 given in %s on line %d
+Warning: assert() expects at most 2 parameters, 3 given in %s on line %d
NULL
+
diff --git a/ext/standard/tests/assert/assert_error2.phpt b/ext/standard/tests/assert/assert_error2.phpt
new file mode 100644
index 0000000000..da7c3d9e0b
--- /dev/null
+++ b/ext/standard/tests/assert/assert_error2.phpt
@@ -0,0 +1,30 @@
+--TEST--
+assert() - basic - Test that bailout works
+--INI--
+assert.active = 1
+assert.warning = 1
+assert.callback = f1
+assert.quiet_eval = 1
+assert.bail = 0
+error_reporting = -1
+display_errors = 1
+--FILE--
+<?php
+function f1($script, $line, $message, $user_message)
+{
+ echo "f1 called\n";
+}
+
+//bail out on error
+var_dump($rao = assert_options(ASSERT_BAIL, 1));
+$sa = "0 != 0";
+var_dump($r2 = assert($sa));
+echo "If this is printed BAIL hasn't worked";
+--EXPECTF--
+int(0)
+
+Warning: Missing argument 4 for f1() in %s on line 2
+f1 called
+
+Warning: assert(): Assertion "0 != 0" failed in %s on line 10
+
diff --git a/ext/standard/tests/assert/assert_error3.phpt b/ext/standard/tests/assert/assert_error3.phpt
new file mode 100644
index 0000000000..54b91edd3d
--- /dev/null
+++ b/ext/standard/tests/assert/assert_error3.phpt
@@ -0,0 +1,21 @@
+--TEST--
+assert() - basic - Test recoverable error
+--INI--
+assert.active = 1
+assert.warning = 1
+assert.callback = f1
+assert.quiet_eval = 0
+assert.bail = 0
+error_reporting = -1
+display_errors = 1
+--FILE--
+<?php
+$sa = "0 $ 0";
+var_dump($r2 = assert($sa));
+--EXPECTF--
+
+Parse error: syntax error, unexpected '$' in %s(3) : assert code on line 1
+
+Catchable fatal error: assert(): Failure evaluating code:
+0 $ 0 in %s on line 3
+
diff --git a/ext/standard/tests/assert/assert_error4.phpt b/ext/standard/tests/assert/assert_error4.phpt
new file mode 100644
index 0000000000..264cc8fecf
--- /dev/null
+++ b/ext/standard/tests/assert/assert_error4.phpt
@@ -0,0 +1,21 @@
+--TEST--
+assert() - basic - Test recoverable error
+--INI--
+assert.active = 1
+assert.warning = 1
+assert.callback = f1
+assert.quiet_eval = 0
+assert.bail = 0
+error_reporting = -1
+display_errors = 1
+--FILE--
+<?php
+$sa = "0 $ 0";
+var_dump($r2 = assert($sa, "Describing what was asserted"));
+--EXPECTF--
+
+Parse error: syntax error, unexpected '$' in %s(3) : assert code on line 1
+
+Catchable fatal error: assert(): Failure evaluating code:
+Describing what was asserted:"0 $ 0" in %s on line 3
+
diff --git a/ext/standard/tests/general_functions/bug60723.phpt b/ext/standard/tests/general_functions/bug60723.phpt
new file mode 100644
index 0000000000..07b801bcfe
--- /dev/null
+++ b/ext/standard/tests/general_functions/bug60723.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Bug #60723 (error_log error time has changed to UTC ignoring default timezo)
+--INI--
+date.timezone=ASIA/Chongqing
+log_errors=On
+--FILE--
+<?php
+$dir = dirname(__FILE__);
+$log = $dir . "/tmp.err";
+ini_set("error_log", $log);
+echo $aa;
+error_log("dummy");
+readfile($log);
+unlink($log);
+?>
+--EXPECTF--
+Notice: Undefined variable: aa in %sbug60723.php on line %d
+[%s ASIA/Chongqing] PHP Notice: Undefined variable: aa in %sbug60723.php on line %d
+[%s ASIA/Chongqing] dummy
diff --git a/ext/standard/tests/network/gethostbyname_basic001.phpt b/ext/standard/tests/network/gethostbyname_basic001.phpt
index e917b59920..9171e226aa 100644
--- a/ext/standard/tests/network/gethostbyname_basic001.phpt
+++ b/ext/standard/tests/network/gethostbyname_basic001.phpt
@@ -5,6 +5,7 @@ gethostbyname() function - basic type return test
--SKIPIF--
<?php
if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
+if (getenv("SKIP_ONLINE_TESTS")) die("skip test requiring internet connection");
?>
--FILE--
<?php
diff --git a/ext/standard/tests/network/gethostbyname_basic002.phpt b/ext/standard/tests/network/gethostbyname_basic002.phpt
deleted file mode 100644
index 983faa929e..0000000000
--- a/ext/standard/tests/network/gethostbyname_basic002.phpt
+++ /dev/null
@@ -1,15 +0,0 @@
---TEST--
-gethostbyname() function - basic invalid parameter test
---CREDITS--
-"Sylvain R." <sracine@phpquebec.org>
---SKIPIF--
-<?php
-if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
-?>
---FILE--
-<?php
- $ip = gethostbyname("www.php.net");
- var_dump((bool) ip2long($ip));
-?>
---EXPECT--
-bool(true)
diff --git a/ext/standard/tests/network/gethostbyname_error004.phpt b/ext/standard/tests/network/gethostbyname_error004.phpt
index 7aac172920..274301a236 100644
--- a/ext/standard/tests/network/gethostbyname_error004.phpt
+++ b/ext/standard/tests/network/gethostbyname_error004.phpt
@@ -5,6 +5,7 @@ gethostbyname() function - basic return valid ip address test
--SKIPIF--
<?php
if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
+if (getenv("SKIP_ONLINE_TESTS")) die("skip test requiring internet connection");
?>
--FILE--
<?php
diff --git a/ext/standard/tests/network/getmxrr.phpt b/ext/standard/tests/network/getmxrr.phpt
index 29cea1d71e..c4a15c52ce 100644
--- a/ext/standard/tests/network/getmxrr.phpt
+++ b/ext/standard/tests/network/getmxrr.phpt
@@ -3,6 +3,7 @@ getmxrr() test
--SKIPIF--
<?php
if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
+if (getenv("SKIP_ONLINE_TESTS")) die("skip test requiring internet connection");
if (substr(PHP_OS, 0, 3) == 'WIN') {
die('skip: no Windows support');
}
diff --git a/ext/standard/tests/serialize/bug35895.phpt b/ext/standard/tests/serialize/bug35895.phpt
new file mode 100644
index 0000000000..22fce0d1f2
--- /dev/null
+++ b/ext/standard/tests/serialize/bug35895.phpt
@@ -0,0 +1,24 @@
+--TEST--
+Bug #35895 (__sleep and private property)
+--FILE--
+<?php
+class Parents {
+ private $parents;
+ public function __sleep() {
+ return array("parents");
+ }
+}
+
+class Child extends Parents {
+ private $child;
+ public function __sleep() {
+ return array_merge(array("child"), parent::__sleep());
+ }
+}
+
+$obj = new Child();
+serialize($obj);
+
+?>
+--EXPECTF--
+Notice: serialize(): "parents" returned as member variable from __sleep() but does not exist in %sbug35895.php on line %d
diff --git a/ext/standard/tests/strings/http_build_query_error.phpt b/ext/standard/tests/strings/http_build_query_error.phpt
new file mode 100644
index 0000000000..30155e62a3
--- /dev/null
+++ b/ext/standard/tests/strings/http_build_query_error.phpt
@@ -0,0 +1,13 @@
+--TEST--
+Testing error on null parameter 1 of http_build_query()
+--CREDITS--
+Pawel Krynicki <pawel.krynicki [at] xsolve [dot] pl>
+#testfest AmsterdamPHP 2012-06-23
+--FILE--
+<?php
+
+$result = http_build_query(null);
+
+?>
+--EXPECTF--
+Warning: http_build_query(): Parameter 1 expected to be Array or Object. %s value given in %s on line %d \ No newline at end of file
diff --git a/ext/standard/tests/url/bug63162.phpt b/ext/standard/tests/url/bug63162.phpt
new file mode 100644
index 0000000000..ea5205efd6
--- /dev/null
+++ b/ext/standard/tests/url/bug63162.phpt
@@ -0,0 +1,38 @@
+--TEST--
+Test parse_url() for bug #63162
+--DESCRIPTION--
+This test covers tests the inputs:
+[0]=> http://user:pass@host
+[1]=> //user:pass@host
+[2]=> //user@host
+--FILE--
+<?php
+var_dump(parse_url('http://user:pass@host'));
+var_dump(parse_url('//user:pass@host'));
+var_dump(parse_url('//user@host'));
+?>
+--EXPECT--
+array(4) {
+ ["scheme"]=>
+ string(4) "http"
+ ["host"]=>
+ string(4) "host"
+ ["user"]=>
+ string(4) "user"
+ ["pass"]=>
+ string(4) "pass"
+}
+array(3) {
+ ["host"]=>
+ string(4) "host"
+ ["user"]=>
+ string(4) "user"
+ ["pass"]=>
+ string(4) "pass"
+}
+array(2) {
+ ["host"]=>
+ string(4) "host"
+ ["user"]=>
+ string(4) "user"
+}
diff --git a/ext/standard/url.c b/ext/standard/url.c
index 44a568032b..c159322837 100644
--- a/ext/standard/url.c
+++ b/ext/standard/url.c
@@ -201,6 +201,8 @@ PHPAPI php_url *php_url_parse_ex(char const *str, int length)
STR_FREE(ret->scheme);
efree(ret);
return NULL;
+ } else if (*s == '/' && *(s+1) == '/') { /* relative-scheme URL */
+ s += 2;
} else {
goto just_path;
}
diff --git a/ext/standard/url_scanner_ex.c b/ext/standard/url_scanner_ex.c
index d883d4dfa3..1ec269de30 100644
--- a/ext/standard/url_scanner_ex.c
+++ b/ext/standard/url_scanner_ex.c
@@ -2,9 +2,9 @@
#line 1 "ext/standard/url_scanner_ex.re"
/*
+----------------------------------------------------------------------+
- | PHP Version 6 |
+ | PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2006 The PHP Group |
+ | Copyright (c) 1997-2012 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/standard/url_scanner_ex.re b/ext/standard/url_scanner_ex.re
index e7218a14f1..2e37cf0ba4 100644
--- a/ext/standard/url_scanner_ex.re
+++ b/ext/standard/url_scanner_ex.re
@@ -1,8 +1,8 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 6 |
+ | PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2006 The PHP Group |
+ | Copyright (c) 1997-2012 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/ext/standard/var.c b/ext/standard/var.c
index 494fb583c7..a4fa262e76 100644
--- a/ext/standard/var.c
+++ b/ext/standard/var.c
@@ -639,6 +639,7 @@ static void php_var_serialize_class(smart_str *buf, zval *struc, zval *retval_pt
HashPosition pos;
int i;
zval nval, *nvalp;
+ HashTable *propers;
ZVAL_NULL(&nval);
nvalp = &nval;
@@ -664,7 +665,8 @@ static void php_var_serialize_class(smart_str *buf, zval *struc, zval *retval_pt
smart_str_appendl(buf,"N;", 2);
continue;
}
- if (zend_hash_find(Z_OBJPROP_P(struc), Z_STRVAL_PP(name), Z_STRLEN_PP(name) + 1, (void *) &d) == SUCCESS) {
+ propers = Z_OBJPROP_P(struc);
+ if (zend_hash_find(propers, Z_STRVAL_PP(name), Z_STRLEN_PP(name) + 1, (void *) &d) == SUCCESS) {
php_var_serialize_string(buf, Z_STRVAL_PP(name), Z_STRLEN_PP(name));
php_var_serialize_intern(buf, *d, var_hash TSRMLS_CC);
} else {
@@ -676,7 +678,7 @@ static void php_var_serialize_class(smart_str *buf, zval *struc, zval *retval_pt
do {
zend_mangle_property_name(&priv_name, &prop_name_length, ce->name, ce->name_length, Z_STRVAL_PP(name), Z_STRLEN_PP(name), ce->type & ZEND_INTERNAL_CLASS);
- if (zend_hash_find(Z_OBJPROP_P(struc), priv_name, prop_name_length + 1, (void *) &d) == SUCCESS) {
+ if (zend_hash_find(propers, priv_name, prop_name_length + 1, (void *) &d) == SUCCESS) {
php_var_serialize_string(buf, priv_name, prop_name_length);
pefree(priv_name, ce->type & ZEND_INTERNAL_CLASS);
php_var_serialize_intern(buf, *d, var_hash TSRMLS_CC);
@@ -684,7 +686,7 @@ static void php_var_serialize_class(smart_str *buf, zval *struc, zval *retval_pt
}
pefree(priv_name, ce->type & ZEND_INTERNAL_CLASS);
zend_mangle_property_name(&prot_name, &prop_name_length, "*", 1, Z_STRVAL_PP(name), Z_STRLEN_PP(name), ce->type & ZEND_INTERNAL_CLASS);
- if (zend_hash_find(Z_OBJPROP_P(struc), prot_name, prop_name_length + 1, (void *) &d) == SUCCESS) {
+ if (zend_hash_find(propers, prot_name, prop_name_length + 1, (void *) &d) == SUCCESS) {
php_var_serialize_string(buf, prot_name, prop_name_length);
pefree(prot_name, ce->type & ZEND_INTERNAL_CLASS);
php_var_serialize_intern(buf, *d, var_hash TSRMLS_CC);
diff --git a/ext/zlib/tests/bug55544-win.phpt b/ext/zlib/tests/bug55544-win.phpt
new file mode 100644
index 0000000000..03fd6b1c90
--- /dev/null
+++ b/ext/zlib/tests/bug55544-win.phpt
Binary files differ
diff --git a/ext/zlib/tests/bug55544.phpt b/ext/zlib/tests/bug55544.phpt
index ca4214a46f..a0d22f4fce 100644
--- a/ext/zlib/tests/bug55544.phpt
+++ b/ext/zlib/tests/bug55544.phpt
Binary files differ
diff --git a/ext/zlib/tests/bug_52944-darwin.phpt b/ext/zlib/tests/bug_52944-darwin.phpt
new file mode 100644
index 0000000000..c25babadf5
--- /dev/null
+++ b/ext/zlib/tests/bug_52944-darwin.phpt
@@ -0,0 +1,24 @@
+--TEST--
+Bug #52944 (segfault with zlib filter and corrupted data)
+--SKIPIF--
+<?php if (!extension_loaded("zlib")) print "skip"; ?>
+<?php
+if (PHP_OS != 'Darwin') {
+ die("skip Darwin only");
+}
+--INI--
+allow_url_fopen=1
+--FILE--
+<?php
+require dirname(__FILE__) . "/bug_52944_corrupted_data.inc";
+
+$fp = fopen('data://text/plain;base64,' . $data, 'r');
+stream_filter_append($fp, 'zlib.inflate', STREAM_FILTER_READ);
+var_dump(fread($fp,1));
+var_dump(fread($fp,1));
+fclose($fp);
+echo "Done.\n";
+--EXPECT--
+string(1) "%"
+string(1) "C"
+Done.
diff --git a/ext/zlib/tests/bug_52944-win.phpt b/ext/zlib/tests/bug_52944-win.phpt
new file mode 100644
index 0000000000..fa369f8fb4
--- /dev/null
+++ b/ext/zlib/tests/bug_52944-win.phpt
@@ -0,0 +1,24 @@
+--TEST--
+Bug #52944 (segfault with zlib filter and corrupted data)
+--SKIPIF--
+<?php if (!extension_loaded("zlib")) print "skip"; ?>
+<?php
+if (substr(PHP_OS, 0, 3) != 'WIN') {
+ die("skip windows only");
+}
+--INI--
+allow_url_fopen=1
+--FILE--
+<?php
+require dirname(__FILE__) . "/bug_52944_corrupted_data.inc";
+
+$fp = fopen('data://text/plain;base64,' . $data, 'r');
+stream_filter_append($fp, 'zlib.inflate', STREAM_FILTER_READ);
+var_dump(fread($fp,1));
+var_dump(fread($fp,1));
+fclose($fp);
+echo "Done.\n";
+--EXPECT--
+string(1) "%"
+string(1) "C"
+Done.
diff --git a/ext/zlib/tests/bug_52944.phpt b/ext/zlib/tests/bug_52944.phpt
index c090fe6f5c..ed4af3e157 100644
--- a/ext/zlib/tests/bug_52944.phpt
+++ b/ext/zlib/tests/bug_52944.phpt
@@ -1,162 +1,27 @@
---TEST--
-Bug #52944 (segfault with zlib filter and corrupted data)
---SKIPIF--
-<?php if (!extension_loaded("zlib")) print "skip"; ?>
-<?php
-include "func.inc";
-if (substr(PHP_OS, 0, 3) == 'WIN' && version_compare(get_zlib_version(), '1.2.7') < 0) {
- die('skip - only for zlib >= 1.2.7 on windows');
-}
---INI--
-allow_url_fopen=1
---FILE--
-<?php
-$data =
-'U3XuBFLaJfQAWt4cqi8u8ugXxyDcPTZy8VicbJr50gGTEh0dmo+d8O4uBCTuAf3dHbbDYTieluscWXkKlavfKdMkZZRP3GpTApbb'.
-'mQONJCgdbpPHat6iGOoq34vIGCLKFuD8qiA4ti5AL7bArvDtd7i+5tvn49j1L3bwroIsk1iPS5leATIwp1iwk+VdPLzu7tsexYBf'.
-'giLx7WtQI779GtQIKD1QI4AT1Ihvf0I1Iu1u1Ca+7Vs3TtfqiCXvrm99EuJy/ix5z1VD8atW9sUyvmu/pQn8KU5lZvHUqC5xzgow'.
-'0e8m/e5n5fLH2EPhBn4CA3n0p02/E/hVlAgxNIczOk7H7shAHSyUQ7PIwicPE/xNw7Nq4F+aHj2CowlZQKvhr2+fGIhA1QsSG6SD'.
-'y3MBWfRsWxpYq08oqfievkq2Du7uwO99DGhG4GQrIODp67QfRFEFnrUQWD1qV2R44JVHoEjwt5c6ASus4MdOAtA+2OZAHLLOA9O6'.
-'4kgGY4wOggODnQMWrk6fnTn4s4E/GG/QqEPiOiY+PWvij9MDz+0qM8WlyB6rGiGdVcVbChvQJhcjos7ShfrFxU017nBgsMHx2OON'.
-'NV7mx3AovW/veYYnlUfNlF1TNysBvNPrs5V6ClWzREIaxqSGPIK+EoQEeqBvCarbQHOQnolOl/jMrmXPMBWbIDRkzJPVo3kCD3Us'.
-'NRXjK+Ad8/fMLPiqY7+CulD4Vc/pga9nIEdhGDsx1qvT4Aw9rpW6rGt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
-'i6e/udG7B1uHWVcD2O4QdE4F4Kv3H4/zFXQrOWd7r8Dp231VBh1+OEC7syjEtoWirADNCWcA3UutRaEXjk9guJYE7RHPA1VVEI9K'.
-'rSg7qOo/suXUVo/B4kiq6Pj6MFc+nog5D1/90SOqIc45zS20XmOwTW+S3Ae1RlBvaQ5hPtQ6QW0Jc6I/1eKHSn+uVlLzprQnvwy+'.
-'uXWye3igcjgf4FQCPNpXB3eKujy0918dwuPh+3evPqqKO44mI6hGCfTVx+1NhTUBtOVOkwqwDzs7P6pdeR0EF1Vw+8Aeb48zuEE0'.
-'HHcF4NbbzaMTAVnidDQupcVXAV+SL6T3QKmGUnKo0PeNtyJcJmYknHYV9Seyu/KVBlbND09w2LMhX0KdQqeo54GTt5PCp67OPPD1'.
-'2naefOs1Les5FbK+XyA09UgFgY929nNwozi4CqMJOO7VGZ4XEXfdfntlCl50GXbtYwF2TUNAWV0m7u7xu73Nj+cgy/ePC/0M4nyg'.
-'GM7bO3sFES37I8ABKizJzVcABuLq9S546WoW5LY40KbRBFwY8XDtDsfo7bcIA3ohibCLN6rQCcH5RSjFpLqWpD7+XLRgO23tnMvZ'.
-'BcR9H+IJq3fiESmZWBbnilDlCKPe2X5QJA==';
-$fp = fopen('data://text/plain;base64,' . $data, 'r');
-stream_filter_append($fp, 'zlib.inflate', STREAM_FILTER_READ);
-var_dump(fread($fp,1));
-var_dump(fread($fp,1));
-fclose($fp);
-echo "Done.\n";
---EXPECT--
-string(0) ""
-string(0) ""
-Done.
+--TEST--
+Bug #52944 (segfault with zlib filter and corrupted data)
+--SKIPIF--
+<?php if (!extension_loaded("zlib")) print "skip"; ?>
+<?php
+if (substr(PHP_OS, 0, 3) == 'WIN') {
+ die("skip not for windows");
+}
+if (PHP_OS == 'Darwin') {
+ die("skip not for Darwin");
+}
+--INI--
+allow_url_fopen=1
+--FILE--
+<?php
+require dirname(__FILE__) . "/bug_52944_corrupted_data.inc";
+
+$fp = fopen('data://text/plain;base64,' . $data, 'r');
+stream_filter_append($fp, 'zlib.inflate', STREAM_FILTER_READ);
+var_dump(fread($fp,1));
+var_dump(fread($fp,1));
+fclose($fp);
+echo "Done.\n";
+--EXPECT--
+string(0) ""
+string(0) ""
+Done.
diff --git a/ext/zlib/tests/bug_52944_corrupted_data.inc b/ext/zlib/tests/bug_52944_corrupted_data.inc
new file mode 100644
index 0000000000..ed46a36a1f
--- /dev/null
+++ b/ext/zlib/tests/bug_52944_corrupted_data.inc
@@ -0,0 +1,142 @@
+<?php
+
+// corrupted data
+$data =
+'U3XuBFLaJfQAWt4cqi8u8ugXxyDcPTZy8VicbJr50gGTEh0dmo+d8O4uBCTuAf3dHbbDYTieluscWXkKlavfKdMkZZRP3GpTApbb'.
+'mQONJCgdbpPHat6iGOoq34vIGCLKFuD8qiA4ti5AL7bArvDtd7i+5tvn49j1L3bwroIsk1iPS5leATIwp1iwk+VdPLzu7tsexYBf'.
+'giLx7WtQI779GtQIKD1QI4AT1Ihvf0I1Iu1u1Ca+7Vs3TtfqiCXvrm99EuJy/ix5z1VD8atW9sUyvmu/pQn8KU5lZvHUqC5xzgow'.
+'0e8m/e5n5fLH2EPhBn4CA3n0p02/E/hVlAgxNIczOk7H7shAHSyUQ7PIwicPE/xNw7Nq4F+aHj2CowlZQKvhr2+fGIhA1QsSG6SD'.
+'y3MBWfRsWxpYq08oqfievkq2Du7uwO99DGhG4GQrIODp67QfRFEFnrUQWD1qV2R44JVHoEjwt5c6ASus4MdOAtA+2OZAHLLOA9O6'.
+'4kgGY4wOggODnQMWrk6fnTn4s4E/GG/QqEPiOiY+PWvij9MDz+0qM8WlyB6rGiGdVcVbChvQJhcjos7ShfrFxU017nBgsMHx2OON'.
+'NV7mx3AovW/veYYnlUfNlF1TNysBvNPrs5V6ClWzREIaxqSGPIK+EoQEeqBvCarbQHOQnolOl/jMrmXPMBWbIDRkzJPVo3kCD3Us'.
+'NRXjK+Ad8/fMLPiqY7+CulD4Vc/pga9nIEdhGDsx1qvT4Aw9rpW6rG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.
+'i6e/udG7B1uHWVcD2O4QdE4F4Kv3H4/zFXQrOWd7r8Dp231VBh1+OEC7syjEtoWirADNCWcA3UutRaEXjk9guJYE7RHPA1VVEI9K'.
+'rSg7qOo/suXUVo/B4kiq6Pj6MFc+nog5D1/90SOqIc45zS20XmOwTW+S3Ae1RlBvaQ5hPtQ6QW0Jc6I/1eKHSn+uVlLzprQnvwy+'.
+'uXWye3igcjgf4FQCPNpXB3eKujy0918dwuPh+3evPqqKO44mI6hGCfTVx+1NhTUBtOVOkwqwDzs7P6pdeR0EF1Vw+8Aeb48zuEE0'.
+'HHcF4NbbzaMTAVnidDQupcVXAV+SL6T3QKmGUnKo0PeNtyJcJmYknHYV9Seyu/KVBlbND09w2LMhX0KdQqeo54GTt5PCp67OPPD1'.
+'2naefOs1Les5FbK+XyA09UgFgY929nNwozi4CqMJOO7VGZ4XEXfdfntlCl50GXbtYwF2TUNAWV0m7u7xu73Nj+cgy/ePC/0M4nyg'.
+'GM7bO3sFES37I8ABKizJzVcABuLq9S546WoW5LY40KbRBFwY8XDtDsfo7bcIA3ohibCLN6rQCcH5RSjFpLqWpD7+XLRgO23tnMvZ'.
+'BcR9H+IJq3fiESmZWBbnilDlCKPe2X5QJA==';
diff --git a/main/main.c b/main/main.c
index 709c6dd3d9..44c61c6005 100644
--- a/main/main.c
+++ b/main/main.c
@@ -597,6 +597,7 @@ PHPAPI int php_get_module_initialized(void)
{
return module_initialized;
}
+/* }}} */
/* {{{ php_log_err
*/
@@ -627,7 +628,15 @@ PHPAPI void php_log_err(char *log_message TSRMLS_DC)
char *error_time_str;
time(&error_time);
- error_time_str = php_format_date("d-M-Y H:i:s e", 13, error_time, 0 TSRMLS_CC);
+#ifdef ZTS
+ if (!php_during_module_startup()) {
+ error_time_str = php_format_date("d-M-Y H:i:s e", 13, error_time, 1 TSRMLS_CC);
+ } else {
+ error_time_str = php_format_date("d-M-Y H:i:s e", 13, error_time, 0 TSRMLS_CC);
+ }
+#else
+ error_time_str = php_format_date("d-M-Y H:i:s e", 13, error_time, 1 TSRMLS_CC);
+#endif
len = spprintf(&tmp, 0, "[%s] %s%s", error_time_str, log_message, PHP_EOL);
#ifdef PHP_WIN32
php_flock(fd, 2);
diff --git a/main/output.c b/main/output.c
index d4eaa6701d..e100057ca9 100644
--- a/main/output.c
+++ b/main/output.c
@@ -214,7 +214,7 @@ PHPAPI void php_output_register_constants(TSRMLS_D)
* Used by SAPIs to disable output */
PHPAPI void php_output_set_status(int status TSRMLS_DC)
{
- OG(flags) = status & 0xf;
+ OG(flags) = (OG(flags) & ~0xf) | (status & 0xf);
}
/* }}} */
diff --git a/main/php_version.h b/main/php_version.h
index 3315661b7a..8dfe49630f 100644
--- a/main/php_version.h
+++ b/main/php_version.h
@@ -2,7 +2,7 @@
/* edit configure.in to change version number */
#define PHP_MAJOR_VERSION 5
#define PHP_MINOR_VERSION 4
-#define PHP_RELEASE_VERSION 7
+#define PHP_RELEASE_VERSION 9
#define PHP_EXTRA_VERSION "-dev"
-#define PHP_VERSION "5.4.7-dev"
-#define PHP_VERSION_ID 50407
+#define PHP_VERSION "5.4.9-dev"
+#define PHP_VERSION_ID 50409
diff --git a/netware/start.c b/netware/start.c
index 43510fc22c..b842749257 100644
--- a/netware/start.c
+++ b/netware/start.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2010 The PHP Group |
+ | Copyright (c) 1997-2012 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/run-tests.php b/run-tests.php
index cfc562ebc1..a746c36965 100755
--- a/run-tests.php
+++ b/run-tests.php
@@ -632,6 +632,9 @@ if (isset($argc) && $argc > 1) {
case 'x':
$environment['SKIP_SLOW_TESTS'] = 1;
break;
+ case '--offline':
+ $environment['SKIP_ONLINE_TESTS'] = 1;
+ break;
//case 'w'
case '-':
// repeat check with full switch
@@ -689,6 +692,8 @@ Options:
-x Sets 'SKIP_SLOW_TESTS' environmental variable.
+ --offline Sets 'SKIP_ONLINE_TESTS' environmental variable.
+
--verbose
-v Verbose mode.
diff --git a/sapi/cli/cli.h b/sapi/cli/cli.h
index 2c069c4491..3e9ca43084 100644
--- a/sapi/cli/cli.h
+++ b/sapi/cli/cli.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2010 The PHP Group |
+ | Copyright (c) 1997-2012 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c
index e80ab68f80..4d15db44af 100644
--- a/sapi/cli/php_cli_server.c
+++ b/sapi/cli/php_cli_server.c
@@ -116,7 +116,7 @@ typedef struct php_cli_server_poller {
} php_cli_server_poller;
typedef struct php_cli_server_request {
- enum php_http_method request_method;
+ enum php_http_method request_method;
int protocol_version;
char *request_uri;
size_t request_uri_len;
@@ -247,7 +247,8 @@ static php_cli_server_http_reponse_status_code_pair status_map[] = {
static php_cli_server_http_reponse_status_code_pair template_map[] = {
{ 400, "<h1 class=\"h\">%s</h1><p>Your browser sent a request that this server could not understand.</p>" },
{ 404, "<h1 class=\"h\">%s</h1><p>The requested resource %s was not found on this server.</p>" },
- { 500, "<h1 class=\"h\">%s</h1><p>The server is temporality unavaiable.</p>" }
+ { 500, "<h1 class=\"h\">%s</h1><p>The server is temporarily unavailable.</p>" },
+ { 501, "<h1 class=\"h\">%s</h1><p>Request method not supported.</p>" }
};
static php_cli_server_ext_mime_type_pair mime_type_map[] = {
@@ -275,7 +276,7 @@ static void php_cli_server_log_response(php_cli_server_client *client, int statu
ZEND_DECLARE_MODULE_GLOBALS(cli_server);
-/* {{{ static char php_cli_server_css[]
+/* {{{ static char php_cli_server_css[]
* copied from ext/standard/info.c
*/
static const char php_cli_server_css[] = "<style type=\"text/css\">\n" \
@@ -543,7 +544,7 @@ static void sapi_cli_server_register_variable(zval *track_vars_array, const char
}
} /* }}} */
-static int sapi_cli_server_register_entry_cb(char **entry TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */ {
+static int sapi_cli_server_register_entry_cb(char **entry TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */ {
zval *track_vars_array = va_arg(args, zval *);
if (hash_key->nKeyLength) {
char *real_key, *key;
@@ -583,7 +584,7 @@ static void sapi_cli_server_register_variables(zval *track_vars_array TSRMLS_DC)
} else {
sapi_cli_server_register_variable(track_vars_array, "REMOTE_ADDR", client->addr_str TSRMLS_CC);
}
- }
+ }
{
char *tmp;
spprintf(&tmp, 0, "PHP %s Development Server", PHP_VERSION);
@@ -681,7 +682,7 @@ sapi_module_struct cli_server_sapi_module = {
sapi_cli_server_log_message, /* Log message */
NULL, /* Get request time */
NULL, /* Child terminate */
-
+
STANDARD_SAPI_MODULE_PROPERTIES
}; /* }}} */
@@ -778,7 +779,7 @@ static int php_cli_server_poller_iter_on_active(php_cli_server_poller *poller, v
}
}
}
-
+
#else
php_socket_t fd = 0;
const php_socket_t max_fd = poller->max_fd;
@@ -966,7 +967,7 @@ static int php_cli_server_content_sender_send(php_cli_server_content_sender *sen
} else if (nbytes_sent == chunk->data.immortal.len) {
php_cli_server_chunk_dtor(chunk);
pefree(chunk, 1);
- sender->buffer.first = next;
+ sender->buffer.first = next;
if (!next) {
sender->buffer.last = NULL;
}
@@ -1345,7 +1346,7 @@ static void php_cli_server_request_translate_vpath(php_cli_server_request *reque
}
}
break; /* regular file */
- }
+ }
if (prev_path) {
pefree(prev_path, 1);
*q = DEFAULT_SLASH;
@@ -1384,7 +1385,7 @@ static void php_cli_server_request_translate_vpath(php_cli_server_request *reque
if (request->vpath[i] == '\\') {
request->vpath[i] = '/';
}
- }
+ }
}
#endif
request->sb = sb;
@@ -1452,7 +1453,7 @@ static void normalize_vpath(char **retval, size_t *retval_len, const char *vpath
}
}
}
-
+
*decoded_vpath_end = '\0';
*retval = decoded_vpath;
*retval_len = decoded_vpath_end - decoded_vpath;
@@ -1812,7 +1813,7 @@ static int php_cli_server_send_error_page(php_cli_server *server, php_cli_server
smart_str_append_generic_ex(&buffer, php_cli_server_buffer_size(&client->content_sender.buffer), 1, size_t, _unsigned);
smart_str_appendl_ex(&buffer, "\r\n", 2, 1);
smart_str_appendl_ex(&buffer, "\r\n", 2, 1);
-
+
chunk = php_cli_server_chunk_heap_new(buffer.c, buffer.c, buffer.len);
if (!chunk) {
smart_str_free_ex(&buffer, 1);
@@ -1917,7 +1918,7 @@ static int php_cli_server_begin_send_static(php_cli_server *server, php_cli_serv
}
/* }}} */
-static int php_cli_server_request_startup(php_cli_server *server, php_cli_server_client *client TSRMLS_DC) { /* {{{ */
+static int php_cli_server_request_startup(php_cli_server *server, php_cli_server_client *client TSRMLS_DC) { /* {{{ */
char **auth;
php_cli_server_client_populate_request_info(client, &SG(request_info));
if (SUCCESS == zend_hash_find(&client->request.headers, "Authorization", sizeof("Authorization"), (void**)&auth)) {
@@ -1942,8 +1943,8 @@ static int php_cli_server_request_shutdown(php_cli_server *server, php_cli_serve
SG(server_context) = NULL;
SG(rfc1867_uploaded_files) = NULL;
return SUCCESS;
-}
-/* }}} */
+}
+/* }}} */
static int php_cli_server_dispatch_router(php_cli_server *server, php_cli_server_client *client TSRMLS_DC) /* {{{ */
{
@@ -2002,7 +2003,7 @@ static int php_cli_server_dispatch(php_cli_server *server, php_cli_server_client
destroy_request_info(&SG(request_info));
return SUCCESS;
}
- }
+ }
if (server->router) {
if (!php_cli_server_dispatch_router(server, client TSRMLS_CC)) {
@@ -2016,7 +2017,7 @@ static int php_cli_server_dispatch(php_cli_server *server, php_cli_server_client
|| SUCCESS != php_cli_server_send_error_page(server, client, 500 TSRMLS_CC)) {
php_cli_server_request_shutdown(server, client TSRMLS_CC);
return SUCCESS;
- }
+ }
} else {
if (server->router) {
static int (*send_header_func)(sapi_headers_struct * TSRMLS_DC);
@@ -2029,7 +2030,7 @@ static int php_cli_server_dispatch(php_cli_server *server, php_cli_server_client
sapi_module.send_headers = send_header_func;
SG(sapi_headers).send_default_content_type = 1;
SG(rfc1867_uploaded_files) = NULL;
- }
+ }
if (SUCCESS != php_cli_server_begin_send_static(server, client TSRMLS_CC)) {
php_cli_server_close_connection(server, client TSRMLS_CC);
}
@@ -2191,6 +2192,8 @@ static int php_cli_server_recv_event_read_request(php_cli_server *server, php_cl
efree(errstr);
php_cli_server_close_connection(server, client TSRMLS_CC);
return FAILURE;
+ } else if (status == 1 && client->request.request_method == PHP_HTTP_NOT_IMPLEMENTED) {
+ return php_cli_server_send_error_page(server, client, 501 TSRMLS_CC);
} else if (status == 1) {
php_cli_server_poller_remove(&server->poller, POLLIN, client->sock);
php_cli_server_dispatch(server, client TSRMLS_CC);
@@ -2311,7 +2314,7 @@ static void php_cli_server_do_event_for_each_fd(php_cli_server *server, int(*rha
static int php_cli_server_do_event_loop(php_cli_server *server TSRMLS_DC) /* {{{ */
{
int retval = SUCCESS;
- while (server->is_running) {
+ while (server->is_running) {
static const struct timeval tv = { 1, 0 };
int n = php_cli_server_poller_poll(&server->poller, &tv);
if (n > 0) {
diff --git a/sapi/cli/php_http_parser.c b/sapi/cli/php_http_parser.c
index 13b9ea12bc..d3bc496f4e 100644
--- a/sapi/cli/php_http_parser.c
+++ b/sapi/cli/php_http_parser.c
@@ -81,6 +81,7 @@ static const char *method_strings[] =
, "HEAD"
, "POST"
, "PUT"
+ , "PATCH"
, "CONNECT"
, "OPTIONS"
, "TRACE"
@@ -99,6 +100,7 @@ static const char *method_strings[] =
, "NOTIFY"
, "SUBSCRIBE"
, "UNSUBSCRIBE"
+ , "NOTIMPLEMENTED"
};
@@ -589,7 +591,7 @@ size_t php_http_parser_execute (php_http_parser *parser,
case 'S': parser->method = PHP_HTTP_SUBSCRIBE; break;
case 'T': parser->method = PHP_HTTP_TRACE; break;
case 'U': parser->method = PHP_HTTP_UNLOCK; /* or UNSUBSCRIBE */ break;
- default: goto error;
+ default: parser->method = PHP_HTTP_NOT_IMPLEMENTED; break;
}
state = s_req_method;
break;
@@ -602,7 +604,7 @@ size_t php_http_parser_execute (php_http_parser *parser,
goto error;
matcher = method_strings[parser->method];
- if (ch == ' ' && matcher[index] == '\0') {
+ if (ch == ' ' && (matcher[index] == '\0' || parser->method == PHP_HTTP_NOT_IMPLEMENTED)) {
state = s_req_spaces_before_url;
} else if (ch == matcher[index]) {
; /* nada */
@@ -626,12 +628,14 @@ size_t php_http_parser_execute (php_http_parser *parser,
parser->method = PHP_HTTP_PROPFIND; /* or HTTP_PROPPATCH */
} else if (index == 1 && parser->method == PHP_HTTP_POST && ch == 'U') {
parser->method = PHP_HTTP_PUT;
+ } else if (index == 1 && parser->method == PHP_HTTP_POST && ch == 'A') {
+ parser->method = PHP_HTTP_PATCH;
} else if (index == 2 && parser->method == PHP_HTTP_UNLOCK && ch == 'S') {
parser->method = PHP_HTTP_UNSUBSCRIBE;
} else if (index == 4 && parser->method == PHP_HTTP_PROPFIND && ch == 'P') {
parser->method = PHP_HTTP_PROPPATCH;
} else {
- goto error;
+ parser->method = PHP_HTTP_NOT_IMPLEMENTED;
}
++index;
diff --git a/sapi/cli/php_http_parser.h b/sapi/cli/php_http_parser.h
index 7e72b78d7d..2bf2356725 100644
--- a/sapi/cli/php_http_parser.h
+++ b/sapi/cli/php_http_parser.h
@@ -80,6 +80,7 @@ enum php_http_method
, PHP_HTTP_HEAD
, PHP_HTTP_POST
, PHP_HTTP_PUT
+ , PHP_HTTP_PATCH
/* pathological */
, PHP_HTTP_CONNECT
, PHP_HTTP_OPTIONS
@@ -102,6 +103,8 @@ enum php_http_method
, PHP_HTTP_NOTIFY
, PHP_HTTP_SUBSCRIBE
, PHP_HTTP_UNSUBSCRIBE
+ /* unknown, not implemented */
+ , PHP_HTTP_NOT_IMPLEMENTED
};
diff --git a/sapi/cli/tests/bug61679.phpt b/sapi/cli/tests/bug61679.phpt
new file mode 100644
index 0000000000..819ce2fa89
--- /dev/null
+++ b/sapi/cli/tests/bug61679.phpt
@@ -0,0 +1,43 @@
+--TEST--
+Bug #61679 (Error on non-standard HTTP methods)
+--SKIPIF--
+<?php
+include "skipif.inc";
+?>
+--FILE--
+<?php
+include "php_cli_server.inc";
+php_cli_server_start(<<<'PHP'
+echo "This should never echo";
+PHP
+);
+
+list($host, $port) = explode(':', PHP_CLI_SERVER_ADDRESS);
+$port = intval($port)?:80;
+
+$fp = fsockopen($host, $port, $errno, $errstr, 0.5);
+if (!$fp) {
+ die("connect failed");
+}
+
+// Send a request with a fictitious request method,
+// I like smurfs, the smurf everything.
+if(fwrite($fp, <<<HEADER
+SMURF / HTTP/1.1
+Host: {$host}
+
+
+HEADER
+)) {
+ while (!feof($fp)) {
+ echo fgets($fp);
+ // Only echo the first line from the response,
+ // the rest is not interesting
+ break;
+ }
+}
+
+fclose($fp);
+?>
+--EXPECTF--
+HTTP/1.1 501 Not Implemented
diff --git a/sapi/cli/tests/php_cli_server_018.phpt b/sapi/cli/tests/php_cli_server_018.phpt
new file mode 100644
index 0000000000..deb9348768
--- /dev/null
+++ b/sapi/cli/tests/php_cli_server_018.phpt
@@ -0,0 +1,44 @@
+--TEST--
+Implement Req #61679 (Support HTTP PATCH method)
+--SKIPIF--
+<?php
+include "skipif.inc";
+?>
+--FILE--
+<?php
+include "php_cli_server.inc";
+php_cli_server_start(<<<'PHP'
+var_dump($_SERVER['REQUEST_METHOD']);
+PHP
+);
+
+list($host, $port) = explode(':', PHP_CLI_SERVER_ADDRESS);
+$port = intval($port)?:80;
+
+$fp = fsockopen($host, $port, $errno, $errstr, 0.5);
+if (!$fp) {
+ die("connect failed");
+}
+
+if(fwrite($fp, <<<HEADER
+PATCH / HTTP/1.1
+Host: {$host}
+
+
+HEADER
+)) {
+ while (!feof($fp)) {
+ echo fgets($fp);
+ }
+}
+
+fclose($fp);
+?>
+--EXPECTF--
+HTTP/1.1 200 OK
+Host: %s
+Connection: close
+X-Powered-By: %s
+Content-type: text/html
+
+string(5) "PATCH"
diff --git a/sapi/fpm/config.m4 b/sapi/fpm/config.m4
index ad46717acd..6191c329ba 100644
--- a/sapi/fpm/config.m4
+++ b/sapi/fpm/config.m4
@@ -587,12 +587,16 @@ if test "$PHP_FPM" != "no"; then
AC_DEFINE_UNQUOTED(PHP_FPM_USER, "$php_fpm_user", [fpm user name])
AC_DEFINE_UNQUOTED(PHP_FPM_GROUP, "$php_fpm_group", [fpm group name])
+ AC_DEFINE_UNQUOTED(PHP_FPM_USER, "$php_fpm_user", [fpm user name])
+ AC_DEFINE_UNQUOTED(PHP_FPM_GROUP, "$php_fpm_group", [fpm group name])
+
PHP_ADD_BUILD_DIR(sapi/fpm/fpm)
PHP_ADD_BUILD_DIR(sapi/fpm/fpm/events)
- PHP_OUTPUT(sapi/fpm/php-fpm.conf sapi/fpm/init.d.php-fpm sapi/fpm/php-fpm.8 sapi/fpm/status.html)
+ PHP_OUTPUT(sapi/fpm/php-fpm.conf sapi/fpm/init.d.php-fpm sapi/fpm/php-fpm.service sapi/fpm/php-fpm.8 sapi/fpm/status.html)
PHP_ADD_MAKEFILE_FRAGMENT([$abs_srcdir/sapi/fpm/Makefile.frag])
SAPI_FPM_PATH=sapi/fpm/php-fpm
+
if test "$fpm_trace_type" && test -f "$abs_srcdir/sapi/fpm/fpm/fpm_trace_$fpm_trace_type.c"; then
PHP_FPM_TRACE_FILES="fpm/fpm_trace.c fpm/fpm_trace_$fpm_trace_type.c"
diff --git a/sapi/fpm/fpm/fastcgi.c b/sapi/fpm/fpm/fastcgi.c
index e2e208aa7f..f77c9fb4d6 100644
--- a/sapi/fpm/fpm/fastcgi.c
+++ b/sapi/fpm/fpm/fastcgi.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2009 The PHP Group |
+ | Copyright (c) 1997-2012 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/sapi/fpm/fpm/fastcgi.h b/sapi/fpm/fpm/fastcgi.h
index 7a9f3ef363..f39559d256 100644
--- a/sapi/fpm/fpm/fastcgi.h
+++ b/sapi/fpm/fpm/fastcgi.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2009 The PHP Group |
+ | Copyright (c) 1997-2012 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/sapi/fpm/fpm/fpm.c b/sapi/fpm/fpm/fpm.c
index dab415d123..b866f37f2d 100644
--- a/sapi/fpm/fpm/fpm.c
+++ b/sapi/fpm/fpm/fpm.c
@@ -39,10 +39,10 @@ struct fpm_globals_s fpm_globals = {
.test_successful = 0,
.heartbeat = 0,
.run_as_root = 0,
- .send_config_signal = 0,
+ .send_config_pipe = {0, 0},
};
-int fpm_init(int argc, char **argv, char *config, char *prefix, char *pid, int test_conf, int run_as_root) /* {{{ */
+int fpm_init(int argc, char **argv, char *config, char *prefix, char *pid, int test_conf, int run_as_root, int force_daemon) /* {{{ */
{
fpm_globals.argc = argc;
fpm_globals.argv = argv;
@@ -55,7 +55,7 @@ int fpm_init(int argc, char **argv, char *config, char *prefix, char *pid, int t
if (0 > fpm_php_init_main() ||
0 > fpm_stdio_init_main() ||
- 0 > fpm_conf_init_main(test_conf) ||
+ 0 > fpm_conf_init_main(test_conf, force_daemon) ||
0 > fpm_unix_init_main() ||
0 > fpm_scoreboard_init_main() ||
0 > fpm_pctl_init_main() ||
diff --git a/sapi/fpm/fpm/fpm.h b/sapi/fpm/fpm/fpm.h
index 7a2903d07d..65d0e0d691 100644
--- a/sapi/fpm/fpm/fpm.h
+++ b/sapi/fpm/fpm/fpm.h
@@ -37,7 +37,7 @@
int fpm_run(int *max_requests);
-int fpm_init(int argc, char **argv, char *config, char *prefix, char *pid, int test_conf, int run_as_root);
+int fpm_init(int argc, char **argv, char *config, char *prefix, char *pid, int test_conf, int run_as_root, int force_daemon);
struct fpm_globals_s {
pid_t parent_pid;
@@ -55,7 +55,7 @@ struct fpm_globals_s {
int test_successful;
int heartbeat;
int run_as_root;
- int send_config_signal;
+ int send_config_pipe[2];
};
extern struct fpm_globals_s fpm_globals;
diff --git a/sapi/fpm/fpm/fpm_conf.c b/sapi/fpm/fpm/fpm_conf.c
index dfe6792c05..25e2cc43a1 100644
--- a/sapi/fpm/fpm/fpm_conf.c
+++ b/sapi/fpm/fpm/fpm_conf.c
@@ -1115,7 +1115,7 @@ int fpm_conf_write_pid() /* {{{ */
}
/* }}} */
-static int fpm_conf_post_process(TSRMLS_D) /* {{{ */
+static int fpm_conf_post_process(int force_daemon TSRMLS_DC) /* {{{ */
{
struct fpm_worker_pool_s *wp;
@@ -1123,6 +1123,11 @@ static int fpm_conf_post_process(TSRMLS_D) /* {{{ */
fpm_evaluate_full_path(&fpm_global_config.pid_file, NULL, PHP_LOCALSTATEDIR, 0);
}
+ if (force_daemon >= 0) {
+ /* forced from command line options */
+ fpm_global_config.daemonize = force_daemon;
+ }
+
fpm_globals.log_level = fpm_global_config.log_level;
if (fpm_global_config.process_max < 0) {
@@ -1584,7 +1589,7 @@ static void fpm_conf_dump() /* {{{ */
}
/* }}} */
-int fpm_conf_init_main(int test_conf) /* {{{ */
+int fpm_conf_init_main(int test_conf, int force_daemon) /* {{{ */
{
int ret;
TSRMLS_FETCH();
@@ -1630,7 +1635,7 @@ int fpm_conf_init_main(int test_conf) /* {{{ */
return -1;
}
- if (0 > fpm_conf_post_process(TSRMLS_C)) {
+ if (0 > fpm_conf_post_process(force_daemon TSRMLS_CC)) {
zlog(ZLOG_ERROR, "failed to post process the configuration");
return -1;
}
diff --git a/sapi/fpm/fpm/fpm_conf.h b/sapi/fpm/fpm/fpm_conf.h
index f780f03891..dc54133d43 100644
--- a/sapi/fpm/fpm/fpm_conf.h
+++ b/sapi/fpm/fpm/fpm_conf.h
@@ -97,7 +97,7 @@ enum {
PM_STYLE_ONDEMAND = 3
};
-int fpm_conf_init_main(int test_conf);
+int fpm_conf_init_main(int test_conf, int force_daemon);
int fpm_worker_pool_config_free(struct fpm_worker_pool_config_s *wpc);
int fpm_conf_write_pid();
int fpm_conf_unlink_pid();
diff --git a/sapi/fpm/fpm/fpm_main.c b/sapi/fpm/fpm/fpm_main.c
index 83b461b793..edd75be5ae 100644
--- a/sapi/fpm/fpm/fpm_main.c
+++ b/sapi/fpm/fpm/fpm_main.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2009 The PHP Group |
+ | Copyright (c) 1997-2012 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -155,6 +155,8 @@ static const opt_struct OPTIONS[] = {
{'p', 1, "prefix"},
{'g', 1, "pid"},
{'R', 0, "allow-to-run-as-root"},
+ {'D', 0, "daemonize"},
+ {'F', 0, "nodaemonize"},
{'-', 0, NULL} /* end of args */
};
@@ -912,7 +914,7 @@ static void php_cgi_usage(char *argv0)
prog = "php";
}
- php_printf( "Usage: %s [-n] [-e] [-h] [-i] [-m] [-v] [-t] [-p <prefix>] [-g <pid>] [-c <file>] [-d foo[=bar]] [-y <file>]\n"
+ php_printf( "Usage: %s [-n] [-e] [-h] [-i] [-m] [-v] [-t] [-p <prefix>] [-g <pid>] [-c <file>] [-d foo[=bar]] [-y <file>] [-D] [-F]\n"
" -c <path>|<file> Look for php.ini file in this directory\n"
" -n No php.ini file will be used\n"
" -d foo[=bar] Define INI entry foo with value 'bar'\n"
@@ -928,6 +930,9 @@ static void php_cgi_usage(char *argv0)
" -y, --fpm-config <file>\n"
" Specify alternative path to FastCGI process manager config file.\n"
" -t, --test Test FPM configuration and exit\n"
+ " -D, --daemonize force to run in background, and ignore daemonize option from config file\n"
+ " -F, --nodaemonize\n"
+ " force to stay in foreground, and ignore daemonize option from config file\n"
" -R, --allow-to-run-as-root\n"
" Allow pool to run as root (disabled by default)\n",
prog, PHP_PREFIX);
@@ -1550,6 +1555,7 @@ int main(int argc, char *argv[])
char *fpm_prefix = NULL;
char *fpm_pid = NULL;
int test_conf = 0;
+ int force_daemon = -1;
int php_information = 0;
int php_allow_to_run_as_root = 0;
@@ -1670,6 +1676,14 @@ int main(int argc, char *argv[])
php_allow_to_run_as_root = 1;
break;
+ case 'D': /* daemonize */
+ force_daemon = 1;
+ break;
+
+ case 'F': /* nodaemonize */
+ force_daemon = 0;
+ break;
+
default:
case 'h':
case '?':
@@ -1694,9 +1708,9 @@ int main(int argc, char *argv[])
SG(request_info).no_headers = 1;
#if ZEND_DEBUG
- php_printf("PHP %s (%s) (built: %s %s) (DEBUG)\nCopyright (c) 1997-2009 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version());
+ php_printf("PHP %s (%s) (built: %s %s) (DEBUG)\nCopyright (c) 1997-2012 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version());
#else
- php_printf("PHP %s (%s) (built: %s %s)\nCopyright (c) 1997-2009 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version());
+ php_printf("PHP %s (%s) (built: %s %s)\nCopyright (c) 1997-2012 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version());
#endif
php_request_shutdown((void *) 0);
fcgi_shutdown();
@@ -1797,18 +1811,22 @@ consult the installation file that came with this distribution, or visit \n\
}
}
- if (0 > fpm_init(argc, argv, fpm_config ? fpm_config : CGIG(fpm_config), fpm_prefix, fpm_pid, test_conf, php_allow_to_run_as_root)) {
+ if (0 > fpm_init(argc, argv, fpm_config ? fpm_config : CGIG(fpm_config), fpm_prefix, fpm_pid, test_conf, php_allow_to_run_as_root, force_daemon)) {
- if (fpm_globals.send_config_signal) {
- zlog(ZLOG_DEBUG, "Sending SIGUSR2 (error) to parent %d", getppid());
- kill(getppid(), SIGUSR2);
+ if (fpm_globals.send_config_pipe[1]) {
+ int writeval = 0;
+ zlog(ZLOG_DEBUG, "Sending \"0\" (error) to parent via fd=%d", fpm_globals.send_config_pipe[1]);
+ write(fpm_globals.send_config_pipe[1], &writeval, sizeof(writeval));
+ close(fpm_globals.send_config_pipe[1]);
}
return FPM_EXIT_CONFIG;
}
- if (fpm_globals.send_config_signal) {
- zlog(ZLOG_DEBUG, "Sending SIGUSR1 (OK) to parent %d", getppid());
- kill(getppid(), SIGUSR1);
+ if (fpm_globals.send_config_pipe[1]) {
+ int writeval = 1;
+ zlog(ZLOG_DEBUG, "Sending \"1\" (OK) to parent via fd=%d", fpm_globals.send_config_pipe[1]);
+ write(fpm_globals.send_config_pipe[1], &writeval, sizeof(writeval));
+ close(fpm_globals.send_config_pipe[1]);
}
fpm_is_running = 1;
diff --git a/sapi/fpm/fpm/fpm_php_trace.c b/sapi/fpm/fpm/fpm_php_trace.c
index cd97aebb33..d95d66a754 100644
--- a/sapi/fpm/fpm/fpm_php_trace.c
+++ b/sapi/fpm/fpm/fpm_php_trace.c
@@ -26,6 +26,7 @@
#include "fpm_children.h"
#include "fpm_worker_pool.h"
#include "fpm_process_ctl.h"
+#include "fpm_scoreboard.h"
#include "zlog.h"
@@ -137,6 +138,7 @@ static int fpm_php_trace_dump(struct fpm_child_s *child, FILE *slowlog TSRMLS_DC
void fpm_php_trace(struct fpm_child_s *child) /* {{{ */
{
TSRMLS_FETCH();
+ fpm_scoreboard_update(0, 0, 0, 0, 0, 0, 1, FPM_SCOREBOARD_ACTION_SET, child->wp->scoreboard);
FILE *slowlog;
zlog(ZLOG_NOTICE, "about to trace %d", (int) child->pid);
diff --git a/sapi/fpm/fpm/fpm_process_ctl.c b/sapi/fpm/fpm/fpm_process_ctl.c
index 7840d17f8b..76ea4d358e 100644
--- a/sapi/fpm/fpm/fpm_process_ctl.c
+++ b/sapi/fpm/fpm/fpm_process_ctl.c
@@ -353,7 +353,7 @@ static void fpm_pctl_perform_idle_server_maintenance(struct timeval *now) /* {{{
#endif
}
}
- fpm_scoreboard_update(idle, active, cur_lq, -1, -1, -1, FPM_SCOREBOARD_ACTION_SET, wp->scoreboard);
+ fpm_scoreboard_update(idle, active, cur_lq, -1, -1, -1, 0, FPM_SCOREBOARD_ACTION_SET, wp->scoreboard);
/* this is specific to PM_STYLE_ONDEMAND */
if (wp->config->pm == PM_STYLE_ONDEMAND) {
@@ -388,7 +388,7 @@ static void fpm_pctl_perform_idle_server_maintenance(struct timeval *now) /* {{{
if (idle < wp->config->pm_min_spare_servers) {
if (wp->running_children >= wp->config->pm_max_children) {
if (!wp->warn_max_children) {
- fpm_scoreboard_update(0, 0, 0, 0, 0, 1, FPM_SCOREBOARD_ACTION_INC, wp->scoreboard);
+ fpm_scoreboard_update(0, 0, 0, 0, 0, 1, 0, FPM_SCOREBOARD_ACTION_INC, wp->scoreboard);
zlog(ZLOG_WARNING, "[pool %s] server reached pm.max_children setting (%d), consider raising it", wp->config->name, wp->config->pm_max_children);
wp->warn_max_children = 1;
}
@@ -407,7 +407,7 @@ static void fpm_pctl_perform_idle_server_maintenance(struct timeval *now) /* {{{
children_to_fork = MIN(children_to_fork, wp->config->pm_max_children - wp->running_children);
if (children_to_fork <= 0) {
if (!wp->warn_max_children) {
- fpm_scoreboard_update(0, 0, 0, 0, 0, 1, FPM_SCOREBOARD_ACTION_INC, wp->scoreboard);
+ fpm_scoreboard_update(0, 0, 0, 0, 0, 1, 0, FPM_SCOREBOARD_ACTION_INC, wp->scoreboard);
zlog(ZLOG_WARNING, "[pool %s] server reached pm.max_children setting (%d), consider raising it", wp->config->name, wp->config->pm_max_children);
wp->warn_max_children = 1;
}
@@ -511,7 +511,7 @@ void fpm_pctl_on_socket_accept(struct fpm_event_s *ev, short which, void *arg) /
if (wp->running_children >= wp->config->pm_max_children) {
if (!wp->warn_max_children) {
- fpm_scoreboard_update(0, 0, 0, 0, 0, 1, FPM_SCOREBOARD_ACTION_INC, wp->scoreboard);
+ fpm_scoreboard_update(0, 0, 0, 0, 0, 1, 0, FPM_SCOREBOARD_ACTION_INC, wp->scoreboard);
zlog(ZLOG_WARNING, "[pool %s] server reached max_children setting (%d), consider raising it", wp->config->name, wp->config->pm_max_children);
wp->warn_max_children = 1;
}
diff --git a/sapi/fpm/fpm/fpm_request.c b/sapi/fpm/fpm/fpm_request.c
index 28332d0a92..bf431a08d0 100644
--- a/sapi/fpm/fpm/fpm_request.c
+++ b/sapi/fpm/fpm/fpm_request.c
@@ -54,7 +54,7 @@ void fpm_request_accepting() /* {{{ */
fpm_scoreboard_proc_release(proc);
/* idle++, active-- */
- fpm_scoreboard_update(1, -1, 0, 0, 0, 0, FPM_SCOREBOARD_ACTION_INC, NULL);
+ fpm_scoreboard_update(1, -1, 0, 0, 0, 0, 0, FPM_SCOREBOARD_ACTION_INC, NULL);
}
/* }}} */
@@ -98,7 +98,7 @@ void fpm_request_reading_headers() /* {{{ */
fpm_scoreboard_proc_release(proc);
/* idle--, active++, request++ */
- fpm_scoreboard_update(-1, 1, 0, 0, 1, 0, FPM_SCOREBOARD_ACTION_INC, NULL);
+ fpm_scoreboard_update(-1, 1, 0, 0, 1, 0, 0, FPM_SCOREBOARD_ACTION_INC, NULL);
}
/* }}} */
diff --git a/sapi/fpm/fpm/fpm_scoreboard.c b/sapi/fpm/fpm/fpm_scoreboard.c
index 4222f6037c..24463a90dd 100644
--- a/sapi/fpm/fpm/fpm_scoreboard.c
+++ b/sapi/fpm/fpm/fpm_scoreboard.c
@@ -73,7 +73,7 @@ int fpm_scoreboard_init_main() /* {{{ */
}
/* }}} */
-void fpm_scoreboard_update(int idle, int active, int lq, int lq_len, int requests, int max_children_reached, int action, struct fpm_scoreboard_s *scoreboard) /* {{{ */
+void fpm_scoreboard_update(int idle, int active, int lq, int lq_len, int requests, int max_children_reached, int slow_rq, int action, struct fpm_scoreboard_s *scoreboard) /* {{{ */
{
if (!scoreboard) {
scoreboard = fpm_scoreboard;
@@ -110,6 +110,9 @@ void fpm_scoreboard_update(int idle, int active, int lq, int lq_len, int request
if (max_children_reached >= 0) {
scoreboard->max_children_reached = max_children_reached;
}
+ if (slow_rq > 0) {
+ scoreboard->slow_rq += slow_rq;
+ }
} else {
if (scoreboard->idle + idle > 0) {
scoreboard->idle += idle;
diff --git a/sapi/fpm/fpm/fpm_scoreboard.h b/sapi/fpm/fpm/fpm_scoreboard.h
index 136ea481a4..f58a28737d 100644
--- a/sapi/fpm/fpm/fpm_scoreboard.h
+++ b/sapi/fpm/fpm/fpm_scoreboard.h
@@ -64,13 +64,14 @@ struct fpm_scoreboard_s {
unsigned int lq_len;
unsigned int nprocs;
int free_proc;
+ unsigned long int slow_rq;
struct fpm_scoreboard_proc_s *procs[];
};
int fpm_scoreboard_init_main();
int fpm_scoreboard_init_child(struct fpm_worker_pool_s *wp);
-void fpm_scoreboard_update(int idle, int active, int lq, int lq_len, int requests, int max_children_reached, int action, struct fpm_scoreboard_s *scoreboard);
+void fpm_scoreboard_update(int idle, int active, int lq, int lq_len, int requests, int max_children_reached, int slow_rq, int action, struct fpm_scoreboard_s *scoreboard);
struct fpm_scoreboard_s *fpm_scoreboard_get();
struct fpm_scoreboard_proc_s *fpm_scoreboard_proc_get(struct fpm_scoreboard_s *scoreboard, int child_index);
diff --git a/sapi/fpm/fpm/fpm_signals.c b/sapi/fpm/fpm/fpm_signals.c
index 656269f1a3..8993a860ae 100644
--- a/sapi/fpm/fpm/fpm_signals.c
+++ b/sapi/fpm/fpm/fpm_signals.c
@@ -249,15 +249,3 @@ int fpm_signals_get_fd() /* {{{ */
}
/* }}} */
-void fpm_signals_sighandler_exit_ok(pid_t pid) /* {{{ */
-{
- exit(FPM_EXIT_OK);
-}
-/* }}} */
-
-void fpm_signals_sighandler_exit_config(pid_t pid) /* {{{ */
-{
- exit(FPM_EXIT_CONFIG);
-}
-/* }}} */
-
diff --git a/sapi/fpm/fpm/fpm_signals.h b/sapi/fpm/fpm/fpm_signals.h
index 13484cbac2..eb80faecfd 100644
--- a/sapi/fpm/fpm/fpm_signals.h
+++ b/sapi/fpm/fpm/fpm_signals.h
@@ -11,9 +11,6 @@ int fpm_signals_init_main();
int fpm_signals_init_child();
int fpm_signals_get_fd();
-void fpm_signals_sighandler_exit_ok(pid_t pid);
-void fpm_signals_sighandler_exit_config(pid_t pid);
-
extern const char *fpm_signal_names[NSIG + 1];
#endif
diff --git a/sapi/fpm/fpm/fpm_sockets.c b/sapi/fpm/fpm/fpm_sockets.c
index f56b9cfbd1..76759e7f25 100644
--- a/sapi/fpm/fpm/fpm_sockets.c
+++ b/sapi/fpm/fpm/fpm_sockets.c
@@ -356,7 +356,7 @@ int fpm_sockets_init_main() /* {{{ */
}
if (wp->listen_address_domain == FPM_AF_INET && fpm_socket_get_listening_queue(wp->listening_socket, NULL, &lq_len) >= 0) {
- fpm_scoreboard_update(-1, -1, -1, (int)lq_len, -1, -1, FPM_SCOREBOARD_ACTION_SET, wp->scoreboard);
+ fpm_scoreboard_update(-1, -1, -1, (int)lq_len, -1, -1, 0, FPM_SCOREBOARD_ACTION_SET, wp->scoreboard);
}
}
diff --git a/sapi/fpm/fpm/fpm_status.c b/sapi/fpm/fpm/fpm_status.c
index 5f2c852c7d..2363b57f80 100644
--- a/sapi/fpm/fpm/fpm_status.c
+++ b/sapi/fpm/fpm/fpm_status.c
@@ -148,7 +148,7 @@ int fpm_status_handle_request(TSRMLS_D) /* {{{ */
"<tr><th>start time</th><td>%s</td></tr>\n"
"<tr><th>start since</th><td>%lu</td></tr>\n"
"<tr><th>accepted conn</th><td>%lu</td></tr>\n"
-#if HAVE_FPM_LQ
+#ifdef HAVE_FPM_LQ
"<tr><th>listen queue</th><td>%u</td></tr>\n"
"<tr><th>max listen queue</th><td>%u</td></tr>\n"
"<tr><th>listen queue len</th><td>%d</td></tr>\n"
@@ -158,6 +158,7 @@ int fpm_status_handle_request(TSRMLS_D) /* {{{ */
"<tr><th>total processes</th><td>%d</td></tr>\n"
"<tr><th>max active processes</th><td>%d</td></tr>\n"
"<tr><th>max children reached</th><td>%u</td></tr>\n"
+ "<tr><th>slow requests</th><td>%lu</td></tr>\n"
"</table>\n";
if (!full) {
@@ -177,7 +178,7 @@ int fpm_status_handle_request(TSRMLS_D) /* {{{ */
"<th>content length</th>"
"<th>user</th>"
"<th>script</th>"
-#if HAVE_FPM_LQ
+#ifdef HAVE_FPM_LQ
"<th>last request cpu</th>"
#endif
"<th>last request memory</th>"
@@ -196,7 +197,7 @@ int fpm_status_handle_request(TSRMLS_D) /* {{{ */
"<td>%zu</td>"
"<td>%s</td>"
"<td>%s</td>"
-#if HAVE_FPM_LQ
+#ifdef HAVE_FPM_LQ
"<td>%.2f</td>"
#endif
"<td>%zu</td>"
@@ -219,7 +220,7 @@ int fpm_status_handle_request(TSRMLS_D) /* {{{ */
"<start-time>%s</start-time>\n"
"<start-since>%lu</start-since>\n"
"<accepted-conn>%lu</accepted-conn>\n"
-#if HAVE_FPM_LQ
+#ifdef HAVE_FPM_LQ
"<listen-queue>%u</listen-queue>\n"
"<max-listen-queue>%u</max-listen-queue>\n"
"<listen-queue-len>%d</listen-queue-len>\n"
@@ -228,7 +229,8 @@ int fpm_status_handle_request(TSRMLS_D) /* {{{ */
"<active-processes>%d</active-processes>\n"
"<total-processes>%d</total-processes>\n"
"<max-active-processes>%d</max-active-processes>\n"
- "<max-children-reached>%u</max-children-reached>\n";
+ "<max-children-reached>%u</max-children-reached>\n"
+ "<slow-requests>%lu</slow-requests>\n";
if (!full) {
short_post = "</status>";
@@ -247,7 +249,7 @@ int fpm_status_handle_request(TSRMLS_D) /* {{{ */
"<content-length>%zu</content-length>"
"<user>%s</user>"
"<script>%s</script>"
-#if HAVE_FPM_LQ
+#ifdef HAVE_FPM_LQ
"<last-request-cpu>%.2f</last-request-cpu>"
#endif
"<last-request-memory>%zu</last-request-memory>"
@@ -268,7 +270,7 @@ int fpm_status_handle_request(TSRMLS_D) /* {{{ */
"\"start time\":%s,"
"\"start since\":%lu,"
"\"accepted conn\":%lu,"
-#if HAVE_FPM_LQ
+#ifdef HAVE_FPM_LQ
"\"listen queue\":%u,"
"\"max listen queue\":%u,"
"\"listen queue len\":%d,"
@@ -277,7 +279,8 @@ int fpm_status_handle_request(TSRMLS_D) /* {{{ */
"\"active processes\":%d,"
"\"total processes\":%d,"
"\"max active processes\":%d,"
- "\"max children reached\":%u";
+ "\"max children reached\":%u,"
+ "\"slow requests\":%lu";
if (!full) {
short_post = "}";
@@ -297,7 +300,7 @@ int fpm_status_handle_request(TSRMLS_D) /* {{{ */
"\"content length\":%zu,"
"\"user\":\"%s\","
"\"script\":\"%s\","
-#if HAVE_FPM_LQ
+#ifdef HAVE_FPM_LQ
"\"last request cpu\":%.2f,"
#endif
"\"last request memory\":%zu"
@@ -317,7 +320,7 @@ int fpm_status_handle_request(TSRMLS_D) /* {{{ */
"start time: %s\n"
"start since: %lu\n"
"accepted conn: %lu\n"
-#if HAVE_FPM_LQ
+#ifdef HAVE_FPM_LQ
"listen queue: %u\n"
"max listen queue: %u\n"
"listen queue len: %d\n"
@@ -326,7 +329,8 @@ int fpm_status_handle_request(TSRMLS_D) /* {{{ */
"active processes: %d\n"
"total processes: %d\n"
"max active processes: %d\n"
- "max children reached: %u\n";
+ "max children reached: %u\n"
+ "slow requests: %lu\n";
if (full) {
full_syntax =
@@ -358,7 +362,7 @@ int fpm_status_handle_request(TSRMLS_D) /* {{{ */
time_buffer,
now_epoch - scoreboard.start_epoch,
scoreboard.requests,
-#if HAVE_FPM_LQ
+#ifdef HAVE_FPM_LQ
scoreboard.lq,
scoreboard.lq_max,
scoreboard.lq_len,
@@ -367,7 +371,8 @@ int fpm_status_handle_request(TSRMLS_D) /* {{{ */
scoreboard.active,
scoreboard.idle + scoreboard.active,
scoreboard.active_max,
- scoreboard.max_children_reached);
+ scoreboard.max_children_reached,
+ scoreboard.slow_rq);
PUTS(buffer);
efree(buffer);
diff --git a/sapi/fpm/fpm/fpm_unix.c b/sapi/fpm/fpm/fpm_unix.c
index 5c5e37c3a4..48249e8a49 100644
--- a/sapi/fpm/fpm/fpm_unix.c
+++ b/sapi/fpm/fpm/fpm_unix.c
@@ -121,16 +121,16 @@ static int fpm_unix_conf_wp(struct fpm_worker_pool_s *wp) /* {{{ */
}
} else { /* not root */
if (wp->config->user && *wp->config->user) {
- zlog(ZLOG_WARNING, "[pool %s] 'user' directive is ignored when FPM is not running as root", wp->config->name);
+ zlog(ZLOG_NOTICE, "[pool %s] 'user' directive is ignored when FPM is not running as root", wp->config->name);
}
if (wp->config->group && *wp->config->group) {
- zlog(ZLOG_WARNING, "[pool %s] 'group' directive is ignored when FPM is not running as root", wp->config->name);
+ zlog(ZLOG_NOTICE, "[pool %s] 'group' directive is ignored when FPM is not running as root", wp->config->name);
}
if (wp->config->chroot && *wp->config->chroot) {
- zlog(ZLOG_WARNING, "[pool %s] 'chroot' directive is ignored when FPM is not running as root", wp->config->name);
+ zlog(ZLOG_NOTICE, "[pool %s] 'chroot' directive is ignored when FPM is not running as root", wp->config->name);
}
if (wp->config->process_priority != 64) {
- zlog(ZLOG_WARNING, "[pool %s] 'process.priority' directive is ignored when FPM is not running as root", wp->config->name);
+ zlog(ZLOG_NOTICE, "[pool %s] 'process.priority' directive is ignored when FPM is not running as root", wp->config->name);
}
/* set up HOME and USER anyway */
@@ -262,36 +262,19 @@ int fpm_unix_init_main() /* {{{ */
* The parent process has then to wait for the master
* process to initialize to return a consistent exit
* value. For this pupose, the master process will
- * send USR1 if everything went well and USR2
- * otherwise.
+ * send \"1\" into the pipe if everything went well
+ * and \"0\" otherwise.
*/
- struct sigaction act;
- struct sigaction oldact_usr1;
- struct sigaction oldact_usr2;
- struct timeval tv;
- /*
- * set sigaction for USR1 before fork
- * save old sigaction to restore it after
- * fork in the child process (the master process)
- */
- memset(&act, 0, sizeof(act));
- memset(&act, 0, sizeof(oldact_usr1));
- act.sa_handler = fpm_signals_sighandler_exit_ok;
- sigfillset(&act.sa_mask);
- sigaction(SIGUSR1, &act, &oldact_usr1);
+ struct timeval tv;
+ fd_set rfds;
+ int ret;
- /*
- * set sigaction for USR2 before fork
- * save old sigaction to restore it after
- * fork in the child process (the master process)
- */
- memset(&act, 0, sizeof(act));
- memset(&act, 0, sizeof(oldact_usr2));
- act.sa_handler = fpm_signals_sighandler_exit_config;
- sigfillset(&act.sa_mask);
- sigaction(SIGUSR2, &act, &oldact_usr2);
+ if (pipe(fpm_globals.send_config_pipe) == -1) {
+ zlog(ZLOG_SYSERROR, "failed to create pipe");
+ return -1;
+ }
/* then fork */
pid_t pid = fork();
@@ -302,24 +285,54 @@ int fpm_unix_init_main() /* {{{ */
return -1;
case 0 : /* children */
- /* restore USR1 and USR2 sigaction */
- sigaction(SIGUSR1, &oldact_usr1, NULL);
- sigaction(SIGUSR2, &oldact_usr2, NULL);
- fpm_globals.send_config_signal = 1;
+ close(fpm_globals.send_config_pipe[0]); /* close the read side of the pipe */
break;
default : /* parent */
- fpm_cleanups_run(FPM_CLEANUP_PARENT_EXIT);
+ close(fpm_globals.send_config_pipe[1]); /* close the write side of the pipe */
/*
* wait for 10s before exiting with error
- * the child is supposed to send USR1 or USR2 to tell the parent
+ * the child is supposed to send 1 or 0 into the pipe to tell the parent
* how it goes for it
*/
+ FD_ZERO(&rfds);
+ FD_SET(fpm_globals.send_config_pipe[0], &rfds);
+
tv.tv_sec = 10;
tv.tv_usec = 0;
- zlog(ZLOG_DEBUG, "The calling process is waiting for the master process to ping");
- select(0, NULL, NULL, NULL, &tv);
+
+ zlog(ZLOG_DEBUG, "The calling process is waiting for the master process to ping via fd=%d", fpm_globals.send_config_pipe[0]);
+ ret = select(fpm_globals.send_config_pipe[0] + 1, &rfds, NULL, NULL, &tv);
+ if (ret == -1) {
+ zlog(ZLOG_SYSERROR, "failed to select");
+ exit(FPM_EXIT_SOFTWARE);
+ }
+ if (ret) { /* data available */
+ int readval;
+ ret = read(fpm_globals.send_config_pipe[0], &readval, sizeof(readval));
+ if (ret == -1) {
+ zlog(ZLOG_SYSERROR, "failed to read from pipe");
+ exit(FPM_EXIT_SOFTWARE);
+ }
+
+ if (ret == 0) {
+ zlog(ZLOG_ERROR, "no data have been read from pipe");
+ exit(FPM_EXIT_SOFTWARE);
+ } else {
+ if (readval == 1) {
+ zlog(ZLOG_DEBUG, "I received a valid acknoledge from the master process, I can exit without error");
+ fpm_cleanups_run(FPM_CLEANUP_PARENT_EXIT);
+ exit(FPM_EXIT_OK);
+ } else {
+ zlog(ZLOG_DEBUG, "The master process returned an error !");
+ exit(FPM_EXIT_SOFTWARE);
+ }
+ }
+ } else { /* no date sent ! */
+ zlog(ZLOG_ERROR, "the master process didn't send back its status (via the pipe to the calling process)");
+ exit(FPM_EXIT_SOFTWARE);
+ }
exit(FPM_EXIT_SOFTWARE);
}
}
@@ -337,7 +350,7 @@ int fpm_unix_init_main() /* {{{ */
return -1;
}
} else {
- zlog(ZLOG_WARNING, "'process.priority' directive is ignored when FPM is not running as root");
+ zlog(ZLOG_NOTICE, "'process.priority' directive is ignored when FPM is not running as root");
}
}
diff --git a/sapi/fpm/init.d.php-fpm.in b/sapi/fpm/init.d.php-fpm.in
index dc66310c3d..49cce79ae9 100644
--- a/sapi/fpm/init.d.php-fpm.in
+++ b/sapi/fpm/init.d.php-fpm.in
@@ -18,7 +18,7 @@ php_fpm_CONF=@sysconfdir@/php-fpm.conf
php_fpm_PID=@localstatedir@/run/php-fpm.pid
-php_opts="--fpm-config $php_fpm_CONF"
+php_opts="--fpm-config $php_fpm_CONF --pid $php_fpm_PID"
wait_for_pid () {
@@ -54,7 +54,7 @@ case "$1" in
start)
echo -n "Starting php-fpm "
- $php_fpm_BIN $php_opts
+ $php_fpm_BIN --daemonize $php_opts
if [ "$?" != 0 ] ; then
echo " failed"
diff --git a/sapi/fpm/php-fpm.8.in b/sapi/fpm/php-fpm.8.in
index 6c9c6d6274..a4e7e74e20 100644
--- a/sapi/fpm/php-fpm.8.in
+++ b/sapi/fpm/php-fpm.8.in
@@ -99,6 +99,20 @@ Test FPM configuration file and exit
If called twice (-tt), the configuration is dumped before exiting.
.TP
.PD 0
+.B \-\-daemonize
+.TP
+.PD 1
+.B \-D
+Force to run in background and ignore daemonize option from configuration file.
+.TP
+.PD 0
+.B \-\-nodaemonize
+.TP
+.PD 1
+.B \-F
+Force to stay in foreground and ignore daemonize option from configuration file.
+.TP
+.PD 0
.B \-\-zend\-extension \fIfile\fP
.TP
.PD 1
@@ -113,13 +127,20 @@ The configuration file for the php-fpm daemon.
.B php.ini
The standard php configuration file.
.SH EXAMPLES
-You should use the init script provided to start and stop the php-fpm daemon. This situation applies for any unix systems which use init.d for their main process manager.
+For any unix systems which use init.d for their main process manager, you should use the init script provided to start and stop the php-fpm daemon.
.P
.PD 1
.RS
sudo /etc/init.d/php-fpm start
.RE
.TP
+For any unix systems which use systemd for their main process manager, you should use the unit file provided to start and stop the php-fpm daemon.
+.P
+.PD 1
+.RS
+sudo systemctl start php-fpm.service
+.RE
+.TP
If your installation has no appropriate init script, launch php-fpm with no arguments. It will launch as a daemon (background process) by default. The file @php_fpm_localstatedir@/run/php-fpm.pid determines whether php-fpm is already up and running. Once started, php-fpm then responds to several POSIX signals:
.P
.PD 0
diff --git a/sapi/fpm/php-fpm.service.in b/sapi/fpm/php-fpm.service.in
new file mode 100644
index 0000000000..396a88d66f
--- /dev/null
+++ b/sapi/fpm/php-fpm.service.in
@@ -0,0 +1,12 @@
+[Unit]
+Description=The PHP FastCGI Process Manager
+After=syslog.target network.target
+
+[Service]
+PIDFile=@localstatedir@/run/php-fpm.pid
+ExecStart=@sbindir@/php-fpm --nodaemonize --fpm-config @sysconfdir@/php-fpm.conf
+ExecReload=/bin/kill -USR2 $MAINPID
+
+[Install]
+WantedBy=multi-user.target
+
diff --git a/sapi/litespeed/lsapi_main.c b/sapi/litespeed/lsapi_main.c
index a197225b4b..bb532d8362 100644
--- a/sapi/litespeed/lsapi_main.c
+++ b/sapi/litespeed/lsapi_main.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2007 The PHP Group |
+ | Copyright (c) 1997-2012 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -719,9 +719,9 @@ static int cli_main( int argc, char * argv[] )
case 'v':
if (php_request_startup(TSRMLS_C) != FAILURE) {
#if ZEND_DEBUG
- php_printf("PHP %s (%s) (built: %s %s) (DEBUG)\nCopyright (c) 1997-2004 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version());
+ php_printf("PHP %s (%s) (built: %s %s) (DEBUG)\nCopyright (c) 1997-2012 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version());
#else
- php_printf("PHP %s (%s) (built: %s %s)\nCopyright (c) 1997-2004 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version());
+ php_printf("PHP %s (%s) (built: %s %s)\nCopyright (c) 1997-2012 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version());
#endif
#ifdef PHP_OUTPUT_NEWAPI
php_output_end_all(TSRMLS_C);
diff --git a/sapi/litespeed/lsapidef.h b/sapi/litespeed/lsapidef.h
index 276c579b2c..68f73c4e25 100644
--- a/sapi/litespeed/lsapidef.h
+++ b/sapi/litespeed/lsapidef.h
@@ -3,7 +3,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2007 The PHP Group |
+ | Copyright (c) 1997-2012 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/sapi/litespeed/lsapilib.c b/sapi/litespeed/lsapilib.c
index a3297346d6..fe89ebab28 100644
--- a/sapi/litespeed/lsapilib.c
+++ b/sapi/litespeed/lsapilib.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2007 The PHP Group |
+ | Copyright (c) 1997-2012 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/sapi/litespeed/lsapilib.h b/sapi/litespeed/lsapilib.h
index 8a604fbf1e..701b5284c9 100644
--- a/sapi/litespeed/lsapilib.h
+++ b/sapi/litespeed/lsapilib.h
@@ -3,7 +3,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2007 The PHP Group |
+ | Copyright (c) 1997-2012 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/tests/lang/compare_objects_basic2.phpt b/tests/lang/compare_objects_basic2.phpt
index a2c34d06ad..7e4786cd28 100644
--- a/tests/lang/compare_objects_basic2.phpt
+++ b/tests/lang/compare_objects_basic2.phpt
@@ -20,9 +20,5 @@ var_dump($obj1 == $obj2);
===DONE===
--EXPECTF--
Simple test comparing two objects with different compare callback handler
-
-Notice: Object of class X could not be converted to int in %s on line %d
-
-Notice: Object of class DateTime could not be converted to int in %s on line %d
-bool(true)
-===DONE=== \ No newline at end of file
+bool(false)
+===DONE===
diff --git a/win32/build/deplister.c b/win32/build/deplister.c
index bf91b96d52..f99da51228 100644
--- a/win32/build/deplister.c
+++ b/win32/build/deplister.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2010 The PHP Group |
+ | Copyright (c) 1997-2012 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
diff --git a/win32/build/libs_version.txt b/win32/build/libs_version.txt
index 39281d7387..922245d858 100644
--- a/win32/build/libs_version.txt
+++ b/win32/build/libs_version.txt
@@ -1,16 +1,16 @@
bz2-1.0.6
cclient-2007e
freetype-2.4.3
-icu-4.6.1
+icu-49.1.2
jpeglib-6b
-libcurl-7.24.0
-libiconv-1.11
+libcurl-7.27.0
+libiconv-1.14
libmcrypt-2.5.8
-libmpir-1.3.1
+libmpir-2.5.1
libpng-1.2.46
libpq-8.3.6
-libssh2-1.3.0
+libssh2-1.4.2
libtidy-20090325
-libxslt-1.1.23
-libxml-2.7.7
-openssl-0.9.8u
+libxslt-1.1.27
+libxml-2.7.8
+openssl-0.9.8x
diff --git a/win32/build/template.rc b/win32/build/template.rc
index 2db8896497..606b08a244 100644
--- a/win32/build/template.rc
+++ b/win32/build/template.rc
@@ -65,7 +65,7 @@ BEGIN
#endif
VALUE "FileVersion", EXT_VERSION
VALUE "InternalName", INTERNAL_NAME
- VALUE "LegalCopyright", "Copyright © 1997-2010 The PHP Group"
+ VALUE "LegalCopyright", "Copyright © 1997-2012 The PHP Group"
VALUE "LegalTrademarks", "PHP"
VALUE "OriginalFilename", FILE_NAME
VALUE "ProductName", "PHP"
diff --git a/win32/registry.c b/win32/registry.c
index 45e842b455..638d85ae52 100644
--- a/win32/registry.c
+++ b/win32/registry.c
@@ -77,12 +77,13 @@ static int LoadDirectory(HashTable *directories, HKEY key, char *path, int path_
value_len = max_value+1;
if (RegEnumValue(key, i, name, &name_len, NULL, &type, value, &value_len) == ERROR_SUCCESS) {
if ((type == REG_SZ) || (type == REG_EXPAND_SZ)) {
- ht = (HashTable*)malloc(sizeof(HashTable));
if (!ht) {
- return ret;
+ ht = (HashTable*)malloc(sizeof(HashTable));
+ if (!ht) {
+ return ret;
+ }
+ zend_hash_init(ht, 0, NULL, ZVAL_INTERNAL_PTR_DTOR, 1);
}
- zend_hash_init(ht, 0, NULL, ZVAL_INTERNAL_PTR_DTOR, 1);
-
data = (zval*)malloc(sizeof(zval));
if (!data) {
return ret;