summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS690
-rw-r--r--UPGRADING410
-rw-r--r--UPGRADING.INTERNALS210
-rw-r--r--Zend/zend.c2
-rw-r--r--Zend/zend.h6
-rw-r--r--Zend/zend_API.c4
-rw-r--r--Zend/zend_API.h2
-rw-r--r--Zend/zend_alloc.c4
-rw-r--r--Zend/zend_alloc.h2
-rw-r--r--Zend/zend_ast.c10
-rw-r--r--Zend/zend_execute.h6
-rw-r--r--Zend/zend_execute_API.c4
-rw-r--r--Zend/zend_extensions.c12
-rw-r--r--Zend/zend_extensions.h8
-rw-r--r--Zend/zend_indent.c3
-rw-r--r--Zend/zend_indent.h2
-rw-r--r--Zend/zend_interfaces.c2
-rw-r--r--Zend/zend_modules.h2
-rw-r--r--Zend/zend_object_handlers.c13
-rw-r--r--Zend/zend_vm_def.h22
-rw-r--r--Zend/zend_vm_execute.h114
-rw-r--r--configure.in2
-rw-r--r--ext/date/php_date.c4
-rw-r--r--ext/date/tests/bug67118.phpt3
-rw-r--r--ext/date/tests/bug67118_2.phpt13
-rw-r--r--ext/dba/dba_inifile.c5
-rw-r--r--ext/dba/libinifile/inifile.c41
-rw-r--r--ext/dba/libinifile/inifile.h2
-rw-r--r--ext/dba/tests/bug62490.phpt43
-rw-r--r--ext/dba/tests/dba_db4_003.phpt2
-rw-r--r--ext/dba/tests/dba_db4_007.phpt2
-rw-r--r--ext/dba/tests/dba_db4_010.phpt38
-rw-r--r--ext/dba/tests/dba_handler.inc2
-rw-r--r--ext/dba/tests/dba_inifile.phpt8
-rw-r--r--ext/dba/tests/dba_tcadb.phpt6
-rw-r--r--ext/dom/php_dom.c2
-rw-r--r--ext/gd/libgd/gdft.c10
-rw-r--r--ext/interbase/interbase.c6
-rw-r--r--ext/json/json.c4
-rw-r--r--ext/mysqlnd/mysqlnd_net.c8
-rw-r--r--ext/mysqlnd/mysqlnd_ps.c1
-rw-r--r--ext/opcache/Optimizer/block_pass.c14
-rw-r--r--ext/opcache/Optimizer/pass2.c13
-rw-r--r--ext/opcache/ZendAccelerator.c4
-rw-r--r--ext/opcache/zend_accelerator_module.c7
-rw-r--r--ext/opcache/zend_accelerator_module.h5
-rwxr-xr-xext/openssl/openssl.c2
-rw-r--r--ext/openssl/xp_ssl.c40
-rw-r--r--ext/pcntl/pcntl.c2
-rw-r--r--ext/session/mod_user.c25
-rw-r--r--ext/session/session.c15
-rw-r--r--ext/session/tests/031.phpt9
-rw-r--r--ext/session/tests/bug60634_error_1.phpt1
-rw-r--r--ext/session/tests/bug60634_error_2.phpt1
-rw-r--r--ext/session/tests/save_handler.inc5
-rw-r--r--ext/session/tests/session_module_name_variation3.phpt14
-rw-r--r--ext/session/tests/session_set_save_handler_class_002.phpt3
-rw-r--r--ext/session/tests/session_set_save_handler_class_005.phpt2
-rw-r--r--ext/session/tests/session_set_save_handler_class_012.phpt6
-rw-r--r--ext/session/tests/session_set_save_handler_class_016.phpt2
-rw-r--r--ext/session/tests/session_set_save_handler_class_017.phpt2
-rw-r--r--ext/session/tests/session_set_save_handler_error3.phpt4
-rw-r--r--ext/session/tests/session_set_save_handler_error4.phpt2
-rw-r--r--ext/session/tests/session_set_save_handler_iface_001.phpt2
-rw-r--r--ext/session/tests/session_set_save_handler_variation4.phpt1
-rw-r--r--ext/soap/php_encoding.c2
-rw-r--r--ext/spl/spl_array.c4
-rw-r--r--ext/spl/spl_directory.c4
-rw-r--r--ext/spl/spl_fixedarray.c4
-rw-r--r--ext/spl/spl_iterators.c8
-rw-r--r--ext/standard/array.c4
-rw-r--r--ext/standard/basic_functions.c99
-rw-r--r--ext/standard/basic_functions.h2
-rw-r--r--ext/standard/ftp_fopen_wrapper.c6
-rw-r--r--ext/standard/head.c12
-rw-r--r--ext/standard/head.h7
-rw-r--r--ext/standard/http_fopen_wrapper.c4
-rw-r--r--ext/standard/tests/general_functions/bug44487.phpt24
-rw-r--r--ext/standard/tests/general_functions/call_user_method.phpt20
-rw-r--r--ext/standard/tests/general_functions/call_user_method_002.phpt12
-rw-r--r--ext/standard/tests/network/setcookie.phpt6
-rw-r--r--ext/standard/type.c2
-rw-r--r--ext/xsl/php_xsl.c25
-rw-r--r--ext/zip/tests/oo_addglob.phpt50
-rw-r--r--ext/zip/tests/oo_addpattern.phpt51
-rw-r--r--main/SAPI.c2
-rw-r--r--main/SAPI.h2
-rw-r--r--main/main.c59
-rw-r--r--main/php.h2
-rw-r--r--main/php_content_types.c36
-rw-r--r--main/php_globals.h1
-rw-r--r--main/php_ini.c4
-rw-r--r--main/php_ticks.c12
-rw-r--r--main/php_ticks.h6
-rw-r--r--main/php_variables.c1
-rw-r--r--main/php_version.h6
-rw-r--r--main/streams/php_stream_context.h2
-rw-r--r--main/streams/streams.c3
-rw-r--r--main/streams/transports.c2
-rw-r--r--main/streams/userspace.c4
-rw-r--r--php.ini-development7
-rw-r--r--php.ini-production7
-rw-r--r--sapi/apache/mod_php5.c2
-rw-r--r--sapi/apache2filter/sapi_apache2.c3
-rw-r--r--sapi/apache2handler/sapi_apache2.c3
-rw-r--r--sapi/apache_hooks/mod_php5.c2
-rw-r--r--sapi/apache_hooks/php_apache.c12
-rw-r--r--sapi/caudium/caudium.c5
-rw-r--r--sapi/cgi/cgi_main.c10
-rw-r--r--sapi/cli/generate_mime_type_map.php76
-rw-r--r--sapi/cli/mime_type_map.h1024
-rw-r--r--sapi/cli/php_cli.c6
-rw-r--r--sapi/cli/php_cli_server.c114
-rw-r--r--sapi/cli/tests/bug61977.phpt2
-rw-r--r--sapi/continuity/capi.c2
-rw-r--r--sapi/embed/php_embed.c2
-rw-r--r--sapi/fpm/fpm/fpm_main.c2
-rw-r--r--sapi/litespeed/lsapi_main.c2
-rw-r--r--sapi/milter/php_milter.c8
-rw-r--r--sapi/nsapi/nsapi.c3
-rw-r--r--sapi/pi3web/pi3web_sapi.c2
-rw-r--r--sapi/roxen/roxen.c5
-rw-r--r--sapi/thttpd/thttpd.c3
-rw-r--r--sapi/tux/php_tux.c10
-rw-r--r--tests/basic/024.phpt31
-rw-r--r--tests/basic/024_1.phpt29
-rw-r--r--tests/basic/026.phpt18
-rw-r--r--tests/basic/026_1.phpt16
128 files changed, 1712 insertions, 2093 deletions
diff --git a/NEWS b/NEWS
index 122e05ec1c..1badfb8579 100644
--- a/NEWS
+++ b/NEWS
@@ -1,692 +1,20 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-?? ??? 2014, PHP 5.6.0 Release Candidate 3
-
-- Core:
- . Fixed bug #67497 (eval with parse error causes segmentation fault in
- generator). (Nikita)
- . Fixed bug #67151 (strtr with empty array crashes). (Nikita)
- . Fixed bug #67407 (Windows 8.1/Server 2012 R2 reported as Windows 8/Server
- 2012). (Christian Wenz)
- . Fixed bug #66608 (Incorrect behavior with nested "finally" blocks).
- (Laruence, Dmitry)
- . Implemented FR #34407 (ucwords and Title Case). (Tjerk)
-
-- CLI server:
- . Fixed bug #66830 (Empty header causes PHP built-in web server to hang).
- (Adam)
- . Fixed bug #67594 (Unable to access to apache_request_headers() elements).
- (Tjerk)
-
-- FPM:
- . Fixed bug #67530 (error_log=syslog ignored). (Remi)
- . Fixed bug #67635 (php links to systemd libraries without using pkg-config).
- (pacho@gentoo.org, Remi)
-
-- Intl:
- . Fixed bug #66921 (Wrong argument type hint for function
- intltz_from_date_time_zone). (Stas)
- . Fixed bug #67052 (NumberFormatter::parse() resets LC_NUMERIC setting).
- (Stas)
-
-- pgsql:
- . Fixed bug #67555 (Cannot build against libpq 7.3). (Adam)
-
-- OpenSSL:
- . Fixed bug #67609 (TLS connections fail behind HTTP proxy). (Daniel Lowrey)
- . Fixed broken build against OpenSSL older than 0.9.8 where ECDH unavailable.
- (Lior Kaplan)
- . Fixed bug #67666 (Subject altNames doesn't support wildcard matching). (Tjerk)
-
-- Phar:
- . Fixed bug #67587 (Redirection loop on nginx with FPM). (Christian Weiske)
-
-- SPL:
- . Fixed bug #67539 (ArrayIterator use-after-free due to object change during
- sorting). (research at insighti dot org, Laruence)
- . Fixed bug #67538 (SPL Iterators use-after-free). (CVE-2014-4670) (Laruence)
-
-- Session:
- . Fixed bug #66827 (Session raises E_NOTICE when session name variable is array).
- (Yasuo)
-
-- OPCache:
- . Fixed bug #67215 (php-cgi work with opcache, may be segmentation fault
- happen) (Dmitry, Laruence)
-
-- phpdbg
- . Fixed bug #67575 (Compilation fails for phpdbg when the
- build directory != src directory). (Andy Thompson)
-
-03 Jul 2014, PHP 5.6.0 Release Candidate 2
-
-- Core:
- . Fixed bug #67091 (make install fails to install libphp5.so on FreeBSD 10.0).
- (Ferenc)
- . Fixed bug #67368 (Memory leak with immediately dereferenced array in class
- constant). (Laruence)
- . Fixed bug #67468 (Segfault in highlight_file()/highlight_string()).
- (Andreas Ferber)
- . Fixed bug #67498 (phpinfo() Type Confusion Information Leak Vulnerability).
- (Stefan Esser)
- . Fixed bug #67551 (php://input temp file will be located in sys_temp_dir
- instead of upload_tmp_dir). (Mike)
-
-- FPM:
- . Fix bug #67531 (syslog cannot be set in pool configuration). (Remi)
- . Fix bug #67541 (Fix Apache 2.4.10+ SetHandler proxy:fcgi://
- incompatibilities). (David Zuelke)
-
-- Intl:
- . Fixed bug #67349 (Locale::parseLocale Double Free). (Stas)
- . Fixed bug #67397 (Buffer overflow in locale_get_display_name and
- uloc_getDisplayName (libicu 4.8.1)). (Stas)
-
-- pgsql:
- . Fix bug #67550 (Error in code "form" instead of "from", pgsql.c, line 756),
- which affected builds against libpq < 7.3. (Adam)
-
-- phpdbg:
- . Fix Bug #67499 (readline feature not enabled when build with libedit). (Remi)
- . Fix issue krakjoe/phpdbg#94 (List behavior is inconsistent). (Bob)
- . Fix issue krakjoe/phpdbg#97 (The prompt should always ensure it is on a
- newline). (Bob)
- . Fix issue krakjoe/phpdbg#98 (break if does not seem to work). (Bob)
- . Fix issue krakjoe/phpdbg#99 (register function has the same behavior as
- run). (Bob)
- . Fix issue krakjoe/phpdbg#100 (No way to list the current stack/frames)
- (Help entry was missing). (Bob)
-
-- SPL:
- . Fixed bug #67492 (unserialize() SPL ArrayObject / SPLObjectStorage Type
- Confusion) (CVE-2014-3515). (Stefan Esser)
-
-19 Jun 2014, PHP 5.6.0 Release Candidate 1
-
-- Core:
- . Implemented FR #64744 (Differentiate between member function call on a null
- and non-null, non-objects). (Boro Sitnikovski)
- . Fixed bug #67436 (Autoloader isn't called if two method definitions don't
- match). (Bob)
- . Fixed bug #66622 (Closures do not correctly capture the late bound class
- (static::) in some cases). (Levi Morrison)
- . Fixed bug #67390 (insecure temporary file use in the configure script).
- (Remi) (CVE-2014-3981)
- . Fixed bug #67392 (dtrace breaks argument unpack). (Nikita)
- . Fixed bug #67428 (header('Location: foo') will override a 308-399 response
- code). (Adam)
- . Fixed bug #67433 (SIGSEGV when using count() on an object implementing
- Countable). (Matteo)
- . Fixed bug #67399 (putenv with empty variable may lead to crash). (Stas)
-
-- CLI server:
- . Implemented FR #67429 (CLI server is missing some new HTTP response codes).
- (Adam)
- . Fixed Bug #67406 (built-in web-server segfaults on startup). (Remi)
-
-- Fileinfo:
- . Fixed bug #67410 (fileinfo: mconvert incorrect handling of truncated pascal
- string size). (Francisco Alonso, Jan Kaluza, Remi)
- . Fixed bug #67411 (fileinfo: cdf_check_stream_offset insufficient boundary
- check). (Francisco Alonso, Jan Kaluza, Remi)
- . Fixed bug #67412 (fileinfo: cdf_count_chain insufficient boundary check).
- (Francisco Alonso, Jan Kaluza, Remi)
- . Fixed bug #67413 (fileinfo: cdf_read_property_info insufficient boundary
- check). (Francisco Alonso, Jan Kaluza, Remi)
-
-- mysqlnd:
- . Added support for gb18030 from MySQL 5.7. (Andrey)
-
-- Network:
- . Fixed bug #67432 (Fix potential segfault in dns_get_record()).
- (CVE-2014-4049). (Sara)
-
-- OpenSSL:
- . Fixed bug #65698 (certificates validity parsing does not work past 2050).
- (Paul Oehler)
- . Fixed bug #66636 (openssl_x509_parse warning with V_ASN1_GENERALIZEDTIME).
- (Paul Oehler)
-
-- phpdbg:
- . Fixed bug #67212 (phpdbg uses non-standard TIOCGWINSZ). (Ferenc)
-
-- SOAP:
- . Implemented FR #49898 (Add SoapClient::__getCookies()). (Boro Sitnikovski)
-
-- SPL:
- . Fixed bug #66127 (Segmentation fault with ArrayObject unset). (Stas)
- . Fixed request #67453 (Allow to unserialize empty data). (Remi)
-
-- Streams:
- . Fixed bug #67430 (http:// wrapper doesn't follow 308 redirects). (Adam)
-
-- Tokenizer:
- . Fixed bug #67395 (token_name() does not return name for T_POW and T_POW_EQUAL
- token). (Ferenc)
-
-05 Jun 2014, PHP 5.6.0 Beta 4
-
-- Core:
- . Fixed bug #67249 (printf out-of-bounds read). (Stas)
-
-- Date:
- . Fixed bug #67308 (Serialize of DateTime truncates fractions of second).
- (Adam)
- . Fixed regression in fix for bug #67118 (constructor can't be called twice).
- (Remi)
-
-
-- Fileinfo:
- . Fixed bug #67327 (fileinfo: CDF infinite loop in nelements DoS).
- . Fixed bug #67328 (fileinfo: fileinfo: numerous file_printf calls resulting in
- performance degradation).
- . Fixed bug #67326 (fileinfo: cdf_read_short_sector insufficient boundary check).
- . Fixed bug #67329 (fileinfo: NULL pointer deference flaw by processing certain
- CDF files).
-
-- SPL:
- . Fixed bug #67359 (Segfault in recursiveDirectoryIterator). (Laruence)
-
-- phpdbg:
- . Fixed bug which caused phpdbg to fail immediately on startup in non-debug
- builds. (Bob)
-
-15 May 2014, PHP 5.6.0 Beta 3
-
-- Core:
- . Fixed bug #67169 (array_splice all elements, then []= gives wrong index).
- (Nikita)
- . Fixed bug #67198 (php://input regression). (Mike)
- . Fixed bug #67247 (spl_fixedarray_resize integer overflow). (Stas)
- . Fixed bug #67250 (iptcparse out-of-bounds read). (Stas)
- . Fixed bug #67252 (convert_uudecode out-of-bounds read). (Stas)
-
-- Date:
- . Fixed bug #67251 (date_parse_from_format out-of-bounds read). (Stas)
- . Fixed bug #67253 (timelib_meridian_with_check out-of-bounds read). (Stas)
-
-- GD:
- . Fixed bug #67248 (imageaffinematrixget missing check of parameters). (Stas)
-
-- OpenSSL:
- . Fixed bug #67224 (Fall back to crypto_type from context if not specified
- explicitly in stream_socket_enable_crypto). (Chris Wright)
-
-- PCRE:
- . Fixed bug #67238 (Ungreedy and min/max quantifier bug, applied patch
- from the upstream). (Anatol)
-
-- mbstring
- . Fixed bug #67199 (mb_regex_encoding mismatch). (Yasuo)
-
-01 May 2014, PHP 5.6.0 Beta 2
+?? ??? 20??, PHP 5.7.0
- CLI server:
- . Fixed bug #67079 (Missing MIME types for XML/XSL files). (Anatol)
-
-- COM:
- . Fixed bug #66431 (Special Character via COM Interface (CP_UTF8)). (Anatol)
-
-- Core:
- . Fixed bug #65701 (copy() doesn't work when destination filename is created
- by tempnam()). (Boro Sitnikovski)
- . Fixed bug #66015 (Unexpected array indexing in class's static property). (Bob)
- . Added (constant) string/array dereferencing to static scalar expressions
- to complete the set; now possible thanks to bug #66015 being fixed. (Bob)
- . Fixed bug #66568 (Update reflection information for unserialize() function).
- (Ferenc)
- . Fixed bug #66660 (Composer.phar install/update fails). (Ferenc)
- . Fixed bug #67024 (getimagesize should recognize BMP files with negative
- height). (Gabor Buella)
- . Fixed bug #67064 (Countable interface prevents using 2nd parameter
- ($mode) of count() function). (Bob)
- . Fixed bug #67072 (Echoing unserialized "SplFileObject" crash). (Anatol)
- . Fixed bug #67033 (Remove reference to Windows 95). (Anatol)
-
-- cURL:
- . Fixed bug #64247 (CURLOPT_INFILE doesn't allow reset). (Mike)
- . Fixed bug #66562 (curl_exec returns differently than curl_multi_getcontent).
- (Freek Lijten)
-
-- Date:
- . Fixed bug #66721 (__wakeup of DateTime segfaults when invalid object data is
- supplied). (Boro Sitnikovski)
- . Fixed bug #67118 (DateTime constructor crash with invalid data). (Anatol)
-
-- DOM:
- . Fixed bug #67081 (DOMDocumentType->internalSubset returns entire DOCTYPE tag,
- not only the subset). (Anatol)
-
-- Fileinfo:
- . Fixed bug #66907 (Solaris 10 is missing strcasestr and needs substitute).
- (Anatol)
- . Fixed bug #66307 (Fileinfo crashes with powerpoint files). (Anatol)
-
-- FPM:
- . Fixed bug #66482 (unknown entry 'priority' in php-fpm.conf).
- . Fixed bug #66908 (php-fpm reload leaks epoll_create() file descriptor).
- (Julio Pintos)
- . Fixed bug #67060 (sapi/fpm: possible privilege escalation due to insecure
- default configuration) (CVE-2014-0185). (Stas)
-
-- GMP:
- . Fixed crashes in serialize/unserialize. (Stas)
-
-- JSON:
- . Fixed bug #66021 (Blank line inside empty array/object when
- JSON_PRETTY_PRINT is set). (Kevin Israel)
-
-- LDAP:
- . Fixed issue with null bytes in LDAP bindings. (Matthew Daley)
-
-- litespeed
- . Fixed bug #63228 (-Werror=format-security error in lsapi code).
- (Elan Ruusamäe, George)
-
-- mysqli:
- . Fixed building against an external libmysqlclient. (Adam)
-
-- mysqlnd:
- . Added a new fetching mode to mysqlnd. (Andrey)
-
-- OpenSSL:
- . Fix bug #66942 (memory leak in openssl_seal()). (Chuan Ma)
- . Fix bug #66952 (memory leak in openssl_open()). (Chuan Ma)
- . Fix bug #66840 (Fix broken build when extension built separately).
- (Daniel Lowrey)
-
-- phpdbg:
- . Added watchpoints (watch command). (Bob)
- . Renamed some commands (next => continue and how to step). (Joe)
- . Fixed issue #85 (https://github.com/krakjoe/phpdbg/issues/85)
- (Added stdin/stdout/stderr constants and their php:// wrappers). (Bob)
-
-- PDO:
- . Fixed bug #66604 ('pdo/php_pdo_error.h' not copied to the include dir).
- (Matteo)
-
-- PDO-ODBC:
- . Fixed bug #50444 (PDO-ODBC changes for 64-bit).
-
-- Phar:
- . Fix bug #64498 ($phar->buildFromDirectory can't compress file with an accent
- in its name). (PR #588)
-
-- SQLite:
- . Fixed bug #66967 (Updated bundled libsqlite to 3.8.4.3). (Anatol)
-
-- Apache2 Handler SAPI:
- . Fixed Apache log issue caused by APR's lack of support for %zu
- (APR issue https://issues.apache.org/bugzilla/show_bug.cgi?id=56120).
- (Jeff Trawick)
-
-10 Apr 2014, PHP 5.6.0 Beta 1
-
-- Core:
- . Allow zero length comparison in substr_compare() (Tjerk)
- . Fixed bug #60602 (proc_open() changes environment array) (Tjerk)
- . Fixed bug #61019 (Out of memory on command stream_get_contents). (Mike)
- . Fixed bug #64330 (stream_socket_server() creates wrong Abstract Namespace
- UNIX sockets). (Mike)
- . Fixed bug #66182 (exit in stream filter produces segfault). (Mike)
- . Fixed bug #66736 (fpassthru broken). (Mike)
- . Fixed bug #66822 (Cannot use T_POW in const expression) (Tjerk)
- . Fixed bug #67043 (substr_compare broke by previous change) (Tjerk)
-
-- SPL:
- . Added feature #65545 (SplFileObject::fread()) (Tjerk)
- . Fixed bug #66834 (empty() does not work on classes that extend ArrayObject) (Tjerk)
- . Fixed bug #66702 (RegexIterator::INVERT_MATCH does not invert). (Joshua
- Thijssen)
-
-- cURL:
- . Fixed bug #66109 (Can't reset CURLOPT_CUSTOMREQUEST to default behaviour)
- (Tjerk)
- . Fix compilation on libcurl versions between 7.10.5 and 7.12.2, inclusive.
+ . Refactor MIME type handling to use a hash table instead of linear search.
(Adam)
+ . Update the MIME type list from the one shipped by Apache HTTPD. (Adam)
-- Date:
- . Added DateTimeImmutable::createFromMutable to create a DateTimeImmutable
- object from an existing DateTime (mutable) object (Derick)
-
-- Embed:
- . Fixed bug #65715 (php5embed.lib isn't provided anymore). (Anatol).
-
-- Fileinfo:
- . Fixed bug #66820 (out-of-bounds memory access in fileinfo)
- (CVE-2014-2270). (Remi)
- . Fixed bug #66946i (fileinfo: extensive backtracking in awk rule regular
- expression). (CVE-2013-7345) (Remi)
- . Fixed bug #66987 (Memory corruption in fileinfo ext / bigendian).
- (Remi)
-
-
-- GD:
- . Fixed bug #66815 (imagecrop(): insufficient fix for NULL defer
- CVE-2013-7327). (Tomas Hoger, Remi).
- . Fixed #66869 (Invalid 2nd argument crashes imageaffinematrixget) (Pierre)
- . Fixed bug #66887 (imagescale - poor quality of scaled image). (Remi)
- . Fixed bug #66890 (imagescale segfault). (Remi)
- . Fixed bug #66893 (imagescale ignore method argument). (Remi)
-
-- GMP:
- . Fixed bug #66872 (invalid argument crashes gmp_testbit) (Pierre)
-
-- Hash:
- . Fixed bug #66698 (Missing FNV1a32 and FNV1a64 hash functions).
- (Michael M Slusarz).
- . Implemented timing attack safe string comparison function
- (RFC: https://wiki.php.net/rfc/timing_attack). (Rouven Weßling)
- . hash_pbkdf2() now works correctly if the $length argument is not specified.
- (Nikita)
-
-- Intl:
- . Fixed bug #66873 (A reproductible crash in UConverter when given invalid
- encoding) (Stas)
-
-- Mail:
- . Fixed bug #66535 (Don't add newline after X-PHP-Originating-Script) (Tjerk)
-
-- Mbstring:
- . Upgraded to oniguruma 5.9.5 (Anatol)
-
-- Mcrypt:
- . No longer allow invalid key sizes, invalid IV sizes or missing required IV
- in mcrypt_encrypt, mcrypt_decrypt and the deprecated mode functions.
- (Nikita)
- . Use /dev/urandom as the default source for mcrypt_create_iv(). (Nikita)
-
-- MySQLi:
- . Fixed bug #66762 (Segfault in mysqli_stmt::bind_result() when link closed)
- (Remi)
-
-- OCI8
- . Fixed Bug #66875 (Improve performance of multi-row OCI_RETURN_LOB queries)
- (Perrier, Chris Jones)
-
-- OpenSSL:
- . Fixed memory leak in windows cert verification on verify failure.
- (Chris Wright)
- . Peer certificate capturing via SSL context options now functions even if
- peer verification fails. (Daniel Lowrey)
- . Encrypted TLS servers now support the server name indication TLS extension
- via the new "SNI_server_certs" SSL context option. (Daniel Lowrey)
- . Fixed bug #66833 (Default disgest algo is still MD5, switch to SHA1). (Remi)
-
-- PCRE:
- . Added support for (*MARK) backtracking verbs. (Nikita)
-
-- PDO_firebird:
- . Fixed Bug #66071 (memory corruption in error handling) (Popa)
-
-- PDO_pgsql:
- . Cleaned up code by increasing the requirements to libpq versions providing
- PQexecParams, PQprepare, PQescapeStringConn, PQescapeByteaConn. According
- to the release notes that means 8.0.8+ or 8.1.4+. (Matteo)
- . Deprecated PDO::PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT, an
- undocument constant effectively equivalent to PDO::ATTR_EMULATE_PREPARES.
- (Matteo)
- . Added PDO::PGSQL_ATTR_DISABLE_PREPARES constant to execute the queries
- without preparing them, while still passing parameters separately from
- the command text using PQexecParams. (Matteo)
-
-- Pgsql:
- . Read-only access to the socket stream underlying database connections is
- exposed via a new pg_socket() function to allow read/write polling when
- establishing asynchronous connections and executing queries in non-blocking
- applications. (Daniel Lowrey)
- . Asynchronous connections are now possible using the PGSQL_CONNECT_ASYNC
- flag in conjunction with a new pg_connect_poll() function and connection
- polling status constants. (Daniel Lowrey)
- . New pg_flush() and pg_consume_input() functions added to manually complete
- non-blocking reads/writes to underlying connection sockets. (Daniel Lowrey)
-
-- Session
- . Remove session_gc() and session_serializer_name() wich were introduced in the first 5.6.0 alpha.
-
-- SimpleXML:
- . Fixed bug #66084 (simplexml_load_string() mangles empty node name)
- (Anatol)
-
-- SQLite:
- . Updated the bundled libsqlite to the version 3.8.3.1 (Anatol)
-
-- XSL:
- . Fixed bug #53965 (<xsl:include> cannot find files with relative paths
- when loaded with "file://"). (Anatol)
-
-27 Feb 2014, PHP 5.6.0 Alpha 3
-
-- Core
- . Expose get_debug_info class hook as __debugInfo() magic method. (Sara)
- . Implemented unified default encoding
- (RFC: https://wiki.php.net/rfc/default_encoding). (Yasuo Ohgaki)
-
-- Curl
- . Check for openssl.cafile ini directive when loading CA certs. (Daniel Lowrey)
- . Remove cURL close policy related constants as these have no effect and are
- no longer used in libcurl. (Chris Wright)
-
-- Fileinfo
- . Upgraded to libmagic-5.17 (Anatol)
- . Fixed bug #66731 (file: infinite recursion). (CVE-2014-1943) (Remi)
-
-- FPM:
- . Added clear_env configuration directive to disable clearenv() call.
- (Github PR# 598, Paul Annesley)
-
-- GD:
- . Fixed imagettftext to load the correct character map rather than the last one.
- (Scott)
- . Fixed bug #66714 ( imageconvolution breakage). (Brad Daily)
-
-- JSON:
- . Fixed bug #65753 (JsonSerializeable couldn't implement on module extension)
- (chobieeee@php.net)
-
-- OPCache
- . Added function opcache_is_script_cached(). (Danack)
- . Added information about interned strings usage. (Terry, Julien, Dmitry)
-
-- OpenSSL
- . Fallback to Windows CA cert store for peer verification if no openssl.cafile
- ini directive or "cafile" SSL context option specified in Windows.
- (Chris Wright)
- . The openssl.cafile and openssl.capath ini directives introduced in alpha2
- now have PHP_INI_PERDIR accessibility (was PHP_INI_ALL). (Daniel Lowrey)
- . New "peer_name" SSL context option replaces "CN_match" (which still works
- as before but triggers E_DEPRECATED). (Daniel Lowrey)
- . Fixed segfault when accessing non-existent context for client SNI use
- (Daniel Lowrey)
- . Fixed bug #66501 (Add EC key support to php_openssl_is_private_key).
- (Mark Zedwood)
- . Fixed Bug #47030 (add new boolean "verify_peer_name" SSL context option
- allowing clients to verify cert names separately from the cert itself).
- "verify_peer_name" is enabled by default for client streams.
- (Daniel Lowrey)
- . Fixed Bug #65538 ("cafile" SSL context option now supports stream
- wrappers). (Daniel Lowrey)
- . New openssl_get_cert_locations() function to aid CA file and peer
- verification debugging. (Daniel Lowrey)
- . Encrypted stream wrappers now disable TLS compression by default.
- (Daniel Lowrey)
- . New "capture_session_meta" SSL context option allows encrypted client and
- server streams access to negotiated protocol/cipher information.
- (Daniel Lowrey)
- . New "honor_cipher_order" SSL context option allows servers to prioritize
- cipher suites of their choosing when negotiating SSL/TLS handshakes.
- (Daniel Lowrey)
- . New "single_ecdh_use" and "single_dh_use" SSL context options allow for
- improved forward secrecy in encrypted stream servers. (Daniel Lowrey)
- . New "dh_param" SSL context option allows stream servers control over
- the parameters when negotiating DHE cipher suites. (Daniel Lowrey)
- . New "ecdh_curve" SSL context option allowing stream servers to specify
- the curve to use when negotiating ephemeral ECDHE ciphers (defaults to
- NIST P-256). (Daniel Lowrey)
- . New "rsa_key_size" SSL context option gives stream servers control
- over the key size (in bits) used for RSA key agreements. (Daniel Lowrey)
- . Crypto methods for encrypted client and server streams now use
- bitwise flags for fine-grained protocol support. (Daniel Lowrey)
- . Added new tlsv1.0 stream wrapper to specify TLSv1 client/server method.
- tls wrapper now negotiates TLSv1, TLSv1.1 or TLSv1.2. (Daniel Lowrey)
- . Encrypted client streams now enable SNI by default. (Daniel Lowrey)
- . Encrypted streams now prioritize ephemeral key agreement and high strength
- ciphers by default. (Daniel Lowrey)
- . New OPENSSL_DEFAULT_STREAM_CIPHERS constant exposes default cipher
- list. (Daniel Lowrey)
- . New STREAM_CRYPTO_METHOD_* constants for enhanced control over the crypto
- methods negotiated encrypted server/client sessions. (Daniel Lowrey)
- . Encrypted stream servers now automatically mitigate potential DoS vector
- arising from client-initiated TLS renegotiation. New "reneg_limit",
- "reneg_window" and "reneg_limit_callback" SSL context options for custom
- renegotiation limiting control. (Daniel Lowrey)
-
-- Pgsql:
- . pg_insert()/pg_select()/pg_update()/pg_delete() are no longer EXPERIMENTAL.
- (Yasuo)
- . Impremented FR #25854 Return value for pg_insert should be resource instead of bool.
- (Yasuo)
- . Implemented FR #41146 - Add "description" with exteneded flag pg_meta_data().
- pg_meta_data(resource $conn, string $table [, bool extended])
- It also made pg_meta_data() return "is enum" always.
- (Yasuo)
-
-13 Feb 2014, PHP 5.6.0 Alpha 2
-- Core:
- . Added T_POW (**) operator
- (RFC: https://wiki.php.net/rfc/pow-operator). (Tjerk Meesters)
-
-- mysqli
- . Added new function mysqli_get_links_stats() as well as new INI variable
- mysqli.rollback_on_cached_plink of type bool (Andrey)
-
-- PCRE:
- . Upgraded to PCRE 8.34. (Anatol)
-
-- ldap
- . Added new function ldap_modify_batch(). (Ondrej Hosek)
-
-- OpenSSL
- . Peer certificates now verified by default in client socket operations
- (RFC: https://wiki.php.net/rfc/tls-peer-verification). (Daniel Lowrey)
- . New openssl.cafile and openssl.capath ini directives. (Daniel Lowrey)
-
-23 Jan 2014, PHP 5.6.0 Alpha 1
-- CLI server:
- . Added some MIME types to the CLI web server. (Chris Jones)
-
-- Core:
- . Improved IS_VAR operands fetching. (Laruence, Dmitry)
- . Improved empty string handling. Now ZE uses an interned string instead of
- allocation new empty string each time. (Laruence, Dmitry)
- . Implemented internal operator overloading
- (RFC: https://wiki.php.net/rfc/operator_overloading_gmp). (Nikita)
- . Made calls from incompatible context issue an E_DEPRECATED warning instead
- of E_STRICT (phase 1 of RFC: https://wiki.php.net/rfc/incompat_ctx).
- (Gustavo)
- . Uploads equal or greater than 2GB in size are now accepted.
- (Ralf Lang, Mike)
- . Reduced POST data memory usage by 200-300%. Changed INI setting
- always_populate_raw_post_data to throw a deprecation warning when enabling
- and to accept -1 for never populating the $HTTP_RAW_POST_DATA global
- variable, which will be the default in future PHP versions. (Mike)
- . Implemented dedicated syntax for variadic functions
- (RFC: https://wiki.php.net/rfc/variadics). (Nikita)
- . Fixed bug #50333 Improving multi-threaded scalability by using
- emalloc/efree/estrdup (Anatol, Dmitry)
- . Implemented constant scalar expressions (with support for constants)
- (RFC: https://wiki.php.net/rfc/const_scalar_exprs). (Bob)
- . Fixed bug #65784 (Segfault with finally). (Laruence, Dmitry)
- . Fixed bug #66509 (copy() arginfo has changed starting from 5.4). (willfitch)
-
-- cURL:
- . Implemented FR #65646 (re-enable CURLOPT_FOLLOWLOCATION with open_basedir
- or safe_mode). (Adam)
-
-- FPM
- . Included apparmor support in fpm
- (RFC: https://wiki.php.net/rfc/fpm_change_hat). (Gernot Vormayr)
-
-- GMP:
- . Moved GMP to use object as the underlying structure and implemented various
- improvements based on this.
- (RFC: https://wiki.php.net/rfc/operator_overloading_gmp). (Nikita)
- . Added gmp_root() and gmp_rootrem() functions for calculating nth roots.
- (Nikita)
-
-- Hash:
- . Added gost-crypto (CryptoPro S-box) GOST hash algo. (Manuel Mausz)
-
-- JSON:
- . Fixed case part of bug #64874 ("json_decode handles whitespace and
- case-sensitivity incorrectly")
-
-- mysqlnd:
- . Disabled flag for SP OUT variables for 5.5+ servers as they are not natively
- supported by the overlying APIs. (Andrey)
-
-- OPcache:
- . Added an optimization of class constants and constant calls to some
- internal functions (Laruence, Dmitry)
- . Added an optimization pass to convert FCALL_BY_NAME into DO_FCALL.
- (Laruence, Dmitry)
- . Added an optimization pass to merged identical constants (and related
- cache_slots) in op_array->literals table. (Laruence, Dmitry)
- . Added script level constant replacement optimization pass. (Dmitry)
-
-- OpenSSL:
- . Added crypto_method option for the ssl stream context. (Martin Jansen)
- . Added certificate fingerprint support. (Tjerk Meesters)
- . Added explicit TLSv1.1 and TLSv1.2 stream transports. (Daniel Lowrey)
- . Fixed bug #65729 (CN_match gives false positive). (Tjerk Meesters)
- . Peer name verification matches SAN DNS names for certs using
- the Subject Alternative Name x509 extension. (Daniel Lowrey)
- . Fixed segfault when built against OpenSSL>=1.0.1 (Daniel Lowrey)
- . Added SPKAC support. (Jason Gerfen)
-
-- PDO_pgsql:
- . Fixed Bug #42614 (PDO_pgsql: add pg_get_notify support). (Matteo)
- . Fixed Bug #63657 (pgsqlCopyFromFile, pgsqlCopyToArray use Postgres < 7.3
- syntax). (Matteo)
-
-- phpdbg:
- . Included phpdbg sapi (RFC: https://wiki.php.net/rfc/phpdbg).
- (Felipe Pena, Joe Watkins and Bob Weinand)
-
-- pgsql:
- . pg_version() returns full report which obtained by PQparameterStatus().
- (Yasuo)
- . Added pg_lo_truncate(). (Yasuo)
- . Added 64bit large object support for PostgreSQL 9.3 and later. (Yasuo)
-
-- Session:
- . Fixed Bug #65315 (session.hash_function silently fallback to default md5)
- (Yasuo)
- . Implemented Request #17860 (Session write short circuit). (Yasuo)
- . Implemented Request #20421 (session_abort() and session_reset() function).
- (Yasuo)
+- DBA:
+ . Fixed bug #62490 (dba_delete returns true on missing item (inifile)). (Mike)
- Standard:
- . Implemented FR #65634 (HTTP wrapper is very slow with protocol_version
- 1.1). (Adam)
- . Implemented Change crypt() behavior w/o salt RFC. (Yasuo)
- https://wiki.php.net/rfc/crypt_function_salt
- . Implemented request #49824 (Change array_fill() to allow creating empty
- array). (Nikita)
+ . Removed call_user_method() and call_user_method_array() functions. (Kalle)
+ . Fix user session handlers (See rfc:session.user.return-value). (Sara)
-- XMLReader:
- . Fixed bug #55285 (XMLReader::getAttribute/No/Ns methods inconsistency).
- (Mike)
-
-- Zip:
- . update libzip to version 1.11.2.
- PHP don't use any ilibzip private symbol anymore. (Pierre, Remi)
- . new method ZipArchive::setPassword($password). (Pierre)
- . add --with-libzip option to build with system libzip. (Remi)
- . new methods:
- ZipArchive::setExternalAttributesName($name, $opsys, $attr [, $flags])
- ZipArchive::setExternalAttributesIndex($idx, $opsys, $attr [, $flags])
- ZipArchive::getExternalAttributesName($name, &$opsys, &$attr [, $flags])
- ZipArchive::getExternalAttributesIndex($idx, &$opsys, &$attr [, $flags])
+- XSL:
+ . Fixed bug #64776 (The XSLT extension is not thread safe). (Mike)
<<< NOTE: Insert NEWS from last stable release here prior to actual release! >>>
diff --git a/UPGRADING b/UPGRADING
index 7a174c47c2..740047a86a 100644
--- a/UPGRADING
+++ b/UPGRADING
@@ -1,6 +1,6 @@
$Id$
-PHP 5.6 UPGRADE NOTES
+PHP X.Y UPGRADE NOTES
1. Backward Incompatible Changes
2. New Features
@@ -20,269 +20,34 @@ PHP 5.6 UPGRADE NOTES
1. Backward Incompatible Changes
========================================
-- Core:
- By fixing bug #66015 it is no longer possible to overwrite keys in static scalar
- arrays. Quick example to illustrate:
- class Test {
- const FIRST = 1;
- public $array = array(
- self::FIRST => 'first',
- 'second',
- 'third'
- );
- }
- Test::$array will have as expected three array keys (1, 2, 3) and no longer
- two (0, 1). self::FIRST will no longer overwrite 'third' having key 1 then,
- but will mark the beginning of indexing.
-
-- JSON:
- json_decode() no longer accepts non-lowercase variants of lone JSON true,
- false or null values. For example, True or FALSE will now cause json_decode to
- return NULL and set an error value you can fetch with json_last_error().
- This affects JSON texts consisting solely of true, false or null. Text
- containing non-lowercase values inside JSON arrays or objects has never been
- accepted.
-
-- OpenSSL:
- To prevent man-in-the-middle attacks against encrypted transfers client
- streams now verify peer certificates by default. Previous versions
- required users to manually enable peer verification. As a result of this
- change, existing code using ssl:// or tls:// stream wrappers (e.g.
- file_get_contents(), fsockopen(), stream_socket_client()) may no longer
- connect successfully without manually disabling peer verification via the
- stream context's "verify_peer" setting. Encrypted transfers delegate to
- operating system certificate stores by default if not overridden via the
- new openssl.cafile and openssl.cafile ini directives or via call-time SSL
- context options, so most users should be unaffected by this transparent
- security enhancement. (https://wiki.php.net/rfc/tls-peer-verification)
-
-- Mcrypt:
- The mcrypt_encrypt(), mcrypt_decrypt() and mcrypt_{MODE}() functions no
- longer accept keys or IVs with incorrect sizes. Furthermore an IV is now
- required if the used block cipher mode requires it.
+- DBA
+ . dba_delete() now returns false if the key was not found for the inifile
+ handler, too.
========================================
2. New Features
========================================
-- Added constant scalar expressions syntax.
- (https://wiki.php.net/rfc/const_scalar_exprs)
-
-- Added dedicated syntax for variadic functions.
- (https://wiki.php.net/rfc/variadics)
-
-- Added support for argument unpacking to complement the variadic syntax.
- (https://wiki.php.net/rfc/argument_unpacking)
-
-- Added an exponentiation operator (**).
- (https://wiki.php.net/rfc/pow-operator)
-
-- Added unified default encoding. default_charset=UTF-8 and functions/extensions
- use encoding settings honor default_charset.
-
-- The php://input stream is now re-usable and can be used concurrently with
- enable_post_data_reading=0.
-
-- Added use function and use const.
- (https://wiki.php.net/rfc/use_function)
-
-- Added a function for timing attack safe string comparison
- (https://wiki.php.net/rfc/timing_attack)
-
-- Added gost-crypto (CryptoPro S-box) hash algorithm.
-
-- Stream wrappers verify peer certificates and host names by default in
- encrypted client streams.
-
-- Added openssl certificate fingerprint support (inclusive stream context
- option).
-
-- Added support for SAN x509 extension matching when verifing host names in
- encrypted streams.
-
-- Added a range of new SSL context options for improved encrypted stream
- server security (https://wiki.php.net/rfc/improved-tls-defaults):
-
- . "honor_cipher_order" allows servers to prioritize cipher suites of their
- choosing when negotiating SSL/TLS handshakes.
- . "single_ecdh_use" and "single_dh_use" allow for improved forward
- secrecy in encrypted stream servers.
- . "dh_param" allows specification of pre-generated key generation
- parameters when negotiating ephemeral DHE ciphers in stream servers.
- . "ecdh_curve" allows stream servers to specify which curve to use when
- negotiating ephemeral ECDHE ciphers (defaults to NIST P-256).
- . "rsa_key_size" SSL context option gives stream servers control
- over the key size (in bits) used when negotiating RSA ciphers.
- . "capture_session_meta" if specified stores an array of data describing
- the TLS session's protocol/cipher in the "session_meta" SSL context key.
-
-- Added automatic mitigation against client-initated TLS renegotiation DoS
- attacks in encrypted server streams. Renegotiation limiting may be
- customized via three new SSL context options:
-
- . "reneg_limit" (number of allowed renegotiations per time window)
- . "reneg_window" (renegotiation time window in seconds)
- . "reneg_limit_callback" (optional notification callback on limiting)
-
-- Encrypted TLS servers now support the server name indication (SNI) TLS
- extension via the new "SNI_server_certs" SSL context option.
-
-- Added "crypto_method" SSL context option for use in encrypted streams.
-
-- Added "peer_name" SSL context option to better reflect peer certificate
- name matching using SAN extension (replaces deprecated "CN_match").
-
-- Added stream wrapper support when specifying "cafile" SSL context paths.
-
-- Independent peer cert and peer name validation is now available via a new
- boolean "verify_peer_name" SSL context option. This option is enabled by
- default in encrypted client streams.
-
-- Added protocol-specific tlsv1.0://, tlsv1.1:// and tlsv1.2:// encryption
- stream wrappers. tls:// wrapper now supports TLSv1.1 and TLSv1.2 (previously
- only supported TLSv1).
-
-- Stream crypto method specification now accepts flags instead of values
- allowing support for multiple discrete protocols in a given stream.
-
-- PostgreSQL database connections may now be established asynchronously using
- new constants and polling functions in ext/pgsql.
-
-- Non-blocking read/write query behavior now optionally available in database
- operations using the ext/pgsql extension.
========================================
3. Changes in SAPI modules
========================================
-- Added phpdbg SAPI.
- (https://wiki.php.net/rfc/phpdbg)
-
-- Support for FPM workers changing the apparmor profile through the pool configuration.
- (https://wiki.php.net/rfc/fpm_change_hat)
-
-- Support for several XML MIME types in the built-in CLI server. For static
- files with extensions .xml, .xsl, .xsd the Content-Type header
- application/xml is now sent automatically.
========================================
4. Deprecated Functionality
========================================
-- Incompatible context calls:
- Instance calls from an incompatible context are now deprecated and issue
- E_DEPRECATED instead of E_STRICT. See https://wiki.php.net/rfc/incompat_ctx
-
-- The "CN_match" and "SNI_server_name" SSL context options are deprecated in
- favor of the new "peer_name" option. Name verification now checks certificate
- SAN names as well as the CN field and the specific name fields are deprecated
- to avoid confusion. Their use triggers E_DEPRECATED but continues to work as
- before. If specified, the specific values take precedence over the general
- "peer_name" value.
-
-- Deprecated PDO::PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT, an
- undocument constant effectively equivalent to PDO::ATTR_EMULATE_PREPARES.
-
-- Deprecated INIs: Following INIs are deprecated in favour of new
- internal_encoding/input_encoding/output_encoding. Refer to "Changes to
- encodings in PHP 5.6" in "11. Other Changes" section for more details.
-
- iconv.input_encoding
- iconv.output_encoding
- iconv.internal_encoding
- mbstring.http_input
- mbstring.http_output
- mbstring.internal_encoding
========================================
5. Changed Functions
========================================
-- cURL:
- CURLOPT_SAFE_UPLOAD is now turned on by default and uploads with @file
- do not work unless it is explicitly set to false.
-
- curl_setopt() now supports the following nullable settings (>= 5.5.11):
- . CURLOPT_CUSTOMREQUEST
- . CURLOPT_FTPPORT
- . CURLOPT_RANGE
- . CURLOPT_FTP_ACCOUNT
- . CURLOPT_RTSP_SESSION_ID
- . CURLOPT_KRBLEVEL
- . CURLOPT_KRB4LEVEL
-
-- Strings:
- substr_compare() now allows $length to be zero.
-
-- Crypt:
- crypt() will now raise an E_NOTICE error if the salt parameter is omitted.
- See: https://wiki.php.net/rfc/crypt_function_salt
-
-- Mcrypt:
- The $source parameter of mcrypt_create_iv() now defaults to
- MCRYPT_DEV_URANDOM instead of MCRYPT_DEV_RANDOM.
-
-- OpenSSL:
- The $crypto_type parameter is now optional in stream_socket_enable_crypto()
- if the stream's SSL context specifies the new "crypto_type" option. The
- crypto method from the context is used as a fallback if no crypto method is
- specified at call-time.
-
-- XMLReader:
- XMLReader::getAttributeNs and XMLReader::getAttributeNo now return NULL if
- the attribute could not be found, just like XMLReader::getAttribute.
-
-- Pgsql:
- pg_insert()/pg_select()/pg_update()/pg_delete() are no longer EXPERIMENTAL.
- The following functions no longer block until query write completion if the
- socket stream underlying a database connection is set to non-blocking mode:
- . pg_send_execute()
- . pg_send_prepare()
- . pg_send_query()
- . pg_send_query_params()
-
-- unserialize:
- Manipulated serialization strings for objects implementing Serializable by
- replacing "C:" with "O:" at the start will now produce an error.
========================================
6. New Functions
========================================
-- GMP:
- Added gmp_root($a, $nth) and gmp_rootrem($a, $nth) for calculating nth roots.
-
-- Hash
- Added hash_equals($known_string, $user_string)
-
-- OpenSSL:
- Added string openssl_x509_fingerprint($x509, $type, $binary).
- Added string openssl_spki_new($private_key, $challenge, $algorithm)
- Added bool openssl_spki_verify($spkac)
- Added string openssl_spki_export($spkac)
- Added string openssl_spki_export_challenge($spkac)
- Added array openssl_get_cert_locations()
-
-- LDAP:
- Added ldap_escape($value, $ignore = "", $flags = 0).
- Added ldap_modify_batch($link_identifier, $dn, $modifications) described in
- https://wiki.php.net/rfc/ldap_modify_batch.
-
-- Pgsql:
- Added pg_socket($connection) to allow async connections and non-blocking IO
- Added pg_connect_poll($connection) for establishing async connections
- Added pg_consume_input($connection) for non-blocking query result consumption
- Added pg_flush($connection) for non-blocking query write completion
-
-- PDO_pgsql
- Added PDO::pgsqlGetNotify($result_type = PDO::FETCH_USE_DEFAULT, $ms_timeout = 0)
- Added PDO::pgsqlGetPid()
-
-- Zip:
- Added ZipArchive::setPassword($password)
-
-- SPL
- Added SplFileObject::fread($length) to complement fwrite() method (>= 5.5.11)
========================================
7. New Classes and Interfaces
@@ -298,183 +63,20 @@ PHP 5.6 UPGRADE NOTES
9. Other Changes to Extensions
========================================
-- cURL:
- - The following constants have been removed as they are now marked "obsolete"
- in the underlying library and never had any effect to begin with:
- . CURLOPT_CLOSEPOLICY
- . CURLCLOSEPOLICY_CALLBACK
- . CURLCLOSEPOLICY_LEAST_RECENTLY_USED
- . CURLCLOSEPOLICY_LEAST_TRAFFIC
- . CURLCLOSEPOLICY_OLDEST
- . CURLCLOSEPOLICY_SLOWEST
-
-- GMP:
- The GMP extension now uses objects as the underlying data structure, rather
- than resources. GMP instances now support dumping, serialization, cloning,
- casts to primitive types and have overloaded operators.
- (RFC: https://wiki.php.net/rfc/operator_overloading_gmp)
-
-- OCI8:
- - Added Implicit Result Set support for Oracle Database 12c with a
- new oci_get_implicit_resultset() function.
- - Using 'oci_execute($s, OCI_NO_AUTO_COMMIT)' for a SELECT no longer
- unnecessarily initiates an internal ROLLBACK during connection
- close.
- - Multi-row OCI_RETURN_LOB queries require fewer "round trips" to the database.
- - Added DTrace probes enabled with PHP's generic --enable-dtrace
- - The oci_internal_debug() function is now a no-op.
- - The phpinfo() output format for OCI8 has changed.
-
-- OpenSSL:
- - The "SNI_enabled" SSL stream context option is now set to TRUE by default
- if supported by the underlying openssl library.
-
-- PCRE:
- - The information collected by the (*MARK) backtracking control verb is now
- collected into the "MARK" index of the $matches array for preg_match(),
- preg_match_all() and preg_replace_callback().
-
-- Pgsql:
- - pg_insert()/pg_select()/pg_update()/pg_delete()/pg_meta_data()/pg_convert()
- are no longer EXPERIMENTAL
- - Added PGSQL_DML_ESCAPE option for pg_insert()/pg_select()/pg_update()/pg_delete()
- that simply escapes all supplied parameters. These functions can be as fast as
- native query. Unvalidated data(Unknown data types) is passed as string.
- JSON/Array/etc are supported both PGSQL_DML_ESCAPE and pg_convert() as string.
- - pg_select() returns PostgreSQL query resource when query is executed.
- - Added extended flag parameter for pg_meta_data(). pg_meta_data() always
- returns "is enum" attribute.
- - The new pg_socket() function returns a socket stream with no behavior other
- than to allow IO-readiness polling on a DB connection socket. Calling
- stream_set_blocking() on its result enables non-blocking behavior.
- - Passing the new PGSQL_CONNECT_ASYNC flag to pg_connect() allows applications
- to poll for IO readiness via pg_connect_poll() and establish connections
- asynchronously.
-
-- PDO_pgsql:
- - Added PDO::PGSQL_ATTR_DISABLE_PREPARES constant to execute the queries
- without preparing them, while still passing parameters separately from
- the command text using PQexecParams.
- - Added LISTEN/NOTIFY support via PDO::pgsqlGetNotify / PDO::pgsqlGetPid()
- as described in https://bugs.php.net/bug.php?id=42614.
========================================
10. New Global Constants
========================================
-- LDAP:
- LDAP_ESCAPE_FILTER int(1)
- LDAP_ESCAPE_DN int(2)
-
-- Pgsql:
- PGSQL_DML_ESCAPE int(4096)
- PGSQL_CONNECT_ASYNC
- PGSQL_CONNECTION_STARTED
- PGSQL_CONNECTION_MADE
- PGSQL_CONNECTION_AWAITING_RESPONSE
- PGSQL_CONNECTION_AUTH_OK
- PGSQL_CONNECTION_SSL_STARTUP
- PGSQL_CONNECTION_SETENV
- PGSQL_POLLING_FAILED
- PGSQL_POLLING_READING
- PGSQL_POLLING_WRITING
- PGSQL_POLLING_OK
- PGSQL_POLLING_ACTIVE
-
-- OpenSSL:
- STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT int(9)
- STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT int(17)
- STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT int(33)
- STREAM_CRYPTO_METHOD_ANY_CLIENT int(63)
- STREAM_CRYPTO_METHOD_TLSv1_0_SERVER int(8)
- STREAM_CRYPTO_METHOD_TLSv1_1_SERVER int(16)
- STREAM_CRYPTO_METHOD_TLSv1_2_SERVER int(32)
- STREAM_CRYPTO_METHOD_ANY_SERVER int(62)
- OPENSSL_DEFAULT_STREAM_CIPHERS string
========================================
11. Changes to INI File Handling
========================================
-- Core:
- Changed always_populate_raw_post_data to throw a deprecation warning when
- enabled and to recognize the value -1 for never populating the global
- $HTTP_RAW_POST_DATA variable, which will be default in future PHP versions.
-
- default_charset is set to UTF-8. It was empty previously. default_charset
- is used where it is applicable. Iconv/Mbstring/htmlentities/htmlspecialchars/
- html_entity_decode use default_charset as default encoding.
-
- internal_encoding/input_encoding/output_encoding is added for encoding
- handling modules. Refer to "Changes to encodings in PHP 5.6" in "11. Other Changes"
- section for more details.
-
-- cURL:
- If the new openssl.cafile ini directive is specified ext/curl will give the
- openssl path precedence over its own curl.cainfo directive.
-
-- OpenSSL:
- openssl.cafile and openssl.capath ini directives have been added to allow
- global CA default specification as necessary.
========================================
12. Other Changes
========================================
-- File upload:
- Uploads equal or greater than 2GB in size are now accepted.
-
-- HTTP stream wrapper:
- HTTP 1.1 requests now include a Connection: close header unless explicitly
- overridden by setting a Connection header via the header context option.
-
-- PDO_pgsql
- A libpq version providing PQexecParams, PQprepare, PQescapeStringConn,
- PQescapeByteaConn is now required. According to the release notes that means
- 8.0.8+ or 8.1.4+.
-
-- Zip:
- New --with-libzip option allow to use system libzip. Version > 0.11 required,
- Version >= 0.11.2 recommended for all features.
-
-- Changes to encodings in PHP 5.6
- The default value of default_charset is now UTF-8 when it is not
- explicitly set in php.ini
-
- The following php.ini parameters were added:
- internal_encoding
- input_encoding
- output_encoding
-
- The values of the following php.ini parameters have become empty in
- PHP 5.6 (previously they were all ISO-8859-1)
-
- iconv.input_encoding
- iconv.output_encoding
- iconv.internal_encoding
-
- Changes were made to character set handling in:
- - the iconv and mbstring extensions,
- - and htmlentities(), htmlspecialchars(), html_entity_decode() functions
-
- The precedence for these is now:
-
- default_charset < internal/input/output_encoding < (mbstring.* || iconv.*) < function parameter
-
- For example, the easiest way to use the UTF-8 encoding is to set
- default_charset=UTF-8 and leave the following php.ini parameters
-
- empty:
-
- iconv.input_encoding
- iconv.output_encoding
- iconv.internal_encoding
- mbstring.http_input
- mbstring.http_output
- mbstring.internal_encoding
- internal_encoding
- input_encoding
- output_encoding
-
- The mb_regex_encoding() default setting is changed from EUC-JP to UTF-8.
-
+- Standard
+ . call_user_method() and call_user_method_array() no longer exists.
diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS
index 8b94783946..97b281a93e 100644
--- a/UPGRADING.INTERNALS
+++ b/UPGRADING.INTERNALS
@@ -7,14 +7,6 @@ UPGRADE NOTES - PHP X.Y
b. return_value_ptr now always available, RETVAL_ZVAL_FAST macros
c. POST data handling
d. Arginfo changes
- e. tsrm_virtual_cwd.h moved to zend_virtual_cwd.h
- f. empty strings are interned
- g. Additional str_* APIs
- h. Addition of zend_hash_reindex
- i. Addition of zend_hash_splice
- j. An additional parameter is sent to Countable::count()
- k. Unserialization of manipulated object strings
- l. Removal of IS_CONSTANT_ARRAY and IS_CONSTANT_INDEX hack
2. Build system changes
a. Unix build system changes
@@ -25,209 +17,11 @@ UPGRADE NOTES - PHP X.Y
1. Internal API changes
========================
- a. Addition of do_operation and compare object handlers
-
- Two new object handlers have been added:
-
- do_operation:
- typedef int (*zend_object_do_operation_t)(
- zend_uchar opcode, zval *result, zval *op1, zval *op2 TSRMLS_DC
- );
-
- compare:
- typedef int (*zend_object_compare_zvals_t)(
- zval *result, zval *op1, zval *op2 TSRMLS_DC
- );
-
- The first handler is used to overload arithmetic operations. The first
- argument specifies the opcode of the operator, result is the target zval,
- op1 the first operand and op2 the second operand. For unary operations
- op2 is NULL. If the handler returns FAILURE PHP falls back to the default
- behavior for the operation.
-
- The second handler is used to perform comparison operations with
- non-objects. The value written into result must be an IS_LONG with value
- -1 (smaller), 0 (equal) or 1 (greater). The return value is a SUCCESS/FAILURE
- return code. The difference between this handler and compare_objects is
- that it will be triggered for comparisons with non-objects and objects of
- different types. It takes precedence over compare_objects.
-
- Further docs in the RFC: https://wiki.php.net/rfc/operator_overloading_gmp
-
- b. return_value_ptr now always available, RETVAL_ZVAL_FAST macros
-
- The return_value_ptr argument to internal functions is now always set.
- Previously it was only available for functions returning by-reference.
- return_value_ptr can now be used to return zvals without copying them.
- For this purpose two new macros are provided:
-
- RETVAL_ZVAL_FAST(zv); /* analog to RETVAL_ZVAL(zv, 1, 0) */
- RETURN_ZVAL_FAST(zv); /* analog to RETURN_ZVAL(zv, 1, 0) */
-
- The macros behave similarly to the non-FAST variants with copy=1 and
- dtor=0, but will try to return the zval without making a copy by utilizing
- return_value_ptr.
-
- c. POST data handling
-
- The sapi_request_info's members post_data, post_data_len and raw_post_data as
- well as raw_post_data_len have been replaced with a temp PHP stream
- request_body.
-
- The recommended way to access raw POST data is to open and use a php://input
- stream wrapper. It is safe to be used concurrently and more than once.
-
- d. Arginfo changes
-
- The pass_rest_by_reference argument of the ZEND_BEGIN_ARG_INFO and
- ZEND_BEGIN_ARG_INFO_EX() is no longer used. The value passed to it is ignored.
-
- Instead a variadic argument is created using ZEND_ARG_VARIADIC_INFO():
-
- ZEND_ARG_VARIADIC_INFO(0, name) /* pass rest by value */
- ZEND_ARG_VARIADIC_INFO(1, name) /* pass rest by reference */
- ZEND_ARG_VARIADIC_INFO(ZEND_SEND_PREFER_REF, name)
- /* pass rest by prefer-ref */
-
- ZEND_ARG_VARIADIC_INFO() should only be used for the last argument.
-
- The following changes were applied to the zend_arg_info struct:
-
- typedef struct _zend_arg_info {
- const char *class_name;
- zend_uint class_name_len;
- zend_uchar type_hint;
- + zend_uchar pass_by_reference;
- zend_bool allow_null;
- - zend_bool pass_by_reference;
- + zend_bool is_variadic;
- } zend_arg_info;
-
- The following changes were applied to the zend_internal_function_info struct:
-
- typedef struct _zend_internal_function_info {
- zend_uint required_num_args;
- zend_uchar _type_hint;
- zend_bool return_reference;
- - zend_bool pass_rest_by_reference;
- + zend_bool _allow_null;
- + zend_bool _is_variadic;
- } zend_internal_function_info;
-
- The CHECK_ARG_SEND_TYPE(), ARG_MUST_BE_SENT_BY_REF(),
- ARG_SHOULD_BE_SENT_BY_REF() and ARG_MAY_BE_SENT_BY_REF() macros now assume
- that the argument passed to them is a zend_function* and that it is non-NULL.
-
- e. tsrm_virtual_cwd.h moved to zend_virtual_cwd.h
+ a. zend_set_memory_limit() now takes the TSRMLS_CC macro as its last argument
- Memory allocation is now managed by emalloc/efree instead of malloc/free.
-
- f. empty strings are interned
-
- String created using STR_EMPTY_ALLOC() are now interned.
- convert_to_string use STR_EMPTY_ALLOC() for zval when IS_NULL.
- str_efree() shoud be preferred as efree() on such strings can cause memory
- corruption.
-
- g. Additional str_* APIs
-
- In addition to the previously existing str_free() and str_efree() macros, the
- following macros have been introduced to simplify dealing with potentially
- interned strings:
-
- str_efree_rel(str) - efree_rel() if not interned
- str_erealloc(str, new_len) - erealloc() or emalloc+memcpy if interned
- str_estrndup(str, len) - estrndup() if not interned
- str_strndup(str, len) - zend_strndup() if not interned
- str_hash(str, len) - INTERNED_HASH(str) if interned,
- zend_hash_func(str, len+1) otherwise
-
- h. Addition of zend_hash_reindex
-
- A zend_hash_reindex() function with the following prototype has been added:
-
- void zend_hash_reindex(HashTable *ht, zend_bool only_integer_keys);
-
- If only_integer_keys==0, this function will change all keys to be continuous,
- zero-based integers in hash order. If only_integer_keys==1 the same will be
- done only for keys that were already integers previously, while leaving
- string keys alone.
-
- i. Addition of zend_hash_splice
-
- A zend_hash_splice() macro with the following prototype has been added:
-
- void zend_hash_splice(
- HashTable *ht, uint nDataSize, copy_ctor_func_t pCopyConstructor,
- uint offset, uint length,
- void **list, uint list_count, HashTable *removed
- );
-
- This function performs an in-place splice operation on a hashtable:
-
- The elements between offset and offset+length are removed and the elements in
- list[list_count] are inserted in their place. The removed elements can be
- optionally collected into a hashtable.
-
- This operation reindexes the hashtable, i.e. integer keys will be zero-based
- and sequential, while string keys stay intact. The same applies to the
- elements inserted into the removed HT.
-
- As a side-effect of this addition the signature of the php_splice() function
- changed:
-
- void php_splice(
- HashTable *ht, zend_uint offset, zend_uint length,
- zval ***list, zend_uint list_count, HashTable *removed TSRMLS_DC
- )
-
- This function now directly forwards to zend_hash_splice(), resets the
- IAP of ht (for compatibility with the previous implementation) and resets
- CVs if the passed hashtable is the global symbol table.
-
- j. An additional parameter is sent to Countable::count()
-
- That parameter denotes the $mode passed to count; it shouldn't affect any
- userland code, but any zend_parse_parameters() used with no arguments should
- fail. Extensions which implement Countable internally, need to accept one
- optional long as parameter.
-
- k. Unserialization of manipulated object strings
-
- Strings requiring unserialization of objects are now explicitly checked
- whether the object they contain implements the Serializable interface.
- This solves the situation where manipulated strings could be passed for
- objects using Serializable to disallow serialization. An object
- implementing Serializable will always start with "C:" in the serialized
- string, all other objects are represented with starting "O:". Objects
- implementing Serializable to disable serialization using
- zend_class_unserialize_deny and zend_class_serialize_deny, when
- instantiated from the serializer with a manipulated "O:" string at the
- start, will most likely be defectively initialized. This is now
- fixed at the appropriate place by checking for the presence of the
- serialize callback in the class entry.
-
- l. Removal of IS_CONSTANT_ARRAY and IS_CONSTANT_INDEX hack
-
- These two #defines disappeared. Instead we have now IS_CONSTANT_AST which
- covers also the functionality IS_CONSTANT_ARRAY bid and furthermore the
- hack for marking zvals as constant index with IS_CONSTANT_INDEX is now
- superfluous and so removed.
- Please note that IS_CONSTANT_AST now has the same value than
- IS_CONSTANT_ARRAY had.
========================
2. Build system changes
========================
- a. Unix build system changes
- - The bison version check is now a blacklist instead of a whitelist.
- - The bison binary can be specified through the YACC environment/configure
- variable. Previously `bison` was assumed to be in $PATH.
-
- b. Windows build system changes
- - The configure option --enable-static-analyze isn't available anymore.
- The new option was introduced --with-analyzer.
- - It is possible to disable PGO for single extensions, to do that
- define a global variable PHP_MYMODULE_PGO evaluating to false
- inside config.w32
+
diff --git a/Zend/zend.c b/Zend/zend.c
index 34dcc75469..d735e4a9e7 100644
--- a/Zend/zend.c
+++ b/Zend/zend.c
@@ -52,7 +52,7 @@ ZEND_API FILE *(*zend_fopen)(const char *filename, char **opened_path TSRMLS_DC)
ZEND_API int (*zend_stream_open_function)(const char *filename, zend_file_handle *handle TSRMLS_DC);
ZEND_API void (*zend_block_interruptions)(void);
ZEND_API void (*zend_unblock_interruptions)(void);
-ZEND_API void (*zend_ticks_function)(int ticks);
+ZEND_API void (*zend_ticks_function)(int ticks TSRMLS_DC);
ZEND_API void (*zend_error_cb)(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args);
int (*zend_vspprintf)(char **pbuf, size_t max_len, const char *format, va_list ap);
ZEND_API char *(*zend_getenv)(char *name, size_t name_len TSRMLS_DC);
diff --git a/Zend/zend.h b/Zend/zend.h
index 9e79833cd7..a226e11c60 100644
--- a/Zend/zend.h
+++ b/Zend/zend.h
@@ -22,7 +22,7 @@
#ifndef ZEND_H
#define ZEND_H
-#define ZEND_VERSION "2.6.0-dev"
+#define ZEND_VERSION "2.7.0-dev"
#define ZEND_ENGINE_2
@@ -551,7 +551,7 @@ typedef struct _zend_utility_functions {
void (*block_interruptions)(void);
void (*unblock_interruptions)(void);
int (*get_configuration_directive)(const char *name, uint name_length, zval *contents);
- void (*ticks_function)(int ticks);
+ void (*ticks_function)(int ticks TSRMLS_DC);
void (*on_timeout)(int seconds TSRMLS_DC);
int (*stream_open_function)(const char *filename, zend_file_handle *handle TSRMLS_DC);
int (*vspprintf_function)(char **pbuf, size_t max_len, const char *format, va_list ap);
@@ -700,7 +700,7 @@ extern ZEND_API zend_write_func_t zend_write;
extern ZEND_API FILE *(*zend_fopen)(const char *filename, char **opened_path TSRMLS_DC);
extern ZEND_API void (*zend_block_interruptions)(void);
extern ZEND_API void (*zend_unblock_interruptions)(void);
-extern ZEND_API void (*zend_ticks_function)(int ticks);
+extern ZEND_API void (*zend_ticks_function)(int ticks TSRMLS_DC);
extern ZEND_API void (*zend_error_cb)(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args) ZEND_ATTRIBUTE_PTR_FORMAT(printf, 4, 0);
extern ZEND_API void (*zend_on_timeout)(int seconds TSRMLS_DC);
extern ZEND_API int (*zend_stream_open_function)(const char *filename, zend_file_handle *handle TSRMLS_DC);
diff --git a/Zend/zend_API.c b/Zend/zend_API.c
index b8dd3434ca..2d845d357e 100644
--- a/Zend/zend_API.c
+++ b/Zend/zend_API.c
@@ -2324,10 +2324,8 @@ ZEND_API void zend_unregister_functions(const zend_function_entry *functions, in
}
/* }}} */
-ZEND_API int zend_startup_module(zend_module_entry *module) /* {{{ */
+ZEND_API int zend_startup_module(zend_module_entry *module TSRMLS_DC) /* {{{ */
{
- TSRMLS_FETCH();
-
if ((module = zend_register_internal_module(module TSRMLS_CC)) != NULL && zend_startup_module_ex(module TSRMLS_CC) == SUCCESS) {
return SUCCESS;
}
diff --git a/Zend/zend_API.h b/Zend/zend_API.h
index efc267f918..62a4a8307c 100644
--- a/Zend/zend_API.h
+++ b/Zend/zend_API.h
@@ -267,7 +267,7 @@ ZEND_API int zend_parse_parameter(int flags, int arg_num TSRMLS_DC, zval **arg,
ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_function_entry *functions, HashTable *function_table, int type TSRMLS_DC);
ZEND_API void zend_unregister_functions(const zend_function_entry *functions, int count, HashTable *function_table TSRMLS_DC);
-ZEND_API int zend_startup_module(zend_module_entry *module_entry);
+ZEND_API int zend_startup_module(zend_module_entry *module_entry TSRMLS_DC);
ZEND_API zend_module_entry* zend_register_internal_module(zend_module_entry *module_entry TSRMLS_DC);
ZEND_API zend_module_entry* zend_register_module_ex(zend_module_entry *module TSRMLS_DC);
ZEND_API int zend_startup_module_ex(zend_module_entry *module TSRMLS_DC);
diff --git a/Zend/zend_alloc.c b/Zend/zend_alloc.c
index bdcee5cbe4..f621487819 100644
--- a/Zend/zend_alloc.c
+++ b/Zend/zend_alloc.c
@@ -2682,10 +2682,8 @@ ZEND_API char *zend_strndup(const char *s, uint length)
}
-ZEND_API int zend_set_memory_limit(size_t memory_limit)
+ZEND_API int zend_set_memory_limit(size_t memory_limit TSRMLS_DC)
{
- TSRMLS_FETCH();
-
AG(mm_heap)->limit = (memory_limit >= AG(mm_heap)->block_size) ? memory_limit : AG(mm_heap)->block_size;
return SUCCESS;
diff --git a/Zend/zend_alloc.h b/Zend/zend_alloc.h
index 05494ee37c..1541dffcec 100644
--- a/Zend/zend_alloc.h
+++ b/Zend/zend_alloc.h
@@ -139,7 +139,7 @@ inline static void * __zend_realloc(void *p, size_t len)
#define safe_estrdup(ptr) ((ptr)?(estrdup(ptr)):STR_EMPTY_ALLOC())
#define safe_estrndup(ptr, len) ((ptr)?(estrndup((ptr), (len))):STR_EMPTY_ALLOC())
-ZEND_API int zend_set_memory_limit(size_t memory_limit);
+ZEND_API int zend_set_memory_limit(size_t memory_limit TSRMLS_DC);
ZEND_API void start_memory_manager(TSRMLS_D);
ZEND_API void shutdown_memory_manager(int silent, int full_shutdown TSRMLS_DC);
diff --git a/Zend/zend_ast.c b/Zend/zend_ast.c
index a7df0adbab..54448ac286 100644
--- a/Zend/zend_ast.c
+++ b/Zend/zend_ast.c
@@ -268,9 +268,9 @@ ZEND_API void zend_ast_evaluate(zval *result, zend_ast *ast, zend_class_entry *s
break;
case ZEND_BOOL_AND:
zend_ast_evaluate(&op1, (&ast->u.child)[0], scope TSRMLS_CC);
- if (zend_is_true(&op1)) {
+ if (zend_is_true(&op1 TSRMLS_CC)) {
zend_ast_evaluate(&op2, (&ast->u.child)[1], scope TSRMLS_CC);
- ZVAL_BOOL(result, zend_is_true(&op2));
+ ZVAL_BOOL(result, zend_is_true(&op2 TSRMLS_CC));
zval_dtor(&op2);
} else {
ZVAL_BOOL(result, 0);
@@ -279,18 +279,18 @@ ZEND_API void zend_ast_evaluate(zval *result, zend_ast *ast, zend_class_entry *s
break;
case ZEND_BOOL_OR:
zend_ast_evaluate(&op1, (&ast->u.child)[0], scope TSRMLS_CC);
- if (zend_is_true(&op1)) {
+ if (zend_is_true(&op1 TSRMLS_CC)) {
ZVAL_BOOL(result, 1);
} else {
zend_ast_evaluate(&op2, (&ast->u.child)[1], scope TSRMLS_CC);
- ZVAL_BOOL(result, zend_is_true(&op2));
+ ZVAL_BOOL(result, zend_is_true(&op2 TSRMLS_CC));
zval_dtor(&op2);
}
zval_dtor(&op1);
break;
case ZEND_SELECT:
zend_ast_evaluate(&op1, (&ast->u.child)[0], scope TSRMLS_CC);
- if (zend_is_true(&op1)) {
+ if (zend_is_true(&op1 TSRMLS_CC)) {
if (!(&ast->u.child)[1]) {
*result = op1;
} else {
diff --git a/Zend/zend_execute.h b/Zend/zend_execute.h
index 9bde312e53..d151c3413d 100644
--- a/Zend/zend_execute.h
+++ b/Zend/zend_execute.h
@@ -60,7 +60,7 @@ ZEND_API zend_execute_data *zend_create_execute_data_from_op_array(zend_op_array
ZEND_API void zend_execute(zend_op_array *op_array TSRMLS_DC);
ZEND_API void execute_ex(zend_execute_data *execute_data TSRMLS_DC);
ZEND_API void execute_internal(zend_execute_data *execute_data_ptr, struct _zend_fcall_info *fci, int return_value_used TSRMLS_DC);
-ZEND_API int zend_is_true(zval *op);
+ZEND_API int zend_is_true(zval *op TSRMLS_DC);
ZEND_API int zend_lookup_class(const char *name, int name_length, zend_class_entry ***ce TSRMLS_DC);
ZEND_API int zend_lookup_class_ex(const char *name, int name_length, const zend_literal *key, int use_autoload, zend_class_entry ***ce TSRMLS_DC);
ZEND_API int zend_eval_string(char *str, zval *retval_ptr, char *string_name TSRMLS_DC);
@@ -101,7 +101,7 @@ static zend_always_inline void i_zval_ptr_dtor_nogc(zval *zval_ptr ZEND_FILE_LIN
}
}
-static zend_always_inline int i_zend_is_true(zval *op)
+static zend_always_inline int i_zend_is_true(zval *op TSRMLS_DC)
{
int result;
@@ -130,8 +130,6 @@ static zend_always_inline int i_zend_is_true(zval *op)
break;
case IS_OBJECT:
if(IS_ZEND_STD_OBJECT(*op)) {
- TSRMLS_FETCH();
-
if (Z_OBJ_HT_P(op)->cast_object) {
zval tmp;
if (Z_OBJ_HT_P(op)->cast_object(op, &tmp, IS_BOOL TSRMLS_CC) == SUCCESS) {
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c
index af32e91f28..8c2deb7fcc 100644
--- a/Zend/zend_execute_API.c
+++ b/Zend/zend_execute_API.c
@@ -443,9 +443,9 @@ ZEND_API void _zval_internal_ptr_dtor(zval **zval_ptr ZEND_FILE_LINE_DC) /* {{{
}
/* }}} */
-ZEND_API int zend_is_true(zval *op) /* {{{ */
+ZEND_API int zend_is_true(zval *op TSRMLS_DC) /* {{{ */
{
- return i_zend_is_true(op);
+ return i_zend_is_true(op TSRMLS_CC);
}
/* }}} */
diff --git a/Zend/zend_extensions.c b/Zend/zend_extensions.c
index e1290b78ca..47284342fa 100644
--- a/Zend/zend_extensions.c
+++ b/Zend/zend_extensions.c
@@ -24,7 +24,7 @@
ZEND_API zend_llist zend_extensions;
static int last_resource_number;
-int zend_load_extension(const char *path)
+int zend_load_extension(const char *path TSRMLS_DC)
{
#if ZEND_EXTENSIONS_SUPPORT
DL_HANDLE handle;
@@ -107,7 +107,7 @@ int zend_load_extension(const char *path)
return FAILURE;
}
- return zend_register_extension(new_extension, handle);
+ return zend_register_extension(new_extension, handle TSRMLS_CC);
#else
fprintf(stderr, "Extensions are not supported on this platform.\n");
/* See http://support.microsoft.com/kb/190351 */
@@ -119,7 +119,7 @@ int zend_load_extension(const char *path)
}
-int zend_register_extension(zend_extension *new_extension, DL_HANDLE handle)
+int zend_register_extension(zend_extension *new_extension, DL_HANDLE handle TSRMLS_DC)
{
#if ZEND_EXTENSIONS_SUPPORT
zend_extension extension;
@@ -127,7 +127,7 @@ int zend_register_extension(zend_extension *new_extension, DL_HANDLE handle)
extension = *new_extension;
extension.handle = handle;
- zend_extension_dispatch_message(ZEND_EXTMSG_NEW_EXTENSION, &extension);
+ zend_extension_dispatch_message(ZEND_EXTMSG_NEW_EXTENSION, &extension TSRMLS_CC);
zend_llist_add_element(&zend_extensions, &extension);
@@ -208,10 +208,8 @@ static void zend_extension_message_dispatcher(const zend_extension *extension, i
}
-ZEND_API void zend_extension_dispatch_message(int message, void *arg)
+ZEND_API void zend_extension_dispatch_message(int message, void *arg TSRMLS_DC)
{
- TSRMLS_FETCH();
-
zend_llist_apply_with_arguments(&zend_extensions, (llist_apply_with_args_func_t) zend_extension_message_dispatcher TSRMLS_CC, 2, message, arg);
}
diff --git a/Zend/zend_extensions.h b/Zend/zend_extensions.h
index 3eda38aa96..38ac9f8947 100644
--- a/Zend/zend_extensions.h
+++ b/Zend/zend_extensions.h
@@ -28,7 +28,7 @@
/* The first number is the engine version and the rest is the date.
* This way engine 2/3 API no. is always greater than engine 1 API no..
*/
-#define ZEND_EXTENSION_API_NO 220131226
+#define ZEND_EXTENSION_API_NO 220131227
typedef struct _zend_extension_version_info {
int zend_extension_api_no;
@@ -94,7 +94,7 @@ struct _zend_extension {
BEGIN_EXTERN_C()
ZEND_API int zend_get_resource_handle(zend_extension *extension);
-ZEND_API void zend_extension_dispatch_message(int message, void *arg);
+ZEND_API void zend_extension_dispatch_message(int message, void *arg TSRMLS_DC);
END_EXTERN_C()
#define ZEND_EXTMSG_NEW_EXTENSION 1
@@ -117,8 +117,8 @@ int zend_startup_extensions(void);
void zend_shutdown_extensions(TSRMLS_D);
BEGIN_EXTERN_C()
-ZEND_API int zend_load_extension(const char *path);
-ZEND_API int zend_register_extension(zend_extension *new_extension, DL_HANDLE handle);
+ZEND_API int zend_load_extension(const char *path TSRMLS_DC);
+ZEND_API int zend_register_extension(zend_extension *new_extension, DL_HANDLE handle TSRMLS_DC);
ZEND_API zend_extension *zend_get_extension(const char *extension_name);
END_EXTERN_C()
diff --git a/Zend/zend_indent.c b/Zend/zend_indent.c
index 920d412816..10f9af7823 100644
--- a/Zend/zend_indent.c
+++ b/Zend/zend_indent.c
@@ -47,7 +47,7 @@ static void handle_whitespace(int *emit_whitespace)
}
-ZEND_API void zend_indent()
+ZEND_API void zend_indent(TSRMLS_D)
{
zval token;
int token_type;
@@ -55,7 +55,6 @@ ZEND_API void zend_indent()
int nest_level=0;
int emit_whitespace[256];
int i;
- TSRMLS_FETCH();
memset(emit_whitespace, 0, sizeof(int)*256);
diff --git a/Zend/zend_indent.h b/Zend/zend_indent.h
index 6d0996efa8..1c1afb9127 100644
--- a/Zend/zend_indent.h
+++ b/Zend/zend_indent.h
@@ -23,7 +23,7 @@
#define ZEND_INDENT_H
BEGIN_EXTERN_C()
-ZEND_API void zend_indent(void);
+ZEND_API void zend_indent(TSRMLS_D);
END_EXTERN_C()
#endif /* ZEND_INDENT_H */
diff --git a/Zend/zend_interfaces.c b/Zend/zend_interfaces.c
index 4b01eb3c4f..f9a020c656 100644
--- a/Zend/zend_interfaces.c
+++ b/Zend/zend_interfaces.c
@@ -162,7 +162,7 @@ ZEND_API int zend_user_it_valid(zend_object_iterator *_iter TSRMLS_DC)
zend_call_method_with_0_params(&object, iter->ce, &iter->ce->iterator_funcs.zf_valid, "valid", &more);
if (more) {
- result = i_zend_is_true(more);
+ result = i_zend_is_true(more TSRMLS_CC);
zval_ptr_dtor(&more);
return result ? SUCCESS : FAILURE;
}
diff --git a/Zend/zend_modules.h b/Zend/zend_modules.h
index 080d46168e..55f99c4b1d 100644
--- a/Zend/zend_modules.h
+++ b/Zend/zend_modules.h
@@ -33,7 +33,7 @@
#define ZEND_MODULE_INFO_FUNC_ARGS zend_module_entry *zend_module TSRMLS_DC
#define ZEND_MODULE_INFO_FUNC_ARGS_PASSTHRU zend_module TSRMLS_CC
-#define ZEND_MODULE_API_NO 20131226
+#define ZEND_MODULE_API_NO 20131227
#ifdef ZTS
#define USING_ZTS 1
#else
diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c
index c7adf38f3b..7f1d3e4e86 100644
--- a/Zend/zend_object_handlers.c
+++ b/Zend/zend_object_handlers.c
@@ -29,6 +29,7 @@
#include "zend_interfaces.h"
#include "zend_closures.h"
#include "zend_compile.h"
+#include "zend_hash.h"
#define DEBUG_OBJECT_HANDLERS 0
@@ -220,7 +221,7 @@ static int zend_std_call_setter(zval *object, zval *member, zval *value TSRMLS_D
zval_ptr_dtor(&value);
if (retval) {
- result = i_zend_is_true(retval) ? SUCCESS : FAILURE;
+ result = i_zend_is_true(retval TSRMLS_CC) ? SUCCESS : FAILURE;
zval_ptr_dtor(&retval);
return result;
} else {
@@ -725,12 +726,12 @@ static int zend_std_has_dimension(zval *object, zval *offset, int check_empty TS
SEPARATE_ARG_IF_REF(offset);
zend_call_method_with_1_params(&object, ce, NULL, "offsetexists", &retval, offset);
if (EXPECTED(retval != NULL)) {
- result = i_zend_is_true(retval);
+ result = i_zend_is_true(retval TSRMLS_CC);
zval_ptr_dtor(&retval);
if (check_empty && result && EXPECTED(!EG(exception))) {
zend_call_method_with_1_params(&object, ce, NULL, "offsetget", &retval, offset);
if (retval) {
- result = i_zend_is_true(retval);
+ result = i_zend_is_true(retval TSRMLS_CC);
zval_ptr_dtor(&retval);
}
}
@@ -1474,7 +1475,7 @@ static int zend_std_has_property(zval *object, zval *member, int has_set_exists,
guard->in_isset = 1; /* prevent circular getting */
rv = zend_std_call_issetter(object, member TSRMLS_CC);
if (rv) {
- result = zend_is_true(rv);
+ result = zend_is_true(rv TSRMLS_CC);
zval_ptr_dtor(&rv);
if (has_set_exists && result) {
if (EXPECTED(!EG(exception)) && zobj->ce->__get && !guard->in_get) {
@@ -1483,7 +1484,7 @@ static int zend_std_has_property(zval *object, zval *member, int has_set_exists,
guard->in_get = 0;
if (rv) {
Z_ADDREF_P(rv);
- result = i_zend_is_true(rv);
+ result = i_zend_is_true(rv TSRMLS_CC);
zval_ptr_dtor(&rv);
} else {
result = 0;
@@ -1502,7 +1503,7 @@ static int zend_std_has_property(zval *object, zval *member, int has_set_exists,
result = (Z_TYPE_PP(value) != IS_NULL);
break;
default:
- result = zend_is_true(*value);
+ result = zend_is_true(*value TSRMLS_CC);
break;
case 2:
result = 1;
diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h
index cadaaa7579..d882086692 100644
--- a/Zend/zend_vm_def.h
+++ b/Zend/zend_vm_def.h
@@ -2104,7 +2104,7 @@ ZEND_VM_HANDLER(43, ZEND_JMPZ, CONST|TMP|VAR|CV, ANY)
if (OP1_TYPE == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) {
ret = Z_LVAL_P(val);
} else {
- ret = i_zend_is_true(val);
+ ret = i_zend_is_true(val TSRMLS_CC);
FREE_OP1();
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
@@ -2134,7 +2134,7 @@ ZEND_VM_HANDLER(44, ZEND_JMPNZ, CONST|TMP|VAR|CV, ANY)
if (OP1_TYPE == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) {
ret = Z_LVAL_P(val);
} else {
- ret = i_zend_is_true(val);
+ ret = i_zend_is_true(val TSRMLS_CC);
FREE_OP1();
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
@@ -2164,7 +2164,7 @@ ZEND_VM_HANDLER(45, ZEND_JMPZNZ, CONST|TMP|VAR|CV, ANY)
if (OP1_TYPE == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) {
retval = Z_LVAL_P(val);
} else {
- retval = i_zend_is_true(val);
+ retval = i_zend_is_true(val TSRMLS_CC);
FREE_OP1();
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
@@ -2198,7 +2198,7 @@ ZEND_VM_HANDLER(46, ZEND_JMPZ_EX, CONST|TMP|VAR|CV, ANY)
if (OP1_TYPE == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) {
retval = Z_LVAL_P(val);
} else {
- retval = i_zend_is_true(val);
+ retval = i_zend_is_true(val TSRMLS_CC);
FREE_OP1();
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
@@ -2229,7 +2229,7 @@ ZEND_VM_HANDLER(47, ZEND_JMPNZ_EX, CONST|TMP|VAR|CV, ANY)
if (OP1_TYPE == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) {
retval = Z_LVAL_P(val);
} else {
- retval = i_zend_is_true(val);
+ retval = i_zend_is_true(val TSRMLS_CC);
FREE_OP1();
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
@@ -3486,7 +3486,7 @@ ZEND_VM_HANDLER(52, ZEND_BOOL, CONST|TMP|VAR|CV, ANY)
SAVE_OPLINE();
/* PHP 3.0 returned "" for false and 1 for true, here we use 0 and 1 for now */
- ZVAL_BOOL(retval, i_zend_is_true(GET_OP1_ZVAL_PTR(BP_VAR_R)));
+ ZVAL_BOOL(retval, i_zend_is_true(GET_OP1_ZVAL_PTR(BP_VAR_R) TSRMLS_CC));
FREE_OP1();
CHECK_EXCEPTION();
@@ -4648,7 +4648,7 @@ ZEND_VM_HANDLER(114, ZEND_ISSET_ISEMPTY_VAR, CONST|TMP|VAR|CV, UNUSED|CONST|VAR)
ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0);
}
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
- if (!isset || !i_zend_is_true(*value)) {
+ if (!isset || !i_zend_is_true(*value TSRMLS_CC)) {
ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 1);
} else {
ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0);
@@ -4720,7 +4720,7 @@ ZEND_VM_C_LABEL(num_index_prop):
result = isset;
}
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
- if (!isset || !i_zend_is_true(*value)) {
+ if (!isset || !i_zend_is_true(*value TSRMLS_CC)) {
result = 0;
} else {
result = 1;
@@ -4914,7 +4914,7 @@ ZEND_VM_HANDLER(152, ZEND_JMP_SET, CONST|TMP|VAR|CV, ANY)
SAVE_OPLINE();
value = GET_OP1_ZVAL_PTR(BP_VAR_R);
- if (i_zend_is_true(value)) {
+ if (i_zend_is_true(value TSRMLS_CC)) {
ZVAL_COPY_VALUE(&EX_T(opline->result.var).tmp_var, value);
if (!IS_OP1_TMP_FREE()) {
zendi_zval_copy_ctor(EX_T(opline->result.var).tmp_var);
@@ -4940,7 +4940,7 @@ ZEND_VM_HANDLER(158, ZEND_JMP_SET_VAR, CONST|TMP|VAR|CV, ANY)
SAVE_OPLINE();
value = GET_OP1_ZVAL_PTR(BP_VAR_R);
- if (i_zend_is_true(value)) {
+ if (i_zend_is_true(value TSRMLS_CC)) {
if (OP1_TYPE == IS_VAR || OP1_TYPE == IS_CV) {
Z_ADDREF_P(value);
EX_T(opline->result.var).var.ptr = value;
@@ -5095,7 +5095,7 @@ ZEND_VM_HANDLER(105, ZEND_TICKS, ANY, ANY)
if (++EG(ticks_count)>=opline->extended_value) {
EG(ticks_count)=0;
if (zend_ticks_function) {
- zend_ticks_function(opline->extended_value);
+ zend_ticks_function(opline->extended_value TSRMLS_CC);
}
}
CHECK_EXCEPTION();
diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h
index c085276a33..81aeb43295 100644
--- a/Zend/zend_vm_execute.h
+++ b/Zend/zend_vm_execute.h
@@ -1107,7 +1107,7 @@ static int ZEND_FASTCALL ZEND_TICKS_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
if (++EG(ticks_count)>=opline->extended_value) {
EG(ticks_count)=0;
if (zend_ticks_function) {
- zend_ticks_function(opline->extended_value);
+ zend_ticks_function(opline->extended_value TSRMLS_CC);
}
}
CHECK_EXCEPTION();
@@ -2426,7 +2426,7 @@ static int ZEND_FASTCALL ZEND_JMPZ_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
if (IS_CONST == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) {
ret = Z_LVAL_P(val);
} else {
- ret = i_zend_is_true(val);
+ ret = i_zend_is_true(val TSRMLS_CC);
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
@@ -2456,7 +2456,7 @@ static int ZEND_FASTCALL ZEND_JMPNZ_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS
if (IS_CONST == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) {
ret = Z_LVAL_P(val);
} else {
- ret = i_zend_is_true(val);
+ ret = i_zend_is_true(val TSRMLS_CC);
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
@@ -2486,7 +2486,7 @@ static int ZEND_FASTCALL ZEND_JMPZNZ_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARG
if (IS_CONST == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) {
retval = Z_LVAL_P(val);
} else {
- retval = i_zend_is_true(val);
+ retval = i_zend_is_true(val TSRMLS_CC);
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
@@ -2520,7 +2520,7 @@ static int ZEND_FASTCALL ZEND_JMPZ_EX_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR
if (IS_CONST == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) {
retval = Z_LVAL_P(val);
} else {
- retval = i_zend_is_true(val);
+ retval = i_zend_is_true(val TSRMLS_CC);
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
@@ -2551,7 +2551,7 @@ static int ZEND_FASTCALL ZEND_JMPNZ_EX_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_A
if (IS_CONST == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) {
retval = Z_LVAL_P(val);
} else {
- retval = i_zend_is_true(val);
+ retval = i_zend_is_true(val TSRMLS_CC);
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
@@ -2778,7 +2778,7 @@ static int ZEND_FASTCALL ZEND_BOOL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
/* PHP 3.0 returned "" for false and 1 for true, here we use 0 and 1 for now */
- ZVAL_BOOL(retval, i_zend_is_true(opline->op1.zv));
+ ZVAL_BOOL(retval, i_zend_is_true(opline->op1.zv TSRMLS_CC));
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -3235,7 +3235,7 @@ static int ZEND_FASTCALL ZEND_JMP_SET_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_AR
SAVE_OPLINE();
value = opline->op1.zv;
- if (i_zend_is_true(value)) {
+ if (i_zend_is_true(value TSRMLS_CC)) {
ZVAL_COPY_VALUE(&EX_T(opline->result.var).tmp_var, value);
if (!0) {
zendi_zval_copy_ctor(EX_T(opline->result.var).tmp_var);
@@ -3260,7 +3260,7 @@ static int ZEND_FASTCALL ZEND_JMP_SET_VAR_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLE
SAVE_OPLINE();
value = opline->op1.zv;
- if (i_zend_is_true(value)) {
+ if (i_zend_is_true(value TSRMLS_CC)) {
if (IS_CONST == IS_VAR || IS_CONST == IS_CV) {
Z_ADDREF_P(value);
EX_T(opline->result.var).var.ptr = value;
@@ -4290,7 +4290,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_CONST_HANDLER(ZEND_O
ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0);
}
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
- if (!isset || !i_zend_is_true(*value)) {
+ if (!isset || !i_zend_is_true(*value TSRMLS_CC)) {
ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 1);
} else {
ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0);
@@ -6065,7 +6065,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_VAR_HANDLER(ZEND_OPC
ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0);
}
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
- if (!isset || !i_zend_is_true(*value)) {
+ if (!isset || !i_zend_is_true(*value TSRMLS_CC)) {
ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 1);
} else {
ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0);
@@ -6785,7 +6785,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_UNUSED_HANDLER(ZEND_
ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0);
}
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
- if (!isset || !i_zend_is_true(*value)) {
+ if (!isset || !i_zend_is_true(*value TSRMLS_CC)) {
ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 1);
} else {
ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0);
@@ -7807,7 +7807,7 @@ static int ZEND_FASTCALL ZEND_JMPZ_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
if (IS_TMP_VAR == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) {
ret = Z_LVAL_P(val);
} else {
- ret = i_zend_is_true(val);
+ ret = i_zend_is_true(val TSRMLS_CC);
zval_dtor(free_op1.var);
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
@@ -7837,7 +7837,7 @@ static int ZEND_FASTCALL ZEND_JMPNZ_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
if (IS_TMP_VAR == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) {
ret = Z_LVAL_P(val);
} else {
- ret = i_zend_is_true(val);
+ ret = i_zend_is_true(val TSRMLS_CC);
zval_dtor(free_op1.var);
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
@@ -7867,7 +7867,7 @@ static int ZEND_FASTCALL ZEND_JMPZNZ_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
if (IS_TMP_VAR == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) {
retval = Z_LVAL_P(val);
} else {
- retval = i_zend_is_true(val);
+ retval = i_zend_is_true(val TSRMLS_CC);
zval_dtor(free_op1.var);
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
@@ -7901,7 +7901,7 @@ static int ZEND_FASTCALL ZEND_JMPZ_EX_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS
if (IS_TMP_VAR == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) {
retval = Z_LVAL_P(val);
} else {
- retval = i_zend_is_true(val);
+ retval = i_zend_is_true(val TSRMLS_CC);
zval_dtor(free_op1.var);
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
@@ -7932,7 +7932,7 @@ static int ZEND_FASTCALL ZEND_JMPNZ_EX_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
if (IS_TMP_VAR == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) {
retval = Z_LVAL_P(val);
} else {
- retval = i_zend_is_true(val);
+ retval = i_zend_is_true(val TSRMLS_CC);
zval_dtor(free_op1.var);
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
@@ -8147,7 +8147,7 @@ static int ZEND_FASTCALL ZEND_BOOL_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
/* PHP 3.0 returned "" for false and 1 for true, here we use 0 and 1 for now */
- ZVAL_BOOL(retval, i_zend_is_true(_get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC)));
+ ZVAL_BOOL(retval, i_zend_is_true(_get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC) TSRMLS_CC));
zval_dtor(free_op1.var);
CHECK_EXCEPTION();
@@ -8634,7 +8634,7 @@ static int ZEND_FASTCALL ZEND_JMP_SET_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS
SAVE_OPLINE();
value = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- if (i_zend_is_true(value)) {
+ if (i_zend_is_true(value TSRMLS_CC)) {
ZVAL_COPY_VALUE(&EX_T(opline->result.var).tmp_var, value);
if (!1) {
zendi_zval_copy_ctor(EX_T(opline->result.var).tmp_var);
@@ -8660,7 +8660,7 @@ static int ZEND_FASTCALL ZEND_JMP_SET_VAR_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_
SAVE_OPLINE();
value = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- if (i_zend_is_true(value)) {
+ if (i_zend_is_true(value TSRMLS_CC)) {
if (IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) {
Z_ADDREF_P(value);
EX_T(opline->result.var).var.ptr = value;
@@ -9619,7 +9619,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_TMP_CONST_HANDLER(ZEND_OPC
ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0);
}
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
- if (!isset || !i_zend_is_true(*value)) {
+ if (!isset || !i_zend_is_true(*value TSRMLS_CC)) {
ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 1);
} else {
ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0);
@@ -11352,7 +11352,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_TMP_VAR_HANDLER(ZEND_OPCOD
ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0);
}
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
- if (!isset || !i_zend_is_true(*value)) {
+ if (!isset || !i_zend_is_true(*value TSRMLS_CC)) {
ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 1);
} else {
ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0);
@@ -11947,7 +11947,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_TMP_UNUSED_HANDLER(ZEND_OP
ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0);
}
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
- if (!isset || !i_zend_is_true(*value)) {
+ if (!isset || !i_zend_is_true(*value TSRMLS_CC)) {
ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 1);
} else {
ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0);
@@ -13064,7 +13064,7 @@ static int ZEND_FASTCALL ZEND_JMPZ_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
if (IS_VAR == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) {
ret = Z_LVAL_P(val);
} else {
- ret = i_zend_is_true(val);
+ ret = i_zend_is_true(val TSRMLS_CC);
zval_ptr_dtor_nogc(&free_op1.var);
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
@@ -13094,7 +13094,7 @@ static int ZEND_FASTCALL ZEND_JMPNZ_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
if (IS_VAR == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) {
ret = Z_LVAL_P(val);
} else {
- ret = i_zend_is_true(val);
+ ret = i_zend_is_true(val TSRMLS_CC);
zval_ptr_dtor_nogc(&free_op1.var);
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
@@ -13124,7 +13124,7 @@ static int ZEND_FASTCALL ZEND_JMPZNZ_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
if (IS_VAR == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) {
retval = Z_LVAL_P(val);
} else {
- retval = i_zend_is_true(val);
+ retval = i_zend_is_true(val TSRMLS_CC);
zval_ptr_dtor_nogc(&free_op1.var);
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
@@ -13158,7 +13158,7 @@ static int ZEND_FASTCALL ZEND_JMPZ_EX_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS
if (IS_VAR == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) {
retval = Z_LVAL_P(val);
} else {
- retval = i_zend_is_true(val);
+ retval = i_zend_is_true(val TSRMLS_CC);
zval_ptr_dtor_nogc(&free_op1.var);
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
@@ -13189,7 +13189,7 @@ static int ZEND_FASTCALL ZEND_JMPNZ_EX_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
if (IS_VAR == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) {
retval = Z_LVAL_P(val);
} else {
- retval = i_zend_is_true(val);
+ retval = i_zend_is_true(val TSRMLS_CC);
zval_ptr_dtor_nogc(&free_op1.var);
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
@@ -13506,7 +13506,7 @@ static int ZEND_FASTCALL ZEND_BOOL_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
/* PHP 3.0 returned "" for false and 1 for true, here we use 0 and 1 for now */
- ZVAL_BOOL(retval, i_zend_is_true(_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC)));
+ ZVAL_BOOL(retval, i_zend_is_true(_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC) TSRMLS_CC));
zval_ptr_dtor_nogc(&free_op1.var);
CHECK_EXCEPTION();
@@ -14105,7 +14105,7 @@ static int ZEND_FASTCALL ZEND_JMP_SET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS
SAVE_OPLINE();
value = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- if (i_zend_is_true(value)) {
+ if (i_zend_is_true(value TSRMLS_CC)) {
ZVAL_COPY_VALUE(&EX_T(opline->result.var).tmp_var, value);
if (!0) {
zendi_zval_copy_ctor(EX_T(opline->result.var).tmp_var);
@@ -14131,7 +14131,7 @@ static int ZEND_FASTCALL ZEND_JMP_SET_VAR_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_
SAVE_OPLINE();
value = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- if (i_zend_is_true(value)) {
+ if (i_zend_is_true(value TSRMLS_CC)) {
if (IS_VAR == IS_VAR || IS_VAR == IS_CV) {
Z_ADDREF_P(value);
EX_T(opline->result.var).var.ptr = value;
@@ -16392,7 +16392,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_VAR_CONST_HANDLER(ZEND_OPC
ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0);
}
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
- if (!isset || !i_zend_is_true(*value)) {
+ if (!isset || !i_zend_is_true(*value TSRMLS_CC)) {
ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 1);
} else {
ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0);
@@ -16464,7 +16464,7 @@ num_index_prop:
result = isset;
}
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
- if (!isset || !i_zend_is_true(*value)) {
+ if (!isset || !i_zend_is_true(*value TSRMLS_CC)) {
result = 0;
} else {
result = 1;
@@ -18554,7 +18554,7 @@ num_index_prop:
result = isset;
}
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
- if (!isset || !i_zend_is_true(*value)) {
+ if (!isset || !i_zend_is_true(*value TSRMLS_CC)) {
result = 0;
} else {
result = 1;
@@ -20952,7 +20952,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_VAR_VAR_HANDLER(ZEND_OPCOD
ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0);
}
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
- if (!isset || !i_zend_is_true(*value)) {
+ if (!isset || !i_zend_is_true(*value TSRMLS_CC)) {
ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 1);
} else {
ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0);
@@ -21024,7 +21024,7 @@ num_index_prop:
result = isset;
}
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
- if (!isset || !i_zend_is_true(*value)) {
+ if (!isset || !i_zend_is_true(*value TSRMLS_CC)) {
result = 0;
} else {
result = 1;
@@ -22246,7 +22246,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_VAR_UNUSED_HANDLER(ZEND_OP
ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0);
}
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
- if (!isset || !i_zend_is_true(*value)) {
+ if (!isset || !i_zend_is_true(*value TSRMLS_CC)) {
ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 1);
} else {
ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0);
@@ -24316,7 +24316,7 @@ num_index_prop:
result = isset;
}
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
- if (!isset || !i_zend_is_true(*value)) {
+ if (!isset || !i_zend_is_true(*value TSRMLS_CC)) {
result = 0;
} else {
result = 1;
@@ -25830,7 +25830,7 @@ num_index_prop:
result = isset;
}
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
- if (!isset || !i_zend_is_true(*value)) {
+ if (!isset || !i_zend_is_true(*value TSRMLS_CC)) {
result = 0;
} else {
result = 1;
@@ -27144,7 +27144,7 @@ num_index_prop:
result = isset;
}
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
- if (!isset || !i_zend_is_true(*value)) {
+ if (!isset || !i_zend_is_true(*value TSRMLS_CC)) {
result = 0;
} else {
result = 1;
@@ -28458,7 +28458,7 @@ num_index_prop:
result = isset;
}
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
- if (!isset || !i_zend_is_true(*value)) {
+ if (!isset || !i_zend_is_true(*value TSRMLS_CC)) {
result = 0;
} else {
result = 1;
@@ -30199,7 +30199,7 @@ num_index_prop:
result = isset;
}
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
- if (!isset || !i_zend_is_true(*value)) {
+ if (!isset || !i_zend_is_true(*value TSRMLS_CC)) {
result = 0;
} else {
result = 1;
@@ -30688,7 +30688,7 @@ static int ZEND_FASTCALL ZEND_JMPZ_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
if (IS_CV == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) {
ret = Z_LVAL_P(val);
} else {
- ret = i_zend_is_true(val);
+ ret = i_zend_is_true(val TSRMLS_CC);
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
@@ -30718,7 +30718,7 @@ static int ZEND_FASTCALL ZEND_JMPNZ_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
if (IS_CV == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) {
ret = Z_LVAL_P(val);
} else {
- ret = i_zend_is_true(val);
+ ret = i_zend_is_true(val TSRMLS_CC);
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
@@ -30748,7 +30748,7 @@ static int ZEND_FASTCALL ZEND_JMPZNZ_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
if (IS_CV == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) {
retval = Z_LVAL_P(val);
} else {
- retval = i_zend_is_true(val);
+ retval = i_zend_is_true(val TSRMLS_CC);
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
@@ -30782,7 +30782,7 @@ static int ZEND_FASTCALL ZEND_JMPZ_EX_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
if (IS_CV == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) {
retval = Z_LVAL_P(val);
} else {
- retval = i_zend_is_true(val);
+ retval = i_zend_is_true(val TSRMLS_CC);
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
@@ -30813,7 +30813,7 @@ static int ZEND_FASTCALL ZEND_JMPNZ_EX_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
if (IS_CV == IS_TMP_VAR && EXPECTED(Z_TYPE_P(val) == IS_BOOL)) {
retval = Z_LVAL_P(val);
} else {
- retval = i_zend_is_true(val);
+ retval = i_zend_is_true(val TSRMLS_CC);
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
@@ -31114,7 +31114,7 @@ static int ZEND_FASTCALL ZEND_BOOL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
/* PHP 3.0 returned "" for false and 1 for true, here we use 0 and 1 for now */
- ZVAL_BOOL(retval, i_zend_is_true(_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC)));
+ ZVAL_BOOL(retval, i_zend_is_true(_get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC) TSRMLS_CC));
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -31571,7 +31571,7 @@ static int ZEND_FASTCALL ZEND_JMP_SET_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
SAVE_OPLINE();
value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
- if (i_zend_is_true(value)) {
+ if (i_zend_is_true(value TSRMLS_CC)) {
ZVAL_COPY_VALUE(&EX_T(opline->result.var).tmp_var, value);
if (!0) {
zendi_zval_copy_ctor(EX_T(opline->result.var).tmp_var);
@@ -31596,7 +31596,7 @@ static int ZEND_FASTCALL ZEND_JMP_SET_VAR_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_A
SAVE_OPLINE();
value = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
- if (i_zend_is_true(value)) {
+ if (i_zend_is_true(value TSRMLS_CC)) {
if (IS_CV == IS_VAR || IS_CV == IS_CV) {
Z_ADDREF_P(value);
EX_T(opline->result.var).var.ptr = value;
@@ -33624,7 +33624,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_CONST_HANDLER(ZEND_OPCO
ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0);
}
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
- if (!isset || !i_zend_is_true(*value)) {
+ if (!isset || !i_zend_is_true(*value TSRMLS_CC)) {
ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 1);
} else {
ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0);
@@ -33696,7 +33696,7 @@ num_index_prop:
result = isset;
}
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
- if (!isset || !i_zend_is_true(*value)) {
+ if (!isset || !i_zend_is_true(*value TSRMLS_CC)) {
result = 0;
} else {
result = 1;
@@ -35647,7 +35647,7 @@ num_index_prop:
result = isset;
}
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
- if (!isset || !i_zend_is_true(*value)) {
+ if (!isset || !i_zend_is_true(*value TSRMLS_CC)) {
result = 0;
} else {
result = 1;
@@ -37905,7 +37905,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_VAR_HANDLER(ZEND_OPCODE
ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0);
}
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
- if (!isset || !i_zend_is_true(*value)) {
+ if (!isset || !i_zend_is_true(*value TSRMLS_CC)) {
ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 1);
} else {
ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0);
@@ -37977,7 +37977,7 @@ num_index_prop:
result = isset;
}
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
- if (!isset || !i_zend_is_true(*value)) {
+ if (!isset || !i_zend_is_true(*value TSRMLS_CC)) {
result = 0;
} else {
result = 1;
@@ -39069,7 +39069,7 @@ static int ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_UNUSED_HANDLER(ZEND_OPC
ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0);
}
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
- if (!isset || !i_zend_is_true(*value)) {
+ if (!isset || !i_zend_is_true(*value TSRMLS_CC)) {
ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 1);
} else {
ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0);
@@ -40980,7 +40980,7 @@ num_index_prop:
result = isset;
}
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
- if (!isset || !i_zend_is_true(*value)) {
+ if (!isset || !i_zend_is_true(*value TSRMLS_CC)) {
result = 0;
} else {
result = 1;
diff --git a/configure.in b/configure.in
index 3369b9a4f6..8781cbc459 100644
--- a/configure.in
+++ b/configure.in
@@ -118,7 +118,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
])
PHP_MAJOR_VERSION=5
-PHP_MINOR_VERSION=6
+PHP_MINOR_VERSION=7
PHP_RELEASE_VERSION=0
PHP_EXTRA_VERSION="-dev"
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
diff --git a/ext/date/php_date.c b/ext/date/php_date.c
index 278988036d..a3cd5734d6 100644
--- a/ext/date/php_date.c
+++ b/ext/date/php_date.c
@@ -2735,7 +2735,9 @@ PHP_METHOD(DateTime, __construct)
zend_replace_error_handling(EH_THROW, NULL, &error_handling TSRMLS_CC);
if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sO!", &time_str, &time_str_len, &timezone_object, date_ce_timezone)) {
- php_date_initialize(zend_object_store_get_object(getThis() TSRMLS_CC), time_str, time_str_len, NULL, timezone_object, 1 TSRMLS_CC);
+ if (!php_date_initialize(zend_object_store_get_object(getThis() TSRMLS_CC), time_str, time_str_len, NULL, timezone_object, 1 TSRMLS_CC)) {
+ ZVAL_NULL(getThis());
+ }
}
zend_restore_error_handling(&error_handling TSRMLS_CC);
}
diff --git a/ext/date/tests/bug67118.phpt b/ext/date/tests/bug67118.phpt
index 973b4eb8d5..19b5914aa3 100644
--- a/ext/date/tests/bug67118.phpt
+++ b/ext/date/tests/bug67118.phpt
@@ -23,5 +23,4 @@ class mydt extends datetime
new mydt("Funktionsansvarig rådgivning och juridik", "UTC");
?>
--EXPECTF--
-Warning: DateTime::format(): The DateTime object has not been correctly initialized by its constructor in %sbug67118.php on line %d
-Bad date
+Fatal error: Call to a member function format() on null in %sbug67118.php on line %d
diff --git a/ext/date/tests/bug67118_2.phpt b/ext/date/tests/bug67118_2.phpt
index b4904a1583..368d4d9401 100644
--- a/ext/date/tests/bug67118_2.phpt
+++ b/ext/date/tests/bug67118_2.phpt
@@ -1,5 +1,5 @@
--TEST--
-Regression introduce in fix for Bug #67118
+Regression introduce in fix for Bug #67118 - Invalid code
--INI--
date.timezone=Europe/Paris
--FILE--
@@ -24,12 +24,5 @@ Done
--EXPECTF--
First try
Second try
-object(Foo)#1 (3) {
- ["date"]=>
- string(%d) "2007-09-12 15:49:%s"
- ["timezone_type"]=>
- int(3)
- ["timezone"]=>
- string(3) "UTC"
-}
-Done
+NULL
+Done \ No newline at end of file
diff --git a/ext/dba/dba_inifile.c b/ext/dba/dba_inifile.c
index 4d8eae73ac..6067e99154 100644
--- a/ext/dba/dba_inifile.c
+++ b/ext/dba/dba_inifile.c
@@ -124,14 +124,15 @@ DBA_EXISTS_FUNC(inifile)
DBA_DELETE_FUNC(inifile)
{
int res;
+ zend_bool found = 0;
INIFILE_DATA;
INIFILE_GKEY;
- res = inifile_delete(dba, &ini_key TSRMLS_CC);
+ res = inifile_delete_ex(dba, &ini_key, &found TSRMLS_CC);
INIFILE_DONE;
- return (res == -1 ? FAILURE : SUCCESS);
+ return (res == -1 || !found ? FAILURE : SUCCESS);
}
DBA_FIRSTKEY_FUNC(inifile)
diff --git a/ext/dba/libinifile/inifile.c b/ext/dba/libinifile/inifile.c
index 8c771beba4..218037ebe3 100644
--- a/ext/dba/libinifile/inifile.c
+++ b/ext/dba/libinifile/inifile.c
@@ -402,7 +402,7 @@ static int inifile_copy_to(inifile *dba, size_t pos_start, size_t pos_end, inifi
return FAILURE;
}
php_stream_seek(dba->fp, pos_start, SEEK_SET);
- if (!php_stream_copy_to_stream_ex(dba->fp, fp, pos_end - pos_start, NULL)) {
+ if (SUCCESS != php_stream_copy_to_stream_ex(dba->fp, fp, pos_end - pos_start, NULL)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not copy group [%zu - %zu] to temporary stream", pos_start, pos_end);
return FAILURE;
}
@@ -413,7 +413,7 @@ static int inifile_copy_to(inifile *dba, size_t pos_start, size_t pos_end, inifi
/* {{{ inifile_filter
* copy from to dba while ignoring key name (group must equal)
*/
-static int inifile_filter(inifile *dba, inifile *from, const key_type *key TSRMLS_DC)
+static int inifile_filter(inifile *dba, inifile *from, const key_type *key, zend_bool *found TSRMLS_DC)
{
size_t pos_start = 0, pos_next = 0, pos_curr;
int ret = SUCCESS;
@@ -424,10 +424,13 @@ static int inifile_filter(inifile *dba, inifile *from, const key_type *key TSRML
while(inifile_read(from, &ln TSRMLS_CC)) {
switch(inifile_key_cmp(&ln.key, key TSRMLS_CC)) {
case 0:
+ if (found) {
+ *found = (zend_bool) 1;
+ }
pos_curr = php_stream_tell(from->fp);
if (pos_start != pos_next) {
php_stream_seek(from->fp, pos_start, SEEK_SET);
- if (!php_stream_copy_to_stream_ex(from->fp, dba->fp, pos_next - pos_start, NULL)) {
+ if (SUCCESS != php_stream_copy_to_stream_ex(from->fp, dba->fp, pos_next - pos_start, NULL)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not copy [%zu - %zu] from temporary stream", pos_next, pos_start);
ret = FAILURE;
}
@@ -446,7 +449,7 @@ static int inifile_filter(inifile *dba, inifile *from, const key_type *key TSRML
}
if (pos_start != pos_next) {
php_stream_seek(from->fp, pos_start, SEEK_SET);
- if (!php_stream_copy_to_stream_ex(from->fp, dba->fp, pos_next - pos_start, NULL)) {
+ if (SUCCESS != php_stream_copy_to_stream_ex(from->fp, dba->fp, pos_next - pos_start, NULL)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not copy [%zu - %zu] from temporary stream", pos_next, pos_start);
ret = FAILURE;
}
@@ -458,7 +461,7 @@ static int inifile_filter(inifile *dba, inifile *from, const key_type *key TSRML
/* {{{ inifile_delete_replace_append
*/
-static int inifile_delete_replace_append(inifile *dba, const key_type *key, const val_type *value, int append TSRMLS_DC)
+static int inifile_delete_replace_append(inifile *dba, const key_type *key, const val_type *value, int append, zend_bool *found TSRMLS_DC)
{
size_t pos_grp_start=0, pos_grp_next;
inifile *ini_tmp = NULL;
@@ -497,7 +500,7 @@ static int inifile_delete_replace_append(inifile *dba, const key_type *key, cons
php_stream_seek(dba->fp, 0, SEEK_END);
if (pos_grp_next != (size_t)php_stream_tell(dba->fp)) {
php_stream_seek(dba->fp, pos_grp_next, SEEK_SET);
- if (!php_stream_copy_to_stream_ex(dba->fp, fp_tmp, PHP_STREAM_COPY_ALL, NULL)) {
+ if (SUCCESS != php_stream_copy_to_stream_ex(dba->fp, fp_tmp, PHP_STREAM_COPY_ALL, NULL)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not copy remainder to temporary stream");
ret = FAILURE;
}
@@ -516,7 +519,7 @@ static int inifile_delete_replace_append(inifile *dba, const key_type *key, cons
if (key->name && strlen(key->name)) {
/* 6 */
if (!append && ini_tmp) {
- ret = inifile_filter(dba, ini_tmp, key TSRMLS_CC);
+ ret = inifile_filter(dba, ini_tmp, key, found TSRMLS_CC);
}
/* 7 */
@@ -538,7 +541,7 @@ static int inifile_delete_replace_append(inifile *dba, const key_type *key, cons
if (fp_tmp && php_stream_tell(fp_tmp)) {
php_stream_seek(fp_tmp, 0, SEEK_SET);
php_stream_seek(dba->fp, 0, SEEK_END);
- if (!php_stream_copy_to_stream_ex(fp_tmp, dba->fp, PHP_STREAM_COPY_ALL, NULL)) {
+ if (SUCCESS != php_stream_copy_to_stream_ex(fp_tmp, dba->fp, PHP_STREAM_COPY_ALL, NULL)) {
php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Could not copy from temporary stream - ini file truncated");
ret = FAILURE;
}
@@ -563,7 +566,15 @@ static int inifile_delete_replace_append(inifile *dba, const key_type *key, cons
*/
int inifile_delete(inifile *dba, const key_type *key TSRMLS_DC)
{
- return inifile_delete_replace_append(dba, key, NULL, 0 TSRMLS_CC);
+ return inifile_delete_replace_append(dba, key, NULL, 0, NULL TSRMLS_CC);
+}
+/* }}} */
+
+/* {{{ inifile_delete_ex
+ */
+int inifile_delete_ex(inifile *dba, const key_type *key, zend_bool *found TSRMLS_DC)
+{
+ return inifile_delete_replace_append(dba, key, NULL, 0, found TSRMLS_CC);
}
/* }}} */
@@ -571,7 +582,15 @@ int inifile_delete(inifile *dba, const key_type *key TSRMLS_DC)
*/
int inifile_replace(inifile *dba, const key_type *key, const val_type *value TSRMLS_DC)
{
- return inifile_delete_replace_append(dba, key, value, 0 TSRMLS_CC);
+ return inifile_delete_replace_append(dba, key, value, 0, NULL TSRMLS_CC);
+}
+/* }}} */
+
+/* {{{ inifile_replace_ex
+ */
+int inifile_replace_ex(inifile *dba, const key_type *key, const val_type *value, zend_bool *found TSRMLS_DC)
+{
+ return inifile_delete_replace_append(dba, key, value, 0, found TSRMLS_CC);
}
/* }}} */
@@ -579,7 +598,7 @@ int inifile_replace(inifile *dba, const key_type *key, const val_type *value TSR
*/
int inifile_append(inifile *dba, const key_type *key, const val_type *value TSRMLS_DC)
{
- return inifile_delete_replace_append(dba, key, value, 1 TSRMLS_CC);
+ return inifile_delete_replace_append(dba, key, value, 1, NULL TSRMLS_CC);
}
/* }}} */
diff --git a/ext/dba/libinifile/inifile.h b/ext/dba/libinifile/inifile.h
index 1177610185..e41dac0ca4 100644
--- a/ext/dba/libinifile/inifile.h
+++ b/ext/dba/libinifile/inifile.h
@@ -49,7 +49,9 @@ val_type inifile_fetch(inifile *dba, const key_type *key, int skip TSRMLS_DC);
int inifile_firstkey(inifile *dba TSRMLS_DC);
int inifile_nextkey(inifile *dba TSRMLS_DC);
int inifile_delete(inifile *dba, const key_type *key TSRMLS_DC);
+int inifile_delete_ex(inifile *dba, const key_type *key, zend_bool *found TSRMLS_DC);
int inifile_replace(inifile *dba, const key_type *key, const val_type *val TSRMLS_DC);
+int inifile_replace_ex(inifile *dba, const key_type *key, const val_type *val, zend_bool *found TSRMLS_DC);
int inifile_append(inifile *dba, const key_type *key, const val_type *val TSRMLS_DC);
char *inifile_version();
diff --git a/ext/dba/tests/bug62490.phpt b/ext/dba/tests/bug62490.phpt
new file mode 100644
index 0000000000..325dd34554
--- /dev/null
+++ b/ext/dba/tests/bug62490.phpt
@@ -0,0 +1,43 @@
+--TEST--
+Bug #62490 (dba_delete returns true on missing item (inifile))
+--SKIPIF--
+<?php
+$handler = "inifile";
+include "skipif.inc";
+?>
+--FILE--
+<?php
+$handler = "inifile";
+include "test.inc";
+
+$dba = dba_open($db_filename, "n", $handler)
+ or die;
+for ($i = 0; $i < 3; ++$i) {
+ echo "insert $i:";
+ var_dump(dba_insert("a", $i, $dba));
+}
+
+echo "exists:";
+var_dump(dba_exists("a", $dba));
+echo "delete:";
+var_dump(dba_delete("a", $dba));
+echo "exists:";
+var_dump(dba_exists("a", $dba));
+echo "delete:";
+var_dump(dba_delete("a", $dba));
+
+?>
+===DONE===
+--CLEAN--
+<?php
+include "clean.inc";
+?>
+--EXPECT--
+insert 0:bool(true)
+insert 1:bool(true)
+insert 2:bool(true)
+exists:bool(true)
+delete:bool(true)
+exists:bool(false)
+delete:bool(false)
+===DONE===
diff --git a/ext/dba/tests/dba_db4_003.phpt b/ext/dba/tests/dba_db4_003.phpt
index 7e8568c085..8708170fc1 100644
--- a/ext/dba/tests/dba_db4_003.phpt
+++ b/ext/dba/tests/dba_db4_003.phpt
@@ -39,8 +39,6 @@ require(dirname(__FILE__) .'/clean.inc');
database handler: db4
int(14)
-Notice: dba_open(): %stest0.dbm: unexpected file type or format in %sdba_db4_003.php on line %d
-
Warning: dba_open(%stest0.dbm,c): Driver initialization failed for handler: db4: Invalid argument in %sdba_db4_003.php on line %d
Error creating %stest0.dbm
Dummy contents
diff --git a/ext/dba/tests/dba_db4_007.phpt b/ext/dba/tests/dba_db4_007.phpt
index bd95e0bec7..027d0af032 100644
--- a/ext/dba/tests/dba_db4_007.phpt
+++ b/ext/dba/tests/dba_db4_007.phpt
@@ -35,7 +35,5 @@ require(dirname(__FILE__) .'/clean.inc');
database handler: db4
int(14)
-Notice: dba_popen(): %stest0.dbm: unexpected file type or format in %sdba_db4_007.php on line %d
-
Warning: dba_popen(%stest0.dbm,c): Driver initialization failed for handler: db4: Invalid argument in %sdba_db4_007.php on line %d
Error creating %stest0.dbm
diff --git a/ext/dba/tests/dba_db4_010.phpt b/ext/dba/tests/dba_db4_010.phpt
deleted file mode 100644
index fb31f05835..0000000000
--- a/ext/dba/tests/dba_db4_010.phpt
+++ /dev/null
@@ -1,38 +0,0 @@
---TEST--
-DBA DB4 magic_quotes_runtime Test
---SKIPIF--
-<?php
-$handler = "db4";
-require_once(dirname(__FILE__) .'/skipif.inc');
-die("info $HND handler used");
-?>
---FILE--
-<?php
-$handler = "db4";
-require_once(dirname(__FILE__) .'/test.inc');
-echo "database handler: $handler\n";
-if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
- ini_set('magic_quotes_runtime', 0);
- dba_insert("key1", '"', $db_file);
- var_dump(dba_fetch("key1", $db_file));
- ini_set('magic_quotes_runtime', 1);
- var_dump(dba_fetch("key1", $db_file));
- dba_replace("key1", '\"', $db_file);
- var_dump(dba_fetch("key1", $db_file));
- ini_set('magic_quotes_runtime', 0);
- var_dump(dba_fetch("key1", $db_file));
- dba_close($db_file);
-} else {
- echo "Error creating database\n";
-}
-?>
---CLEAN--
-<?php
-require(dirname(__FILE__) .'/clean.inc');
-?>
---EXPECTF--
-database handler: db4
-string(1) """
-string(2) "\""
-string(2) "\""
-string(1) """
diff --git a/ext/dba/tests/dba_handler.inc b/ext/dba/tests/dba_handler.inc
index a950e903af..ed2a52400a 100644
--- a/ext/dba/tests/dba_handler.inc
+++ b/ext/dba/tests/dba_handler.inc
@@ -82,7 +82,7 @@ do {
dba_close($dba_reader);
}
if (($db_file = dba_popen($db_filename, 'r'.($lock_flag==''?'':'-'), $handler))!==FALSE) {
- if ($handler == 'dbm') {
+ if ($handler == 'dbm' || $handler == "tcadb") {
dba_close($db_file);
}
}
diff --git a/ext/dba/tests/dba_inifile.phpt b/ext/dba/tests/dba_inifile.phpt
index 5975d25f4d..ae06aee09f 100644
--- a/ext/dba/tests/dba_inifile.phpt
+++ b/ext/dba/tests/dba_inifile.phpt
@@ -12,6 +12,10 @@ DBA INIFILE handler test
require_once dirname(__FILE__) .'/dba_handler.inc';
?>
===DONE===
+--CLEAN--
+<?php
+ require(dirname(__FILE__) .'/clean.inc');
+?>
--EXPECT--
database handler: inifile
3NYNYY
@@ -19,7 +23,7 @@ Content String 2
Content 2 replaced
Read during write: not allowed
"key number 6" written
-Failed to write "key number 6" 2nd time
+"key number 6" written 2nd time
Content 2 replaced 2nd time
The 6th value
array(3) {
@@ -36,7 +40,7 @@ Content String 2
Content 2 replaced
Read during write: not allowed
"key number 6" written
-Failed to write "key number 6" 2nd time
+"key number 6" written 2nd time
Content 2 replaced 2nd time
The 6th value
array(3) {
diff --git a/ext/dba/tests/dba_tcadb.phpt b/ext/dba/tests/dba_tcadb.phpt
index 28b6dd8f0b..f75aa813d4 100644
--- a/ext/dba/tests/dba_tcadb.phpt
+++ b/ext/dba/tests/dba_tcadb.phpt
@@ -16,6 +16,12 @@ DBA TCADB handler test
require_once dirname(__FILE__) .'/dba_handler.inc';
?>
===DONE===
+--CLEAN--
+<?php
+$db_filename = $db_file = dirname(__FILE__) .'/test0.tch';
+@unlink($db_filename);
+@unlink($db_filename.'.lck');
+?>
--EXPECT--
database handler: tcadb
3NYNYY
diff --git a/ext/dom/php_dom.c b/ext/dom/php_dom.c
index 0623dbdcde..bfe966bd82 100644
--- a/ext/dom/php_dom.c
+++ b/ext/dom/php_dom.c
@@ -448,7 +448,7 @@ static int dom_property_exists(zval *object, zval *member, int check_empty, cons
Z_SET_REFCOUNT_P(tmp, 1);
Z_UNSET_ISREF_P(tmp);
if (check_empty == 1) {
- retval = zend_is_true(tmp);
+ retval = zend_is_true(tmp TSRMLS_CC);
} else if (check_empty == 0) {
retval = (Z_TYPE_P(tmp) != IS_NULL);
}
diff --git a/ext/gd/libgd/gdft.c b/ext/gd/libgd/gdft.c
index f4ee639081..4979e1511f 100644
--- a/ext/gd/libgd/gdft.c
+++ b/ext/gd/libgd/gdft.c
@@ -1087,7 +1087,15 @@ gdImageStringFTEx (gdImage * im, int *brect, int fg, char *fontlist, double ptsi
}
/* transform glyph image */
- FT_Get_Glyph(slot, &image);
+ if (FT_Get_Glyph(slot, &image)) {
+ if (tmpstr) {
+ gdFree(tmpstr);
+ }
+ gdCacheDelete(tc_cache);
+ gdMutexUnlock(gdFontCacheMutex);
+ return "Problem loading glyph";
+ }
+
if (brect) { /* only if need brect */
FT_Glyph_Get_CBox(image, ft_glyph_bbox_gridfit, &glyph_bbox);
glyph_bbox.xMin += penf.x;
diff --git a/ext/interbase/interbase.c b/ext/interbase/interbase.c
index 8a88efccaa..19f061b17f 100644
--- a/ext/interbase/interbase.c
+++ b/ext/interbase/interbase.c
@@ -816,10 +816,6 @@ PHP_MINFO_FUNCTION(ibase)
snprintf( (s = tmp), sizeof(tmp), "Firebird API version %d", FB_API_VER);
#elif (SQLDA_CURRENT_VERSION > 1)
s = "Interbase 7.0 and up";
-#elif !defined(DSC_null)
- s = "Interbase 6";
-#else
- s = "Firebird 1.0";
#endif
php_info_print_table_row(2, "Compile-time Client Library Version", s);
@@ -838,8 +834,6 @@ PHP_MINFO_FUNCTION(ibase)
#endif
if (info_func) {
info_func(s = tmp);
- } else {
- s = "Firebird 1.0/Interbase 6";
}
php_info_print_table_row(2, "Run-time Client Library Version", s);
} while (0);
diff --git a/ext/json/json.c b/ext/json/json.c
index d4cb39f81d..71f8cc2d69 100644
--- a/ext/json/json.c
+++ b/ext/json/json.c
@@ -190,10 +190,10 @@ static int json_determine_array_type(zval **val TSRMLS_DC) /* {{{ */
}
if (i == HASH_KEY_IS_STRING) {
- return 1;
+ return PHP_JSON_OUTPUT_OBJECT;
} else {
if (index != idx) {
- return 1;
+ return PHP_JSON_OUTPUT_OBJECT;
}
}
idx++;
diff --git a/ext/mysqlnd/mysqlnd_net.c b/ext/mysqlnd/mysqlnd_net.c
index a0beed8b97..0d7b006456 100644
--- a/ext/mysqlnd/mysqlnd_net.c
+++ b/ext/mysqlnd/mysqlnd_net.c
@@ -905,7 +905,11 @@ MYSQLND_METHOD(mysqlnd_net, enable_ssl)(MYSQLND_NET * const net TSRMLS_DC)
ZVAL_STRING(&cipher_zval, net->data->options.ssl_cipher, 0);
php_stream_context_set_option(context, "ssl", "ciphers", &cipher_zval);
}
+#if PHP_API_VERSION >= 20131106
+ php_stream_context_set(net_stream, context TSRMLS_CC);
+#else
php_stream_context_set(net_stream, context);
+#endif
if (php_stream_xport_crypto_setup(net_stream, STREAM_CRYPTO_METHOD_TLS_CLIENT, NULL TSRMLS_CC) < 0 ||
php_stream_xport_crypto_enable(net_stream, 1 TSRMLS_CC) < 0)
{
@@ -921,7 +925,11 @@ MYSQLND_METHOD(mysqlnd_net, enable_ssl)(MYSQLND_NET * const net TSRMLS_DC)
of the context, which means usage of already freed memory, bad. Actually we don't need this
context anymore after we have enabled SSL on the connection. Thus it is very simple, we remove it.
*/
+#if PHP_API_VERSION >= 20131106
+ php_stream_context_set(net_stream, NULL TSRMLS_CC);
+#else
php_stream_context_set(net_stream, NULL);
+#endif
if (net->data->options.timeout_read) {
struct timeval tv;
diff --git a/ext/mysqlnd/mysqlnd_ps.c b/ext/mysqlnd/mysqlnd_ps.c
index bee8e1d0ee..539d1c8f83 100644
--- a/ext/mysqlnd/mysqlnd_ps.c
+++ b/ext/mysqlnd/mysqlnd_ps.c
@@ -38,6 +38,7 @@ const char * const mysqlnd_stmt_not_prepared = "Statement not prepared";
/* Exported by mysqlnd_ps_codec.c */
enum_func_status mysqlnd_stmt_execute_generate_request(MYSQLND_STMT * const s, zend_uchar ** request, size_t *request_len, zend_bool * free_buffer TSRMLS_DC);
+enum_func_status mysqlnd_stmt_execute_batch_generate_request(MYSQLND_STMT * const s, zend_uchar ** request, size_t *request_len, zend_bool * free_buffer TSRMLS_DC);
static void mysqlnd_stmt_separate_result_bind(MYSQLND_STMT * const stmt TSRMLS_DC);
static void mysqlnd_stmt_separate_one_result_bind(MYSQLND_STMT * const stmt, unsigned int param_no TSRMLS_DC);
diff --git a/ext/opcache/Optimizer/block_pass.c b/ext/opcache/Optimizer/block_pass.c
index fff5d7e101..a6114733e3 100644
--- a/ext/opcache/Optimizer/block_pass.c
+++ b/ext/opcache/Optimizer/block_pass.c
@@ -1466,7 +1466,12 @@ static void zend_jmp_optimization(zend_code_block *block, zend_op_array *op_arra
case ZEND_JMPNZ:
/* constant conditional JMPs */
if (ZEND_OP1_TYPE(last_op) == IS_CONST) {
+#if ZEND_EXTENSION_API_NO > PHP_5_6_X_API_NO
+ int should_jmp = zend_is_true(&ZEND_OP1_LITERAL(last_op) TSRMLS_CC);
+#else
int should_jmp = zend_is_true(&ZEND_OP1_LITERAL(last_op));
+#endif
+
if (last_op->opcode == ZEND_JMPZ) {
should_jmp = !should_jmp;
}
@@ -1609,7 +1614,12 @@ next_target:
case ZEND_JMPZ_EX:
/* constant conditional JMPs */
if (ZEND_OP1_TYPE(last_op) == IS_CONST) {
+#if ZEND_EXTENSION_API_NO > PHP_5_6_X_API_NO
+ int should_jmp = zend_is_true(&ZEND_OP1_LITERAL(last_op) TSRMLS_CC);
+#else
int should_jmp = zend_is_true(&ZEND_OP1_LITERAL(last_op));
+#endif
+
if (last_op->opcode == ZEND_JMPZ_EX) {
should_jmp = !should_jmp;
}
@@ -1730,7 +1740,11 @@ next_target_ex:
}
if (ZEND_OP1_TYPE(last_op) == IS_CONST) {
+#if ZEND_EXTENSION_API_NO > PHP_5_6_X_API_NO
+ if (!zend_is_true(&ZEND_OP1_LITERAL(last_op) TSRMLS_CC)) {
+#else
if (!zend_is_true(&ZEND_OP1_LITERAL(last_op))) {
+#endif
/* JMPZNZ(false,L1,L2) -> JMP(L1) */
zend_code_block *todel;
diff --git a/ext/opcache/Optimizer/pass2.c b/ext/opcache/Optimizer/pass2.c
index 30708a0935..d5f4f0492b 100644
--- a/ext/opcache/Optimizer/pass2.c
+++ b/ext/opcache/Optimizer/pass2.c
@@ -89,7 +89,11 @@ if (ZEND_OPTIMIZER_PASS_2 & OPTIMIZATION_LEVEL) {
/* convert Ti = JMPZ_EX(C, L) => Ti = QM_ASSIGN(C)
in case we know it wouldn't jump */
} else if (ZEND_OP1_TYPE(opline) == IS_CONST) {
+#if ZEND_EXTENSION_API_NO > PHP_5_6_X_API_NO
+ int should_jmp = zend_is_true(&ZEND_OP1_LITERAL(opline) TSRMLS_CC);
+#else
int should_jmp = zend_is_true(&ZEND_OP1_LITERAL(opline));
+#endif
if (opline->opcode == ZEND_JMPZ_EX) {
should_jmp = !should_jmp;
}
@@ -103,7 +107,11 @@ if (ZEND_OPTIMIZER_PASS_2 & OPTIMIZATION_LEVEL) {
case ZEND_JMPZ:
case ZEND_JMPNZ:
if (ZEND_OP1_TYPE(opline) == IS_CONST) {
+#if ZEND_EXTENSION_API_NO > PHP_5_6_X_API_NO
+ int should_jmp = zend_is_true(&ZEND_OP1_LITERAL(opline) TSRMLS_CC);
+#else
int should_jmp = zend_is_true(&ZEND_OP1_LITERAL(opline));
+#endif
if (opline->opcode == ZEND_JMPZ) {
should_jmp = !should_jmp;
@@ -139,8 +147,11 @@ if (ZEND_OPTIMIZER_PASS_2 & OPTIMIZATION_LEVEL) {
case ZEND_JMPZNZ:
if (ZEND_OP1_TYPE(opline) == IS_CONST) {
int opline_num;
-
+#if ZEND_EXTENSION_API_NO > PHP_5_6_X_API_NO
+ if (zend_is_true(&ZEND_OP1_LITERAL(opline) TSRMLS_CC)) {
+#else
if (zend_is_true(&ZEND_OP1_LITERAL(opline))) {
+#endif
opline_num = opline->extended_value; /* JMPNZ */
} else {
opline_num = ZEND_OP2(opline).opline_num; /* JMPZ */
diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c
index faa3641eb1..7c55de3752 100644
--- a/ext/opcache/ZendAccelerator.c
+++ b/ext/opcache/ZendAccelerator.c
@@ -2553,7 +2553,11 @@ static int accel_startup(zend_extension *extension)
_setmaxstdio(2048); /* The default configuration is limited to 512 stdio files */
#endif
+#if ZEND_EXTENSION_API_NO > PHP_5_6_X_API_NO
+ if (start_accel_module(TSRMLS_C) == FAILURE) {
+#else
if (start_accel_module() == FAILURE) {
+#endif
accel_startup_ok = 0;
zend_error(E_WARNING, ACCELERATOR_PRODUCT_NAME ": module registration failed!");
return FAILURE;
diff --git a/ext/opcache/zend_accelerator_module.c b/ext/opcache/zend_accelerator_module.c
index 1620c05621..f4dd9fbb85 100644
--- a/ext/opcache/zend_accelerator_module.c
+++ b/ext/opcache/zend_accelerator_module.c
@@ -488,10 +488,17 @@ static zend_module_entry accel_module_entry = {
STANDARD_MODULE_PROPERTIES
};
+#if ZEND_EXTENSION_API_NO > PHP_5_6_X_API_NO
+int start_accel_module(TSRMLS_D)
+{
+ return zend_startup_module(&accel_module_entry TSRMLS_CC);
+}
+#else
int start_accel_module(void)
{
return zend_startup_module(&accel_module_entry);
}
+#endif
/* {{{ proto array accelerator_get_scripts()
Get the scripts which are accelerated by ZendAccelerator */
diff --git a/ext/opcache/zend_accelerator_module.h b/ext/opcache/zend_accelerator_module.h
index ece4a7d6b5..6e772b8c7e 100644
--- a/ext/opcache/zend_accelerator_module.h
+++ b/ext/opcache/zend_accelerator_module.h
@@ -22,7 +22,12 @@
#ifndef ZEND_ACCELERATOR_MODULE_H
#define ZEND_ACCELERATOR_MODULE_H
+#if ZEND_EXTENSION_API_NO > PHP_5_6_X_API_NO
+int start_accel_module(TSRMLS_D);
+#else
int start_accel_module(void);
+#endif
+
void zend_accel_override_file_functions(TSRMLS_D);
#endif /* _ZEND_ACCELERATOR_MODULE_H */
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index 0d9b9564d8..118dcd99c2 100755
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@ -5003,8 +5003,6 @@ PHP_FUNCTION(openssl_open)
}
/* }}} */
-
-
static void openssl_add_method_or_alias(const OBJ_NAME *name, void *arg) /* {{{ */
{
add_next_index_string((zval*)arg, (char*)name->name, 1);
diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c
index 03a84bf363..0b4e3d5c21 100644
--- a/ext/openssl/xp_ssl.c
+++ b/ext/openssl/xp_ssl.c
@@ -236,6 +236,8 @@ static int verify_callback(int preverify_ok, X509_STORE_CTX *ctx) /* {{{ */
zval **val;
unsigned long allowed_depth = OPENSSL_DEFAULT_STREAM_VERIFY_DEPTH;
+ TSRMLS_FETCH();
+
ret = preverify_ok;
/* determine the status for the current cert */
@@ -249,7 +251,7 @@ static int verify_callback(int preverify_ok, X509_STORE_CTX *ctx) /* {{{ */
/* if allow_self_signed is set, make sure that verification succeeds */
if (err == X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT &&
GET_VER_OPT("allow_self_signed") &&
- zend_is_true(*val)
+ zend_is_true(*val TSRMLS_CC)
) {
ret = 1;
}
@@ -372,15 +374,15 @@ static int apply_peer_verification_policy(SSL *ssl, X509 *peer, php_stream *stre
php_openssl_netstream_data_t *sslsock = (php_openssl_netstream_data_t*)stream->abstract;
must_verify_peer = GET_VER_OPT("verify_peer")
- ? zend_is_true(*val)
+ ? zend_is_true(*val TSRMLS_CC)
: sslsock->is_client;
has_cnmatch_ctx_opt = GET_VER_OPT("CN_match");
must_verify_peer_name = (has_cnmatch_ctx_opt || GET_VER_OPT("verify_peer_name"))
- ? zend_is_true(*val)
+ ? zend_is_true(*val TSRMLS_CC)
: sslsock->is_client;
- must_verify_fingerprint = (GET_VER_OPT("peer_fingerprint") && zend_is_true(*val));
+ must_verify_fingerprint = (GET_VER_OPT("peer_fingerprint") && zend_is_true(*val TSRMLS_CC));
if ((must_verify_peer || must_verify_peer_name || must_verify_fingerprint) && peer == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not get peer certificate");
@@ -395,7 +397,7 @@ static int apply_peer_verification_policy(SSL *ssl, X509 *peer, php_stream *stre
/* fine */
break;
case X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT:
- if (GET_VER_OPT("allow_self_signed") && zend_is_true(*val)) {
+ if (GET_VER_OPT("allow_self_signed") && zend_is_true(*val TSRMLS_CC)) {
/* allowed */
break;
}
@@ -628,7 +630,7 @@ static int win_cert_verify_callback(X509_STORE_CTX *x509_store_ctx, void *arg) /
if (chain_policy_status.dwError != 0) {
/* The chain does not match the policy */
if (is_self_signed && chain_policy_status.dwError == CERT_E_UNTRUSTEDROOT
- && GET_VER_OPT("allow_self_signed") && zend_is_true(*val)) {
+ && GET_VER_OPT("allow_self_signed") && zend_is_true(*val TSRMLS_CC)) {
/* allow self-signed certs */
X509_STORE_CTX_set_error(x509_store_ctx, X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT);
} else {
@@ -1152,14 +1154,14 @@ static int set_server_specific_opts(php_stream *stream, SSL_CTX *ctx TSRMLS_DC)
if (SUCCESS == php_stream_context_get_option(
stream->context, "ssl", "honor_cipher_order", &val) &&
- zend_is_true(*val)
+ zend_is_true(*val TSRMLS_CC)
) {
ssl_ctx_options |= SSL_OP_CIPHER_SERVER_PREFERENCE;
}
if (SUCCESS == php_stream_context_get_option(
stream->context, "ssl", "single_dh_use", &val) &&
- zend_is_true(*val)
+ zend_is_true(*val TSRMLS_CC)
) {
ssl_ctx_options |= SSL_OP_SINGLE_DH_USE;
}
@@ -1167,7 +1169,7 @@ static int set_server_specific_opts(php_stream *stream, SSL_CTX *ctx TSRMLS_DC)
#ifdef HAVE_ECDH
if (SUCCESS == php_stream_context_get_option(
stream->context, "ssl", "single_ecdh_use", &val) &&
- zend_is_true(*val)
+ zend_is_true(*val TSRMLS_CC)
) {
ssl_ctx_options |= SSL_OP_SINGLE_ECDH_USE;
}
@@ -1225,7 +1227,7 @@ static int enable_server_sni(php_stream *stream, php_openssl_netstream_data_t *s
SSL_CTX *ctx;
/* If the stream ctx disables SNI we're finished here */
- if (GET_VER_OPT("SNI_enabled") && !zend_is_true(*val)) {
+ if (GET_VER_OPT("SNI_enabled") && !zend_is_true(*val TSRMLS_CC)) {
return SUCCESS;
}
@@ -1305,13 +1307,13 @@ static int enable_server_sni(php_stream *stream, php_openssl_netstream_data_t *s
return SUCCESS;
}
-static void enable_client_sni(php_stream *stream, php_openssl_netstream_data_t *sslsock) /* {{{ */
+static void enable_client_sni(php_stream *stream, php_openssl_netstream_data_t *sslsock TSRMLS_DC) /* {{{ */
{
zval **val;
char *sni_server_name;
/* If SNI is explicitly disabled we're finished here */
- if (GET_VER_OPT("SNI_enabled") && !zend_is_true(*val)) {
+ if (GET_VER_OPT("SNI_enabled") && !zend_is_true(*val TSRMLS_CC)) {
return;
}
@@ -1386,7 +1388,7 @@ int php_openssl_setup_crypto(php_stream *stream,
}
#if OPENSSL_VERSION_NUMBER >= 0x0090806fL
- if (GET_VER_OPT("no_ticket") && zend_is_true(*val)) {
+ if (GET_VER_OPT("no_ticket") && zend_is_true(*val TSRMLS_CC)) {
ssl_ctx_options |= SSL_OP_NO_TICKET;
}
#endif
@@ -1396,12 +1398,12 @@ int php_openssl_setup_crypto(php_stream *stream,
#endif
#if OPENSSL_VERSION_NUMBER >= 0x10000000L
- if (!GET_VER_OPT("disable_compression") || zend_is_true(*val)) {
+ if (!GET_VER_OPT("disable_compression") || zend_is_true(*val TSRMLS_CC)) {
ssl_ctx_options |= SSL_OP_NO_COMPRESSION;
}
#endif
- if (GET_VER_OPT("verify_peer") && !zend_is_true(*val)) {
+ if (GET_VER_OPT("verify_peer") && !zend_is_true(*val TSRMLS_CC)) {
disable_peer_verification(sslsock->ctx, stream TSRMLS_CC);
} else if (FAILURE == enable_peer_verification(sslsock->ctx, stream TSRMLS_CC)) {
return FAILURE;
@@ -1517,7 +1519,7 @@ static int capture_peer_certs(php_stream *stream, php_openssl_netstream_data_t *
if (SUCCESS == php_stream_context_get_option(stream->context,
"ssl", "capture_peer_cert", &val) &&
- zend_is_true(*val)
+ zend_is_true(*val TSRMLS_CC)
) {
MAKE_STD_ZVAL(zcert);
ZVAL_RESOURCE(zcert, zend_list_insert(peer_cert, php_openssl_get_x509_list_id() TSRMLS_CC));
@@ -1528,7 +1530,7 @@ static int capture_peer_certs(php_stream *stream, php_openssl_netstream_data_t *
if (SUCCESS == php_stream_context_get_option(stream->context,
"ssl", "capture_peer_cert_chain", &val) &&
- zend_is_true(*val)
+ zend_is_true(*val TSRMLS_CC)
) {
zval *arr;
STACK_OF(X509) *chain;
@@ -1578,7 +1580,7 @@ static int php_openssl_enable_crypto(php_stream *stream,
#ifdef HAVE_SNI
if (sslsock->is_client) {
- enable_client_sni(stream, sslsock);
+ enable_client_sni(stream, sslsock TSRMLS_CC);
}
#endif
@@ -1675,7 +1677,7 @@ static int php_openssl_enable_crypto(php_stream *stream,
if (SUCCESS == php_stream_context_get_option(stream->context,
"ssl", "capture_session_meta", &val) &&
- zend_is_true(*val)
+ zend_is_true(*val TSRMLS_CC)
) {
zval *meta_arr = capture_session_meta(sslsock->ssl_handle);
php_stream_context_set_option(stream->context, "ssl", "session_meta", meta_arr);
diff --git a/ext/pcntl/pcntl.c b/ext/pcntl/pcntl.c
index b7ef4c729c..4c7f1784aa 100644
--- a/ext/pcntl/pcntl.c
+++ b/ext/pcntl/pcntl.c
@@ -499,7 +499,7 @@ PHP_MINIT_FUNCTION(pcntl)
{
php_register_signal_constants(INIT_FUNC_ARGS_PASSTHRU);
php_pcntl_register_errno_constants(INIT_FUNC_ARGS_PASSTHRU);
- php_add_tick_function(pcntl_signal_dispatch);
+ php_add_tick_function(pcntl_signal_dispatch TSRMLS_CC);
return SUCCESS;
}
diff --git a/ext/session/mod_user.c b/ext/session/mod_user.c
index 5573d4cdfd..1eabc9432e 100644
--- a/ext/session/mod_user.c
+++ b/ext/session/mod_user.c
@@ -68,12 +68,25 @@ static zval *ps_call_handler(zval *func, int argc, zval **argv TSRMLS_DC)
#define PSF(a) PS(mod_user_names).name.ps_##a
-#define FINISH \
- if (retval) { \
- convert_to_long(retval); \
- ret = Z_LVAL_P(retval); \
- zval_ptr_dtor(&retval); \
- } \
+#define FINISH \
+ if (retval) { \
+ if (Z_TYPE_P(retval) == IS_BOOL) { \
+ ret = Z_BVAL_P(retval) ? SUCCESS : FAILURE; \
+ } else if ((Z_TYPE_P(retval) == IS_LONG) && (Z_LVAL_P(retval) == -1)) { \
+ /* BC for clever users - Deprecate me */ \
+ ret = FAILURE; \
+ } else if ((Z_TYPE_P(retval) == IS_LONG) && (Z_LVAL_P(retval) == 0)) { \
+ /* BC for clever users - Deprecate me */ \
+ ret = SUCCESS; \
+ } else { \
+ if (!EG(exception)) { \
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, \
+ "Session callback expects true/false return value"); \
+ } \
+ ret = FAILURE; \
+ } \
+ zval_ptr_dtor(&retval); \
+ } \
return ret
PS_OPEN_FUNC(user)
diff --git a/ext/session/session.c b/ext/session/session.c
index 6412043673..b24e6365f1 100644
--- a/ext/session/session.c
+++ b/ext/session/session.c
@@ -51,6 +51,7 @@
#include "ext/standard/php_smart_str.h"
#include "ext/standard/url.h"
#include "ext/standard/basic_functions.h"
+#include "ext/standard/head.h"
#include "mod_files.h"
#include "mod_user.h"
@@ -565,7 +566,7 @@ static void php_session_save_current_state(TSRMLS_D) /* {{{ */
}
}
- if (ret == FAILURE) {
+ if ((ret == FAILURE) && !EG(exception)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to write session data (%s). Please "
"verify that the current setting of session.save_path "
"is correct (%s)",
@@ -1289,14 +1290,6 @@ static int php_session_cache_limiter(TSRMLS_D) /* {{{ */
* Cookie Management *
********************* */
-#define COOKIE_SET_COOKIE "Set-Cookie: "
-#define COOKIE_EXPIRES "; expires="
-#define COOKIE_MAX_AGE "; Max-Age="
-#define COOKIE_PATH "; path="
-#define COOKIE_DOMAIN "; domain="
-#define COOKIE_SECURE "; secure"
-#define COOKIE_HTTPONLY "; HttpOnly"
-
/*
* Remove already sent session ID cookie.
* It must be directly removed from SG(sapi_header) because sapi_add_header_ex()
@@ -1362,7 +1355,7 @@ static void php_session_send_cookie(TSRMLS_D) /* {{{ */
e_session_name = php_url_encode(PS(session_name), strlen(PS(session_name)), NULL);
e_id = php_url_encode(PS(id), strlen(PS(id)), NULL);
- smart_str_appends(&ncookie, COOKIE_SET_COOKIE);
+ smart_str_appends(&ncookie, "Set-Cookie: ");
smart_str_appends(&ncookie, e_session_name);
smart_str_appendc(&ncookie, '=');
smart_str_appends(&ncookie, e_id);
@@ -1607,7 +1600,7 @@ PHPAPI void php_session_start(TSRMLS_D) /* {{{ */
}
}
- /* Finally check session id for dangarous characters
+ /* Finally check session id for dangerous characters
* Security note: session id may be embedded in HTML pages.*/
if (PS(id) && strpbrk(PS(id), "\r\n\t <>'\"\\")) {
efree(PS(id));
diff --git a/ext/session/tests/031.phpt b/ext/session/tests/031.phpt
index 7486c4b866..ba50247891 100644
--- a/ext/session/tests/031.phpt
+++ b/ext/session/tests/031.phpt
@@ -1,8 +1,13 @@
--TEST--
setting hash_function to sha512 and hash_bits_per_character > 4 should not crash
--SKIPIF--
-<?php include('skipif.inc'); ?>
-<?php if (!extension_loaded('hash')) die('skip hash extension not available'); ?>
+<?php
+include('skipif.inc');
+
+if (!function_exists("hash")) {
+ echo "skip hash extension not loaded";
+}
+?>
--INI--
session.use_cookies=0
session.cache_limiter=
diff --git a/ext/session/tests/bug60634_error_1.phpt b/ext/session/tests/bug60634_error_1.phpt
index e41592f18d..cc50e81209 100644
--- a/ext/session/tests/bug60634_error_1.phpt
+++ b/ext/session/tests/bug60634_error_1.phpt
@@ -16,6 +16,7 @@ function open($save_path, $session_name) {
function close() {
echo "close: goodbye cruel world\n";
+ return true;
}
function read($id) {
diff --git a/ext/session/tests/bug60634_error_2.phpt b/ext/session/tests/bug60634_error_2.phpt
index 7c50948ba8..96c8eb61e5 100644
--- a/ext/session/tests/bug60634_error_2.phpt
+++ b/ext/session/tests/bug60634_error_2.phpt
@@ -16,6 +16,7 @@ function open($save_path, $session_name) {
function close() {
echo "close: goodbye cruel world\n";
+ return true;
}
function read($id) {
diff --git a/ext/session/tests/save_handler.inc b/ext/session/tests/save_handler.inc
index ebe9cac564..d271748259 100644
--- a/ext/session/tests/save_handler.inc
+++ b/ext/session/tests/save_handler.inc
@@ -31,7 +31,7 @@ function write($id, $session_data) {
if ($fp = fopen($session_file, "w")) {
$return = fwrite($fp, $session_data);
fclose($fp);
- return $return;
+ return (bool)$return;
}
return false;
}
@@ -40,7 +40,8 @@ function destroy($id) {
global $session_save_path, $name;
echo "Destroy [${session_save_path},${id}]\n";
$session_file = "$session_save_path/".SESSION_FILE_PREFIX.$id;
- return unlink($session_file);
+ unlink($session_file);
+ return true;
}
function gc($maxlifetime) {
diff --git a/ext/session/tests/session_module_name_variation3.phpt b/ext/session/tests/session_module_name_variation3.phpt
index dc1c6ba5ec..e32790d54e 100644
--- a/ext/session/tests/session_module_name_variation3.phpt
+++ b/ext/session/tests/session_module_name_variation3.phpt
@@ -21,11 +21,11 @@ function open($save_path, $session_name) {
throw new Exception("Stop...!");
}
-function close() { }
-function read($id) { }
-function write($id, $session_data) { }
-function destroy($id) { }
-function gc($maxlifetime) { }
+function close() { return true; }
+function read($id) { return ''; }
+function write($id, $session_data) { return true; }
+function destroy($id) { return true; }
+function gc($maxlifetime) { return true; }
var_dump(session_module_name("files"));
session_set_save_handler("open", "close", "read", "write", "destroy", "gc");
@@ -41,9 +41,11 @@ ob_end_flush();
string(%d) "%s"
string(4) "user"
-Fatal error: Uncaught exception 'Exception' with message 'Stop...!' in %s:%d
+Warning: Uncaught exception 'Exception' with message 'Stop...!' in %s:%d
Stack trace:
#0 [internal function]: open('', 'PHPSESSID')
#1 %s(%d): session_start()
#2 {main}
thrown in %s on line %d
+
+Fatal error: session_start(): Failed to initialize storage module: %s in %s/session_module_name_variation3.php on line %d
diff --git a/ext/session/tests/session_set_save_handler_class_002.phpt b/ext/session/tests/session_set_save_handler_class_002.phpt
index 6fb831f695..b75a7e6390 100644
--- a/ext/session/tests/session_set_save_handler_class_002.phpt
+++ b/ext/session/tests/session_set_save_handler_class_002.phpt
@@ -38,11 +38,12 @@ class MySession2 extends SessionHandler {
}
public function write($id, $data) {
- return file_put_contents($this->path . $id, $data);
+ return (bool)file_put_contents($this->path . $id, $data);
}
public function destroy($id) {
@unlink($this->path . $id);
+ return true;
}
public function gc($maxlifetime) {
diff --git a/ext/session/tests/session_set_save_handler_class_005.phpt b/ext/session/tests/session_set_save_handler_class_005.phpt
index c74c81de1d..5be735306a 100644
--- a/ext/session/tests/session_set_save_handler_class_005.phpt
+++ b/ext/session/tests/session_set_save_handler_class_005.phpt
@@ -52,4 +52,6 @@ array(0) {
Warning: SessionHandler::write(): Parent session handler is not open in %ssession_set_save_handler_class_005.php on line %d
+Warning: session_write_close(): Failed to write session data %s in %ssession_set_save_handler_class_005.php on line %d
+
Warning: SessionHandler::close(): Parent session handler is not open in %ssession_set_save_handler_class_005.php on line %d
diff --git a/ext/session/tests/session_set_save_handler_class_012.phpt b/ext/session/tests/session_set_save_handler_class_012.phpt
index 3899d28816..60cd12955c 100644
--- a/ext/session/tests/session_set_save_handler_class_012.phpt
+++ b/ext/session/tests/session_set_save_handler_class_012.phpt
@@ -24,7 +24,9 @@ class MySession extends SessionHandler {
public function open($path, $name) {
++$this->i;
echo 'Open ', session_id(), "\n";
- return parent::open();
+ // This test was written for broken return value handling
+ // Mimmick what was actually being tested by returning true here
+ return (null === parent::open());
}
public function read($key) {
++$this->i;
@@ -57,4 +59,6 @@ array(0) {
Warning: Unknown: Parent session handler is not open in Unknown on line 0
+Warning: Unknown: Failed to write session data %s in %s on line %d
+
Warning: Unknown: Parent session handler is not open in Unknown on line 0
diff --git a/ext/session/tests/session_set_save_handler_class_016.phpt b/ext/session/tests/session_set_save_handler_class_016.phpt
index 2de03c0682..521bd86f31 100644
--- a/ext/session/tests/session_set_save_handler_class_016.phpt
+++ b/ext/session/tests/session_set_save_handler_class_016.phpt
@@ -38,7 +38,7 @@ class MySession2 extends SessionHandler {
}
public function write($id, $data) {
- return file_put_contents($this->path . $id, $data);
+ return (bool)file_put_contents($this->path . $id, $data);
}
public function destroy($id) {
diff --git a/ext/session/tests/session_set_save_handler_class_017.phpt b/ext/session/tests/session_set_save_handler_class_017.phpt
index 756dc55d03..6f42d7809a 100644
--- a/ext/session/tests/session_set_save_handler_class_017.phpt
+++ b/ext/session/tests/session_set_save_handler_class_017.phpt
@@ -38,7 +38,7 @@ class MySession2 extends SessionHandler {
}
public function write($id, $data) {
- return file_put_contents($this->path . $id, $data);
+ return (bool)file_put_contents($this->path . $id, $data);
}
public function destroy($id) {
diff --git a/ext/session/tests/session_set_save_handler_error3.phpt b/ext/session/tests/session_set_save_handler_error3.phpt
index cb07b0d8de..859ba11ad5 100644
--- a/ext/session/tests/session_set_save_handler_error3.phpt
+++ b/ext/session/tests/session_set_save_handler_error3.phpt
@@ -34,9 +34,11 @@ ob_end_flush();
--EXPECTF--
*** Testing session_set_save_handler() : error functionality ***
-Fatal error: Uncaught exception 'Exception' with message 'Do something bad..!' in %s:%d
+Warning: Uncaught exception 'Exception' with message 'Do something bad..!' in %s:%d
Stack trace:
#0 [internal function]: open('', 'PHPSESSID')
#1 %s(%d): session_start()
#2 {main}
thrown in %s on line %d
+
+Fatal error: session_start(): Failed to initialize storage module: %s in %ssession_set_save_handler_error3.php on line %d
diff --git a/ext/session/tests/session_set_save_handler_error4.phpt b/ext/session/tests/session_set_save_handler_error4.phpt
index d286f07d99..be3429b084 100644
--- a/ext/session/tests/session_set_save_handler_error4.phpt
+++ b/ext/session/tests/session_set_save_handler_error4.phpt
@@ -15,7 +15,7 @@ ob_start();
echo "*** Testing session_set_save_handler() : error functionality ***\n";
-function callback() { }
+function callback() { return true; }
session_set_save_handler("callback", "callback", "callback", "callback", "callback", "callback");
session_set_save_handler("callback", "echo", "callback", "callback", "callback", "callback");
diff --git a/ext/session/tests/session_set_save_handler_iface_001.phpt b/ext/session/tests/session_set_save_handler_iface_001.phpt
index 39a4b9975b..03ee42865c 100644
--- a/ext/session/tests/session_set_save_handler_iface_001.phpt
+++ b/ext/session/tests/session_set_save_handler_iface_001.phpt
@@ -38,7 +38,7 @@ class MySession2 implements SessionHandlerInterface {
}
public function write($id, $data) {
- return file_put_contents($this->path . $id, $data);
+ return (bool)file_put_contents($this->path . $id, $data);
}
public function destroy($id) {
diff --git a/ext/session/tests/session_set_save_handler_variation4.phpt b/ext/session/tests/session_set_save_handler_variation4.phpt
index 3485f2373a..c34eb9cd9f 100644
--- a/ext/session/tests/session_set_save_handler_variation4.phpt
+++ b/ext/session/tests/session_set_save_handler_variation4.phpt
@@ -24,6 +24,7 @@ echo "*** Testing session_set_save_handler() : variation ***\n";
function noisy_gc($maxlifetime) {
echo("GC [".$maxlifetime."]\n");
gc($maxlifetime);
+ return true;
}
require_once "save_handler.inc";
diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c
index b225a2d670..720f212475 100644
--- a/ext/soap/php_encoding.c
+++ b/ext/soap/php_encoding.c
@@ -1187,7 +1187,7 @@ static xmlNodePtr to_xml_bool(encodeTypePtr type, zval *data, int style, xmlNode
xmlAddChild(parent, ret);
FIND_ZVAL_NULL(data, ret, style);
- if (zend_is_true(data)) {
+ if (zend_is_true(data TSRMLS_CC)) {
xmlNodeSetContent(ret, BAD_CAST("true"));
} else {
xmlNodeSetContent(ret, BAD_CAST("false"));
diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c
index 9c49d91ca2..c631c187c9 100644
--- a/ext/spl/spl_array.c
+++ b/ext/spl/spl_array.c
@@ -601,7 +601,7 @@ static int spl_array_has_dimension_ex(int check_inherited, zval *object, zval *o
zend_call_method_with_1_params(&object, Z_OBJCE_P(object), &intern->fptr_offset_has, "offsetExists", &rv, offset_tmp);
zval_ptr_dtor(&offset_tmp);
- if (rv && zend_is_true(rv)) {
+ if (rv && zend_is_true(rv TSRMLS_CC)) {
zval_ptr_dtor(&rv);
if (check_empty != 1) {
return 1;
@@ -660,7 +660,7 @@ static int spl_array_has_dimension_ex(int check_inherited, zval *object, zval *o
}
}
- return check_empty ? zend_is_true(value) : Z_TYPE_P(value) != IS_NULL;
+ return check_empty ? zend_is_true(value TSRMLS_CC) : Z_TYPE_P(value) != IS_NULL;
} /* }}} */
static int spl_array_has_dimension(zval *object, zval *offset, int check_empty TSRMLS_DC) /* {{{ */
diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c
index 4159d1ae34..0d5cccf0c9 100644
--- a/ext/spl/spl_directory.c
+++ b/ext/spl/spl_directory.c
@@ -837,7 +837,7 @@ SPL_METHOD(DirectoryIterator, seek)
int valid = 0;
zend_call_method_with_0_params(&this_ptr, Z_OBJCE_P(getThis()), &intern->u.dir.func_valid, "valid", &retval);
if (retval) {
- valid = zend_is_true(retval);
+ valid = zend_is_true(retval TSRMLS_CC);
zval_ptr_dtor(&retval);
retval = NULL;
}
@@ -1499,7 +1499,7 @@ SPL_METHOD(RecursiveDirectoryIterator, hasChildren)
spl_filesystem_object_get_file_name(intern TSRMLS_CC);
if (!allow_links && !(intern->flags & SPL_FILE_DIR_FOLLOW_SYMLINKS)) {
php_stat(intern->file_name, intern->file_name_len, FS_IS_LINK, return_value TSRMLS_CC);
- if (zend_is_true(return_value)) {
+ if (zend_is_true(return_value TSRMLS_CC)) {
RETURN_FALSE;
}
}
diff --git a/ext/spl/spl_fixedarray.c b/ext/spl/spl_fixedarray.c
index 2ad50359f2..2c5d5f626c 100644
--- a/ext/spl/spl_fixedarray.c
+++ b/ext/spl/spl_fixedarray.c
@@ -511,7 +511,7 @@ static inline int spl_fixedarray_object_has_dimension_helper(spl_fixedarray_obje
if (!intern->array->elements[index]) {
retval = 0;
} else if (check_empty) {
- if (zend_is_true(intern->array->elements[index])) {
+ if (zend_is_true(intern->array->elements[index] TSRMLS_CC)) {
retval = 1;
} else {
retval = 0;
@@ -540,7 +540,7 @@ static int spl_fixedarray_object_has_dimension(zval *object, zval *offset, int c
zval_ptr_dtor(&intern->retval);
MAKE_STD_ZVAL(intern->retval);
ZVAL_ZVAL(intern->retval, rv, 1, 1);
- return zend_is_true(intern->retval);
+ return zend_is_true(intern->retval TSRMLS_CC);
}
return 0;
}
diff --git a/ext/spl/spl_iterators.c b/ext/spl/spl_iterators.c
index cade34efd4..b9901f8f27 100644
--- a/ext/spl/spl_iterators.c
+++ b/ext/spl/spl_iterators.c
@@ -249,7 +249,7 @@ next_step:
}
}
if (retval) {
- has_children = zend_is_true(retval);
+ has_children = zend_is_true(retval TSRMLS_CC);
zval_ptr_dtor(&retval);
if (has_children) {
if (object->max_depth == -1 || object->max_depth > object->level) {
@@ -1776,7 +1776,7 @@ static inline void spl_filter_it_fetch(zval *zthis, spl_dual_it_object *intern T
while (spl_dual_it_fetch(intern, 1 TSRMLS_CC) == SUCCESS) {
zend_call_method_with_0_params(&zthis, intern->std.ce, NULL, "accept", &retval);
if (retval) {
- if (zend_is_true(retval)) {
+ if (zend_is_true(retval TSRMLS_CC)) {
zval_ptr_dtor(&retval);
return;
}
@@ -2600,7 +2600,7 @@ static inline void spl_caching_it_next(spl_dual_it_object *intern TSRMLS_DC)
return;
}
} else {
- if (zend_is_true(retval)) {
+ if (zend_is_true(retval TSRMLS_CC)) {
zend_call_method_with_0_params(&intern->inner.zobject, intern->inner.ce, NULL, "getchildren", &zchildren);
if (EG(exception)) {
if (zchildren) {
@@ -3575,7 +3575,7 @@ static int spl_iterator_func_apply(zend_object_iterator *iter, void *puser TSRML
apply_info->count++;
zend_fcall_info_call(&apply_info->fci, &apply_info->fcc, &retval, NULL TSRMLS_CC);
if (retval) {
- result = zend_is_true(retval) ? ZEND_HASH_APPLY_KEEP : ZEND_HASH_APPLY_STOP;
+ result = zend_is_true(retval TSRMLS_CC) ? ZEND_HASH_APPLY_KEEP : ZEND_HASH_APPLY_STOP;
zval_ptr_dtor(&retval);
} else {
result = ZEND_HASH_APPLY_STOP;
diff --git a/ext/standard/array.c b/ext/standard/array.c
index cbcaaf5b8b..54e8951f23 100644
--- a/ext/standard/array.c
+++ b/ext/standard/array.c
@@ -4134,7 +4134,7 @@ PHP_FUNCTION(array_filter)
fci.params = args;
if (zend_call_function(&fci, &fci_cache TSRMLS_CC) == SUCCESS && retval) {
- int retval_true = zend_is_true(retval);
+ int retval_true = zend_is_true(retval TSRMLS_CC);
zval_ptr_dtor(&retval);
if (use_type) {
@@ -4147,7 +4147,7 @@ PHP_FUNCTION(array_filter)
php_error_docref(NULL TSRMLS_CC, E_WARNING, "An error occurred while invoking the filter callback");
return;
}
- } else if (!zend_is_true(*operand)) {
+ } else if (!zend_is_true(*operand TSRMLS_CC)) {
continue;
}
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c
index 62ac0d1c6d..5ca7ec0ffe 100644
--- a/ext/standard/basic_functions.c
+++ b/ext/standard/basic_functions.c
@@ -702,18 +702,6 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_call_user_func_array, 0, 0, 2)
ZEND_ARG_INFO(0, parameters) /* ARRAY_INFO(0, parameters, 1) */
ZEND_END_ARG_INFO()
-ZEND_BEGIN_ARG_INFO_EX(arginfo_call_user_method, 0, 0, 2)
- ZEND_ARG_INFO(0, method_name)
- ZEND_ARG_INFO(1, object)
- ZEND_ARG_VARIADIC_INFO(0, parameters)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO(arginfo_call_user_method_array, 0)
- ZEND_ARG_INFO(0, method_name)
- ZEND_ARG_INFO(1, object)
- ZEND_ARG_INFO(0, params) /* ARRAY_INFO(0, params, 1) */
-ZEND_END_ARG_INFO()
-
ZEND_BEGIN_ARG_INFO_EX(arginfo_forward_static_call, 0, 0, 1)
ZEND_ARG_INFO(0, function_name)
ZEND_ARG_VARIADIC_INFO(0, parameters)
@@ -2955,8 +2943,6 @@ const zend_function_entry basic_functions[] = { /* {{{ */
PHP_FE(error_get_last, arginfo_error_get_last)
PHP_FE(call_user_func, arginfo_call_user_func)
PHP_FE(call_user_func_array, arginfo_call_user_func_array)
- PHP_DEP_FE(call_user_method, arginfo_call_user_method)
- PHP_DEP_FE(call_user_method_array, arginfo_call_user_method_array)
PHP_FE(forward_static_call, arginfo_forward_static_call)
PHP_FE(forward_static_call_array, arginfo_forward_static_call_array)
PHP_FE(serialize, arginfo_serialize)
@@ -4780,89 +4766,6 @@ PHP_FUNCTION(call_user_func_array)
}
/* }}} */
-/* {{{ proto mixed call_user_method(string method_name, mixed object [, mixed parameter] [, mixed ...])
- Call a user method on a specific object or class */
-PHP_FUNCTION(call_user_method)
-{
- zval ***params = NULL;
- int n_params = 0;
- zval *retval_ptr;
- zval *callback, *object;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/z*", &callback, &object, &params, &n_params) == FAILURE) {
- return;
- }
-
- if (Z_TYPE_P(object) != IS_OBJECT &&
- Z_TYPE_P(object) != IS_STRING
- ) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Second argument is not an object or class name");
- if (params) {
- efree(params);
- }
- RETURN_FALSE;
- }
-
- convert_to_string(callback);
-
- if (call_user_function_ex(EG(function_table), &object, callback, &retval_ptr, n_params, params, 0, NULL TSRMLS_CC) == SUCCESS) {
- if (retval_ptr) {
- COPY_PZVAL_TO_ZVAL(*return_value, retval_ptr);
- }
- } else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call %s()", Z_STRVAL_P(callback));
- }
- if (n_params) {
- efree(params);
- }
-}
-/* }}} */
-
-/* {{{ proto mixed call_user_method_array(string method_name, mixed object, array params)
- Call a user method on a specific object or class using a parameter array */
-PHP_FUNCTION(call_user_method_array)
-{
- zval *params, ***method_args = NULL, *retval_ptr;
- zval *callback, *object;
- HashTable *params_ar;
- int num_elems, element = 0;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/zA/", &callback, &object, &params) == FAILURE) {
- return;
- }
-
- if (Z_TYPE_P(object) != IS_OBJECT &&
- Z_TYPE_P(object) != IS_STRING
- ) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Second argument is not an object or class name");
- RETURN_FALSE;
- }
-
- convert_to_string(callback);
-
- params_ar = HASH_OF(params);
- num_elems = zend_hash_num_elements(params_ar);
- method_args = (zval ***) safe_emalloc(sizeof(zval **), num_elems, 0);
-
- for (zend_hash_internal_pointer_reset(params_ar);
- zend_hash_get_current_data(params_ar, (void **) &(method_args[element])) == SUCCESS;
- zend_hash_move_forward(params_ar)
- ) {
- element++;
- }
-
- if (call_user_function_ex(EG(function_table), &object, callback, &retval_ptr, num_elems, method_args, 0, NULL TSRMLS_CC) == SUCCESS) {
- if (retval_ptr) {
- COPY_PZVAL_TO_ZVAL(*return_value, retval_ptr);
- }
- } else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call %s()", Z_STRVAL_P(callback));
- }
-
- efree(method_args);
-}
-/* }}} */
-
/* {{{ proto mixed forward_static_call(mixed function_name [, mixed parmeter] [, mixed ...]) U
Call a user function which is the first parameter */
PHP_FUNCTION(forward_static_call)
@@ -5717,7 +5620,7 @@ PHP_FUNCTION(register_tick_function)
zend_llist_init(BG(user_tick_functions),
sizeof(user_tick_function_entry),
(llist_dtor_func_t) user_tick_function_dtor, 0);
- php_add_tick_function(run_user_tick_functions);
+ php_add_tick_function(run_user_tick_functions TSRMLS_CC);
}
for (i = 0; i < tick_fe.arg_count; i++) {
diff --git a/ext/standard/basic_functions.h b/ext/standard/basic_functions.h
index 3af85b3d40..3324427088 100644
--- a/ext/standard/basic_functions.h
+++ b/ext/standard/basic_functions.h
@@ -81,8 +81,6 @@ PHP_FUNCTION(error_get_last);
PHP_FUNCTION(call_user_func);
PHP_FUNCTION(call_user_func_array);
-PHP_FUNCTION(call_user_method);
-PHP_FUNCTION(call_user_method_array);
PHP_FUNCTION(forward_static_call);
PHP_FUNCTION(forward_static_call_array);
diff --git a/ext/standard/ftp_fopen_wrapper.c b/ext/standard/ftp_fopen_wrapper.c
index d6eb3b8fbc..df03772c39 100644
--- a/ext/standard/ftp_fopen_wrapper.c
+++ b/ext/standard/ftp_fopen_wrapper.c
@@ -163,7 +163,7 @@ static php_stream *php_ftp_fopen_connect(php_stream_wrapper *wrapper, const char
goto connect_errexit;
}
- php_stream_context_set(stream, context);
+ php_stream_context_set(stream, context TSRMLS_CC);
php_stream_notify_info(context, PHP_STREAM_NOTIFY_CONNECT, NULL, 0);
/* Start talking to ftp server */
@@ -571,7 +571,7 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *pa
goto errexit;
}
- php_stream_context_set(datastream, context);
+ php_stream_context_set(datastream, context TSRMLS_CC);
php_stream_notify_progress_init(context, 0, file_size);
if (use_ssl_on_data && (php_stream_xport_crypto_setup(datastream,
@@ -745,7 +745,7 @@ php_stream * php_stream_ftp_opendir(php_stream_wrapper *wrapper, const char *pat
goto opendir_errexit;
}
- php_stream_context_set(datastream, context);
+ php_stream_context_set(datastream, context TSRMLS_CC);
if (use_ssl_on_data && (php_stream_xport_crypto_setup(stream,
STREAM_CRYPTO_METHOD_SSLv23_CLIENT, NULL TSRMLS_CC) < 0 ||
diff --git a/ext/standard/head.c b/ext/standard/head.c
index eca032a97b..0316903bc6 100644
--- a/ext/standard/head.c
+++ b/ext/standard/head.c
@@ -124,7 +124,7 @@ PHPAPI int php_setcookie(char *name, int name_len, char *value, int value_len, t
if (expires > 0) {
const char *p;
char tsdelta[13];
- strlcat(cookie, "; expires=", len + 100);
+ strlcat(cookie, COOKIE_EXPIRES, len + 100);
dt = php_format_date("D, d-M-Y H:i:s T", sizeof("D, d-M-Y H:i:s T")-1, expires, 0 TSRMLS_CC);
/* check to make sure that the year does not exceed 4 digits in length */
p = zend_memrchr(dt, '-', strlen(dt));
@@ -139,7 +139,7 @@ PHPAPI int php_setcookie(char *name, int name_len, char *value, int value_len, t
efree(dt);
snprintf(tsdelta, sizeof(tsdelta), "%li", (long) difftime(expires, time(NULL)));
- strlcat(cookie, "; Max-Age=", len + 100);
+ strlcat(cookie, COOKIE_MAX_AGE, len + 100);
strlcat(cookie, tsdelta, len + 100);
}
}
@@ -149,18 +149,18 @@ PHPAPI int php_setcookie(char *name, int name_len, char *value, int value_len, t
}
if (path && path_len > 0) {
- strlcat(cookie, "; path=", len + 100);
+ strlcat(cookie, COOKIE_PATH, len + 100);
strlcat(cookie, path, len + 100);
}
if (domain && domain_len > 0) {
- strlcat(cookie, "; domain=", len + 100);
+ strlcat(cookie, COOKIE_DOMAIN, len + 100);
strlcat(cookie, domain, len + 100);
}
if (secure) {
- strlcat(cookie, "; secure", len + 100);
+ strlcat(cookie, COOKIE_SECURE, len + 100);
}
if (httponly) {
- strlcat(cookie, "; httponly", len + 100);
+ strlcat(cookie, COOKIE_HTTPONLY, len + 100);
}
ctr.line = cookie;
diff --git a/ext/standard/head.h b/ext/standard/head.h
index efca9b8637..59b1518676 100644
--- a/ext/standard/head.h
+++ b/ext/standard/head.h
@@ -21,6 +21,13 @@
#ifndef HEAD_H
#define HEAD_H
+#define COOKIE_EXPIRES "; expires="
+#define COOKIE_MAX_AGE "; Max-Age="
+#define COOKIE_DOMAIN "; domain="
+#define COOKIE_PATH "; path="
+#define COOKIE_SECURE "; secure"
+#define COOKIE_HTTPONLY "; HttpOnly"
+
extern PHP_RINIT_FUNCTION(head);
PHP_FUNCTION(header);
PHP_FUNCTION(header_remove);
diff --git a/ext/standard/http_fopen_wrapper.c b/ext/standard/http_fopen_wrapper.c
index 1c4b17afb1..645b2ee0c3 100644
--- a/ext/standard/http_fopen_wrapper.c
+++ b/ext/standard/http_fopen_wrapper.c
@@ -344,7 +344,7 @@ finish:
eol_detect = stream->flags & (PHP_STREAM_FLAG_DETECT_EOL | PHP_STREAM_FLAG_EOL_MAC);
stream->flags &= ~(PHP_STREAM_FLAG_DETECT_EOL | PHP_STREAM_FLAG_EOL_MAC);
- php_stream_context_set(stream, context);
+ php_stream_context_set(stream, context TSRMLS_CC);
php_stream_notify_info(context, PHP_STREAM_NOTIFY_CONNECT, NULL, 0);
@@ -689,7 +689,7 @@ finish:
response_code = 0;
}
if (context && SUCCESS==php_stream_context_get_option(context, "http", "ignore_errors", &tmpzval)) {
- ignore_errors = zend_is_true(*tmpzval);
+ ignore_errors = zend_is_true(*tmpzval TSRMLS_CC);
}
/* when we request only the header, don't fail even on error codes */
if ((options & STREAM_ONLY_GET_HEADERS) || ignore_errors) {
diff --git a/ext/standard/tests/general_functions/bug44487.phpt b/ext/standard/tests/general_functions/bug44487.phpt
deleted file mode 100644
index 10c52c6b3f..0000000000
--- a/ext/standard/tests/general_functions/bug44487.phpt
+++ /dev/null
@@ -1,24 +0,0 @@
---TEST--
-Bug #44487 (call_user_method_array issues a warning when throwing an exception)
---INI--
-error_reporting = E_ALL & ~E_DEPRECATED
---FILE--
-<?php
-
-class Foo
-{
- public function test()
- {
- print 'test';
- throw new Exception();
- }
-}
-
-try {
- $bar = new Foo();
- call_user_method_array('test', $bar, array()) ;
-} catch (Exception $e) {
-}
-?>
---EXPECT--
-test
diff --git a/ext/standard/tests/general_functions/call_user_method.phpt b/ext/standard/tests/general_functions/call_user_method.phpt
deleted file mode 100644
index cc54ff9544..0000000000
--- a/ext/standard/tests/general_functions/call_user_method.phpt
+++ /dev/null
@@ -1,20 +0,0 @@
---TEST--
-Basic behaviour of call_user_method() test
---CREDITS--
-Sebastian Schürmann
-sebs@php.net
-Testfest 2009 Munich
---FILE--
-<?php
-class a {
- static function b() {
- return true;
- }
-}
-$a = new a();
-$res = call_user_method('b', $a);
-var_dump($res);
-?>
---EXPECTF--
-Deprecated: Function call_user_method() is deprecated in %s on line 8
-bool(true)
diff --git a/ext/standard/tests/general_functions/call_user_method_002.phpt b/ext/standard/tests/general_functions/call_user_method_002.phpt
deleted file mode 100644
index 054bc3edeb..0000000000
--- a/ext/standard/tests/general_functions/call_user_method_002.phpt
+++ /dev/null
@@ -1,12 +0,0 @@
---TEST--
-call_user_method() Invalid free
---FILE--
-<?php
-
-call_user_method("1", $arr1);
-
-?>
---EXPECTF--
-Deprecated: Function call_user_method() is deprecated in %s on line %d
-
-Warning: call_user_method(): Second argument is not an object or class name in %s on line %d
diff --git a/ext/standard/tests/network/setcookie.phpt b/ext/standard/tests/network/setcookie.phpt
index bf04ec78de..3b8e551834 100644
--- a/ext/standard/tests/network/setcookie.phpt
+++ b/ext/standard/tests/network/setcookie.phpt
@@ -29,13 +29,13 @@ $expected = array(
'Set-Cookie: name=value; path=/path/',
'Set-Cookie: name=value; domain=domain.tld',
'Set-Cookie: name=value; secure',
- 'Set-Cookie: name=value; httponly'
+ 'Set-Cookie: name=value; HttpOnly'
);
$headers = headers_list();
if (($i = count($expected)) > count($headers))
{
- echo "Less headers are being sent than expected - aborting";
+ echo "Fewer headers are being sent than expected - aborting";
return;
}
@@ -67,4 +67,4 @@ echo ($i === 0)
--EXPECTHEADERS--
--EXPECT--
-OK \ No newline at end of file
+OK
diff --git a/ext/standard/type.c b/ext/standard/type.c
index dcc8083e41..15bdbb06c2 100644
--- a/ext/standard/type.c
+++ b/ext/standard/type.c
@@ -186,7 +186,7 @@ PHP_FUNCTION(boolval)
return;
}
- RETURN_BOOL(zend_is_true(*val));
+ RETURN_BOOL(zend_is_true(*val TSRMLS_CC));
}
/* }}} */
diff --git a/ext/xsl/php_xsl.c b/ext/xsl/php_xsl.c
index 3d63dd0642..aac93cd5c9 100644
--- a/ext/xsl/php_xsl.c
+++ b/ext/xsl/php_xsl.c
@@ -57,8 +57,8 @@ zend_module_entry xsl_module_entry = {
xsl_functions,
PHP_MINIT(xsl),
PHP_MSHUTDOWN(xsl),
- PHP_RINIT(xsl), /* Replace with NULL if there's nothing to do at request start */
- PHP_RSHUTDOWN(xsl), /* Replace with NULL if there's nothing to do at request end */
+ NULL,
+ NULL,
PHP_MINFO(xsl),
#if ZEND_MODULE_API_NO >= 20010901
"0.1", /* Replace with version number for your extension */
@@ -170,6 +170,7 @@ PHP_MINIT_FUNCTION(xsl)
xsltRegisterExtModuleFunction ((const xmlChar *) "function",
(const xmlChar *) "http://php.net/xsl",
xsl_ext_function_object_php);
+ xsltSetGenericErrorFunc(NULL, php_libxml_error_handler);
REGISTER_LONG_CONSTANT("XSL_CLONE_AUTO", 0, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("XSL_CLONE_NEVER", -1, CONST_CS | CONST_PERSISTENT);
@@ -273,7 +274,7 @@ PHP_MSHUTDOWN_FUNCTION(xsl)
(const xmlChar *) "http://php.net/xsl");
xsltUnregisterExtModuleFunction ((const xmlChar *) "function",
(const xmlChar *) "http://php.net/xsl");
-
+ xsltSetGenericErrorFunc(NULL, NULL);
xsltCleanupGlobals();
UNREGISTER_INI_ENTRIES();
@@ -282,24 +283,6 @@ PHP_MSHUTDOWN_FUNCTION(xsl)
}
/* }}} */
-/* {{{ PHP_RINIT_FUNCTION
- */
-PHP_RINIT_FUNCTION(xsl)
-{
- xsltSetGenericErrorFunc(NULL, php_libxml_error_handler);
- return SUCCESS;
-}
-/* }}} */
-
-/* {{{ PHP_RSHUTDOWN_FUNCTION
- */
-PHP_RSHUTDOWN_FUNCTION(xsl)
-{
- xsltSetGenericErrorFunc(NULL, NULL);
- return SUCCESS;
-}
-/* }}} */
-
/* {{{ PHP_MINFO_FUNCTION
*/
PHP_MINFO_FUNCTION(xsl)
diff --git a/ext/zip/tests/oo_addglob.phpt b/ext/zip/tests/oo_addglob.phpt
new file mode 100644
index 0000000000..970bfc7678
--- /dev/null
+++ b/ext/zip/tests/oo_addglob.phpt
@@ -0,0 +1,50 @@
+--TEST--
+ZipArchive::addGlob() method
+--CREDITS--
+Sammy Kaye Powers <sammyk@sammykmedia.com>
+w/Kenzo over the shoulder
+#phptek Chicago 2014
+--SKIPIF--
+<?php
+/* $Id$ */
+if(!extension_loaded('zip')) die('skip');
+?>
+--FILE--
+<?php
+$dirname = dirname(__FILE__) . '/';
+include $dirname . 'utils.inc';
+$file = $dirname . '__tmp_oo_addglob.zip';
+
+copy($dirname . 'test.zip', $file);
+touch($dirname . 'foo.txt');
+touch($dirname . 'bar.baz');
+
+$zip = new ZipArchive();
+if (!$zip->open($file)) {
+ exit('failed');
+}
+$options = array('add_path' => 'baz/', 'remove_all_path' => TRUE);
+if (!$zip->addGlob($dirname . '*.{txt,baz}', GLOB_BRACE, $options)) {
+ echo "failed1\n";
+}
+if ($zip->status == ZIPARCHIVE::ER_OK) {
+ dump_entries_name($zip);
+ $zip->close();
+} else {
+ echo "failed2\n";
+}
+?>
+--CLEAN--
+<?php
+$dirname = dirname(__FILE__) . '/';
+unlink($dirname . '__tmp_oo_addglob.zip');
+unlink($dirname . 'foo.txt');
+unlink($dirname . 'bar.baz');
+?>
+--EXPECTF--
+0 bar
+1 foobar/
+2 foobar/baz
+3 entry1.txt
+4 baz/foo.txt
+5 baz/bar.baz
diff --git a/ext/zip/tests/oo_addpattern.phpt b/ext/zip/tests/oo_addpattern.phpt
new file mode 100644
index 0000000000..4e1cab4ad9
--- /dev/null
+++ b/ext/zip/tests/oo_addpattern.phpt
@@ -0,0 +1,51 @@
+--TEST--
+ZipArchive::addPattern() method
+--CREDITS--
+Sammy Kaye Powers <sammyk@sammykmedia.com>
+w/Kenzo over the shoulder
+#phptek Chicago 2014
+--SKIPIF--
+<?php
+/* $Id$ */
+if(!extension_loaded('zip')) die('skip');
+?>
+--FILE--
+<?php
+$dirname = dirname(__FILE__) . '/';
+include $dirname . 'utils.inc';
+$file = $dirname . '__tmp_oo_addpattern.zip';
+
+copy($dirname . 'test.zip', $file);
+touch($dirname . 'foo.txt');
+touch($dirname . 'bar.txt');
+
+$zip = new ZipArchive();
+if (!$zip->open($file)) {
+ exit('failed');
+}
+$dir = realpath($dirname);
+$options = array('add_path' => 'baz/', 'remove_path' => $dir);
+if (!$zip->addPattern('/\.txt$/', $dir, $options)) {
+ echo "failed\n";
+}
+if ($zip->status == ZIPARCHIVE::ER_OK) {
+ dump_entries_name($zip);
+ $zip->close();
+} else {
+ echo "failed\n";
+}
+?>
+--CLEAN--
+<?php
+$dirname = dirname(__FILE__) . '/';
+unlink($dirname . '__tmp_oo_addpattern.zip');
+unlink($dirname . 'foo.txt');
+unlink($dirname . 'bar.txt');
+?>
+--EXPECTF--
+0 bar
+1 foobar/
+2 foobar/baz
+3 entry1.txt
+4 baz/bar.txt
+5 baz/foo.txt
diff --git a/main/SAPI.c b/main/SAPI.c
index f9e9ccb049..b69143c587 100644
--- a/main/SAPI.c
+++ b/main/SAPI.c
@@ -999,7 +999,7 @@ SAPI_API int sapi_register_input_filter(unsigned int (*input_filter)(int arg, ch
SAPI_API int sapi_flush(TSRMLS_D)
{
if (sapi_module.flush) {
- sapi_module.flush(SG(server_context));
+ sapi_module.flush(SG(server_context) TSRMLS_CC);
return SUCCESS;
} else {
return FAILURE;
diff --git a/main/SAPI.h b/main/SAPI.h
index 990ca6990c..ecb1743820 100644
--- a/main/SAPI.h
+++ b/main/SAPI.h
@@ -228,7 +228,7 @@ struct _sapi_module_struct {
int (*deactivate)(TSRMLS_D);
int (*ub_write)(const char *str, unsigned int str_length TSRMLS_DC);
- void (*flush)(void *server_context);
+ void (*flush)(void *server_context TSRMLS_DC);
struct stat *(*get_stat)(TSRMLS_D);
char *(*getenv)(char *name, size_t name_len TSRMLS_DC);
diff --git a/main/main.c b/main/main.c
index 60f5a16c4b..671700887a 100644
--- a/main/main.c
+++ b/main/main.c
@@ -179,7 +179,7 @@ static PHP_INI_MH(OnChangeMemoryLimit)
} else {
PG(memory_limit) = 1<<30; /* effectively, no limit */
}
- return zend_set_memory_limit(PG(memory_limit));
+ return zend_set_memory_limit(PG(memory_limit) TSRMLS_CC);
}
/* }}} */
@@ -499,40 +499,6 @@ static PHP_INI_MH(OnChangeMailForceExtra)
/* defined in browscap.c */
PHP_INI_MH(OnChangeBrowscap);
-/* {{{ PHP_INI_MH
- */
-static PHP_INI_MH(OnChangeAlwaysPopulateRawPostData)
-{
- signed char *p;
-#ifndef ZTS
- char *base = (char *) mh_arg2;
-#else
- char *base;
-
- base = (char *) ts_resource(*((int *) mh_arg2));
-#endif
-
- p = (signed char *) (base+(size_t) mh_arg1);
-
- *p = zend_atol(new_value, new_value_length);
- if (new_value_length == 2 && strcasecmp("on", new_value) == 0) {
- *p = (signed char) 1;
- }
- else if (new_value_length == 3 && strcasecmp("yes", new_value) == 0) {
- *p = (signed char) 1;
- }
- else if (new_value_length == 4 && strcasecmp("true", new_value) == 0) {
- *p = (signed char) 1;
- }
- else if (new_value_length == 5 && strcasecmp("never", new_value) == 0) {
- *p = (signed char) -1;
- }
- else {
- *p = (signed char) atoi(new_value);
- }
- return SUCCESS;
-}
-/* }}} */
/* Need to be read from the environment (?):
* PHP_AUTO_PREPEND_FILE
@@ -638,7 +604,6 @@ PHP_INI_BEGIN()
STD_PHP_INI_BOOLEAN("allow_url_fopen", "1", PHP_INI_SYSTEM, OnUpdateBool, allow_url_fopen, php_core_globals, core_globals)
STD_PHP_INI_BOOLEAN("allow_url_include", "0", PHP_INI_SYSTEM, OnUpdateBool, allow_url_include, php_core_globals, core_globals)
STD_PHP_INI_BOOLEAN("enable_post_data_reading", "1", PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateBool, enable_post_data_reading, php_core_globals, core_globals)
- STD_PHP_INI_ENTRY("always_populate_raw_post_data", "0", PHP_INI_SYSTEM|PHP_INI_PERDIR, OnChangeAlwaysPopulateRawPostData, always_populate_raw_post_data, php_core_globals, core_globals)
STD_PHP_INI_ENTRY("realpath_cache_size", "16K", PHP_INI_SYSTEM, OnUpdateLong, realpath_cache_size_limit, virtual_cwd_globals, cwd_globals)
STD_PHP_INI_ENTRY("realpath_cache_ttl", "120", PHP_INI_SYSTEM, OnUpdateLong, realpath_cache_ttl, virtual_cwd_globals, cwd_globals)
@@ -1243,7 +1208,7 @@ static void php_error_cb(int type, const char *error_filename, const uint error_
CG(parse_error) = 0;
} else {
/* restore memory limit */
- zend_set_memory_limit(PG(memory_limit));
+ zend_set_memory_limit(PG(memory_limit) TSRMLS_CC);
efree(buffer);
zend_objects_store_mark_destructed(&EG(objects_store) TSRMLS_CC);
zend_bailout();
@@ -1870,7 +1835,7 @@ void php_request_shutdown(void *dummy)
}
} zend_end_try();
- /* 7.5 free last error information */
+ /* 8. free last error information */
if (PG(last_error_message)) {
free(PG(last_error_message));
PG(last_error_message) = NULL;
@@ -1880,34 +1845,34 @@ void php_request_shutdown(void *dummy)
PG(last_error_file) = NULL;
}
- /* 7. Shutdown scanner/executor/compiler and restore ini entries */
+ /* 9. Shutdown scanner/executor/compiler and restore ini entries */
zend_deactivate(TSRMLS_C);
- /* 8. Call all extensions post-RSHUTDOWN functions */
+ /* 10. Call all extensions post-RSHUTDOWN functions */
zend_try {
zend_post_deactivate_modules(TSRMLS_C);
} zend_end_try();
- /* 9. SAPI related shutdown (free stuff) */
+ /* 11. SAPI related shutdown (free stuff) */
zend_try {
sapi_deactivate(TSRMLS_C);
} zend_end_try();
- /* 9.5 free virtual CWD memory */
+ /* 12. free virtual CWD memory */
virtual_cwd_deactivate(TSRMLS_C);
- /* 10. Destroy stream hashes */
+ /* 13. Destroy stream hashes */
zend_try {
php_shutdown_stream_hashes(TSRMLS_C);
} zend_end_try();
- /* 11. Free Willy (here be crashes) */
+ /* 14. Free Willy (here be crashes) */
zend_try {
shutdown_memory_manager(CG(unclean_shutdown) || !report_memleaks, 0 TSRMLS_CC);
} zend_end_try();
zend_interned_strings_restore(TSRMLS_C);
- /* 12. Reset max_execution_time */
+ /* 15. Reset max_execution_time */
zend_try {
zend_unset_timeout(TSRMLS_C);
} zend_end_try();
@@ -2720,9 +2685,9 @@ PHPAPI int php_lint_script(zend_file_handle *file TSRMLS_DC)
#ifdef PHP_WIN32
/* {{{ dummy_indent
just so that this symbol gets exported... */
-PHPAPI void dummy_indent(void)
+PHPAPI void dummy_indent(TSRMLS_D)
{
- zend_indent();
+ zend_indent(TSRMLS_C);
}
/* }}} */
#endif
diff --git a/main/php.h b/main/php.h
index 4330479d50..f9cfd2d7f2 100644
--- a/main/php.h
+++ b/main/php.h
@@ -26,7 +26,7 @@
#include <dmalloc.h>
#endif
-#define PHP_API_VERSION 20131106
+#define PHP_API_VERSION 20131218
#define PHP_HAVE_STREAMS
#define YYDEBUG 0
#define PHP_DEFAULT_CHARSET "UTF-8"
diff --git a/main/php_content_types.c b/main/php_content_types.c
index ca47e15285..c8db921421 100644
--- a/main/php_content_types.c
+++ b/main/php_content_types.c
@@ -33,19 +33,6 @@ static sapi_post_entry php_post_entries[] = {
};
/* }}} */
-static zend_bool populate_raw_post_data(TSRMLS_D)
-{
- if (!SG(request_info).request_body) {
- return (zend_bool) 0;
- }
-
- if (!PG(always_populate_raw_post_data)) {
- return (zend_bool) !SG(request_info).post_entry;
- }
-
- return (zend_bool) (PG(always_populate_raw_post_data) > 0);
-}
-
/* {{{ SAPI_POST_READER_FUNC
*/
SAPI_API SAPI_POST_READER_FUNC(php_default_post_reader)
@@ -55,29 +42,6 @@ SAPI_API SAPI_POST_READER_FUNC(php_default_post_reader)
/* no post handler registered, so we just swallow the data */
sapi_read_standard_form_data(TSRMLS_C);
}
-
- if (populate_raw_post_data(TSRMLS_C)) {
- size_t length;
- char *data = NULL;
-
- php_stream_rewind(SG(request_info).request_body);
- length = php_stream_copy_to_mem(SG(request_info).request_body, &data, PHP_STREAM_COPY_ALL, 0);
- php_stream_rewind(SG(request_info).request_body);
-
- if (length > INT_MAX) {
- sapi_module.sapi_error(E_WARNING,
- "HTTP_RAW_POST_DATA truncated from %lu to %d bytes",
- (unsigned long) length, INT_MAX);
- length = INT_MAX;
- }
- SET_VAR_STRINGL("HTTP_RAW_POST_DATA", data, length);
-
- sapi_module.sapi_error(E_DEPRECATED,
- "Automatically populating $HTTP_RAW_POST_DATA is deprecated and "
- "will be removed in a future version. To avoid this warning set "
- "'always_populate_raw_post_data' to '-1' in php.ini and use the "
- "php://input stream instead.");
- }
}
}
/* }}} */
diff --git a/main/php_globals.h b/main/php_globals.h
index e135d61865..d8ba6142d4 100644
--- a/main/php_globals.h
+++ b/main/php_globals.h
@@ -135,7 +135,6 @@ struct _php_core_globals {
zend_bool during_request_startup;
zend_bool allow_url_fopen;
zend_bool enable_post_data_reading;
- signed char always_populate_raw_post_data;
zend_bool report_zend_debug;
int last_error_type;
diff --git a/main/php_ini.c b/main/php_ini.c
index e20ba4ba73..f7f4686e84 100644
--- a/main/php_ini.c
+++ b/main/php_ini.c
@@ -361,7 +361,7 @@ static void php_load_zend_extension_cb(void *arg TSRMLS_DC)
int length = strlen(filename);
if (IS_ABSOLUTE_PATH(filename, length)) {
- zend_load_extension(filename);
+ zend_load_extension(filename TSRMLS_CC);
} else {
char *libpath;
char *extension_dir = INI_STR("extension_dir");
@@ -372,7 +372,7 @@ static void php_load_zend_extension_cb(void *arg TSRMLS_DC)
} else {
spprintf(&libpath, 0, "%s%c%s", extension_dir, DEFAULT_SLASH, filename);
}
- zend_load_extension(libpath);
+ zend_load_extension(libpath TSRMLS_CC);
efree(libpath);
}
}
diff --git a/main/php_ticks.c b/main/php_ticks.c
index b07f925fab..248b5a9e04 100644
--- a/main/php_ticks.c
+++ b/main/php_ticks.c
@@ -46,17 +46,13 @@ static int php_compare_tick_functions(void *elem1, void *elem2)
return (func1 == func2);
}
-PHPAPI void php_add_tick_function(void (*func)(int))
+PHPAPI void php_add_tick_function(void (*func)(int) TSRMLS_DC)
{
- TSRMLS_FETCH();
-
zend_llist_add_element(&PG(tick_functions), (void *)&func);
}
-PHPAPI void php_remove_tick_function(void (*func)(int))
+PHPAPI void php_remove_tick_function(void (*func)(int) TSRMLS_DC)
{
- TSRMLS_FETCH();
-
zend_llist_del_element(&PG(tick_functions), (void *)func,
(int(*)(void*, void*))php_compare_tick_functions);
}
@@ -69,10 +65,8 @@ static void php_tick_iterator(void *data, void *arg TSRMLS_DC)
func(*((int *)arg));
}
-void php_run_ticks(int count)
+void php_run_ticks(int count TSRMLS_DC)
{
- TSRMLS_FETCH();
-
zend_llist_apply_with_argument(&PG(tick_functions), (llist_apply_with_arg_func_t) php_tick_iterator, &count TSRMLS_CC);
}
diff --git a/main/php_ticks.h b/main/php_ticks.h
index 0f58adac6a..b511949d80 100644
--- a/main/php_ticks.h
+++ b/main/php_ticks.h
@@ -24,11 +24,11 @@
int php_startup_ticks(TSRMLS_D);
void php_deactivate_ticks(TSRMLS_D);
void php_shutdown_ticks(TSRMLS_D);
-void php_run_ticks(int count);
+void php_run_ticks(int count TSRMLS_DC);
BEGIN_EXTERN_C()
-PHPAPI void php_add_tick_function(void (*func)(int));
-PHPAPI void php_remove_tick_function(void (*func)(int));
+PHPAPI void php_add_tick_function(void (*func)(int) TSRMLS_DC);
+PHPAPI void php_remove_tick_function(void (*func)(int) TSRMLS_DC);
END_EXTERN_C()
#endif
diff --git a/main/php_variables.c b/main/php_variables.c
index 90cfcb20bc..fef905ff7d 100644
--- a/main/php_variables.c
+++ b/main/php_variables.c
@@ -734,6 +734,7 @@ static zend_bool php_auto_globals_create_post(const char *name, uint name_len TS
if (PG(variables_order) &&
(strchr(PG(variables_order),'P') || strchr(PG(variables_order),'p')) &&
+ !SG(headers_sent) &&
SG(request_info).request_method &&
!strcasecmp(SG(request_info).request_method, "POST")) {
sapi_module.treat_data(PARSE_POST, NULL, NULL TSRMLS_CC);
diff --git a/main/php_version.h b/main/php_version.h
index d48bf13c6f..87c2e4ac4d 100644
--- a/main/php_version.h
+++ b/main/php_version.h
@@ -1,8 +1,8 @@
/* automatically generated by configure */
/* edit configure.in to change version number */
#define PHP_MAJOR_VERSION 5
-#define PHP_MINOR_VERSION 6
+#define PHP_MINOR_VERSION 7
#define PHP_RELEASE_VERSION 0
#define PHP_EXTRA_VERSION "-dev"
-#define PHP_VERSION "5.6.0-dev"
-#define PHP_VERSION_ID 50600
+#define PHP_VERSION "5.7.0-dev"
+#define PHP_VERSION_ID 50700
diff --git a/main/streams/php_stream_context.h b/main/streams/php_stream_context.h
index 58b298b689..5c6925a856 100644
--- a/main/streams/php_stream_context.h
+++ b/main/streams/php_stream_context.h
@@ -87,7 +87,7 @@ END_EXTERN_C()
BEGIN_EXTERN_C()
PHPAPI void php_stream_notification_notify(php_stream_context *context, int notifycode, int severity,
char *xmsg, int xcode, size_t bytes_sofar, size_t bytes_max, void * ptr TSRMLS_DC);
-PHPAPI php_stream_context *php_stream_context_set(php_stream *stream, php_stream_context *context);
+PHPAPI php_stream_context *php_stream_context_set(php_stream *stream, php_stream_context *context TSRMLS_DC);
END_EXTERN_C()
#define php_stream_notify_info(context, code, xmsg, xcode) do { if ((context) && (context)->notifier) { \
diff --git a/main/streams/streams.c b/main/streams/streams.c
index 67a151014d..6716dce524 100644
--- a/main/streams/streams.c
+++ b/main/streams/streams.c
@@ -2161,10 +2161,9 @@ PHPAPI php_stream *_php_stream_open_wrapper_ex(const char *path, const char *mod
/* }}} */
/* {{{ context API */
-PHPAPI php_stream_context *php_stream_context_set(php_stream *stream, php_stream_context *context)
+PHPAPI php_stream_context *php_stream_context_set(php_stream *stream, php_stream_context *context TSRMLS_DC)
{
php_stream_context *oldcontext = stream->context;
- TSRMLS_FETCH();
stream->context = context;
diff --git a/main/streams/transports.c b/main/streams/transports.c
index a633b059fa..f54e8e6cdf 100644
--- a/main/streams/transports.c
+++ b/main/streams/transports.c
@@ -134,7 +134,7 @@ PHPAPI php_stream *_php_stream_xport_create(const char *name, size_t namelen, in
context STREAMS_REL_CC TSRMLS_CC);
if (stream) {
- php_stream_context_set(stream, context);
+ php_stream_context_set(stream, context TSRMLS_CC);
if ((flags & STREAM_XPORT_SERVER) == 0) {
/* client */
diff --git a/main/streams/userspace.c b/main/streams/userspace.c
index 5990464a6e..7d958729e5 100644
--- a/main/streams/userspace.c
+++ b/main/streams/userspace.c
@@ -1121,7 +1121,7 @@ static int php_userstreamop_set_option(php_stream *stream, int option, int value
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_SET_OPTION " is not implemented!",
us->wrapper->classname);
ret = PHP_STREAM_OPTION_RETURN_ERR;
- } else if (retval && zend_is_true(retval)) {
+ } else if (retval && zend_is_true(retval TSRMLS_CC)) {
ret = PHP_STREAM_OPTION_RETURN_OK;
} else {
ret = PHP_STREAM_OPTION_RETURN_ERR;
@@ -1629,7 +1629,7 @@ static int php_userstreamop_cast(php_stream *stream, int castas, void **retptr T
us->wrapper->classname);
break;
}
- if (retval == NULL || !zend_is_true(retval)) {
+ if (retval == NULL || !zend_is_true(retval TSRMLS_CC)) {
break;
}
php_stream_from_zval_no_verify(intstream, &retval);
diff --git a/php.ini-development b/php.ini-development
index 148d194fef..562816fc44 100644
--- a/php.ini-development
+++ b/php.ini-development
@@ -699,13 +699,6 @@ default_charset = "UTF-8"
; http://php.net/output-encoding
;output_encoding =
-; Always populate the $HTTP_RAW_POST_DATA variable. PHP's default behavior is
-; to disable this feature and it will be removed in a future version.
-; If post reading is disabled through enable_post_data_reading,
-; $HTTP_RAW_POST_DATA is *NOT* populated.
-; http://php.net/always-populate-raw-post-data
-;always_populate_raw_post_data = -1
-
;;;;;;;;;;;;;;;;;;;;;;;;;
; Paths and Directories ;
;;;;;;;;;;;;;;;;;;;;;;;;;
diff --git a/php.ini-production b/php.ini-production
index 5410b3de54..34f91fe293 100644
--- a/php.ini-production
+++ b/php.ini-production
@@ -697,13 +697,6 @@ default_charset = "UTF-8"
; http://php.net/output-encoding
;output_encoding =
-; Always populate the $HTTP_RAW_POST_DATA variable. PHP's default behavior is
-; to disable this feature and it will be removed in a future version.
-; If post reading is disabled through enable_post_data_reading,
-; $HTTP_RAW_POST_DATA is *NOT* populated.
-; http://php.net/always-populate-raw-post-data
-;always_populate_raw_post_data = -1
-
;;;;;;;;;;;;;;;;;;;;;;;;;
; Paths and Directories ;
;;;;;;;;;;;;;;;;;;;;;;;;;
diff --git a/sapi/apache/mod_php5.c b/sapi/apache/mod_php5.c
index a1e5a70e89..37252e1126 100644
--- a/sapi/apache/mod_php5.c
+++ b/sapi/apache/mod_php5.c
@@ -108,7 +108,7 @@ static int sapi_apache_ub_write(const char *str, uint str_length TSRMLS_DC)
/* {{{ sapi_apache_flush
*/
-static void sapi_apache_flush(void *server_context)
+static void sapi_apache_flush(void *server_context TSRMLS_DC)
{
if (server_context) {
#if MODULE_MAGIC_NUMBER > 19970110
diff --git a/sapi/apache2filter/sapi_apache2.c b/sapi/apache2filter/sapi_apache2.c
index d5bf0d8646..4fd45041ba 100644
--- a/sapi/apache2filter/sapi_apache2.c
+++ b/sapi/apache2filter/sapi_apache2.c
@@ -248,14 +248,13 @@ php_apache_sapi_register_variables(zval *track_vars_array TSRMLS_DC)
}
static void
-php_apache_sapi_flush(void *server_context)
+php_apache_sapi_flush(void *server_context TSRMLS_DC)
{
php_struct *ctx;
apr_bucket_brigade *bb;
apr_bucket_alloc_t *ba;
apr_bucket *b;
ap_filter_t *f; /* output filters */
- TSRMLS_FETCH();
ctx = server_context;
diff --git a/sapi/apache2handler/sapi_apache2.c b/sapi/apache2handler/sapi_apache2.c
index a0c24bd0e3..dfb5eac28a 100644
--- a/sapi/apache2handler/sapi_apache2.c
+++ b/sapi/apache2handler/sapi_apache2.c
@@ -287,11 +287,10 @@ php_apache_sapi_register_variables(zval *track_vars_array TSRMLS_DC)
}
static void
-php_apache_sapi_flush(void *server_context)
+php_apache_sapi_flush(void *server_context TSRMLS_DC)
{
php_struct *ctx;
request_rec *r;
- TSRMLS_FETCH();
ctx = server_context;
diff --git a/sapi/apache_hooks/mod_php5.c b/sapi/apache_hooks/mod_php5.c
index a069e324c1..901d3b57a3 100644
--- a/sapi/apache_hooks/mod_php5.c
+++ b/sapi/apache_hooks/mod_php5.c
@@ -253,7 +253,7 @@ static int sapi_apache_ub_write(const char *str, uint str_length TSRMLS_DC)
/* {{{ sapi_apache_flush
*/
-static void sapi_apache_flush(void *server_context)
+static void sapi_apache_flush(void *server_context TSRMLS_DC)
{
if (server_context) {
#if MODULE_MAGIC_NUMBER > 19970110
diff --git a/sapi/apache_hooks/php_apache.c b/sapi/apache_hooks/php_apache.c
index 6531ca20ee..76a4219b0a 100644
--- a/sapi/apache_hooks/php_apache.c
+++ b/sapi/apache_hooks/php_apache.c
@@ -155,15 +155,13 @@ static request_rec *get_apache_request(zval *z TSRMLS_DC)
return r;
}
-/* {{{ php_apache_request_new(request_rec *r)
+/* {{{ php_apache_request_new(request_rec *r TSRMLS_DC)
* create a new zval-instance for ApacheRequest that wraps request_rec
*/
-zval *php_apache_request_new(request_rec *r)
+zval *php_apache_request_new(request_rec *r TSRMLS_DC)
{
zval *req;
zval *addr;
-
- TSRMLS_FETCH();
MAKE_STD_ZVAL(addr);
Z_TYPE_P(addr) = IS_LONG;
@@ -1170,7 +1168,7 @@ PHP_FUNCTION(apache_request_sub_req_lookup_uri)
if (!sub_r) {
RETURN_FALSE;
}
- return_value = php_apache_request_new(sub_r);
+ return_value = php_apache_request_new(sub_r TSRMLS_CC);
}
/* }}} */
@@ -1196,7 +1194,7 @@ PHP_FUNCTION(apache_request_sub_req_lookup_file)
if (!sub_r) {
RETURN_FALSE;
}
- return_value = php_apache_request_new(sub_r);
+ return_value = php_apache_request_new(sub_r TSRMLS_CC);
}
/* }}} */
@@ -1222,7 +1220,7 @@ PHP_FUNCTION(apache_request_sub_req_method_uri)
if (!sub_r) {
RETURN_FALSE;
}
- return_value = php_apache_request_new(sub_r);
+ return_value = php_apache_request_new(sub_r TSRMLS_CC);
}
/* }}} */
diff --git a/sapi/caudium/caudium.c b/sapi/caudium/caudium.c
index e707f3576e..946f7a039e 100644
--- a/sapi/caudium/caudium.c
+++ b/sapi/caudium/caudium.c
@@ -395,11 +395,10 @@ php_caudium_sapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
* the client. Used for POST/PUT requests.
*/
-INLINE static int php_caudium_low_read_post(char *buf, uint count_bytes)
+INLINE static int php_caudium_low_read_post(char *buf, uint count_bytes TSRMLS_DC)
{
uint total_read = 0;
GET_THIS();
- TSRMLS_FETCH();
if(!MY_FD_OBJ->prog)
{
@@ -423,7 +422,7 @@ static int
php_caudium_sapi_read_post(char *buf, uint count_bytes TSRMLS_DC)
{
uint total_read = 0;
- THREAD_SAFE_RUN(total_read = php_caudium_low_read_post(buf, count_bytes), "read post");
+ THREAD_SAFE_RUN(total_read = php_caudium_low_read_post(buf, count_bytes TSRMLS_CC), "read post");
return total_read;
}
diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c
index 437d09cf32..7006ecd73f 100644
--- a/sapi/cgi/cgi_main.c
+++ b/sapi/cgi/cgi_main.c
@@ -324,14 +324,14 @@ static int sapi_fcgi_ub_write(const char *str, uint str_length TSRMLS_DC)
return str_length;
}
-static void sapi_cgi_flush(void *server_context)
+static void sapi_cgi_flush(void *server_context TSRMLS_DC)
{
if (fflush(stdout) == EOF) {
php_handle_aborted_connection();
}
}
-static void sapi_fcgi_flush(void *server_context)
+static void sapi_fcgi_flush(void *server_context TSRMLS_DC)
{
fcgi_request *request = (fcgi_request*) server_context;
@@ -928,7 +928,7 @@ static int sapi_cgi_deactivate(TSRMLS_D)
php_handle_aborted_connection();
}
} else {
- sapi_cgi_flush(SG(server_context));
+ sapi_cgi_flush(SG(server_context) TSRMLS_CC);
}
}
return SUCCESS;
@@ -2240,7 +2240,7 @@ consult the installation file that came with this distribution, or visit \n\
break;
case 'z': /* load extension file */
- zend_load_extension(php_optarg);
+ zend_load_extension(php_optarg TSRMLS_CC);
break;
default:
@@ -2493,7 +2493,7 @@ consult the installation file that came with this distribution, or visit \n\
/* Zeev might want to do something with this one day */
case PHP_MODE_INDENT:
open_file_for_scanning(&file_handle TSRMLS_CC);
- zend_indent();
+ zend_indent(TSRMLS_C);
zend_file_handle_dtor(&file_handle TSRMLS_CC);
php_output_teardown();
return SUCCESS;
diff --git a/sapi/cli/generate_mime_type_map.php b/sapi/cli/generate_mime_type_map.php
new file mode 100644
index 0000000000..4475004985
--- /dev/null
+++ b/sapi/cli/generate_mime_type_map.php
@@ -0,0 +1,76 @@
+#!/usr/bin/env php
+<?php
+
+// Check if we are being given a mime.types file or if we should use the
+// default URL.
+$source = count($_SERVER['argv']) > 1 ? $_SERVER['argv'][1] : 'https://raw.githubusercontent.com/apache/httpd/trunk/docs/conf/mime.types';
+
+// See if we can actually load it.
+$types = @file($source);
+if ($types === false) {
+ fprintf(STDERR, "Error: unable to read $source\n");
+ exit(1);
+}
+
+// Remove comments and flip into an extensions array.
+$extensions = [];
+array_walk($types, function ($line) use (&$extensions) {
+ $line = trim($line);
+ if ($line && $line[0] != '#') {
+ $fields = preg_split('/\s+/', $line);
+ if (count($fields) > 1) {
+ $mime = array_shift($fields);
+ foreach ($fields as $extension) {
+ $extensions[$extension] = $mime;
+ }
+ }
+ }
+});
+
+?>
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2014 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 |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_01.txt |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Moriyoshi Koizumi <moriyoshi@php.net> |
+ +----------------------------------------------------------------------+
+*/
+
+/* This is a generated file. Rather than modifying it, please run
+ * "php generate_mime_type_map.php > mime_type_map.h" to regenerate the file. */
+
+#ifndef PHP_CLI_SERVER_MIME_TYPE_MAP_H
+#define PHP_CLI_SERVER_MIME_TYPE_MAP_H
+
+typedef struct php_cli_server_ext_mime_type_pair {
+ const char *ext;
+ const char *mime_type;
+} php_cli_server_ext_mime_type_pair;
+
+static php_cli_server_ext_mime_type_pair mime_type_map[] = {
+<?php foreach ($extensions as $extension => $mime): ?>
+ { "<?= addcslashes($extension, "\0..\37!@\@\177..\377") ?>", "<?= addcslashes($mime, "\0..\37!@\@\177..\377") ?>" },
+<?php endforeach ?>
+ { NULL, NULL }
+};
+
+#endif /* PHP_CLI_SERVER_MIME_TYPE_MAP_H */
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim600: noet sw=4 ts=4 fdm=marker
+ * vim<600: noet sw=4 ts=4
+ */
diff --git a/sapi/cli/mime_type_map.h b/sapi/cli/mime_type_map.h
new file mode 100644
index 0000000000..72c05d4149
--- /dev/null
+++ b/sapi/cli/mime_type_map.h
@@ -0,0 +1,1024 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 1997-2014 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 |
+ | available through the world-wide-web at the following url: |
+ | http://www.php.net/license/3_01.txt |
+ | If you did not receive a copy of the PHP license and are unable to |
+ | obtain it through the world-wide-web, please send a note to |
+ | license@php.net so we can mail you a copy immediately. |
+ +----------------------------------------------------------------------+
+ | Author: Moriyoshi Koizumi <moriyoshi@php.net> |
+ +----------------------------------------------------------------------+
+*/
+
+/* This is a generated file. Rather than modifying it, please run
+ * "php generate_mime_type_map.php > mime_type_map.h" to regenerate the file. */
+
+#ifndef PHP_CLI_SERVER_MIME_TYPE_MAP_H
+#define PHP_CLI_SERVER_MIME_TYPE_MAP_H
+
+typedef struct php_cli_server_ext_mime_type_pair {
+ const char *ext;
+ const char *mime_type;
+} php_cli_server_ext_mime_type_pair;
+
+static php_cli_server_ext_mime_type_pair mime_type_map[] = {
+ { "ez", "application/andrew-inset" },
+ { "aw", "application/applixware" },
+ { "atom", "application/atom+xml" },
+ { "atomcat", "application/atomcat+xml" },
+ { "atomsvc", "application/atomsvc+xml" },
+ { "ccxml", "application/ccxml+xml" },
+ { "cdmia", "application/cdmi-capability" },
+ { "cdmic", "application/cdmi-container" },
+ { "cdmid", "application/cdmi-domain" },
+ { "cdmio", "application/cdmi-object" },
+ { "cdmiq", "application/cdmi-queue" },
+ { "cu", "application/cu-seeme" },
+ { "davmount", "application/davmount+xml" },
+ { "dbk", "application/docbook+xml" },
+ { "dssc", "application/dssc+der" },
+ { "xdssc", "application/dssc+xml" },
+ { "ecma", "application/ecmascript" },
+ { "emma", "application/emma+xml" },
+ { "epub", "application/epub+zip" },
+ { "exi", "application/exi" },
+ { "pfr", "application/font-tdpfr" },
+ { "gml", "application/gml+xml" },
+ { "gpx", "application/gpx+xml" },
+ { "gxf", "application/gxf" },
+ { "stk", "application/hyperstudio" },
+ { "ink", "application/inkml+xml" },
+ { "inkml", "application/inkml+xml" },
+ { "ipfix", "application/ipfix" },
+ { "jar", "application/java-archive" },
+ { "ser", "application/java-serialized-object" },
+ { "class", "application/java-vm" },
+ { "js", "application/javascript" },
+ { "json", "application/json" },
+ { "jsonml", "application/jsonml+json" },
+ { "lostxml", "application/lost+xml" },
+ { "hqx", "application/mac-binhex40" },
+ { "cpt", "application/mac-compactpro" },
+ { "mads", "application/mads+xml" },
+ { "mrc", "application/marc" },
+ { "mrcx", "application/marcxml+xml" },
+ { "ma", "application/mathematica" },
+ { "nb", "application/mathematica" },
+ { "mb", "application/mathematica" },
+ { "mathml", "application/mathml+xml" },
+ { "mbox", "application/mbox" },
+ { "mscml", "application/mediaservercontrol+xml" },
+ { "metalink", "application/metalink+xml" },
+ { "meta4", "application/metalink4+xml" },
+ { "mets", "application/mets+xml" },
+ { "mods", "application/mods+xml" },
+ { "m21", "application/mp21" },
+ { "mp21", "application/mp21" },
+ { "mp4s", "application/mp4" },
+ { "doc", "application/msword" },
+ { "dot", "application/msword" },
+ { "mxf", "application/mxf" },
+ { "bin", "application/octet-stream" },
+ { "dms", "application/octet-stream" },
+ { "lrf", "application/octet-stream" },
+ { "mar", "application/octet-stream" },
+ { "so", "application/octet-stream" },
+ { "dist", "application/octet-stream" },
+ { "distz", "application/octet-stream" },
+ { "pkg", "application/octet-stream" },
+ { "bpk", "application/octet-stream" },
+ { "dump", "application/octet-stream" },
+ { "elc", "application/octet-stream" },
+ { "deploy", "application/octet-stream" },
+ { "oda", "application/oda" },
+ { "opf", "application/oebps-package+xml" },
+ { "ogx", "application/ogg" },
+ { "omdoc", "application/omdoc+xml" },
+ { "onetoc", "application/onenote" },
+ { "onetoc2", "application/onenote" },
+ { "onetmp", "application/onenote" },
+ { "onepkg", "application/onenote" },
+ { "oxps", "application/oxps" },
+ { "xer", "application/patch-ops-error+xml" },
+ { "pdf", "application/pdf" },
+ { "pgp", "application/pgp-encrypted" },
+ { "asc", "application/pgp-signature" },
+ { "sig", "application/pgp-signature" },
+ { "prf", "application/pics-rules" },
+ { "p10", "application/pkcs10" },
+ { "p7m", "application/pkcs7-mime" },
+ { "p7c", "application/pkcs7-mime" },
+ { "p7s", "application/pkcs7-signature" },
+ { "p8", "application/pkcs8" },
+ { "ac", "application/pkix-attr-cert" },
+ { "cer", "application/pkix-cert" },
+ { "crl", "application/pkix-crl" },
+ { "pkipath", "application/pkix-pkipath" },
+ { "pki", "application/pkixcmp" },
+ { "pls", "application/pls+xml" },
+ { "ai", "application/postscript" },
+ { "eps", "application/postscript" },
+ { "ps", "application/postscript" },
+ { "cww", "application/prs.cww" },
+ { "pskcxml", "application/pskc+xml" },
+ { "rdf", "application/rdf+xml" },
+ { "rif", "application/reginfo+xml" },
+ { "rnc", "application/relax-ng-compact-syntax" },
+ { "rl", "application/resource-lists+xml" },
+ { "rld", "application/resource-lists-diff+xml" },
+ { "rs", "application/rls-services+xml" },
+ { "gbr", "application/rpki-ghostbusters" },
+ { "mft", "application/rpki-manifest" },
+ { "roa", "application/rpki-roa" },
+ { "rsd", "application/rsd+xml" },
+ { "rss", "application/rss+xml" },
+ { "rtf", "application/rtf" },
+ { "sbml", "application/sbml+xml" },
+ { "scq", "application/scvp-cv-request" },
+ { "scs", "application/scvp-cv-response" },
+ { "spq", "application/scvp-vp-request" },
+ { "spp", "application/scvp-vp-response" },
+ { "sdp", "application/sdp" },
+ { "setpay", "application/set-payment-initiation" },
+ { "setreg", "application/set-registration-initiation" },
+ { "shf", "application/shf+xml" },
+ { "smi", "application/smil+xml" },
+ { "smil", "application/smil+xml" },
+ { "rq", "application/sparql-query" },
+ { "srx", "application/sparql-results+xml" },
+ { "gram", "application/srgs" },
+ { "grxml", "application/srgs+xml" },
+ { "sru", "application/sru+xml" },
+ { "ssdl", "application/ssdl+xml" },
+ { "ssml", "application/ssml+xml" },
+ { "tei", "application/tei+xml" },
+ { "teicorpus", "application/tei+xml" },
+ { "tfi", "application/thraud+xml" },
+ { "tsd", "application/timestamped-data" },
+ { "plb", "application/vnd.3gpp.pic-bw-large" },
+ { "psb", "application/vnd.3gpp.pic-bw-small" },
+ { "pvb", "application/vnd.3gpp.pic-bw-var" },
+ { "tcap", "application/vnd.3gpp2.tcap" },
+ { "pwn", "application/vnd.3m.post-it-notes" },
+ { "aso", "application/vnd.accpac.simply.aso" },
+ { "imp", "application/vnd.accpac.simply.imp" },
+ { "acu", "application/vnd.acucobol" },
+ { "atc", "application/vnd.acucorp" },
+ { "acutc", "application/vnd.acucorp" },
+ { "air", "application/vnd.adobe.air-application-installer-package+zip" },
+ { "fcdt", "application/vnd.adobe.formscentral.fcdt" },
+ { "fxp", "application/vnd.adobe.fxp" },
+ { "fxpl", "application/vnd.adobe.fxp" },
+ { "xdp", "application/vnd.adobe.xdp+xml" },
+ { "xfdf", "application/vnd.adobe.xfdf" },
+ { "ahead", "application/vnd.ahead.space" },
+ { "azf", "application/vnd.airzip.filesecure.azf" },
+ { "azs", "application/vnd.airzip.filesecure.azs" },
+ { "azw", "application/vnd.amazon.ebook" },
+ { "acc", "application/vnd.americandynamics.acc" },
+ { "ami", "application/vnd.amiga.ami" },
+ { "apk", "application/vnd.android.package-archive" },
+ { "cii", "application/vnd.anser-web-certificate-issue-initiation" },
+ { "fti", "application/vnd.anser-web-funds-transfer-initiation" },
+ { "atx", "application/vnd.antix.game-component" },
+ { "mpkg", "application/vnd.apple.installer+xml" },
+ { "m3u8", "application/vnd.apple.mpegurl" },
+ { "swi", "application/vnd.aristanetworks.swi" },
+ { "iota", "application/vnd.astraea-software.iota" },
+ { "aep", "application/vnd.audiograph" },
+ { "mpm", "application/vnd.blueice.multipass" },
+ { "bmi", "application/vnd.bmi" },
+ { "rep", "application/vnd.businessobjects" },
+ { "cdxml", "application/vnd.chemdraw+xml" },
+ { "mmd", "application/vnd.chipnuts.karaoke-mmd" },
+ { "cdy", "application/vnd.cinderella" },
+ { "cla", "application/vnd.claymore" },
+ { "rp9", "application/vnd.cloanto.rp9" },
+ { "c4g", "application/vnd.clonk.c4group" },
+ { "c4d", "application/vnd.clonk.c4group" },
+ { "c4f", "application/vnd.clonk.c4group" },
+ { "c4p", "application/vnd.clonk.c4group" },
+ { "c4u", "application/vnd.clonk.c4group" },
+ { "c11amc", "application/vnd.cluetrust.cartomobile-config" },
+ { "c11amz", "application/vnd.cluetrust.cartomobile-config-pkg" },
+ { "csp", "application/vnd.commonspace" },
+ { "cdbcmsg", "application/vnd.contact.cmsg" },
+ { "cmc", "application/vnd.cosmocaller" },
+ { "clkx", "application/vnd.crick.clicker" },
+ { "clkk", "application/vnd.crick.clicker.keyboard" },
+ { "clkp", "application/vnd.crick.clicker.palette" },
+ { "clkt", "application/vnd.crick.clicker.template" },
+ { "clkw", "application/vnd.crick.clicker.wordbank" },
+ { "wbs", "application/vnd.criticaltools.wbs+xml" },
+ { "pml", "application/vnd.ctc-posml" },
+ { "ppd", "application/vnd.cups-ppd" },
+ { "car", "application/vnd.curl.car" },
+ { "pcurl", "application/vnd.curl.pcurl" },
+ { "dart", "application/vnd.dart" },
+ { "rdz", "application/vnd.data-vision.rdz" },
+ { "uvf", "application/vnd.dece.data" },
+ { "uvvf", "application/vnd.dece.data" },
+ { "uvd", "application/vnd.dece.data" },
+ { "uvvd", "application/vnd.dece.data" },
+ { "uvt", "application/vnd.dece.ttml+xml" },
+ { "uvvt", "application/vnd.dece.ttml+xml" },
+ { "uvx", "application/vnd.dece.unspecified" },
+ { "uvvx", "application/vnd.dece.unspecified" },
+ { "uvz", "application/vnd.dece.zip" },
+ { "uvvz", "application/vnd.dece.zip" },
+ { "fe_launch", "application/vnd.denovo.fcselayout-link" },
+ { "dna", "application/vnd.dna" },
+ { "mlp", "application/vnd.dolby.mlp" },
+ { "dpg", "application/vnd.dpgraph" },
+ { "dfac", "application/vnd.dreamfactory" },
+ { "kpxx", "application/vnd.ds-keypoint" },
+ { "ait", "application/vnd.dvb.ait" },
+ { "svc", "application/vnd.dvb.service" },
+ { "geo", "application/vnd.dynageo" },
+ { "mag", "application/vnd.ecowin.chart" },
+ { "nml", "application/vnd.enliven" },
+ { "esf", "application/vnd.epson.esf" },
+ { "msf", "application/vnd.epson.msf" },
+ { "qam", "application/vnd.epson.quickanime" },
+ { "slt", "application/vnd.epson.salt" },
+ { "ssf", "application/vnd.epson.ssf" },
+ { "es3", "application/vnd.eszigno3+xml" },
+ { "et3", "application/vnd.eszigno3+xml" },
+ { "ez2", "application/vnd.ezpix-album" },
+ { "ez3", "application/vnd.ezpix-package" },
+ { "fdf", "application/vnd.fdf" },
+ { "mseed", "application/vnd.fdsn.mseed" },
+ { "seed", "application/vnd.fdsn.seed" },
+ { "dataless", "application/vnd.fdsn.seed" },
+ { "gph", "application/vnd.flographit" },
+ { "ftc", "application/vnd.fluxtime.clip" },
+ { "fm", "application/vnd.framemaker" },
+ { "frame", "application/vnd.framemaker" },
+ { "maker", "application/vnd.framemaker" },
+ { "book", "application/vnd.framemaker" },
+ { "fnc", "application/vnd.frogans.fnc" },
+ { "ltf", "application/vnd.frogans.ltf" },
+ { "fsc", "application/vnd.fsc.weblaunch" },
+ { "oas", "application/vnd.fujitsu.oasys" },
+ { "oa2", "application/vnd.fujitsu.oasys2" },
+ { "oa3", "application/vnd.fujitsu.oasys3" },
+ { "fg5", "application/vnd.fujitsu.oasysgp" },
+ { "bh2", "application/vnd.fujitsu.oasysprs" },
+ { "ddd", "application/vnd.fujixerox.ddd" },
+ { "xdw", "application/vnd.fujixerox.docuworks" },
+ { "xbd", "application/vnd.fujixerox.docuworks.binder" },
+ { "fzs", "application/vnd.fuzzysheet" },
+ { "txd", "application/vnd.genomatix.tuxedo" },
+ { "ggb", "application/vnd.geogebra.file" },
+ { "ggt", "application/vnd.geogebra.tool" },
+ { "gex", "application/vnd.geometry-explorer" },
+ { "gre", "application/vnd.geometry-explorer" },
+ { "gxt", "application/vnd.geonext" },
+ { "g2w", "application/vnd.geoplan" },
+ { "g3w", "application/vnd.geospace" },
+ { "gmx", "application/vnd.gmx" },
+ { "kml", "application/vnd.google-earth.kml+xml" },
+ { "kmz", "application/vnd.google-earth.kmz" },
+ { "gqf", "application/vnd.grafeq" },
+ { "gqs", "application/vnd.grafeq" },
+ { "gac", "application/vnd.groove-account" },
+ { "ghf", "application/vnd.groove-help" },
+ { "gim", "application/vnd.groove-identity-message" },
+ { "grv", "application/vnd.groove-injector" },
+ { "gtm", "application/vnd.groove-tool-message" },
+ { "tpl", "application/vnd.groove-tool-template" },
+ { "vcg", "application/vnd.groove-vcard" },
+ { "hal", "application/vnd.hal+xml" },
+ { "zmm", "application/vnd.handheld-entertainment+xml" },
+ { "hbci", "application/vnd.hbci" },
+ { "les", "application/vnd.hhe.lesson-player" },
+ { "hpgl", "application/vnd.hp-hpgl" },
+ { "hpid", "application/vnd.hp-hpid" },
+ { "hps", "application/vnd.hp-hps" },
+ { "jlt", "application/vnd.hp-jlyt" },
+ { "pcl", "application/vnd.hp-pcl" },
+ { "pclxl", "application/vnd.hp-pclxl" },
+ { "sfd-hdstx", "application/vnd.hydrostatix.sof-data" },
+ { "mpy", "application/vnd.ibm.minipay" },
+ { "afp", "application/vnd.ibm.modcap" },
+ { "listafp", "application/vnd.ibm.modcap" },
+ { "list3820", "application/vnd.ibm.modcap" },
+ { "irm", "application/vnd.ibm.rights-management" },
+ { "sc", "application/vnd.ibm.secure-container" },
+ { "icc", "application/vnd.iccprofile" },
+ { "icm", "application/vnd.iccprofile" },
+ { "igl", "application/vnd.igloader" },
+ { "ivp", "application/vnd.immervision-ivp" },
+ { "ivu", "application/vnd.immervision-ivu" },
+ { "igm", "application/vnd.insors.igm" },
+ { "xpw", "application/vnd.intercon.formnet" },
+ { "xpx", "application/vnd.intercon.formnet" },
+ { "i2g", "application/vnd.intergeo" },
+ { "qbo", "application/vnd.intu.qbo" },
+ { "qfx", "application/vnd.intu.qfx" },
+ { "rcprofile", "application/vnd.ipunplugged.rcprofile" },
+ { "irp", "application/vnd.irepository.package+xml" },
+ { "xpr", "application/vnd.is-xpr" },
+ { "fcs", "application/vnd.isac.fcs" },
+ { "jam", "application/vnd.jam" },
+ { "rms", "application/vnd.jcp.javame.midlet-rms" },
+ { "jisp", "application/vnd.jisp" },
+ { "joda", "application/vnd.joost.joda-archive" },
+ { "ktz", "application/vnd.kahootz" },
+ { "ktr", "application/vnd.kahootz" },
+ { "karbon", "application/vnd.kde.karbon" },
+ { "chrt", "application/vnd.kde.kchart" },
+ { "kfo", "application/vnd.kde.kformula" },
+ { "flw", "application/vnd.kde.kivio" },
+ { "kon", "application/vnd.kde.kontour" },
+ { "kpr", "application/vnd.kde.kpresenter" },
+ { "kpt", "application/vnd.kde.kpresenter" },
+ { "ksp", "application/vnd.kde.kspread" },
+ { "kwd", "application/vnd.kde.kword" },
+ { "kwt", "application/vnd.kde.kword" },
+ { "htke", "application/vnd.kenameaapp" },
+ { "kia", "application/vnd.kidspiration" },
+ { "kne", "application/vnd.kinar" },
+ { "knp", "application/vnd.kinar" },
+ { "skp", "application/vnd.koan" },
+ { "skd", "application/vnd.koan" },
+ { "skt", "application/vnd.koan" },
+ { "skm", "application/vnd.koan" },
+ { "sse", "application/vnd.kodak-descriptor" },
+ { "lasxml", "application/vnd.las.las+xml" },
+ { "lbd", "application/vnd.llamagraphics.life-balance.desktop" },
+ { "lbe", "application/vnd.llamagraphics.life-balance.exchange+xml" },
+ { "123", "application/vnd.lotus-1-2-3" },
+ { "apr", "application/vnd.lotus-approach" },
+ { "pre", "application/vnd.lotus-freelance" },
+ { "nsf", "application/vnd.lotus-notes" },
+ { "org", "application/vnd.lotus-organizer" },
+ { "scm", "application/vnd.lotus-screencam" },
+ { "lwp", "application/vnd.lotus-wordpro" },
+ { "portpkg", "application/vnd.macports.portpkg" },
+ { "mcd", "application/vnd.mcd" },
+ { "mc1", "application/vnd.medcalcdata" },
+ { "cdkey", "application/vnd.mediastation.cdkey" },
+ { "mwf", "application/vnd.mfer" },
+ { "mfm", "application/vnd.mfmp" },
+ { "flo", "application/vnd.micrografx.flo" },
+ { "igx", "application/vnd.micrografx.igx" },
+ { "mif", "application/vnd.mif" },
+ { "daf", "application/vnd.mobius.daf" },
+ { "dis", "application/vnd.mobius.dis" },
+ { "mbk", "application/vnd.mobius.mbk" },
+ { "mqy", "application/vnd.mobius.mqy" },
+ { "msl", "application/vnd.mobius.msl" },
+ { "plc", "application/vnd.mobius.plc" },
+ { "txf", "application/vnd.mobius.txf" },
+ { "mpn", "application/vnd.mophun.application" },
+ { "mpc", "application/vnd.mophun.certificate" },
+ { "xul", "application/vnd.mozilla.xul+xml" },
+ { "cil", "application/vnd.ms-artgalry" },
+ { "cab", "application/vnd.ms-cab-compressed" },
+ { "xls", "application/vnd.ms-excel" },
+ { "xlm", "application/vnd.ms-excel" },
+ { "xla", "application/vnd.ms-excel" },
+ { "xlc", "application/vnd.ms-excel" },
+ { "xlt", "application/vnd.ms-excel" },
+ { "xlw", "application/vnd.ms-excel" },
+ { "xlam", "application/vnd.ms-excel.addin.macroenabled.12" },
+ { "xlsb", "application/vnd.ms-excel.sheet.binary.macroenabled.12" },
+ { "xlsm", "application/vnd.ms-excel.sheet.macroenabled.12" },
+ { "xltm", "application/vnd.ms-excel.template.macroenabled.12" },
+ { "eot", "application/vnd.ms-fontobject" },
+ { "chm", "application/vnd.ms-htmlhelp" },
+ { "ims", "application/vnd.ms-ims" },
+ { "lrm", "application/vnd.ms-lrm" },
+ { "thmx", "application/vnd.ms-officetheme" },
+ { "cat", "application/vnd.ms-pki.seccat" },
+ { "stl", "application/vnd.ms-pki.stl" },
+ { "ppt", "application/vnd.ms-powerpoint" },
+ { "pps", "application/vnd.ms-powerpoint" },
+ { "pot", "application/vnd.ms-powerpoint" },
+ { "ppam", "application/vnd.ms-powerpoint.addin.macroenabled.12" },
+ { "pptm", "application/vnd.ms-powerpoint.presentation.macroenabled.12" },
+ { "sldm", "application/vnd.ms-powerpoint.slide.macroenabled.12" },
+ { "ppsm", "application/vnd.ms-powerpoint.slideshow.macroenabled.12" },
+ { "potm", "application/vnd.ms-powerpoint.template.macroenabled.12" },
+ { "mpp", "application/vnd.ms-project" },
+ { "mpt", "application/vnd.ms-project" },
+ { "docm", "application/vnd.ms-word.document.macroenabled.12" },
+ { "dotm", "application/vnd.ms-word.template.macroenabled.12" },
+ { "wps", "application/vnd.ms-works" },
+ { "wks", "application/vnd.ms-works" },
+ { "wcm", "application/vnd.ms-works" },
+ { "wdb", "application/vnd.ms-works" },
+ { "wpl", "application/vnd.ms-wpl" },
+ { "xps", "application/vnd.ms-xpsdocument" },
+ { "mseq", "application/vnd.mseq" },
+ { "mus", "application/vnd.musician" },
+ { "msty", "application/vnd.muvee.style" },
+ { "taglet", "application/vnd.mynfc" },
+ { "nlu", "application/vnd.neurolanguage.nlu" },
+ { "ntf", "application/vnd.nitf" },
+ { "nitf", "application/vnd.nitf" },
+ { "nnd", "application/vnd.noblenet-directory" },
+ { "nns", "application/vnd.noblenet-sealer" },
+ { "nnw", "application/vnd.noblenet-web" },
+ { "ngdat", "application/vnd.nokia.n-gage.data" },
+ { "n-gage", "application/vnd.nokia.n-gage.symbian.install" },
+ { "rpst", "application/vnd.nokia.radio-preset" },
+ { "rpss", "application/vnd.nokia.radio-presets" },
+ { "edm", "application/vnd.novadigm.edm" },
+ { "edx", "application/vnd.novadigm.edx" },
+ { "ext", "application/vnd.novadigm.ext" },
+ { "odc", "application/vnd.oasis.opendocument.chart" },
+ { "otc", "application/vnd.oasis.opendocument.chart-template" },
+ { "odb", "application/vnd.oasis.opendocument.database" },
+ { "odf", "application/vnd.oasis.opendocument.formula" },
+ { "odft", "application/vnd.oasis.opendocument.formula-template" },
+ { "odg", "application/vnd.oasis.opendocument.graphics" },
+ { "otg", "application/vnd.oasis.opendocument.graphics-template" },
+ { "odi", "application/vnd.oasis.opendocument.image" },
+ { "oti", "application/vnd.oasis.opendocument.image-template" },
+ { "odp", "application/vnd.oasis.opendocument.presentation" },
+ { "otp", "application/vnd.oasis.opendocument.presentation-template" },
+ { "ods", "application/vnd.oasis.opendocument.spreadsheet" },
+ { "ots", "application/vnd.oasis.opendocument.spreadsheet-template" },
+ { "odt", "application/vnd.oasis.opendocument.text" },
+ { "odm", "application/vnd.oasis.opendocument.text-master" },
+ { "ott", "application/vnd.oasis.opendocument.text-template" },
+ { "oth", "application/vnd.oasis.opendocument.text-web" },
+ { "xo", "application/vnd.olpc-sugar" },
+ { "dd2", "application/vnd.oma.dd2+xml" },
+ { "oxt", "application/vnd.openofficeorg.extension" },
+ { "pptx", "application/vnd.openxmlformats-officedocument.presentationml.presentation" },
+ { "sldx", "application/vnd.openxmlformats-officedocument.presentationml.slide" },
+ { "ppsx", "application/vnd.openxmlformats-officedocument.presentationml.slideshow" },
+ { "potx", "application/vnd.openxmlformats-officedocument.presentationml.template" },
+ { "xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" },
+ { "xltx", "application/vnd.openxmlformats-officedocument.spreadsheetml.template" },
+ { "docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document" },
+ { "dotx", "application/vnd.openxmlformats-officedocument.wordprocessingml.template" },
+ { "mgp", "application/vnd.osgeo.mapguide.package" },
+ { "dp", "application/vnd.osgi.dp" },
+ { "esa", "application/vnd.osgi.subsystem" },
+ { "pdb", "application/vnd.palm" },
+ { "pqa", "application/vnd.palm" },
+ { "oprc", "application/vnd.palm" },
+ { "paw", "application/vnd.pawaafile" },
+ { "str", "application/vnd.pg.format" },
+ { "ei6", "application/vnd.pg.osasli" },
+ { "efif", "application/vnd.picsel" },
+ { "wg", "application/vnd.pmi.widget" },
+ { "plf", "application/vnd.pocketlearn" },
+ { "pbd", "application/vnd.powerbuilder6" },
+ { "box", "application/vnd.previewsystems.box" },
+ { "mgz", "application/vnd.proteus.magazine" },
+ { "qps", "application/vnd.publishare-delta-tree" },
+ { "ptid", "application/vnd.pvi.ptid1" },
+ { "qxd", "application/vnd.quark.quarkxpress" },
+ { "qxt", "application/vnd.quark.quarkxpress" },
+ { "qwd", "application/vnd.quark.quarkxpress" },
+ { "qwt", "application/vnd.quark.quarkxpress" },
+ { "qxl", "application/vnd.quark.quarkxpress" },
+ { "qxb", "application/vnd.quark.quarkxpress" },
+ { "bed", "application/vnd.realvnc.bed" },
+ { "mxl", "application/vnd.recordare.musicxml" },
+ { "musicxml", "application/vnd.recordare.musicxml+xml" },
+ { "cryptonote", "application/vnd.rig.cryptonote" },
+ { "cod", "application/vnd.rim.cod" },
+ { "rm", "application/vnd.rn-realmedia" },
+ { "rmvb", "application/vnd.rn-realmedia-vbr" },
+ { "link66", "application/vnd.route66.link66+xml" },
+ { "st", "application/vnd.sailingtracker.track" },
+ { "see", "application/vnd.seemail" },
+ { "sema", "application/vnd.sema" },
+ { "semd", "application/vnd.semd" },
+ { "semf", "application/vnd.semf" },
+ { "ifm", "application/vnd.shana.informed.formdata" },
+ { "itp", "application/vnd.shana.informed.formtemplate" },
+ { "iif", "application/vnd.shana.informed.interchange" },
+ { "ipk", "application/vnd.shana.informed.package" },
+ { "twd", "application/vnd.simtech-mindmapper" },
+ { "twds", "application/vnd.simtech-mindmapper" },
+ { "mmf", "application/vnd.smaf" },
+ { "teacher", "application/vnd.smart.teacher" },
+ { "sdkm", "application/vnd.solent.sdkm+xml" },
+ { "sdkd", "application/vnd.solent.sdkm+xml" },
+ { "dxp", "application/vnd.spotfire.dxp" },
+ { "sfs", "application/vnd.spotfire.sfs" },
+ { "sdc", "application/vnd.stardivision.calc" },
+ { "sda", "application/vnd.stardivision.draw" },
+ { "sdd", "application/vnd.stardivision.impress" },
+ { "smf", "application/vnd.stardivision.math" },
+ { "sdw", "application/vnd.stardivision.writer" },
+ { "vor", "application/vnd.stardivision.writer" },
+ { "sgl", "application/vnd.stardivision.writer-global" },
+ { "smzip", "application/vnd.stepmania.package" },
+ { "sm", "application/vnd.stepmania.stepchart" },
+ { "sxc", "application/vnd.sun.xml.calc" },
+ { "stc", "application/vnd.sun.xml.calc.template" },
+ { "sxd", "application/vnd.sun.xml.draw" },
+ { "std", "application/vnd.sun.xml.draw.template" },
+ { "sxi", "application/vnd.sun.xml.impress" },
+ { "sti", "application/vnd.sun.xml.impress.template" },
+ { "sxm", "application/vnd.sun.xml.math" },
+ { "sxw", "application/vnd.sun.xml.writer" },
+ { "sxg", "application/vnd.sun.xml.writer.global" },
+ { "stw", "application/vnd.sun.xml.writer.template" },
+ { "sus", "application/vnd.sus-calendar" },
+ { "susp", "application/vnd.sus-calendar" },
+ { "svd", "application/vnd.svd" },
+ { "sis", "application/vnd.symbian.install" },
+ { "sisx", "application/vnd.symbian.install" },
+ { "xsm", "application/vnd.syncml+xml" },
+ { "bdm", "application/vnd.syncml.dm+wbxml" },
+ { "xdm", "application/vnd.syncml.dm+xml" },
+ { "tao", "application/vnd.tao.intent-module-archive" },
+ { "pcap", "application/vnd.tcpdump.pcap" },
+ { "cap", "application/vnd.tcpdump.pcap" },
+ { "dmp", "application/vnd.tcpdump.pcap" },
+ { "tmo", "application/vnd.tmobile-livetv" },
+ { "tpt", "application/vnd.trid.tpt" },
+ { "mxs", "application/vnd.triscape.mxs" },
+ { "tra", "application/vnd.trueapp" },
+ { "ufd", "application/vnd.ufdl" },
+ { "ufdl", "application/vnd.ufdl" },
+ { "utz", "application/vnd.uiq.theme" },
+ { "umj", "application/vnd.umajin" },
+ { "unityweb", "application/vnd.unity" },
+ { "uoml", "application/vnd.uoml+xml" },
+ { "vcx", "application/vnd.vcx" },
+ { "vsd", "application/vnd.visio" },
+ { "vst", "application/vnd.visio" },
+ { "vss", "application/vnd.visio" },
+ { "vsw", "application/vnd.visio" },
+ { "vis", "application/vnd.visionary" },
+ { "vsf", "application/vnd.vsf" },
+ { "wbxml", "application/vnd.wap.wbxml" },
+ { "wmlc", "application/vnd.wap.wmlc" },
+ { "wmlsc", "application/vnd.wap.wmlscriptc" },
+ { "wtb", "application/vnd.webturbo" },
+ { "nbp", "application/vnd.wolfram.player" },
+ { "wpd", "application/vnd.wordperfect" },
+ { "wqd", "application/vnd.wqd" },
+ { "stf", "application/vnd.wt.stf" },
+ { "xar", "application/vnd.xara" },
+ { "xfdl", "application/vnd.xfdl" },
+ { "hvd", "application/vnd.yamaha.hv-dic" },
+ { "hvs", "application/vnd.yamaha.hv-script" },
+ { "hvp", "application/vnd.yamaha.hv-voice" },
+ { "osf", "application/vnd.yamaha.openscoreformat" },
+ { "osfpvg", "application/vnd.yamaha.openscoreformat.osfpvg+xml" },
+ { "saf", "application/vnd.yamaha.smaf-audio" },
+ { "spf", "application/vnd.yamaha.smaf-phrase" },
+ { "cmp", "application/vnd.yellowriver-custom-menu" },
+ { "zir", "application/vnd.zul" },
+ { "zirz", "application/vnd.zul" },
+ { "zaz", "application/vnd.zzazz.deck+xml" },
+ { "vxml", "application/voicexml+xml" },
+ { "wgt", "application/widget" },
+ { "hlp", "application/winhlp" },
+ { "wsdl", "application/wsdl+xml" },
+ { "wspolicy", "application/wspolicy+xml" },
+ { "7z", "application/x-7z-compressed" },
+ { "abw", "application/x-abiword" },
+ { "ace", "application/x-ace-compressed" },
+ { "dmg", "application/x-apple-diskimage" },
+ { "aab", "application/x-authorware-bin" },
+ { "x32", "application/x-authorware-bin" },
+ { "u32", "application/x-authorware-bin" },
+ { "vox", "application/x-authorware-bin" },
+ { "aam", "application/x-authorware-map" },
+ { "aas", "application/x-authorware-seg" },
+ { "bcpio", "application/x-bcpio" },
+ { "torrent", "application/x-bittorrent" },
+ { "blb", "application/x-blorb" },
+ { "blorb", "application/x-blorb" },
+ { "bz", "application/x-bzip" },
+ { "bz2", "application/x-bzip2" },
+ { "boz", "application/x-bzip2" },
+ { "cbr", "application/x-cbr" },
+ { "cba", "application/x-cbr" },
+ { "cbt", "application/x-cbr" },
+ { "cbz", "application/x-cbr" },
+ { "cb7", "application/x-cbr" },
+ { "vcd", "application/x-cdlink" },
+ { "cfs", "application/x-cfs-compressed" },
+ { "chat", "application/x-chat" },
+ { "pgn", "application/x-chess-pgn" },
+ { "nsc", "application/x-conference" },
+ { "cpio", "application/x-cpio" },
+ { "csh", "application/x-csh" },
+ { "deb", "application/x-debian-package" },
+ { "udeb", "application/x-debian-package" },
+ { "dgc", "application/x-dgc-compressed" },
+ { "dir", "application/x-director" },
+ { "dcr", "application/x-director" },
+ { "dxr", "application/x-director" },
+ { "cst", "application/x-director" },
+ { "cct", "application/x-director" },
+ { "cxt", "application/x-director" },
+ { "w3d", "application/x-director" },
+ { "fgd", "application/x-director" },
+ { "swa", "application/x-director" },
+ { "wad", "application/x-doom" },
+ { "ncx", "application/x-dtbncx+xml" },
+ { "dtb", "application/x-dtbook+xml" },
+ { "res", "application/x-dtbresource+xml" },
+ { "dvi", "application/x-dvi" },
+ { "evy", "application/x-envoy" },
+ { "eva", "application/x-eva" },
+ { "bdf", "application/x-font-bdf" },
+ { "gsf", "application/x-font-ghostscript" },
+ { "psf", "application/x-font-linux-psf" },
+ { "otf", "application/x-font-otf" },
+ { "pcf", "application/x-font-pcf" },
+ { "snf", "application/x-font-snf" },
+ { "ttf", "application/x-font-ttf" },
+ { "ttc", "application/x-font-ttf" },
+ { "pfa", "application/x-font-type1" },
+ { "pfb", "application/x-font-type1" },
+ { "pfm", "application/x-font-type1" },
+ { "afm", "application/x-font-type1" },
+ { "woff", "application/font-woff" },
+ { "arc", "application/x-freearc" },
+ { "spl", "application/x-futuresplash" },
+ { "gca", "application/x-gca-compressed" },
+ { "ulx", "application/x-glulx" },
+ { "gnumeric", "application/x-gnumeric" },
+ { "gramps", "application/x-gramps-xml" },
+ { "gtar", "application/x-gtar" },
+ { "hdf", "application/x-hdf" },
+ { "install", "application/x-install-instructions" },
+ { "iso", "application/x-iso9660-image" },
+ { "jnlp", "application/x-java-jnlp-file" },
+ { "latex", "application/x-latex" },
+ { "lzh", "application/x-lzh-compressed" },
+ { "lha", "application/x-lzh-compressed" },
+ { "mie", "application/x-mie" },
+ { "prc", "application/x-mobipocket-ebook" },
+ { "mobi", "application/x-mobipocket-ebook" },
+ { "application", "application/x-ms-application" },
+ { "lnk", "application/x-ms-shortcut" },
+ { "wmd", "application/x-ms-wmd" },
+ { "wmz", "application/x-msmetafile" },
+ { "xbap", "application/x-ms-xbap" },
+ { "mdb", "application/x-msaccess" },
+ { "obd", "application/x-msbinder" },
+ { "crd", "application/x-mscardfile" },
+ { "clp", "application/x-msclip" },
+ { "exe", "application/x-msdownload" },
+ { "dll", "application/x-msdownload" },
+ { "com", "application/x-msdownload" },
+ { "bat", "application/x-msdownload" },
+ { "msi", "application/x-msdownload" },
+ { "mvb", "application/x-msmediaview" },
+ { "m13", "application/x-msmediaview" },
+ { "m14", "application/x-msmediaview" },
+ { "wmf", "application/x-msmetafile" },
+ { "emf", "application/x-msmetafile" },
+ { "emz", "application/x-msmetafile" },
+ { "mny", "application/x-msmoney" },
+ { "pub", "application/x-mspublisher" },
+ { "scd", "application/x-msschedule" },
+ { "trm", "application/x-msterminal" },
+ { "wri", "application/x-mswrite" },
+ { "nc", "application/x-netcdf" },
+ { "cdf", "application/x-netcdf" },
+ { "nzb", "application/x-nzb" },
+ { "p12", "application/x-pkcs12" },
+ { "pfx", "application/x-pkcs12" },
+ { "p7b", "application/x-pkcs7-certificates" },
+ { "spc", "application/x-pkcs7-certificates" },
+ { "p7r", "application/x-pkcs7-certreqresp" },
+ { "rar", "application/x-rar-compressed" },
+ { "ris", "application/x-research-info-systems" },
+ { "sh", "application/x-sh" },
+ { "shar", "application/x-shar" },
+ { "swf", "application/x-shockwave-flash" },
+ { "xap", "application/x-silverlight-app" },
+ { "sql", "application/x-sql" },
+ { "sit", "application/x-stuffit" },
+ { "sitx", "application/x-stuffitx" },
+ { "srt", "application/x-subrip" },
+ { "sv4cpio", "application/x-sv4cpio" },
+ { "sv4crc", "application/x-sv4crc" },
+ { "t3", "application/x-t3vm-image" },
+ { "gam", "application/x-tads" },
+ { "tar", "application/x-tar" },
+ { "tcl", "application/x-tcl" },
+ { "tex", "application/x-tex" },
+ { "tfm", "application/x-tex-tfm" },
+ { "texinfo", "application/x-texinfo" },
+ { "texi", "application/x-texinfo" },
+ { "obj", "application/x-tgif" },
+ { "ustar", "application/x-ustar" },
+ { "src", "application/x-wais-source" },
+ { "der", "application/x-x509-ca-cert" },
+ { "crt", "application/x-x509-ca-cert" },
+ { "fig", "application/x-xfig" },
+ { "xlf", "application/x-xliff+xml" },
+ { "xpi", "application/x-xpinstall" },
+ { "xz", "application/x-xz" },
+ { "z1", "application/x-zmachine" },
+ { "z2", "application/x-zmachine" },
+ { "z3", "application/x-zmachine" },
+ { "z4", "application/x-zmachine" },
+ { "z5", "application/x-zmachine" },
+ { "z6", "application/x-zmachine" },
+ { "z7", "application/x-zmachine" },
+ { "z8", "application/x-zmachine" },
+ { "xaml", "application/xaml+xml" },
+ { "xdf", "application/xcap-diff+xml" },
+ { "xenc", "application/xenc+xml" },
+ { "xhtml", "application/xhtml+xml" },
+ { "xht", "application/xhtml+xml" },
+ { "xml", "application/xml" },
+ { "xsl", "application/xml" },
+ { "dtd", "application/xml-dtd" },
+ { "xop", "application/xop+xml" },
+ { "xpl", "application/xproc+xml" },
+ { "xslt", "application/xslt+xml" },
+ { "xspf", "application/xspf+xml" },
+ { "mxml", "application/xv+xml" },
+ { "xhvml", "application/xv+xml" },
+ { "xvml", "application/xv+xml" },
+ { "xvm", "application/xv+xml" },
+ { "yang", "application/yang" },
+ { "yin", "application/yin+xml" },
+ { "zip", "application/zip" },
+ { "adp", "audio/adpcm" },
+ { "au", "audio/basic" },
+ { "snd", "audio/basic" },
+ { "mid", "audio/midi" },
+ { "midi", "audio/midi" },
+ { "kar", "audio/midi" },
+ { "rmi", "audio/midi" },
+ { "mp4a", "audio/mp4" },
+ { "mpga", "audio/mpeg" },
+ { "mp2", "audio/mpeg" },
+ { "mp2a", "audio/mpeg" },
+ { "mp3", "audio/mpeg" },
+ { "m2a", "audio/mpeg" },
+ { "m3a", "audio/mpeg" },
+ { "oga", "audio/ogg" },
+ { "ogg", "audio/ogg" },
+ { "spx", "audio/ogg" },
+ { "s3m", "audio/s3m" },
+ { "sil", "audio/silk" },
+ { "uva", "audio/vnd.dece.audio" },
+ { "uvva", "audio/vnd.dece.audio" },
+ { "eol", "audio/vnd.digital-winds" },
+ { "dra", "audio/vnd.dra" },
+ { "dts", "audio/vnd.dts" },
+ { "dtshd", "audio/vnd.dts.hd" },
+ { "lvp", "audio/vnd.lucent.voice" },
+ { "pya", "audio/vnd.ms-playready.media.pya" },
+ { "ecelp4800", "audio/vnd.nuera.ecelp4800" },
+ { "ecelp7470", "audio/vnd.nuera.ecelp7470" },
+ { "ecelp9600", "audio/vnd.nuera.ecelp9600" },
+ { "rip", "audio/vnd.rip" },
+ { "weba", "audio/webm" },
+ { "aac", "audio/x-aac" },
+ { "aif", "audio/x-aiff" },
+ { "aiff", "audio/x-aiff" },
+ { "aifc", "audio/x-aiff" },
+ { "caf", "audio/x-caf" },
+ { "flac", "audio/x-flac" },
+ { "mka", "audio/x-matroska" },
+ { "m3u", "audio/x-mpegurl" },
+ { "wax", "audio/x-ms-wax" },
+ { "wma", "audio/x-ms-wma" },
+ { "ram", "audio/x-pn-realaudio" },
+ { "ra", "audio/x-pn-realaudio" },
+ { "rmp", "audio/x-pn-realaudio-plugin" },
+ { "wav", "audio/x-wav" },
+ { "xm", "audio/xm" },
+ { "cdx", "chemical/x-cdx" },
+ { "cif", "chemical/x-cif" },
+ { "cmdf", "chemical/x-cmdf" },
+ { "cml", "chemical/x-cml" },
+ { "csml", "chemical/x-csml" },
+ { "xyz", "chemical/x-xyz" },
+ { "bmp", "image/bmp" },
+ { "cgm", "image/cgm" },
+ { "g3", "image/g3fax" },
+ { "gif", "image/gif" },
+ { "ief", "image/ief" },
+ { "jpeg", "image/jpeg" },
+ { "jpg", "image/jpeg" },
+ { "jpe", "image/jpeg" },
+ { "ktx", "image/ktx" },
+ { "png", "image/png" },
+ { "btif", "image/prs.btif" },
+ { "sgi", "image/sgi" },
+ { "svg", "image/svg+xml" },
+ { "svgz", "image/svg+xml" },
+ { "tiff", "image/tiff" },
+ { "tif", "image/tiff" },
+ { "psd", "image/vnd.adobe.photoshop" },
+ { "uvi", "image/vnd.dece.graphic" },
+ { "uvvi", "image/vnd.dece.graphic" },
+ { "uvg", "image/vnd.dece.graphic" },
+ { "uvvg", "image/vnd.dece.graphic" },
+ { "sub", "text/vnd.dvb.subtitle" },
+ { "djvu", "image/vnd.djvu" },
+ { "djv", "image/vnd.djvu" },
+ { "dwg", "image/vnd.dwg" },
+ { "dxf", "image/vnd.dxf" },
+ { "fbs", "image/vnd.fastbidsheet" },
+ { "fpx", "image/vnd.fpx" },
+ { "fst", "image/vnd.fst" },
+ { "mmr", "image/vnd.fujixerox.edmics-mmr" },
+ { "rlc", "image/vnd.fujixerox.edmics-rlc" },
+ { "mdi", "image/vnd.ms-modi" },
+ { "wdp", "image/vnd.ms-photo" },
+ { "npx", "image/vnd.net-fpx" },
+ { "wbmp", "image/vnd.wap.wbmp" },
+ { "xif", "image/vnd.xiff" },
+ { "webp", "image/webp" },
+ { "3ds", "image/x-3ds" },
+ { "ras", "image/x-cmu-raster" },
+ { "cmx", "image/x-cmx" },
+ { "fh", "image/x-freehand" },
+ { "fhc", "image/x-freehand" },
+ { "fh4", "image/x-freehand" },
+ { "fh5", "image/x-freehand" },
+ { "fh7", "image/x-freehand" },
+ { "ico", "image/x-icon" },
+ { "sid", "image/x-mrsid-image" },
+ { "pcx", "image/x-pcx" },
+ { "pic", "image/x-pict" },
+ { "pct", "image/x-pict" },
+ { "pnm", "image/x-portable-anymap" },
+ { "pbm", "image/x-portable-bitmap" },
+ { "pgm", "image/x-portable-graymap" },
+ { "ppm", "image/x-portable-pixmap" },
+ { "rgb", "image/x-rgb" },
+ { "tga", "image/x-tga" },
+ { "xbm", "image/x-xbitmap" },
+ { "xpm", "image/x-xpixmap" },
+ { "xwd", "image/x-xwindowdump" },
+ { "eml", "message/rfc822" },
+ { "mime", "message/rfc822" },
+ { "igs", "model/iges" },
+ { "iges", "model/iges" },
+ { "msh", "model/mesh" },
+ { "mesh", "model/mesh" },
+ { "silo", "model/mesh" },
+ { "dae", "model/vnd.collada+xml" },
+ { "dwf", "model/vnd.dwf" },
+ { "gdl", "model/vnd.gdl" },
+ { "gtw", "model/vnd.gtw" },
+ { "mts", "model/vnd.mts" },
+ { "vtu", "model/vnd.vtu" },
+ { "wrl", "model/vrml" },
+ { "vrml", "model/vrml" },
+ { "x3db", "model/x3d+binary" },
+ { "x3dbz", "model/x3d+binary" },
+ { "x3dv", "model/x3d+vrml" },
+ { "x3dvz", "model/x3d+vrml" },
+ { "x3d", "model/x3d+xml" },
+ { "x3dz", "model/x3d+xml" },
+ { "appcache", "text/cache-manifest" },
+ { "ics", "text/calendar" },
+ { "ifb", "text/calendar" },
+ { "css", "text/css" },
+ { "csv", "text/csv" },
+ { "html", "text/html" },
+ { "htm", "text/html" },
+ { "n3", "text/n3" },
+ { "txt", "text/plain" },
+ { "text", "text/plain" },
+ { "conf", "text/plain" },
+ { "def", "text/plain" },
+ { "list", "text/plain" },
+ { "log", "text/plain" },
+ { "in", "text/plain" },
+ { "dsc", "text/prs.lines.tag" },
+ { "rtx", "text/richtext" },
+ { "sgml", "text/sgml" },
+ { "sgm", "text/sgml" },
+ { "tsv", "text/tab-separated-values" },
+ { "t", "text/troff" },
+ { "tr", "text/troff" },
+ { "roff", "text/troff" },
+ { "man", "text/troff" },
+ { "me", "text/troff" },
+ { "ms", "text/troff" },
+ { "ttl", "text/turtle" },
+ { "uri", "text/uri-list" },
+ { "uris", "text/uri-list" },
+ { "urls", "text/uri-list" },
+ { "vcard", "text/vcard" },
+ { "curl", "text/vnd.curl" },
+ { "dcurl", "text/vnd.curl.dcurl" },
+ { "scurl", "text/vnd.curl.scurl" },
+ { "mcurl", "text/vnd.curl.mcurl" },
+ { "fly", "text/vnd.fly" },
+ { "flx", "text/vnd.fmi.flexstor" },
+ { "gv", "text/vnd.graphviz" },
+ { "3dml", "text/vnd.in3d.3dml" },
+ { "spot", "text/vnd.in3d.spot" },
+ { "jad", "text/vnd.sun.j2me.app-descriptor" },
+ { "wml", "text/vnd.wap.wml" },
+ { "wmls", "text/vnd.wap.wmlscript" },
+ { "s", "text/x-asm" },
+ { "asm", "text/x-asm" },
+ { "c", "text/x-c" },
+ { "cc", "text/x-c" },
+ { "cxx", "text/x-c" },
+ { "cpp", "text/x-c" },
+ { "h", "text/x-c" },
+ { "hh", "text/x-c" },
+ { "dic", "text/x-c" },
+ { "f", "text/x-fortran" },
+ { "for", "text/x-fortran" },
+ { "f77", "text/x-fortran" },
+ { "f90", "text/x-fortran" },
+ { "java", "text/x-java-source" },
+ { "opml", "text/x-opml" },
+ { "p", "text/x-pascal" },
+ { "pas", "text/x-pascal" },
+ { "nfo", "text/x-nfo" },
+ { "etx", "text/x-setext" },
+ { "sfv", "text/x-sfv" },
+ { "uu", "text/x-uuencode" },
+ { "vcs", "text/x-vcalendar" },
+ { "vcf", "text/x-vcard" },
+ { "3gp", "video/3gpp" },
+ { "3g2", "video/3gpp2" },
+ { "h261", "video/h261" },
+ { "h263", "video/h263" },
+ { "h264", "video/h264" },
+ { "jpgv", "video/jpeg" },
+ { "jpm", "video/jpm" },
+ { "jpgm", "video/jpm" },
+ { "mj2", "video/mj2" },
+ { "mjp2", "video/mj2" },
+ { "mp4", "video/mp4" },
+ { "mp4v", "video/mp4" },
+ { "mpg4", "video/mp4" },
+ { "mpeg", "video/mpeg" },
+ { "mpg", "video/mpeg" },
+ { "mpe", "video/mpeg" },
+ { "m1v", "video/mpeg" },
+ { "m2v", "video/mpeg" },
+ { "ogv", "video/ogg" },
+ { "qt", "video/quicktime" },
+ { "mov", "video/quicktime" },
+ { "uvh", "video/vnd.dece.hd" },
+ { "uvvh", "video/vnd.dece.hd" },
+ { "uvm", "video/vnd.dece.mobile" },
+ { "uvvm", "video/vnd.dece.mobile" },
+ { "uvp", "video/vnd.dece.pd" },
+ { "uvvp", "video/vnd.dece.pd" },
+ { "uvs", "video/vnd.dece.sd" },
+ { "uvvs", "video/vnd.dece.sd" },
+ { "uvv", "video/vnd.dece.video" },
+ { "uvvv", "video/vnd.dece.video" },
+ { "dvb", "video/vnd.dvb.file" },
+ { "fvt", "video/vnd.fvt" },
+ { "mxu", "video/vnd.mpegurl" },
+ { "m4u", "video/vnd.mpegurl" },
+ { "pyv", "video/vnd.ms-playready.media.pyv" },
+ { "uvu", "video/vnd.uvvu.mp4" },
+ { "uvvu", "video/vnd.uvvu.mp4" },
+ { "viv", "video/vnd.vivo" },
+ { "webm", "video/webm" },
+ { "f4v", "video/x-f4v" },
+ { "fli", "video/x-fli" },
+ { "flv", "video/x-flv" },
+ { "m4v", "video/x-m4v" },
+ { "mkv", "video/x-matroska" },
+ { "mk3d", "video/x-matroska" },
+ { "mks", "video/x-matroska" },
+ { "mng", "video/x-mng" },
+ { "asf", "video/x-ms-asf" },
+ { "asx", "video/x-ms-asf" },
+ { "vob", "video/x-ms-vob" },
+ { "wm", "video/x-ms-wm" },
+ { "wmv", "video/x-ms-wmv" },
+ { "wmx", "video/x-ms-wmx" },
+ { "wvx", "video/x-ms-wvx" },
+ { "avi", "video/x-msvideo" },
+ { "movie", "video/x-sgi-movie" },
+ { "smv", "video/x-smv" },
+ { "ice", "x-conference/x-cooltalk" },
+ { NULL, NULL }
+};
+
+#endif /* PHP_CLI_SERVER_MIME_TYPE_MAP_H */
+
+/*
+ * Local variables:
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ * vim600: noet sw=4 ts=4 fdm=marker
+ * vim<600: noet sw=4 ts=4
+ */
diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c
index 9daa382eec..7c971176b6 100644
--- a/sapi/cli/php_cli.c
+++ b/sapi/cli/php_cli.c
@@ -320,7 +320,7 @@ static int sapi_cli_ub_write(const char *str, uint str_length TSRMLS_DC) /* {{{
}
/* }}} */
-static void sapi_cli_flush(void *server_context) /* {{{ */
+static void sapi_cli_flush(void *server_context TSRMLS_DC) /* {{{ */
{
/* Ignore EBADF here, it's caused by the fact that STDIN/STDOUT/STDERR streams
* are/could be closed before fflush() is called.
@@ -870,7 +870,7 @@ static int do_cli(int argc, char **argv TSRMLS_DC) /* {{{ */
break;
case 'z': /* load extension file */
- zend_load_extension(php_optarg);
+ zend_load_extension(php_optarg TSRMLS_CC);
break;
case 'H':
hide_argv = 1;
@@ -1024,7 +1024,7 @@ static int do_cli(int argc, char **argv TSRMLS_DC) /* {{{ */
/* Zeev might want to do something with this one day */
case PHP_MODE_INDENT:
open_file_for_scanning(&file_handle TSRMLS_CC);
- zend_indent();
+ zend_indent(TSRMLS_C);
zend_file_handle_dtor(file_handle.handle TSRMLS_CC);
goto out;
break;
diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c
index f333addafd..4cd251ed42 100644
--- a/sapi/cli/php_cli_server.c
+++ b/sapi/cli/php_cli_server.c
@@ -104,6 +104,7 @@
#include "php_http_parser.h"
#include "php_cli_server.h"
+#include "mime_type_map.h"
#include "php_cli_process_title.h"
@@ -194,6 +195,7 @@ typedef struct php_cli_server {
size_t router_len;
socklen_t socklen;
HashTable clients;
+ HashTable extension_mime_types;
} php_cli_server;
typedef struct php_cli_server_http_response_status_code_pair {
@@ -201,11 +203,6 @@ typedef struct php_cli_server_http_response_status_code_pair {
const char *str;
} php_cli_server_http_response_status_code_pair;
-typedef struct php_cli_server_ext_mime_type_pair {
- const char *ext;
- const char *mime_type;
-} php_cli_server_ext_mime_type_pair;
-
static php_cli_server_http_response_status_code_pair status_map[] = {
{ 100, "Continue" },
{ 101, "Switching Protocols" },
@@ -262,64 +259,6 @@ static php_cli_server_http_response_status_code_pair template_map[] = {
{ 501, "<h1>%s</h1><p>Request method not supported.</p>" }
};
-static php_cli_server_ext_mime_type_pair mime_type_map[] = {
- { "html", "text/html" },
- { "htm", "text/html" },
- { "js", "text/javascript" },
- { "css", "text/css" },
- { "gif", "image/gif" },
- { "jpg", "image/jpeg" },
- { "jpeg", "image/jpeg" },
- { "jpe", "image/jpeg" },
- { "pdf", "application/pdf" },
- { "png", "image/png" },
- { "svg", "image/svg+xml" },
- { "txt", "text/plain" },
- { "webm", "video/webm" },
- { "ogv", "video/ogg" },
- { "ogg", "audio/ogg" },
- { "3gp", "video/3gpp" }, /* This is standard video format used for MMS in phones */
- { "apk", "application/vnd.android.package-archive" },
- { "avi", "video/x-msvideo" },
- { "bmp", "image/x-ms-bmp" },
- { "csv", "text/comma-separated-values" },
- { "doc", "application/msword" },
- { "docx", "application/msword" },
- { "flac", "audio/flac" },
- { "gz", "application/x-gzip" },
- { "gzip", "application/x-gzip" },
- { "ics", "text/calendar" },
- { "kml", "application/vnd.google-earth.kml+xml" },
- { "kmz", "application/vnd.google-earth.kmz" },
- { "m4a", "audio/mp4" },
- { "mp3", "audio/mpeg" },
- { "mp4", "video/mp4" },
- { "mpg", "video/mpeg" },
- { "mpeg", "video/mpeg" },
- { "mov", "video/quicktime" },
- { "odp", "application/vnd.oasis.opendocument.presentation" },
- { "ods", "application/vnd.oasis.opendocument.spreadsheet" },
- { "odt", "application/vnd.oasis.opendocument.text" },
- { "oga", "audio/ogg" },
- { "pdf", "application/pdf" },
- { "pptx", "application/vnd.ms-powerpoint" },
- { "pps", "application/vnd.ms-powerpoint" },
- { "qt", "video/quicktime" },
- { "swf", "application/x-shockwave-flash" },
- { "tar", "application/x-tar" },
- { "text", "text/plain" },
- { "tif", "image/tiff" },
- { "wav", "audio/wav" },
- { "wmv", "video/x-ms-wmv" },
- { "xls", "application/vnd.ms-excel" },
- { "xlsx", "application/vnd.ms-excel" },
- { "zip", "application/x-zip-compressed" },
- { "xml", "application/xml" },
- { "xsl", "application/xml" },
- { "xsd", "application/xml" },
- { NULL, NULL }
-};
-
static int php_cli_output_is_tty = OUTPUT_NOT_CHECKED;
static size_t php_cli_server_client_send_through(php_cli_server_client *client, const char *str, size_t str_len);
@@ -465,15 +404,14 @@ static void append_essential_headers(smart_str* buffer, php_cli_server_client *c
smart_str_appendl_ex(buffer, "Connection: close\r\n", sizeof("Connection: close\r\n") - 1, persistent);
} /* }}} */
-static const char *get_mime_type(const char *ext, size_t ext_len) /* {{{ */
+static const char *get_mime_type(const php_cli_server *server, const char *ext, size_t ext_len) /* {{{ */
{
- php_cli_server_ext_mime_type_pair *pair;
- for (pair = mime_type_map; pair->ext; pair++) {
- size_t len = strlen(pair->ext);
- if (len == ext_len && memcmp(pair->ext, ext, len) == 0) {
- return pair->mime_type;
- }
+ char *mime_type = NULL;
+
+ if (zend_hash_find(&server->extension_mime_types, ext, ext_len + 1, (void **) &mime_type) == SUCCESS) {
+ return mime_type;
}
+
return NULL;
} /* }}} */
@@ -619,10 +557,9 @@ static int sapi_cli_server_ub_write(const char *str, uint str_length TSRMLS_DC)
return php_cli_server_client_send_through(client, str, str_length);
} /* }}} */
-static void sapi_cli_server_flush(void *server_context) /* {{{ */
+static void sapi_cli_server_flush(void *server_context TSRMLS_DC) /* {{{ */
{
php_cli_server_client *client = server_context;
- TSRMLS_FETCH();
if (!client) {
return;
@@ -1146,7 +1083,7 @@ static int php_cli_server_content_sender_send(php_cli_server_content_sender *sen
return 0;
} /* }}} */
-static int php_cli_server_content_sender_pull(php_cli_server_content_sender *sender, int fd, size_t *nbytes_read) /* {{{ */
+static int php_cli_server_content_sender_pull(php_cli_server_content_sender *sender, int fd, size_t *nbytes_read TSRMLS_DC) /* {{{ */
{
ssize_t _nbytes_read;
php_cli_server_chunk *chunk = php_cli_server_chunk_heap_new_self_contained(131072);
@@ -1154,7 +1091,6 @@ static int php_cli_server_content_sender_pull(php_cli_server_content_sender *sen
_nbytes_read = read(fd, chunk->data.heap.p, chunk->data.heap.len);
if (_nbytes_read < 0) {
char *errstr = get_last_error();
- TSRMLS_FETCH();
php_cli_server_logf("%s" TSRMLS_CC, errstr);
pefree(errstr, 1);
php_cli_server_chunk_dtor(chunk);
@@ -2049,7 +1985,7 @@ static int php_cli_server_begin_send_static(php_cli_server *server, php_cli_serv
{
php_cli_server_chunk *chunk;
smart_str buffer = { 0 };
- const char *mime_type = get_mime_type(client->request.ext, client->request.ext_len);
+ const char *mime_type = get_mime_type(server, client->request.ext, client->request.ext_len);
if (!mime_type) {
mime_type = "application/octet-stream";
}
@@ -2209,9 +2145,30 @@ static int php_cli_server_dispatch(php_cli_server *server, php_cli_server_client
}
/* }}} */
+static int php_cli_server_mime_type_ctor(php_cli_server *server, const php_cli_server_ext_mime_type_pair *mime_type_map) /* {{{ */
+{
+ const php_cli_server_ext_mime_type_pair *pair;
+
+ if (zend_hash_init(&server->extension_mime_types, 0, NULL, NULL, 1) != SUCCESS) {
+ return FAILURE;
+ }
+
+ for (pair = mime_type_map; pair->ext; pair++) {
+ size_t ext_len = 0, mime_type_len = 0;
+
+ ext_len = strlen(pair->ext);
+ mime_type_len = strlen(pair->mime_type);
+
+ zend_hash_add(&server->extension_mime_types, pair->ext, ext_len + 1, (void *) pair->mime_type, mime_type_len + 1, NULL);
+ }
+
+ return SUCCESS;
+} /* }}} */
+
static void php_cli_server_dtor(php_cli_server *server TSRMLS_DC) /* {{{ */
{
zend_hash_destroy(&server->clients);
+ zend_hash_destroy(&server->extension_mime_types);
if (server->server_sock >= 0) {
closesocket(server->server_sock);
}
@@ -2329,6 +2286,11 @@ static int php_cli_server_ctor(php_cli_server *server, const char *addr, const c
server->router_len = 0;
}
+ if (php_cli_server_mime_type_ctor(server, mime_type_map) == FAILURE) {
+ retval = FAILURE;
+ goto out;
+ }
+
server->is_running = 1;
out:
if (retval != SUCCESS) {
@@ -2374,7 +2336,7 @@ static int php_cli_server_send_event(php_cli_server *server, php_cli_server_clie
if (client->content_sender_initialized) {
if (client->file_fd >= 0 && !client->content_sender.buffer.first) {
size_t nbytes_read;
- if (php_cli_server_content_sender_pull(&client->content_sender, client->file_fd, &nbytes_read)) {
+ if (php_cli_server_content_sender_pull(&client->content_sender, client->file_fd, &nbytes_read TSRMLS_CC)) {
php_cli_server_close_connection(server, client TSRMLS_CC);
return FAILURE;
}
diff --git a/sapi/cli/tests/bug61977.phpt b/sapi/cli/tests/bug61977.phpt
index 09a6ba6d23..6250c9aec0 100644
--- a/sapi/cli/tests/bug61977.phpt
+++ b/sapi/cli/tests/bug61977.phpt
@@ -48,7 +48,7 @@ foo.html => Content-Type: text/html; charset=UTF-8
foo.htm => Content-Type: text/html; charset=UTF-8
foo.svg => Content-Type: image/svg+xml
foo.css => Content-Type: text/css; charset=UTF-8
-foo.js => Content-Type: text/javascript; charset=UTF-8
+foo.js => Content-Type: application/javascript
foo.png => Content-Type: image/png
foo.webm => Content-Type: video/webm
foo.ogv => Content-Type: video/ogg
diff --git a/sapi/continuity/capi.c b/sapi/continuity/capi.c
index 953991474d..30d10ed0a0 100644
--- a/sapi/continuity/capi.c
+++ b/sapi/continuity/capi.c
@@ -462,7 +462,7 @@ int phpFinit(lstTset * opt)
core_globals = ts_resource(core_globals_id);
logFmsg(0, "mod/php: PHP Interface v3 (module)");
- logFmsg(0, "mod/php: Copyright (c) 1999-2005 The PHP Group. All rights reserved.");
+ logFmsg(0, "mod/php: Copyright (c) 1999-2014 The PHP Group. All rights reserved.");
sapi_startup(&capi_sapi_module);
capi_sapi_module.startup(&capi_sapi_module);
diff --git a/sapi/embed/php_embed.c b/sapi/embed/php_embed.c
index dad54de1ae..b4fc5aaf10 100644
--- a/sapi/embed/php_embed.c
+++ b/sapi/embed/php_embed.c
@@ -79,7 +79,7 @@ static int php_embed_ub_write(const char *str, uint str_length TSRMLS_DC)
return str_length;
}
-static void php_embed_flush(void *server_context)
+static void php_embed_flush(void *server_context TSRMLS_DC)
{
if (fflush(stdout)==EOF) {
php_handle_aborted_connection();
diff --git a/sapi/fpm/fpm/fpm_main.c b/sapi/fpm/fpm/fpm_main.c
index 2ee1456340..09371314d2 100644
--- a/sapi/fpm/fpm/fpm_main.c
+++ b/sapi/fpm/fpm/fpm_main.c
@@ -316,7 +316,7 @@ static int sapi_cgibin_ub_write(const char *str, uint str_length TSRMLS_DC)
}
-static void sapi_cgibin_flush(void *server_context)
+static void sapi_cgibin_flush(void *server_context TSRMLS_DC)
{
/* fpm has started, let use fcgi instead of stdout */
if (fpm_is_running) {
diff --git a/sapi/litespeed/lsapi_main.c b/sapi/litespeed/lsapi_main.c
index 3413a423ac..2405e2419e 100644
--- a/sapi/litespeed/lsapi_main.c
+++ b/sapi/litespeed/lsapi_main.c
@@ -155,7 +155,7 @@ static int sapi_lsapi_ub_write(const char *str, uint str_length TSRMLS_DC)
/* {{{ sapi_lsapi_flush
*/
-static void sapi_lsapi_flush( void * server_context )
+static void sapi_lsapi_flush( void * server_context TSRMLS_DC )
{
if ( lsapi_mode ) {
if ( LSAPI_Flush() == -1) {
diff --git a/sapi/milter/php_milter.c b/sapi/milter/php_milter.c
index 432fd806c2..e0b2d0a0af 100644
--- a/sapi/milter/php_milter.c
+++ b/sapi/milter/php_milter.c
@@ -860,10 +860,6 @@ static int sapi_milter_ub_write(const char *str, uint str_length TSRMLS_DC)
return str_length;
}
-static void sapi_milter_flush(void *server_context)
-{
-}
-
static void sapi_milter_register_variables(zval *track_vars_array TSRMLS_DC)
{
php_register_variable ("SERVER_SOFTWARE", "Sendmail Milter", track_vars_array TSRMLS_CC);
@@ -906,7 +902,7 @@ static sapi_module_struct milter_sapi_module = {
NULL, /* deactivate */
sapi_milter_ub_write, /* unbuffered write */
- sapi_milter_flush, /* flush */
+ NULL, /* flush */
NULL, /* get uid */
NULL, /* getenv */
@@ -1119,7 +1115,7 @@ int main(int argc, char *argv[])
break;
case 'z': /* load extension file */
- zend_load_extension(ap_php_optarg);
+ zend_load_extension(ap_php_optarg TSRMLS_CC);
break;
default:
diff --git a/sapi/nsapi/nsapi.c b/sapi/nsapi/nsapi.c
index ec3137ca51..5ed133c18d 100644
--- a/sapi/nsapi/nsapi.c
+++ b/sapi/nsapi/nsapi.c
@@ -467,10 +467,9 @@ static int sapi_nsapi_ub_write(const char *str, unsigned int str_length TSRMLS_D
}
/* modified version of apache2 */
-static void sapi_nsapi_flush(void *server_context)
+static void sapi_nsapi_flush(void *server_context TSRMLS_DC)
{
nsapi_request_context *rc = (nsapi_request_context *)server_context;
- TSRMLS_FETCH();
if (!rc) {
/* we have no context, so no flushing needed. This fixes a SIGSEGV on shutdown */
diff --git a/sapi/pi3web/pi3web_sapi.c b/sapi/pi3web/pi3web_sapi.c
index 4bc08e5382..0e17c0e029 100644
--- a/sapi/pi3web/pi3web_sapi.c
+++ b/sapi/pi3web/pi3web_sapi.c
@@ -385,7 +385,7 @@ MODULE_API DWORD PHP5_wrapper(LPCONTROL_BLOCK lpCB)
}
if ( open_file_for_scanning( &file_handle TSRMLS_CC ) == SUCCESS )
{
- zend_indent();
+ zend_indent(TSRMLS_C);
}
else
{
diff --git a/sapi/roxen/roxen.c b/sapi/roxen/roxen.c
index b3a64345ea..14456477b0 100644
--- a/sapi/roxen/roxen.c
+++ b/sapi/roxen/roxen.c
@@ -387,13 +387,12 @@ php_roxen_sapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
* the client. Used for POST/PUT requests.
*/
-INLINE static int php_roxen_low_read_post(char *buf, uint count_bytes)
+INLINE static int php_roxen_low_read_post(char *buf, uint count_bytes TSRMLS_DC)
{
uint total_read = 0;
#ifdef ROXEN_USE_ZTS
GET_THIS();
#endif
- TSRMLS_FETCH();
if(!MY_FD_OBJ->prog)
{
@@ -417,7 +416,7 @@ static int
php_roxen_sapi_read_post(char *buf, uint count_bytes TSRMLS_DC)
{
uint total_read = 0;
- THREAD_SAFE_RUN(total_read = php_roxen_low_read_post(buf, count_bytes), "read post");
+ THREAD_SAFE_RUN(total_read = php_roxen_low_read_post(buf, count_bytes TSRMLS_CC), "read post");
return total_read;
}
diff --git a/sapi/thttpd/thttpd.c b/sapi/thttpd/thttpd.c
index 843e4a62fb..f6ba8585b9 100644
--- a/sapi/thttpd/thttpd.c
+++ b/sapi/thttpd/thttpd.c
@@ -349,11 +349,12 @@ static zend_module_entry php_thttpd_module = {
STANDARD_MODULE_PROPERTIES
};
-static int php_thttpd_startup(sapi_module_struct *sapi_module)
+static int php_thttpd_startup(sapi_module_struct *sapi_module TSRMLS_DC)
{
#if PHP_API_VERSION >= 20020918
if (php_module_startup(sapi_module, &php_thttpd_module, 1) == FAILURE) {
#else
+ /* No TSRMLS_CC here to zend_startup_module() as 5.6 and older does not have that parameter */
if (php_module_startup(sapi_module) == FAILURE
|| zend_startup_module(&php_thttpd_module) == FAILURE) {
#endif
diff --git a/sapi/tux/php_tux.c b/sapi/tux/php_tux.c
index 55d911f8ab..9dba8efbfe 100644
--- a/sapi/tux/php_tux.c
+++ b/sapi/tux/php_tux.c
@@ -96,7 +96,7 @@ static int sapi_tux_ub_write(const char *str, uint str_length TSRMLS_DC)
return n;
}
-static int sapi_tux_send_headers(sapi_headers_struct *sapi_headers)
+static int sapi_tux_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC)
{
char buf[1024];
struct iovec *vec;
@@ -107,7 +107,6 @@ static int sapi_tux_send_headers(sapi_headers_struct *sapi_headers)
size_t len;
char *status_line;
int locate_cl;
- TSRMLS_FETCH();
max_headers = 30;
n = 1;
@@ -158,11 +157,10 @@ static int sapi_tux_send_headers(sapi_headers_struct *sapi_headers)
return SAPI_HEADER_SENT_SUCCESSFULLY;
}
-static int sapi_tux_read_post(char *buffer, uint count_bytes)
+static int sapi_tux_read_post(char *buffer, uint count_bytes TSRMLS_DC)
{
#if 0
int amount = 0;
- TSRMLS_FETCH();
TG(req)->objectlen = count_bytes;
TG(req)->object_addr = buffer;
@@ -177,10 +175,8 @@ static int sapi_tux_read_post(char *buffer, uint count_bytes)
#endif
}
-static char *sapi_tux_read_cookies(void)
+static char *sapi_tux_read_cookies(TSRMLS_D)
{
- TSRMLS_FETCH();
-
return TG(req)->cookies;
}
diff --git a/tests/basic/024.phpt b/tests/basic/024.phpt
deleted file mode 100644
index 2e046c0cd8..0000000000
--- a/tests/basic/024.phpt
+++ /dev/null
@@ -1,31 +0,0 @@
---TEST--
-Test HTTP_RAW_POST_DATA creation
---INI--
-always_populate_raw_post_data=1
-max_input_vars=1000
---POST--
-a=ABC&y=XYZ&c[]=1&c[]=2&c[a]=3
---FILE--
-<?php
-var_dump($_POST, $HTTP_RAW_POST_DATA);
-?>
---EXPECT--
-Deprecated: Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set 'always_populate_raw_post_data' to '-1' in php.ini and use the php://input stream instead. in Unknown on line 0
-
-Warning: Cannot modify header information - headers already sent in Unknown on line 0
-array(3) {
- ["a"]=>
- string(3) "ABC"
- ["y"]=>
- string(3) "XYZ"
- ["c"]=>
- array(3) {
- [0]=>
- string(1) "1"
- [1]=>
- string(1) "2"
- ["a"]=>
- string(1) "3"
- }
-}
-string(30) "a=ABC&y=XYZ&c[]=1&c[]=2&c[a]=3"
diff --git a/tests/basic/024_1.phpt b/tests/basic/024_1.phpt
deleted file mode 100644
index f98af82995..0000000000
--- a/tests/basic/024_1.phpt
+++ /dev/null
@@ -1,29 +0,0 @@
---TEST--
-Test HTTP_RAW_POST_DATA creation
---INI--
-always_populate_raw_post_data=-1
-max_input_vars=1000
---POST--
-a=ABC&y=XYZ&c[]=1&c[]=2&c[a]=3
---FILE--
-<?php
-var_dump($_POST, $HTTP_RAW_POST_DATA);
-?>
---EXPECTF--
-Notice: Undefined variable: HTTP_RAW_POST_DATA in %s on line %d
-array(3) {
- ["a"]=>
- string(3) "ABC"
- ["y"]=>
- string(3) "XYZ"
- ["c"]=>
- array(3) {
- [0]=>
- string(1) "1"
- [1]=>
- string(1) "2"
- ["a"]=>
- string(1) "3"
- }
-}
-NULL
diff --git a/tests/basic/026.phpt b/tests/basic/026.phpt
deleted file mode 100644
index a3e34f49f2..0000000000
--- a/tests/basic/026.phpt
+++ /dev/null
@@ -1,18 +0,0 @@
---TEST--
-Registration of HTTP_RAW_POST_DATA due to unknown content-type
---INI--
-always_populate_raw_post_data=0
---POST_RAW--
-Content-Type: unknown/type
-a=1&b=ZYX
---FILE--
-<?php
-var_dump($_POST, $HTTP_RAW_POST_DATA);
-?>
---EXPECT--
-Deprecated: Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set 'always_populate_raw_post_data' to '-1' in php.ini and use the php://input stream instead. in Unknown on line 0
-
-Warning: Cannot modify header information - headers already sent in Unknown on line 0
-array(0) {
-}
-string(9) "a=1&b=ZYX"
diff --git a/tests/basic/026_1.phpt b/tests/basic/026_1.phpt
deleted file mode 100644
index 527a795f67..0000000000
--- a/tests/basic/026_1.phpt
+++ /dev/null
@@ -1,16 +0,0 @@
---TEST--
-Registration of HTTP_RAW_POST_DATA due to unknown content-type
---INI--
-always_populate_raw_post_data=-1
---POST_RAW--
-Content-Type: unknown/type
-a=1&b=ZYX
---FILE--
-<?php
-var_dump($_POST, $HTTP_RAW_POST_DATA);
-?>
---EXPECTF--
-Notice: Undefined variable: HTTP_RAW_POST_DATA in %s on line %d
-array(0) {
-}
-NULL