diff options
| author | Pierre Joye <pierre.php@gmail.com> | 2014-03-05 10:32:42 +0100 |
|---|---|---|
| committer | Pierre Joye <pierre.php@gmail.com> | 2014-03-05 10:32:42 +0100 |
| commit | e590aceb5ad05e59896fecfeb645f5a70919f417 (patch) | |
| tree | 9812785c5ac4a8727ab1b2b2fa3b8012f7df7fd8 | |
| parent | 9b54901ffbfc1f5eacf3f75bdf01c76c78233264 (diff) | |
| parent | c2a9f73c99065cd8a7d3c08583498053076e1265 (diff) | |
| download | php-git-e590aceb5ad05e59896fecfeb645f5a70919f417.tar.gz | |
Merge branch 'PHP-5.4' of git.php.net:php-src into PHP-5.4
# By Anatol Belski (22) and others
# Via Derick Rethans (5) and others
* 'PHP-5.4' of git.php.net:php-src: (176 commits)
NEWS
Fixed Bug #66820 out-of-bounds memory access in fileinfo
Improves fix for memory leak, keep in sync with upstream.
Updated news for #60602
proc_open(): separate environment values that aren't strings
Updated NEWS for #66535
Fixed test case title
[bug 66535] X-PHP-Originating-Script adds newline if no custom headers are given
man page: long option name is --strip, not --stripped
--global have be removed in 5.2
NEWS
test for bug #66762
Fixed Bug #66762 Segfault in mysqli_stmt::bind_result() when link closed
fix tests broken by 633f898f1520253d3530fe91fc82f68bca7c4627
add news entry
add clear_env option to FPM config
Reduce test noise on cross Oracle client <-> server version tests. This fix is already in PHP 5.6+
Reduce test noise in cross Oracle client <-> server version testing. This change is already in PHP 5.6+
fixed macro
Make sure value is initialized
...
1025 files changed, 5694 insertions, 2910 deletions
diff --git a/.gitignore b/.gitignore index 6f291dc917..32d6ae03f8 100644 --- a/.gitignore +++ b/.gitignore @@ -204,6 +204,8 @@ ext/pdo_sqlite/sqlite3.h ext/pdo_sqlite/tests/*.db ext/pdo_sqlite/tests/*.tmp ext/phar/phar.phar +ext/phar/phar.1 +ext/phar/phar.phar.1 ext/pspell/tests/*.tmp ext/reflection/xml ext/reflection/html @@ -235,12 +237,14 @@ sapi/apache/libphp5.module sapi/apache2handler/libphp5.module sapi/apache_hooks/libphp5.module sapi/cgi/php-cgi +sapi/cgi/php-cgi.1 sapi/cli/php.1 sapi/fpm/php-fpm sapi/fpm/php-fpm.1 sapi/fpm/init.d.php-fpm sapi/fpm/php-fpm.conf sapi/fpm/fpm/php-cgi +sapi/phpdbg/phpdbg scripts/php-config scripts/phpize scripts/man1/*.1 diff --git a/CODING_STANDARDS b/CODING_STANDARDS index 5ceacdc4dc..bebc951452 100644 --- a/CODING_STANDARDS +++ b/CODING_STANDARDS @@ -59,8 +59,8 @@ Exceptions: you're calling. 7. When commenting out code using a #if statement, do NOT use 0 only. Instead - use "<svn username here>_0". For example, #if FOO_0, where FOO is your - svn user foo. This allows easier tracking of why code was commented out, + use "<git username here>_0". For example, #if FOO_0, where FOO is your + git user foo. This allows easier tracking of why code was commented out, especially in bundled libraries. 8. Do not define functions that are not available. For instance, if a @@ -82,7 +82,7 @@ Exceptions: library may need to control or free the memory, or when the memory in question needs to survive between multiple requests. -Naming Conventions +User Functions/Methods Naming Conventions ------------------ 1. Function names for user-level functions should be enclosed with in @@ -163,6 +163,26 @@ Naming Conventions 'foobar' 'foo_bar' +Internal Function Naming Convensions +---------------------- + +1. Functions that are part of the external API should be named + 'php_modulename_function()' to avoid symbol collision. They should be in + lowercase, with words underscore delimited. Exposed API must be defined + in 'php_modulename.h'. + + PHPAPI char *php_session_create_id(PS_CREATE_SID_ARGS); + + Unexposed module function should be static and should not be defined in + 'php_modulename.h'. + + static int php_session_destroy(TSRMLS_D) + +2. Main module source file must be named 'modulename.c'. + +3. Header file that is used by other sources must be named 'php_modulename.h'. + + Syntax and indentation ---------------------- @@ -181,9 +201,9 @@ Syntax and indentation of PHP or one of its standard modules, please maintain the K&R style. This applies to just about everything, starting with indentation and comment styles and up to function declaration - syntax. Also see Indentstyle_. + syntax. Also see Indentstyle. -.. _Indentstyle: http://www.catb.org/~esr/jargon/html/I/indent-style.html + Indentstyle: http://www.catb.org/~esr/jargon/html/I/indent-style.html 3. Be generous with whitespace and braces. Keep one empty line between the variable declaration section and the statements in a block, as well as diff --git a/Makefile.global b/Makefile.global index 6b79ad7aa4..ff858c2aa3 100644 --- a/Makefile.global +++ b/Makefile.global @@ -113,6 +113,7 @@ clean: find . -name \*.la -o -name \*.a | xargs rm -f find . -name \*.so | xargs rm -f find . -name .libs -a -type d|xargs rm -rf + find . -name \*.1 | xargs rm -f rm -f libphp$(PHP_MAJOR_VERSION).la $(SAPI_CLI_PATH) $(OVERALL_TARGET) modules/* libs/* distclean: clean @@ -1,8 +1,133 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| -?? ??? 2013, PHP 5.4.23 +?? ??? 2014, PHP 5.4.27 -?? ??? 2013, PHP 5.4.22 +- MySQLi: + . Fixed bug #66762i (Segfault in mysqli_stmt::bind_result() when link closed) + (Remi) + +- Mail: + . Fixed bug #66535 (Don't add newline after X-PHP-Originating-Script) (Tjerk) + +- Core: + . Fixed bug #60602 (proc_open() changes environment array) (Tjerk) + +?? ??? 2014, PHP 5.4.26 + +- JSON: + . Fixed bug #65753 (JsonSerializeable couldn't implement on module extension) + (chobieeee@php.net) + +- Fileinfo: + . Fixed bug #66731 (file: infinite recursion). (CVE-2014-1943) (Remi) + . Fixed bug #66820 (out-of-bounds memory access in fileinfo). (Remi) + +- FPM: + . Added clear_env configuration directive to disable clearenv() call. + (Github PR# 598, Paul Annesley) + +- LDAP: + . Implemented ldap_modify_batch (https://wiki.php.net/rfc/ldap_modify_batch). + (Ondřej Hošek) + +- Openssl: + . Fixed bug #66501 (Add EC key support to php_openssl_is_private_key). + (Mark Zedwood) + +- Pgsql: + . Added warning for dangerous client encoding and remove possible injections + for pg_insert()/pg_update()/pg_delete()/pg_select(). (Yasuo) + +06 Feb 2014, PHP 5.4.25 + +- Core: + . Fixed bug #66286 (Incorrect object comparison with inheritance). (Nikita) + . Fixed bug #66509 (copy() arginfo has changed starting from 5.4). + (Will Fitch) + +- mysqlnd: + . Fixed bug #66283 (Segmentation fault after memory_limit). (Johannes) + +- PDO_pgsql: + . Fixed bug #62479 (PDO-psql cannot connect if password contains spaces). + (Will Fitch, Ilia) + +- Session: + . Fixed bug #66481 (Calls to session_name() segfault when session.name is + null). (Laruence) + +10 Jan 2014, PHP 5.4.24 + +- Core: + . Added validation of class names in the autoload process. (Dmitry) + . Fixed invalid C code in zend_strtod.c. (Lior Kaplan) + . Fixed bug #61645 (fopen and O_NONBLOCK). (Mike) + +- Date: + . Fixed bug #66060 (Heap buffer over-read in DateInterval). (CVE-2013-6712) + (Remi) + . Fixed bug #63391 (Incorrect/inconsistent day of week prior to the year + 1600). (Derick, T. Carter) + . Fixed bug #61599 (Wrong Day of Week). (Derick, T. Carter) + +- DOM: + . Fixed bug #65196 (Passing DOMDocumentFragment to DOMDocument::saveHTML() + Produces invalid Markup). (Mike) + +- Exif: + . Fixed bug #65873 (Integer overflow in exif_read_data()). (Stas) + +- Filter: + . Fixed bug #66229 (128.0.0.0/16 isn't reserved any longer). (Adam) + +- GD: + . Fixed bug #64405 (Use freetype-config for determining freetype2 dir(s)). + (Adam) + +- PDO_odbc: + . Fixed bug #66311 (Stack smashing protection kills PDO/ODBC queries). + (michael at orlitzky dot com) + +- SNMP: + . Fixed SNMP_ERR_TOOBIG handling for bulk walk operations. (Boris Lytochkin) + +- XSL + . Fixed bug #49634 (Segfault throwing an exception in a XSL registered + function). (Mike) + +- ZIP: + . Fixed Bug #66321 (ZipArchive::open() ze_obj->filename_len not real). (Remi) + +12 Dec 2013, PHP 5.4.23 + +- Core: + . Fixed bug #66094 (unregister_tick_function tries to cast a Closure to a + string). (Laruence) + . Fixed bug #65969 (Chain assignment with T_LIST failure). (Dmitry) + . Fixed bug #65947 (basename is no more working after fgetcsv in certain + situation). (Laruence) + +- JSON + . Fixed whitespace part of bug #64874 ("json_decode handles whitespace and + case-sensitivity incorrectly"). (Andrea Faulds) + +- MySQLi: + . Fixed bug #66043 (Segfault calling bind_param() on mysqli). (Laruence) + +- mysqlnd: + . Fixed bug #66124 (mysqli under mysqlnd loses precision when bind_param + with 'i'). (Andrey) + . Fixed bug #66141 (mysqlnd quote function is wrong with NO_BACKSLASH_ESCAPES + after failed query). (Andrey) + +- Openssl: + . Fixed memory corruption in openssl_x509_parse() (CVE-2013-6420). + (Stefan Esser). + +- PDO + . Fixed bug 65946 (sql_parser permanently converts values bound to strings) + +14 Nov 2013, PHP 5.4.22 - Core: . Fixed bug #65911 (scope resolution operator - strange behavior with $this). @@ -18,10 +143,14 @@ PHP NEWS - FTP: . Fixed bug #65667 (ftp_nb_continue produces segfault). (Philip Hofstetter) -- ODBC +- ODBC: . Fixed bug #65950 (Field name truncation if the field name is bigger than 32 characters). (patch submitted by: michael dot y at zend dot com, Yasuo) +- PDO: + . Fixed bug #66033 (Segmentation Fault when constructor of PDO statement + throws an exception). (Laruence) + - Sockets: . Fixed bug #65808 (the socket_connect() won't work with IPv6 address). (Mike) @@ -29,6 +158,7 @@ PHP NEWS - Standard: . Fixed bug #64760 (var_export() does not use full precision for floating-point numbers) (Yasuo) + . Fixed bug #66395 (basename function doesn't remove drive letter). (Anatol) - XMLReader: . Fixed bug #51936 (Crash with clone XMLReader). (Mike) diff --git a/README.EXTENSIONS b/README.EXTENSIONS index 06d6cdd85f..e802af8329 100644 --- a/README.EXTENSIONS +++ b/README.EXTENSIONS @@ -1,3 +1,11 @@ +This file describes extension module API details. Refer to +README.EXT_SKEL to create extension skeleton files. Refer to +Hacker's Guide for PHP internals. + +http://www.php.net/manual/en/internals2.php + + + Between PHP 4.0.6 and 4.1.0, the Zend module struct changed in a way that broke both source and binary compatibility. If you are maintaining a third party extension, here's how to update it: diff --git a/README.EXT_SKEL b/README.EXT_SKEL index d44fcc5c6a..42df006d24 100644 --- a/README.EXT_SKEL +++ b/README.EXT_SKEL @@ -45,12 +45,29 @@ HOW TO USE IT --proto=filename. +SOURCE AND HEADER FILE NAME + + ./ext_skel generates 'module_name.c' and 'php_module_name.h' as main source + and header files. Keep these names. + + Module functions (User functions) must be named + + module_name_function() + + When you need to expose module functions to other modules, expose functions + strictly needed by others. Exposed internal function must be named + + php_module_name_function() + + See also CODING_STANDARDS. + + FORMAT OF FUNCTION DEFINITIONS FILE All the definitions must be on one line. In it's simplest form, it's just the function name, e.g. - my_function + module_name_function but then you'll be left with an almost empty function body without any argument handling. @@ -72,8 +89,9 @@ FORMAT OF FUNCTION DEFINITIONS FILE An example: - my_function(int arg1, int arg2 [, int arg3 [, int arg4]]) this is my 1st + module_name_function(int arg1, int arg2 [, int arg3 [, int arg4]]) + Arguments arg1 and arg2 are required. Arguments arg3 and arg4 are optional. If possible, the function definition should also contain it's return type @@ -133,15 +151,15 @@ EXAMPLE The following _one_ line - bool my_drawtext(resource image, string text, resource font, int x, int y [, int color]) + bool module_name_drawtext(resource image, string text, resource font, int x, int y [, int color]) will create this function definition for you (note that there are a few question marks to be replaced by you, and you must of course add your own value definitions too): -/* {{{ proto bool my_drawtext(resource image, string text, resource font, int x, int y [, int color]) +/* {{{ proto bool module_name_drawtext(resource image, string text, resource font, int x, int y [, int color]) */ -PHP_FUNCTION(my_drawtext) +PHP_FUNCTION(module_name_drawtext) { char *text = NULL; int argc = ZEND_NUM_ARGS(); @@ -164,7 +182,7 @@ PHP_FUNCTION(my_drawtext) ZEND_FETCH_RESOURCE(???, ???, font, font_id, "???", ???_rsrc_id); } - php_error(E_WARNING, "my_drawtext: not yet implemented"); + php_error(E_WARNING, "module_name_drawtext: not yet implemented"); } /* }}} */ diff --git a/README.GIT-RULES b/README.GIT-RULES index 6e90aa97b6..3df9d17bcd 100644 --- a/README.GIT-RULES +++ b/README.GIT-RULES @@ -69,9 +69,11 @@ The next few rules are more of a technical nature:: branches) an empty merge should be done. 2. All news updates intended for public viewing, such as new features, - bug fixes, improvements, etc., should go into the NEWS file of the - *first* to be released version with the given change. In other words - any NEWS file change only needs to done in one branch. + bug fixes, improvements, etc., should go into the NEWS file of *any + stable release* version with the given change. In other words, + news about a bug fix which went into PHP-5.4, PHP-5.5 and master + should be noted in both PHP-5.4/NEWS and PHP-5.5/NEWS but + not master, which is not a public released version yet. 3. Do not commit multiple file and dump all messages in one commit. If you modified several unrelated files, commit each group separately and diff --git a/README.RELEASE_PROCESS b/README.RELEASE_PROCESS index bc6d4571bd..21305f2993 100644 --- a/README.RELEASE_PROCESS +++ b/README.RELEASE_PROCESS @@ -8,15 +8,16 @@ General notes and tips 1. Do not release on Fridays, Saturdays or Sundays because the sysadmins can not upgrade stuff then. -2. Package the day before a release. So if the release is to be on Thursday, -package on Wednesday. +2. Package two days before a release. So if the release is to be on Thursday, +package on Tuesday. Think about timezones as well. 3. Ensure that Windows builds will work before packaging -4. Follow all steps to the letter. When unclear ask previous RM's (Derick/Ilia) -before proceeding. Ideally make sure that for the first releases one of the -previous RM's is around to answer questions. For the steps related to the -php/QA/bug websites try to have someone from the webmaster team (Bjori) on hand. +4. Follow all steps to the letter. When unclear ask previous RM's (David/Julien/ +Johannes/Stas/Derick/Ilia) before proceeding. Ideally make sure that for the +first releases one of the previous RM's is around to answer questions. For the +steps related to the php/QA/bug websites try to have someone from the webmaster +team (Bjori) on hand. 5. Verify the tags to be extra sure everything was tagged properly. @@ -50,30 +51,44 @@ Rolling a non stable release (alpha/beta/RC) 2. run the "scripts/dev/credits" script in php-src and commit the changes in the credits files in ext/standard. -3. Checkout the release branch for this release (e.g., PHP-5.4.2). +3. Checkout the release branch for this release (e.g., PHP-5.4.2) from the main branch. 4. Bump the version numbers in ``main/php_version.h``, ``configure.in`` and possibly ``NEWS``. -Do not use abbreviations for alpha and beta. +Do not use abbreviations for alpha and beta. Do not use dashes, you should +``#define PHP_VERSION "5.4.22RC1"`` and not ``#define PHP_VERSION "5.4.22-RC1"`` -5. Commit these changes to the branch with ``git commit -a``. +5. Compile and make test, with and without ZTS, using the right Bison version +(for example, for 5.5, Bison 2.4.1 is used) -6. Tag the repository with the version, e.g.: +6. Check ./sapi/cli/php -v output for version matching. + +7. If all is right, commit the changes to the release branch with ``git commit -a``. + +8. Tag the repository release branch with the version, e.g.: ``git tag -u YOURKEYID php-5.4.2RC2`` -7. Push the changes to the main repo: +9. Bump the version numbers in ``main/php_version.h``, ``configure.in`` and ``NEWS`` +in the *main* branch (PHP-5.4 for example) to prepare for the **next** version. +F.e. if the RC is "5.4.1RC1" then the new one should be "5.4.2-dev" - regardless if we get +a new RC or not. This is to make sure ``version_compare()`` can correctly work. +Commit the changes to the main branch. + +10. Push the changes to the main repo, the tag, the main branch and the release branch : ``git push --tags origin HEAD`` +``git push origin {main branch}`` +``git push origin {release branch}`` -8. run: ``./makedist 5.4.2RC2``, this will export the tree, create configure -and build two tarballs (one gz and one bz2). +11. run: ``PHPROOT=. ./makedist 5.4.2RC2``, this will export the tree, create configure +and build three tarballs (gz, bz2 and xz). -9. Copy those two tarballs to www.php.net, in your homedir there should be a +12. Copy those tarballs (scp, rsync) to downloads.php.net, in your homedir there should be a directory "downloads/". Copy them into there, so that the system can generate -MD5 sums. If you do not have this directory, talk to Derick. +MD5 sums. If you do not have this directory, talk to Derick or Dan. -10. Now the RC can be found on http://downloads.php.net/yourname, +13. Now the RC can be found on http://downloads.php.net/yourname, f.e. http://downloads.php.net/derick/ -11. Once the release has been tagged, contact the PHP Windows development team +14. Once the release has been tagged, contact the PHP Windows development team (internals-win@lists.php.net) so that Windows binaries can be created. Once those are made, they should be placed into the same directory as the source snapshots. @@ -86,10 +101,10 @@ pointing out "the location of the release" and "the possible release date of either the next RC, or the final release". 2. Send an email (see example here http://news.php.net/php.pear.qa/5201) **To** -``php-qa@lists.php.net`` and ``primary-qa-tests@lists.php.net``. +``php-qa@lists.php.net`` and ``primary-qa-tester@lists.php.net``. This email is to notify the selected projects about a new release so that they can make sure their projects keep working. Make sure that you have been setup -as a moderator for ``primary-qa-tests@lists.php.net`` by having someone (Wez, +as a moderator for ``primary-qa-tester@lists.php.net`` by having someone (Hannes, Dan, Derick) run the following commands for you: ``ssh lists.php.net`` @@ -105,9 +120,9 @@ Derick) run the following commands for you: Note: Remember to update the MD5 checksum information. -4. Update ``php.git/include/version.inc`` (x=major version number) +4. Update ``web/php.git/include/version.inc`` (x=major version number) - a. ``$PHP_x_RC`` = "5.4.0RC1" + a. ``$PHP_x_RC`` = "5.4.0RC1" (should be set to "false" before) b. ``$PHP_x_RC_DATE`` = "06 September 2007" @@ -118,67 +133,61 @@ Derick) run the following commands for you: 6. For the first RC, write the doc team (phpdoc@lists.php.net) about updating the INSTALL and win32/install.txt files which are generated from the PHP manual sources. -7. Publish the announce on www.php.net as well (for all releases, alpha, RCs or other) - Rolling a stable release ------------------------ -1. Check windows snapshot builder logs (http://snaps.php.net/win32/snapshot-STABLE.log f.e.) +1. Checkout your release branch, you should have created when releasing previous RC +and bump the version numbers in ``main/php_version.h``, ``configure.in`` and possibly ``NEWS``. -2. Bump the version numbers in ``main/php_version.h``, ``configure.in`` and possibly ``NEWS``. +2. If a CVE commit needs to be merged to the release, then have it committed to +the base branches and merged upwards as usual (f.e commit the CVE fix to 5.3, +merge to 5.4, 5.5 etc...). Then you can cherry-pick it in your release branch. +Don't forget to update NEWS manually in an extra commit then. -3. **Merge** all related sections in NEWS (f.e. merge the 5.4.1RC1 and 5.4.0 sections) +3. Commit those changes -4. Commit those changes - -5. run the "scripts/dev/credits" script in php-src and commit the changes in the +4. run the "scripts/dev/credits" script in php-src and commit the changes in the credits files in ext/standard. -6. tag the repository with the version f.e. "``git tag -s php-5.4.1``" -(of course, you need to change that to the version you're rolling an RC for). -When making 5.X release, you need to tag the Zend directory separately!! +5. Compile and make test, with and without ZTS, using the right Bison version +(for example, for 5.5, Bison 2.4.1 is used) -7. Bump up the version numbers in ``main/php_version.h``, ``configure.in`` and -possibly ``NEWS`` again, to the **next** version. F.e. if the release candidate -was "5.4.1RC1" then the new one should be "5.4.1RC2-dev" - regardless if we get -a new RC or not. This is to make sure ``version_compare()`` can correctly work. +6. Check ./sapi/cli/php -v output for version matching. -8. Commit those changes +7. tag the repository with the version f.e. "``git tag -s php-5.4.1``" -9. Log in onto the snaps box and go into the correct tree (f.e. the PHP-5.4 -branch if you're rolling 5.5.x releases). +8. Push the tag f.e. "``git push origin php-5.4.1``" -10. You do not have to update the tree, but of course you can with "``git pull -origin <branch>``". +9. run: ``PHPROOT=. ./makedist php 5.4.1``, this will export the tag, create configure +and build three tarballs (gz, bz2 and xz). +Check if the pear files are updated (phar). -11. run: ``./makedist php 5.4.1``, this will export the tree, create configure -and build two tarballs (one gz and one bz2). +10. Generate the GPG signature files for the archives. + ``gpg -u YOUREMAIL --armor --detach-sign php-X.Y.Z.tar.xxx`` -12. Commit those two tarballs to web/php-distributions.git, then update the git - submodule reference in web/php.git: - git submodule init; +11. Commit and push all the tarballs and signature files to web/php-distributions.git, + then update the git submodule reference in web/php.git: + ``git submodule init; git submodule update; cd distributions; git pull origin master; cd ..; git commit distributions; - git push; - -13. Once the release has been tagged, contact the PHP Windows development team -(internals-win@lists.php.net) so that Windows binaries can be created. Once -those are made, they should be committed to SVN too. + git push;`` +This is to fetch the last commit id from php-distributions.git and commit this +last commit id to web/php.git, then, mirrors will now sync -14. Check if the pear files are updated (phar for 5.1+ or run pear/make-pear-bundle.php with 4.4) - -15. When making a final release, also remind the PHP Windows development team -(internals-win@lists.php.net) to prepare the installer packages for Win32. +12. Once the release has been tagged, contact the PHP Windows development team +(internals-win@lists.php.net) so that Windows binaries can be created. Getting the stable release announced ------------------------------------ 1. Run the bumpRelease script for phpweb on your local checkout - a. ``php bin/bumpRelease 5`` (or ``php bin/bumpRelease 4`` for PHP4) + a. ``php bin/bumpRelease 5`` to create the release file (releases/x_y_z.php) + The release announcement file should list in detail security fixes and + changes in behavior (whether due to a bug fix or not). b. In case multiple PHP minor versions are in active development you have to manually copy the old information to include/releases.inc @@ -198,7 +207,13 @@ Getting the stable release announced f. if the windows builds aren't ready yet prefix the "windows" key with a dot (".windows") -3. Update the ChangeLog file for the given major version +3. Update phpweb/include/releases.php with the old release info + (updates the download archives) + +4. Update php-qa/include/release-qa.php and add the next version as an QARELEASE + (prepare for next RC) + +5. Update the ChangeLog file for the given major version f.e. ``ChangeLog-5.php`` from the NEWS file a. go over the list and put every element on one line @@ -218,19 +233,10 @@ f.e. ``ChangeLog-5.php`` from the NEWS file IV. ``s/Fixed PECL bug #\([0-9]\+\)/<?php peclbugfix(\1); ?>/`` V. ``s/FR #\([0-9]\+\)/FR <?php bugl(\1); ?>/`` + + e. You may want to try php-web/bin/news2html to automate this task -4. ``cp releases/5_4_0.php releases/5_4_1.php`` - -5. ``git add releases/5_4_1.php`` - -6. Update the ``releases/*.php`` file with relevant data. The release -announcement file should list in detail: - - a. security fixes, - - b. changes in behavior (whether due to a bug fix or not) - -7. Add a short notice to phpweb stating that there is a new release, and +6. Add a short notice to phpweb stating that there is a new release, and highlight the major important things (security fixes) and when it is important to upgrade. @@ -238,7 +244,11 @@ to upgrade. b. Add the content for the news entry -8. Commit all the changes. +7. **Check mirrors have been synced before announcing or pushing news** + Try, f.e. http://www.php.net/get/php-5.5.1.tar.bz2/from/a/mirror + Try several mirrors, mirrors may update slowly (may take an hour) + +8. Commit all the changes to their respective git repos 9. Wait an hour or two, then send a mail to php-announce@lists.php.net, php-general@lists.php.net and internals@lists.php.net with a text similar to diff --git a/README.SUBMITTING_PATCH b/README.SUBMITTING_PATCH index 63b7156f10..ee8e6bbaef 100644 --- a/README.SUBMITTING_PATCH +++ b/README.SUBMITTING_PATCH @@ -50,6 +50,17 @@ Please make the mail subject prefix "[PATCH]". If attaching a patch, ensure it has a file extension of ".txt". This is because only MIME attachments of type 'text/*' are accepted. +The preferred way to propose PHP patch is sending pull request from +github. + +https://github.com/php/php-src + +Fork the official PHP repository and send a pull request. A +notification will be sent to the pull request mailing list. Sending a +note to PHP Internals list (internals@lists.php.net) may help getting +more feedback and quicker turnaround. You can also add pull requests +to bug reports at http://bugs.php.net/. + PHP Documentation Patches ------------------------- diff --git a/TSRM/tsrm_config_common.h b/TSRM/tsrm_config_common.h index 83b6b9b02c..eba9c13488 100644 --- a/TSRM/tsrm_config_common.h +++ b/TSRM/tsrm_config_common.h @@ -2,7 +2,7 @@ #define TSRM_CONFIG_COMMON_H #ifndef __CYGWIN__ -# if WINNT|WIN32 +# ifdef _WIN32 # define TSRM_WIN32 # endif #endif diff --git a/TSRM/tsrm_nw.c b/TSRM/tsrm_nw.c index d9963faad1..8d591c0746 100644 --- a/TSRM/tsrm_nw.c +++ b/TSRM/tsrm_nw.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/TSRM/tsrm_nw.h b/TSRM/tsrm_nw.h index 1f93bd535d..ba03744a30 100644 --- a/TSRM/tsrm_nw.h +++ b/TSRM/tsrm_nw.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/TSRM/tsrm_virtual_cwd.c b/TSRM/tsrm_virtual_cwd.c index 3e211fa54f..f7a8ca5ec5 100644 --- a/TSRM/tsrm_virtual_cwd.c +++ b/TSRM/tsrm_virtual_cwd.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/TSRM/tsrm_virtual_cwd.h b/TSRM/tsrm_virtual_cwd.h index 8aac4aa267..81efb0f8a3 100644 --- a/TSRM/tsrm_virtual_cwd.h +++ b/TSRM/tsrm_virtual_cwd.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/TSRM/tsrm_win32.c b/TSRM/tsrm_win32.c index 2ec97be011..d8f8365112 100644 --- a/TSRM/tsrm_win32.c +++ b/TSRM/tsrm_win32.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/TSRM/tsrm_win32.h b/TSRM/tsrm_win32.h index c77f69c7f1..dc5a3999dd 100644 --- a/TSRM/tsrm_win32.h +++ b/TSRM/tsrm_win32.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | @@ -621,6 +621,7 @@ c. New functions - LDAP: - ldap_control_paged_result() - ldap_control_paged_result_response() + - ldap_modify_batch (5.4.26) - libxml: - libxml_set_external_entity_loader() diff --git a/Zend/Makefile.am b/Zend/Makefile.am index 5ec4590fef..7955badf6e 100644 --- a/Zend/Makefile.am +++ b/Zend/Makefile.am @@ -10,7 +10,7 @@ libZend_la_SOURCES=\ zend_ini_parser.y zend_ini_scanner.l \ zend_alloc.c zend_compile.c zend_constants.c zend_dynamic_array.c \ zend_execute.c zend_execute_API.c zend_highlight.c zend_llist.c \ - zend_opcode.c zend_operators.c zend_ptr_stack.c zend_stack.c \ + zend_vm_opcodes.c zend_opcode.c zend_operators.c zend_ptr_stack.c zend_stack.c \ zend_variables.c zend.c zend_API.c zend_extensions.c zend_hash.c \ zend_list.c zend_indent.c zend_builtin_functions.c zend_sprintf.c \ zend_ini.c zend_qsort.c zend_objects.c zend_object_handlers.c \ diff --git a/Zend/Zend.dsp b/Zend/Zend.dsp index ebe01978c4..5e95b61d8d 100644 --- a/Zend/Zend.dsp +++ b/Zend/Zend.dsp @@ -257,6 +257,10 @@ SOURCE=.\zend_ts_hash.c SOURCE=.\zend_variables.c
# End Source File
+# Begin Source File
+
+SOURCE=.\zend_vm_opcodes.c
+# End Source File
# End Group
# Begin Group "Header Files"
diff --git a/Zend/ZendTS.dsp b/Zend/ZendTS.dsp index 3494cd4e17..bab134623a 100644 --- a/Zend/ZendTS.dsp +++ b/Zend/ZendTS.dsp @@ -287,6 +287,10 @@ SOURCE=.\zend_ts_hash.c SOURCE=.\zend_variables.c
# End Source File
+# Begin Source File
+
+SOURCE=.\zend_vm_opcodes.c
+# End Source File
# End Group
# Begin Group "Header Files"
diff --git a/Zend/tests/bug65969.phpt b/Zend/tests/bug65969.phpt new file mode 100644 index 0000000000..d5128322ae --- /dev/null +++ b/Zend/tests/bug65969.phpt @@ -0,0 +1,10 @@ +--TEST-- +Bug #65969 (Chain assignment with T_LIST failure) +--FILE-- +<?php +$obj = new stdClass; +list($a,$b) = $obj->prop = [1,2]; +var_dump($a,$b); +--EXPECT-- +int(1) +int(2) diff --git a/Zend/tests/bug66218.phpt b/Zend/tests/bug66218.phpt new file mode 100644 index 0000000000..af7a5ab1d0 --- /dev/null +++ b/Zend/tests/bug66218.phpt @@ -0,0 +1,21 @@ +--TEST-- +Bug #66218 zend_register_functions breaks reflection +--SKIPIF-- +<?php +if (PHP_SAPI != "cli") die("skip CLI only test"); +if (!function_exists("dl")) die("skip need dl"); +?> +--FILE-- +<?php +$tab = get_extension_funcs("standard"); +$fcts = array("dl"); +foreach ($fcts as $fct) { + if (in_array($fct, $tab)) { + echo "$fct Ok\n"; + } +} +?> +Done +--EXPECTF-- +dl Ok +Done diff --git a/Zend/tests/bug66286.phpt b/Zend/tests/bug66286.phpt new file mode 100644 index 0000000000..457e282402 --- /dev/null +++ b/Zend/tests/bug66286.phpt @@ -0,0 +1,26 @@ +--TEST-- +Bug #66286: Incorrect object comparison with inheritance +--FILE-- +<?php + +abstract class first { + protected $someArray = array(); +} + +class second extends first { + protected $someArray = array(); + protected $someValue = null; + + public function __construct($someValue) { + $this->someValue = $someValue; + } +} + +$objFirst = new second('123'); +$objSecond = new second('321'); + +var_dump ($objFirst == $objSecond); + +?> +--EXPECT-- +bool(false) diff --git a/Zend/zend.c b/Zend/zend.c index 0602c45042..1189875f37 100644 --- a/Zend/zend.c +++ b/Zend/zend.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | @@ -43,10 +43,6 @@ # define GLOBAL_CONSTANTS_TABLE EG(zend_constants) #endif -#if defined(ZEND_WIN32) && ZEND_DEBUG -BOOL WINAPI IsDebuggerPresent(VOID); -#endif - /* true multithread-shared globals */ ZEND_API zend_class_entry *zend_standard_class_def = NULL; ZEND_API int (*zend_printf)(const char *format, ...); @@ -131,7 +127,7 @@ ZEND_API zval zval_used_for_init; /* True global variable */ /* version information */ static char *zend_version_info; static uint zend_version_info_length; -#define ZEND_CORE_VERSION_INFO "Zend Engine v" ZEND_VERSION ", Copyright (c) 1998-2013 Zend Technologies\n" +#define ZEND_CORE_VERSION_INFO "Zend Engine v" ZEND_VERSION ", Copyright (c) 1998-2014 Zend Technologies\n" #define PRINT_ZVAL_INDENT 4 static void print_hash(zend_write_func_t write_func, HashTable *ht, int indent, zend_bool is_object TSRMLS_DC) /* {{{ */ diff --git a/Zend/zend.h b/Zend/zend.h index e1d1fad427..d1710548d6 100644 --- a/Zend/zend.h +++ b/Zend/zend.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 125a1a2564..1a661d7056 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_API.h b/Zend/zend_API.h index 7b8b68d3b2..84acfcac88 100644 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_alloc.c b/Zend/zend_alloc.c index 596c2498bc..ae88b5dae9 100644 --- a/Zend/zend_alloc.c +++ b/Zend/zend_alloc.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_alloc.h b/Zend/zend_alloc.h index d456f90d4c..3e9747d2ae 100644 --- a/Zend/zend_alloc.h +++ b/Zend/zend_alloc.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_build.h b/Zend/zend_build.h index 152e1bd44a..bec174d5c7 100644 --- a/Zend/zend_build.h +++ b/Zend/zend_build.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index 04f4ebec26..f3dd12346d 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | @@ -2452,36 +2452,49 @@ ZEND_FUNCTION(extension_loaded) Returns an array with the names of functions belonging to the named extension */ ZEND_FUNCTION(get_extension_funcs) { - char *extension_name; - int extension_name_len; + char *extension_name, *lcname; + int extension_name_len, array; zend_module_entry *module; - const zend_function_entry *func; - + HashPosition iterator; + zend_function *zif; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &extension_name, &extension_name_len) == FAILURE) { return; } - if (strncasecmp(extension_name, "zend", sizeof("zend"))) { - char *lcname = zend_str_tolower_dup(extension_name, extension_name_len); - if (zend_hash_find(&module_registry, lcname, - extension_name_len+1, (void**)&module) == FAILURE) { - efree(lcname); - RETURN_FALSE; - } + lcname = zend_str_tolower_dup(extension_name, extension_name_len); + } else { + lcname = estrdup("core"); + } + if (zend_hash_find(&module_registry, lcname, + extension_name_len+1, (void**)&module) == FAILURE) { efree(lcname); + RETURN_FALSE; + } - if (!(func = module->functions)) { - RETURN_FALSE; - } + zend_hash_internal_pointer_reset_ex(CG(function_table), &iterator); + if (module->functions) { + /* avoid BC break, if functions list is empty, will return an empty array */ + array_init(return_value); + array = 1; } else { - func = builtin_functions; + array = 0; + } + while (zend_hash_get_current_data_ex(CG(function_table), (void **) &zif, &iterator) == SUCCESS) { + if (zif->common.type==ZEND_INTERNAL_FUNCTION + && zif->internal_function.module == module) { + if (!array) { + array_init(return_value); + array = 1; + } + add_next_index_string(return_value, zif->common.function_name, 1); + } + zend_hash_move_forward_ex(CG(function_table), &iterator); } - array_init(return_value); + efree(lcname); - while (func->fname) { - add_next_index_string(return_value, func->fname, 1); - func++; + if (!array) { + RETURN_FALSE; } } /* }}} */ diff --git a/Zend/zend_builtin_functions.h b/Zend/zend_builtin_functions.h index e1af53637d..3db0d2002b 100644 --- a/Zend/zend_builtin_functions.h +++ b/Zend/zend_builtin_functions.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_closures.c b/Zend/zend_closures.c index a37397543b..c18972a7f1 100644 --- a/Zend/zend_closures.c +++ b/Zend/zend_closures.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_closures.h b/Zend/zend_closures.h index c41cf47560..eb0c89b8c5 100644 --- a/Zend/zend_closures.h +++ b/Zend/zend_closures.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 10390b04a8..f26766964a 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h index 32449d2a66..1490307df4 100644 --- a/Zend/zend_compile.h +++ b/Zend/zend_compile.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_config.nw.h b/Zend/zend_config.nw.h index 04f80bfe72..bbb2da6e72 100644 --- a/Zend/zend_config.nw.h +++ b/Zend/zend_config.nw.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_config.w32.h b/Zend/zend_config.w32.h index 73bd0525ba..f779a506e6 100644 --- a/Zend/zend_config.w32.h +++ b/Zend/zend_config.w32.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_constants.c b/Zend/zend_constants.c index 21580d3d5f..574d4b1555 100644 --- a/Zend/zend_constants.c +++ b/Zend/zend_constants.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_constants.h b/Zend/zend_constants.h index c7261946c8..2e9af42d2f 100644 --- a/Zend/zend_constants.h +++ b/Zend/zend_constants.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_default_classes.c b/Zend/zend_default_classes.c index 43d8e631db..1889451a00 100644 --- a/Zend/zend_default_classes.c +++ b/Zend/zend_default_classes.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_dynamic_array.c b/Zend/zend_dynamic_array.c index 543479c43e..db81b00a73 100644 --- a/Zend/zend_dynamic_array.c +++ b/Zend/zend_dynamic_array.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_dynamic_array.h b/Zend/zend_dynamic_array.h index 2c96f85437..e69eb18768 100644 --- a/Zend/zend_dynamic_array.h +++ b/Zend/zend_dynamic_array.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_errors.h b/Zend/zend_errors.h index a2cdc20a60..941903d16d 100644 --- a/Zend/zend_errors.h +++ b/Zend/zend_errors.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_exceptions.c b/Zend/zend_exceptions.c index 14ae75e38d..ced1ebf639 100644 --- a/Zend/zend_exceptions.c +++ b/Zend/zend_exceptions.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | @@ -360,6 +360,11 @@ ZEND_METHOD(error_exception, getSeverity) } \ } + +#define TRACE_ARG_APPEND(vallen) \ + *str = (char*)erealloc(*str, *len + 1 + vallen); \ + memcpy((*str) + *len - l_added + 1 + vallen, (*str) + *len - l_added + 1, l_added); + /* }}} */ static int _build_trace_args(zval **arg TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */ @@ -371,7 +376,7 @@ static int _build_trace_args(zval **arg TSRMLS_DC, int num_args, va_list args, z len = va_arg(args, int*); /* the trivial way would be to do: - * conver_to_string_ex(arg); + * convert_to_string_ex(arg); * append it and kill the now tmp arg. * but that could cause some E_NOTICE and also damn long lines. */ @@ -394,8 +399,58 @@ static int _build_trace_args(zval **arg TSRMLS_DC, int num_args, va_list args, z l_added += 3 + 1; } while (--l_added) { - if ((*str)[*len - l_added] < 32) { - (*str)[*len - l_added] = '?'; + unsigned char chr = (*str)[*len - l_added]; + if (chr < 32 || chr == '\\' || chr > 126) { + (*str)[*len - l_added] = '\\'; + + switch (chr) { + case '\n': + TRACE_ARG_APPEND(1); + (*str)[++(*len) - l_added] = 'n'; + break; + case '\r': + TRACE_ARG_APPEND(1); + (*str)[++(*len) - l_added] = 'r'; + break; + case '\t': + TRACE_ARG_APPEND(1); + (*str)[++(*len) - l_added] = 't'; + break; + case '\f': + TRACE_ARG_APPEND(1); + (*str)[++(*len) - l_added] = 'f'; + break; + case '\v': + TRACE_ARG_APPEND(1); + (*str)[++(*len) - l_added] = 'v'; + break; +#ifndef PHP_WIN32 + case '\e': +#else + case VK_ESCAPE: +#endif + TRACE_ARG_APPEND(1); + (*str)[++(*len) - l_added] = 'e'; + break; + case '\\': + TRACE_ARG_APPEND(1); + (*str)[++(*len) - l_added] = '\\'; + break; + default: + TRACE_ARG_APPEND(3); + (*str)[*len - l_added + 1] = 'x'; + if ((chr >> 4) < 10) { + (*str)[*len - l_added + 2] = (chr >> 4) + '0'; + } else { + (*str)[*len - l_added + 2] = (chr >> 4) + 'A' - 10; + } + if (chr % 16 < 10) { + (*str)[*len - l_added + 3] = chr % 16 + '0'; + } else { + (*str)[*len - l_added + 3] = chr % 16 + 'A' - 10; + } + *len += 3; + } } } break; diff --git a/Zend/zend_exceptions.h b/Zend/zend_exceptions.h index 82633530d6..ff73a22417 100644 --- a/Zend/zend_exceptions.h +++ b/Zend/zend_exceptions.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index ff9c2d0de2..a329a65202 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | @@ -1248,9 +1248,8 @@ convert_to_array: } } -static void zend_fetch_dimension_address_read(temp_variable *result, zval **container_ptr, zval *dim, int dim_type, int type TSRMLS_DC) +static void zend_fetch_dimension_address_read(temp_variable *result, zval *container, zval *dim, int dim_type, int type TSRMLS_DC) { - zval *container = *container_ptr; zval **retval; switch (Z_TYPE_P(container)) { diff --git a/Zend/zend_execute.h b/Zend/zend_execute.h index 19eaeeb402..b74fd9614d 100644 --- a/Zend/zend_execute.h +++ b/Zend/zend_execute.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 6fa7e9bafb..e79abdc944 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | @@ -1081,6 +1081,14 @@ ZEND_API int zend_lookup_class_ex(const char *name, int name_length, const zend_ return FAILURE; } + /* Verify class name before passing it to __autoload() */ + if (strspn(name, "0123456789_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377\\") != name_length) { + if (!key) { + free_alloca(lc_free, use_heap); + } + return FAILURE; + } + if (EG(in_autoload) == NULL) { ALLOC_HASHTABLE(EG(in_autoload)); zend_hash_init(EG(in_autoload), 0, NULL, NULL, 0); diff --git a/Zend/zend_extensions.c b/Zend/zend_extensions.c index 2dd7cd4c59..e1290b78ca 100644 --- a/Zend/zend_extensions.c +++ b/Zend/zend_extensions.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_extensions.h b/Zend/zend_extensions.h index efab29d67e..df7a7d5f14 100644 --- a/Zend/zend_extensions.h +++ b/Zend/zend_extensions.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_float.c b/Zend/zend_float.c index cd6fcf2a14..ca0130134c 100644 --- a/Zend/zend_float.c +++ b/Zend/zend_float.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_float.h b/Zend/zend_float.h index a17ad5658b..b69f4de101 100644 --- a/Zend/zend_float.h +++ b/Zend/zend_float.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_gc.c b/Zend/zend_gc.c index 7b83ddb54f..76217e369d 100644 --- a/Zend/zend_gc.c +++ b/Zend/zend_gc.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_gc.h b/Zend/zend_gc.h index 3483e9dbf0..ac5f6350a2 100644 --- a/Zend/zend_gc.h +++ b/Zend/zend_gc.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_globals.h b/Zend/zend_globals.h index 646e9c9a60..e779ac4d74 100644 --- a/Zend/zend_globals.h +++ b/Zend/zend_globals.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_globals_macros.h b/Zend/zend_globals_macros.h index 9bb1b8026d..ac9b793775 100644 --- a/Zend/zend_globals_macros.h +++ b/Zend/zend_globals_macros.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_hash.c b/Zend/zend_hash.c index 0609d707f5..bfff87a67e 100644 --- a/Zend/zend_hash.c +++ b/Zend/zend_hash.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_hash.h b/Zend/zend_hash.h index 88c3bfb421..4ab811eeb0 100644 --- a/Zend/zend_hash.h +++ b/Zend/zend_hash.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_highlight.c b/Zend/zend_highlight.c index ad299e3590..a38441b39a 100644 --- a/Zend/zend_highlight.c +++ b/Zend/zend_highlight.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | @@ -57,7 +57,7 @@ ZEND_API void zend_html_putc(char c) ZEND_API void zend_html_puts(const char *s, uint len TSRMLS_DC) { const unsigned char *ptr = (const unsigned char*)s, *end = ptr + len; - unsigned char *filtered; + unsigned char *filtered = NULL; size_t filtered_len; if (LANG_SCNG(output_filter)) { diff --git a/Zend/zend_highlight.h b/Zend/zend_highlight.h index 20adf349ae..1a35505135 100644 --- a/Zend/zend_highlight.h +++ b/Zend/zend_highlight.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_indent.c b/Zend/zend_indent.c index fea78d9c57..cacdf8df3b 100644 --- a/Zend/zend_indent.c +++ b/Zend/zend_indent.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_indent.h b/Zend/zend_indent.h index bba02a738b..6d0996efa8 100644 --- a/Zend/zend_indent.h +++ b/Zend/zend_indent.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_ini.c b/Zend/zend_ini.c index 2c74f20f6a..f286ccd157 100644 --- a/Zend/zend_ini.c +++ b/Zend/zend_ini.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_ini.h b/Zend/zend_ini.h index b27d3d4add..0fe4c3161f 100644 --- a/Zend/zend_ini.h +++ b/Zend/zend_ini.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_ini_parser.y b/Zend/zend_ini_parser.y index 2d428c3fe7..aa6e0594b3 100644 --- a/Zend/zend_ini_parser.y +++ b/Zend/zend_ini_parser.y @@ -3,7 +3,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_ini_scanner.c b/Zend/zend_ini_scanner.c index 5f483de522..fd7e08aa33 100644 --- a/Zend/zend_ini_scanner.c +++ b/Zend/zend_ini_scanner.c @@ -4,7 +4,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_ini_scanner.h b/Zend/zend_ini_scanner.h index 2655fc8732..aafe7efdde 100644 --- a/Zend/zend_ini_scanner.h +++ b/Zend/zend_ini_scanner.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_ini_scanner.l b/Zend/zend_ini_scanner.l index 5fb28d4259..f27db6ef03 100644 --- a/Zend/zend_ini_scanner.l +++ b/Zend/zend_ini_scanner.l @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_interfaces.c b/Zend/zend_interfaces.c index e2e81ed326..7a107da8d7 100644 --- a/Zend/zend_interfaces.c +++ b/Zend/zend_interfaces.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_interfaces.h b/Zend/zend_interfaces.h index 23547951ed..7ff5fe09af 100644 --- a/Zend/zend_interfaces.h +++ b/Zend/zend_interfaces.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_istdiostream.h b/Zend/zend_istdiostream.h index d7edf172f0..40fdb4310f 100644 --- a/Zend/zend_istdiostream.h +++ b/Zend/zend_istdiostream.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_iterators.c b/Zend/zend_iterators.c index f2c27fa63d..a2854c4b74 100644 --- a/Zend/zend_iterators.c +++ b/Zend/zend_iterators.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_iterators.h b/Zend/zend_iterators.h index b484102b20..d675e57058 100644 --- a/Zend/zend_iterators.h +++ b/Zend/zend_iterators.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_language_parser.y b/Zend/zend_language_parser.y index bf48bb73d9..2a69fcfc38 100644 --- a/Zend/zend_language_parser.y +++ b/Zend/zend_language_parser.y @@ -3,7 +3,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_language_scanner.c b/Zend/zend_language_scanner.c index 2b25ae7eb1..68ba75e7c7 100644 --- a/Zend/zend_language_scanner.c +++ b/Zend/zend_language_scanner.c @@ -4,7 +4,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_language_scanner.h b/Zend/zend_language_scanner.h index 704547825a..62ad8ddf91 100644 --- a/Zend/zend_language_scanner.h +++ b/Zend/zend_language_scanner.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_language_scanner.l b/Zend/zend_language_scanner.l index e70a3e1dce..0300b3208b 100644 --- a/Zend/zend_language_scanner.l +++ b/Zend/zend_language_scanner.l @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_list.c b/Zend/zend_list.c index e60deb1cd1..11c2c33567 100644 --- a/Zend/zend_list.c +++ b/Zend/zend_list.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_list.h b/Zend/zend_list.h index 23f51140f5..b7980d56f2 100644 --- a/Zend/zend_list.h +++ b/Zend/zend_list.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_llist.c b/Zend/zend_llist.c index 8aa369b502..f8c20e7b76 100644 --- a/Zend/zend_llist.c +++ b/Zend/zend_llist.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_llist.h b/Zend/zend_llist.h index 0a03e6ce59..b05ece8077 100644 --- a/Zend/zend_llist.h +++ b/Zend/zend_llist.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_modules.h b/Zend/zend_modules.h index 1e420347f5..123fdf9f3e 100644 --- a/Zend/zend_modules.h +++ b/Zend/zend_modules.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_multibyte.c b/Zend/zend_multibyte.c index dafcf18393..356bfc75fa 100644 --- a/Zend/zend_multibyte.c +++ b/Zend/zend_multibyte.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_multibyte.h b/Zend/zend_multibyte.h index c537e133f8..db2db1a971 100644 --- a/Zend/zend_multibyte.h +++ b/Zend/zend_multibyte.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_multiply.h b/Zend/zend_multiply.h index 092d3cd0b2..5d03125b29 100644 --- a/Zend/zend_multiply.h +++ b/Zend/zend_multiply.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c index c2bb056a9a..054c1bf553 100644 --- a/Zend/zend_object_handlers.c +++ b/Zend/zend_object_handlers.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | @@ -1376,10 +1376,6 @@ static int zend_std_compare_objects(zval *o1, zval *o2 TSRMLS_DC) /* {{{ */ Z_OBJ_UNPROTECT_RECURSION(o1); Z_OBJ_UNPROTECT_RECURSION(o2); return 1; - } else { - Z_OBJ_UNPROTECT_RECURSION(o1); - Z_OBJ_UNPROTECT_RECURSION(o2); - return 0; } } } diff --git a/Zend/zend_object_handlers.h b/Zend/zend_object_handlers.h index 11635328c3..cfc0933d22 100644 --- a/Zend/zend_object_handlers.h +++ b/Zend/zend_object_handlers.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_objects.c b/Zend/zend_objects.c index ce6284439c..da3aab551d 100644 --- a/Zend/zend_objects.c +++ b/Zend/zend_objects.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_objects.h b/Zend/zend_objects.h index 17d8430fce..d00c65a368 100644 --- a/Zend/zend_objects.h +++ b/Zend/zend_objects.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_objects_API.c b/Zend/zend_objects_API.c index b5dd48f798..f7a6b0b4c3 100644 --- a/Zend/zend_objects_API.c +++ b/Zend/zend_objects_API.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_objects_API.h b/Zend/zend_objects_API.h index a6ea9b8c02..d8f2c5e384 100644 --- a/Zend/zend_objects_API.h +++ b/Zend/zend_objects_API.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c index 695b651a87..52b68a9191 100644 --- a/Zend/zend_opcode.c +++ b/Zend/zend_opcode.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c index 474f978a32..a791a36d78 100644 --- a/Zend/zend_operators.c +++ b/Zend/zend_operators.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_operators.h b/Zend/zend_operators.h index 047b92e3ba..94cb924f5a 100644 --- a/Zend/zend_operators.h +++ b/Zend/zend_operators.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | @@ -593,13 +593,18 @@ static zend_always_inline int fast_add_function(zval *result, zval *op1, zval *o "r"(op2) : "rax"); #else - Z_LVAL_P(result) = Z_LVAL_P(op1) + Z_LVAL_P(op2); + /* + * 'result' may alias with op1 or op2, so we need to + * ensure that 'result' is not updated until after we + * have read the values of op1 and op2. + */ if (UNEXPECTED((Z_LVAL_P(op1) & LONG_SIGN_MASK) == (Z_LVAL_P(op2) & LONG_SIGN_MASK) - && (Z_LVAL_P(op1) & LONG_SIGN_MASK) != (Z_LVAL_P(result) & LONG_SIGN_MASK))) { + && (Z_LVAL_P(op1) & LONG_SIGN_MASK) != ((Z_LVAL_P(op1) + Z_LVAL_P(op2)) & LONG_SIGN_MASK))) { Z_DVAL_P(result) = (double) Z_LVAL_P(op1) + (double) Z_LVAL_P(op2); Z_TYPE_P(result) = IS_DOUBLE; } else { + Z_LVAL_P(result) = Z_LVAL_P(op1) + Z_LVAL_P(op2); Z_TYPE_P(result) = IS_LONG; } #endif @@ -736,6 +741,7 @@ static zend_always_inline int fast_mul_function(zval *result, zval *op1, zval *o static zend_always_inline int fast_div_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) { +#if 0 if (EXPECTED(Z_TYPE_P(op1) == IS_LONG) && 0) { if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) { if (UNEXPECTED(Z_LVAL_P(op2) == 0)) { @@ -790,6 +796,7 @@ static zend_always_inline int fast_div_function(zval *result, zval *op1, zval *o return SUCCESS; } } +#endif return div_function(result, op1, op2 TSRMLS_CC); } diff --git a/Zend/zend_ptr_stack.c b/Zend/zend_ptr_stack.c index 7d2fa2d297..acdb800ca7 100644 --- a/Zend/zend_ptr_stack.c +++ b/Zend/zend_ptr_stack.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_ptr_stack.h b/Zend/zend_ptr_stack.h index e2e7705764..455aa63b4c 100644 --- a/Zend/zend_ptr_stack.h +++ b/Zend/zend_ptr_stack.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_qsort.c b/Zend/zend_qsort.c index bf179904ef..b5799897dd 100644 --- a/Zend/zend_qsort.c +++ b/Zend/zend_qsort.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_qsort.h b/Zend/zend_qsort.h index 58c99f26c2..747e98823f 100644 --- a/Zend/zend_qsort.h +++ b/Zend/zend_qsort.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_sprintf.c b/Zend/zend_sprintf.c index 79ee5a9d6f..64c9b727fd 100644 --- a/Zend/zend_sprintf.c +++ b/Zend/zend_sprintf.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_stack.c b/Zend/zend_stack.c index 3e7401f5ff..cf99499e79 100644 --- a/Zend/zend_stack.c +++ b/Zend/zend_stack.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_stack.h b/Zend/zend_stack.h index f18dfeca7c..d484879468 100644 --- a/Zend/zend_stack.h +++ b/Zend/zend_stack.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_static_allocator.c b/Zend/zend_static_allocator.c index 1150deb570..71338d211e 100644 --- a/Zend/zend_static_allocator.c +++ b/Zend/zend_static_allocator.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_static_allocator.h b/Zend/zend_static_allocator.h index 5556256535..7516065707 100644 --- a/Zend/zend_static_allocator.h +++ b/Zend/zend_static_allocator.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_stream.c b/Zend/zend_stream.c index 835fdbbd7e..6d306b337e 100644 --- a/Zend/zend_stream.c +++ b/Zend/zend_stream.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_stream.h b/Zend/zend_stream.h index a65d258957..5306b496f9 100644 --- a/Zend/zend_stream.h +++ b/Zend/zend_stream.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_string.c b/Zend/zend_string.c index ff7ee3fd81..9b7005df59 100644 --- a/Zend/zend_string.c +++ b/Zend/zend_string.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_string.h b/Zend/zend_string.h index ebf8c816c1..5f823775e4 100644 --- a/Zend/zend_string.h +++ b/Zend/zend_string.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_strtod.c b/Zend/zend_strtod.c index d6e5ccf960..4546614cfd 100644 --- a/Zend/zend_strtod.c +++ b/Zend/zend_strtod.c @@ -267,8 +267,7 @@ BEGIN_EXTERN_C() #if defined(IEEE_LITTLE_ENDIAN) + defined(IEEE_BIG_ENDIAN) + defined(VAX) + \ defined(IBM) != 1 - Exactly one of IEEE_LITTLE_ENDIAN IEEE_BIG_ENDIAN, VAX, or - IBM should be defined. +#error "Exactly one of IEEE_LITTLE_ENDIAN IEEE_BIG_ENDIAN, VAX, or IBM should be defined." #endif typedef union { diff --git a/Zend/zend_strtod.h b/Zend/zend_strtod.h index aac17cea14..ba312d4f1b 100644 --- a/Zend/zend_strtod.h +++ b/Zend/zend_strtod.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_ts_hash.c b/Zend/zend_ts_hash.c index f517fe8560..6f2eb8185c 100644 --- a/Zend/zend_ts_hash.c +++ b/Zend/zend_ts_hash.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_ts_hash.h b/Zend/zend_ts_hash.h index 9a849e15ae..25117aa784 100644 --- a/Zend/zend_ts_hash.h +++ b/Zend/zend_ts_hash.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_types.h b/Zend/zend_types.h index 3e68add3dc..d896159247 100644 --- a/Zend/zend_types.h +++ b/Zend/zend_types.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_variables.c b/Zend/zend_variables.c index c0e1849eef..b875445120 100644 --- a/Zend/zend_variables.c +++ b/Zend/zend_variables.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_variables.h b/Zend/zend_variables.h index e52dbd7853..30f170bfbe 100644 --- a/Zend/zend_variables.h +++ b/Zend/zend_variables.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_vm.h b/Zend/zend_vm.h index c406c1a891..078be15b74 100644 --- a/Zend/zend_vm.h +++ b/Zend/zend_vm.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index f6c6e6ac58..ab33468205 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | @@ -1166,19 +1166,17 @@ ZEND_VM_HANDLER(81, ZEND_FETCH_DIM_R, VAR|CV, CONST|TMP|VAR|CV) { USE_OPLINE zend_free_op free_op1, free_op2; - zval **container; + zval *container; SAVE_OPLINE(); - if ((opline->extended_value & ZEND_FETCH_ADD_LOCK) && - OP1_TYPE != IS_CV && - EX_T(opline->op1.var).var.ptr_ptr) { - PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr); + if (OP1_TYPE == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) { + PZVAL_LOCK(EX_T(opline->op1.var).var.ptr); } - container = GET_OP1_ZVAL_PTR_PTR(BP_VAR_R); + container = GET_OP1_ZVAL_PTR(BP_VAR_R); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, GET_OP2_ZVAL_PTR(BP_VAR_R), OP2_TYPE, BP_VAR_R TSRMLS_CC); FREE_OP2(); - FREE_OP1_VAR_PTR(); + FREE_OP1(); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -1243,13 +1241,13 @@ ZEND_VM_HANDLER(90, ZEND_FETCH_DIM_IS, VAR|CV, CONST|TMP|VAR|CV) { USE_OPLINE zend_free_op free_op1, free_op2; - zval **container; + zval *container; SAVE_OPLINE(); - container = GET_OP1_ZVAL_PTR_PTR(BP_VAR_IS); + container = GET_OP1_ZVAL_PTR(BP_VAR_IS); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, GET_OP2_ZVAL_PTR(BP_VAR_R), OP2_TYPE, BP_VAR_IS TSRMLS_CC); FREE_OP2(); - FREE_OP1_VAR_PTR(); + FREE_OP1(); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -1258,12 +1256,12 @@ ZEND_VM_HANDLER(93, ZEND_FETCH_DIM_FUNC_ARG, VAR|CV, CONST|TMP|VAR|UNUSED|CV) { USE_OPLINE zend_free_op free_op1, free_op2; - zval **container; SAVE_OPLINE(); if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) { - container = GET_OP1_ZVAL_PTR_PTR(BP_VAR_W); + zval **container = GET_OP1_ZVAL_PTR_PTR(BP_VAR_W); + if (OP1_TYPE == IS_VAR && UNEXPECTED(container == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); } @@ -1271,15 +1269,19 @@ ZEND_VM_HANDLER(93, ZEND_FETCH_DIM_FUNC_ARG, VAR|CV, CONST|TMP|VAR|UNUSED|CV) if (OP1_TYPE == IS_VAR && OP1_FREE && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } + FREE_OP2(); + FREE_OP1_VAR_PTR(); } else { + zval *container; + if (OP2_TYPE == IS_UNUSED) { zend_error_noreturn(E_ERROR, "Cannot use [] for reading"); } - container = GET_OP1_ZVAL_PTR_PTR(BP_VAR_R); + container = GET_OP1_ZVAL_PTR(BP_VAR_R); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, GET_OP2_ZVAL_PTR(BP_VAR_R), OP2_TYPE, BP_VAR_R TSRMLS_CC); + FREE_OP2(); + FREE_OP1(); } - FREE_OP2(); - FREE_OP1_VAR_PTR(); CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 64d4320f9a..fa997b287e 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | @@ -12874,16 +12874,14 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HA { USE_OPLINE zend_free_op free_op1; - zval **container; + zval *container; SAVE_OPLINE(); - if ((opline->extended_value & ZEND_FETCH_ADD_LOCK) && - IS_VAR != IS_CV && - EX_T(opline->op1.var).var.ptr_ptr) { - PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr); + if (IS_VAR == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) { + PZVAL_LOCK(EX_T(opline->op1.var).var.ptr); } - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + container = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, opline->op2.zv, IS_CONST, BP_VAR_R TSRMLS_CC); if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; @@ -12951,10 +12949,10 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_H { USE_OPLINE zend_free_op free_op1; - zval **container; + zval *container; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + container = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, opline->op2.zv, IS_CONST, BP_VAR_IS TSRMLS_CC); if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; @@ -12966,12 +12964,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CONST_HANDLER(ZEND_OP { USE_OPLINE zend_free_op free_op1; - zval **container; SAVE_OPLINE(); if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) { - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + zval **container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); } @@ -12979,15 +12977,19 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CONST_HANDLER(ZEND_OP if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } + + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; } else { + zval *container; + if (IS_CONST == IS_UNUSED) { zend_error_noreturn(E_ERROR, "Cannot use [] for reading"); } - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + container = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, opline->op2.zv, IS_CONST, BP_VAR_R TSRMLS_CC); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -15048,16 +15050,14 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAND { USE_OPLINE zend_free_op free_op1, free_op2; - zval **container; + zval *container; SAVE_OPLINE(); - if ((opline->extended_value & ZEND_FETCH_ADD_LOCK) && - IS_VAR != IS_CV && - EX_T(opline->op1.var).var.ptr_ptr) { - PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr); + if (IS_VAR == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) { + PZVAL_LOCK(EX_T(opline->op1.var).var.ptr); } - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + container = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_R TSRMLS_CC); zval_dtor(free_op2.var); if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; @@ -15125,10 +15125,10 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HAN { USE_OPLINE zend_free_op free_op1, free_op2; - zval **container; + zval *container; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + container = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_IS TSRMLS_CC); zval_dtor(free_op2.var); if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; @@ -15140,12 +15140,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_TMP_HANDLER(ZEND_OPCO { USE_OPLINE zend_free_op free_op1, free_op2; - zval **container; SAVE_OPLINE(); if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) { - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + zval **container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); } @@ -15153,15 +15153,19 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_TMP_HANDLER(ZEND_OPCO if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } + zval_dtor(free_op2.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; } else { + zval *container; + if (IS_TMP_VAR == IS_UNUSED) { zend_error_noreturn(E_ERROR, "Cannot use [] for reading"); } - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + container = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_R TSRMLS_CC); + zval_dtor(free_op2.var); + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; } - zval_dtor(free_op2.var); - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -17132,16 +17136,14 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HAND { USE_OPLINE zend_free_op free_op1, free_op2; - zval **container; + zval *container; SAVE_OPLINE(); - if ((opline->extended_value & ZEND_FETCH_ADD_LOCK) && - IS_VAR != IS_CV && - EX_T(opline->op1.var).var.ptr_ptr) { - PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr); + if (IS_VAR == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) { + PZVAL_LOCK(EX_T(opline->op1.var).var.ptr); } - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + container = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_R TSRMLS_CC); if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; @@ -17209,10 +17211,10 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HAN { USE_OPLINE zend_free_op free_op1, free_op2; - zval **container; + zval *container; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + container = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_IS TSRMLS_CC); if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; @@ -17224,12 +17226,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_VAR_HANDLER(ZEND_OPCO { USE_OPLINE zend_free_op free_op1, free_op2; - zval **container; SAVE_OPLINE(); if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) { - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + zval **container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); } @@ -17237,15 +17239,19 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_VAR_HANDLER(ZEND_OPCO if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; } else { + zval *container; + if (IS_VAR == IS_UNUSED) { zend_error_noreturn(E_ERROR, "Cannot use [] for reading"); } - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + container = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_R TSRMLS_CC); + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -19007,12 +19013,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_UNUSED_HANDLER(ZEND_O { USE_OPLINE zend_free_op free_op1; - zval **container; SAVE_OPLINE(); if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) { - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + zval **container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); } @@ -19020,15 +19026,19 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_UNUSED_HANDLER(ZEND_O if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } + + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; } else { + zval *container; + if (IS_UNUSED == IS_UNUSED) { zend_error_noreturn(E_ERROR, "Cannot use [] for reading"); } - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + container = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, NULL, IS_UNUSED, BP_VAR_R TSRMLS_CC); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -20257,16 +20267,14 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDL { USE_OPLINE zend_free_op free_op1; - zval **container; + zval *container; SAVE_OPLINE(); - if ((opline->extended_value & ZEND_FETCH_ADD_LOCK) && - IS_VAR != IS_CV && - EX_T(opline->op1.var).var.ptr_ptr) { - PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr); + if (IS_VAR == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) { + PZVAL_LOCK(EX_T(opline->op1.var).var.ptr); } - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + container = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_R TSRMLS_CC); if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; @@ -20334,10 +20342,10 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HAND { USE_OPLINE zend_free_op free_op1; - zval **container; + zval *container; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + container = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_IS TSRMLS_CC); if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; @@ -20349,12 +20357,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CV_HANDLER(ZEND_OPCOD { USE_OPLINE zend_free_op free_op1; - zval **container; SAVE_OPLINE(); if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) { - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + zval **container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); } @@ -20362,15 +20370,19 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CV_HANDLER(ZEND_OPCOD if (IS_VAR == IS_VAR && (free_op1.var != NULL) && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } + + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; } else { + zval *container; + if (IS_CV == IS_UNUSED) { zend_error_noreturn(E_ERROR, "Cannot use [] for reading"); } - container = _get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); + container = _get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_R TSRMLS_CC); - } - if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}; + } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -28692,16 +28704,14 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HAN { USE_OPLINE - zval **container; + zval *container; SAVE_OPLINE(); - if ((opline->extended_value & ZEND_FETCH_ADD_LOCK) && - IS_CV != IS_CV && - EX_T(opline->op1.var).var.ptr_ptr) { - PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr); + if (IS_CV == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) { + PZVAL_LOCK(EX_T(opline->op1.var).var.ptr); } - container = _get_zval_ptr_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); + container = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, opline->op2.zv, IS_CONST, BP_VAR_R TSRMLS_CC); @@ -28768,10 +28778,10 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HA { USE_OPLINE - zval **container; + zval *container; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_cv_BP_VAR_IS(EX_CVs(), opline->op1.var TSRMLS_CC); + container = _get_zval_ptr_cv_BP_VAR_IS(EX_CVs(), opline->op1.var TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, opline->op2.zv, IS_CONST, BP_VAR_IS TSRMLS_CC); @@ -28783,12 +28793,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_CONST_HANDLER(ZEND_OPC { USE_OPLINE zend_free_op free_op1; - zval **container; SAVE_OPLINE(); if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) { - container = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC); + zval **container = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC); + if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); } @@ -28796,15 +28806,19 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_CONST_HANDLER(ZEND_OPC if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } + + } else { + zval *container; + if (IS_CONST == IS_UNUSED) { zend_error_noreturn(E_ERROR, "Cannot use [] for reading"); } - container = _get_zval_ptr_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); + container = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, opline->op2.zv, IS_CONST, BP_VAR_R TSRMLS_CC); - } + } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -30641,16 +30655,14 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDL { USE_OPLINE zend_free_op free_op2; - zval **container; + zval *container; SAVE_OPLINE(); - if ((opline->extended_value & ZEND_FETCH_ADD_LOCK) && - IS_CV != IS_CV && - EX_T(opline->op1.var).var.ptr_ptr) { - PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr); + if (IS_CV == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) { + PZVAL_LOCK(EX_T(opline->op1.var).var.ptr); } - container = _get_zval_ptr_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); + container = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_R TSRMLS_CC); zval_dtor(free_op2.var); @@ -30717,10 +30729,10 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HAND { USE_OPLINE zend_free_op free_op2; - zval **container; + zval *container; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_cv_BP_VAR_IS(EX_CVs(), opline->op1.var TSRMLS_CC); + container = _get_zval_ptr_cv_BP_VAR_IS(EX_CVs(), opline->op1.var TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_IS TSRMLS_CC); zval_dtor(free_op2.var); @@ -30732,12 +30744,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_TMP_HANDLER(ZEND_OPCOD { USE_OPLINE zend_free_op free_op1, free_op2; - zval **container; SAVE_OPLINE(); if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) { - container = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC); + zval **container = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC); + if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); } @@ -30745,15 +30757,19 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_TMP_HANDLER(ZEND_OPCOD if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } + zval_dtor(free_op2.var); + } else { + zval *container; + if (IS_TMP_VAR == IS_UNUSED) { zend_error_noreturn(E_ERROR, "Cannot use [] for reading"); } - container = _get_zval_ptr_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); + container = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_TMP_VAR, BP_VAR_R TSRMLS_CC); - } - zval_dtor(free_op2.var); + zval_dtor(free_op2.var); + } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -32594,16 +32610,14 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDL { USE_OPLINE zend_free_op free_op2; - zval **container; + zval *container; SAVE_OPLINE(); - if ((opline->extended_value & ZEND_FETCH_ADD_LOCK) && - IS_CV != IS_CV && - EX_T(opline->op1.var).var.ptr_ptr) { - PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr); + if (IS_CV == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) { + PZVAL_LOCK(EX_T(opline->op1.var).var.ptr); } - container = _get_zval_ptr_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); + container = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_R TSRMLS_CC); if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; @@ -32670,10 +32684,10 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HAND { USE_OPLINE zend_free_op free_op2; - zval **container; + zval *container; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_cv_BP_VAR_IS(EX_CVs(), opline->op1.var TSRMLS_CC); + container = _get_zval_ptr_cv_BP_VAR_IS(EX_CVs(), opline->op1.var TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_IS TSRMLS_CC); if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; @@ -32685,12 +32699,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_VAR_HANDLER(ZEND_OPCOD { USE_OPLINE zend_free_op free_op1, free_op2; - zval **container; SAVE_OPLINE(); if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) { - container = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC); + zval **container = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC); + if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); } @@ -32698,15 +32712,19 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_VAR_HANDLER(ZEND_OPCOD if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + } else { + zval *container; + if (IS_VAR == IS_UNUSED) { zend_error_noreturn(E_ERROR, "Cannot use [] for reading"); } - container = _get_zval_ptr_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); + container = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC), IS_VAR, BP_VAR_R TSRMLS_CC); - } - if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}; + } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -34336,12 +34354,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_UNUSED_HANDLER(ZEND_OP { USE_OPLINE zend_free_op free_op1; - zval **container; SAVE_OPLINE(); if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) { - container = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC); + zval **container = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC); + if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); } @@ -34349,15 +34367,19 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_UNUSED_HANDLER(ZEND_OP if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } + + } else { + zval *container; + if (IS_UNUSED == IS_UNUSED) { zend_error_noreturn(E_ERROR, "Cannot use [] for reading"); } - container = _get_zval_ptr_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); + container = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, NULL, IS_UNUSED, BP_VAR_R TSRMLS_CC); - } + } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } @@ -35446,16 +35468,14 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_R_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLE { USE_OPLINE - zval **container; + zval *container; SAVE_OPLINE(); - if ((opline->extended_value & ZEND_FETCH_ADD_LOCK) && - IS_CV != IS_CV && - EX_T(opline->op1.var).var.ptr_ptr) { - PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr); + if (IS_CV == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) { + PZVAL_LOCK(EX_T(opline->op1.var).var.ptr); } - container = _get_zval_ptr_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); + container = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_R TSRMLS_CC); @@ -35522,10 +35542,10 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_IS_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDL { USE_OPLINE - zval **container; + zval *container; SAVE_OPLINE(); - container = _get_zval_ptr_ptr_cv_BP_VAR_IS(EX_CVs(), opline->op1.var TSRMLS_CC); + container = _get_zval_ptr_cv_BP_VAR_IS(EX_CVs(), opline->op1.var TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_IS TSRMLS_CC); @@ -35537,12 +35557,12 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_CV_HANDLER(ZEND_OPCODE { USE_OPLINE zend_free_op free_op1; - zval **container; SAVE_OPLINE(); if (ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), (opline->extended_value & ZEND_FETCH_ARG_MASK))) { - container = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC); + zval **container = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->op1.var TSRMLS_CC); + if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { zend_error_noreturn(E_ERROR, "Cannot use string offset as an array"); } @@ -35550,15 +35570,19 @@ static int ZEND_FASTCALL ZEND_FETCH_DIM_FUNC_ARG_SPEC_CV_CV_HANDLER(ZEND_OPCODE if (IS_CV == IS_VAR && 0 && READY_TO_DESTROY(free_op1.var)) { EXTRACT_ZVAL_PTR(&EX_T(opline->result.var)); } + + } else { + zval *container; + if (IS_CV == IS_UNUSED) { zend_error_noreturn(E_ERROR, "Cannot use [] for reading"); } - container = _get_zval_ptr_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); + container = _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op1.var TSRMLS_CC); zend_fetch_dimension_address_read(&EX_T(opline->result.var), container, _get_zval_ptr_cv_BP_VAR_R(EX_CVs(), opline->op2.var TSRMLS_CC), IS_CV, BP_VAR_R TSRMLS_CC); - } + } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); } diff --git a/Zend/zend_vm_gen.php b/Zend/zend_vm_gen.php index d2f51925dc..4bab9e5e3d 100644 --- a/Zend/zend_vm_gen.php +++ b/Zend/zend_vm_gen.php @@ -3,7 +3,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | @@ -24,7 +24,7 @@ $header_text = <<< DATA +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | @@ -886,9 +886,16 @@ function gen_executor($f, $skl, $spec, $kind, $executor_name, $initializer_name, out($f,"#undef CHECK_EXCEPTION\n"); out($f,"#undef HANDLE_EXCEPTION\n"); out($f,"#undef HANDLE_EXCEPTION_LEAVE\n"); - out($f,"#define CHECK_EXCEPTION() if (UNEXPECTED(EG(exception) != NULL)) goto ZEND_HANDLE_EXCEPTION_SPEC_HANDLER\n"); - out($f,"#define HANDLE_EXCEPTION() goto ZEND_HANDLE_EXCEPTION_SPEC_HANDLER\n"); - out($f,"#define HANDLE_EXCEPTION_LEAVE() goto ZEND_HANDLE_EXCEPTION_SPEC_HANDLER\n"); + if (ZEND_VM_SPEC) { + out($f,"#define CHECK_EXCEPTION() if (UNEXPECTED(EG(exception) != NULL)) goto ZEND_HANDLE_EXCEPTION_SPEC_HANDLER\n"); + out($f,"#define HANDLE_EXCEPTION() goto ZEND_HANDLE_EXCEPTION_SPEC_HANDLER\n"); + out($f,"#define HANDLE_EXCEPTION_LEAVE() goto ZEND_HANDLE_EXCEPTION_SPEC_HANDLER\n"); + } else { + out($f,"#define CHECK_EXCEPTION() if (UNEXPECTED(EG(exception) != NULL)) goto ZEND_HANDLE_EXCEPTION_HANDLER\n"); + out($f,"#define HANDLE_EXCEPTION() goto ZEND_HANDLE_EXCEPTION_HANDLER\n"); + out($f,"#define HANDLE_EXCEPTION_LEAVE() goto ZEND_HANDLE_EXCEPTION_HANDLER\n"); + } + out($f,"#define LOAD_REGS() do {Ts = EX(Ts); CVs = EX(CVs);} while (0)\n"); out($f,"#define ZEND_VM_CONTINUE() goto *(void**)(OPLINE->handler)\n"); out($f,"#define ZEND_VM_RETURN() EG(in_execution) = original_in_execution; return\n"); @@ -1194,14 +1201,40 @@ function gen_vm($def, $skel) { // Insert header out($f, $GLOBALS['header_text']); + fputs($f, "#ifndef ZEND_VM_OPCODES_H\n#define ZEND_VM_OPCODES_H\n\n"); + fputs($f, "ZEND_API const char *zend_get_opcode_name(zend_uchar opcode);\n\n"); + foreach ($opcodes as $code => $dsc) { $code = str_pad((string)$code,$code_len," ",STR_PAD_LEFT); $op = str_pad($dsc["op"],$max_opcode_len); fputs($f,"#define $op $code\n"); } + + fputs($f, "\n#endif"); fclose($f); echo "zend_vm_opcodes.h generated successfully.\n"; + // zend_vm_opcodes.c + $f = fopen("zend_vm_opcodes.c", "w+") or die("ERROR: Cannot create zend_vm_opcodes.c\n"); + + // Insert header + out($f, $GLOBALS['header_text']); + fputs($f,"#include <stdio.h>\n"); + fputs($f,"#include <zend.h>\n\n"); + + fputs($f,"const char *zend_vm_opcodes_map[".($max_opcode + 1)."] = {\n"); + for ($i = 0; $i <= $max_opcode; $i++) { + fputs($f,"\t".(isset($opcodes[$i]["op"])?'"'.$opcodes[$i]["op"].'"':"NULL").",\n"); + } + fputs($f, "};\n\n"); + + fputs($f, "ZEND_API const char* zend_get_opcode_name(zend_uchar opcode) {\n"); + fputs($f, "\treturn zend_vm_opcodes_map[opcode];\n"); + fputs($f, "}\n"); + + fclose($f); + echo "zend_vm_opcodes.c generated successfully.\n"; + // Generate zend_vm_execute.h $f = fopen("zend_vm_execute.h", "w+") or die("ERROR: Cannot create zend_vm_execute.h\n"); $executor_file = realpath("zend_vm_execute.h"); diff --git a/Zend/zend_vm_opcodes.c b/Zend/zend_vm_opcodes.c new file mode 100644 index 0000000000..0cd8df0d94 --- /dev/null +++ b/Zend/zend_vm_opcodes.c @@ -0,0 +1,188 @@ +/* + +----------------------------------------------------------------------+ + | Zend Engine | + +----------------------------------------------------------------------+ + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | + +----------------------------------------------------------------------+ + | This source file is subject to version 2.00 of the Zend 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.zend.com/license/2_00.txt. | + | If you did not receive a copy of the Zend license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@zend.com so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Andi Gutmans <andi@zend.com> | + | Zeev Suraski <zeev@zend.com> | + | Dmitry Stogov <dmitry@zend.com> | + +----------------------------------------------------------------------+ +*/ + +#include <stdio.h> +#include <zend.h> + +const char *zend_vm_opcodes_map[159] = { + "ZEND_NOP", + "ZEND_ADD", + "ZEND_SUB", + "ZEND_MUL", + "ZEND_DIV", + "ZEND_MOD", + "ZEND_SL", + "ZEND_SR", + "ZEND_CONCAT", + "ZEND_BW_OR", + "ZEND_BW_AND", + "ZEND_BW_XOR", + "ZEND_BW_NOT", + "ZEND_BOOL_NOT", + "ZEND_BOOL_XOR", + "ZEND_IS_IDENTICAL", + "ZEND_IS_NOT_IDENTICAL", + "ZEND_IS_EQUAL", + "ZEND_IS_NOT_EQUAL", + "ZEND_IS_SMALLER", + "ZEND_IS_SMALLER_OR_EQUAL", + "ZEND_CAST", + "ZEND_QM_ASSIGN", + "ZEND_ASSIGN_ADD", + "ZEND_ASSIGN_SUB", + "ZEND_ASSIGN_MUL", + "ZEND_ASSIGN_DIV", + "ZEND_ASSIGN_MOD", + "ZEND_ASSIGN_SL", + "ZEND_ASSIGN_SR", + "ZEND_ASSIGN_CONCAT", + "ZEND_ASSIGN_BW_OR", + "ZEND_ASSIGN_BW_AND", + "ZEND_ASSIGN_BW_XOR", + "ZEND_PRE_INC", + "ZEND_PRE_DEC", + "ZEND_POST_INC", + "ZEND_POST_DEC", + "ZEND_ASSIGN", + "ZEND_ASSIGN_REF", + "ZEND_ECHO", + "ZEND_PRINT", + "ZEND_JMP", + "ZEND_JMPZ", + "ZEND_JMPNZ", + "ZEND_JMPZNZ", + "ZEND_JMPZ_EX", + "ZEND_JMPNZ_EX", + "ZEND_CASE", + "ZEND_SWITCH_FREE", + "ZEND_BRK", + "ZEND_CONT", + "ZEND_BOOL", + "ZEND_INIT_STRING", + "ZEND_ADD_CHAR", + "ZEND_ADD_STRING", + "ZEND_ADD_VAR", + "ZEND_BEGIN_SILENCE", + "ZEND_END_SILENCE", + "ZEND_INIT_FCALL_BY_NAME", + "ZEND_DO_FCALL", + "ZEND_DO_FCALL_BY_NAME", + "ZEND_RETURN", + "ZEND_RECV", + "ZEND_RECV_INIT", + "ZEND_SEND_VAL", + "ZEND_SEND_VAR", + "ZEND_SEND_REF", + "ZEND_NEW", + "ZEND_INIT_NS_FCALL_BY_NAME", + "ZEND_FREE", + "ZEND_INIT_ARRAY", + "ZEND_ADD_ARRAY_ELEMENT", + "ZEND_INCLUDE_OR_EVAL", + "ZEND_UNSET_VAR", + "ZEND_UNSET_DIM", + "ZEND_UNSET_OBJ", + "ZEND_FE_RESET", + "ZEND_FE_FETCH", + "ZEND_EXIT", + "ZEND_FETCH_R", + "ZEND_FETCH_DIM_R", + "ZEND_FETCH_OBJ_R", + "ZEND_FETCH_W", + "ZEND_FETCH_DIM_W", + "ZEND_FETCH_OBJ_W", + "ZEND_FETCH_RW", + "ZEND_FETCH_DIM_RW", + "ZEND_FETCH_OBJ_RW", + "ZEND_FETCH_IS", + "ZEND_FETCH_DIM_IS", + "ZEND_FETCH_OBJ_IS", + "ZEND_FETCH_FUNC_ARG", + "ZEND_FETCH_DIM_FUNC_ARG", + "ZEND_FETCH_OBJ_FUNC_ARG", + "ZEND_FETCH_UNSET", + "ZEND_FETCH_DIM_UNSET", + "ZEND_FETCH_OBJ_UNSET", + "ZEND_FETCH_DIM_TMP_VAR", + "ZEND_FETCH_CONSTANT", + "ZEND_GOTO", + "ZEND_EXT_STMT", + "ZEND_EXT_FCALL_BEGIN", + "ZEND_EXT_FCALL_END", + "ZEND_EXT_NOP", + "ZEND_TICKS", + "ZEND_SEND_VAR_NO_REF", + "ZEND_CATCH", + "ZEND_THROW", + "ZEND_FETCH_CLASS", + "ZEND_CLONE", + "ZEND_RETURN_BY_REF", + "ZEND_INIT_METHOD_CALL", + "ZEND_INIT_STATIC_METHOD_CALL", + "ZEND_ISSET_ISEMPTY_VAR", + "ZEND_ISSET_ISEMPTY_DIM_OBJ", + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + "ZEND_PRE_INC_OBJ", + "ZEND_PRE_DEC_OBJ", + "ZEND_POST_INC_OBJ", + "ZEND_POST_DEC_OBJ", + "ZEND_ASSIGN_OBJ", + NULL, + "ZEND_INSTANCEOF", + "ZEND_DECLARE_CLASS", + "ZEND_DECLARE_INHERITED_CLASS", + "ZEND_DECLARE_FUNCTION", + "ZEND_RAISE_ABSTRACT_ERROR", + "ZEND_DECLARE_CONST", + "ZEND_ADD_INTERFACE", + "ZEND_DECLARE_INHERITED_CLASS_DELAYED", + "ZEND_VERIFY_ABSTRACT_CLASS", + "ZEND_ASSIGN_DIM", + "ZEND_ISSET_ISEMPTY_PROP_OBJ", + "ZEND_HANDLE_EXCEPTION", + "ZEND_USER_OPCODE", + NULL, + "ZEND_JMP_SET", + "ZEND_DECLARE_LAMBDA_FUNCTION", + "ZEND_ADD_TRAIT", + "ZEND_BIND_TRAITS", + "ZEND_SEPARATE", + "ZEND_QM_ASSIGN_VAR", + "ZEND_JMP_SET_VAR", +}; + +ZEND_API const char* zend_get_opcode_name(zend_uchar opcode) { + return zend_vm_opcodes_map[opcode]; +} diff --git a/Zend/zend_vm_opcodes.h b/Zend/zend_vm_opcodes.h index 94e69abf1e..331bc7a187 100644 --- a/Zend/zend_vm_opcodes.h +++ b/Zend/zend_vm_opcodes.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | @@ -18,6 +18,11 @@ +----------------------------------------------------------------------+ */ +#ifndef ZEND_VM_OPCODES_H +#define ZEND_VM_OPCODES_H + +ZEND_API const char *zend_get_opcode_name(zend_uchar opcode); + #define ZEND_NOP 0 #define ZEND_ADD 1 #define ZEND_SUB 2 @@ -159,3 +164,5 @@ #define ZEND_SEPARATE 156 #define ZEND_QM_ASSIGN_VAR 157 #define ZEND_JMP_SET_VAR 158 + +#endif
\ No newline at end of file diff --git a/build/buildcheck.sh b/build/buildcheck.sh index 8754e3a292..8ff3531825 100755 --- a/build/buildcheck.sh +++ b/build/buildcheck.sh @@ -33,14 +33,14 @@ ac_version=`$PHP_AUTOCONF --version 2>/dev/null|head -n 1|sed -e 's/^[^0-9]*//' if test -z "$ac_version"; then echo "buildconf: autoconf not found." echo " You need autoconf version 2.59 or newer installed" -echo " to build PHP from SVN." +echo " to build PHP from Git." exit 1 fi IFS=.; set $ac_version; IFS=' ' if test "$1" = "2" -a "$2" -lt "59" || test "$1" -lt "2"; then echo "buildconf: autoconf version $ac_version found." echo " You need autoconf version 2.59 or newer installed" -echo " to build PHP from SVN." +echo " to build PHP from Git." exit 1 else echo "buildconf: autoconf version $ac_version (ok)" diff --git a/configure.in b/configure.in index af2de7fce9..dcd3e05fdb 100644 --- a/configure.in +++ b/configure.in @@ -119,7 +119,7 @@ int zend_sprintf(char *buffer, const char *format, ...); PHP_MAJOR_VERSION=5 PHP_MINOR_VERSION=4 -PHP_RELEASE_VERSION=23 +PHP_RELEASE_VERSION=27 PHP_EXTRA_VERSION="-dev" PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION" PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION` @@ -1467,7 +1467,7 @@ PHP_ADD_SOURCES(Zend, \ zend_ini_parser.c zend_ini_scanner.c \ zend_alloc.c zend_compile.c zend_constants.c zend_dynamic_array.c zend_dtrace.c \ zend_execute_API.c zend_highlight.c zend_llist.c \ - zend_opcode.c zend_operators.c zend_ptr_stack.c zend_stack.c \ + zend_vm_opcodes.c zend_opcode.c zend_operators.c zend_ptr_stack.c zend_stack.c \ zend_variables.c zend.c zend_API.c zend_extensions.c zend_hash.c \ zend_list.c zend_indent.c zend_builtin_functions.c zend_sprintf.c \ zend_ini.c zend_qsort.c zend_multibyte.c zend_ts_hash.c zend_stream.c \ diff --git a/ext/bcmath/bcmath.c b/ext/bcmath/bcmath.c index c5fbce94dd..9369897c7f 100644 --- a/ext/bcmath/bcmath.c +++ b/ext/bcmath/bcmath.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/bcmath/php_bcmath.h b/ext/bcmath/php_bcmath.h index 571993ed7b..a18e5287e6 100644 --- a/ext/bcmath/php_bcmath.h +++ b/ext/bcmath/php_bcmath.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/bz2/bz2.c b/ext/bz2/bz2.c index abe84fc316..2692b22586 100644 --- a/ext/bz2/bz2.c +++ b/ext/bz2/bz2.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/bz2/bz2_filter.c b/ext/bz2/bz2_filter.c index 868acec870..a8a164085c 100644 --- a/ext/bz2/bz2_filter.c +++ b/ext/bz2/bz2_filter.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/bz2/php_bz2.h b/ext/bz2/php_bz2.h index 8b12eca357..21aa2683c9 100644 --- a/ext/bz2/php_bz2.h +++ b/ext/bz2/php_bz2.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/calendar/cal_unix.c b/ext/calendar/cal_unix.c index c65b046fc8..99adfd3563 100644 --- a/ext/calendar/cal_unix.c +++ b/ext/calendar/cal_unix.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/calendar/calendar.c b/ext/calendar/calendar.c index 010b8d4d13..06d3add252 100644 --- a/ext/calendar/calendar.c +++ b/ext/calendar/calendar.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/calendar/easter.c b/ext/calendar/easter.c index 1948ff9f0e..a999da044f 100644 --- a/ext/calendar/easter.c +++ b/ext/calendar/easter.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/com_dotnet/com_com.c b/ext/com_dotnet/com_com.c index fe48ee9e28..f77779d691 100644 --- a/ext/com_dotnet/com_com.c +++ b/ext/com_dotnet/com_com.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/com_dotnet/com_dotnet.c b/ext/com_dotnet/com_dotnet.c index 7fbdae15cb..0aa1a2a9c7 100644 --- a/ext/com_dotnet/com_dotnet.c +++ b/ext/com_dotnet/com_dotnet.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/com_dotnet/com_extension.c b/ext/com_dotnet/com_extension.c index 1257974697..e3b3abfe28 100644 --- a/ext/com_dotnet/com_extension.c +++ b/ext/com_dotnet/com_extension.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/com_dotnet/com_handlers.c b/ext/com_dotnet/com_handlers.c index 4bdbf52f2b..c889c9a06a 100644 --- a/ext/com_dotnet/com_handlers.c +++ b/ext/com_dotnet/com_handlers.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/com_dotnet/com_iterator.c b/ext/com_dotnet/com_iterator.c index ce4bdd67c0..2f8ba5eb44 100644 --- a/ext/com_dotnet/com_iterator.c +++ b/ext/com_dotnet/com_iterator.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/com_dotnet/com_misc.c b/ext/com_dotnet/com_misc.c index 023c5b80ef..b65a6be85d 100644 --- a/ext/com_dotnet/com_misc.c +++ b/ext/com_dotnet/com_misc.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/com_dotnet/com_olechar.c b/ext/com_dotnet/com_olechar.c index e456df242d..a3e81978bd 100644 --- a/ext/com_dotnet/com_olechar.c +++ b/ext/com_dotnet/com_olechar.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/com_dotnet/com_persist.c b/ext/com_dotnet/com_persist.c index 8953a4184c..aaddf9ce9a 100644 --- a/ext/com_dotnet/com_persist.c +++ b/ext/com_dotnet/com_persist.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/com_dotnet/com_saproxy.c b/ext/com_dotnet/com_saproxy.c index ad92849743..b19c516444 100644 --- a/ext/com_dotnet/com_saproxy.c +++ b/ext/com_dotnet/com_saproxy.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/com_dotnet/com_typeinfo.c b/ext/com_dotnet/com_typeinfo.c index 482b9b84ab..4ec448e2e3 100644 --- a/ext/com_dotnet/com_typeinfo.c +++ b/ext/com_dotnet/com_typeinfo.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/com_dotnet/com_variant.c b/ext/com_dotnet/com_variant.c index 556f356b97..af80f00528 100644 --- a/ext/com_dotnet/com_variant.c +++ b/ext/com_dotnet/com_variant.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/com_dotnet/com_wrapper.c b/ext/com_dotnet/com_wrapper.c index 597b059951..363bb70561 100644 --- a/ext/com_dotnet/com_wrapper.c +++ b/ext/com_dotnet/com_wrapper.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/com_dotnet/php_com_dotnet.h b/ext/com_dotnet/php_com_dotnet.h index 8771e27736..51f621bd5f 100644 --- a/ext/com_dotnet/php_com_dotnet.h +++ b/ext/com_dotnet/php_com_dotnet.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/com_dotnet/php_com_dotnet_internal.h b/ext/com_dotnet/php_com_dotnet_internal.h index 015de450cf..5dabdfb213 100644 --- a/ext/com_dotnet/php_com_dotnet_internal.h +++ b/ext/com_dotnet/php_com_dotnet_internal.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/ctype/ctype.c b/ext/ctype/ctype.c index e2698f5e73..8f116b86d3 100644 --- a/ext/ctype/ctype.c +++ b/ext/ctype/ctype.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/ctype/php_ctype.h b/ext/ctype/php_ctype.h index e1036b9d03..ab5ec44ec4 100644 --- a/ext/ctype/php_ctype.h +++ b/ext/ctype/php_ctype.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/curl/interface.c b/ext/curl/interface.c index d122051ade..8915625047 100644 --- a/ext/curl/interface.c +++ b/ext/curl/interface.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/curl/multi.c b/ext/curl/multi.c index 38c1f1a53f..a990dad2f2 100644 --- a/ext/curl/multi.c +++ b/ext/curl/multi.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/curl/php_curl.h b/ext/curl/php_curl.h index 911d87a6b4..c613da1dc6 100644 --- a/ext/curl/php_curl.h +++ b/ext/curl/php_curl.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/curl/streams.c b/ext/curl/streams.c index 2683ae0880..9681e197ac 100644 --- a/ext/curl/streams.c +++ b/ext/curl/streams.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/curl/tests/bug61948-win32.phpt b/ext/curl/tests/bug61948-win32.phpt index dc86526b7b..00f498f910 100644 --- a/ext/curl/tests/bug61948-win32.phpt +++ b/ext/curl/tests/bug61948-win32.phpt @@ -17,9 +17,7 @@ open_basedir="c:/tmp" ?> --EXPECTF-- %a - -Warning: curl_setopt(): open_basedir restriction in effect. File(c:/tmp/foo) is not within the allowed path(s): (c:/tmp) in %sbug61948-win32.php on line %d -bool(false) +bool(true) Warning: curl_setopt(): open_basedir restriction in effect. File(c:/xxx/bar) is not within the allowed path(s): (c:/tmp) in %sbug61948-win32.php on line %d bool(false) diff --git a/ext/date/lib/astro.c b/ext/date/lib/astro.c index d770d1aaed..7f51c71d92 100644 --- a/ext/date/lib/astro.c +++ b/ext/date/lib/astro.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/date/lib/dow.c b/ext/date/lib/dow.c index b6c2d69682..a77fdd7182 100644 --- a/ext/date/lib/dow.c +++ b/ext/date/lib/dow.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | @@ -25,10 +25,7 @@ static int m_table_leap[13] = { -1, 6, 2, 3, 6, 1, 4, 6, 2, 5, 0, 3, 5 }; /* 1 static timelib_sll century_value(timelib_sll j) { - timelib_sll i = j - 17; - timelib_sll c = (4 - i * 2 + (i + 1) / 4) % 7; - - return c < 0 ? c + 7 : c; + return 6 - (j % 4) * 2; } static timelib_sll timelib_day_of_week_ex(timelib_sll y, timelib_sll m, timelib_sll d, int iso) @@ -36,11 +33,8 @@ static timelib_sll timelib_day_of_week_ex(timelib_sll y, timelib_sll m, timelib_ timelib_sll c1, y1, m1, dow; /* Only valid for Gregorian calendar, commented out as we don't handle - * julian calendar. We just return the 'wrong' day of week to be - * consistent. - if (y < 1753) { - return -1; - } */ + * Julian calendar. We just return the 'wrong' day of week to be + * consistent. */ c1 = century_value(y / 100); y1 = (y % 100); m1 = timelib_is_leap(y) ? m_table_leap[m] : m_table_common[m]; diff --git a/ext/date/lib/fallbackmap.h b/ext/date/lib/fallbackmap.h index 4e4c23c96e..af69482c0c 100644 --- a/ext/date/lib/fallbackmap.h +++ b/ext/date/lib/fallbackmap.h @@ -1,40 +1,42 @@ - { "sst", 0, -11, "Pacific/Apia" }, - { "hst", 0, -10, "Pacific/Honolulu" }, - { "akst", 0, -9, "America/Anchorage" }, - { "akdt", 1, -8, "America/Anchorage" }, - { "pst", 0, -8, "America/Los_Angeles" }, - { "pdt", 1, -7, "America/Los_Angeles" }, - { "mst", 0, -7, "America/Denver" }, - { "mdt", 1, -6, "America/Denver" }, - { "cst", 0, -6, "America/Chicago" }, - { "cdt", 1, -5, "America/Chicago" }, - { "est", 0, -5, "America/New_York" }, - { "edt", 1, -4, "America/New_York" }, - { "ast", 0, -4, "America/Halifax" }, - { "adt", 1, -3, "America/Halifax" }, - { "brt", 0, -3, "America/Sao_Paulo" }, - { "brst", 1, -2, "America/Sao_Paulo" }, - { "azost", 0, -1, "Atlantic/Azores" }, - { "azodt", 1, 0, "Atlantic/Azores" }, - { "gmt", 0, 0, "Europe/London" }, - { "bst", 1, 1, "Europe/London" }, - { "cet", 0, 1, "Europe/Paris" }, - { "cest", 1, 2, "Europe/Paris" }, - { "eet", 0, 2, "Europe/Helsinki" }, - { "eest", 1, 3, "Europe/Helsinki" }, - { "msk", 0, 3, "Europe/Moscow" }, - { "msd", 1, 4, "Europe/Moscow" }, - { "gst", 0, 4, "Asia/Dubai" }, - { "pkt", 0, 5, "Asia/Karachi" }, - { "ist", 0, 5.5, "Asia/Kolkata" }, - { "npt", 0, 5.75, "Asia/Katmandu" }, - { "yekt", 1, 6, "Asia/Yekaterinburg" }, - { "novst", 1, 7, "Asia/Novosibirsk" }, - { "krat", 0, 7, "Asia/Krasnoyarsk" }, - { "krast", 1, 8, "Asia/Krasnoyarsk" }, - { "jst", 0, 9, "Asia/Tokyo" }, - { "est", 0, 10, "Australia/Melbourne" }, - { "cst", 1, 10.5, "Australia/Adelaide" }, - { "est", 1, 11, "Australia/Melbourne" }, - { "nzst", 0, 12, "Pacific/Auckland" }, - { "nzdt", 1, 13, "Pacific/Auckland" }, + { "sst", 0, -660, "Pacific/Apia" }, + { "hst", 0, -600, "Pacific/Honolulu" }, + { "akst", 0, -540, "America/Anchorage" }, + { "akdt", 1, -480, "America/Anchorage" }, + { "pst", 0, -480, "America/Los_Angeles" }, + { "pdt", 1, -420, "America/Los_Angeles" }, + { "mst", 0, -420, "America/Denver" }, + { "mdt", 1, -360, "America/Denver" }, + { "cst", 0, -360, "America/Chicago" }, + { "cdt", 1, -300, "America/Chicago" }, + { "est", 0, -300, "America/New_York" }, + { "vet", 0, -270, "America/Caracas" }, + { "edt", 1, -240, "America/New_York" }, + { "ast", 0, -240, "America/Halifax" }, + { "adt", 1, -180, "America/Halifax" }, + { "brt", 0, -180, "America/Sao_Paulo" }, + { "brst", 1, -120, "America/Sao_Paulo" }, + { "azost", 0, -60, "Atlantic/Azores" }, + { "azodt", 1, 0, "Atlantic/Azores" }, + { "gmt", 0, 0, "Europe/London" }, + { "bst", 1, 60, "Europe/London" }, + { "cet", 0, 60, "Europe/Paris" }, + { "cest", 1, 120, "Europe/Paris" }, + { "eet", 0, 120, "Europe/Helsinki" }, + { "eest", 1, 180, "Europe/Helsinki" }, + { "msk", 0, 180, "Europe/Moscow" }, + { "msd", 1, 240, "Europe/Moscow" }, + { "gst", 0, 240, "Asia/Dubai" }, + { "pkt", 0, 300, "Asia/Karachi" }, + { "ist", 0, 330, "Asia/Kolkata" }, + { "npt", 0, 345, "Asia/Katmandu" }, + { "yekt", 1, 360, "Asia/Yekaterinburg" }, + { "novst", 1, 420, "Asia/Novosibirsk" }, + { "krat", 0, 420, "Asia/Krasnoyarsk" }, + { "cst", 0, 480, "Asia/Shanghai" }, + { "krast", 1, 480, "Asia/Krasnoyarsk" }, + { "jst", 0, 540, "Asia/Tokyo" }, + { "est", 0, 600, "Australia/Melbourne" }, + { "cst", 1, 630, "Australia/Adelaide" }, + { "est", 1, 660, "Australia/Melbourne" }, + { "nzst", 0, 720, "Pacific/Auckland" }, + { "nzdt", 1, 780, "Pacific/Auckland" }, diff --git a/ext/date/lib/interval.c b/ext/date/lib/interval.c index 96867ba2b7..86e98ea744 100644 --- a/ext/date/lib/interval.c +++ b/ext/date/lib/interval.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | @@ -25,7 +25,7 @@ timelib_rel_time *timelib_diff(timelib_time *one, timelib_time *two) { timelib_rel_time *rt; timelib_time *swp; - timelib_sll dst_h_corr = 0, dst_m_corr = 0; + timelib_sll dst_corr = 0 ,dst_h_corr = 0, dst_m_corr = 0; timelib_time one_backup, two_backup; rt = timelib_rel_time_ctor(); @@ -43,8 +43,9 @@ timelib_rel_time *timelib_diff(timelib_time *one, timelib_time *two) && (strcmp(one->tz_info->name, two->tz_info->name) == 0) && (one->z != two->z)) { - dst_h_corr = (two->z - one->z) / 3600; - dst_m_corr = ((two->z - one->z) % 3600) / 60; + dst_corr = two->z - one->z; + dst_h_corr = dst_corr / 3600; + dst_m_corr = (dst_corr % 3600) / 60; } /* Save old TZ info */ @@ -57,16 +58,108 @@ timelib_rel_time *timelib_diff(timelib_time *one, timelib_time *two) rt->y = two->y - one->y; rt->m = two->m - one->m; rt->d = two->d - one->d; - rt->h = two->h - one->h + dst_h_corr; - rt->i = two->i - one->i + dst_m_corr; + rt->h = two->h - one->h; + rt->i = two->i - one->i; rt->s = two->s - one->s; + if (one_backup.dst == 0 && two_backup.dst == 1 && two->sse >= one->sse + 86400 - dst_corr) { + rt->h += dst_h_corr; + rt->i += dst_m_corr; + } + rt->days = abs(floor((one->sse - two->sse - (dst_h_corr * 3600) - (dst_m_corr * 60)) / 86400)); timelib_do_rel_normalize(rt->invert ? one : two, rt); + /* We need to do this after normalisation otherwise we can't get "24H" */ + if (one_backup.dst == 1 && two_backup.dst == 0 && two->sse >= one->sse + 86400) { + if (two->sse < one->sse + 86400 - dst_corr) { + rt->d--; + rt->h = 24; + } else { + rt->h += dst_h_corr; + rt->i += dst_m_corr; + } + } + /* Restore old TZ info */ memcpy(one, &one_backup, sizeof(one_backup)); memcpy(two, &two_backup, sizeof(two_backup)); return rt; } + +timelib_time *timelib_add(timelib_time *old_time, timelib_rel_time *interval) +{ + int bias = 1; + timelib_time *t = timelib_time_clone(old_time); + + if (interval->have_weekday_relative || interval->have_special_relative) { + memcpy(&t->relative, interval, sizeof(struct timelib_rel_time)); + } else { + if (interval->invert) { + bias = -1; + } + memset(&t->relative, 0, sizeof(struct timelib_rel_time)); + t->relative.y = interval->y * bias; + t->relative.m = interval->m * bias; + t->relative.d = interval->d * bias; + t->relative.h = interval->h * bias; + t->relative.i = interval->i * bias; + t->relative.s = interval->s * bias; + } + t->have_relative = 1; + t->sse_uptodate = 0; + + timelib_update_ts(t, NULL); + +// printf("%lld %lld %d\n", old_time->dst, t->dst, (t->sse - old_time->sse)); + /* Adjust for backwards DST changeover */ + if (old_time->dst == 1 && t->dst == 0 && !interval->y && !interval->m && !interval->d) { + t->sse -= old_time->z; + t->sse += t->z; + } + + timelib_update_from_sse(t); + t->have_relative = 0; + + return t; +} + +timelib_time *timelib_sub(timelib_time *old_time, timelib_rel_time *interval) +{ + int bias = 1; + timelib_time *t = timelib_time_clone(old_time); + + if (interval->invert) { + bias = -1; + } + + memset(&t->relative, 0, sizeof(struct timelib_rel_time)); + t->relative.y = 0 - (interval->y * bias); + t->relative.m = 0 - (interval->m * bias); + t->relative.d = 0 - (interval->d * bias); + t->relative.h = 0 - (interval->h * bias); + t->relative.i = 0 - (interval->i * bias); + t->relative.s = 0 - (interval->s * bias); + t->have_relative = 1; + t->sse_uptodate = 0; + + timelib_update_ts(t, NULL); + + /* Adjust for backwards DST changeover */ + if (old_time->dst == 1 && t->dst == 0 && !interval->y && !interval->m && !interval->d) { + t->sse -= old_time->z; + t->sse += t->z; + } + /* Adjust for forwards DST changeover */ + if (old_time->dst == 0 && t->dst == 1 && !interval->y && !interval->m && !interval->d ) { + t->sse -= old_time->z; + t->sse += t->z; + } + + timelib_update_from_sse(t); + + t->have_relative = 0; + + return t; +} diff --git a/ext/date/lib/parse_date.c b/ext/date/lib/parse_date.c index f510a665e8..47b48178c2 100644 --- a/ext/date/lib/parse_date.c +++ b/ext/date/lib/parse_date.c @@ -1,4 +1,4 @@ -/* Generated by re2c 0.13.5 on Sun Aug 25 14:46:08 2013 */ +/* Generated by re2c 0.13.5 on Sat Jan 25 15:48:30 2014 */ #line 1 "ext/date/lib/parse_date.re" /* +----------------------------------------------------------------------+ @@ -752,7 +752,7 @@ const static timelib_tz_lookup_table* zone_search(const char *word, long gmtoffs /* Still didn't find anything, let's find the zone solely based on * offset/isdst then */ for (fmp = timelib_timezone_fallbackmap; fmp->name; fmp++) { - if ((fmp->gmtoffset * 3600) == gmtoffset && fmp->type == isdst) { + if ((fmp->gmtoffset * 60) == gmtoffset && fmp->type == isdst) { return fmp; } } diff --git a/ext/date/lib/parse_date.re b/ext/date/lib/parse_date.re index df33508f50..5b923d4bc4 100644 --- a/ext/date/lib/parse_date.re +++ b/ext/date/lib/parse_date.re @@ -750,7 +750,7 @@ const static timelib_tz_lookup_table* zone_search(const char *word, long gmtoffs /* Still didn't find anything, let's find the zone solely based on * offset/isdst then */ for (fmp = timelib_timezone_fallbackmap; fmp->name; fmp++) { - if ((fmp->gmtoffset * 3600) == gmtoffset && fmp->type == isdst) { + if ((fmp->gmtoffset * 60) == gmtoffset && fmp->type == isdst) { return fmp; } } diff --git a/ext/date/lib/parse_iso_intervals.c b/ext/date/lib/parse_iso_intervals.c index bd1ad05ddd..f6b4d838c8 100644 --- a/ext/date/lib/parse_iso_intervals.c +++ b/ext/date/lib/parse_iso_intervals.c @@ -1,10 +1,10 @@ -/* Generated by re2c 0.13.5 on Mon Dec 5 22:02:27 2011 */ +/* Generated by re2c 0.13.5 on Wed Nov 27 11:10:58 2013 */ #line 1 "ext/date/lib/parse_iso_intervals.re" /* +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | @@ -415,7 +415,7 @@ yy6: break; } ptr++; - } while (*ptr); + } while (!s->errors->error_count && *ptr); s->have_period = 1; TIMELIB_DEINIT; return TIMELIB_PERIOD; diff --git a/ext/date/lib/parse_iso_intervals.re b/ext/date/lib/parse_iso_intervals.re index 56aa34d8e0..c5e9f677ba 100644 --- a/ext/date/lib/parse_iso_intervals.re +++ b/ext/date/lib/parse_iso_intervals.re @@ -383,7 +383,7 @@ isoweek = year4 "-"? "W" weekofyear; break; } ptr++; - } while (*ptr); + } while (!s->errors->error_count && *ptr); s->have_period = 1; TIMELIB_DEINIT; return TIMELIB_PERIOD; diff --git a/ext/date/lib/parse_tz.c b/ext/date/lib/parse_tz.c index d3abf84c81..5d2aec9c93 100644 --- a/ext/date/lib/parse_tz.c +++ b/ext/date/lib/parse_tz.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/date/lib/timelib.c b/ext/date/lib/timelib.c index 2f457a9882..039d3cedbe 100644 --- a/ext/date/lib/timelib.c +++ b/ext/date/lib/timelib.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/date/lib/timelib.h b/ext/date/lib/timelib.h index 478dec32d0..533c88664f 100644 --- a/ext/date/lib/timelib.h +++ b/ext/date/lib/timelib.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | @@ -91,6 +91,8 @@ int timelib_apply_localtime(timelib_time *t, unsigned int localtime); void timelib_unixtime2gmt(timelib_time* tm, timelib_sll ts); void timelib_unixtime2local(timelib_time *tm, timelib_sll ts); void timelib_update_from_sse(timelib_time *tm); +void timelib_set_timezone_from_offset(timelib_time *t, timelib_sll utc_offset); +void timelib_set_timezone_from_abbr(timelib_time *t, timelib_abbr_info abbr_info); void timelib_set_timezone(timelib_time *t, timelib_tzinfo *tz); /* From parse_tz.c */ @@ -136,5 +138,7 @@ int timelib_astro_rise_set_altitude(timelib_time *time, double lon, double lat, /* from interval.c */ timelib_rel_time *timelib_diff(timelib_time *one, timelib_time *two); +timelib_time *timelib_add(timelib_time *t, timelib_rel_time *interval); +timelib_time *timelib_sub(timelib_time *t, timelib_rel_time *interval); #endif diff --git a/ext/date/lib/timelib_structs.h b/ext/date/lib/timelib_structs.h index a3d7793447..5185e7b40b 100644 --- a/ext/date/lib/timelib_structs.h +++ b/ext/date/lib/timelib_structs.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | @@ -172,6 +172,12 @@ typedef struct timelib_time { * 2 TimeZone abbreviation */ } timelib_time; +typedef struct timelib_abbr_info { + timelib_sll utc_offset; + char *abbr; + int dst; +} timelib_abbr_info; + typedef struct timelib_error_message { int position; char character; diff --git a/ext/date/lib/timezonedb.h b/ext/date/lib/timezonedb.h index 91884a935f..4a4b041882 100644 --- a/ext/date/lib/timezonedb.h +++ b/ext/date/lib/timezonedb.h @@ -232,355 +232,355 @@ const timelib_tzdb_index_entry timezonedb_idx_builtin[579] = { { "Asia/Aden" , 0x018C91 }, { "Asia/Almaty" , 0x018CE6 }, { "Asia/Amman" , 0x018E65 }, - { "Asia/Anadyr" , 0x019037 }, - { "Asia/Aqtau" , 0x01921C }, - { "Asia/Aqtobe" , 0x01941B }, - { "Asia/Ashgabat" , 0x0195D3 }, - { "Asia/Ashkhabad" , 0x0196F0 }, - { "Asia/Baghdad" , 0x01980D }, - { "Asia/Bahrain" , 0x019982 }, - { "Asia/Baku" , 0x0199E8 }, - { "Asia/Bangkok" , 0x019CD0 }, - { "Asia/Beirut" , 0x019D25 }, - { "Asia/Bishkek" , 0x01A032 }, - { "Asia/Brunei" , 0x01A1DE }, - { "Asia/Calcutta" , 0x01A240 }, - { "Asia/Choibalsan" , 0x01A2B9 }, - { "Asia/Chongqing" , 0x01A432 }, - { "Asia/Chungking" , 0x01A521 }, - { "Asia/Colombo" , 0x01A5D0 }, - { "Asia/Dacca" , 0x01A66C }, - { "Asia/Damascus" , 0x01A712 }, - { "Asia/Dhaka" , 0x01AA62 }, - { "Asia/Dili" , 0x01AB08 }, - { "Asia/Dubai" , 0x01AB92 }, - { "Asia/Dushanbe" , 0x01ABE7 }, - { "Asia/Gaza" , 0x01ACEA }, - { "Asia/Harbin" , 0x01B03D }, - { "Asia/Hebron" , 0x01B124 }, - { "Asia/Ho_Chi_Minh" , 0x01B480 }, - { "Asia/Hong_Kong" , 0x01B4F8 }, - { "Asia/Hovd" , 0x01B6BA }, - { "Asia/Irkutsk" , 0x01B832 }, - { "Asia/Istanbul" , 0x01BA18 }, - { "Asia/Jakarta" , 0x01BE05 }, - { "Asia/Jayapura" , 0x01BEAF }, - { "Asia/Jerusalem" , 0x01BF4B }, - { "Asia/Kabul" , 0x01C27A }, - { "Asia/Kamchatka" , 0x01C2CB }, - { "Asia/Karachi" , 0x01C4A7 }, - { "Asia/Kashgar" , 0x01C55C }, - { "Asia/Kathmandu" , 0x01C62D }, - { "Asia/Katmandu" , 0x01C693 }, - { "Asia/Khandyga" , 0x01C6F9 }, - { "Asia/Kolkata" , 0x01C91E }, - { "Asia/Krasnoyarsk" , 0x01C997 }, - { "Asia/Kuala_Lumpur" , 0x01CB7F }, - { "Asia/Kuching" , 0x01CC3C }, - { "Asia/Kuwait" , 0x01CD2A }, - { "Asia/Macao" , 0x01CD7F }, - { "Asia/Macau" , 0x01CEBA }, - { "Asia/Magadan" , 0x01CFF5 }, - { "Asia/Makassar" , 0x01D1D7 }, - { "Asia/Manila" , 0x01D29C }, - { "Asia/Muscat" , 0x01D321 }, - { "Asia/Nicosia" , 0x01D376 }, - { "Asia/Novokuznetsk" , 0x01D65E }, - { "Asia/Novosibirsk" , 0x01D860 }, - { "Asia/Omsk" , 0x01DA4B }, - { "Asia/Oral" , 0x01DC32 }, - { "Asia/Phnom_Penh" , 0x01DE02 }, - { "Asia/Pontianak" , 0x01DE7A }, - { "Asia/Pyongyang" , 0x01DF3C }, - { "Asia/Qatar" , 0x01DFA9 }, - { "Asia/Qyzylorda" , 0x01E00F }, - { "Asia/Rangoon" , 0x01E1E5 }, - { "Asia/Riyadh" , 0x01E25D }, - { "Asia/Saigon" , 0x01E2B2 }, - { "Asia/Sakhalin" , 0x01E32A }, - { "Asia/Samarkand" , 0x01E521 }, - { "Asia/Seoul" , 0x01E657 }, - { "Asia/Shanghai" , 0x01E6FB }, - { "Asia/Singapore" , 0x01E7DB }, - { "Asia/Taipei" , 0x01E892 }, - { "Asia/Tashkent" , 0x01E9AA }, - { "Asia/Tbilisi" , 0x01EADB }, - { "Asia/Tehran" , 0x01EC95 }, - { "Asia/Tel_Aviv" , 0x01EF03 }, - { "Asia/Thimbu" , 0x01F232 }, - { "Asia/Thimphu" , 0x01F298 }, - { "Asia/Tokyo" , 0x01F2FE }, - { "Asia/Ujung_Pandang" , 0x01F387 }, - { "Asia/Ulaanbaatar" , 0x01F404 }, - { "Asia/Ulan_Bator" , 0x01F55F }, - { "Asia/Urumqi" , 0x01F6AC }, - { "Asia/Ust-Nera" , 0x01F773 }, - { "Asia/Vientiane" , 0x01F978 }, - { "Asia/Vladivostok" , 0x01F9F0 }, - { "Asia/Yakutsk" , 0x01FBDC }, - { "Asia/Yekaterinburg" , 0x01FDC1 }, - { "Asia/Yerevan" , 0x01FFCC }, - { "Atlantic/Azores" , 0x0201CC }, - { "Atlantic/Bermuda" , 0x0206CF }, - { "Atlantic/Canary" , 0x0209B0 }, - { "Atlantic/Cape_Verde" , 0x020C86 }, - { "Atlantic/Faeroe" , 0x020CFF }, - { "Atlantic/Faroe" , 0x020FA3 }, - { "Atlantic/Jan_Mayen" , 0x021247 }, - { "Atlantic/Madeira" , 0x021579 }, - { "Atlantic/Reykjavik" , 0x021A82 }, - { "Atlantic/South_Georgia" , 0x021C3B }, - { "Atlantic/St_Helena" , 0x021E4D }, - { "Atlantic/Stanley" , 0x021C7F }, - { "Australia/ACT" , 0x021EA2 }, - { "Australia/Adelaide" , 0x0221BF }, - { "Australia/Brisbane" , 0x0224EB }, - { "Australia/Broken_Hill" , 0x0225B2 }, - { "Australia/Canberra" , 0x0228F0 }, - { "Australia/Currie" , 0x022C0D }, - { "Australia/Darwin" , 0x022F40 }, - { "Australia/Eucla" , 0x022FC6 }, - { "Australia/Hobart" , 0x02309B }, - { "Australia/LHI" , 0x0233F9 }, - { "Australia/Lindeman" , 0x023694 }, - { "Australia/Lord_Howe" , 0x023775 }, - { "Australia/Melbourne" , 0x023A20 }, - { "Australia/North" , 0x023D45 }, - { "Australia/NSW" , 0x023DB9 }, - { "Australia/Perth" , 0x0240D6 }, - { "Australia/Queensland" , 0x0241AE }, - { "Australia/South" , 0x02425A }, - { "Australia/Sydney" , 0x024577 }, - { "Australia/Tasmania" , 0x0248B4 }, - { "Australia/Victoria" , 0x024BF9 }, - { "Australia/West" , 0x024F16 }, - { "Australia/Yancowinna" , 0x024FCC }, - { "Brazil/Acre" , 0x0252EE }, - { "Brazil/DeNoronha" , 0x0253F2 }, - { "Brazil/East" , 0x025512 }, - { "Brazil/West" , 0x0257EF }, - { "Canada/Atlantic" , 0x0258E7 }, - { "Canada/Central" , 0x025DCF }, - { "Canada/East-Saskatchewan" , 0x0266D9 }, - { "Canada/Eastern" , 0x0261E9 }, - { "Canada/Mountain" , 0x026862 }, - { "Canada/Newfoundland" , 0x026BD8 }, - { "Canada/Pacific" , 0x027103 }, - { "Canada/Saskatchewan" , 0x02751C }, - { "Canada/Yukon" , 0x0276A5 }, - { "CET" , 0x0279A8 }, - { "Chile/Continental" , 0x027CB1 }, - { "Chile/EasterIsland" , 0x02804C }, - { "CST6CDT" , 0x02838E }, - { "Cuba" , 0x0286DF }, - { "EET" , 0x028A52 }, - { "Egypt" , 0x028D05 }, - { "Eire" , 0x028FC8 }, - { "EST" , 0x0294D9 }, - { "EST5EDT" , 0x02951D }, - { "Etc/GMT" , 0x02986E }, - { "Etc/GMT+0" , 0x02993A }, - { "Etc/GMT+1" , 0x0299C4 }, - { "Etc/GMT+10" , 0x029A51 }, - { "Etc/GMT+11" , 0x029ADF }, - { "Etc/GMT+12" , 0x029B6D }, - { "Etc/GMT+2" , 0x029C88 }, - { "Etc/GMT+3" , 0x029D14 }, - { "Etc/GMT+4" , 0x029DA0 }, - { "Etc/GMT+5" , 0x029E2C }, - { "Etc/GMT+6" , 0x029EB8 }, - { "Etc/GMT+7" , 0x029F44 }, - { "Etc/GMT+8" , 0x029FD0 }, - { "Etc/GMT+9" , 0x02A05C }, - { "Etc/GMT-0" , 0x0298F6 }, - { "Etc/GMT-1" , 0x02997E }, - { "Etc/GMT-10" , 0x029A0A }, - { "Etc/GMT-11" , 0x029A98 }, - { "Etc/GMT-12" , 0x029B26 }, - { "Etc/GMT-13" , 0x029BB4 }, - { "Etc/GMT-14" , 0x029BFB }, - { "Etc/GMT-2" , 0x029C42 }, - { "Etc/GMT-3" , 0x029CCE }, - { "Etc/GMT-4" , 0x029D5A }, - { "Etc/GMT-5" , 0x029DE6 }, - { "Etc/GMT-6" , 0x029E72 }, - { "Etc/GMT-7" , 0x029EFE }, - { "Etc/GMT-8" , 0x029F8A }, - { "Etc/GMT-9" , 0x02A016 }, - { "Etc/GMT0" , 0x0298B2 }, - { "Etc/Greenwich" , 0x02A0A2 }, - { "Etc/UCT" , 0x02A0E6 }, - { "Etc/Universal" , 0x02A12A }, - { "Etc/UTC" , 0x02A16E }, - { "Etc/Zulu" , 0x02A1B2 }, - { "Europe/Amsterdam" , 0x02A1F6 }, - { "Europe/Andorra" , 0x02A634 }, - { "Europe/Athens" , 0x02A8B0 }, - { "Europe/Belfast" , 0x02ABF3 }, - { "Europe/Belgrade" , 0x02B12A }, - { "Europe/Berlin" , 0x02B3F3 }, - { "Europe/Bratislava" , 0x02B757 }, - { "Europe/Brussels" , 0x02BA89 }, - { "Europe/Bucharest" , 0x02BEC0 }, - { "Europe/Budapest" , 0x02C1EA }, - { "Europe/Busingen" , 0x02C55D }, - { "Europe/Chisinau" , 0x02C814 }, - { "Europe/Copenhagen" , 0x02CBA2 }, - { "Europe/Dublin" , 0x02CEAC }, - { "Europe/Gibraltar" , 0x02D3BD }, - { "Europe/Guernsey" , 0x02D814 }, - { "Europe/Helsinki" , 0x02DD4B }, - { "Europe/Isle_of_Man" , 0x02E001 }, - { "Europe/Istanbul" , 0x02E538 }, - { "Europe/Jersey" , 0x02E925 }, - { "Europe/Kaliningrad" , 0x02EE5C }, - { "Europe/Kiev" , 0x02F0C2 }, - { "Europe/Lisbon" , 0x02F3D9 }, - { "Europe/Ljubljana" , 0x02F8DD }, - { "Europe/London" , 0x02FBA6 }, - { "Europe/Luxembourg" , 0x0300DD }, - { "Europe/Madrid" , 0x030533 }, - { "Europe/Malta" , 0x0308F9 }, - { "Europe/Mariehamn" , 0x030CB2 }, - { "Europe/Minsk" , 0x030F68 }, - { "Europe/Monaco" , 0x031176 }, - { "Europe/Moscow" , 0x0315B1 }, - { "Europe/Nicosia" , 0x031802 }, - { "Europe/Oslo" , 0x031AEA }, - { "Europe/Paris" , 0x031E1C }, - { "Europe/Podgorica" , 0x032262 }, - { "Europe/Prague" , 0x03252B }, - { "Europe/Riga" , 0x03285D }, - { "Europe/Rome" , 0x032BA2 }, - { "Europe/Samara" , 0x032F65 }, - { "Europe/San_Marino" , 0x033198 }, - { "Europe/Sarajevo" , 0x03355B }, - { "Europe/Simferopol" , 0x033824 }, - { "Europe/Skopje" , 0x033B4F }, - { "Europe/Sofia" , 0x033E18 }, - { "Europe/Stockholm" , 0x034120 }, - { "Europe/Tallinn" , 0x0343CF }, - { "Europe/Tirane" , 0x034709 }, - { "Europe/Tiraspol" , 0x034A0F }, - { "Europe/Uzhgorod" , 0x034D9D }, - { "Europe/Vaduz" , 0x0350B4 }, - { "Europe/Vatican" , 0x035363 }, - { "Europe/Vienna" , 0x035726 }, - { "Europe/Vilnius" , 0x035A53 }, - { "Europe/Volgograd" , 0x035D92 }, - { "Europe/Warsaw" , 0x035F92 }, - { "Europe/Zagreb" , 0x036373 }, - { "Europe/Zaporozhye" , 0x03663C }, - { "Europe/Zurich" , 0x03697D }, - { "Factory" , 0x036C2C }, - { "GB" , 0x036C9D }, - { "GB-Eire" , 0x0371D4 }, - { "GMT" , 0x03770B }, - { "GMT+0" , 0x0377D7 }, - { "GMT-0" , 0x037793 }, - { "GMT0" , 0x03774F }, - { "Greenwich" , 0x03781B }, - { "Hongkong" , 0x03785F }, - { "HST" , 0x037A21 }, - { "Iceland" , 0x037A65 }, - { "Indian/Antananarivo" , 0x037C1E }, - { "Indian/Chagos" , 0x037C92 }, - { "Indian/Christmas" , 0x037CF4 }, - { "Indian/Cocos" , 0x037D38 }, - { "Indian/Comoro" , 0x037D7C }, - { "Indian/Kerguelen" , 0x037DD1 }, - { "Indian/Mahe" , 0x037E26 }, - { "Indian/Maldives" , 0x037E7B }, - { "Indian/Mauritius" , 0x037ED0 }, - { "Indian/Mayotte" , 0x037F46 }, - { "Indian/Reunion" , 0x037F9B }, - { "Iran" , 0x037FF0 }, - { "Israel" , 0x03825E }, - { "Jamaica" , 0x03858D }, - { "Japan" , 0x038652 }, - { "Kwajalein" , 0x0386DB }, - { "Libya" , 0x03873E }, - { "MET" , 0x038847 }, - { "Mexico/BajaNorte" , 0x038B50 }, - { "Mexico/BajaSur" , 0x038EB9 }, - { "Mexico/General" , 0x0390FE }, - { "MST" , 0x03935C }, - { "MST7MDT" , 0x0393A0 }, - { "Navajo" , 0x0396F1 }, - { "NZ" , 0x039A6A }, - { "NZ-CHAT" , 0x039DE8 }, - { "Pacific/Apia" , 0x03A0D0 }, - { "Pacific/Auckland" , 0x03A26C }, - { "Pacific/Chatham" , 0x03A5F8 }, - { "Pacific/Chuuk" , 0x03A8EF }, - { "Pacific/Easter" , 0x03A948 }, - { "Pacific/Efate" , 0x03ACA6 }, - { "Pacific/Enderbury" , 0x03AD6C }, - { "Pacific/Fakaofo" , 0x03ADDA }, - { "Pacific/Fiji" , 0x03AE2B }, - { "Pacific/Funafuti" , 0x03AFBE }, - { "Pacific/Galapagos" , 0x03B002 }, - { "Pacific/Gambier" , 0x03B07A }, - { "Pacific/Guadalcanal" , 0x03B0DF }, - { "Pacific/Guam" , 0x03B134 }, - { "Pacific/Honolulu" , 0x03B18A }, - { "Pacific/Johnston" , 0x03B201 }, - { "Pacific/Kiritimati" , 0x03B280 }, - { "Pacific/Kosrae" , 0x03B2EB }, - { "Pacific/Kwajalein" , 0x03B348 }, - { "Pacific/Majuro" , 0x03B3B4 }, - { "Pacific/Marquesas" , 0x03B413 }, - { "Pacific/Midway" , 0x03B47A }, - { "Pacific/Nauru" , 0x03B504 }, - { "Pacific/Niue" , 0x03B57C }, - { "Pacific/Norfolk" , 0x03B5DA }, - { "Pacific/Noumea" , 0x03B62F }, - { "Pacific/Pago_Pago" , 0x03B6BF }, - { "Pacific/Palau" , 0x03B748 }, - { "Pacific/Pitcairn" , 0x03B78C }, - { "Pacific/Pohnpei" , 0x03B7E1 }, - { "Pacific/Ponape" , 0x03B836 }, - { "Pacific/Port_Moresby" , 0x03B87B }, - { "Pacific/Rarotonga" , 0x03B8BF }, - { "Pacific/Saipan" , 0x03B99B }, - { "Pacific/Samoa" , 0x03B9FE }, - { "Pacific/Tahiti" , 0x03BA87 }, - { "Pacific/Tarawa" , 0x03BAEC }, - { "Pacific/Tongatapu" , 0x03BB40 }, - { "Pacific/Truk" , 0x03BBCC }, - { "Pacific/Wake" , 0x03BC11 }, - { "Pacific/Wallis" , 0x03BC61 }, - { "Pacific/Yap" , 0x03BCA5 }, - { "Poland" , 0x03BCEA }, - { "Portugal" , 0x03C0CB }, - { "PRC" , 0x03C5C7 }, - { "PST8PDT" , 0x03C678 }, - { "ROC" , 0x03C9C9 }, - { "ROK" , 0x03CAE1 }, - { "Singapore" , 0x03CB85 }, - { "Turkey" , 0x03CC3C }, - { "UCT" , 0x03D029 }, - { "Universal" , 0x03D06D }, - { "US/Alaska" , 0x03D0B1 }, - { "US/Aleutian" , 0x03D41A }, - { "US/Arizona" , 0x03D780 }, - { "US/Central" , 0x03D80E }, - { "US/East-Indiana" , 0x03E218 }, - { "US/Eastern" , 0x03DD19 }, - { "US/Hawaii" , 0x03E482 }, - { "US/Indiana-Starke" , 0x03E4F3 }, - { "US/Michigan" , 0x03E864 }, - { "US/Mountain" , 0x03EB9B }, - { "US/Pacific" , 0x03EF14 }, - { "US/Pacific-New" , 0x03F319 }, - { "US/Samoa" , 0x03F71E }, - { "UTC" , 0x03F7A7 }, - { "W-SU" , 0x03FA9E }, - { "WET" , 0x03F7EB }, - { "Zulu" , 0x03FCD8 }, + { "Asia/Anadyr" , 0x01911B }, + { "Asia/Aqtau" , 0x019300 }, + { "Asia/Aqtobe" , 0x0194FF }, + { "Asia/Ashgabat" , 0x0196B7 }, + { "Asia/Ashkhabad" , 0x0197D4 }, + { "Asia/Baghdad" , 0x0198F1 }, + { "Asia/Bahrain" , 0x019A66 }, + { "Asia/Baku" , 0x019ACC }, + { "Asia/Bangkok" , 0x019DB4 }, + { "Asia/Beirut" , 0x019E09 }, + { "Asia/Bishkek" , 0x01A116 }, + { "Asia/Brunei" , 0x01A2C2 }, + { "Asia/Calcutta" , 0x01A324 }, + { "Asia/Choibalsan" , 0x01A39D }, + { "Asia/Chongqing" , 0x01A516 }, + { "Asia/Chungking" , 0x01A605 }, + { "Asia/Colombo" , 0x01A6B4 }, + { "Asia/Dacca" , 0x01A750 }, + { "Asia/Damascus" , 0x01A7F6 }, + { "Asia/Dhaka" , 0x01AB46 }, + { "Asia/Dili" , 0x01ABEC }, + { "Asia/Dubai" , 0x01AC76 }, + { "Asia/Dushanbe" , 0x01ACCB }, + { "Asia/Gaza" , 0x01ADCE }, + { "Asia/Harbin" , 0x01B121 }, + { "Asia/Hebron" , 0x01B208 }, + { "Asia/Ho_Chi_Minh" , 0x01B564 }, + { "Asia/Hong_Kong" , 0x01B5DC }, + { "Asia/Hovd" , 0x01B79E }, + { "Asia/Irkutsk" , 0x01B916 }, + { "Asia/Istanbul" , 0x01BAFC }, + { "Asia/Jakarta" , 0x01BEE9 }, + { "Asia/Jayapura" , 0x01BF93 }, + { "Asia/Jerusalem" , 0x01C02F }, + { "Asia/Kabul" , 0x01C35E }, + { "Asia/Kamchatka" , 0x01C3AF }, + { "Asia/Karachi" , 0x01C58B }, + { "Asia/Kashgar" , 0x01C640 }, + { "Asia/Kathmandu" , 0x01C711 }, + { "Asia/Katmandu" , 0x01C777 }, + { "Asia/Khandyga" , 0x01C7DD }, + { "Asia/Kolkata" , 0x01CA02 }, + { "Asia/Krasnoyarsk" , 0x01CA7B }, + { "Asia/Kuala_Lumpur" , 0x01CC63 }, + { "Asia/Kuching" , 0x01CD20 }, + { "Asia/Kuwait" , 0x01CE0E }, + { "Asia/Macao" , 0x01CE63 }, + { "Asia/Macau" , 0x01CF9E }, + { "Asia/Magadan" , 0x01D0D9 }, + { "Asia/Makassar" , 0x01D2BB }, + { "Asia/Manila" , 0x01D380 }, + { "Asia/Muscat" , 0x01D405 }, + { "Asia/Nicosia" , 0x01D45A }, + { "Asia/Novokuznetsk" , 0x01D742 }, + { "Asia/Novosibirsk" , 0x01D944 }, + { "Asia/Omsk" , 0x01DB2F }, + { "Asia/Oral" , 0x01DD16 }, + { "Asia/Phnom_Penh" , 0x01DEE6 }, + { "Asia/Pontianak" , 0x01DF5E }, + { "Asia/Pyongyang" , 0x01E020 }, + { "Asia/Qatar" , 0x01E08D }, + { "Asia/Qyzylorda" , 0x01E0F3 }, + { "Asia/Rangoon" , 0x01E2C9 }, + { "Asia/Riyadh" , 0x01E341 }, + { "Asia/Saigon" , 0x01E396 }, + { "Asia/Sakhalin" , 0x01E40E }, + { "Asia/Samarkand" , 0x01E605 }, + { "Asia/Seoul" , 0x01E73B }, + { "Asia/Shanghai" , 0x01E7DF }, + { "Asia/Singapore" , 0x01E8BF }, + { "Asia/Taipei" , 0x01E976 }, + { "Asia/Tashkent" , 0x01EA8E }, + { "Asia/Tbilisi" , 0x01EBBF }, + { "Asia/Tehran" , 0x01ED79 }, + { "Asia/Tel_Aviv" , 0x01EFE7 }, + { "Asia/Thimbu" , 0x01F316 }, + { "Asia/Thimphu" , 0x01F37C }, + { "Asia/Tokyo" , 0x01F3E2 }, + { "Asia/Ujung_Pandang" , 0x01F46B }, + { "Asia/Ulaanbaatar" , 0x01F4E8 }, + { "Asia/Ulan_Bator" , 0x01F643 }, + { "Asia/Urumqi" , 0x01F790 }, + { "Asia/Ust-Nera" , 0x01F857 }, + { "Asia/Vientiane" , 0x01FA5C }, + { "Asia/Vladivostok" , 0x01FAD4 }, + { "Asia/Yakutsk" , 0x01FCC0 }, + { "Asia/Yekaterinburg" , 0x01FEA5 }, + { "Asia/Yerevan" , 0x0200B0 }, + { "Atlantic/Azores" , 0x0202B0 }, + { "Atlantic/Bermuda" , 0x0207B3 }, + { "Atlantic/Canary" , 0x020A94 }, + { "Atlantic/Cape_Verde" , 0x020D6A }, + { "Atlantic/Faeroe" , 0x020DE3 }, + { "Atlantic/Faroe" , 0x021087 }, + { "Atlantic/Jan_Mayen" , 0x02132B }, + { "Atlantic/Madeira" , 0x02165D }, + { "Atlantic/Reykjavik" , 0x021B66 }, + { "Atlantic/South_Georgia" , 0x021D1F }, + { "Atlantic/St_Helena" , 0x021F31 }, + { "Atlantic/Stanley" , 0x021D63 }, + { "Australia/ACT" , 0x021F86 }, + { "Australia/Adelaide" , 0x0222A3 }, + { "Australia/Brisbane" , 0x0225CF }, + { "Australia/Broken_Hill" , 0x022696 }, + { "Australia/Canberra" , 0x0229D4 }, + { "Australia/Currie" , 0x022CF1 }, + { "Australia/Darwin" , 0x023024 }, + { "Australia/Eucla" , 0x0230AA }, + { "Australia/Hobart" , 0x02317F }, + { "Australia/LHI" , 0x0234DD }, + { "Australia/Lindeman" , 0x023778 }, + { "Australia/Lord_Howe" , 0x023859 }, + { "Australia/Melbourne" , 0x023B04 }, + { "Australia/North" , 0x023E29 }, + { "Australia/NSW" , 0x023E9D }, + { "Australia/Perth" , 0x0241BA }, + { "Australia/Queensland" , 0x024292 }, + { "Australia/South" , 0x02433E }, + { "Australia/Sydney" , 0x02465B }, + { "Australia/Tasmania" , 0x024998 }, + { "Australia/Victoria" , 0x024CDD }, + { "Australia/West" , 0x024FFA }, + { "Australia/Yancowinna" , 0x0250B0 }, + { "Brazil/Acre" , 0x0253D2 }, + { "Brazil/DeNoronha" , 0x0254D6 }, + { "Brazil/East" , 0x0255F6 }, + { "Brazil/West" , 0x0258D3 }, + { "Canada/Atlantic" , 0x0259CB }, + { "Canada/Central" , 0x025EB3 }, + { "Canada/East-Saskatchewan" , 0x0267BD }, + { "Canada/Eastern" , 0x0262CD }, + { "Canada/Mountain" , 0x026946 }, + { "Canada/Newfoundland" , 0x026CBC }, + { "Canada/Pacific" , 0x0271E7 }, + { "Canada/Saskatchewan" , 0x027600 }, + { "Canada/Yukon" , 0x027789 }, + { "CET" , 0x027A8C }, + { "Chile/Continental" , 0x027D95 }, + { "Chile/EasterIsland" , 0x028130 }, + { "CST6CDT" , 0x028472 }, + { "Cuba" , 0x0287C3 }, + { "EET" , 0x028B36 }, + { "Egypt" , 0x028DE9 }, + { "Eire" , 0x0290AC }, + { "EST" , 0x0295BD }, + { "EST5EDT" , 0x029601 }, + { "Etc/GMT" , 0x029952 }, + { "Etc/GMT+0" , 0x029A1E }, + { "Etc/GMT+1" , 0x029AA8 }, + { "Etc/GMT+10" , 0x029B35 }, + { "Etc/GMT+11" , 0x029BC3 }, + { "Etc/GMT+12" , 0x029C51 }, + { "Etc/GMT+2" , 0x029D6C }, + { "Etc/GMT+3" , 0x029DF8 }, + { "Etc/GMT+4" , 0x029E84 }, + { "Etc/GMT+5" , 0x029F10 }, + { "Etc/GMT+6" , 0x029F9C }, + { "Etc/GMT+7" , 0x02A028 }, + { "Etc/GMT+8" , 0x02A0B4 }, + { "Etc/GMT+9" , 0x02A140 }, + { "Etc/GMT-0" , 0x0299DA }, + { "Etc/GMT-1" , 0x029A62 }, + { "Etc/GMT-10" , 0x029AEE }, + { "Etc/GMT-11" , 0x029B7C }, + { "Etc/GMT-12" , 0x029C0A }, + { "Etc/GMT-13" , 0x029C98 }, + { "Etc/GMT-14" , 0x029CDF }, + { "Etc/GMT-2" , 0x029D26 }, + { "Etc/GMT-3" , 0x029DB2 }, + { "Etc/GMT-4" , 0x029E3E }, + { "Etc/GMT-5" , 0x029ECA }, + { "Etc/GMT-6" , 0x029F56 }, + { "Etc/GMT-7" , 0x029FE2 }, + { "Etc/GMT-8" , 0x02A06E }, + { "Etc/GMT-9" , 0x02A0FA }, + { "Etc/GMT0" , 0x029996 }, + { "Etc/Greenwich" , 0x02A186 }, + { "Etc/UCT" , 0x02A1CA }, + { "Etc/Universal" , 0x02A20E }, + { "Etc/UTC" , 0x02A252 }, + { "Etc/Zulu" , 0x02A296 }, + { "Europe/Amsterdam" , 0x02A2DA }, + { "Europe/Andorra" , 0x02A718 }, + { "Europe/Athens" , 0x02A994 }, + { "Europe/Belfast" , 0x02ACD7 }, + { "Europe/Belgrade" , 0x02B20E }, + { "Europe/Berlin" , 0x02B4D7 }, + { "Europe/Bratislava" , 0x02B83B }, + { "Europe/Brussels" , 0x02BB6D }, + { "Europe/Bucharest" , 0x02BFA4 }, + { "Europe/Budapest" , 0x02C2CE }, + { "Europe/Busingen" , 0x02C641 }, + { "Europe/Chisinau" , 0x02C8F8 }, + { "Europe/Copenhagen" , 0x02CC86 }, + { "Europe/Dublin" , 0x02CF90 }, + { "Europe/Gibraltar" , 0x02D4A1 }, + { "Europe/Guernsey" , 0x02D8F8 }, + { "Europe/Helsinki" , 0x02DE2F }, + { "Europe/Isle_of_Man" , 0x02E0E5 }, + { "Europe/Istanbul" , 0x02E61C }, + { "Europe/Jersey" , 0x02EA09 }, + { "Europe/Kaliningrad" , 0x02EF40 }, + { "Europe/Kiev" , 0x02F1A6 }, + { "Europe/Lisbon" , 0x02F4BD }, + { "Europe/Ljubljana" , 0x02F9C1 }, + { "Europe/London" , 0x02FC8A }, + { "Europe/Luxembourg" , 0x0301C1 }, + { "Europe/Madrid" , 0x030617 }, + { "Europe/Malta" , 0x0309DD }, + { "Europe/Mariehamn" , 0x030D96 }, + { "Europe/Minsk" , 0x03104C }, + { "Europe/Monaco" , 0x03125A }, + { "Europe/Moscow" , 0x031695 }, + { "Europe/Nicosia" , 0x0318E6 }, + { "Europe/Oslo" , 0x031BCE }, + { "Europe/Paris" , 0x031F00 }, + { "Europe/Podgorica" , 0x032346 }, + { "Europe/Prague" , 0x03260F }, + { "Europe/Riga" , 0x032941 }, + { "Europe/Rome" , 0x032C86 }, + { "Europe/Samara" , 0x033049 }, + { "Europe/San_Marino" , 0x03327C }, + { "Europe/Sarajevo" , 0x03363F }, + { "Europe/Simferopol" , 0x033908 }, + { "Europe/Skopje" , 0x033C33 }, + { "Europe/Sofia" , 0x033EFC }, + { "Europe/Stockholm" , 0x034204 }, + { "Europe/Tallinn" , 0x0344B3 }, + { "Europe/Tirane" , 0x0347ED }, + { "Europe/Tiraspol" , 0x034AF3 }, + { "Europe/Uzhgorod" , 0x034E81 }, + { "Europe/Vaduz" , 0x035198 }, + { "Europe/Vatican" , 0x035447 }, + { "Europe/Vienna" , 0x03580A }, + { "Europe/Vilnius" , 0x035B37 }, + { "Europe/Volgograd" , 0x035E76 }, + { "Europe/Warsaw" , 0x036076 }, + { "Europe/Zagreb" , 0x036457 }, + { "Europe/Zaporozhye" , 0x036720 }, + { "Europe/Zurich" , 0x036A61 }, + { "Factory" , 0x036D10 }, + { "GB" , 0x036D81 }, + { "GB-Eire" , 0x0372B8 }, + { "GMT" , 0x0377EF }, + { "GMT+0" , 0x0378BB }, + { "GMT-0" , 0x037877 }, + { "GMT0" , 0x037833 }, + { "Greenwich" , 0x0378FF }, + { "Hongkong" , 0x037943 }, + { "HST" , 0x037B05 }, + { "Iceland" , 0x037B49 }, + { "Indian/Antananarivo" , 0x037D02 }, + { "Indian/Chagos" , 0x037D76 }, + { "Indian/Christmas" , 0x037DD8 }, + { "Indian/Cocos" , 0x037E1C }, + { "Indian/Comoro" , 0x037E60 }, + { "Indian/Kerguelen" , 0x037EB5 }, + { "Indian/Mahe" , 0x037F0A }, + { "Indian/Maldives" , 0x037F5F }, + { "Indian/Mauritius" , 0x037FB4 }, + { "Indian/Mayotte" , 0x03802A }, + { "Indian/Reunion" , 0x03807F }, + { "Iran" , 0x0380D4 }, + { "Israel" , 0x038342 }, + { "Jamaica" , 0x038671 }, + { "Japan" , 0x038736 }, + { "Kwajalein" , 0x0387BF }, + { "Libya" , 0x038822 }, + { "MET" , 0x03892B }, + { "Mexico/BajaNorte" , 0x038C34 }, + { "Mexico/BajaSur" , 0x038F9D }, + { "Mexico/General" , 0x0391E2 }, + { "MST" , 0x039440 }, + { "MST7MDT" , 0x039484 }, + { "Navajo" , 0x0397D5 }, + { "NZ" , 0x039B4E }, + { "NZ-CHAT" , 0x039ECC }, + { "Pacific/Apia" , 0x03A1B4 }, + { "Pacific/Auckland" , 0x03A350 }, + { "Pacific/Chatham" , 0x03A6DC }, + { "Pacific/Chuuk" , 0x03A9D3 }, + { "Pacific/Easter" , 0x03AA2C }, + { "Pacific/Efate" , 0x03AD8A }, + { "Pacific/Enderbury" , 0x03AE50 }, + { "Pacific/Fakaofo" , 0x03AEBE }, + { "Pacific/Fiji" , 0x03AF0F }, + { "Pacific/Funafuti" , 0x03B0A2 }, + { "Pacific/Galapagos" , 0x03B0E6 }, + { "Pacific/Gambier" , 0x03B15E }, + { "Pacific/Guadalcanal" , 0x03B1C3 }, + { "Pacific/Guam" , 0x03B218 }, + { "Pacific/Honolulu" , 0x03B26E }, + { "Pacific/Johnston" , 0x03B2E5 }, + { "Pacific/Kiritimati" , 0x03B364 }, + { "Pacific/Kosrae" , 0x03B3CF }, + { "Pacific/Kwajalein" , 0x03B42C }, + { "Pacific/Majuro" , 0x03B498 }, + { "Pacific/Marquesas" , 0x03B4F7 }, + { "Pacific/Midway" , 0x03B55E }, + { "Pacific/Nauru" , 0x03B5E8 }, + { "Pacific/Niue" , 0x03B660 }, + { "Pacific/Norfolk" , 0x03B6BE }, + { "Pacific/Noumea" , 0x03B713 }, + { "Pacific/Pago_Pago" , 0x03B7A3 }, + { "Pacific/Palau" , 0x03B82C }, + { "Pacific/Pitcairn" , 0x03B870 }, + { "Pacific/Pohnpei" , 0x03B8C5 }, + { "Pacific/Ponape" , 0x03B91A }, + { "Pacific/Port_Moresby" , 0x03B95F }, + { "Pacific/Rarotonga" , 0x03B9A3 }, + { "Pacific/Saipan" , 0x03BA7F }, + { "Pacific/Samoa" , 0x03BAE2 }, + { "Pacific/Tahiti" , 0x03BB6B }, + { "Pacific/Tarawa" , 0x03BBD0 }, + { "Pacific/Tongatapu" , 0x03BC24 }, + { "Pacific/Truk" , 0x03BCB0 }, + { "Pacific/Wake" , 0x03BCF5 }, + { "Pacific/Wallis" , 0x03BD45 }, + { "Pacific/Yap" , 0x03BD89 }, + { "Poland" , 0x03BDCE }, + { "Portugal" , 0x03C1AF }, + { "PRC" , 0x03C6AB }, + { "PST8PDT" , 0x03C75C }, + { "ROC" , 0x03CAAD }, + { "ROK" , 0x03CBC5 }, + { "Singapore" , 0x03CC69 }, + { "Turkey" , 0x03CD20 }, + { "UCT" , 0x03D10D }, + { "Universal" , 0x03D151 }, + { "US/Alaska" , 0x03D195 }, + { "US/Aleutian" , 0x03D4FE }, + { "US/Arizona" , 0x03D864 }, + { "US/Central" , 0x03D8F2 }, + { "US/East-Indiana" , 0x03E2FC }, + { "US/Eastern" , 0x03DDFD }, + { "US/Hawaii" , 0x03E566 }, + { "US/Indiana-Starke" , 0x03E5D7 }, + { "US/Michigan" , 0x03E948 }, + { "US/Mountain" , 0x03EC7F }, + { "US/Pacific" , 0x03EFF8 }, + { "US/Pacific-New" , 0x03F3FD }, + { "US/Samoa" , 0x03F802 }, + { "UTC" , 0x03F88B }, + { "W-SU" , 0x03FB82 }, + { "WET" , 0x03F8CF }, + { "Zulu" , 0x03FDBC }, }; /* This is a generated file, do not modify */ -const unsigned char timelib_timezone_db_data_builtin[261404] = { +const unsigned char timelib_timezone_db_data_builtin[261632] = { /* Africa/Abidjan */ @@ -3490,7 +3490,7 @@ const unsigned char timelib_timezone_db_data_builtin[261404] = { 0x33, 0x47, 0x2D, 0xD0, 0x34, 0x40, 0x59, 0x50, 0x35, 0x1D, 0xD5, 0x50, 0x36, 0x32, 0xB0, 0x50, 0x36, 0xFD, 0xB7, 0x50, 0x38, 0x1B, 0xCC, 0xD0, 0x38, 0xE6, 0xD3, 0xD0, 0x39, 0xFB, 0xAE, 0xD0, 0x3A, 0xC6, 0xB5, 0xD0, 0x3B, 0xDB, 0x90, 0xD0, 0x3C, 0xAF, 0xD2, 0x50, 0x3D, 0xBB, 0x72, 0xD0, -0x3E, 0x8F, 0xB4, 0x50, 0x3F, 0x9B, 0x54, 0xD0, 0x40, 0x6F, 0x96, 0x50, 0x45, 0x44, 0x35, 0x50, +0x3E, 0x8F, 0xB4, 0x50, 0x3F, 0x9B, 0x54, 0xD0, 0x40, 0x66, 0x5B, 0xD0, 0x45, 0x44, 0x35, 0x50, 0x45, 0xF3, 0x8C, 0xD0, 0x47, 0x24, 0x17, 0x50, 0x47, 0xDC, 0xA9, 0x50, 0x49, 0x03, 0xF9, 0x50, 0x49, 0xB3, 0x50, 0xD0, 0x4A, 0xE3, 0xDB, 0x50, 0x4B, 0x9C, 0x6D, 0x50, 0x4C, 0xCC, 0xF7, 0xD0, 0x4D, 0x85, 0x89, 0xD0, 0x4E, 0xBF, 0x4E, 0xD0, 0x4F, 0x77, 0xE0, 0xD0, 0x50, 0x95, 0xF6, 0x50, @@ -7552,8 +7552,8 @@ const unsigned char timelib_timezone_db_data_builtin[261404] = { /* Asia/Amman */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x4A, 0x4F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x11, 0xB6, 0xA3, 0xD6, 0xD0, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0D, 0xB6, 0xA3, 0xD6, 0xD0, 0x06, 0x72, 0x79, 0xE0, 0x07, 0x0C, 0xAB, 0x50, 0x08, 0x24, 0x37, 0x60, 0x08, 0xED, 0xDE, 0xD0, 0x0A, 0x05, 0x6A, 0xE0, 0x0A, 0xCF, 0x12, 0x50, 0x0B, 0xE7, 0xEF, 0xE0, 0x0C, 0xDA, 0x75, 0xD0, 0x0D, 0xC9, 0x23, 0x60, 0x0E, 0x92, 0xCA, 0xD0, 0x0F, 0xA9, 0x05, 0x60, 0x10, 0x72, 0xAC, 0xD0, @@ -7570,17 +7570,31 @@ const unsigned char timelib_timezone_db_data_builtin[261404] = { 0x42, 0x4C, 0x72, 0xE0, 0x43, 0x3C, 0x63, 0xE0, 0x44, 0x2C, 0x54, 0xE0, 0x45, 0x41, 0x2F, 0xE0, 0x46, 0x0C, 0x36, 0xE0, 0x47, 0x21, 0x11, 0xE0, 0x47, 0xEC, 0x18, 0xE0, 0x49, 0x0A, 0x2E, 0x60, 0x49, 0xCB, 0xFA, 0xE0, 0x4A, 0xEA, 0x10, 0x60, 0x4B, 0xAB, 0xDC, 0xE0, 0x4C, 0xC9, 0xF2, 0x60, -0x4D, 0x94, 0xF9, 0x60, 0x4E, 0xA9, 0xD4, 0x60, 0x4F, 0x74, 0xDB, 0x60, 0x50, 0x89, 0xB6, 0x60, +0x4D, 0x94, 0xF9, 0x60, 0x4E, 0xA9, 0xD4, 0x60, 0x4F, 0x74, 0xDB, 0x60, 0x52, 0xB3, 0x5E, 0x50, +0x53, 0x34, 0x9F, 0x60, 0x54, 0x52, 0xB4, 0xE0, 0x55, 0x14, 0x81, 0x60, 0x56, 0x32, 0x96, 0xE0, +0x56, 0xFD, 0x9D, 0xE0, 0x58, 0x12, 0x78, 0xE0, 0x58, 0xDD, 0x7F, 0xE0, 0x59, 0xF2, 0x5A, 0xE0, +0x5A, 0xBD, 0x61, 0xE0, 0x5B, 0xD2, 0x3C, 0xE0, 0x5C, 0x9D, 0x43, 0xE0, 0x5D, 0xB2, 0x1E, 0xE0, +0x5E, 0x7D, 0x25, 0xE0, 0x5F, 0x9B, 0x3B, 0x60, 0x60, 0x5D, 0x07, 0xE0, 0x61, 0x7B, 0x1D, 0x60, +0x62, 0x46, 0x24, 0x60, 0x63, 0x5A, 0xFF, 0x60, 0x64, 0x26, 0x06, 0x60, 0x65, 0x3A, 0xE1, 0x60, +0x66, 0x05, 0xE8, 0x60, 0x67, 0x1A, 0xC3, 0x60, 0x67, 0xE5, 0xCA, 0x60, 0x69, 0x03, 0xDF, 0xE0, +0x69, 0xC5, 0xAC, 0x60, 0x6A, 0xE3, 0xC1, 0xE0, 0x6B, 0xA5, 0x8E, 0x60, 0x6C, 0xC3, 0xA3, 0xE0, +0x6D, 0x8E, 0xAA, 0xE0, 0x6E, 0xA3, 0x85, 0xE0, 0x6F, 0x6E, 0x8C, 0xE0, 0x70, 0x83, 0x67, 0xE0, +0x71, 0x4E, 0x6E, 0xE0, 0x72, 0x63, 0x49, 0xE0, 0x73, 0x2E, 0x50, 0xE0, 0x74, 0x4C, 0x66, 0x60, +0x75, 0x0E, 0x32, 0xE0, 0x76, 0x2C, 0x48, 0x60, 0x76, 0xF7, 0x4F, 0x60, 0x78, 0x0C, 0x2A, 0x60, +0x78, 0xD7, 0x31, 0x60, 0x79, 0xEC, 0x0C, 0x60, 0x7A, 0xB7, 0x13, 0x60, 0x7B, 0xCB, 0xEE, 0x60, +0x7C, 0x96, 0xF5, 0x60, 0x7D, 0xB5, 0x0A, 0xE0, 0x7E, 0x76, 0xD7, 0x60, 0x7F, 0x94, 0xEC, 0xE0, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x04, 0x03, 0x04, 0x03, 0x04, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, -0x03, 0x01, 0x03, 0x01, 0x05, 0x00, 0x00, 0x21, 0xB0, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x01, +0x03, 0x01, 0x03, 0x01, 0x02, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, +0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, +0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, +0x03, 0x01, 0x03, 0x01, 0x03, 0x00, 0x00, 0x21, 0xB0, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x09, 0x00, 0x00, 0x2A, -0x30, 0x01, 0x04, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x45, 0x53, -0x54, 0x00, 0x45, 0x45, 0x54, 0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xBA, 0x14, 0xB8, 0x01, 0x49, 0x7C, 0xF5, 0x00, 0x00, -0x00, 0x00, +0x30, 0x01, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x45, 0x45, 0x54, 0x00, +0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xBA, 0x14, 0xB8, 0x01, 0x49, +0x7C, 0xF5, 0x00, 0x00, 0x00, 0x00, /* Asia/Anadyr */ 0x50, 0x48, 0x50, 0x31, 0x01, 0x52, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -11908,7 +11922,7 @@ const unsigned char timelib_timezone_db_data_builtin[261404] = { 0x33, 0x47, 0x2D, 0xD0, 0x34, 0x40, 0x59, 0x50, 0x35, 0x1D, 0xD5, 0x50, 0x36, 0x32, 0xB0, 0x50, 0x36, 0xFD, 0xB7, 0x50, 0x38, 0x1B, 0xCC, 0xD0, 0x38, 0xE6, 0xD3, 0xD0, 0x39, 0xFB, 0xAE, 0xD0, 0x3A, 0xC6, 0xB5, 0xD0, 0x3B, 0xDB, 0x90, 0xD0, 0x3C, 0xAF, 0xD2, 0x50, 0x3D, 0xBB, 0x72, 0xD0, -0x3E, 0x8F, 0xB4, 0x50, 0x3F, 0x9B, 0x54, 0xD0, 0x40, 0x6F, 0x96, 0x50, 0x45, 0x44, 0x35, 0x50, +0x3E, 0x8F, 0xB4, 0x50, 0x3F, 0x9B, 0x54, 0xD0, 0x40, 0x66, 0x5B, 0xD0, 0x45, 0x44, 0x35, 0x50, 0x45, 0xF3, 0x8C, 0xD0, 0x47, 0x24, 0x17, 0x50, 0x47, 0xDC, 0xA9, 0x50, 0x49, 0x03, 0xF9, 0x50, 0x49, 0xB3, 0x50, 0xD0, 0x4A, 0xE3, 0xDB, 0x50, 0x4B, 0x9C, 0x6D, 0x50, 0x4C, 0xCC, 0xF7, 0xD0, 0x4D, 0x85, 0x89, 0xD0, 0x4E, 0xBF, 0x4E, 0xD0, 0x4F, 0x77, 0xE0, 0xD0, 0x50, 0x95, 0xF6, 0x50, @@ -18402,4 +18416,4 @@ const unsigned char timelib_timezone_db_data_builtin[261404] = { 0x00, 0x00, 0x55, 0x54, 0x43, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00, }; -const timelib_tzdb timezonedb_builtin = { "2013.8", 579, timezonedb_idx_builtin, timelib_timezone_db_data_builtin }; +const timelib_tzdb timezonedb_builtin = { "2013.9", 579, timezonedb_idx_builtin, timelib_timezone_db_data_builtin }; diff --git a/ext/date/lib/tm2unixtime.c b/ext/date/lib/tm2unixtime.c index e15a38150c..f1756e4791 100644 --- a/ext/date/lib/tm2unixtime.c +++ b/ext/date/lib/tm2unixtime.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/date/lib/unixtime2tm.c b/ext/date/lib/unixtime2tm.c index c177feebb1..9870313fbc 100644 --- a/ext/date/lib/unixtime2tm.c +++ b/ext/date/lib/unixtime2tm.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | @@ -137,19 +137,16 @@ void timelib_unixtime2gmt(timelib_time* tm, timelib_sll ts) void timelib_update_from_sse(timelib_time *tm) { timelib_sll sse; + int z = tm->z; + signed int dst = tm->dst; sse = tm->sse; switch (tm->zone_type) { case TIMELIB_ZONETYPE_ABBR: case TIMELIB_ZONETYPE_OFFSET: { - int z = tm->z; - signed int dst = tm->dst; - timelib_unixtime2gmt(tm, tm->sse - (tm->z * 60) + (tm->dst * 3600)); - tm->z = z; - tm->dst = dst; goto cleanup; } @@ -171,6 +168,8 @@ cleanup: tm->sse = sse; tm->is_localtime = 1; tm->have_zone = 1; + tm->z = z; + tm->dst = dst; } void timelib_unixtime2local(timelib_time *tm, timelib_sll ts) @@ -215,6 +214,34 @@ void timelib_unixtime2local(timelib_time *tm, timelib_sll ts) tm->have_zone = 1; } +void timelib_set_timezone_from_offset(timelib_time *t, timelib_sll utc_offset) +{ + if (t->tz_abbr) { + free(t->tz_abbr); + } + t->tz_abbr = NULL; + + t->z = utc_offset; + t->have_zone = 1; + t->zone_type = TIMELIB_ZONETYPE_OFFSET; + t->dst = 0; + t->tz_info = NULL; +} + +void timelib_set_timezone_from_abbr(timelib_time *t, timelib_abbr_info abbr_info) +{ + if (t->tz_abbr) { + free(t->tz_abbr); + } + t->tz_abbr = strdup(abbr_info.abbr); + + t->z = abbr_info.utc_offset; + t->have_zone = 1; + t->zone_type = TIMELIB_ZONETYPE_ABBR; + t->dst = abbr_info.dst; + t->tz_info = NULL; +} + void timelib_set_timezone(timelib_time *t, timelib_tzinfo *tz) { timelib_time_offset *gmt_offset; diff --git a/ext/date/php_date.c b/ext/date/php_date.c index 7e4de09c1e..c0566334db 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | @@ -752,6 +752,14 @@ PHP_RSHUTDOWN_FUNCTION(date) #define DATE_FORMAT_ISO8601 "Y-m-d\\TH:i:sO" +/* + * This comes from various sources that like to contradict. I'm going with the + * format here because of: + * http://msdn.microsoft.com/en-us/library/windows/desktop/aa384321%28v=vs.85%29.aspx + * and http://curl.haxx.se/rfc/cookie_spec.html + */ +#define DATE_FORMAT_COOKIE "l, d-M-Y H:i:s T" + #define DATE_TZ_ERRMSG \ "It is not safe to rely on the system's timezone settings. You are " \ "*required* to use the date.timezone setting or the " \ @@ -783,7 +791,7 @@ PHP_MINIT_FUNCTION(date) * with the variations that the only legal time zone is GMT * and the separators between the elements of the date must be dashes." */ - REGISTER_STRING_CONSTANT("DATE_COOKIE", DATE_FORMAT_RFC850, CONST_CS | CONST_PERSISTENT); + REGISTER_STRING_CONSTANT("DATE_COOKIE", DATE_FORMAT_COOKIE, CONST_CS | CONST_PERSISTENT); REGISTER_STRING_CONSTANT("DATE_ISO8601", DATE_FORMAT_ISO8601, CONST_CS | CONST_PERSISTENT); REGISTER_STRING_CONSTANT("DATE_RFC822", DATE_FORMAT_RFC822, CONST_CS | CONST_PERSISTENT); REGISTER_STRING_CONSTANT("DATE_RFC850", DATE_FORMAT_RFC850, CONST_CS | CONST_PERSISTENT); @@ -1948,7 +1956,7 @@ static void date_register_classes(TSRMLS_D) zend_declare_class_constant_stringl(date_ce_date, const_name, sizeof(const_name)-1, value, sizeof(value)-1 TSRMLS_CC); REGISTER_DATE_CLASS_CONST_STRING("ATOM", DATE_FORMAT_RFC3339); - REGISTER_DATE_CLASS_CONST_STRING("COOKIE", DATE_FORMAT_RFC850); + REGISTER_DATE_CLASS_CONST_STRING("COOKIE", DATE_FORMAT_COOKIE); REGISTER_DATE_CLASS_CONST_STRING("ISO8601", DATE_FORMAT_ISO8601); REGISTER_DATE_CLASS_CONST_STRING("RFC822", DATE_FORMAT_RFC822); REGISTER_DATE_CLASS_CONST_STRING("RFC850", DATE_FORMAT_RFC850); @@ -2479,6 +2487,7 @@ PHPAPI int php_date_initialize(php_date_obj *dateobj, /*const*/ char *time_str, timelib_fill_holes(dateobj->time, now, TIMELIB_NO_CLONE); timelib_update_ts(dateobj->time, tzi); + timelib_update_from_sse(dateobj->time); dateobj->time->have_relative = 0; @@ -2880,7 +2889,7 @@ PHP_FUNCTION(date_add) zval *object, *interval; php_date_obj *dateobj; php_interval_obj *intobj; - int bias = 1; + timelib_time *new_time; if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &object, date_ce_date, &interval, date_ce_interval) == FAILURE) { RETURN_FALSE; @@ -2890,27 +2899,9 @@ PHP_FUNCTION(date_add) intobj = (php_interval_obj *) zend_object_store_get_object(interval TSRMLS_CC); DATE_CHECK_INITIALIZED(intobj->initialized, DateInterval); - - if (intobj->diff->have_weekday_relative || intobj->diff->have_special_relative) { - memcpy(&dateobj->time->relative, intobj->diff, sizeof(struct timelib_rel_time)); - } else { - if (intobj->diff->invert) { - bias = -1; - } - memset(&dateobj->time->relative, 0, sizeof(struct timelib_rel_time)); - dateobj->time->relative.y = intobj->diff->y * bias; - dateobj->time->relative.m = intobj->diff->m * bias; - dateobj->time->relative.d = intobj->diff->d * bias; - dateobj->time->relative.h = intobj->diff->h * bias; - dateobj->time->relative.i = intobj->diff->i * bias; - dateobj->time->relative.s = intobj->diff->s * bias; - } - dateobj->time->have_relative = 1; - dateobj->time->sse_uptodate = 0; - - timelib_update_ts(dateobj->time, NULL); - timelib_update_from_sse(dateobj->time); - dateobj->time->have_relative = 0; + new_time = timelib_add(dateobj->time, intobj->diff); + timelib_time_dtor(dateobj->time); + dateobj->time = new_time; RETURN_ZVAL(object, 1, 0); } @@ -2924,7 +2915,7 @@ PHP_FUNCTION(date_sub) zval *object, *interval; php_date_obj *dateobj; php_interval_obj *intobj; - int bias = 1; + timelib_time *new_time; if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &object, date_ce_date, &interval, date_ce_interval) == FAILURE) { RETURN_FALSE; @@ -2939,24 +2930,9 @@ PHP_FUNCTION(date_sub) return; } - if (intobj->diff->invert) { - bias = -1; - } - - memset(&dateobj->time->relative, 0, sizeof(struct timelib_rel_time)); - dateobj->time->relative.y = 0 - (intobj->diff->y * bias); - dateobj->time->relative.m = 0 - (intobj->diff->m * bias); - dateobj->time->relative.d = 0 - (intobj->diff->d * bias); - dateobj->time->relative.h = 0 - (intobj->diff->h * bias); - dateobj->time->relative.i = 0 - (intobj->diff->i * bias); - dateobj->time->relative.s = 0 - (intobj->diff->s * bias); - dateobj->time->have_relative = 1; - dateobj->time->sse_uptodate = 0; - - timelib_update_ts(dateobj->time, NULL); - timelib_update_from_sse(dateobj->time); - - dateobj->time->have_relative = 0; + new_time = timelib_sub(dateobj->time, intobj->diff); + timelib_time_dtor(dateobj->time); + dateobj->time = new_time; RETURN_ZVAL(object, 1, 0); } @@ -3016,11 +2992,18 @@ PHP_FUNCTION(date_timezone_set) dateobj = (php_date_obj *) zend_object_store_get_object(object TSRMLS_CC); DATE_CHECK_INITIALIZED(dateobj->time, DateTime); tzobj = (php_timezone_obj *) zend_object_store_get_object(timezone_object TSRMLS_CC); - if (tzobj->type != TIMELIB_ZONETYPE_ID) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can only do this for zones with ID for now"); - return; + + switch (tzobj->type) { + case TIMELIB_ZONETYPE_OFFSET: + timelib_set_timezone_from_offset(dateobj->time, tzobj->tzi.utc_offset); + break; + case TIMELIB_ZONETYPE_ABBR: + timelib_set_timezone_from_abbr(dateobj->time, tzobj->tzi.z); + break; + case TIMELIB_ZONETYPE_ID: + timelib_set_timezone(dateobj->time, tzobj->tzi.tz); + break; } - timelib_set_timezone(dateobj->time, tzobj->tzi.tz); timelib_unixtime2local(dateobj->time, dateobj->time->sse); RETURN_ZVAL(object, 1, 0); diff --git a/ext/date/php_date.h b/ext/date/php_date.h index be0df38b69..4ce730bb2b 100644 --- a/ext/date/php_date.h +++ b/ext/date/php_date.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | @@ -122,14 +122,9 @@ struct _php_timezone_obj { int initialized; int type; union { - timelib_tzinfo *tz; /* TIMELIB_ZONETYPE_ID; */ - timelib_sll utc_offset; /* TIMELIB_ZONETYPE_OFFSET */ - struct /* TIMELIB_ZONETYPE_ABBR */ - { - timelib_sll utc_offset; - char *abbr; - int dst; - } z; + timelib_tzinfo *tz; /* TIMELIB_ZONETYPE_ID */ + timelib_sll utc_offset; /* TIMELIB_ZONETYPE_OFFSET */ + timelib_abbr_info z; /* TIMELIB_ZONETYPE_ABBR */ } tzi; }; diff --git a/ext/date/tests/DateTime_format_basic2.phpt b/ext/date/tests/DateTime_format_basic2.phpt index d7adaa5df8..016fa7b6b2 100644 --- a/ext/date/tests/DateTime_format_basic2.phpt +++ b/ext/date/tests/DateTime_format_basic2.phpt @@ -31,7 +31,7 @@ var_dump( $date->format( DateTime::W3C) ) ; --EXPECT-- *** Testing date_format() : basic functionality - formatting coinstants *** string(25) "2005-07-14T22:30:41+01:00" -string(32) "Thursday, 14-Jul-05 22:30:41 BST" +string(34) "Thursday, 14-Jul-2005 22:30:41 BST" string(24) "2005-07-14T22:30:41+0100" string(29) "Thu, 14 Jul 05 22:30:41 +0100" string(32) "Thursday, 14-Jul-05 22:30:41 BST" diff --git a/ext/date/tests/DateTime_verify.phpt b/ext/date/tests/DateTime_verify.phpt index a03911f5c8..c790974729 100644 --- a/ext/date/tests/DateTime_verify.phpt +++ b/ext/date/tests/DateTime_verify.phpt @@ -160,7 +160,7 @@ array(11) { ["ATOM"]=> string(13) "Y-m-d\TH:i:sP" ["COOKIE"]=> - string(16) "l, d-M-y H:i:s T" + string(16) "l, d-M-Y H:i:s T" ["ISO8601"]=> string(13) "Y-m-d\TH:i:sO" ["RFC822"]=> @@ -180,4 +180,4 @@ array(11) { ["W3C"]=> string(13) "Y-m-d\TH:i:sP" } -===DONE===
\ No newline at end of file +===DONE=== diff --git a/ext/date/tests/bug44780.phpt b/ext/date/tests/bug44780.phpt new file mode 100644 index 0000000000..5c822d48e6 --- /dev/null +++ b/ext/date/tests/bug44780.phpt @@ -0,0 +1,10 @@ +--TEST-- +Bug #44780 (some time zone offsets not recognized by timezone_name_from_abbr) +--FILE-- +<?php +var_dump( timezone_name_from_abbr("", 5.5*3600, false) ); +var_dump( timezone_name_from_abbr("", 28800, false) ); +?> +--EXPECT-- +string(12) "Asia/Kolkata" +string(13) "Asia/Shanghai" diff --git a/ext/date/tests/bug45543.phpt b/ext/date/tests/bug45543.phpt new file mode 100644 index 0000000000..8e36e6287c --- /dev/null +++ b/ext/date/tests/bug45543.phpt @@ -0,0 +1,34 @@ +--TEST-- +Test for bug #45543: DateTime::setTimezone can not set timezones without ID. +--INI-- +date.timezone=UTC +--FILE-- +<?php +$test_dates = array( + '2008-01-01 12:00:00 PDT', + '2008-01-01 12:00:00 +02:00', +); + +foreach ($test_dates as $test_date) +{ + $d1 = new DateTime($test_date); + $d2 = new DateTime('2008-01-01 12:00:00 UTC'); + echo $d1->format(DATE_ISO8601), PHP_EOL; + echo $d2->format(DATE_ISO8601), PHP_EOL; + $tz = $d1->getTimeZone(); + $d2->setTimeZone($tz); + echo $d1->format(DATE_ISO8601), PHP_EOL; + echo $d2->format(DATE_ISO8601), PHP_EOL; + echo PHP_EOL; +} +--EXPECT-- +2008-01-01T12:00:00-0700 +2008-01-01T12:00:00+0000 +2008-01-01T12:00:00-0700 +2008-01-01T05:00:00-0700 + +2008-01-01T12:00:00+0200 +2008-01-01T12:00:00+0000 +2008-01-01T12:00:00+0200 +2008-01-01T14:00:00+0200 + diff --git a/ext/date/tests/bug52063.phpt b/ext/date/tests/bug52063.phpt index af9da9e429..7364a80612 100644 --- a/ext/date/tests/bug52063.phpt +++ b/ext/date/tests/bug52063.phpt @@ -11,5 +11,5 @@ echo $a->format(DateTime::COOKIE); echo "\n"; ?> --EXPECTF-- -Thursday, 01-Jan-09 00:00:00 WET -Thursday, 01-Jan-09 00:00:00 WET +Thursday, 01-Jan-2009 00:00:00 WET +Thursday, 01-Jan-2009 00:00:00 WET diff --git a/ext/date/tests/bug53879.phpt b/ext/date/tests/bug53879.phpt new file mode 100644 index 0000000000..3d16c97209 --- /dev/null +++ b/ext/date/tests/bug53879.phpt @@ -0,0 +1,16 @@ +--TEST-- +Bug #53879 (DateTime::createFromFormat() fails to parse cookie expiration date) +--INI-- +date.timezone=UTC +--FILE-- +<?php +$date = DateTime::createFromFormat(DateTime::COOKIE, "Mon, 21-Jan-2041 15:24:52 GMT"); +print_r($date); +?> +--EXPECTF-- +DateTime Object +( + [date] => 2041-01-21 15:24:52 + [timezone_type] => 2 + [timezone] => GMT +) diff --git a/ext/date/tests/bug63391.phpt b/ext/date/tests/bug63391.phpt new file mode 100644 index 0000000000..a29d25e730 --- /dev/null +++ b/ext/date/tests/bug63391.phpt @@ -0,0 +1,20 @@ +--TEST-- +Test for #63391 (Incorrect/inconsistent day of week prior to the year 1600) +--FILE-- +<?php +ini_set('date.timezone', 'UTC'); + +print "Date PHP\n"; +print "---------- ---\n"; +$dates = array('1599-12-30', '1599-12-31', '1600-01-01', '1600-01-02'); +foreach ($dates as $date) { + echo date_create($date)->format('Y-m-d D'), "\n"; +} +?> +--EXPECT-- +Date PHP +---------- --- +1599-12-30 Thu +1599-12-31 Fri +1600-01-01 Sat +1600-01-02 Sun diff --git a/ext/date/tests/bug65371.phpt b/ext/date/tests/bug65371.phpt new file mode 100644 index 0000000000..a6e3126514 --- /dev/null +++ b/ext/date/tests/bug65371.phpt @@ -0,0 +1,22 @@ +--TEST-- +Testing bug #65371 +--INI-- +date.timezone=Europe/Berlin +--FILE-- +<?php + +function p($str) +{ + echo $str, "\n"; + echo strftime($str), "\n"; + echo bin2hex($str), "\n"; + echo bin2hex(strftime($str)); +} + +setlocale(LC_ALL, 'C'); +p('あ'); +--EXPECT-- +あ +あ +e38182 +e38182 diff --git a/ext/date/tests/date_constants.phpt b/ext/date/tests/date_constants.phpt index 132e24159b..b9fce8c78b 100644 --- a/ext/date/tests/date_constants.phpt +++ b/ext/date/tests/date_constants.phpt @@ -41,8 +41,8 @@ Date constants --EXPECT-- string(25) "2006-07-01T14:27:30+02:00" string(25) "2006-05-30T14:32:13+02:00" -string(33) "Saturday, 01-Jul-06 14:27:30 CEST" -string(32) "Tuesday, 30-May-06 14:32:13 CEST" +string(35) "Saturday, 01-Jul-2006 14:27:30 CEST" +string(34) "Tuesday, 30-May-2006 14:32:13 CEST" string(24) "2006-07-01T14:27:30+0200" string(24) "2006-05-30T14:32:13+0200" string(29) "Sat, 01 Jul 06 14:27:30 +0200" diff --git a/ext/date/tests/forward-transition-construction.phpt b/ext/date/tests/forward-transition-construction.phpt new file mode 100644 index 0000000000..8f195a51bd --- /dev/null +++ b/ext/date/tests/forward-transition-construction.phpt @@ -0,0 +1,27 @@ +--TEST-- +Test for Date/Time construction during a forward DST transition +--FILE-- +<?php +date_default_timezone_set('America/New_York'); + +$date = new DateTime('2010-03-14 01:30:00'); +echo $date->format('Y-m-d H:i:s T/e - U') . "\n"; + +$date = new DateTime('2010-03-14 02:00:00'); +echo $date->format('Y-m-d H:i:s T/e - U') . "\n"; + +$date = new DateTime('2010-03-14 02:30:00'); +echo $date->format('Y-m-d H:i:s T/e - U') . "\n"; + +$date = new DateTime('2010-03-14 03:00:00'); +echo $date->format('Y-m-d H:i:s T/e - U') . "\n"; + +$date = new DateTime('2010-03-14 03:30:00'); +echo $date->format('Y-m-d H:i:s T/e - U') . "\n"; +?> +--EXPECT-- +2010-03-14 01:30:00 EST/America/New_York - 1268548200 +2010-03-14 03:00:00 EDT/America/New_York - 1268550000 +2010-03-14 03:30:00 EDT/America/New_York - 1268551800 +2010-03-14 03:00:00 EDT/America/New_York - 1268550000 +2010-03-14 03:30:00 EDT/America/New_York - 1268551800 diff --git a/ext/date/tests/gmdate_variation13.phpt b/ext/date/tests/gmdate_variation13.phpt index 5a19ae268e..1d1f434ece 100644 --- a/ext/date/tests/gmdate_variation13.phpt +++ b/ext/date/tests/gmdate_variation13.phpt @@ -45,7 +45,7 @@ string(25) "2008-08-08T08:08:08+00:00" string(%d) "%s" --DATE_COOKIE Constant-- -string(30) "Friday, 08-Aug-08 08:08:08 GMT" +string(32) "Friday, 08-Aug-2008 08:08:08 GMT" string(%d) "%s" --DATE_RFC822 Constant-- @@ -79,4 +79,4 @@ string(%d) "%s" --DATE_W3C Constant-- string(25) "2008-08-08T08:08:08+00:00" string(%d) "%s" -===DONE===
\ No newline at end of file +===DONE=== diff --git a/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-ba.phpt b/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-ba.phpt new file mode 100644 index 0000000000..fdbe96d7d0 --- /dev/null +++ b/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-ba.phpt @@ -0,0 +1,96 @@ +--TEST-- +RFC: DateTime and Daylight Saving Time Transitions (zone type 3, ba) +--CREDITS-- +Daniel Convissor <danielc@php.net> +--FILE-- +<?php + +date_default_timezone_set('America/New_York'); +$date_format = 'Y-m-d H:i:s T e'; +$interval_format = 'P%dDT%hH'; + +/* + * Backward Transitions, add(). + */ + +$start = new DateTime('2010-11-07 01:59:59'); +$interval_spec = 'PT1S'; +$interval = new DateInterval($interval_spec); +echo 'ba1 ' . $start->format($date_format) . " + $interval_spec = " + . $start->add($interval)->format($date_format) . "\n"; + +$start = new DateTime('2010-11-06 04:30:00'); +$interval_spec = 'P1D'; +$interval = new DateInterval($interval_spec); +echo 'ba2 ' . $start->format($date_format) . " + $interval_spec = " + . $start->add($interval)->format($date_format) . "\n"; + +$start = new DateTime('2010-11-06 04:30:00'); +$interval_spec = 'PT24H'; +$interval = new DateInterval($interval_spec); +echo 'ba3 ' . $start->format($date_format) . " + $interval_spec = " + . $start->add($interval)->format($date_format) . "\n"; + +$start = new DateTime('2010-11-06 04:30:00'); +$interval_spec = 'PT23H'; +$interval = new DateInterval($interval_spec); +echo 'ba4 ' . $start->format($date_format) . " + $interval_spec = " + . $start->add($interval)->format($date_format) . "\n"; + +$start = new DateTime('2010-11-06 04:30:00'); +$interval_spec = 'PT22H'; +$interval = new DateInterval($interval_spec); +echo 'ba5 ' . $start->format($date_format) . " + $interval_spec = " + . $start->add($interval)->format($date_format) . "\n"; + +$start = new DateTime('2010-11-06 04:30:00'); +$interval_spec = 'PT21H'; +$interval = new DateInterval($interval_spec); +echo 'ba6 ' . $start->format($date_format) . " + $interval_spec = " + . $start->add($interval)->format($date_format) . "\n"; + +$start = new DateTime('2010-11-06 01:30:00'); +$interval_spec = 'P1D'; +$interval = new DateInterval($interval_spec); +echo 'ba7 ' . $start->format($date_format) . " + $interval_spec = " + . $start->add($interval)->format($date_format) . "\n"; + +$start = new DateTime('2010-11-06 01:30:00'); +$interval_spec = 'P1DT1H'; +$interval = new DateInterval($interval_spec); +echo 'ba8 ' . $start->format($date_format) . " + $interval_spec = " + . $start->add($interval)->format($date_format) . "\n"; + +$start = new DateTime('2010-11-06 04:30:00'); +$interval_spec = 'PT25H'; +$interval = new DateInterval($interval_spec); +echo 'ba9 ' . $start->format($date_format) . " + $interval_spec = " + . $start->add($interval)->format($date_format) . "\n"; + +$start = new DateTime('2010-11-06 03:30:00'); +$interval_spec = 'P1D'; +$interval = new DateInterval($interval_spec); +echo 'ba10 ' . $start->format($date_format) . " + $interval_spec = " + . $start->add($interval)->format($date_format) . "\n"; + +$start = new DateTime('2010-11-06 02:30:00'); +$interval_spec = 'P1D'; +$interval = new DateInterval($interval_spec); +echo 'ba11 ' . $start->format($date_format) . " + $interval_spec = " + . $start->add($interval)->format($date_format) . "\n"; + +echo "\n"; + +?> +--EXPECT-- +ba1 2010-11-07 01:59:59 EDT America/New_York + PT1S = 2010-11-07 01:00:00 EST America/New_York +ba2 2010-11-06 04:30:00 EDT America/New_York + P1D = 2010-11-07 04:30:00 EST America/New_York +ba3 2010-11-06 04:30:00 EDT America/New_York + PT24H = 2010-11-07 03:30:00 EST America/New_York +ba4 2010-11-06 04:30:00 EDT America/New_York + PT23H = 2010-11-07 02:30:00 EST America/New_York +ba5 2010-11-06 04:30:00 EDT America/New_York + PT22H = 2010-11-07 01:30:00 EST America/New_York +ba6 2010-11-06 04:30:00 EDT America/New_York + PT21H = 2010-11-07 01:30:00 EDT America/New_York +ba7 2010-11-06 01:30:00 EDT America/New_York + P1D = 2010-11-07 01:30:00 EDT America/New_York +ba8 2010-11-06 01:30:00 EDT America/New_York + P1DT1H = 2010-11-07 02:30:00 EST America/New_York +ba9 2010-11-06 04:30:00 EDT America/New_York + PT25H = 2010-11-07 04:30:00 EST America/New_York +ba10 2010-11-06 03:30:00 EDT America/New_York + P1D = 2010-11-07 03:30:00 EST America/New_York +ba11 2010-11-06 02:30:00 EDT America/New_York + P1D = 2010-11-07 02:30:00 EST America/New_York diff --git a/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-bd1.phpt b/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-bd1.phpt new file mode 100644 index 0000000000..8249599931 --- /dev/null +++ b/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-bd1.phpt @@ -0,0 +1,48 @@ +--TEST-- +RFC: DateTime and Daylight Saving Time Transitions (zone type 3, bd1) +--CREDITS-- +Daniel Convissor <danielc@php.net> +--FILE-- +<?php + +date_default_timezone_set('America/New_York'); +$date_format = 'Y-m-d H:i:s T e'; +$interval_format = 'P%dDT%hH'; + +/* + * Backward Transitions, diff(). + */ + +$end = new DateTime('2010-11-07 05:30:00'); +$start = new DateTime('2010-11-06 04:30:00'); +echo 'bd1 ' . $end->format($date_format) . ' - ' . $start->format($date_format) + . ' = ' . $start->diff($end)->format($interval_format) . "\n"; + +$end = new DateTime('2010-11-07 04:30:00'); +$start = new DateTime('2010-11-06 04:30:00'); +echo 'bd2 ' . $end->format($date_format) . ' - ' . $start->format($date_format) + . ' = ' . $start->diff($end)->format($interval_format) . "\n"; + +$end = new DateTime('2010-11-07 03:30:00'); +$start = new DateTime('2010-11-06 04:30:00'); +echo 'bd3 ' . $end->format($date_format) . ' - ' . $start->format($date_format) + . ' = ' . $start->diff($end)->format($interval_format) . "\n"; + +$end = new DateTime('2010-11-07 02:30:00'); +$start = new DateTime('2010-11-06 04:30:00'); +echo 'bd4 ' . $end->format($date_format) . ' - ' . $start->format($date_format) + . ' = ' . $start->diff($end)->format($interval_format) . "\n"; + +$end = new DateTime('2010-11-07 01:30:00'); +$start = new DateTime('2010-11-06 01:30:00'); +echo 'bd7 ' . $end->format($date_format) . ' - ' . $start->format($date_format) + . ' = ' . $start->diff($end)->format($interval_format) . "\n"; + +echo "\n"; +?> +--EXPECT-- +bd1 2010-11-07 05:30:00 EST America/New_York - 2010-11-06 04:30:00 EDT America/New_York = P1DT1H +bd2 2010-11-07 04:30:00 EST America/New_York - 2010-11-06 04:30:00 EDT America/New_York = P1DT0H +bd3 2010-11-07 03:30:00 EST America/New_York - 2010-11-06 04:30:00 EDT America/New_York = P0DT24H +bd4 2010-11-07 02:30:00 EST America/New_York - 2010-11-06 04:30:00 EDT America/New_York = P0DT23H +bd7 2010-11-07 01:30:00 EDT America/New_York - 2010-11-06 01:30:00 EDT America/New_York = P1DT0H diff --git a/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-bd2.phpt b/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-bd2.phpt new file mode 100644 index 0000000000..fe2e79b3b9 --- /dev/null +++ b/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-bd2.phpt @@ -0,0 +1,56 @@ +--TEST-- +RFC: DateTime and Daylight Saving Time Transitions (zone type 3, bd2) +--CREDITS-- +Daniel Convissor <danielc@php.net> +--XFAIL-- +Still not quite right +--FILE-- +<?php + +date_default_timezone_set('America/New_York'); +$date_format = 'Y-m-d H:i:s T e'; +$interval_format = 'P%dDT%hH'; + +/* + * For backward transitions, must create objects with zone type 2 + * where specifying Daylight or Standard time is required + * then converting them to zone type 3. + */ + +$tz = new DateTimeZone('America/New_York'); + +/* + * Backward Transitions, diff(). + */ + +$end = new DateTime('2010-11-07 05:30:00'); +$end->setTimeZone($tz); +$start = new DateTime('2010-11-06 04:30:59'); +echo 'bd0 ' . $end->format($date_format) . ' - ' . $start->format($date_format) + . ' = ' . $start->diff($end)->format('P%dDT%hH%iM%sS') . "\n"; + +$end = new DateTime('2010-11-07 01:30:00 EST'); +$end->setTimeZone($tz); +$start = new DateTime('2010-11-06 04:30:00'); +echo 'bd5 ' . $end->format($date_format) . ' - ' . $start->format($date_format) + . ' = ' . $start->diff($end)->format($interval_format) . "\n"; + +$end = new DateTime('2010-11-07 01:30:00 EDT'); +$end->setTimeZone($tz); +$start = new DateTime('2010-11-06 04:30:00'); +echo 'bd6 ' . $end->format($date_format) . ' - ' . $start->format($date_format) + . ' = ' . $start->diff($end)->format($interval_format) . "\n"; + +$end = new DateTime('2010-11-07 01:30:00 EST'); +$end->setTimeZone($tz); +$start = new DateTime('2010-11-06 01:30:00'); +echo 'bd8 ' . $end->format($date_format) . ' - ' . $start->format($date_format) + . ' = ' . $start->diff($end)->format($interval_format) . "\n"; + +echo "\n"; +?> +--EXPECT-- +bd0 2010-11-07 01:00:00 EST America/New_York - 2010-11-07 01:59:59 EDT America/New_York = PT0H0M1S +bd5 2010-11-07 01:30:00 EST America/New_York - 2010-11-06 04:30:00 EDT America/New_York = P0DT22H +bd6 2010-11-07 01:30:00 EDT America/New_York - 2010-11-06 04:30:00 EDT America/New_York = P0DT21H +bd8 2010-11-07 01:30:00 EST America/New_York - 2010-11-06 01:30:00 EDT America/New_York = P1DT1H diff --git a/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-bs.phpt b/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-bs.phpt new file mode 100644 index 0000000000..138c68f3a9 --- /dev/null +++ b/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-bs.phpt @@ -0,0 +1,92 @@ +--TEST-- +RFC: DateTime and Daylight Saving Time Transitions (zone type 3, bs) +--CREDITS-- +Daniel Convissor <danielc@php.net> +--FILE-- +<?php + +date_default_timezone_set('America/New_York'); +$tz = new DateTimeZone('America/New_York'); +$date_format = 'Y-m-d H:i:s T e'; +$interval_format = 'P%dDT%hH'; + +/* + * Backward Transitions, sub(). + */ + +$end = new DateTime('2010-11-07 01:00:00 EST'); +$end->setTimeZone($tz); +$interval_spec = 'PT1S'; +$interval = new DateInterval($interval_spec); +echo 'bs1 ' . $end->format($date_format) . " - $interval_spec = " + . $end->sub($interval)->format($date_format) . "\n"; + +$end = new DateTime('2010-11-07 04:30:00'); +$interval_spec = 'P1D'; +$interval = new DateInterval($interval_spec); +echo 'bs2 ' . $end->format($date_format) . " - $interval_spec = " + . $end->sub($interval)->format($date_format) . "\n"; + +$end = new DateTime('2010-11-07 03:30:00'); +$interval_spec = 'PT24H'; +$interval = new DateInterval($interval_spec); +echo 'bs3 ' . $end->format($date_format) . " - $interval_spec = " + . $end->sub($interval)->format($date_format) . "\n"; + +$end = new DateTime('2010-11-07 02:30:00'); +$interval_spec = 'PT23H'; +$interval = new DateInterval($interval_spec); +echo 'bs4 ' . $end->format($date_format) . " - $interval_spec = " + . $end->sub($interval)->format($date_format) . "\n"; + +$end = new DateTime('2010-11-07 01:30:00 EST'); +$end->setTimeZone($tz); +$interval_spec = 'PT22H'; +$interval = new DateInterval($interval_spec); +echo 'bs5 ' . $end->format($date_format) . " - $interval_spec = " + . $end->sub($interval)->format($date_format) . "\n"; + +$end = new DateTime('2010-11-07 01:30:00 EDT'); +$end->setTimeZone($tz); +$interval_spec = 'PT21H'; +$interval = new DateInterval($interval_spec); +echo 'bs6 ' . $end->format($date_format) . " - $interval_spec = " + . $end->sub($interval)->format($date_format) . "\n"; + +$end = new DateTime('2010-11-07 01:30:00'); +$interval_spec = 'P1D'; +$interval = new DateInterval($interval_spec); +echo 'bs7 ' . $end->format($date_format) . " - $interval_spec = " + . $end->sub($interval)->format($date_format) . "\n"; + +$end = new DateTime('2010-11-07 01:30:00 EST'); +$end->setTimeZone($tz); +$interval_spec = 'P1DT1H'; +$interval = new DateInterval($interval_spec); +echo 'bs8 ' . $end->format($date_format) . " - $interval_spec = " + . $end->sub($interval)->format($date_format) . "\n"; + +$end = new DateTime('2010-11-07 03:30:00'); +$interval_spec = 'P1D'; +$interval = new DateInterval($interval_spec); +echo 'bs9 ' . $end->format($date_format) . " - $interval_spec = " + . $end->sub($interval)->format($date_format) . "\n"; + +$end = new DateTime('2010-11-07 02:30:00'); +$interval_spec = 'P1D'; +$interval = new DateInterval($interval_spec); +echo 'bs10 ' . $end->format($date_format) . " - $interval_spec = " + . $end->sub($interval)->format($date_format) . "\n"; + +?> +--EXPECT-- +bs1 2010-11-07 01:00:00 EST America/New_York - PT1S = 2010-11-07 01:59:59 EDT America/New_York +bs2 2010-11-07 04:30:00 EST America/New_York - P1D = 2010-11-06 04:30:00 EDT America/New_York +bs3 2010-11-07 03:30:00 EST America/New_York - PT24H = 2010-11-06 04:30:00 EDT America/New_York +bs4 2010-11-07 02:30:00 EST America/New_York - PT23H = 2010-11-06 04:30:00 EDT America/New_York +bs5 2010-11-07 01:30:00 EST America/New_York - PT22H = 2010-11-06 04:30:00 EDT America/New_York +bs6 2010-11-07 01:30:00 EDT America/New_York - PT21H = 2010-11-06 04:30:00 EDT America/New_York +bs7 2010-11-07 01:30:00 EDT America/New_York - P1D = 2010-11-06 01:30:00 EDT America/New_York +bs8 2010-11-07 01:30:00 EST America/New_York - P1DT1H = 2010-11-06 00:30:00 EDT America/New_York +bs9 2010-11-07 03:30:00 EST America/New_York - P1D = 2010-11-06 03:30:00 EDT America/New_York +bs10 2010-11-07 02:30:00 EST America/New_York - P1D = 2010-11-06 02:30:00 EDT America/New_York diff --git a/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-fa.phpt b/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-fa.phpt new file mode 100644 index 0000000000..9fa493f578 --- /dev/null +++ b/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-fa.phpt @@ -0,0 +1,58 @@ +--TEST-- +RFC: DateTime and Daylight Saving Time Transitions (zone type 3, fa) +--CREDITS-- +Daniel Convissor <danielc@php.net> +--FILE-- +<?php + +date_default_timezone_set('America/New_York'); +$date_format = 'Y-m-d H:i:s T e'; +$interval_format = 'P%dDT%hH'; + +/* + * Forward Transitions, add(). + */ + +$start = new DateTime('2010-03-14 01:59:59'); +$interval_spec = 'PT1S'; +$interval = new DateInterval($interval_spec); +echo 'fa1 ' . $start->format($date_format) . " + $interval_spec = " + . $start->add($interval)->format($date_format) . "\n"; + +$start = new DateTime('2010-03-13 04:30:00'); +$interval_spec = 'P1D'; +$interval = new DateInterval($interval_spec); +echo 'fa2 ' . $start->format($date_format) . " + $interval_spec = " + . $start->add($interval)->format($date_format) . "\n"; + +$start = new DateTime('2010-03-13 04:30:00'); +$interval_spec = 'PT22H'; +$interval = new DateInterval($interval_spec); +echo 'fa3 ' . $start->format($date_format) . " + $interval_spec = " + . $start->add($interval)->format($date_format) . "\n"; + +$start = new DateTime('2010-03-13 04:30:00'); +$interval_spec = 'PT21H'; +$interval = new DateInterval($interval_spec); +echo 'fa4 ' . $start->format($date_format) . " + $interval_spec = " + . $start->add($interval)->format($date_format) . "\n"; + +$start = new DateTime('2010-03-13 01:30:00'); +$interval_spec = 'P1D'; +$interval = new DateInterval($interval_spec); +echo 'fa5 ' . $start->format($date_format) . " + $interval_spec = " + . $start->add($interval)->format($date_format) . "\n"; + +$start = new DateTime('2010-03-13 02:30:00'); +$interval_spec = 'P1D'; +$interval = new DateInterval($interval_spec); +echo 'fa6 ' . $start->format($date_format) . " + $interval_spec = " + . $start->add($interval)->format($date_format) . "\n"; +?> +--EXPECT-- +fa1 2010-03-14 01:59:59 EST America/New_York + PT1S = 2010-03-14 03:00:00 EDT America/New_York +fa2 2010-03-13 04:30:00 EST America/New_York + P1D = 2010-03-14 04:30:00 EDT America/New_York +fa3 2010-03-13 04:30:00 EST America/New_York + PT22H = 2010-03-14 03:30:00 EDT America/New_York +fa4 2010-03-13 04:30:00 EST America/New_York + PT21H = 2010-03-14 01:30:00 EST America/New_York +fa5 2010-03-13 01:30:00 EST America/New_York + P1D = 2010-03-14 01:30:00 EST America/New_York +fa6 2010-03-13 02:30:00 EST America/New_York + P1D = 2010-03-14 03:30:00 EDT America/New_York diff --git a/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-fd.phpt b/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-fd.phpt new file mode 100644 index 0000000000..ae7060be0b --- /dev/null +++ b/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-fd.phpt @@ -0,0 +1,58 @@ +--TEST-- +RFC: DateTime and Daylight Saving Time Transitions (zone type 3, fd) +--CREDITS-- +Daniel Convissor <danielc@php.net> +--FILE-- +<?php + +date_default_timezone_set('America/New_York'); +$date_format = 'Y-m-d H:i:s T e'; +$interval_format = 'P%dDT%hH'; + +/* + * Forward Transitions, diff(). + */ + +$end = new DateTime('2010-03-14 03:00:00'); +$start = new DateTime('2010-03-14 01:59:59'); +echo 'fd1 ' . $end->format($date_format) . ' - ' . $start->format($date_format) + . ' = ' . $start->diff($end)->format('PT%hH%iM%sS') . "\n"; + +$end = new DateTime('2010-03-14 04:30:00'); +$start = new DateTime('2010-03-13 04:30:00'); +echo 'fd2 ' . $end->format($date_format) . ' - ' . $start->format($date_format) + . ' = ' . $start->diff($end)->format($interval_format) . "\n"; + +$end = new DateTime('2010-03-14 03:30:00'); +$start = new DateTime('2010-03-13 04:30:00'); +echo 'fd3 ' . $end->format($date_format) . ' - ' . $start->format($date_format) + . ' = ' . $start->diff($end)->format($interval_format) . "\n"; + +$end = new DateTime('2010-03-14 01:30:00'); +$start = new DateTime('2010-03-13 04:30:00'); +echo 'fd4 ' . $end->format($date_format) . ' - ' . $start->format($date_format) + . ' = ' . $start->diff($end)->format($interval_format) . "\n"; + +$end = new DateTime('2010-03-14 01:30:00'); +$start = new DateTime('2010-03-13 01:30:00'); +echo 'fd5 ' . $end->format($date_format) . ' - ' . $start->format($date_format) + . ' = ' . $start->diff($end)->format($interval_format) . "\n"; + +$end = new DateTime('2010-03-14 03:30:00'); +$start = new DateTime('2010-03-13 03:30:00'); +echo 'fd6 ' . $end->format($date_format) . ' - ' . $start->format($date_format) + . ' = ' . $start->diff($end)->format($interval_format) . "\n"; + +$end = new DateTime('2010-03-14 03:30:00'); +$start = new DateTime('2010-03-13 02:30:00'); +echo 'fd7 ' . $end->format($date_format) . ' - ' . $start->format($date_format) + . ' = ' . $start->diff($end)->format($interval_format) . "\n"; +?> +--EXPECT-- +fd1 2010-03-14 03:00:00 EDT America/New_York - 2010-03-14 01:59:59 EST America/New_York = PT0H0M1S +fd2 2010-03-14 04:30:00 EDT America/New_York - 2010-03-13 04:30:00 EST America/New_York = P1DT0H +fd3 2010-03-14 03:30:00 EDT America/New_York - 2010-03-13 04:30:00 EST America/New_York = P0DT22H +fd4 2010-03-14 01:30:00 EST America/New_York - 2010-03-13 04:30:00 EST America/New_York = P0DT21H +fd5 2010-03-14 01:30:00 EST America/New_York - 2010-03-13 01:30:00 EST America/New_York = P1DT0H +fd6 2010-03-14 03:30:00 EDT America/New_York - 2010-03-13 03:30:00 EST America/New_York = P1DT0H +fd7 2010-03-14 03:30:00 EDT America/New_York - 2010-03-13 02:30:00 EST America/New_York = P1DT1H diff --git a/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-fs.phpt b/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-fs.phpt new file mode 100644 index 0000000000..72351d37e1 --- /dev/null +++ b/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-fs.phpt @@ -0,0 +1,67 @@ +--TEST-- +RFC: DateTime and Daylight Saving Time Transitions (zone type 3, fs) +--CREDITS-- +Daniel Convissor <danielc@php.net> +--XFAIL-- +Still not quite right +--FILE-- +<?php + +date_default_timezone_set('America/New_York'); +$date_format = 'Y-m-d H:i:s T e'; +$interval_format = 'P%dDT%hH'; + +/* + * Forward Transitions, sub(). + */ + +$end = new DateTime('2010-03-14 03:00:00'); +$interval_spec = 'PT1S'; +$interval = new DateInterval($interval_spec); +echo 'fs1 ' . $end->format($date_format) . " - $interval_spec = " + . $end->sub($interval)->format($date_format) . "\n"; + +$end = new DateTime('2010-03-14 04:30:00'); +$interval_spec = 'P1D'; +$interval = new DateInterval($interval_spec); +echo 'fs2 ' . $end->format($date_format) . " - $interval_spec = " + . $end->sub($interval)->format($date_format) . "\n"; + +$end = new DateTime('2010-03-14 03:30:00'); +$interval_spec = 'PT22H'; +$interval = new DateInterval($interval_spec); +echo 'fs3 ' . $end->format($date_format) . " - $interval_spec = " + . $end->sub($interval)->format($date_format) . "\n"; + +$end = new DateTime('2010-03-14 01:30:00'); +$interval_spec = 'PT21H'; +$interval = new DateInterval($interval_spec); +echo 'fs4 ' . $end->format($date_format) . " - $interval_spec = " + . $end->sub($interval)->format($date_format) . "\n"; + +$end = new DateTime('2010-03-14 01:30:00'); +$interval_spec = 'P1D'; +$interval = new DateInterval($interval_spec); +echo 'fs5 ' . $end->format($date_format) . " - $interval_spec = " + . $end->sub($interval)->format($date_format) . "\n"; + +$end = new DateTime('2010-03-15 03:30:00'); +$interval_spec = 'P1D'; +$interval = new DateInterval($interval_spec); +echo 'fs6 ' . $end->format($date_format) . " - $interval_spec = " + . $end->sub($interval)->format($date_format) . "\n"; + +$end = new DateTime('2010-03-15 02:30:00'); +$interval_spec = 'P1D'; +$interval = new DateInterval($interval_spec); +echo 'fs7 ' . $end->format($date_format) . " - $interval_spec = " + . $end->sub($interval)->format($date_format) . "\n"; +?> +--EXPECT-- +fs1 2010-03-14 03:00:00 EDT America/New_York - PT1S = 2010-03-14 01:59:59 EST America/New_York +fs2 2010-03-14 04:30:00 EDT America/New_York - P1D = 2010-03-13 04:30:00 EST America/New_York +fs3 2010-03-14 03:30:00 EDT America/New_York - PT22H = 2010-03-13 04:30:00 EST America/New_York +fs4 2010-03-14 01:30:00 EST America/New_York - PT21H = 2010-03-13 04:30:00 EST America/New_York +fs5 2010-03-14 01:30:00 EST America/New_York - P1D = 2010-03-13 01:30:00 EST America/New_York +fs6 2010-03-15 03:30:00 EDT America/New_York - P1D = 2010-03-14 03:30:00 EDT America/New_York +fs7 2010-03-15 02:30:00 EDT America/New_York - P1D = 2010-03-14 03:30:00 EDT America/New_York diff --git a/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3.phpt b/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3.phpt deleted file mode 100644 index 855fe4ef65..0000000000 --- a/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3.phpt +++ /dev/null @@ -1,399 +0,0 @@ ---TEST-- -RFC: DateTime and Daylight Saving Time Transitions (zone type 3) ---CREDITS-- -Daniel Convissor <danielc@php.net> ---XFAIL-- -RFC not implemented yet ---FILE-- -<?php - -date_default_timezone_set('America/New_York'); -$date_format = 'Y-m-d H:i:s T e'; -$interval_format = 'P%dDT%hH'; - -/* - * Forward Transitions, diff(). - */ - -$end = new DateTime('2010-03-14 03:00:00'); -$start = new DateTime('2010-03-14 01:59:59'); -echo 'fd1 ' . $end->format($date_format) . ' - ' . $start->format($date_format) - . ' = ' . $start->diff($end)->format('PT%hH%iM%sS') . "\n"; - -$end = new DateTime('2010-03-14 04:30:00'); -$start = new DateTime('2010-03-13 04:30:00'); -echo 'fd2 ' . $end->format($date_format) . ' - ' . $start->format($date_format) - . ' = ' . $start->diff($end)->format($interval_format) . "\n"; - -$end = new DateTime('2010-03-14 03:30:00'); -$start = new DateTime('2010-03-13 04:30:00'); -echo 'fd3 ' . $end->format($date_format) . ' - ' . $start->format($date_format) - . ' = ' . $start->diff($end)->format($interval_format) . "\n"; - -$end = new DateTime('2010-03-14 01:30:00'); -$start = new DateTime('2010-03-13 04:30:00'); -echo 'fd4 ' . $end->format($date_format) . ' - ' . $start->format($date_format) - . ' = ' . $start->diff($end)->format($interval_format) . "\n"; - -$end = new DateTime('2010-03-14 01:30:00'); -$start = new DateTime('2010-03-13 01:30:00'); -echo 'fd5 ' . $end->format($date_format) . ' - ' . $start->format($date_format) - . ' = ' . $start->diff($end)->format($interval_format) . "\n"; - -$end = new DateTime('2010-03-14 03:30:00'); -$start = new DateTime('2010-03-13 03:30:00'); -echo 'fd6 ' . $end->format($date_format) . ' - ' . $start->format($date_format) - . ' = ' . $start->diff($end)->format($interval_format) . "\n"; - -$end = new DateTime('2010-03-14 03:30:00'); -$start = new DateTime('2010-03-13 02:30:00'); -echo 'fd7 ' . $end->format($date_format) . ' - ' . $start->format($date_format) - . ' = ' . $start->diff($end)->format($interval_format) . "\n"; - -echo "\n"; - -/* - * Forward Transitions, add(). - */ - -$start = new DateTime('2010-03-14 01:59:59'); -$interval_spec = 'PT1S'; -$interval = new DateInterval($interval_spec); -echo 'fa1 ' . $start->format($date_format) . " + $interval_spec = " - . $start->add($interval)->format($date_format) . "\n"; - -$start = new DateTime('2010-03-13 04:30:00'); -$interval_spec = 'P1D'; -$interval = new DateInterval($interval_spec); -echo 'fa2 ' . $start->format($date_format) . " + $interval_spec = " - . $start->add($interval)->format($date_format) . "\n"; - -$start = new DateTime('2010-03-13 04:30:00'); -$interval_spec = 'PT22H'; -$interval = new DateInterval($interval_spec); -echo 'fa3 ' . $start->format($date_format) . " + $interval_spec = " - . $start->add($interval)->format($date_format) . "\n"; - -$start = new DateTime('2010-03-13 04:30:00'); -$interval_spec = 'PT21H'; -$interval = new DateInterval($interval_spec); -echo 'fa4 ' . $start->format($date_format) . " + $interval_spec = " - . $start->add($interval)->format($date_format) . "\n"; - -$start = new DateTime('2010-03-13 01:30:00'); -$interval_spec = 'P1D'; -$interval = new DateInterval($interval_spec); -echo 'fa5 ' . $start->format($date_format) . " + $interval_spec = " - . $start->add($interval)->format($date_format) . "\n"; - -$start = new DateTime('2010-03-13 02:30:00'); -$interval_spec = 'P1D'; -$interval = new DateInterval($interval_spec); -echo 'fa6 ' . $start->format($date_format) . " + $interval_spec = " - . $start->add($interval)->format($date_format) . "\n"; - -echo "\n"; - -/* - * Forward Transitions, sub(). - */ - -$end = new DateTime('2010-03-14 03:00:00'); -$interval_spec = 'PT1S'; -$interval = new DateInterval($interval_spec); -echo 'fs1 ' . $end->format($date_format) . " - $interval_spec = " - . $end->sub($interval)->format($date_format) . "\n"; - -$end = new DateTime('2010-03-14 04:30:00'); -$interval_spec = 'P1D'; -$interval = new DateInterval($interval_spec); -echo 'fs2 ' . $end->format($date_format) . " - $interval_spec = " - . $end->sub($interval)->format($date_format) . "\n"; - -$end = new DateTime('2010-03-14 03:30:00'); -$interval_spec = 'PT22H'; -$interval = new DateInterval($interval_spec); -echo 'fs3 ' . $end->format($date_format) . " - $interval_spec = " - . $end->sub($interval)->format($date_format) . "\n"; - -$end = new DateTime('2010-03-14 01:30:00'); -$interval_spec = 'PT21H'; -$interval = new DateInterval($interval_spec); -echo 'fs4 ' . $end->format($date_format) . " - $interval_spec = " - . $end->sub($interval)->format($date_format) . "\n"; - -$end = new DateTime('2010-03-14 01:30:00'); -$interval_spec = 'P1D'; -$interval = new DateInterval($interval_spec); -echo 'fs5 ' . $end->format($date_format) . " - $interval_spec = " - . $end->sub($interval)->format($date_format) . "\n"; - -$end = new DateTime('2010-03-15 03:30:00'); -$interval_spec = 'P1D'; -$interval = new DateInterval($interval_spec); -echo 'fs6 ' . $end->format($date_format) . " - $interval_spec = " - . $end->sub($interval)->format($date_format) . "\n"; - -$end = new DateTime('2010-03-15 02:30:00'); -$interval_spec = 'P1D'; -$interval = new DateInterval($interval_spec); -echo 'fs7 ' . $end->format($date_format) . " - $interval_spec = " - . $end->sub($interval)->format($date_format) . "\n"; - -echo "\n"; - - -/* - * For backward transitions, must create objects with zone type 2 - * where specifying Daylight or Standard time is required - * then converting them to zone type 3. - */ - -$tz = new DateTimeZone('America/New_York'); - -/* - * Backward Transitions, diff(). - */ - -$end = new DateTime('2010-11-07 01:00:00 EST'); -$end->setTimeZone($tz); -$start = new DateTime('2010-11-07 01:59:59'); -echo 'bd1 ' . $end->format($date_format) . ' - ' . $start->format($date_format) - . ' = ' . $start->diff($end)->format('PT%hH%iM%sS') . "\n"; - -$end = new DateTime('2010-11-07 04:30:00'); -$start = new DateTime('2010-11-06 04:30:00'); -echo 'bd2 ' . $end->format($date_format) . ' - ' . $start->format($date_format) - . ' = ' . $start->diff($end)->format($interval_format) . "\n"; - -$end = new DateTime('2010-11-07 03:30:00'); -$start = new DateTime('2010-11-06 04:30:00'); -echo 'bd3 ' . $end->format($date_format) . ' - ' . $start->format($date_format) - . ' = ' . $start->diff($end)->format($interval_format) . "\n"; - -$end = new DateTime('2010-11-07 02:30:00'); -$start = new DateTime('2010-11-06 04:30:00'); -echo 'bd4 ' . $end->format($date_format) . ' - ' . $start->format($date_format) - . ' = ' . $start->diff($end)->format($interval_format) . "\n"; - -$end = new DateTime('2010-11-07 01:30:00 EST'); -$end->setTimeZone($tz); -$start = new DateTime('2010-11-06 04:30:00'); -echo 'bd5 ' . $end->format($date_format) . ' - ' . $start->format($date_format) - . ' = ' . $start->diff($end)->format($interval_format) . "\n"; - -$end = new DateTime('2010-11-07 01:30:00 EDT'); -$end->setTimeZone($tz); -$start = new DateTime('2010-11-06 04:30:00'); -echo 'bd6 ' . $end->format($date_format) . ' - ' . $start->format($date_format) - . ' = ' . $start->diff($end)->format($interval_format) . "\n"; - -$end = new DateTime('2010-11-07 01:30:00'); -$start = new DateTime('2010-11-06 01:30:00'); -echo 'bd7 ' . $end->format($date_format) . ' - ' . $start->format($date_format) - . ' = ' . $start->diff($end)->format($interval_format) . "\n"; - -$end = new DateTime('2010-11-07 01:30:00 EST'); -$end->setTimeZone($tz); -$start = new DateTime('2010-11-06 01:30:00'); -echo 'bd8 ' . $end->format($date_format) . ' - ' . $start->format($date_format) - . ' = ' . $start->diff($end)->format($interval_format) . "\n"; - -echo "\n"; - -/* - * Backward Transitions, add(). - */ - -$start = new DateTime('2010-11-07 01:59:59'); -$interval_spec = 'PT1S'; -$interval = new DateInterval($interval_spec); -echo 'ba1 ' . $start->format($date_format) . " + $interval_spec = " - . $start->add($interval)->format($date_format) . "\n"; - -$start = new DateTime('2010-11-06 04:30:00'); -$interval_spec = 'P1D'; -$interval = new DateInterval($interval_spec); -echo 'ba2 ' . $start->format($date_format) . " + $interval_spec = " - . $start->add($interval)->format($date_format) . "\n"; - -$start = new DateTime('2010-11-06 04:30:00'); -$interval_spec = 'PT24H'; -$interval = new DateInterval($interval_spec); -echo 'ba3 ' . $start->format($date_format) . " + $interval_spec = " - . $start->add($interval)->format($date_format) . "\n"; - -$start = new DateTime('2010-11-06 04:30:00'); -$interval_spec = 'PT23H'; -$interval = new DateInterval($interval_spec); -echo 'ba4 ' . $start->format($date_format) . " + $interval_spec = " - . $start->add($interval)->format($date_format) . "\n"; - -$start = new DateTime('2010-11-06 04:30:00'); -$interval_spec = 'PT22H'; -$interval = new DateInterval($interval_spec); -echo 'ba5 ' . $start->format($date_format) . " + $interval_spec = " - . $start->add($interval)->format($date_format) . "\n"; - -$start = new DateTime('2010-11-06 04:30:00'); -$interval_spec = 'PT21H'; -$interval = new DateInterval($interval_spec); -echo 'ba6 ' . $start->format($date_format) . " + $interval_spec = " - . $start->add($interval)->format($date_format) . "\n"; - -$start = new DateTime('2010-11-06 01:30:00'); -$interval_spec = 'P1D'; -$interval = new DateInterval($interval_spec); -echo 'ba7 ' . $start->format($date_format) . " + $interval_spec = " - . $start->add($interval)->format($date_format) . "\n"; - -$start = new DateTime('2010-11-06 01:30:00'); -$interval_spec = 'P1DT1H'; -$interval = new DateInterval($interval_spec); -echo 'ba8 ' . $start->format($date_format) . " + $interval_spec = " - . $start->add($interval)->format($date_format) . "\n"; - -$start = new DateTime('2010-11-06 04:30:00'); -$interval_spec = 'PT25H'; -$interval = new DateInterval($interval_spec); -echo 'ba9 ' . $start->format($date_format) . " + $interval_spec = " - . $start->add($interval)->format($date_format) . "\n"; - -$start = new DateTime('2010-11-06 03:30:00'); -$interval_spec = 'P1D'; -$interval = new DateInterval($interval_spec); -echo 'ba10 ' . $start->format($date_format) . " + $interval_spec = " - . $start->add($interval)->format($date_format) . "\n"; - -$start = new DateTime('2010-11-06 02:30:00'); -$interval_spec = 'P1D'; -$interval = new DateInterval($interval_spec); -echo 'ba11 ' . $start->format($date_format) . " + $interval_spec = " - . $start->add($interval)->format($date_format) . "\n"; - -echo "\n"; - -/* - * Backward Transitions, sub(). - */ - -$end = new DateTime('2010-11-07 01:00:00 EST'); -$end->setTimeZone($tz); -$interval_spec = 'PT1S'; -$interval = new DateInterval($interval_spec); -echo 'bs1 ' . $end->format($date_format) . " - $interval_spec = " - . $end->sub($interval)->format($date_format) . "\n"; - -$end = new DateTime('2010-11-07 04:30:00'); -$interval_spec = 'P1D'; -$interval = new DateInterval($interval_spec); -echo 'bs2 ' . $end->format($date_format) . " - $interval_spec = " - . $end->sub($interval)->format($date_format) . "\n"; - -$end = new DateTime('2010-11-07 03:30:00'); -$interval_spec = 'PT24H'; -$interval = new DateInterval($interval_spec); -echo 'bs3 ' . $end->format($date_format) . " - $interval_spec = " - . $end->sub($interval)->format($date_format) . "\n"; - -$end = new DateTime('2010-11-07 02:30:00'); -$interval_spec = 'PT23H'; -$interval = new DateInterval($interval_spec); -echo 'bs4 ' . $end->format($date_format) . " - $interval_spec = " - . $end->sub($interval)->format($date_format) . "\n"; - -$end = new DateTime('2010-11-07 01:30:00 EST'); -$end->setTimeZone($tz); -$interval_spec = 'PT22H'; -$interval = new DateInterval($interval_spec); -echo 'bs5 ' . $end->format($date_format) . " - $interval_spec = " - . $end->sub($interval)->format($date_format) . "\n"; - -$end = new DateTime('2010-11-07 01:30:00 EDT'); -$end->setTimeZone($tz); -$interval_spec = 'PT21H'; -$interval = new DateInterval($interval_spec); -echo 'bs6 ' . $end->format($date_format) . " - $interval_spec = " - . $end->sub($interval)->format($date_format) . "\n"; - -$end = new DateTime('2010-11-07 01:30:00'); -$interval_spec = 'P1D'; -$interval = new DateInterval($interval_spec); -echo 'bs7 ' . $end->format($date_format) . " - $interval_spec = " - . $end->sub($interval)->format($date_format) . "\n"; - -$end = new DateTime('2010-11-07 01:30:00 EST'); -$end->setTimeZone($tz); -$interval_spec = 'P1DT1H'; -$interval = new DateInterval($interval_spec); -echo 'bs8 ' . $end->format($date_format) . " - $interval_spec = " - . $end->sub($interval)->format($date_format) . "\n"; - -$end = new DateTime('2010-11-07 03:30:00'); -$interval_spec = 'P1D'; -$interval = new DateInterval($interval_spec); -echo 'bs9 ' . $end->format($date_format) . " - $interval_spec = " - . $end->sub($interval)->format($date_format) . "\n"; - -$end = new DateTime('2010-11-07 02:30:00'); -$interval_spec = 'P1D'; -$interval = new DateInterval($interval_spec); -echo 'bs10 ' . $end->format($date_format) . " - $interval_spec = " - . $end->sub($interval)->format($date_format) . "\n"; - -?> ---EXPECT-- -fd1 2010-03-14 03:00:00 EDT America/New_York - 2010-03-14 01:59:59 EST America/New_York = PT0H0M1S -fd2 2010-03-14 04:30:00 EDT America/New_York - 2010-03-13 04:30:00 EST America/New_York = P1DT0H -fd3 2010-03-14 03:30:00 EDT America/New_York - 2010-03-13 04:30:00 EST America/New_York = P0DT22H -fd4 2010-03-14 01:30:00 EST America/New_York - 2010-03-13 04:30:00 EST America/New_York = P0DT21H -fd5 2010-03-14 01:30:00 EST America/New_York - 2010-03-13 01:30:00 EST America/New_York = P1DT0H -fd6 2010-03-14 03:30:00 EDT America/New_York - 2010-03-13 03:30:00 EST America/New_York = P1DT0H -fd7 2010-03-14 03:30:00 EDT America/New_York - 2010-03-13 02:30:00 EST America/New_York = P1DT1H - -fa1 2010-03-14 01:59:59 EST America/New_York + PT1S = 2010-03-14 03:00:00 EDT America/New_York -fa2 2010-03-13 04:30:00 EST America/New_York + P1D = 2010-03-14 04:30:00 EDT America/New_York -fa3 2010-03-13 04:30:00 EST America/New_York + PT22H = 2010-03-14 03:30:00 EDT America/New_York -fa4 2010-03-13 04:30:00 EST America/New_York + PT21H = 2010-03-14 01:30:00 EST America/New_York -fa5 2010-03-13 01:30:00 EST America/New_York + P1D = 2010-03-14 01:30:00 EST America/New_York -fa6 2010-03-13 02:30:00 EST America/New_York + P1D = 2010-03-14 03:30:00 EDT America/New_York - -fs1 2010-03-14 03:00:00 EDT America/New_York - PT1S = 2010-03-14 01:59:59 EST America/New_York -fs2 2010-03-14 04:30:00 EDT America/New_York - P1D = 2010-03-13 04:30:00 EST America/New_York -fs3 2010-03-14 03:30:00 EDT America/New_York - PT22H = 2010-03-13 04:30:00 EST America/New_York -fs4 2010-03-14 01:30:00 EST America/New_York - PT21H = 2010-03-13 04:30:00 EST America/New_York -fs5 2010-03-14 01:30:00 EST America/New_York - P1D = 2010-03-13 01:30:00 EST America/New_York -fs6 2010-03-15 03:30:00 EDT America/New_York - P1D = 2010-03-14 03:30:00 EDT America/New_York -fs7 2010-03-15 03:30:00 EDT America/New_York - P1D = 2010-03-14 03:30:00 EDT America/New_York - -bd1 2010-11-07 01:00:00 EST America/New_York - 2010-11-07 01:59:59 EDT America/New_York = PT0H0M1S -bd2 2010-11-07 04:30:00 EST America/New_York - 2010-11-06 04:30:00 EDT America/New_York = P1DT0H -bd3 2010-11-07 03:30:00 EST America/New_York - 2010-11-06 04:30:00 EDT America/New_York = P0DT24H -bd4 2010-11-07 02:30:00 EST America/New_York - 2010-11-06 04:30:00 EDT America/New_York = P0DT23H -bd5 2010-11-07 01:30:00 EST America/New_York - 2010-11-06 04:30:00 EDT America/New_York = P0DT22H -bd6 2010-11-07 01:30:00 EDT America/New_York - 2010-11-06 04:30:00 EDT America/New_York = P0DT21H -bd7 2010-11-07 01:30:00 EDT America/New_York - 2010-11-06 01:30:00 EDT America/New_York = P1DT0H -bd8 2010-11-07 01:30:00 EST America/New_York - 2010-11-06 01:30:00 EDT America/New_York = P1DT1H - -ba1 2010-11-07 01:59:59 EDT America/New_York + PT1S = 2010-11-07 01:00:00 EST America/New_York -ba2 2010-11-06 04:30:00 EDT America/New_York + P1D = 2010-11-07 04:30:00 EST America/New_York -ba3 2010-11-06 04:30:00 EDT America/New_York + PT24H = 2010-11-07 03:30:00 EST America/New_York -ba4 2010-11-06 04:30:00 EDT America/New_York + PT23H = 2010-11-07 02:30:00 EST America/New_York -ba5 2010-11-06 04:30:00 EDT America/New_York + PT22H = 2010-11-07 01:30:00 EST America/New_York -ba6 2010-11-06 04:30:00 EDT America/New_York + PT21H = 2010-11-07 01:30:00 EDT America/New_York -ba7 2010-11-06 01:30:00 EDT America/New_York + P1D = 2010-11-07 01:30:00 EDT America/New_York -ba8 2010-11-06 01:30:00 EDT America/New_York + P1DT1H = 2010-11-07 01:30:00 EST America/New_York -ba9 2010-11-06 04:30:00 EDT America/New_York + PT25H = 2010-11-07 04:30:00 EST America/New_York -ba10 2010-11-06 03:30:00 EDT America/New_York + P1D = 2010-11-07 03:30:00 EST America/New_York -ba11 2010-11-06 02:30:00 EDT America/New_York + P1D = 2010-11-07 02:30:00 EST America/New_York - -bs1 2010-11-07 01:00:00 EST America/New_York - PT1S = 2010-11-07 01:59:59 EDT America/New_York -bs2 2010-11-07 04:30:00 EST America/New_York - P1D = 2010-11-06 04:30:00 EDT America/New_York -bs3 2010-11-07 03:30:00 EST America/New_York - PT24H = 2010-11-06 04:30:00 EDT America/New_York -bs4 2010-11-07 02:30:00 EST America/New_York - PT23H = 2010-11-06 04:30:00 EDT America/New_York -bs5 2010-11-07 01:30:00 EST America/New_York - PT22H = 2010-11-06 04:30:00 EDT America/New_York -bs6 2010-11-07 01:30:00 EDT America/New_York - PT21H = 2010-11-06 04:30:00 EDT America/New_York -bs7 2010-11-07 01:30:00 EDT America/New_York - P1D = 2010-11-06 01:30:00 EDT America/New_York -bs8 2010-11-07 01:30:00 EST America/New_York - P1DT1H = 2010-11-06 00:30:00 EDT America/New_York -bs9 2010-11-07 03:30:00 EST America/New_York - P1D = 2010-11-06 03:30:00 EDT America/New_York -bs10 2010-11-07 02:30:00 EST America/New_York - P1D = 2010-11-06 02:30:00 EDT America/New_York diff --git a/ext/date/tests/strtotime3-64bit.phpt b/ext/date/tests/strtotime3-64bit.phpt index 7dc0816359..3a47659f86 100644 --- a/ext/date/tests/strtotime3-64bit.phpt +++ b/ext/date/tests/strtotime3-64bit.phpt @@ -53,7 +53,7 @@ bool(false) string(31) "Fri, 16 Jun 2006 23:49:12 +0100" bool(false) string(31) "Fri, 16 Jun 2006 02:22:00 +0100" -string(31) "Mon, 16 Jun 0222 02:22:00 -0036" +string(31) "Sun, 16 Jun 0222 02:22:00 -0036" string(31) "Fri, 16 Jun 2006 02:22:33 +0100" bool(false) string(31) "Tue, 02 Mar 2004 00:00:00 +0000" diff --git a/ext/date/tests/test-parse-from-format.phpt b/ext/date/tests/test-parse-from-format.phpt index 2bf9c4e1b8..5bb5fe5325 100644 --- a/ext/date/tests/test-parse-from-format.phpt +++ b/ext/date/tests/test-parse-from-format.phpt @@ -32,8 +32,8 @@ object(DateTime)#2 (3) { string(6) "+02:00" } -string(16) "l, d-M-y H:i:s T" -string(36) "Tuesday, 08-Jul-08 22:14:12 GMT+0200" +string(16) "l, d-M-Y H:i:s T" +string(38) "Tuesday, 08-Jul-2008 22:14:12 GMT+0200" object(DateTime)#1 (3) { ["date"]=> string(19) "2008-07-08 22:14:12" diff --git a/ext/dba/dba.c b/ext/dba/dba.c index ced90f0c62..9df7f34001 100644 --- a/ext/dba/dba.c +++ b/ext/dba/dba.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/dba/dba_cdb.c b/ext/dba/dba_cdb.c index a4a7314e8a..075aedb0c1 100644 --- a/ext/dba/dba_cdb.c +++ b/ext/dba/dba_cdb.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/dba/dba_db1.c b/ext/dba/dba_db1.c index fbb24d27bb..a8221b9562 100644 --- a/ext/dba/dba_db1.c +++ b/ext/dba/dba_db1.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/dba/dba_db2.c b/ext/dba/dba_db2.c index d92613a25b..b6879ca730 100644 --- a/ext/dba/dba_db2.c +++ b/ext/dba/dba_db2.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/dba/dba_db3.c b/ext/dba/dba_db3.c index b236865bd0..e248be8e28 100644 --- a/ext/dba/dba_db3.c +++ b/ext/dba/dba_db3.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/dba/dba_db4.c b/ext/dba/dba_db4.c index 8987f1a4be..7f9dfed7ab 100644 --- a/ext/dba/dba_db4.c +++ b/ext/dba/dba_db4.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/dba/dba_dbm.c b/ext/dba/dba_dbm.c index 2f3b800a31..c18c04f77e 100644 --- a/ext/dba/dba_dbm.c +++ b/ext/dba/dba_dbm.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/dba/dba_flatfile.c b/ext/dba/dba_flatfile.c index 082aa5cdb6..aa99d01283 100644 --- a/ext/dba/dba_flatfile.c +++ b/ext/dba/dba_flatfile.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/dba/dba_gdbm.c b/ext/dba/dba_gdbm.c index 7534568d39..d8ca97e209 100644 --- a/ext/dba/dba_gdbm.c +++ b/ext/dba/dba_gdbm.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/dba/dba_inifile.c b/ext/dba/dba_inifile.c index e1359b65e9..5ca5d302bc 100644 --- a/ext/dba/dba_inifile.c +++ b/ext/dba/dba_inifile.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/dba/dba_ndbm.c b/ext/dba/dba_ndbm.c index 8b5bbda851..bad6385708 100644 --- a/ext/dba/dba_ndbm.c +++ b/ext/dba/dba_ndbm.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/dba/dba_qdbm.c b/ext/dba/dba_qdbm.c index 485b1997e6..4e5d69dfa2 100644 --- a/ext/dba/dba_qdbm.c +++ b/ext/dba/dba_qdbm.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/dba/dba_tcadb.c b/ext/dba/dba_tcadb.c index 082a1ae250..341e99fed6 100644 --- a/ext/dba/dba_tcadb.c +++ b/ext/dba/dba_tcadb.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/dba/libcdb/cdb.c b/ext/dba/libcdb/cdb.c index bc4ee08831..d8c58372ba 100644 --- a/ext/dba/libcdb/cdb.c +++ b/ext/dba/libcdb/cdb.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/dba/libcdb/cdb.h b/ext/dba/libcdb/cdb.h index 5be8ec4778..c6ffd17949 100644 --- a/ext/dba/libcdb/cdb.h +++ b/ext/dba/libcdb/cdb.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/dba/libcdb/cdb_make.c b/ext/dba/libcdb/cdb_make.c index 154118c152..2813336b40 100644 --- a/ext/dba/libcdb/cdb_make.c +++ b/ext/dba/libcdb/cdb_make.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/dba/libcdb/cdb_make.h b/ext/dba/libcdb/cdb_make.h index 5bb0ddf5b2..d43fceb6d8 100644 --- a/ext/dba/libcdb/cdb_make.h +++ b/ext/dba/libcdb/cdb_make.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/dba/libcdb/uint32.c b/ext/dba/libcdb/uint32.c index 803a3d5fd7..d8152d5015 100644 --- a/ext/dba/libcdb/uint32.c +++ b/ext/dba/libcdb/uint32.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/dba/libcdb/uint32.h b/ext/dba/libcdb/uint32.h index ac44f05d7d..b0e0b44002 100644 --- a/ext/dba/libcdb/uint32.h +++ b/ext/dba/libcdb/uint32.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/dba/libflatfile/flatfile.c b/ext/dba/libflatfile/flatfile.c index 6ce2f616c8..a1fce218ab 100644 --- a/ext/dba/libflatfile/flatfile.c +++ b/ext/dba/libflatfile/flatfile.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/dba/libflatfile/flatfile.h b/ext/dba/libflatfile/flatfile.h index b8fbeddc9c..7e9b1796cd 100644 --- a/ext/dba/libflatfile/flatfile.h +++ b/ext/dba/libflatfile/flatfile.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/dba/libinifile/inifile.c b/ext/dba/libinifile/inifile.c index 3cd97702b3..0dd17da31e 100644 --- a/ext/dba/libinifile/inifile.c +++ b/ext/dba/libinifile/inifile.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/dba/libinifile/inifile.h b/ext/dba/libinifile/inifile.h index 5a25573892..1177610185 100644 --- a/ext/dba/libinifile/inifile.h +++ b/ext/dba/libinifile/inifile.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/dba/php_dba.h b/ext/dba/php_dba.h index 1e931dfe48..6b21b06ee6 100644 --- a/ext/dba/php_dba.h +++ b/ext/dba/php_dba.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/dba/php_tcadb.h b/ext/dba/php_tcadb.h index 6aa9aa7f8b..b718a172f8 100644 --- a/ext/dba/php_tcadb.h +++ b/ext/dba/php_tcadb.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/dom/attr.c b/ext/dom/attr.c index d45ca8820a..ebbc41f6f5 100644 --- a/ext/dom/attr.c +++ b/ext/dom/attr.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/dom/cdatasection.c b/ext/dom/cdatasection.c index dc8a3f1492..6ca1ffcf0c 100644 --- a/ext/dom/cdatasection.c +++ b/ext/dom/cdatasection.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/dom/characterdata.c b/ext/dom/characterdata.c index 3b1f9b136b..92eb280159 100644 --- a/ext/dom/characterdata.c +++ b/ext/dom/characterdata.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/dom/comment.c b/ext/dom/comment.c index 017c2ba78f..eb181ec454 100644 --- a/ext/dom/comment.c +++ b/ext/dom/comment.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/dom/document.c b/ext/dom/document.c index d17c7cbd55..19acff7468 100644 --- a/ext/dom/document.c +++ b/ext/dom/document.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | @@ -2296,7 +2296,7 @@ PHP_FUNCTION(dom_document_save_html) xmlBufferPtr buf; dom_object *intern, *nodeobj; xmlChar *mem = NULL; - int size, format; + int size = 0, format; dom_doc_propsptr doc_props; if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), @@ -2324,7 +2324,22 @@ PHP_FUNCTION(dom_document_save_html) RETURN_FALSE; } - size = htmlNodeDump(buf, docp, node); + if (node->type == XML_DOCUMENT_FRAG_NODE) { + int one_size; + + for (node = node->children; node; node = node->next) { + one_size = htmlNodeDump(buf, docp, node); + + if (one_size >= 0) { + size += one_size; + } else { + size = -1; + break; + } + } + } else { + size = htmlNodeDump(buf, docp, node); + } if (size >= 0) { mem = (xmlChar*) xmlBufferContent(buf); if (!mem) { diff --git a/ext/dom/documentfragment.c b/ext/dom/documentfragment.c index 4e8d660c9b..e99f57151f 100644 --- a/ext/dom/documentfragment.c +++ b/ext/dom/documentfragment.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/dom/documenttype.c b/ext/dom/documenttype.c index 570999a50e..a94cc31d74 100644 --- a/ext/dom/documenttype.c +++ b/ext/dom/documenttype.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/dom/dom_ce.h b/ext/dom/dom_ce.h index 8caf0021a1..0e1002536e 100644 --- a/ext/dom/dom_ce.h +++ b/ext/dom/dom_ce.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/dom/dom_fe.h b/ext/dom/dom_fe.h index 3778c95208..b05c4aee42 100644 --- a/ext/dom/dom_fe.h +++ b/ext/dom/dom_fe.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/dom/dom_iterators.c b/ext/dom/dom_iterators.c index f4183d2f9a..f5772e5a99 100644 --- a/ext/dom/dom_iterators.c +++ b/ext/dom/dom_iterators.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/dom/dom_properties.h b/ext/dom/dom_properties.h index 8482502411..a658b1d843 100644 --- a/ext/dom/dom_properties.h +++ b/ext/dom/dom_properties.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/dom/domconfiguration.c b/ext/dom/domconfiguration.c index 4092d73b37..272fda8f8f 100644 --- a/ext/dom/domconfiguration.c +++ b/ext/dom/domconfiguration.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/dom/domerror.c b/ext/dom/domerror.c index 92b6622176..cf0eb8da69 100644 --- a/ext/dom/domerror.c +++ b/ext/dom/domerror.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/dom/domerrorhandler.c b/ext/dom/domerrorhandler.c index 7af3723230..78b75fe615 100644 --- a/ext/dom/domerrorhandler.c +++ b/ext/dom/domerrorhandler.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/dom/domexception.c b/ext/dom/domexception.c index 9aa878a028..b41b83c6cd 100644 --- a/ext/dom/domexception.c +++ b/ext/dom/domexception.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/dom/domimplementation.c b/ext/dom/domimplementation.c index 5a32c60dd8..8cdd0fe28b 100644 --- a/ext/dom/domimplementation.c +++ b/ext/dom/domimplementation.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/dom/domimplementationlist.c b/ext/dom/domimplementationlist.c index d89d2ff143..fde89b7d94 100644 --- a/ext/dom/domimplementationlist.c +++ b/ext/dom/domimplementationlist.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/dom/domimplementationsource.c b/ext/dom/domimplementationsource.c index 2fb5887635..2e8a8d81b2 100644 --- a/ext/dom/domimplementationsource.c +++ b/ext/dom/domimplementationsource.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/dom/domlocator.c b/ext/dom/domlocator.c index 88c352b3bf..93cd580a01 100644 --- a/ext/dom/domlocator.c +++ b/ext/dom/domlocator.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/dom/domstringlist.c b/ext/dom/domstringlist.c index d2ab606d21..f036fbbdd6 100644 --- a/ext/dom/domstringlist.c +++ b/ext/dom/domstringlist.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/dom/element.c b/ext/dom/element.c index 606a23f9cb..b570471b7d 100644 --- a/ext/dom/element.c +++ b/ext/dom/element.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/dom/entity.c b/ext/dom/entity.c index 18e86fceb5..803bb70eec 100644 --- a/ext/dom/entity.c +++ b/ext/dom/entity.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/dom/entityreference.c b/ext/dom/entityreference.c index 4ef526c7e1..f2fe3945da 100644 --- a/ext/dom/entityreference.c +++ b/ext/dom/entityreference.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/dom/namednodemap.c b/ext/dom/namednodemap.c index 07d7c7002f..d3c8cee558 100644 --- a/ext/dom/namednodemap.c +++ b/ext/dom/namednodemap.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/dom/namelist.c b/ext/dom/namelist.c index 5831ddeeea..57e6f5d37c 100644 --- a/ext/dom/namelist.c +++ b/ext/dom/namelist.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/dom/node.c b/ext/dom/node.c index 32795671df..ae74ea04cf 100644 --- a/ext/dom/node.c +++ b/ext/dom/node.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/dom/nodelist.c b/ext/dom/nodelist.c index d856f1452a..1a0c811185 100644 --- a/ext/dom/nodelist.c +++ b/ext/dom/nodelist.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/dom/notation.c b/ext/dom/notation.c index 1fdfe89f76..4c0258cc1f 100644 --- a/ext/dom/notation.c +++ b/ext/dom/notation.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/dom/php_dom.c b/ext/dom/php_dom.c index bd9c98756b..dda638abd0 100644 --- a/ext/dom/php_dom.c +++ b/ext/dom/php_dom.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/dom/php_dom.h b/ext/dom/php_dom.h index 3559c4bb5e..f2bccf7b87 100644 --- a/ext/dom/php_dom.h +++ b/ext/dom/php_dom.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/dom/processinginstruction.c b/ext/dom/processinginstruction.c index 976b693deb..5a415efc80 100644 --- a/ext/dom/processinginstruction.c +++ b/ext/dom/processinginstruction.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/dom/string_extend.c b/ext/dom/string_extend.c index 2c47362fd1..3d65a84bad 100644 --- a/ext/dom/string_extend.c +++ b/ext/dom/string_extend.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/dom/tests/bug65196.phpt b/ext/dom/tests/bug65196.phpt new file mode 100644 index 0000000000..c77f97222f --- /dev/null +++ b/ext/dom/tests/bug65196.phpt @@ -0,0 +1,26 @@ +--TEST-- +bug #65196 (Passing DOMDocumentFragment to DOMDocument::saveHTML() Produces invalid Markup) +--SKIPIF-- +<?php +extension_loaded("dom") or die("skip need ext/dom"); +?> +--FILE-- +<?php +$dom = new DOMDocument(); + +$frag1 = $dom->createDocumentFragment(); +var_dump($dom->saveHTML($frag1)); + +$frag2 = $dom->createDocumentFragment(); +$div = $dom->createElement('div'); +$div->appendChild($dom->createElement('span')); +$frag2->appendChild($div); +$frag2->appendChild($dom->createElement('div')); +$frag2->appendChild($dom->createElement('div')); +var_dump($dom->saveHTML($frag2)); +?> +===DONE=== +--EXPECT-- +string(0) "" +string(46) "<div><span></span></div><div></div><div></div>" +===DONE=== diff --git a/ext/dom/text.c b/ext/dom/text.c index f608997050..212d040873 100644 --- a/ext/dom/text.c +++ b/ext/dom/text.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/dom/typeinfo.c b/ext/dom/typeinfo.c index bc0e60837e..3742780ab7 100644 --- a/ext/dom/typeinfo.c +++ b/ext/dom/typeinfo.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/dom/userdatahandler.c b/ext/dom/userdatahandler.c index d368a2957b..6bddff6e73 100644 --- a/ext/dom/userdatahandler.c +++ b/ext/dom/userdatahandler.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/dom/xml_common.h b/ext/dom/xml_common.h index 87a41c5305..61d9854e1d 100644 --- a/ext/dom/xml_common.h +++ b/ext/dom/xml_common.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/dom/xpath.c b/ext/dom/xpath.c index d12ef30323..a7540ba38d 100644 --- a/ext/dom/xpath.c +++ b/ext/dom/xpath.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/enchant/enchant.c b/ext/enchant/enchant.c index 98b5c9fd87..6de2feac80 100644 --- a/ext/enchant/enchant.c +++ b/ext/enchant/enchant.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.0 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/enchant/php_enchant.h b/ext/enchant/php_enchant.h index 604c47937e..2024effa6a 100644 --- a/ext/enchant/php_enchant.h +++ b/ext/enchant/php_enchant.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 4 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.0 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/ereg/ereg.c b/ext/ereg/ereg.c index 76f5c1b765..20f967feb9 100644 --- a/ext/ereg/ereg.c +++ b/ext/ereg/ereg.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/ereg/php_ereg.h b/ext/ereg/php_ereg.h index d733d5087d..d34d19855f 100644 --- a/ext/ereg/php_ereg.h +++ b/ext/ereg/php_ereg.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/ereg/php_regex.h b/ext/ereg/php_regex.h index 53b92da69a..bb83b89fc9 100644 --- a/ext/ereg/php_regex.h +++ b/ext/ereg/php_regex.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/exif/exif.c b/ext/exif/exif.c index 2fe54f7b31..38907b4d94 100644 --- a/ext/exif/exif.c +++ b/ext/exif/exif.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | @@ -2852,7 +2852,12 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha offset_val = php_ifd_get32u(dir_entry+8, ImageInfo->motorola_intel); /* If its bigger than 4 bytes, the dir entry contains an offset. */ value_ptr = offset_base+offset_val; - if (byte_count > IFDlength || offset_val > IFDlength-byte_count || value_ptr < dir_entry) { + /* + dir_entry is ImageInfo->file.list[sn].data+2+i*12 + offset_base is ImageInfo->file.list[sn].data-dir_offset + dir_entry - offset_base is dir_offset+2+i*12 + */ + if (byte_count > IFDlength || offset_val > IFDlength-byte_count || value_ptr < dir_entry || offset_val < (size_t)(dir_entry-offset_base)) { /* It is important to check for IMAGE_FILETYPE_TIFF * JPEG does not use absolute pointers instead its pointers are * relative to the start of the TIFF header in APP1 section. */ diff --git a/ext/exif/php_exif.h b/ext/exif/php_exif.h index 5b624e0e56..e0326752e6 100644 --- a/ext/exif/php_exif.h +++ b/ext/exif/php_exif.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/fileinfo/fileinfo.c b/ext/fileinfo/fileinfo.c index 353adb98b9..2d523ab498 100644 --- a/ext/fileinfo/fileinfo.c +++ b/ext/fileinfo/fileinfo.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.0 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/fileinfo/libmagic.patch b/ext/fileinfo/libmagic.patch index 97e771e920..c5d40e9657 100644 --- a/ext/fileinfo/libmagic.patch +++ b/ext/fileinfo/libmagic.patch @@ -1,6 +1,6 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c ---- libmagic.orig/apprentice.c 2013-03-21 18:45:14.000000000 +0100 -+++ libmagic/apprentice.c 2013-04-27 13:53:32.175250261 +0200 +--- libmagic.orig/apprentice.c Thu Mar 21 18:45:14 2013 ++++ libmagic/apprentice.c Fri May 3 15:19:35 2013 @@ -29,6 +29,8 @@ * apprentice - make one pass through /etc/magic, learning its secrets. */ @@ -830,8 +830,8 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c m->str_flags = swap4(m->str_flags); } diff -u libmagic.orig/ascmagic.c libmagic/ascmagic.c ---- libmagic.orig/ascmagic.c 2012-10-31 18:03:01.000000000 +0100 -+++ libmagic/ascmagic.c 2013-04-08 15:42:57.328298809 +0200 +--- libmagic.orig/ascmagic.c Wed Oct 31 18:03:01 2012 ++++ libmagic/ascmagic.c Tue Feb 18 18:44:17 2014 @@ -139,7 +139,7 @@ /* malloc size is a conservative overestimate; could be improved, or at least realloced after conversion. */ @@ -841,6 +841,15 @@ diff -u libmagic.orig/ascmagic.c libmagic/ascmagic.c file_oomem(ms, mlen); goto done; } +@@ -147,7 +147,7 @@ + == NULL) + goto done; + if ((rv = file_softmagic(ms, utf8_buf, +- (size_t)(utf8_end - utf8_buf), TEXTTEST, text)) == 0) ++ (size_t)(utf8_end - utf8_buf), 0, TEXTTEST, text)) == 0) + rv = -1; + } + @@ -211,6 +211,7 @@ case 0: if (file_printf(ms, ", ") == -1) @@ -860,8 +869,8 @@ diff -u libmagic.orig/ascmagic.c libmagic/ascmagic.c return rv; } diff -u libmagic.orig/cdf.c libmagic/cdf.c ---- libmagic.orig/cdf.c 2013-03-21 18:45:14.000000000 +0100 -+++ libmagic/cdf.c 2013-04-08 15:42:57.328298809 +0200 +--- libmagic.orig/cdf.c Thu Mar 21 18:45:14 2013 ++++ libmagic/cdf.c Sun Apr 7 22:30:22 2013 @@ -43,7 +43,17 @@ #include <err.h> #endif @@ -923,8 +932,8 @@ diff -u libmagic.orig/cdf.c libmagic/cdf.c (void)fprintf(stderr, "timestamp %s\n", buf); } else { diff -u libmagic.orig/cdf.h libmagic/cdf.h ---- libmagic.orig/cdf.h 2012-10-31 18:03:01.000000000 +0100 -+++ libmagic/cdf.h 2013-04-08 15:42:57.328298809 +0200 +--- libmagic.orig/cdf.h Wed Oct 31 18:03:01 2012 ++++ libmagic/cdf.h Sun Apr 7 22:30:22 2013 @@ -35,10 +35,12 @@ #ifndef _H_CDF_ #define _H_CDF_ @@ -966,8 +975,8 @@ diff -u libmagic.orig/cdf.h libmagic/cdf.h void cdf_swap_header(cdf_header_t *); void cdf_unpack_header(cdf_header_t *, char *); diff -u libmagic.orig/cdf_time.c libmagic/cdf_time.c ---- libmagic.orig/cdf_time.c 2012-10-31 18:03:01.000000000 +0100 -+++ libmagic/cdf_time.c 2013-04-08 15:42:57.328298809 +0200 +--- libmagic.orig/cdf_time.c Wed Oct 31 18:03:01 2012 ++++ libmagic/cdf_time.c Sun Apr 7 22:30:22 2013 @@ -96,7 +96,7 @@ } @@ -1026,8 +1035,8 @@ diff -u libmagic.orig/cdf_time.c libmagic/cdf_time.c static const cdf_timestamp_t tst = 0x01A5E403C2D59C00ULL; static const char *ref = "Sat Apr 23 01:30:00 1977"; diff -u libmagic.orig/compress.c libmagic/compress.c ---- libmagic.orig/compress.c 2013-01-06 21:35:43.000000000 +0100 -+++ libmagic/compress.c 2013-04-08 15:42:57.328298809 +0200 +--- libmagic.orig/compress.c Sun Jan 6 21:35:43 2013 ++++ libmagic/compress.c Sun Apr 7 22:30:22 2013 @@ -32,6 +32,7 @@ * uncompress(method, old, n, newch) - uncompress old into new, * using method, return sizeof new @@ -1189,8 +1198,8 @@ diff -u libmagic.orig/compress.c libmagic/compress.c -#endif +#endif /* if PHP_FILEINFO_UNCOMPRESS */ diff -u libmagic.orig/file.h libmagic/file.h ---- libmagic.orig/file.h 2013-02-18 16:40:59.000000000 +0100 -+++ libmagic/file.h 2013-04-08 15:42:57.328298809 +0200 +--- libmagic.orig/file.h Mon Feb 18 16:40:59 2013 ++++ libmagic/file.h Tue Feb 18 18:44:17 2014 @@ -33,11 +33,9 @@ #ifndef __file_h__ #define __file_h__ @@ -1303,7 +1312,13 @@ diff -u libmagic.orig/file.h libmagic/file.h protected int file_zmagic(struct magic_set *, int, const char *, const unsigned char *, size_t); #endif -@@ -443,16 +442,13 @@ +@@ -438,21 +437,18 @@ + unichar **, size_t *, const char **, const char **, const char **); + protected int file_is_tar(struct magic_set *, const unsigned char *, size_t); + protected int file_softmagic(struct magic_set *, const unsigned char *, size_t, +- int, int); ++ size_t, int, int); + protected int file_apprentice(struct magic_set *, const char *, int); protected int file_magicfind(struct magic_set *, const char *, struct mlist *); protected uint64_t file_signextend(struct magic_set *, struct magic *, uint64_t); @@ -1377,22 +1392,24 @@ diff -u libmagic.orig/file.h libmagic/file.h #if defined(HAVE_MMAP) && defined(HAVE_SYS_MMAN_H) && !defined(QUICK) #define QUICK -@@ -533,4 +511,12 @@ - #define FILE_RCSID(id) +@@ -531,6 +509,14 @@ #endif - + #else + #define FILE_RCSID(id) ++#endif ++ +#ifdef PHP_WIN32 +#define FINFO_LSEEK_FUNC _lseek +#define FINFO_READ_FUNC _read +#else +#define FINFO_LSEEK_FUNC lseek +#define FINFO_READ_FUNC read -+#endif -+ + #endif + #endif /* __file_h__ */ diff -u libmagic.orig/fsmagic.c libmagic/fsmagic.c ---- libmagic.orig/fsmagic.c 2013-03-21 18:45:14.000000000 +0100 -+++ libmagic/fsmagic.c 2013-04-08 15:42:57.328298809 +0200 +--- libmagic.orig/fsmagic.c Thu Mar 21 18:45:14 2013 ++++ libmagic/fsmagic.c Sun Apr 7 22:30:22 2013 @@ -59,27 +59,21 @@ # define minor(dev) ((dev) & 0xff) #endif @@ -1758,8 +1775,8 @@ diff -u libmagic.orig/fsmagic.c libmagic/fsmagic.c return ret; } diff -u libmagic.orig/funcs.c libmagic/funcs.c ---- libmagic.orig/funcs.c 2012-10-31 18:03:01.000000000 +0100 -+++ libmagic/funcs.c 2013-04-08 15:42:57.328298809 +0200 +--- libmagic.orig/funcs.c Wed Oct 31 18:03:01 2012 ++++ libmagic/funcs.c Tue Feb 18 18:44:17 2014 @@ -41,52 +41,42 @@ #if defined(HAVE_WCTYPE_H) #include <wctype.h> @@ -1896,7 +1913,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c if ((ms->flags & MAGIC_DEBUG) != 0) (void)fprintf(stderr, "zmagic %d\n", m); goto done; -@@ -219,12 +221,17 @@ +@@ -219,16 +221,21 @@ } /* Check if we have a CDF file */ @@ -1919,6 +1936,11 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c /* try soft magic tests */ if ((ms->flags & MAGIC_NO_CHECK_SOFT) == 0) +- if ((m = file_softmagic(ms, ubuf, nb, BINTEST, ++ if ((m = file_softmagic(ms, ubuf, nb, 0, BINTEST, + looks_text)) != 0) { + if ((ms->flags & MAGIC_DEBUG) != 0) + (void)fprintf(stderr, "softmagic %d\n", m); @@ -296,7 +303,6 @@ return m; @@ -2047,8 +2069,8 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c } + diff -u libmagic.orig/magic.c libmagic/magic.c ---- libmagic.orig/magic.c 2013-01-11 17:43:09.000000000 +0100 -+++ libmagic/magic.c 2013-04-27 13:53:32.175250261 +0200 +--- libmagic.orig/magic.c Fri Jan 11 17:43:09 2013 ++++ libmagic/magic.c Fri May 3 15:19:35 2013 @@ -25,11 +25,6 @@ * SUCH DAMAGE. */ @@ -2391,8 +2413,8 @@ diff -u libmagic.orig/magic.c libmagic/magic.c public const char * magic_error(struct magic_set *ms) diff -u libmagic.orig/magic.h libmagic/magic.h ---- libmagic.orig/magic.h 2013-03-21 18:52:42.000000000 +0100 -+++ libmagic/magic.h 2013-04-08 15:42:57.328298809 +0200 +--- libmagic.orig/magic.h Thu Mar 21 18:52:42 2013 ++++ libmagic/magic.h Sun Apr 7 22:30:22 2013 @@ -87,6 +87,7 @@ const char *magic_getpath(const char *, int); @@ -2410,15 +2432,15 @@ diff -u libmagic.orig/magic.h libmagic/magic.h int magic_errno(magic_t); diff -u libmagic.orig/print.c libmagic/print.c ---- libmagic.orig/print.c 2013-03-21 18:45:14.000000000 +0100 -+++ libmagic/print.c 2013-04-27 13:53:32.175250261 +0200 -@@ -28,13 +28,17 @@ - /* +--- libmagic.orig/print.c Thu Mar 21 18:45:14 2013 ++++ libmagic/print.c Mon Dec 16 23:09:24 2013 +@@ -29,12 +29,17 @@ * print.c - debugging printout routines */ + +#define _GNU_SOURCE +#include "php.h" - ++ #include "file.h" +#include "cdf.h" @@ -2430,7 +2452,7 @@ diff -u libmagic.orig/print.c libmagic/print.c #include <string.h> #include <stdarg.h> #include <stdlib.h> -@@ -43,188 +47,28 @@ +@@ -43,188 +48,28 @@ #endif #include <time.h> @@ -2631,7 +2653,7 @@ diff -u libmagic.orig/print.c libmagic/print.c } protected const char * -@@ -235,7 +79,7 @@ +@@ -235,7 +80,7 @@ struct tm *tm; if (flags & FILE_T_WINDOWS) { @@ -2641,8 +2663,8 @@ diff -u libmagic.orig/print.c libmagic/print.c t = ts.tv_sec; } diff -u libmagic.orig/readcdf.c libmagic/readcdf.c ---- libmagic.orig/readcdf.c 2012-10-31 18:03:01.000000000 +0100 -+++ libmagic/readcdf.c 2013-04-08 15:42:57.328298809 +0200 +--- libmagic.orig/readcdf.c Wed Oct 31 18:03:01 2012 ++++ libmagic/readcdf.c Sun Apr 7 22:30:22 2013 @@ -30,7 +30,11 @@ #endif @@ -2704,8 +2726,8 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c if (file_printf(ms, "application/CDFV2-corrupt") == -1) return -1; diff -u libmagic.orig/readelf.c libmagic/readelf.c ---- libmagic.orig/readelf.c 2013-03-21 18:45:14.000000000 +0100 -+++ libmagic/readelf.c 2013-04-08 15:42:57.328298809 +0200 +--- libmagic.orig/readelf.c Thu Mar 21 18:45:14 2013 ++++ libmagic/readelf.c Sun Apr 7 22:30:22 2013 @@ -48,8 +48,8 @@ private int dophn_exec(struct magic_set *, int, int, int, off_t, int, size_t, off_t, int *, int); @@ -2956,8 +2978,8 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c if (fstat(fd, &st) == -1) { diff -u libmagic.orig/readelf.h libmagic/readelf.h ---- libmagic.orig/readelf.h 2013-03-21 18:45:14.000000000 +0100 -+++ libmagic/readelf.h 2013-03-31 16:57:18.499744030 +0200 +--- libmagic.orig/readelf.h Thu Mar 21 18:45:14 2013 ++++ libmagic/readelf.h Wed Mar 28 15:35:26 2012 @@ -44,9 +44,17 @@ typedef uint32_t Elf32_Word; typedef uint8_t Elf32_Char; @@ -2977,8 +2999,8 @@ diff -u libmagic.orig/readelf.h libmagic/readelf.h typedef uint32_t Elf64_Word; typedef uint8_t Elf64_Char; diff -u libmagic.orig/softmagic.c libmagic/softmagic.c ---- libmagic.orig/softmagic.c 2013-03-21 18:45:14.000000000 +0100 -+++ libmagic/softmagic.c 2013-05-14 11:00:07.044745939 +0200 +--- libmagic.orig/softmagic.c Thu Mar 21 18:45:14 2013 ++++ libmagic/softmagic.c Thu Feb 20 18:57:46 2014 @@ -41,6 +41,11 @@ #include <stdlib.h> #include <time.h> @@ -2991,6 +3013,22 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c private int match(struct magic_set *, struct magic *, uint32_t, const unsigned char *, size_t, size_t, int, int, int, int, int *, int *, +@@ -69,13 +74,13 @@ + /*ARGSUSED1*/ /* nbytes passed for regularity, maybe need later */ + protected int + file_softmagic(struct magic_set *ms, const unsigned char *buf, size_t nbytes, +- int mode, int text) ++ size_t level, int mode, int text) + { + struct mlist *ml; + int rv, printed_something = 0, need_separator = 0; + for (ml = ms->mlist[0]->next; ml != ms->mlist[0]; ml = ml->next) + if ((rv = match(ms, ml->magic, ml->nmagic, buf, nbytes, 0, mode, +- text, 0, 0, &printed_something, &need_separator, ++ text, 0, level, &printed_something, &need_separator, + NULL)) != 0) + return rv; + @@ -132,7 +137,7 @@ struct magic *m = &magic[magindex]; @@ -3113,7 +3151,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c } if (m->flag & INDIR) { -@@ -1644,9 +1624,6 @@ +@@ -1644,16 +1624,13 @@ if ((ms->flags & MAGIC_DEBUG) != 0) { mdebug(offset, (char *)(void *)p, sizeof(union VALUETYPE)); @@ -3123,7 +3161,32 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c } } -@@ -1717,12 +1694,12 @@ + /* Verify we have enough data to match magic type */ + switch (m->type) { + case FILE_BYTE: +- if (nbytes < (offset + 1)) /* should alway be true */ ++ if (nbytes < (offset + 1)) /* should always be true */ + return 0; + break; + +@@ -1703,6 +1680,8 @@ + break; + + case FILE_INDIRECT: ++ if (offset == 0) ++ return 0; + if (nbytes < offset) + return 0; + sbuf = ms->o.buf; +@@ -1710,19 +1689,21 @@ + ms->o.buf = NULL; + ms->offset = 0; + rv = file_softmagic(ms, s + offset, nbytes - offset, +- BINTEST, text); ++ recursion_level, BINTEST, text); + if ((ms->flags & MAGIC_DEBUG) != 0) + fprintf(stderr, "indirect @offs=%u[%d]\n", offset, rv); + rbuf = ms->o.buf; ms->o.buf = sbuf; ms->offset = soffset; if (rv == 1) { @@ -3135,11 +3198,13 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c if (file_printf(ms, "%s", rbuf) == -1) return -1; - free(rbuf); ++ } ++ if (rbuf) { + efree(rbuf); } return rv; -@@ -1837,6 +1814,42 @@ +@@ -1837,6 +1818,42 @@ return file_strncmp(a, b, len, flags); } @@ -3182,7 +3247,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c private int magiccheck(struct magic_set *ms, struct magic *m) { -@@ -1996,69 +2009,157 @@ +@@ -1996,69 +2013,157 @@ break; } case FILE_REGEX: { diff --git a/ext/fileinfo/libmagic/ascmagic.c b/ext/fileinfo/libmagic/ascmagic.c index 209009764e..c0041df3b4 100644 --- a/ext/fileinfo/libmagic/ascmagic.c +++ b/ext/fileinfo/libmagic/ascmagic.c @@ -147,7 +147,7 @@ file_ascmagic_with_encoding(struct magic_set *ms, const unsigned char *buf, == NULL) goto done; if ((rv = file_softmagic(ms, utf8_buf, - (size_t)(utf8_end - utf8_buf), TEXTTEST, text)) == 0) + (size_t)(utf8_end - utf8_buf), 0, TEXTTEST, text)) == 0) rv = -1; } diff --git a/ext/fileinfo/libmagic/file.h b/ext/fileinfo/libmagic/file.h index 19b6872b49..ab5082d753 100644 --- a/ext/fileinfo/libmagic/file.h +++ b/ext/fileinfo/libmagic/file.h @@ -437,7 +437,7 @@ protected int file_encoding(struct magic_set *, const unsigned char *, size_t, unichar **, size_t *, const char **, const char **, const char **); protected int file_is_tar(struct magic_set *, const unsigned char *, size_t); protected int file_softmagic(struct magic_set *, const unsigned char *, size_t, - int, int); + size_t, int, int); protected int file_apprentice(struct magic_set *, const char *, int); protected int file_magicfind(struct magic_set *, const char *, struct mlist *); protected uint64_t file_signextend(struct magic_set *, struct magic *, diff --git a/ext/fileinfo/libmagic/funcs.c b/ext/fileinfo/libmagic/funcs.c index 9c0d2bdb7c..011ca42757 100644 --- a/ext/fileinfo/libmagic/funcs.c +++ b/ext/fileinfo/libmagic/funcs.c @@ -235,7 +235,7 @@ file_buffer(struct magic_set *ms, php_stream *stream, const char *inname, const /* try soft magic tests */ if ((ms->flags & MAGIC_NO_CHECK_SOFT) == 0) - if ((m = file_softmagic(ms, ubuf, nb, BINTEST, + if ((m = file_softmagic(ms, ubuf, nb, 0, BINTEST, looks_text)) != 0) { if ((ms->flags & MAGIC_DEBUG) != 0) (void)fprintf(stderr, "softmagic %d\n", m); diff --git a/ext/fileinfo/libmagic/softmagic.c b/ext/fileinfo/libmagic/softmagic.c index 0671fa99f9..21fea6b726 100644 --- a/ext/fileinfo/libmagic/softmagic.c +++ b/ext/fileinfo/libmagic/softmagic.c @@ -67,6 +67,8 @@ private void cvt_16(union VALUETYPE *, const struct magic *); private void cvt_32(union VALUETYPE *, const struct magic *); private void cvt_64(union VALUETYPE *, const struct magic *); +#define OFFSET_OOB(n, o, i) ((n) < (o) || (i) > ((n) - (o))) + /* * softmagic - lookup one file in parsed, in-memory copy of database * Passed the name and FILE * of one file to be typed. @@ -74,13 +76,13 @@ private void cvt_64(union VALUETYPE *, const struct magic *); /*ARGSUSED1*/ /* nbytes passed for regularity, maybe need later */ protected int file_softmagic(struct magic_set *ms, const unsigned char *buf, size_t nbytes, - int mode, int text) + size_t level, int mode, int text) { struct mlist *ml; int rv, printed_something = 0, need_separator = 0; for (ml = ms->mlist[0]->next; ml != ms->mlist[0]; ml = ml->next) if ((rv = match(ms, ml->magic, ml->nmagic, buf, nbytes, 0, mode, - text, 0, 0, &printed_something, &need_separator, + text, 0, level, &printed_something, &need_separator, NULL)) != 0) return rv; @@ -1171,7 +1173,7 @@ mget(struct magic_set *ms, const unsigned char *s, struct magic *m, } switch (cvt_flip(m->in_type, flip)) { case FILE_BYTE: - if (nbytes < (offset + 1)) + if (OFFSET_OOB(nbytes, offset, 1)) return 0; if (off) { switch (m->in_op & FILE_OPS_MASK) { @@ -1206,7 +1208,7 @@ mget(struct magic_set *ms, const unsigned char *s, struct magic *m, offset = ~offset; break; case FILE_BESHORT: - if (nbytes < (offset + 2)) + if (OFFSET_OOB(nbytes, offset, 2)) return 0; if (off) { switch (m->in_op & FILE_OPS_MASK) { @@ -1258,7 +1260,7 @@ mget(struct magic_set *ms, const unsigned char *s, struct magic *m, offset = ~offset; break; case FILE_LESHORT: - if (nbytes < (offset + 2)) + if (OFFSET_OOB(nbytes, offset, 2)) return 0; if (off) { switch (m->in_op & FILE_OPS_MASK) { @@ -1310,7 +1312,7 @@ mget(struct magic_set *ms, const unsigned char *s, struct magic *m, offset = ~offset; break; case FILE_SHORT: - if (nbytes < (offset + 2)) + if (OFFSET_OOB(nbytes, offset, 2)) return 0; if (off) { switch (m->in_op & FILE_OPS_MASK) { @@ -1347,7 +1349,7 @@ mget(struct magic_set *ms, const unsigned char *s, struct magic *m, break; case FILE_BELONG: case FILE_BEID3: - if (nbytes < (offset + 4)) + if (OFFSET_OOB(nbytes, offset, 4)) return 0; if (off) { switch (m->in_op & FILE_OPS_MASK) { @@ -1418,7 +1420,7 @@ mget(struct magic_set *ms, const unsigned char *s, struct magic *m, break; case FILE_LELONG: case FILE_LEID3: - if (nbytes < (offset + 4)) + if (OFFSET_OOB(nbytes, offset, 4)) return 0; if (off) { switch (m->in_op & FILE_OPS_MASK) { @@ -1488,7 +1490,7 @@ mget(struct magic_set *ms, const unsigned char *s, struct magic *m, offset = ~offset; break; case FILE_MELONG: - if (nbytes < (offset + 4)) + if (OFFSET_OOB(nbytes, offset, 4)) return 0; if (off) { switch (m->in_op & FILE_OPS_MASK) { @@ -1558,7 +1560,7 @@ mget(struct magic_set *ms, const unsigned char *s, struct magic *m, offset = ~offset; break; case FILE_LONG: - if (nbytes < (offset + 4)) + if (OFFSET_OOB(nbytes, offset, 4)) return 0; if (off) { switch (m->in_op & FILE_OPS_MASK) { @@ -1630,14 +1632,14 @@ mget(struct magic_set *ms, const unsigned char *s, struct magic *m, /* Verify we have enough data to match magic type */ switch (m->type) { case FILE_BYTE: - if (nbytes < (offset + 1)) /* should always be true */ + if (OFFSET_OOB(nbytes, offset, 1)) return 0; break; case FILE_SHORT: case FILE_BESHORT: case FILE_LESHORT: - if (nbytes < (offset + 2)) + if (OFFSET_OOB(nbytes, offset, 2)) return 0; break; @@ -1656,55 +1658,67 @@ mget(struct magic_set *ms, const unsigned char *s, struct magic *m, case FILE_FLOAT: case FILE_BEFLOAT: case FILE_LEFLOAT: - if (nbytes < (offset + 4)) + if (OFFSET_OOB(nbytes, offset, 4)) return 0; break; case FILE_DOUBLE: case FILE_BEDOUBLE: case FILE_LEDOUBLE: - if (nbytes < (offset + 8)) + if (OFFSET_OOB(nbytes, offset, 8)) return 0; break; case FILE_STRING: case FILE_PSTRING: case FILE_SEARCH: - if (nbytes < (offset + m->vallen)) + if (OFFSET_OOB(nbytes, offset, m->vallen)) return 0; break; case FILE_REGEX: - if (nbytes < offset) + if (OFFSET_OOB(nbytes, offset, 0)) return 0; break; case FILE_INDIRECT: - if (nbytes < offset) + if (offset == 0) + return 0; + if (OFFSET_OOB(nbytes, offset, 0)) return 0; sbuf = ms->o.buf; soffset = ms->offset; ms->o.buf = NULL; ms->offset = 0; rv = file_softmagic(ms, s + offset, nbytes - offset, - BINTEST, text); + recursion_level, BINTEST, text); if ((ms->flags & MAGIC_DEBUG) != 0) fprintf(stderr, "indirect @offs=%u[%d]\n", offset, rv); rbuf = ms->o.buf; ms->o.buf = sbuf; ms->offset = soffset; if (rv == 1) { - if ((ms->flags & (MAGIC_MIME|MAGIC_APPLE)) == 0 && - file_printf(ms, m->desc, offset) == -1) - return -1; - if (file_printf(ms, "%s", rbuf) == -1) + if ((ms->flags & (MAGIC_MIME|MAGIC_APPLE)) == 0 && + file_printf(ms, m->desc, offset) == -1) { + if (rbuf) { + efree(rbuf); + } return -1; + } + if (file_printf(ms, "%s", rbuf) == -1) { + if (rbuf) { + efree(rbuf); + } + return -1; + } + } + if (rbuf) { efree(rbuf); } return rv; case FILE_USE: - if (nbytes < offset) + if (OFFSET_OOB(nbytes, offset, 0)) return 0; sbuf = m->value.s; if (*sbuf == '^') { diff --git a/ext/fileinfo/php_fileinfo.h b/ext/fileinfo/php_fileinfo.h index 14bd256a42..354ec7b284 100644 --- a/ext/fileinfo/php_fileinfo.h +++ b/ext/fileinfo/php_fileinfo.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.0 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/fileinfo/tests/cve-2014-1943.phpt b/ext/fileinfo/tests/cve-2014-1943.phpt new file mode 100644 index 0000000000..b2e9c17c3f --- /dev/null +++ b/ext/fileinfo/tests/cve-2014-1943.phpt @@ -0,0 +1,39 @@ +--TEST-- +Bug #66731: file: infinite recursion +--SKIPIF-- +<?php +if (!class_exists('finfo')) + die('skip no fileinfo extension'); +--FILE-- +<?php +$fd = __DIR__.'/cve-2014-1943.data'; +$fm = __DIR__.'/cve-2014-1943.magic'; + +$a = "\105\122\000\000\000\000\000"; +$b = str_repeat("\001", 250000); +$m = "0 byte x\n". + ">(1.b) indirect x\n"; + +file_put_contents($fd, $a); +$fi = finfo_open(FILEINFO_NONE); +var_dump(finfo_file($fi, $fd)); +finfo_close($fi); + +file_put_contents($fd, $b); +file_put_contents($fm, $m); +$fi = finfo_open(FILEINFO_NONE, $fm); +var_dump(finfo_file($fi, $fd)); +finfo_close($fi); +?> +Done +--CLEAN-- +<?php +@unlink(__DIR__.'/cve-2014-1943.data'); +@unlink(__DIR__.'/cve-2014-1943.magic'); +?> +--EXPECTF-- +string(%d) "%s" + +Warning: finfo_file(): Failed identify data 0:(null) in %s on line %d +bool(false) +Done diff --git a/ext/fileinfo/tests/magic b/ext/fileinfo/tests/magic index aa75fb65bc..b554333a6c 100644 --- a/ext/fileinfo/tests/magic +++ b/ext/fileinfo/tests/magic @@ -4888,7 +4888,7 @@ >>0 ubyte 0xF5 FoxPro with memo # http://msdn.microsoft.com/en-US/library/st4a0s68(v=vs.80).aspx #>>0 ubyte 0xFA FoxPro 2.x, with memo -# unkown version (should not happen) +# unknown version (should not happen) >>0 default x xBase >>>0 ubyte x (0x%x) # flags in version byte @@ -6115,7 +6115,7 @@ >>>>>379 string GRUB\ \0 \b, GRUB version 0.95 or 0.96 >>>>391 string Geom\0Hard\ Disk\0Read\0\ Error\0 >>>>>385 string GRUB\ \0 \b, GRUB version 0.97 -#unkown version +#unknown version >>>343 string Geom\0Read\0\ Error\0 >>>>321 string Loading\ stage1.5 \b, GRUB version x.y >>>380 string Geom\0Hard\ Disk\0Read\0\ Error\0 diff --git a/ext/filter/callback_filter.c b/ext/filter/callback_filter.c index 3beacb6a8f..644807d0dd 100644 --- a/ext/filter/callback_filter.c +++ b/ext/filter/callback_filter.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/filter/filter.c b/ext/filter/filter.c index 6496ccdb6a..ad78b4a085 100644 --- a/ext/filter/filter.c +++ b/ext/filter/filter.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/filter/filter_private.h b/ext/filter/filter_private.h index 9bc53a0e47..65ebb3622f 100644 --- a/ext/filter/filter_private.h +++ b/ext/filter/filter_private.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/filter/logical_filters.c b/ext/filter/logical_filters.c index 03b00bd9f6..232a26b91f 100644 --- a/ext/filter/logical_filters.c +++ b/ext/filter/logical_filters.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | @@ -715,8 +715,6 @@ void php_filter_validate_ip(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */ if ( (ip[0] == 0) || (ip[0] == 100 && (ip[1] >= 64 && ip[1] <= 127)) || - (ip[0] == 128 && ip[1] == 0) || - (ip[0] == 191 && ip[1] == 255) || (ip[0] == 169 && ip[1] == 254) || (ip[0] == 192 && ip[1] == 0 && ip[2] == 2) || (ip[0] == 127 && ip[1] == 0 && ip[2] == 0 && ip[3] == 1) || diff --git a/ext/filter/php_filter.h b/ext/filter/php_filter.h index cbe1c47200..f658e42fc4 100644 --- a/ext/filter/php_filter.h +++ b/ext/filter/php_filter.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/filter/sanitizing_filters.c b/ext/filter/sanitizing_filters.c index 30da05a217..7d1e74830e 100644 --- a/ext/filter/sanitizing_filters.c +++ b/ext/filter/sanitizing_filters.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/filter/tests/bug53150.phpt b/ext/filter/tests/bug53150.phpt index 4baa4db772..4906888bdf 100644 --- a/ext/filter/tests/bug53150.phpt +++ b/ext/filter/tests/bug53150.phpt @@ -23,6 +23,6 @@ string(3) "::1" bool(false) bool(false) string(9) "128.0.0.1" -bool(false) +string(9) "128.0.0.1" +string(11) "191.255.0.0" string(11) "191.255.0.0" -bool(false) diff --git a/ext/ftp/ftp.c b/ext/ftp/ftp.c index b82017e21f..3ff54ff12f 100644 --- a/ext/ftp/ftp.c +++ b/ext/ftp/ftp.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | @@ -178,6 +178,10 @@ ftp_close(ftpbuf_t *ftp) if (ftp->data) { data_close(ftp, ftp->data); } + if (ftp->stream && ftp->closestream) { + TSRMLS_FETCH(); + php_stream_close(ftp->stream); + } if (ftp->fd != -1) { #if HAVE_OPENSSL_EXT if (ftp->ssl_active) { diff --git a/ext/ftp/ftp.h b/ext/ftp/ftp.h index 69de7dbb78..2759ce2af5 100644 --- a/ext/ftp/ftp.h +++ b/ext/ftp/ftp.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/ftp/php_ftp.c b/ext/ftp/php_ftp.c index 21e13ea460..79c871f559 100644 --- a/ext/ftp/php_ftp.c +++ b/ext/ftp/php_ftp.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | @@ -963,6 +963,7 @@ PHP_FUNCTION(ftp_nb_get) if ((ret = ftp_nb_get(ftp, outstream, remote, xtype, resumepos TSRMLS_CC)) == PHP_FTP_FAILED) { php_stream_close(outstream); + ftp->stream = NULL; VCWD_UNLINK(local); php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf); RETURN_LONG(PHP_FTP_FAILED); @@ -970,6 +971,7 @@ PHP_FUNCTION(ftp_nb_get) if (ret == PHP_FTP_FINISHED){ php_stream_close(outstream); + ftp->stream = NULL; } RETURN_LONG(ret); @@ -1003,6 +1005,7 @@ PHP_FUNCTION(ftp_nb_continue) if (ret != PHP_FTP_MOREDATA && ftp->closestream) { php_stream_close(ftp->stream); + ftp->stream = NULL; } if (ret == PHP_FTP_FAILED) { @@ -1214,6 +1217,7 @@ PHP_FUNCTION(ftp_nb_put) if (ret != PHP_FTP_MOREDATA) { php_stream_close(instream); + ftp->stream = NULL; } if (ret == PHP_FTP_FAILED) { diff --git a/ext/ftp/php_ftp.h b/ext/ftp/php_ftp.h index 41f65f900a..fffe6bf2f5 100644 --- a/ext/ftp/php_ftp.h +++ b/ext/ftp/php_ftp.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/ftp/tests/ftp_fget_basic1.phpt b/ext/ftp/tests/ftp_fget_basic1.phpt index 475f7183d2..5909d35cef 100644 --- a/ext/ftp/tests/ftp_fget_basic1.phpt +++ b/ext/ftp/tests/ftp_fget_basic1.phpt @@ -16,7 +16,7 @@ ftp_login($ftp, 'user', 'pass'); if (!$ftp) die("Couldn't connect to the server"); ftp_set_option($ftp, FTP_AUTOSEEK, false); -$local_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . "localfile.txt"; +$local_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . "ftp_fget_basic1.txt"; $handle = fopen($local_file, 'w'); var_dump(ftp_fget($ftp, $handle, 'fget.txt', FTP_ASCII, FTP_AUTORESUME)); @@ -24,7 +24,7 @@ var_dump(file_get_contents($local_file)); ?> --CLEAN-- <?php -@unlink(dirname(__FILE__) . DIRECTORY_SEPARATOR . "localfile.txt"); +@unlink(dirname(__FILE__) . DIRECTORY_SEPARATOR . "ftp_fget_basic1.txt"); ?> --EXPECT-- bool(true) diff --git a/ext/ftp/tests/ftp_fget_basic2.phpt b/ext/ftp/tests/ftp_fget_basic2.phpt index 00a26752d9..622cea3683 100644 --- a/ext/ftp/tests/ftp_fget_basic2.phpt +++ b/ext/ftp/tests/ftp_fget_basic2.phpt @@ -15,7 +15,7 @@ $ftp = ftp_connect('127.0.0.1', $port); ftp_login($ftp, 'user', 'pass'); if (!$ftp) die("Couldn't connect to the server"); -$local_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . "localfile.txt"; +$local_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . "ftp_fget_basic2.txt"; file_put_contents($local_file, 'ASCIIFoo'); $handle = fopen($local_file, 'a'); @@ -24,7 +24,7 @@ var_dump(file_get_contents($local_file)); ?> --CLEAN-- <?php -@unlink(dirname(__FILE__) . DIRECTORY_SEPARATOR . "localfile.txt"); +@unlink(dirname(__FILE__) . DIRECTORY_SEPARATOR . "ftp_fget_basic2.txt"); ?> --EXPECT-- bool(true) diff --git a/ext/ftp/tests/ftp_fget_basic3.phpt b/ext/ftp/tests/ftp_fget_basic3.phpt index b7098701ab..9485473b1c 100644 --- a/ext/ftp/tests/ftp_fget_basic3.phpt +++ b/ext/ftp/tests/ftp_fget_basic3.phpt @@ -15,7 +15,7 @@ $ftp = ftp_connect('127.0.0.1', $port); ftp_login($ftp, 'user', 'pass'); if (!$ftp) die("Couldn't connect to the server"); -$local_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . "localfile.txt"; +$local_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . "ftp_fget_basic3.txt"; file_put_contents($local_file, 'ASCIIFoo'); $handle = fopen($local_file, 'a'); @@ -24,7 +24,7 @@ var_dump(file_get_contents($local_file)); ?> --CLEAN-- <?php -@unlink(dirname(__FILE__) . DIRECTORY_SEPARATOR . "localfile.txt"); +@unlink(dirname(__FILE__) . DIRECTORY_SEPARATOR . "ftp_fget_basic3.txt"); ?> --EXPECT-- bool(true) diff --git a/ext/ftp/tests/ftp_nb_fget_basic1.phpt b/ext/ftp/tests/ftp_nb_fget_basic1.phpt index cac4eec56b..5e6389ff13 100644 --- a/ext/ftp/tests/ftp_nb_fget_basic1.phpt +++ b/ext/ftp/tests/ftp_nb_fget_basic1.phpt @@ -16,7 +16,7 @@ ftp_login($ftp, 'user', 'pass'); if (!$ftp) die("Couldn't connect to the server"); ftp_set_option($ftp, FTP_AUTOSEEK, false); -$local_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . "localfile.txt"; +$local_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . "ftp_nb_fget_basic1.txt"; $handle = fopen($local_file, 'w'); var_dump(ftp_nb_fget($ftp, $handle, 'fget.txt', FTP_ASCII, FTP_AUTORESUME)); @@ -24,7 +24,7 @@ var_dump(file_get_contents($local_file)); ?> --CLEAN-- <?php -@unlink(dirname(__FILE__) . DIRECTORY_SEPARATOR . "localfile.txt"); +@unlink(dirname(__FILE__) . DIRECTORY_SEPARATOR . "ftp_nb_fget_basic1.txt"); ?> --EXPECT-- int(2) diff --git a/ext/ftp/tests/ftp_nb_fget_basic2.phpt b/ext/ftp/tests/ftp_nb_fget_basic2.phpt index dc92f4e23b..215b79ac4a 100644 --- a/ext/ftp/tests/ftp_nb_fget_basic2.phpt +++ b/ext/ftp/tests/ftp_nb_fget_basic2.phpt @@ -15,7 +15,7 @@ $ftp = ftp_connect('127.0.0.1', $port); ftp_login($ftp, 'user', 'pass'); if (!$ftp) die("Couldn't connect to the server"); -$local_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . "localfile.txt"; +$local_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . "ftp_nb_fget_basic2.txt"; file_put_contents($local_file, 'ASCIIFoo'); $handle = fopen($local_file, 'a'); @@ -24,7 +24,7 @@ var_dump(file_get_contents($local_file)); ?> --CLEAN-- <?php -@unlink(dirname(__FILE__) . DIRECTORY_SEPARATOR . "localfile.txt"); +@unlink(dirname(__FILE__) . DIRECTORY_SEPARATOR . "ftp_nb_fget_basic2.txt"); ?> --EXPECT-- int(2) diff --git a/ext/ftp/tests/ftp_nb_fget_basic3.phpt b/ext/ftp/tests/ftp_nb_fget_basic3.phpt index d1a87c4f3d..66daf2ba0a 100644 --- a/ext/ftp/tests/ftp_nb_fget_basic3.phpt +++ b/ext/ftp/tests/ftp_nb_fget_basic3.phpt @@ -15,7 +15,7 @@ $ftp = ftp_connect('127.0.0.1', $port); ftp_login($ftp, 'user', 'pass'); if (!$ftp) die("Couldn't connect to the server"); -$local_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . "localfile.txt"; +$local_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . "ftp_nb_fget_basic3.txt"; file_put_contents($local_file, 'ASCIIFoo'); $handle = fopen($local_file, 'a'); @@ -24,7 +24,7 @@ var_dump(file_get_contents($local_file)); ?> --CLEAN-- <?php -@unlink(dirname(__FILE__) . DIRECTORY_SEPARATOR . "localfile.txt"); +@unlink(dirname(__FILE__) . DIRECTORY_SEPARATOR . "ftp_nb_fget_basic3.txt"); ?> --EXPECT-- int(2) diff --git a/ext/ftp/tests/ftp_nb_get_large.phpt b/ext/ftp/tests/ftp_nb_get_large.phpt index 3fbf2a4831..0c354d7c19 100644 --- a/ext/ftp/tests/ftp_nb_get_large.phpt +++ b/ext/ftp/tests/ftp_nb_get_large.phpt @@ -18,7 +18,7 @@ $ftp = ftp_connect('127.0.0.1', $port); ftp_login($ftp, 'user', 'pass'); if (!$ftp) die("Couldn't connect to the server"); -$local_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . "localfile.txt"; +$local_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . "ftp_nb_get_large.txt"; touch($local_file); ftp_nb_get($ftp, $local_file, 'fget_large.txt', FTP_BINARY, 5368709119); $fp = fopen($local_file, 'r'); @@ -29,7 +29,7 @@ fclose($fp); ?> --CLEAN-- <?php -@unlink(dirname(__FILE__) . DIRECTORY_SEPARATOR . "localfile.txt"); +@unlink(dirname(__FILE__) . DIRECTORY_SEPARATOR . "ftp_nb_get_large.txt"); ?> --EXPECT-- string(1) "X" diff --git a/ext/gd/config.m4 b/ext/gd/config.m4 index 0e35eceba3..732e14c82e 100644 --- a/ext/gd/config.m4 +++ b/ext/gd/config.m4 @@ -193,30 +193,25 @@ AC_DEFUN([PHP_GD_FREETYPE2],[ if test "$PHP_FREETYPE_DIR" != "no"; then for i in $PHP_FREETYPE_DIR /usr/local /usr; do - if test -f "$i/include/freetype2/freetype/freetype.h"; then + if test -f "$i/bin/freetype-config"; then FREETYPE2_DIR=$i - FREETYPE2_INC_DIR=$i/include/freetype2 + FREETYPE2_CONFIG="$i/bin/freetype-config" break fi done if test -z "$FREETYPE2_DIR"; then - AC_MSG_ERROR([freetype.h not found.]) + AC_MSG_ERROR([freetype-config not found.]) fi - PHP_CHECK_LIBRARY(freetype, FT_New_Face, - [ - PHP_ADD_LIBRARY_WITH_PATH(freetype, $FREETYPE2_DIR/$PHP_LIBDIR, GD_SHARED_LIBADD) - PHP_ADD_INCLUDE($FREETYPE2_DIR/include) - PHP_ADD_INCLUDE($FREETYPE2_INC_DIR) - AC_DEFINE(USE_GD_IMGSTRTTF, 1, [ ]) - AC_DEFINE(HAVE_LIBFREETYPE,1,[ ]) - AC_DEFINE(ENABLE_GD_TTF,1,[ ]) - ],[ - AC_MSG_ERROR([Problem with freetype.(a|so). Please check config.log for more information.]) - ],[ - -L$FREETYPE2_DIR/$PHP_LIBDIR - ]) + FREETYPE2_CFLAGS=`$FREETYPE2_CONFIG --cflags` + FREETYPE2_LIBS=`$FREETYPE2_CONFIG --libs` + + PHP_EVAL_INCLINE($FREETYPE2_CFLAGS) + PHP_EVAL_LIBLINE($FREETYPE2_LIBS, GD_SHARED_LIBADD) + AC_DEFINE(USE_GD_IMGSTRTTF, 1, [ ]) + AC_DEFINE(HAVE_LIBFREETYPE,1,[ ]) + AC_DEFINE(ENABLE_GD_TTF,1,[ ]) else AC_MSG_RESULT([If configure fails try --with-freetype-dir=<DIR>]) fi diff --git a/ext/gd/gd.c b/ext/gd/gd.c index 3279463b7e..e5657f7424 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/gd/gd_ctx.c b/ext/gd/gd_ctx.c index b0e8aa66ab..bff691fad2 100644 --- a/ext/gd/gd_ctx.c +++ b/ext/gd/gd_ctx.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/gd/libgd/xbm.c b/ext/gd/libgd/xbm.c index 9491328d66..d6fdd7d086 100644 --- a/ext/gd/libgd/xbm.c +++ b/ext/gd/libgd/xbm.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/gd/php_gd.h b/ext/gd/php_gd.h index 70bc85a08b..92fc438bc9 100644 --- a/ext/gd/php_gd.h +++ b/ext/gd/php_gd.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/gettext/gettext.c b/ext/gettext/gettext.c index ed86b6cbc4..732ef54998 100644 --- a/ext/gettext/gettext.c +++ b/ext/gettext/gettext.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/gettext/php_gettext.h b/ext/gettext/php_gettext.h index 0c517d9a51..f990d32af5 100644 --- a/ext/gettext/php_gettext.h +++ b/ext/gettext/php_gettext.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/gmp/gmp.c b/ext/gmp/gmp.c index e3a3563aac..25e8203030 100644 --- a/ext/gmp/gmp.c +++ b/ext/gmp/gmp.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/gmp/php_gmp.h b/ext/gmp/php_gmp.h index e1aaef886d..50feadc2d4 100644 --- a/ext/gmp/php_gmp.h +++ b/ext/gmp/php_gmp.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/hash/hash.c b/ext/hash/hash.c index f5dca3fe54..bd9dcca59f 100644 --- a/ext/hash/hash.c +++ b/ext/hash/hash.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/hash/hash_adler32.c b/ext/hash/hash_adler32.c index 4575c00c4e..af5ff82de0 100644 --- a/ext/hash/hash_adler32.c +++ b/ext/hash/hash_adler32.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/hash/hash_crc32.c b/ext/hash/hash_crc32.c index 9be5b4bd40..7e748df559 100644 --- a/ext/hash/hash_crc32.c +++ b/ext/hash/hash_crc32.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/hash/hash_fnv.c b/ext/hash/hash_fnv.c index f96946d824..1c92478259 100644 --- a/ext/hash/hash_fnv.c +++ b/ext/hash/hash_fnv.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/hash/hash_gost.c b/ext/hash/hash_gost.c index 3961c4f2d5..d61075c44f 100644 --- a/ext/hash/hash_gost.c +++ b/ext/hash/hash_gost.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/hash/hash_haval.c b/ext/hash/hash_haval.c index 7d8b49670f..32437cecdf 100644 --- a/ext/hash/hash_haval.c +++ b/ext/hash/hash_haval.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/hash/hash_joaat.c b/ext/hash/hash_joaat.c index d73938dead..cfeab863de 100644 --- a/ext/hash/hash_joaat.c +++ b/ext/hash/hash_joaat.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/hash/hash_md.c b/ext/hash/hash_md.c index 25165eef43..f13f594452 100644 --- a/ext/hash/hash_md.c +++ b/ext/hash/hash_md.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/hash/hash_ripemd.c b/ext/hash/hash_ripemd.c index c7c53c603c..16fbd12b18 100644 --- a/ext/hash/hash_ripemd.c +++ b/ext/hash/hash_ripemd.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/hash/hash_sha.c b/ext/hash/hash_sha.c index 80d9f1f265..a784c102d7 100644 --- a/ext/hash/hash_sha.c +++ b/ext/hash/hash_sha.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/hash/hash_snefru.c b/ext/hash/hash_snefru.c index 34101de9d2..2cf37998ad 100644 --- a/ext/hash/hash_snefru.c +++ b/ext/hash/hash_snefru.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/hash/hash_tiger.c b/ext/hash/hash_tiger.c index e6e2692cc9..78f932a745 100644 --- a/ext/hash/hash_tiger.c +++ b/ext/hash/hash_tiger.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/hash/hash_whirlpool.c b/ext/hash/hash_whirlpool.c index 6fde452bc9..ca41e523d0 100644 --- a/ext/hash/hash_whirlpool.c +++ b/ext/hash/hash_whirlpool.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/hash/php_hash.h b/ext/hash/php_hash.h index 4acf4a4c2f..d4f5b16e24 100644 --- a/ext/hash/php_hash.h +++ b/ext/hash/php_hash.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/hash/php_hash_adler32.h b/ext/hash/php_hash_adler32.h index 789cf18ef7..ca78b38a13 100644 --- a/ext/hash/php_hash_adler32.h +++ b/ext/hash/php_hash_adler32.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/hash/php_hash_crc32.h b/ext/hash/php_hash_crc32.h index 111a12f193..cc61243c30 100644 --- a/ext/hash/php_hash_crc32.h +++ b/ext/hash/php_hash_crc32.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/hash/php_hash_crc32_tables.h b/ext/hash/php_hash_crc32_tables.h index 8424a23d13..30f5602287 100644 --- a/ext/hash/php_hash_crc32_tables.h +++ b/ext/hash/php_hash_crc32_tables.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/hash/php_hash_fnv.h b/ext/hash/php_hash_fnv.h index 3eeb046c34..10023fc618 100644 --- a/ext/hash/php_hash_fnv.h +++ b/ext/hash/php_hash_fnv.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/hash/php_hash_gost.h b/ext/hash/php_hash_gost.h index 6a4af310dc..072be98983 100644 --- a/ext/hash/php_hash_gost.h +++ b/ext/hash/php_hash_gost.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/hash/php_hash_haval.h b/ext/hash/php_hash_haval.h index 0e62f230dd..4a37815daf 100644 --- a/ext/hash/php_hash_haval.h +++ b/ext/hash/php_hash_haval.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/hash/php_hash_joaat.h b/ext/hash/php_hash_joaat.h index d4eacd98f0..494e7eb09a 100644 --- a/ext/hash/php_hash_joaat.h +++ b/ext/hash/php_hash_joaat.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/hash/php_hash_md.h b/ext/hash/php_hash_md.h index 10b6f121bb..473abee66c 100644 --- a/ext/hash/php_hash_md.h +++ b/ext/hash/php_hash_md.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/hash/php_hash_ripemd.h b/ext/hash/php_hash_ripemd.h index fde5c0f533..b564b3a17c 100644 --- a/ext/hash/php_hash_ripemd.h +++ b/ext/hash/php_hash_ripemd.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/hash/php_hash_sha.h b/ext/hash/php_hash_sha.h index bae7cf3c2f..bd24fb0974 100644 --- a/ext/hash/php_hash_sha.h +++ b/ext/hash/php_hash_sha.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/hash/php_hash_snefru.h b/ext/hash/php_hash_snefru.h index 87e3c53019..214edb1982 100644 --- a/ext/hash/php_hash_snefru.h +++ b/ext/hash/php_hash_snefru.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/hash/php_hash_snefru_tables.h b/ext/hash/php_hash_snefru_tables.h index 1956e9e1e3..ef92453031 100644 --- a/ext/hash/php_hash_snefru_tables.h +++ b/ext/hash/php_hash_snefru_tables.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/hash/php_hash_tiger.h b/ext/hash/php_hash_tiger.h index c3428bfe81..fd602d6819 100644 --- a/ext/hash/php_hash_tiger.h +++ b/ext/hash/php_hash_tiger.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/hash/php_hash_tiger_tables.h b/ext/hash/php_hash_tiger_tables.h index a826c9ac66..f3e726f80c 100644 --- a/ext/hash/php_hash_tiger_tables.h +++ b/ext/hash/php_hash_tiger_tables.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/hash/php_hash_types.h b/ext/hash/php_hash_types.h index 8793da55d6..d662ebf204 100644 --- a/ext/hash/php_hash_types.h +++ b/ext/hash/php_hash_types.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/hash/php_hash_whirlpool.h b/ext/hash/php_hash_whirlpool.h index f742547c50..d28b1d927c 100644 --- a/ext/hash/php_hash_whirlpool.h +++ b/ext/hash/php_hash_whirlpool.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/hash/php_hash_whirlpool_tables.h b/ext/hash/php_hash_whirlpool_tables.h index 819a52a19e..4951636003 100644 --- a/ext/hash/php_hash_whirlpool_tables.h +++ b/ext/hash/php_hash_whirlpool_tables.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c index ba893ea9e6..ea6ac1a1f1 100644 --- a/ext/iconv/iconv.c +++ b/ext/iconv/iconv.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/iconv/php_iconv.h b/ext/iconv/php_iconv.h index 04fa6ef534..26e3f3b2a6 100644 --- a/ext/iconv/php_iconv.h +++ b/ext/iconv/php_iconv.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/imap/php_imap.c b/ext/imap/php_imap.c index d697fa7911..0e8310a367 100644 --- a/ext/imap/php_imap.c +++ b/ext/imap/php_imap.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/imap/php_imap.h b/ext/imap/php_imap.h index 52128a643b..a823326cca 100644 --- a/ext/imap/php_imap.h +++ b/ext/imap/php_imap.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/interbase/ibase_blobs.c b/ext/interbase/ibase_blobs.c index 9d9d2f807d..7c27ccf325 100644 --- a/ext/interbase/ibase_blobs.c +++ b/ext/interbase/ibase_blobs.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/interbase/ibase_events.c b/ext/interbase/ibase_events.c index 3380defd4b..09cdbfa404 100644 --- a/ext/interbase/ibase_events.c +++ b/ext/interbase/ibase_events.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/interbase/ibase_query.c b/ext/interbase/ibase_query.c index b30d741a82..53eb7a885e 100644 --- a/ext/interbase/ibase_query.c +++ b/ext/interbase/ibase_query.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/interbase/ibase_service.c b/ext/interbase/ibase_service.c index 956ef04474..bd6d4ad1aa 100644 --- a/ext/interbase/ibase_service.c +++ b/ext/interbase/ibase_service.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/interbase/interbase.c b/ext/interbase/interbase.c index 132ad35fba..c78c522606 100644 --- a/ext/interbase/interbase.c +++ b/ext/interbase/interbase.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/interbase/php_ibase_includes.h b/ext/interbase/php_ibase_includes.h index 559be77a44..71990a5e4b 100644 --- a/ext/interbase/php_ibase_includes.h +++ b/ext/interbase/php_ibase_includes.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/interbase/php_ibase_udf.c b/ext/interbase/php_ibase_udf.c index 7faf314bc0..497a862449 100644 --- a/ext/interbase/php_ibase_udf.c +++ b/ext/interbase/php_ibase_udf.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/interbase/php_interbase.h b/ext/interbase/php_interbase.h index 149319e577..044896ac43 100644 --- a/ext/interbase/php_interbase.h +++ b/ext/interbase/php_interbase.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/json/json.c b/ext/json/json.c index 8c8963db8c..37ee314936 100644 --- a/ext/json/json.c +++ b/ext/json/json.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | @@ -38,7 +38,7 @@ static PHP_FUNCTION(json_last_error); static const char digits[] = "0123456789abcdef"; -zend_class_entry *php_json_serializable_ce; +PHP_JSON_API zend_class_entry *php_json_serializable_ce; ZEND_DECLARE_MODULE_GLOBALS(json) @@ -684,21 +684,35 @@ PHP_JSON_API void php_json_decode_ex(zval *return_value, char *str, int str_len, double d; int type, overflow_info; long p; + char *trim = str; + int trim_len = str_len; + + /* Increment trimmed string pointer to strip leading whitespace */ + /* JSON RFC says to consider as whitespace: space, tab, LF or CR */ + while (trim_len && (*trim == ' ' || *trim == '\t' || *trim == '\n' || *trim == '\r')) { + trim++; + trim_len--; + } + + /* Decrement trimmed string length to strip trailing whitespace */ + while (trim_len && (trim[trim_len - 1] == ' ' || trim[trim_len - 1] == '\t' || trim[trim_len - 1] == '\n' || trim[trim_len - 1] == '\r')) { + trim_len--; + } RETVAL_NULL(); - if (str_len == 4) { - if (!strcasecmp(str, "null")) { + if (trim_len == 4) { + if (!strncasecmp(trim, "null", trim_len)) { /* We need to explicitly clear the error because its an actual NULL and not an error */ jp->error_code = PHP_JSON_ERROR_NONE; RETVAL_NULL(); - } else if (!strcasecmp(str, "true")) { + } else if (!strncasecmp(trim, "true", trim_len)) { RETVAL_BOOL(1); } - } else if (str_len == 5 && !strcasecmp(str, "false")) { + } else if (trim_len == 5 && !strncasecmp(trim, "false", trim_len)) { RETVAL_BOOL(0); } - if ((type = is_numeric_string_ex(str, str_len, &p, &d, 0, &overflow_info)) != 0) { + if ((type = is_numeric_string_ex(trim, trim_len, &p, &d, 0, &overflow_info)) != 0) { if (type == IS_LONG) { RETVAL_LONG(p); } else if (type == IS_DOUBLE) { @@ -711,10 +725,10 @@ PHP_JSON_API void php_json_decode_ex(zval *return_value, char *str, int str_len, int i; zend_bool is_float = 0; - for (i = (str[0] == '-' ? 1 : 0); i < str_len; i++) { + for (i = (trim[0] == '-' ? 1 : 0); i < trim_len; i++) { /* Not using isdigit() because it's locale specific, * but we expect JSON input to always be UTF-8. */ - if (str[i] < '0' || str[i] > '9') { + if (trim[i] < '0' || trim[i] > '9') { is_float = 1; break; } @@ -723,7 +737,7 @@ PHP_JSON_API void php_json_decode_ex(zval *return_value, char *str, int str_len, if (is_float) { RETVAL_DOUBLE(d); } else { - RETVAL_STRINGL(str, str_len, 1); + RETVAL_STRINGL(trim, trim_len, 1); } } else { RETVAL_DOUBLE(d); diff --git a/ext/json/php_json.h b/ext/json/php_json.h index 08c07c2edc..9ad2ecab6b 100644 --- a/ext/json/php_json.h +++ b/ext/json/php_json.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | @@ -50,7 +50,7 @@ ZEND_END_MODULE_GLOBALS(json) PHP_JSON_API void php_json_encode(smart_str *buf, zval *val, int options TSRMLS_DC); PHP_JSON_API void php_json_decode_ex(zval *return_value, char *str, int str_len, int options, long depth TSRMLS_DC); -extern zend_class_entry *php_json_serializable_ce; +extern PHP_JSON_API zend_class_entry *php_json_serializable_ce; /* json_encode() options */ diff --git a/ext/json/tests/bug64874_part1.phpt b/ext/json/tests/bug64874_part1.phpt new file mode 100644 index 0000000000..6b79b8dc04 --- /dev/null +++ b/ext/json/tests/bug64874_part1.phpt @@ -0,0 +1,117 @@ +--TEST-- +Whitespace part of bug #64874 ("json_decode handles whitespace and case-sensitivity incorrectly") +--SKIPIF-- +<?php if (!extension_loaded("json")) print "skip"; ?> +--FILE-- +<?php +function decode($json) { + var_dump(json_decode($json)); + var_dump(json_last_error() !== 0); + echo "\n"; +} + +// Leading whitespace should be ignored +decode(" true"); +decode("\ttrue"); +decode("\ntrue"); +decode("\rtrue"); + +// So should trailing whitespace +decode("true "); +decode("true\t"); +decode("true\n"); +decode("true\r"); + +// And so should the combination of both +decode(" true "); +decode(" true\t"); +decode(" true\n"); +decode(" true\r"); +decode("\ttrue "); +decode("\ttrue\t"); +decode("\ttrue\n"); +decode("\ttrue\r"); +decode("\ntrue "); +decode("\ntrue\t"); +decode("\ntrue\n"); +decode("\ntrue\r"); +decode("\rtrue "); +decode("\rtrue\t"); +decode("\rtrue\n"); +decode("\rtrue\r"); + +echo "Done\n"; +--EXPECT-- +bool(true) +bool(false) + +bool(true) +bool(false) + +bool(true) +bool(false) + +bool(true) +bool(false) + +bool(true) +bool(false) + +bool(true) +bool(false) + +bool(true) +bool(false) + +bool(true) +bool(false) + +bool(true) +bool(false) + +bool(true) +bool(false) + +bool(true) +bool(false) + +bool(true) +bool(false) + +bool(true) +bool(false) + +bool(true) +bool(false) + +bool(true) +bool(false) + +bool(true) +bool(false) + +bool(true) +bool(false) + +bool(true) +bool(false) + +bool(true) +bool(false) + +bool(true) +bool(false) + +bool(true) +bool(false) + +bool(true) +bool(false) + +bool(true) +bool(false) + +bool(true) +bool(false) + +Done diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c index 71d57d6d9b..9d3a710b60 100644 --- a/ext/ldap/ldap.c +++ b/ext/ldap/ldap.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | @@ -152,6 +152,15 @@ PHP_MINIT_FUNCTION(ldap) REGISTER_LONG_CONSTANT("LDAP_DEREF_FINDING", LDAP_DEREF_FINDING, CONST_PERSISTENT | CONST_CS); REGISTER_LONG_CONSTANT("LDAP_DEREF_ALWAYS", LDAP_DEREF_ALWAYS, CONST_PERSISTENT | CONST_CS); + /* Constants to be used with ldap_modify_batch() */ + REGISTER_LONG_CONSTANT("LDAP_MODIFY_BATCH_ADD", LDAP_MODIFY_BATCH_ADD, CONST_PERSISTENT | CONST_CS); + REGISTER_LONG_CONSTANT("LDAP_MODIFY_BATCH_REMOVE", LDAP_MODIFY_BATCH_REMOVE, CONST_PERSISTENT | CONST_CS); + REGISTER_LONG_CONSTANT("LDAP_MODIFY_BATCH_REMOVE_ALL", LDAP_MODIFY_BATCH_REMOVE_ALL, CONST_PERSISTENT | CONST_CS); + REGISTER_LONG_CONSTANT("LDAP_MODIFY_BATCH_REPLACE", LDAP_MODIFY_BATCH_REPLACE, CONST_PERSISTENT | CONST_CS); + REGISTER_STRING_CONSTANT("LDAP_MODIFY_BATCH_ATTRIB", LDAP_MODIFY_BATCH_ATTRIB, CONST_PERSISTENT | CONST_CS); + REGISTER_STRING_CONSTANT("LDAP_MODIFY_BATCH_MODTYPE", LDAP_MODIFY_BATCH_MODTYPE, CONST_PERSISTENT | CONST_CS); + REGISTER_STRING_CONSTANT("LDAP_MODIFY_BATCH_VALUES", LDAP_MODIFY_BATCH_VALUES, CONST_PERSISTENT | CONST_CS); + #if (LDAP_API_VERSION > 2000) || HAVE_NSLDAP || HAVE_ORALDAP_10 /* LDAP options */ REGISTER_LONG_CONSTANT("LDAP_OPT_DEREF", LDAP_OPT_DEREF, CONST_PERSISTENT | CONST_CS); @@ -1432,6 +1441,355 @@ PHP_FUNCTION(ldap_delete) } /* }}} */ +/* {{{ _ldap_str_equal_to_const + */ +static int _ldap_str_equal_to_const(const char *str, uint str_len, const char *cstr) +{ + int i; + + if (strlen(cstr) != str_len) + return 0; + + for (i = 0; i < str_len; ++i) { + if (str[i] != cstr[i]) { + return 0; + } + } + + return 1; +} +/* }}} */ + +/* {{{ _ldap_strlen_max + */ +static int _ldap_strlen_max(const char *str, uint max_len) +{ + int i; + + for (i = 0; i < max_len; ++i) { + if (str[i] == '\0') { + return i; + } + } + + return max_len; +} +/* }}} */ + +/* {{{ _ldap_hash_fetch + */ +static void _ldap_hash_fetch(zval *hashTbl, const char *key, zval **out) +{ + zval **fetched; + if (zend_hash_find(Z_ARRVAL_P(hashTbl), key, strlen(key)+1, (void **) &fetched) == SUCCESS) { + *out = *fetched; + } + else { + *out = NULL; + } +} +/* }}} */ + +/* {{{ proto bool ldap_modify_batch(resource link, string dn, array modifs) + Perform multiple modifications as part of one operation */ +PHP_FUNCTION(ldap_modify_batch) +{ + ldap_linkdata *ld; + zval *link, *mods, *mod, *modinfo, *modval; + zval *attrib, *modtype, *vals; + zval **fetched; + char *dn; + int dn_len; + int i, j, k; + int num_mods, num_modprops, num_modvals; + LDAPMod **ldap_mods; + uint oper; + + /* + $mods = array( + array( + "attrib" => "unicodePwd", + "modtype" => LDAP_MODIFY_BATCH_REMOVE, + "values" => array($oldpw) + ), + array( + "attrib" => "unicodePwd", + "modtype" => LDAP_MODIFY_BATCH_ADD, + "values" => array($newpw) + ), + array( + "attrib" => "userPrincipalName", + "modtype" => LDAP_MODIFY_BATCH_REPLACE, + "values" => array("janitor@corp.contoso.com") + ), + array( + "attrib" => "userCert", + "modtype" => LDAP_MODIFY_BATCH_REMOVE_ALL + ) + ); + */ + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsa", &link, &dn, &dn_len, &mods) != SUCCESS) { + return; + } + + ZEND_FETCH_RESOURCE(ld, ldap_linkdata *, &link, -1, "ldap link", le_link); + + /* perform validation */ + { + char *modkey; + uint modkeylen; + long modtype; + + /* to store the wrongly-typed keys */ + ulong tmpUlong; + + /* make sure the DN contains no NUL bytes */ + if (_ldap_strlen_max(dn, dn_len) != dn_len) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "DN must not contain NUL bytes"); + RETURN_FALSE; + } + + /* make sure the top level is a normal array */ + zend_hash_internal_pointer_reset(Z_ARRVAL_P(mods)); + if (zend_hash_get_current_key_type(Z_ARRVAL_P(mods)) != HASH_KEY_IS_LONG) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Modifications array must not be string-indexed"); + RETURN_FALSE; + } + + num_mods = zend_hash_num_elements(Z_ARRVAL_P(mods)); + + for (i = 0; i < num_mods; i++) { + /* is the numbering consecutive? */ + if (zend_hash_index_find(Z_ARRVAL_P(mods), i, (void **) &fetched) != SUCCESS) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Modifications array must have consecutive indices 0, 1, ..."); + RETURN_FALSE; + } + mod = *fetched; + + /* is it an array? */ + if (Z_TYPE_P(mod) != IS_ARRAY) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Each entry of modifications array must be an array itself"); + RETURN_FALSE; + } + + /* for the modification hashtable... */ + zend_hash_internal_pointer_reset(Z_ARRVAL_P(mod)); + num_modprops = zend_hash_num_elements(Z_ARRVAL_P(mod)); + + for (j = 0; j < num_modprops; j++) { + /* are the keys strings? */ + if (zend_hash_get_current_key_ex(Z_ARRVAL_P(mod), &modkey, &modkeylen, &tmpUlong, 0, NULL) != HASH_KEY_IS_STRING) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Each entry of modifications array must be string-indexed"); + RETURN_FALSE; + } + + /* modkeylen includes the terminating NUL byte; remove that */ + --modkeylen; + + /* is this a valid entry? */ + if ( + !_ldap_str_equal_to_const(modkey, modkeylen, LDAP_MODIFY_BATCH_ATTRIB) && + !_ldap_str_equal_to_const(modkey, modkeylen, LDAP_MODIFY_BATCH_MODTYPE) && + !_ldap_str_equal_to_const(modkey, modkeylen, LDAP_MODIFY_BATCH_VALUES) + ) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "The only allowed keys in entries of the modifications array are '" LDAP_MODIFY_BATCH_ATTRIB "', '" LDAP_MODIFY_BATCH_MODTYPE "' and '" LDAP_MODIFY_BATCH_VALUES "'"); + RETURN_FALSE; + } + + zend_hash_get_current_data(Z_ARRVAL_P(mod), (void **) &fetched); + modinfo = *fetched; + + /* does the value type match the key? */ + if (_ldap_str_equal_to_const(modkey, modkeylen, LDAP_MODIFY_BATCH_ATTRIB)) { + if (Z_TYPE_P(modinfo) != IS_STRING) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "A '" LDAP_MODIFY_BATCH_ATTRIB "' value must be a string"); + RETURN_FALSE; + } + + if (Z_STRLEN_P(modinfo) != _ldap_strlen_max(Z_STRVAL_P(modinfo), Z_STRLEN_P(modinfo))) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "A '" LDAP_MODIFY_BATCH_ATTRIB "' value must not contain NUL bytes"); + RETURN_FALSE; + } + } + else if (_ldap_str_equal_to_const(modkey, modkeylen, LDAP_MODIFY_BATCH_MODTYPE)) { + if (Z_TYPE_P(modinfo) != IS_LONG) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "A '" LDAP_MODIFY_BATCH_MODTYPE "' value must be a long"); + RETURN_FALSE; + } + + /* is the value in range? */ + modtype = Z_LVAL_P(modinfo); + if ( + modtype != LDAP_MODIFY_BATCH_ADD && + modtype != LDAP_MODIFY_BATCH_REMOVE && + modtype != LDAP_MODIFY_BATCH_REPLACE && + modtype != LDAP_MODIFY_BATCH_REMOVE_ALL + ) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "The '" LDAP_MODIFY_BATCH_MODTYPE "' value must match one of the LDAP_MODIFY_BATCH_* constants"); + RETURN_FALSE; + } + + /* if it's REMOVE_ALL, there must not be a values array; otherwise, there must */ + if (modtype == LDAP_MODIFY_BATCH_REMOVE_ALL) { + if (zend_hash_exists(Z_ARRVAL_P(mod), LDAP_MODIFY_BATCH_VALUES, strlen(LDAP_MODIFY_BATCH_VALUES) + 1)) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "If '" LDAP_MODIFY_BATCH_MODTYPE "' is LDAP_MODIFY_BATCH_REMOVE_ALL, a '" LDAP_MODIFY_BATCH_VALUES "' array must not be provided"); + RETURN_FALSE; + } + } + else { + if (!zend_hash_exists(Z_ARRVAL_P(mod), LDAP_MODIFY_BATCH_VALUES, strlen(LDAP_MODIFY_BATCH_VALUES) + 1)) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "If '" LDAP_MODIFY_BATCH_MODTYPE "' is not LDAP_MODIFY_BATCH_REMOVE_ALL, a '" LDAP_MODIFY_BATCH_VALUES "' array must be provided"); + RETURN_FALSE; + } + } + } + else if (_ldap_str_equal_to_const(modkey, modkeylen, LDAP_MODIFY_BATCH_VALUES)) { + if (Z_TYPE_P(modinfo) != IS_ARRAY) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "A '" LDAP_MODIFY_BATCH_VALUES "' value must be an array"); + RETURN_FALSE; + } + + /* is the array not empty? */ + zend_hash_internal_pointer_reset(Z_ARRVAL_P(modinfo)); + num_modvals = zend_hash_num_elements(Z_ARRVAL_P(modinfo)); + if (num_modvals == 0) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "A '" LDAP_MODIFY_BATCH_VALUES "' array must have at least one element"); + RETURN_FALSE; + } + + /* are its keys integers? */ + if (zend_hash_get_current_key_type(Z_ARRVAL_P(modinfo)) != HASH_KEY_IS_LONG) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "A '" LDAP_MODIFY_BATCH_VALUES "' array must not be string-indexed"); + RETURN_FALSE; + } + + /* are the keys consecutive? */ + for (k = 0; k < num_modvals; k++) { + if (zend_hash_index_find(Z_ARRVAL_P(modinfo), k, (void **) &fetched) != SUCCESS) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "A '" LDAP_MODIFY_BATCH_VALUES "' array must have consecutive indices 0, 1, ..."); + RETURN_FALSE; + } + modval = *fetched; + + /* is the data element a string? */ + if (Z_TYPE_P(modval) != IS_STRING) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Each element of a '" LDAP_MODIFY_BATCH_VALUES "' array must be a string"); + RETURN_FALSE; + } + } + } + + zend_hash_move_forward(Z_ARRVAL_P(mod)); + } + } + } + /* validation was successful */ + + /* allocate array of modifications */ + ldap_mods = safe_emalloc((num_mods+1), sizeof(LDAPMod *), 0); + + /* for each modification */ + for (i = 0; i < num_mods; i++) { + /* allocate the modification struct */ + ldap_mods[i] = safe_emalloc(1, sizeof(LDAPMod), 0); + + /* fetch the relevant data */ + zend_hash_index_find(Z_ARRVAL_P(mods), i, (void **) &fetched); + mod = *fetched; + + _ldap_hash_fetch(mod, LDAP_MODIFY_BATCH_ATTRIB, &attrib); + _ldap_hash_fetch(mod, LDAP_MODIFY_BATCH_MODTYPE, &modtype); + _ldap_hash_fetch(mod, LDAP_MODIFY_BATCH_VALUES, &vals); + + /* map the modification type */ + switch (Z_LVAL_P(modtype)) { + case LDAP_MODIFY_BATCH_ADD: + oper = LDAP_MOD_ADD; + break; + case LDAP_MODIFY_BATCH_REMOVE: + case LDAP_MODIFY_BATCH_REMOVE_ALL: + oper = LDAP_MOD_DELETE; + break; + case LDAP_MODIFY_BATCH_REPLACE: + oper = LDAP_MOD_REPLACE; + break; + default: + php_error_docref(NULL TSRMLS_CC, E_ERROR, "Unknown and uncaught modification type."); + RETURN_FALSE; + } + + /* fill in the basic info */ + ldap_mods[i]->mod_op = oper | LDAP_MOD_BVALUES; + ldap_mods[i]->mod_type = estrndup(Z_STRVAL_P(attrib), Z_STRLEN_P(attrib)); + + if (Z_LVAL_P(modtype) == LDAP_MODIFY_BATCH_REMOVE_ALL) { + /* no values */ + ldap_mods[i]->mod_bvalues = NULL; + } + else { + /* allocate space for the values as part of this modification */ + num_modvals = zend_hash_num_elements(Z_ARRVAL_P(vals)); + ldap_mods[i]->mod_bvalues = safe_emalloc((num_modvals+1), sizeof(struct berval *), 0); + + /* for each value */ + for (j = 0; j < num_modvals; j++) { + /* fetch it */ + zend_hash_index_find(Z_ARRVAL_P(vals), j, (void **) &fetched); + modval = *fetched; + + /* allocate the data struct */ + ldap_mods[i]->mod_bvalues[j] = safe_emalloc(1, sizeof(struct berval), 0); + + /* fill it */ + ldap_mods[i]->mod_bvalues[j]->bv_len = Z_STRLEN_P(modval); + ldap_mods[i]->mod_bvalues[j]->bv_val = estrndup(Z_STRVAL_P(modval), Z_STRLEN_P(modval)); + } + + /* NULL-terminate values */ + ldap_mods[i]->mod_bvalues[num_modvals] = NULL; + } + } + + /* NULL-terminate modifications */ + ldap_mods[num_mods] = NULL; + + /* perform (finally) */ + if ((i = ldap_modify_ext_s(ld->link, dn, ldap_mods, NULL, NULL)) != LDAP_SUCCESS) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Batch Modify: %s", ldap_err2string(i)); + RETVAL_FALSE; + } else RETVAL_TRUE; + + /* clean up */ + { + for (i = 0; i < num_mods; i++) { + /* attribute */ + efree(ldap_mods[i]->mod_type); + + if (ldap_mods[i]->mod_bvalues != NULL) { + /* each BER value */ + for (j = 0; ldap_mods[i]->mod_bvalues[j] != NULL; j++) { + /* free the data bytes */ + efree(ldap_mods[i]->mod_bvalues[j]->bv_val); + + /* free the bvalue struct */ + efree(ldap_mods[i]->mod_bvalues[j]); + } + + /* the BER value array */ + efree(ldap_mods[i]->mod_bvalues); + } + + /* the modification */ + efree(ldap_mods[i]); + } + + /* the modifications array */ + efree(ldap_mods); + } +} +/* }}} */ + /* {{{ proto int ldap_errno(resource link) Get the current ldap error number */ PHP_FUNCTION(ldap_errno) @@ -2516,6 +2874,12 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_modify, 0, 0, 3) ZEND_ARG_INFO(0, entry) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_modify_batch, 0, 0, 3) + ZEND_ARG_INFO(0, link_identifier) + ZEND_ARG_INFO(0, dn) + ZEND_ARG_ARRAY_INFO(0, modifications_info, 0) +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_mod_add, 0, 0, 3) ZEND_ARG_INFO(0, link_identifier) ZEND_ARG_INFO(0, dn) @@ -2669,6 +3033,7 @@ const zend_function_entry ldap_functions[] = { PHP_FE(ldap_dn2ufn, arginfo_ldap_dn2ufn) PHP_FE(ldap_add, arginfo_ldap_add) PHP_FE(ldap_delete, arginfo_ldap_delete) + PHP_FE(ldap_modify_batch, arginfo_ldap_modify_batch) PHP_FALIAS(ldap_modify, ldap_mod_replace, arginfo_ldap_modify) /* additional functions for attribute based modifications, Gerrit Thomson */ diff --git a/ext/ldap/php_ldap.h b/ext/ldap/php_ldap.h index 2ed8fd822d..bd3731819d 100644 --- a/ext/ldap/php_ldap.h +++ b/ext/ldap/php_ldap.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | @@ -50,4 +50,14 @@ ZEND_END_MODULE_GLOBALS(ldap) #define phpext_ldap_ptr ldap_module_ptr +/* Constants for ldap_modify_batch */ +#define LDAP_MODIFY_BATCH_ADD 0x01 +#define LDAP_MODIFY_BATCH_REMOVE 0x02 +#define LDAP_MODIFY_BATCH_REMOVE_ALL 0x12 +#define LDAP_MODIFY_BATCH_REPLACE 0x03 + +#define LDAP_MODIFY_BATCH_ATTRIB "attrib" +#define LDAP_MODIFY_BATCH_MODTYPE "modtype" +#define LDAP_MODIFY_BATCH_VALUES "values" + #endif /* PHP_LDAP_H */ diff --git a/ext/ldap/tests/ldap_modify_batch_basic.phpt b/ext/ldap/tests/ldap_modify_batch_basic.phpt new file mode 100644 index 0000000000..4f6705c7e8 --- /dev/null +++ b/ext/ldap/tests/ldap_modify_batch_basic.phpt @@ -0,0 +1,109 @@ +--TEST-- +ldap_modify_batch() - Basic batch modify operation +--CREDITS-- +Patrick Allaert <patrickallaert@php.net> +Ondřej Hošek <ondra.hosek@gmail.com> +--SKIPIF-- +<?php require_once('skipif.inc'); ?> +<?php require_once('skipifbindfailure.inc'); ?> +--FILE-- +<?php +require "connect.inc"; + +$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version); +insert_dummy_data($link); + +$mods = array( + array( + "attrib" => "telephoneNumber", + "modtype" => LDAP_MODIFY_BATCH_ADD, + "values" => array( + "+1 555 5551717" + ) + ), + array( + "attrib" => "sn", + "modtype" => LDAP_MODIFY_BATCH_REPLACE, + "values" => array("Brown-Smith") + ), + array( + "attrib" => "description", + "modtype" => LDAP_MODIFY_BATCH_REMOVE_ALL + ) +); + +var_dump( + ldap_modify_batch($link, "cn=userA,dc=my-domain,dc=com", $mods), + ldap_get_entries($link, ldap_search($link, "dc=my-domain,dc=com", "(sn=Brown-Smith)")) +); +?> +===DONE=== +--CLEAN-- +<?php +require "connect.inc"; + +$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version); + +remove_dummy_data($link); +?> +--EXPECT-- +bool(true) +array(2) { + ["count"]=> + int(1) + [0]=> + array(12) { + ["objectclass"]=> + array(2) { + ["count"]=> + int(1) + [0]=> + string(6) "person" + } + [0]=> + string(11) "objectclass" + ["cn"]=> + array(2) { + ["count"]=> + int(1) + [0]=> + string(5) "userA" + } + [1]=> + string(2) "cn" + ["userpassword"]=> + array(2) { + ["count"]=> + int(1) + [0]=> + string(4) "oops" + } + [2]=> + string(12) "userpassword" + ["telephonenumber"]=> + array(3) { + ["count"]=> + int(2) + [0]=> + string(14) "xx-xx-xx-xx-xx" + [1]=> + string(14) "+1 555 5551717" + } + [3]=> + string(15) "telephonenumber" + ["sn"]=> + array(2) { + ["count"]=> + int(1) + [0]=> + string(11) "Brown-Smith" + } + [4]=> + string(2) "sn" + ["count"]=> + int(5) + ["dn"]=> + string(28) "cn=userA,dc=my-domain,dc=com" + } +} +===DONE=== diff --git a/ext/ldap/tests/ldap_modify_batch_error.phpt b/ext/ldap/tests/ldap_modify_batch_error.phpt new file mode 100644 index 0000000000..687c371c4d --- /dev/null +++ b/ext/ldap/tests/ldap_modify_batch_error.phpt @@ -0,0 +1,104 @@ +--TEST-- +ldap_modify_batch() - Batch modify operations that should fail +--CREDITS-- +Patrick Allaert <patrickallaert@php.net> +Ondřej Hošek <ondra.hosek@gmail.com> +--SKIPIF-- +<?php require_once('skipif.inc'); ?> +<?php require_once('skipifbindfailure.inc'); ?> +--FILE-- +<?php +require "connect.inc"; + +$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version); + +$addGivenName = array( + array( + "attrib" => "givenName", + "modtype" => LDAP_MODIFY_BATCH_ADD, + "values" => array("Jack") + ) +); + +// Too few parameters +var_dump(ldap_modify_batch()); +var_dump(ldap_modify_batch($link)); +var_dump(ldap_modify_batch($link, "dc=my-domain,dc=com")); + +// Too many parameters +var_dump(ldap_modify_batch($link, "dc=my-domain,dc=com", $addGivenName, "Invalid additional parameter")); + +// DN not found +var_dump(ldap_modify_batch($link, "dc=my-domain,dc=com", $addGivenName)); + +// Invalid DN +var_dump(ldap_modify_batch($link, "weirdAttribute=val", $addGivenName)); + +// prepare +$entry = array( + "objectClass" => array( + "top", + "dcObject", + "organization"), + "dc" => "my-domain", + "o" => "my-domain", +); + +ldap_add($link, "dc=my-domain,dc=com", $entry); + +// invalid domain +$mods = array( + array( + "attrib" => "dc", + "modtype" => LDAP_MODIFY_BATCH_REPLACE, + "values" => array("Wrong Domain") + ) +); + +var_dump(ldap_modify_batch($link, "dc=my-domain,dc=com", $mods)); + +// invalid attribute +$mods = array( + array( + "attrib" => "weirdAttribute", + "modtype" => LDAP_MODIFY_BATCH_ADD, + "values" => array("weirdVal", "anotherWeirdval") + ) +); + +var_dump(ldap_modify_batch($link, "dc=my-domain,dc=com", $mods)); +?> +===DONE=== +--CLEAN-- +<?php +require "connect.inc"; + +$link = ldap_connect_and_bind($host, $port, $user, $passwd, $protocol_version); + +ldap_delete($link, "dc=my-domain,dc=com"); +?> +--EXPECTF-- +Warning: ldap_modify_batch() expects exactly 3 parameters, 0 given in %s on line %d +NULL + +Warning: ldap_modify_batch() expects exactly 3 parameters, 1 given in %s on line %d +NULL + +Warning: ldap_modify_batch() expects exactly 3 parameters, 2 given in %s on line %d +NULL + +Warning: ldap_modify_batch() expects exactly 3 parameters, 4 given in %s on line %d +NULL + +Warning: ldap_modify_batch(): Batch Modify: No such object in %s on line %d +bool(false) + +Warning: ldap_modify_batch(): Batch Modify: Invalid DN syntax in %s on line %d +bool(false) + +Warning: ldap_modify_batch(): Batch Modify: Naming violation in %s on line %d +bool(false) + +Warning: ldap_modify_batch(): Batch Modify: Undefined attribute type in %s on line %d +bool(false) +===DONE=== diff --git a/ext/libxml/libxml.c b/ext/libxml/libxml.c index b1cb45db76..9bd8bfd6dd 100644 --- a/ext/libxml/libxml.c +++ b/ext/libxml/libxml.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | @@ -87,7 +87,7 @@ static PHP_MINIT_FUNCTION(libxml); static PHP_RINIT_FUNCTION(libxml); static PHP_MSHUTDOWN_FUNCTION(libxml); static PHP_MINFO_FUNCTION(libxml); -static int php_libxml_post_deactivate(); +static int php_libxml_post_deactivate(void); /* }}} */ @@ -869,7 +869,7 @@ static PHP_MSHUTDOWN_FUNCTION(libxml) return SUCCESS; } -static int php_libxml_post_deactivate() +static int php_libxml_post_deactivate(void) { TSRMLS_FETCH(); /* reset libxml generic error handling */ diff --git a/ext/libxml/php_libxml.h b/ext/libxml/php_libxml.h index 04f8b4933b..901e321aac 100644 --- a/ext/libxml/php_libxml.h +++ b/ext/libxml/php_libxml.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/mbstring/mb_gpc.c b/ext/mbstring/mb_gpc.c index 5ecc8f365e..8924b065c8 100644 --- a/ext/mbstring/mb_gpc.c +++ b/ext/mbstring/mb_gpc.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c index a42f2e8809..919d1f5a3a 100644 --- a/ext/mbstring/mbstring.c +++ b/ext/mbstring/mbstring.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/mbstring/mbstring.h b/ext/mbstring/mbstring.h index 70f9f48fb0..8e6310f75f 100644 --- a/ext/mbstring/mbstring.h +++ b/ext/mbstring/mbstring.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/mbstring/php_mbregex.c b/ext/mbstring/php_mbregex.c index 607921ebb6..4b1b924d06 100644 --- a/ext/mbstring/php_mbregex.c +++ b/ext/mbstring/php_mbregex.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/mbstring/php_mbregex.h b/ext/mbstring/php_mbregex.h index d5ae7529df..3ec224366a 100644 --- a/ext/mbstring/php_mbregex.h +++ b/ext/mbstring/php_mbregex.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/mbstring/php_unicode.c b/ext/mbstring/php_unicode.c index 9380045e6f..a1db6819e9 100644 --- a/ext/mbstring/php_unicode.c +++ b/ext/mbstring/php_unicode.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/mbstring/php_unicode.h b/ext/mbstring/php_unicode.h index b1e395cac1..5932b8d2da 100644 --- a/ext/mbstring/php_unicode.h +++ b/ext/mbstring/php_unicode.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/mbstring/tests/zend_multibyte-01.phpt b/ext/mbstring/tests/zend_multibyte-01.phpt index d96e0f07d3..f2403abcac 100644 --- a/ext/mbstring/tests/zend_multibyte-01.phpt +++ b/ext/mbstring/tests/zend_multibyte-01.phpt @@ -1,14 +1,9 @@ --TEST-- zend multibyte (1) --SKIPIF-- -<?php -ini_set("mbstring.script_encoding","SJIS"); -if (ini_set("mbstring.script_encoding","SJIS") != "SJIS") { - die("skip zend-multibyte is not available"); -} -?> --INI-- -mbstring.script_encoding=Shift_JIS +zend.multibyte=On +zend.script_encoding=Shift_JIS mbstring.internal_encoding=Shift_JIS --FILE-- <?php diff --git a/ext/mbstring/tests/zend_multibyte-02.phpt b/ext/mbstring/tests/zend_multibyte-02.phpt index c94dee5a28..ebc10b48be 100644 --- a/ext/mbstring/tests/zend_multibyte-02.phpt +++ b/ext/mbstring/tests/zend_multibyte-02.phpt @@ -1,18 +1,14 @@ --TEST-- zend multibyte (2) ---SKIPIF-- -<?php -ini_set("mbstring.script_encoding","SJIS"); -if (ini_set("mbstring.script_encoding","SJIS") != "SJIS") { - die("skip zend-multibyte is not available"); -} -?> +--XFAIL-- +https://bugs.php.net/bug.php?id=66582 --INI-- -mbstring.script_encoding=UTF-8 +zend.multibyte=On +zend.script_encoding=UTF-8 mbstring.internal_encoding=CP932 --FILE-- <?php var_dump(bin2hex("テスト")); ?> ---EXPECT-- -string(12) "836583588367" +--EXPECTF-- +php: Zend/zend_language_scanner.l:%d: encoding_filter_script_to_internal: Assertion `internal_encoding && zend_multibyte_check_lexer_compatibility(internal_encoding)' failed. diff --git a/ext/mbstring/tests/zend_multibyte-03.phpt b/ext/mbstring/tests/zend_multibyte-03.phpt index 46a262c32e..99c58bce70 100644 --- a/ext/mbstring/tests/zend_multibyte-03.phpt +++ b/ext/mbstring/tests/zend_multibyte-03.phpt @@ -1,14 +1,9 @@ --TEST-- zend multibyte (3) --SKIPIF-- -<?php -ini_set("mbstring.script_encoding","SJIS"); -if (ini_set("mbstring.script_encoding","SJIS") != "SJIS") { - die("skip zend-multibyte is not available"); -} -?> --INI-- -mbstring.script_encoding=UTF-8 +zend.multibyte=On +zend.script_encoding=UTF-8 mbstring.internal_encoding=EUC-JP --FILE-- <?php diff --git a/ext/mbstring/tests/zend_multibyte-04.phpt b/ext/mbstring/tests/zend_multibyte-04.phpt index f1295b6afe..e7fdf81cdd 100644 --- a/ext/mbstring/tests/zend_multibyte-04.phpt +++ b/ext/mbstring/tests/zend_multibyte-04.phpt @@ -1,14 +1,9 @@ --TEST-- zend multibyte (4) --SKIPIF-- -<?php -ini_set("mbstring.script_encoding","SJIS"); -if (ini_set("mbstring.script_encoding","SJIS") != "SJIS") { - die("skip zend-multibyte is not available"); -} -?> --INI-- -mbstring.script_encoding=CP932 +zend.multibyte=On +zend.script_encoding=CP932 mbstring.internal_encoding=UTF-8 --FILE-- <?php diff --git a/ext/mbstring/tests/zend_multibyte-05.phpt b/ext/mbstring/tests/zend_multibyte-05.phpt index 0a01c231fc..3dd56d043d 100644 --- a/ext/mbstring/tests/zend_multibyte-05.phpt +++ b/ext/mbstring/tests/zend_multibyte-05.phpt @@ -1,14 +1,9 @@ --TEST-- zend multibyte (5) --SKIPIF-- -<?php -ini_set("mbstring.script_encoding","SJIS"); -if (ini_set("mbstring.script_encoding","SJIS") != "SJIS") { - die("skip zend-multibyte is not available"); -} -?> --INI-- -mbstring.script_encoding=EUC-JP +zend.multibyte=On +zend.script_encoding=EUC-JP mbstring.internal_encoding=UTF-8 --FILE-- <?php diff --git a/ext/mbstring/tests/zend_multibyte-06.phpt b/ext/mbstring/tests/zend_multibyte-06.phpt index 9acd6a951d..e0b4ead545 100644 --- a/ext/mbstring/tests/zend_multibyte-06.phpt +++ b/ext/mbstring/tests/zend_multibyte-06.phpt @@ -1,19 +1,15 @@ --TEST-- zend multibyte (6) ---SKIPIF-- -<?php -ini_set("mbstring.script_encoding","SJIS"); -if (ini_set("mbstring.script_encoding","SJIS") != "SJIS") { - die("skip zend-multibyte is not available"); -} -?> +--XFAIL-- +https://bugs.php.net/bug.php?id=66582 --INI-- -mbstring.script_encoding=EUC-JP +zend.multibyte=On +zend.script_encoding=EUC-JP mbstring.internal_encoding=CP932 --FILE-- <?php declare(encoding="UTF-8"); var_dump(bin2hex("テスト")); ?> ---EXPECT-- -string(12) "836583588367" +--EXPECTF-- +php: Zend/zend_language_scanner.l:%d: encoding_filter_script_to_internal: Assertion `internal_encoding && zend_multibyte_check_lexer_compatibility(internal_encoding)' failed. diff --git a/ext/mbstring/tests/zend_multibyte-07.phpt b/ext/mbstring/tests/zend_multibyte-07.phpt index 30305f5fdf..08db1d0f70 100644 --- a/ext/mbstring/tests/zend_multibyte-07.phpt +++ b/ext/mbstring/tests/zend_multibyte-07.phpt @@ -1,14 +1,11 @@ --TEST-- zend multibyte (7) --SKIPIF-- -<?php -ini_set("mbstring.script_encoding","SJIS"); -if (ini_set("mbstring.script_encoding","SJIS") != "SJIS") { - die("skip zend-multibyte is not available"); -} -?> +--XFAIL-- +https://bugs.php.net/bug.php?id=66582 --INI-- -mbstring.script_encoding=ISO-8859-1 +zend.multibyte=On +zend.script_encoding=ISO-8859-1 mbstring.internal_encoding=EUC-JP --FILE-- <?php diff --git a/ext/mbstring/tests/zend_multibyte-08.phpt b/ext/mbstring/tests/zend_multibyte-08.phpt index ab27461355..488e2a00ca 100644 --- a/ext/mbstring/tests/zend_multibyte-08.phpt +++ b/ext/mbstring/tests/zend_multibyte-08.phpt @@ -1,14 +1,9 @@ --TEST-- zend multibyte (8) --SKIPIF-- -<?php -ini_set("mbstring.script_encoding","SJIS"); -if (ini_set("mbstring.script_encoding","SJIS") != "SJIS") { - die("skip zend-multibyte is not available"); -} -?> --INI-- -mbstring.script_encoding=ISO-8859-1 +zend.multibyte=On +zend.script_encoding=ISO-8859-1 mbstring.internal_encoding=UTF-8 --FILE-- <?php diff --git a/ext/mbstring/tests/zend_multibyte-09.phpt b/ext/mbstring/tests/zend_multibyte-09.phpt index 79ee435aa0..8ad00b4e1e 100644 --- a/ext/mbstring/tests/zend_multibyte-09.phpt +++ b/ext/mbstring/tests/zend_multibyte-09.phpt @@ -1,14 +1,11 @@ --TEST-- zend multibyte (9) --SKIPIF-- -<?php -ini_set("mbstring.script_encoding","SJIS"); -if (ini_set("mbstring.script_encoding","SJIS") != "SJIS") { - die("skip zend-multibyte is not available"); -} -?> +--XFAIL-- +https://bugs.php.net/bug.php?id=66582 --INI-- -mbstring.script_encoding=cp1251 +zend.multibyte=On +zend.script_encoding=cp1251 mbstring.internal_encoding=UTF-8 --FILE-- <?php diff --git a/ext/mbstring/tests/zend_multibyte-10.phpt b/ext/mbstring/tests/zend_multibyte-10.phpt index 435c339752..139d973b95 100644 --- a/ext/mbstring/tests/zend_multibyte-10.phpt +++ b/ext/mbstring/tests/zend_multibyte-10.phpt @@ -1,12 +1,8 @@ --TEST-- zend multibyte (10) --SKIPIF-- -<?php -ini_set("mbstring.script_encoding","SJIS"); -if (ini_set("mbstring.script_encoding","SJIS") != "SJIS") { - die("skip zend-multibyte is not available"); -} -?> +--INI-- +zend.multibyte=1 --FILE-- <?php declare(encoding="ISO-8859-15"); diff --git a/ext/mbstring/tests/zend_multibyte-11.phpt b/ext/mbstring/tests/zend_multibyte-11.phpt index b79e4339ba..c6e45fa5cd 100644 --- a/ext/mbstring/tests/zend_multibyte-11.phpt +++ b/ext/mbstring/tests/zend_multibyte-11.phpt @@ -1,12 +1,8 @@ --TEST-- zend multibyte (11) --SKIPIF-- -<?php -ini_set("mbstring.script_encoding","SJIS"); -if (ini_set("mbstring.script_encoding","SJIS") != "SJIS") { - die("skip zend-multibyte is not available"); -} -?> +--INI-- +zend.multibyte=1 --FILE-- <?php declare(encoding="ISO-8859-15") { diff --git a/ext/mbstring/tests/zend_multibyte-12.phpt b/ext/mbstring/tests/zend_multibyte-12.phpt index e1c8ce52d1..90968e8820 100644 --- a/ext/mbstring/tests/zend_multibyte-12.phpt +++ b/ext/mbstring/tests/zend_multibyte-12.phpt @@ -1,12 +1,8 @@ --TEST-- zend multibyte (12) --SKIPIF-- -<?php -ini_set("mbstring.script_encoding","SJIS"); -if (ini_set("mbstring.script_encoding","SJIS") != "SJIS") { - die("skip zend-multibyte is not available"); -} -?> +--INI-- +zend.multibyte=1 --FILE-- <?php declare(encoding="ISO-8859-15"); diff --git a/ext/mbstring/tests/zend_multibyte-13.phpt b/ext/mbstring/tests/zend_multibyte-13.phpt index e601a6ceed..6eaef985f5 100644 --- a/ext/mbstring/tests/zend_multibyte-13.phpt +++ b/ext/mbstring/tests/zend_multibyte-13.phpt @@ -1,14 +1,9 @@ --TEST-- zend multibyte (13) --SKIPIF-- -<?php -ini_set("mbstring.script_encoding","SJIS"); -if (ini_set("mbstring.script_encoding","SJIS") != "SJIS") { - die("skip zend-multibyte is not available"); -} -?> --INI-- -mbstring.script_encoding=UTF-8 +zend.multibyte=On +zend.script_encoding=UTF-8 mbstring.internal_encoding=ISO-8859-1 --FILE-- <?php diff --git a/ext/mbstring/tests/zend_multibyte-14.phpt b/ext/mbstring/tests/zend_multibyte-14.phpt index 04bc409fb6..98c2f87e25 100644 --- a/ext/mbstring/tests/zend_multibyte-14.phpt +++ b/ext/mbstring/tests/zend_multibyte-14.phpt @@ -1,14 +1,9 @@ --TEST-- zend multibyte (14) --SKIPIF-- -<?php -ini_set("mbstring.script_encoding","SJIS"); -if (ini_set("mbstring.script_encoding","SJIS") != "SJIS") { - die("skip zend-multibyte is not available"); -} -?> --INI-- -mbstring.script_encoding=UTF-8 +zend.multibyte=On +zend.script_encoding=UTF-8 mbstring.internal_encoding=UTF-8 --FILE-- <?php diff --git a/ext/mcrypt/mcrypt.c b/ext/mcrypt/mcrypt.c index 0fcddddbd0..55302c77f8 100644 --- a/ext/mcrypt/mcrypt.c +++ b/ext/mcrypt/mcrypt.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/mcrypt/mcrypt_filter.c b/ext/mcrypt/mcrypt_filter.c index da8215bd9e..cc32be649a 100644 --- a/ext/mcrypt/mcrypt_filter.c +++ b/ext/mcrypt/mcrypt_filter.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/mcrypt/php_mcrypt.h b/ext/mcrypt/php_mcrypt.h index 4eb2c56f0e..9dfa1d8185 100644 --- a/ext/mcrypt/php_mcrypt.h +++ b/ext/mcrypt/php_mcrypt.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/mcrypt/php_mcrypt_filter.h b/ext/mcrypt/php_mcrypt_filter.h index 0139130328..bfb0d7288f 100644 --- a/ext/mcrypt/php_mcrypt_filter.h +++ b/ext/mcrypt/php_mcrypt_filter.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/mssql/php_mssql.c b/ext/mssql/php_mssql.c index fbeaa60ef0..5b50216914 100644 --- a/ext/mssql/php_mssql.c +++ b/ext/mssql/php_mssql.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/mssql/php_mssql.h b/ext/mssql/php_mssql.h index b73c842046..463a030ab1 100644 --- a/ext/mssql/php_mssql.h +++ b/ext/mssql/php_mssql.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/mysql/php_mysql.c b/ext/mysql/php_mysql.c index 078b402ff4..44561a1aa8 100644 --- a/ext/mysql/php_mysql.c +++ b/ext/mysql/php_mysql.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/mysql/php_mysql.h b/ext/mysql/php_mysql.h index 7b9ab8d6fb..0368140580 100644 --- a/ext/mysql/php_mysql.h +++ b/ext/mysql/php_mysql.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/mysql/php_mysql_structs.h b/ext/mysql/php_mysql_structs.h index bf09b24b0c..ee1286d989 100644 --- a/ext/mysql/php_mysql_structs.h +++ b/ext/mysql/php_mysql_structs.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c index 2710b9de23..cbeb18349e 100644 --- a/ext/mysqli/mysqli.c +++ b/ext/mysqli/mysqli.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | @@ -176,8 +176,11 @@ void php_clear_stmt_bind(MY_STMT *stmt TSRMLS_DC) php_free_stmt_bind_buffer(stmt->param, FETCH_SIMPLE); /* Clean output bind */ php_free_stmt_bind_buffer(stmt->result, FETCH_RESULT); -#endif + if (stmt->link_handle) { + zend_objects_store_del_ref_by_handle(stmt->link_handle TSRMLS_CC); + } +#endif if (stmt->query) { efree(stmt->query); } @@ -1055,6 +1058,10 @@ PHP_FUNCTION(mysqli_stmt_construct) efree(stmt); RETURN_FALSE; } +#ifndef MYSQLI_USE_MYSQLND + stmt->link_handle = Z_OBJ_HANDLE(*mysql_link); + zend_objects_store_add_ref_by_handle(stmt->link_handle TSRMLS_CC); +#endif mysqli_resource = (MYSQLI_RESOURCE *)ecalloc (1, sizeof(MYSQLI_RESOURCE)); mysqli_resource->ptr = (void *)stmt; diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c index 2cda0aa903..0b28a43ba7 100644 --- a/ext/mysqli/mysqli_api.c +++ b/ext/mysqli/mysqli_api.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | @@ -384,7 +384,7 @@ mysqli_stmt_bind_result_do_bind(MY_STMT *stmt, zval ***args, unsigned int argc, /* Changed to my_bool in MySQL 5.1. See MySQL Bug #16144 */ my_bool tmp; #else - uint tmp = 0; + ulong tmp = 0; #endif stmt->result.buf[ofs].type = IS_STRING; /* @@ -1840,6 +1840,10 @@ PHP_FUNCTION(mysqli_prepare) efree(stmt); RETURN_FALSE; } +#ifndef MYSQLI_USE_MYSQLND + stmt->link_handle = Z_OBJ_HANDLE(*mysql_link); + zend_objects_store_add_ref_by_handle(stmt->link_handle TSRMLS_CC); +#endif mysqli_resource = (MYSQLI_RESOURCE *)ecalloc (1, sizeof(MYSQLI_RESOURCE)); mysqli_resource->ptr = (void *)stmt; @@ -2368,6 +2372,10 @@ PHP_FUNCTION(mysqli_stmt_init) efree(stmt); RETURN_FALSE; } +#ifndef MYSQLI_USE_MYSQLND + stmt->link_handle = Z_OBJ_HANDLE(*mysql_link); + zend_objects_store_add_ref_by_handle(stmt->link_handle TSRMLS_CC); +#endif mysqli_resource = (MYSQLI_RESOURCE *)ecalloc (1, sizeof(MYSQLI_RESOURCE)); mysqli_resource->status = MYSQLI_STATUS_INITIALIZED; diff --git a/ext/mysqli/mysqli_driver.c b/ext/mysqli/mysqli_driver.c index 8684edcb47..d90d37c2ec 100644 --- a/ext/mysqli/mysqli_driver.c +++ b/ext/mysqli/mysqli_driver.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/mysqli/mysqli_embedded.c b/ext/mysqli/mysqli_embedded.c index 3693777b25..e56e936f63 100644 --- a/ext/mysqli/mysqli_embedded.c +++ b/ext/mysqli/mysqli_embedded.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/mysqli/mysqli_exception.c b/ext/mysqli/mysqli_exception.c index dafc3098c7..82cf5cd7bf 100644 --- a/ext/mysqli/mysqli_exception.c +++ b/ext/mysqli/mysqli_exception.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/mysqli/mysqli_fe.c b/ext/mysqli/mysqli_fe.c index 8bcb02fdc5..1f6cc32d00 100644 --- a/ext/mysqli/mysqli_fe.c +++ b/ext/mysqli/mysqli_fe.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/mysqli/mysqli_fe.h b/ext/mysqli/mysqli_fe.h index d3e900003e..d9247644a8 100644 --- a/ext/mysqli/mysqli_fe.h +++ b/ext/mysqli/mysqli_fe.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/mysqli/mysqli_libmysql.h b/ext/mysqli/mysqli_libmysql.h index 3a7b91b995..87c53ce30e 100644 --- a/ext/mysqli/mysqli_libmysql.h +++ b/ext/mysqli/mysqli_libmysql.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/mysqli/mysqli_nonapi.c b/ext/mysqli/mysqli_nonapi.c index e1557efce1..60d185dcca 100644 --- a/ext/mysqli/mysqli_nonapi.c +++ b/ext/mysqli/mysqli_nonapi.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | @@ -777,7 +777,7 @@ PHP_FUNCTION(mysqli_poll) MYSQLND **new_r_array = NULL, **new_e_array = NULL, **new_dont_poll_array = NULL; long sec = 0, usec = 0; enum_func_status ret; - uint desc_num; + int desc_num; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a!a!al|l", &r_array, &e_array, &dont_poll_array, &sec, &usec) == FAILURE) { return; diff --git a/ext/mysqli/mysqli_priv.h b/ext/mysqli/mysqli_priv.h index f85f029571..a583f4f0e2 100644 --- a/ext/mysqli/mysqli_priv.h +++ b/ext/mysqli/mysqli_priv.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/mysqli/mysqli_prop.c b/ext/mysqli/mysqli_prop.c index f50371bf0d..1a4fb1e3ce 100644 --- a/ext/mysqli/mysqli_prop.c +++ b/ext/mysqli/mysqli_prop.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/mysqli/mysqli_report.c b/ext/mysqli/mysqli_report.c index 52135ce43e..bdd3adaf5f 100644 --- a/ext/mysqli/mysqli_report.c +++ b/ext/mysqli/mysqli_report.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/mysqli/mysqli_report.h b/ext/mysqli/mysqli_report.h index 34d0a661ff..637586b3c4 100644 --- a/ext/mysqli/mysqli_report.h +++ b/ext/mysqli/mysqli_report.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/mysqli/mysqli_result_iterator.c b/ext/mysqli/mysqli_result_iterator.c index 0f5ccdd63d..98d854838c 100644 --- a/ext/mysqli/mysqli_result_iterator.c +++ b/ext/mysqli/mysqli_result_iterator.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/mysqli/mysqli_warning.c b/ext/mysqli/mysqli_warning.c index 25653e3358..e100319e61 100644 --- a/ext/mysqli/mysqli_warning.c +++ b/ext/mysqli/mysqli_warning.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/mysqli/php_mysqli.h b/ext/mysqli/php_mysqli.h index 6dac3f0979..e036cf42b7 100644 --- a/ext/mysqli/php_mysqli.h +++ b/ext/mysqli/php_mysqli.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/mysqli/php_mysqli_structs.h b/ext/mysqli/php_mysqli_structs.h index 1f7e761c40..d2fb34b908 100644 --- a/ext/mysqli/php_mysqli_structs.h +++ b/ext/mysqli/php_mysqli_structs.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | @@ -116,6 +116,10 @@ typedef struct { BIND_BUFFER param; BIND_BUFFER result; char *query; +#ifndef MYSQLI_USE_MYSQLND + /* used to manage refcount with libmysql (already implement in mysqlnd) */ + zend_object_handle link_handle; +#endif } MY_STMT; typedef struct { diff --git a/ext/mysqli/tests/bug66043.phpt b/ext/mysqli/tests/bug66043.phpt new file mode 100644 index 0000000000..d0e8b1c3d3 --- /dev/null +++ b/ext/mysqli/tests/bug66043.phpt @@ -0,0 +1,24 @@ +--TEST-- +Bug #66043 (Segfault calling bind_param() on mysqli) +--SKIPIF-- +<?php +require_once('skipif.inc'); +require_once("connect.inc"); +if ($IS_MYSQLND) { + die("skip libmysql only test"); +} +require_once('skipifconnectfailure.inc'); +?> +--FILE-- +<?php +require 'connect.inc'; +$db = new mysqli($host, $user, $passwd, 'mysql'); + +$stmt = $db->stmt_init(); +$stmt->prepare("SELECT User FROM user WHERE password=\"\""); +$stmt->execute(); +$stmt->bind_result($testArg); +echo "Okey"; +?> +--EXPECTF-- +Okey diff --git a/ext/mysqli/tests/bug66124.phpt b/ext/mysqli/tests/bug66124.phpt new file mode 100644 index 0000000000..8c0027f9e6 --- /dev/null +++ b/ext/mysqli/tests/bug66124.phpt @@ -0,0 +1,101 @@ +--TEST-- +Bug #66124 (mysqli under mysqlnd loses precision when bind_param with 'i') +--SKIPIF-- +<?php +require_once('skipif.inc'); +require_once('connect.inc'); +require_once('skipifconnectfailure.inc'); +?> +--FILE-- +<?php +$table_drop = "DROP TABLE IF EXISTS `bug66124`"; +$table_create = "CREATE TABLE `bug66124` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8"; + +$table_insert = "INSERT INTO `bug66124` SET `id`=?"; +$table_select = "SELECT * FROM `bug66124`"; +$table_delete = "DELETE FROM `bug66124`"; +$id = '1311200011005001566'; + + +require_once('connect.inc'); + +if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) { + printf("Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n", + $host, $user, $db, $port, $socket); + exit(1); +} + +$link->query($table_drop); +$link->query($table_create); + +$stmt = $link->prepare($table_insert); +if (!$stmt) { + printf("Can't prepare\n"); + exit(1); +} + +echo "Using 'i':\n"; +$stmt->bind_param('i', $id); + +if ($stmt->execute()){ + echo "insert id:{$id}=>{$stmt->insert_id}\n"; +} else { + printf("Can't execute\n"); + exit(1); +} + + +$result = $link->query($table_select); + +if ($result){ + while ($row = $result->fetch_assoc()) { + echo "fetch id:{$row['id']}\n"; + } +} else { + printf("Can't select\n"); + exit(1); +} + +$stmt->close(); + +$link->query($table_drop); +$link->query($table_create); + + +$stmt = $link->prepare($table_insert); +$stmt->bind_param('s', $id); + +echo "Using 's':\n"; + +if ($stmt->execute()){ + echo "insert id:{$id}\n"; +} else{ + printf("Can't execute\n"); + exit(1); +} + +$result = $link->query($table_select); + +if ($result){ + while ($row = $result->fetch_assoc()) { + echo "fetch id:{$row['id']}\n"; + } +} else { + printf("Can't select\n"); + exit(1); +} + +$link->close(); +?> +done +--EXPECTF-- +Using 'i': +insert id:1311200011005001566=>1311200011005001566 +fetch id:1311200011005001566 +Using 's': +insert id:1311200011005001566 +fetch id:1311200011005001566 +done
\ No newline at end of file diff --git a/ext/mysqli/tests/bug66762.phpt b/ext/mysqli/tests/bug66762.phpt new file mode 100644 index 0000000000..2b8a92c7fd --- /dev/null +++ b/ext/mysqli/tests/bug66762.phpt @@ -0,0 +1,26 @@ +--TEST-- +Bug #66762 mysqli@libmysql segfault in mysqli_stmt::bind_result() when link closed +--SKIPIF-- +<?php +require_once('skipif.inc'); +require_once('skipifconnectfailure.inc'); +?> +--FILE-- +<?php + require_once("connect.inc"); + + $mysqli = new mysqli($host, $user, $passwd, $db); + + $read_stmt = $mysqli->prepare("SELECT 1"); + + var_dump($read_stmt->bind_result($data)); + + unset($mysqli); + var_dump($read_stmt->bind_result($data)); + +?> +done! +--EXPECT-- +bool(true) +bool(true) +done!
\ No newline at end of file diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c index 6eb34e4092..d265dfd392 100644 --- a/ext/mysqlnd/mysqlnd.c +++ b/ext/mysqlnd/mysqlnd.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2013 The PHP Group | + | Copyright (c) 2006-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 | @@ -251,6 +251,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, simple_command_handle_response)(MYSQLND_CONN_D conn->persistent); if (!ignore_upsert_status) { + memset(conn->upsert_status, 0, sizeof(*conn->upsert_status)); conn->upsert_status->warning_count = ok_response->warning_count; conn->upsert_status->server_status = ok_response->server_status; conn->upsert_status->affected_rows = ok_response->affected_rows; @@ -314,6 +315,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, simple_command)(MYSQLND_CONN_DATA * conn, enum DBG_ENTER("mysqlnd_conn_data::simple_command"); DBG_INF_FMT("command=%s ok_packet=%u silent=%u", mysqlnd_command_to_text[command], ok_packet, silent); + DBG_INF_FMT("conn->server_status=%u", conn->upsert_status->server_status); switch (CONN_GET_STATE(conn)) { case CONN_READY: @@ -328,10 +330,6 @@ MYSQLND_METHOD(mysqlnd_conn_data, simple_command)(MYSQLND_CONN_DATA * conn, enum DBG_RETURN(FAIL); } - /* clean UPSERT info */ - if (!ignore_upsert_status) { - memset(conn->upsert_status, 0, sizeof(*conn->upsert_status)); - } SET_ERROR_AFF_ROWS(conn); SET_EMPTY_ERROR(*conn->error_info); @@ -888,6 +886,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, connect)(MYSQLND_CONN_DATA * conn, conn->max_packet_size = MYSQLND_ASSEMBLED_PACKET_MAX_SIZE; /* todo: check if charset is available */ conn->server_capabilities = greet_packet->server_capabilities; + memset(conn->upsert_status, 0, sizeof(*conn->upsert_status)); conn->upsert_status->warning_count = 0; conn->upsert_status->server_status = greet_packet->server_status; conn->upsert_status->affected_rows = 0; @@ -1064,6 +1063,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, send_query)(MYSQLND_CONN_DATA * conn, const ch enum_func_status ret = FAIL; DBG_ENTER("mysqlnd_conn_data::send_query"); DBG_INF_FMT("conn=%llu query=%s", conn->thread_id, query); + DBG_INF_FMT("conn->server_status=%u", conn->upsert_status->server_status); if (PASS == conn->m->local_tx_start(conn, this_func TSRMLS_CC)) { ret = conn->m->simple_command(conn, COM_QUERY, (zend_uchar *) query, query_len, @@ -1074,6 +1074,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, send_query)(MYSQLND_CONN_DATA * conn, const ch } conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC); } + DBG_INF_FMT("conn->server_status=%u", conn->upsert_status->server_status); DBG_RETURN(ret); } /* }}} */ @@ -1089,6 +1090,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, reap_query)(MYSQLND_CONN_DATA * conn TSRMLS_DC DBG_ENTER("mysqlnd_conn_data::reap_query"); DBG_INF_FMT("conn=%llu", conn->thread_id); + DBG_INF_FMT("conn->server_status=%u", conn->upsert_status->server_status); if (PASS == conn->m->local_tx_start(conn, this_func TSRMLS_CC)) { if (state <= CONN_READY || state == CONN_QUIT_SENT) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Connection not opened, clear or has been closed"); @@ -1099,6 +1101,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, reap_query)(MYSQLND_CONN_DATA * conn TSRMLS_DC conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC); } + DBG_INF_FMT("conn->server_status=%u", conn->upsert_status->server_status); DBG_RETURN(ret); } /* }}} */ @@ -1211,7 +1214,7 @@ static int mysqlnd_stream_array_from_fd_set(MYSQLND ** conn_array, fd_set * fds /* {{{ _mysqlnd_poll */ PHPAPI enum_func_status -_mysqlnd_poll(MYSQLND **r_array, MYSQLND **e_array, MYSQLND ***dont_poll, long sec, long usec, uint * desc_num TSRMLS_DC) +_mysqlnd_poll(MYSQLND **r_array, MYSQLND **e_array, MYSQLND ***dont_poll, long sec, long usec, int * desc_num TSRMLS_DC) { struct timeval tv; struct timeval *tv_p = NULL; @@ -1477,6 +1480,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, escape_string)(MYSQLND_CONN_DATA * const conn, DBG_INF_FMT("conn=%llu", conn->thread_id); if (PASS == conn->m->local_tx_start(conn, this_func TSRMLS_CC)) { + DBG_INF_FMT("server_status=%u", conn->upsert_status->server_status); if (conn->upsert_status->server_status & SERVER_STATUS_NO_BACKSLASH_ESCAPES) { ret = mysqlnd_cset_escape_quotes(conn->charset, newstr, escapestr, escapestr_len TSRMLS_CC); } else { diff --git a/ext/mysqlnd/mysqlnd.h b/ext/mysqlnd/mysqlnd.h index e707c415db..c85105d7c6 100644 --- a/ext/mysqlnd/mysqlnd.h +++ b/ext/mysqlnd/mysqlnd.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2013 The PHP Group | + | Copyright (c) 2006-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 | @@ -117,7 +117,7 @@ PHPAPI void _mysqlnd_debug(const char *mode TSRMLS_DC); #define mysqlnd_reap_async_query(conn) ((conn)->data)->m->reap_query((conn)->data TSRMLS_CC) #define mysqlnd_unbuffered_skip_result(result) (result)->m.skip_result((result) TSRMLS_CC) -PHPAPI enum_func_status _mysqlnd_poll(MYSQLND **r_array, MYSQLND **e_array, MYSQLND ***dont_poll, long sec, long usec, uint * desc_num TSRMLS_DC); +PHPAPI enum_func_status _mysqlnd_poll(MYSQLND **r_array, MYSQLND **e_array, MYSQLND ***dont_poll, long sec, long usec, int * desc_num TSRMLS_DC); #define mysqlnd_use_result(conn) ((conn)->data)->m->use_result((conn)->data TSRMLS_CC) #define mysqlnd_store_result(conn) ((conn)->data)->m->store_result((conn)->data TSRMLS_CC) diff --git a/ext/mysqlnd/mysqlnd_alloc.c b/ext/mysqlnd/mysqlnd_alloc.c index 39c1711b02..a72423f4fb 100644 --- a/ext/mysqlnd/mysqlnd_alloc.c +++ b/ext/mysqlnd/mysqlnd_alloc.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2013 The PHP Group | + | Copyright (c) 2006-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 | diff --git a/ext/mysqlnd/mysqlnd_alloc.h b/ext/mysqlnd/mysqlnd_alloc.h index 33c007026a..f567314358 100644 --- a/ext/mysqlnd/mysqlnd_alloc.h +++ b/ext/mysqlnd/mysqlnd_alloc.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2013 The PHP Group | + | Copyright (c) 2006-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 | diff --git a/ext/mysqlnd/mysqlnd_auth.c b/ext/mysqlnd/mysqlnd_auth.c index 918697a5f5..5efc5d345e 100644 --- a/ext/mysqlnd/mysqlnd_auth.c +++ b/ext/mysqlnd/mysqlnd_auth.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2013 The PHP Group | + | Copyright (c) 2006-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 | diff --git a/ext/mysqlnd/mysqlnd_block_alloc.c b/ext/mysqlnd/mysqlnd_block_alloc.c index b9d7887287..100e807bae 100644 --- a/ext/mysqlnd/mysqlnd_block_alloc.c +++ b/ext/mysqlnd/mysqlnd_block_alloc.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2013 The PHP Group | + | Copyright (c) 2006-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 | diff --git a/ext/mysqlnd/mysqlnd_block_alloc.h b/ext/mysqlnd/mysqlnd_block_alloc.h index 39ccbdc6b3..f9627744d5 100644 --- a/ext/mysqlnd/mysqlnd_block_alloc.h +++ b/ext/mysqlnd/mysqlnd_block_alloc.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2013 The PHP Group | + | Copyright (c) 2006-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 | diff --git a/ext/mysqlnd/mysqlnd_bt.c b/ext/mysqlnd/mysqlnd_bt.c index 3aeb8f2bb1..8fa7bb316d 100644 --- a/ext/mysqlnd/mysqlnd_bt.c +++ b/ext/mysqlnd/mysqlnd_bt.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2013 The PHP Group | + | Copyright (c) 2006-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 | diff --git a/ext/mysqlnd/mysqlnd_charset.c b/ext/mysqlnd/mysqlnd_charset.c index 8766a4b25d..cb4ae3266a 100644 --- a/ext/mysqlnd/mysqlnd_charset.c +++ b/ext/mysqlnd/mysqlnd_charset.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2013 The PHP Group | + | Copyright (c) 2006-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 | diff --git a/ext/mysqlnd/mysqlnd_charset.h b/ext/mysqlnd/mysqlnd_charset.h index 09d0eb4171..cf3eada8af 100644 --- a/ext/mysqlnd/mysqlnd_charset.h +++ b/ext/mysqlnd/mysqlnd_charset.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2013 The PHP Group | + | Copyright (c) 2006-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 | diff --git a/ext/mysqlnd/mysqlnd_debug.c b/ext/mysqlnd/mysqlnd_debug.c index fb8a360240..fe459a1b38 100644 --- a/ext/mysqlnd/mysqlnd_debug.c +++ b/ext/mysqlnd/mysqlnd_debug.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2013 The PHP Group | + | Copyright (c) 2006-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 | diff --git a/ext/mysqlnd/mysqlnd_debug.h b/ext/mysqlnd/mysqlnd_debug.h index f98c163e74..0db5ef9fe7 100644 --- a/ext/mysqlnd/mysqlnd_debug.h +++ b/ext/mysqlnd/mysqlnd_debug.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2013 The PHP Group | + | Copyright (c) 2006-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 | diff --git a/ext/mysqlnd/mysqlnd_driver.c b/ext/mysqlnd/mysqlnd_driver.c index e209a71b49..cfe5316e87 100644 --- a/ext/mysqlnd/mysqlnd_driver.c +++ b/ext/mysqlnd/mysqlnd_driver.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2013 The PHP Group | + | Copyright (c) 2006-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 | diff --git a/ext/mysqlnd/mysqlnd_enum_n_def.h b/ext/mysqlnd/mysqlnd_enum_n_def.h index e813df2ee5..709d03fc62 100644 --- a/ext/mysqlnd/mysqlnd_enum_n_def.h +++ b/ext/mysqlnd/mysqlnd_enum_n_def.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2013 The PHP Group | + | Copyright (c) 2006-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 | @@ -544,6 +544,10 @@ enum mysqlnd_packet_type }; +/* + After adding new elements please update + `mysqlnd_command_to_text` in mysqlnd_wireprotocol.c +*/ enum php_mysqlnd_server_command { COM_SLEEP = 0, @@ -576,6 +580,8 @@ enum php_mysqlnd_server_command COM_SET_OPTION = 27, COM_STMT_FETCH = 28, COM_DAEMON, + COM_BINLOG_DUMP_GTID, + COM_RESET_CONNECTION, COM_END }; diff --git a/ext/mysqlnd/mysqlnd_ext_plugin.c b/ext/mysqlnd/mysqlnd_ext_plugin.c index 21be3fd37b..acc9970d0d 100644 --- a/ext/mysqlnd/mysqlnd_ext_plugin.c +++ b/ext/mysqlnd/mysqlnd_ext_plugin.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2013 The PHP Group | + | Copyright (c) 2006-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 | diff --git a/ext/mysqlnd/mysqlnd_ext_plugin.h b/ext/mysqlnd/mysqlnd_ext_plugin.h index ef9d085a9b..2a2416a042 100644 --- a/ext/mysqlnd/mysqlnd_ext_plugin.h +++ b/ext/mysqlnd/mysqlnd_ext_plugin.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2013 The PHP Group | + | Copyright (c) 2006-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 | diff --git a/ext/mysqlnd/mysqlnd_libmysql_compat.h b/ext/mysqlnd/mysqlnd_libmysql_compat.h index c967fb3a9f..28edecd24c 100644 --- a/ext/mysqlnd/mysqlnd_libmysql_compat.h +++ b/ext/mysqlnd/mysqlnd_libmysql_compat.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2013 The PHP Group | + | Copyright (c) 2006-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 | diff --git a/ext/mysqlnd/mysqlnd_loaddata.c b/ext/mysqlnd/mysqlnd_loaddata.c index 40de45b06f..9f128e17e1 100644 --- a/ext/mysqlnd/mysqlnd_loaddata.c +++ b/ext/mysqlnd/mysqlnd_loaddata.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2013 The PHP Group | + | Copyright (c) 2006-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 | diff --git a/ext/mysqlnd/mysqlnd_net.c b/ext/mysqlnd/mysqlnd_net.c index 77e1196413..f7de43746b 100644 --- a/ext/mysqlnd/mysqlnd_net.c +++ b/ext/mysqlnd/mysqlnd_net.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2013 The PHP Group | + | Copyright (c) 2006-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 | diff --git a/ext/mysqlnd/mysqlnd_net.h b/ext/mysqlnd/mysqlnd_net.h index 568a0e18b2..76a474bc5f 100644 --- a/ext/mysqlnd/mysqlnd_net.h +++ b/ext/mysqlnd/mysqlnd_net.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2013 The PHP Group | + | Copyright (c) 2006-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 | diff --git a/ext/mysqlnd/mysqlnd_plugin.c b/ext/mysqlnd/mysqlnd_plugin.c index f32fe4afdc..3ae0e7d8bd 100644 --- a/ext/mysqlnd/mysqlnd_plugin.c +++ b/ext/mysqlnd/mysqlnd_plugin.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2013 The PHP Group | + | Copyright (c) 2006-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 | diff --git a/ext/mysqlnd/mysqlnd_priv.h b/ext/mysqlnd/mysqlnd_priv.h index 190ed697b6..f52c2a99b9 100644 --- a/ext/mysqlnd/mysqlnd_priv.h +++ b/ext/mysqlnd/mysqlnd_priv.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2013 The PHP Group | + | Copyright (c) 2006-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 | diff --git a/ext/mysqlnd/mysqlnd_ps.c b/ext/mysqlnd/mysqlnd_ps.c index cd5b302275..23a0f8a687 100644 --- a/ext/mysqlnd/mysqlnd_ps.c +++ b/ext/mysqlnd/mysqlnd_ps.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2013 The PHP Group | + | Copyright (c) 2006-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 | @@ -485,6 +485,7 @@ mysqlnd_stmt_execute_parse_response(MYSQLND_STMT * const s TSRMLS_DC) ret = mysqlnd_query_read_result_set_header(stmt->conn, s TSRMLS_CC); if (ret == FAIL) { COPY_CLIENT_ERROR(*stmt->error_info, *conn->error_info); + memset(stmt->upsert_status, 0, sizeof(*stmt->upsert_status)); stmt->upsert_status->affected_rows = conn->upsert_status->affected_rows; if (CONN_GET_STATE(conn) == CONN_QUIT_SENT) { /* close the statement here, the connection has been closed */ @@ -913,6 +914,7 @@ mysqlnd_stmt_fetch_row_unbuffered(MYSQLND_RES *result, void *param, unsigned int DBG_INF("EOF"); /* Mark the connection as usable again */ result->unbuf->eof_reached = TRUE; + memset(result->conn->upsert_status, 0, sizeof(*result->conn->upsert_status)); result->conn->upsert_status->warning_count = row_packet->warning_count; result->conn->upsert_status->server_status = row_packet->server_status; /* @@ -1022,6 +1024,7 @@ mysqlnd_fetch_stmt_row_cursor(MYSQLND_RES *result, void *param, unsigned int fla row_packet->skip_extraction = stmt->result_bind? FALSE:TRUE; + memset(stmt->upsert_status, 0, sizeof(*stmt->upsert_status)); if (PASS == (ret = PACKET_READ(row_packet, result->conn)) && !row_packet->eof) { unsigned int i, field_count = result->field_count; diff --git a/ext/mysqlnd/mysqlnd_ps_codec.c b/ext/mysqlnd/mysqlnd_ps_codec.c index cee0be181e..e2640c775b 100644 --- a/ext/mysqlnd/mysqlnd_ps_codec.c +++ b/ext/mysqlnd/mysqlnd_ps_codec.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2013 The PHP Group | + | Copyright (c) 2006-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 | @@ -636,9 +636,8 @@ mysqlnd_stmt_execute_store_params(MYSQLND_STMT * s, zend_uchar **buf, zend_uchar occur, and force resend for the next execution. */ for (i = 0; i < stmt->param_count; i++) { - if (Z_TYPE_P(stmt->param_bind[i].zv) != IS_NULL && - (stmt->param_bind[i].type == MYSQL_TYPE_LONG || stmt->param_bind[i].type == MYSQL_TYPE_LONGLONG)) - { + short current_type = stmt->param_bind[i].type; + if (Z_TYPE_P(stmt->param_bind[i].zv) != IS_NULL && (current_type == MYSQL_TYPE_LONG || current_type == MYSQL_TYPE_LONGLONG)) { /* always copy the var, because we do many conversions */ if (Z_TYPE_P(stmt->param_bind[i].zv) != IS_LONG && PASS != mysqlnd_stmt_copy_it(&copies, stmt->param_bind[i].zv, stmt->param_count, i TSRMLS_CC)) @@ -652,10 +651,31 @@ mysqlnd_stmt_execute_store_params(MYSQLND_STMT * s, zend_uchar **buf, zend_uchar */ if (Z_TYPE_P(stmt->param_bind[i].zv) != IS_LONG) { zval *tmp_data = (copies && copies[i])? copies[i]: stmt->param_bind[i].zv; - convert_to_double_ex(&tmp_data); - if (Z_DVAL_P(tmp_data) > LONG_MAX || Z_DVAL_P(tmp_data) < LONG_MIN) { + /* + Because converting to double and back to long can lead + to losing precision we need second variable. Conversion to double is to see if + value is too big for a long. As said, precision could be lost. + */ + zval *tmp_data_copy; + MAKE_STD_ZVAL(tmp_data_copy); + *tmp_data_copy = *tmp_data; + Z_SET_REFCOUNT_P(tmp_data_copy, 1); + zval_copy_ctor(tmp_data_copy); + convert_to_double_ex(&tmp_data_copy); + + /* + if it doesn't fit in a long send it as a string. + Check bug #52891 : Wrong data inserted with mysqli/mysqlnd when using bind_param, value > LONG_MAX + We do transformation here, which will be used later when sending types. The code later relies on this. + */ + if (Z_DVAL_P(tmp_data_copy) > LONG_MAX || Z_DVAL_P(tmp_data_copy) < LONG_MIN) { stmt->send_types_to_server = resend_types_next_time = 1; + convert_to_string_ex(&tmp_data); + } else { + convert_to_long_ex(&tmp_data); } + + zval_ptr_dtor(&tmp_data_copy); } } } @@ -698,10 +718,11 @@ mysqlnd_stmt_execute_store_params(MYSQLND_STMT * s, zend_uchar **buf, zend_uchar */ if (Z_TYPE_P(stmt->param_bind[i].zv) != IS_LONG) { zval *tmp_data = (copies && copies[i])? copies[i]: stmt->param_bind[i].zv; - - convert_to_double_ex(&tmp_data); - if (Z_DVAL_P(tmp_data) > LONG_MAX || Z_DVAL_P(tmp_data) < LONG_MIN) { - convert_to_string_ex(&tmp_data); + /* + In case of IS_LONG we do nothing, it is ok, in case of string, we just need to set current_type. + The actual transformation has been performed several dozens line above. + */ + if (Z_TYPE_P(tmp_data) == IS_STRING) { current_type = MYSQL_TYPE_VAR_STRING; /* don't change stmt->param_bind[i].type to MYSQL_TYPE_VAR_STRING @@ -709,8 +730,6 @@ mysqlnd_stmt_execute_store_params(MYSQLND_STMT * s, zend_uchar **buf, zend_uchar if the type is however not long, then we will do a goto in the next switch. We want to preserve the original bind type given by the user. Thus, we do these hacks. */ - } else { - convert_to_long_ex(&tmp_data); } } } diff --git a/ext/mysqlnd/mysqlnd_result.c b/ext/mysqlnd/mysqlnd_result.c index fd2023cd10..0814926483 100644 --- a/ext/mysqlnd/mysqlnd_result.c +++ b/ext/mysqlnd/mysqlnd_result.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2013 The PHP Group | + | Copyright (c) 2006-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 | @@ -198,9 +198,11 @@ MYSQLND_METHOD(mysqlnd_res, free_buffered_data)(MYSQLND_RES * result TSRMLS_DC) if (set->data) { unsigned int copy_on_write_performed = 0; unsigned int copy_on_write_saved = 0; + zval **data = set->data; + set->data = NULL; /* prevent double free if following loop is interrupted */ for (row = set->row_count - 1; row >= 0; row--) { - zval **current_row = set->data + row * field_count; + zval **current_row = data + row * field_count; MYSQLND_MEMORY_POOL_CHUNK *current_buffer = set->row_buffers[row]; int64_t col; @@ -222,8 +224,7 @@ MYSQLND_METHOD(mysqlnd_res, free_buffered_data)(MYSQLND_RES * result TSRMLS_DC) MYSQLND_INC_GLOBAL_STATISTIC_W_VALUE2(STAT_COPY_ON_WRITE_PERFORMED, copy_on_write_performed, STAT_COPY_ON_WRITE_SAVED, copy_on_write_saved); - mnd_efree(set->data); - set->data = NULL; + mnd_efree(data); } if (set->row_buffers) { @@ -426,6 +427,7 @@ mysqlnd_query_read_result_set_header(MYSQLND_CONN_DATA * conn, MYSQLND_STMT * s DBG_INF("UPSERT"); conn->last_query_type = QUERY_UPSERT; conn->field_count = rset_header->field_count; + memset(conn->upsert_status, 0, sizeof(*conn->upsert_status)); conn->upsert_status->warning_count = rset_header->warning_count; conn->upsert_status->server_status = rset_header->server_status; conn->upsert_status->affected_rows = rset_header->affected_rows; @@ -714,6 +716,7 @@ mysqlnd_fetch_row_unbuffered_c(MYSQLND_RES * result TSRMLS_DC) /* Mark the connection as usable again */ DBG_INF_FMT("warnings=%u server_status=%u", row_packet->warning_count, row_packet->server_status); result->unbuf->eof_reached = TRUE; + memset(result->conn->upsert_status, 0, sizeof(*result->conn->upsert_status)); result->conn->upsert_status->warning_count = row_packet->warning_count; result->conn->upsert_status->server_status = row_packet->server_status; /* @@ -849,6 +852,7 @@ mysqlnd_fetch_row_unbuffered(MYSQLND_RES * result, void *param, unsigned int fla /* Mark the connection as usable again */ DBG_INF_FMT("warnings=%u server_status=%u", row_packet->warning_count, row_packet->server_status); result->unbuf->eof_reached = TRUE; + memset(result->conn->upsert_status, 0, sizeof(*result->conn->upsert_status)); result->conn->upsert_status->warning_count = row_packet->warning_count; result->conn->upsert_status->server_status = row_packet->server_status; /* @@ -1206,6 +1210,7 @@ MYSQLND_METHOD(mysqlnd_res, store_result_fetch_data)(MYSQLND_CONN_DATA * const c /* Finally clean */ if (row_packet->eof) { + memset(conn->upsert_status, 0, sizeof(*conn->upsert_status)); conn->upsert_status->warning_count = row_packet->warning_count; conn->upsert_status->server_status = row_packet->server_status; } diff --git a/ext/mysqlnd/mysqlnd_result.h b/ext/mysqlnd/mysqlnd_result.h index f821b916ea..54f3b03d7d 100644 --- a/ext/mysqlnd/mysqlnd_result.h +++ b/ext/mysqlnd/mysqlnd_result.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2013 The PHP Group | + | Copyright (c) 2006-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 | diff --git a/ext/mysqlnd/mysqlnd_result_meta.c b/ext/mysqlnd/mysqlnd_result_meta.c index 1d22e6cc05..52bb0bdadf 100644 --- a/ext/mysqlnd/mysqlnd_result_meta.c +++ b/ext/mysqlnd/mysqlnd_result_meta.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2013 The PHP Group | + | Copyright (c) 2006-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 | diff --git a/ext/mysqlnd/mysqlnd_result_meta.h b/ext/mysqlnd/mysqlnd_result_meta.h index 8fa9989700..97720adba1 100644 --- a/ext/mysqlnd/mysqlnd_result_meta.h +++ b/ext/mysqlnd/mysqlnd_result_meta.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2013 The PHP Group | + | Copyright (c) 2006-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 | diff --git a/ext/mysqlnd/mysqlnd_reverse_api.c b/ext/mysqlnd/mysqlnd_reverse_api.c index daa43ec513..cd490fa62c 100644 --- a/ext/mysqlnd/mysqlnd_reverse_api.c +++ b/ext/mysqlnd/mysqlnd_reverse_api.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2013 The PHP Group | + | Copyright (c) 2006-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 | diff --git a/ext/mysqlnd/mysqlnd_reverse_api.h b/ext/mysqlnd/mysqlnd_reverse_api.h index dd23555b94..df1dbf8fb8 100644 --- a/ext/mysqlnd/mysqlnd_reverse_api.h +++ b/ext/mysqlnd/mysqlnd_reverse_api.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2013 The PHP Group | + | Copyright (c) 2006-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 | diff --git a/ext/mysqlnd/mysqlnd_statistics.c b/ext/mysqlnd/mysqlnd_statistics.c index 271cb29717..2045bebb1e 100644 --- a/ext/mysqlnd/mysqlnd_statistics.c +++ b/ext/mysqlnd/mysqlnd_statistics.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2013 The PHP Group | + | Copyright (c) 2006-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 | diff --git a/ext/mysqlnd/mysqlnd_statistics.h b/ext/mysqlnd/mysqlnd_statistics.h index d1fd03b00e..0493d89396 100644 --- a/ext/mysqlnd/mysqlnd_statistics.h +++ b/ext/mysqlnd/mysqlnd_statistics.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2013 The PHP Group | + | Copyright (c) 2006-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 | diff --git a/ext/mysqlnd/mysqlnd_structs.h b/ext/mysqlnd/mysqlnd_structs.h index 5c07a3c3c9..f25492e13d 100644 --- a/ext/mysqlnd/mysqlnd_structs.h +++ b/ext/mysqlnd/mysqlnd_structs.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2013 The PHP Group | + | Copyright (c) 2006-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 | diff --git a/ext/mysqlnd/mysqlnd_wireprotocol.c b/ext/mysqlnd/mysqlnd_wireprotocol.c index d0ab9fe731..f3ff8006ae 100644 --- a/ext/mysqlnd/mysqlnd_wireprotocol.c +++ b/ext/mysqlnd/mysqlnd_wireprotocol.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2013 The PHP Group | + | Copyright (c) 2006-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 | @@ -90,7 +90,8 @@ const char * const mysqlnd_command_to_text[COM_END] = "TIME", "DELAYED_INSERT", "CHANGE_USER", "BINLOG_DUMP", "TABLE_DUMP", "CONNECT_OUT", "REGISTER_SLAVE", "STMT_PREPARE", "STMT_EXECUTE", "STMT_SEND_LONG_DATA", "STMT_CLOSE", - "STMT_RESET", "SET_OPTION", "STMT_FETCH", "DAEMON" + "STMT_RESET", "SET_OPTION", "STMT_FETCH", "DAEMON", "BINLOG_DUMP_GTID", + "RESET_CONNECTION" }; /* }}} */ @@ -763,6 +764,7 @@ php_mysqlnd_ok_read(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC) packet->error, sizeof(packet->error), &packet->error_no, packet->sqlstate TSRMLS_CC); + DBG_INF_FMT("conn->server_status=%u", conn->upsert_status->server_status); DBG_RETURN(PASS); } /* Everything was fine! */ @@ -1005,6 +1007,7 @@ php_mysqlnd_rset_header_read(void * _packet, MYSQLND_CONN_DATA * conn TSRMLS_DC) packet->error_info.error, sizeof(packet->error_info.error), &packet->error_info.error_no, packet->error_info.sqlstate TSRMLS_CC); + DBG_INF_FMT("conn->server_status=%u", conn->upsert_status->server_status); DBG_RETURN(PASS); } diff --git a/ext/mysqlnd/mysqlnd_wireprotocol.h b/ext/mysqlnd/mysqlnd_wireprotocol.h index 253784c364..8f48374b1b 100644 --- a/ext/mysqlnd/mysqlnd_wireprotocol.h +++ b/ext/mysqlnd/mysqlnd_wireprotocol.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2013 The PHP Group | + | Copyright (c) 2006-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 | diff --git a/ext/mysqlnd/php_mysqlnd.c b/ext/mysqlnd/php_mysqlnd.c index 002135566c..353710bedb 100644 --- a/ext/mysqlnd/php_mysqlnd.c +++ b/ext/mysqlnd/php_mysqlnd.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2013 The PHP Group | + | Copyright (c) 2006-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 | diff --git a/ext/mysqlnd/php_mysqlnd.h b/ext/mysqlnd/php_mysqlnd.h index 14ad234e1b..dc39028900 100644 --- a/ext/mysqlnd/php_mysqlnd.h +++ b/ext/mysqlnd/php_mysqlnd.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2013 The PHP Group | + | Copyright (c) 2006-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 | diff --git a/ext/oci8/oci8.c b/ext/oci8/oci8.c index 44bfa71398..cdb1302d37 100644 --- a/ext/oci8/oci8.c +++ b/ext/oci8/oci8.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/oci8/oci8_collection.c b/ext/oci8/oci8_collection.c index 763e12e924..365baf4131 100644 --- a/ext/oci8/oci8_collection.c +++ b/ext/oci8/oci8_collection.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/oci8/oci8_interface.c b/ext/oci8/oci8_interface.c index e51d3c92f5..136718dbc2 100644 --- a/ext/oci8/oci8_interface.c +++ b/ext/oci8/oci8_interface.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/oci8/oci8_lob.c b/ext/oci8/oci8_lob.c index d05e053919..a6cdd647c9 100644 --- a/ext/oci8/oci8_lob.c +++ b/ext/oci8/oci8_lob.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/oci8/oci8_statement.c b/ext/oci8/oci8_statement.c index 89facb0703..de963c7cde 100644 --- a/ext/oci8/oci8_statement.c +++ b/ext/oci8/oci8_statement.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/oci8/php_oci8.h b/ext/oci8/php_oci8.h index 6632bc88ff..1c7507ae05 100644 --- a/ext/oci8/php_oci8.h +++ b/ext/oci8/php_oci8.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/oci8/php_oci8_int.h b/ext/oci8/php_oci8_int.h index d8d7d0f47a..0bc80c3d9c 100644 --- a/ext/oci8/php_oci8_int.h +++ b/ext/oci8/php_oci8_int.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | @@ -191,7 +191,7 @@ typedef struct { /* php_oci_statement {{{ */ sword errcode; /* last errcode*/ OCIError *err; /* private error handle */ OCIStmt *stmt; /* statement handle */ - char *last_query; /* last query issued. also used to determine if this is a statement or a refcursor recieved from Oracle */ + char *last_query; /* last query issued. also used to determine if this is a statement or a refcursor received from Oracle */ long last_query_len; /* last query length */ HashTable *columns; /* hash containing all the result columns */ HashTable *binds; /* binds hash */ diff --git a/ext/oci8/tests/drcp_cclass1.phpt b/ext/oci8/tests/drcp_cclass1.phpt index 068331e5a9..5c78a2943e 100644 --- a/ext/oci8/tests/drcp_cclass1.phpt +++ b/ext/oci8/tests/drcp_cclass1.phpt @@ -3,9 +3,21 @@ DRCP: Test setting connection class inline --SKIPIF-- <?php if (!extension_loaded('oci8')) die ("skip no oci8 extension"); -require(dirname(__FILE__)."/details.inc"); +require(dirname(__FILE__).'/connect.inc'); if (!$test_drcp) die("skip testing DRCP connection class only works in DRCP mode"); if (strcasecmp($user, "system") && strcasecmp($user, "sys")) die("skip needs to be run as a DBA user"); + +preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches_sv); +// This test in Oracle 12c needs a non-CDB or the root container +if (isset($matches_sv[0]) && $matches_sv[1] >= 12) { + $s = oci_parse($c, "select nvl(sys_context('userenv', 'con_name'), 'notacdb') as dbtype from dual"); + $r = @oci_execute($s); + if (!$r) + die('skip could not identify container type'); + $r = oci_fetch_array($s); + if ($r['DBTYPE'] !== 'CDB$ROOT') + die('skip cannot run test using a PDB'); +} ?> --FILE-- <?php diff --git a/ext/oci8/tests/lob_015.phpt b/ext/oci8/tests/lob_015.phpt index b4a19684a3..59e8fec42a 100644 --- a/ext/oci8/tests/lob_015.phpt +++ b/ext/oci8/tests/lob_015.phpt @@ -48,7 +48,7 @@ Warning: oci_bind_by_name() expects at least 3 parameters, 2 given in %s on line Warning: oci_bind_by_name() expects at least 3 parameters, 1 given in %s on line %d -Warning: oci_execute(): ORA-00932: %s NUMBER %s BLOB in %s on line %d +Warning: oci_execute(): ORA-00932: %s on line %d object(OCI-Lob)#%d (1) { ["descriptor"]=> resource(%d) of type (oci8 descriptor) diff --git a/ext/odbc/birdstep.c b/ext/odbc/birdstep.c index 0af58d0cd6..7bc3833d86 100644 --- a/ext/odbc/birdstep.c +++ b/ext/odbc/birdstep.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/odbc/php_birdstep.h b/ext/odbc/php_birdstep.h index 17f4fdee50..90180d0641 100644 --- a/ext/odbc/php_birdstep.h +++ b/ext/odbc/php_birdstep.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c index c84a4ecc60..4d21b3a136 100644 --- a/ext/odbc/php_odbc.c +++ b/ext/odbc/php_odbc.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/odbc/php_odbc.h b/ext/odbc/php_odbc.h index 7e8d26d0cc..bd78e88f52 100644 --- a/ext/odbc/php_odbc.h +++ b/ext/odbc/php_odbc.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/odbc/php_odbc_includes.h b/ext/odbc/php_odbc_includes.h index c00583b16a..a9b0acfa0c 100644 --- a/ext/odbc/php_odbc_includes.h +++ b/ext/odbc/php_odbc_includes.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index 26792e2428..d20ca83e85 100644..100755 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | @@ -78,6 +78,10 @@ #endif #define DEBUG_SMIME 0 +#if !defined(OPENSSL_NO_EC) && defined(EVP_PKEY_EC) +#define HAVE_EVP_PKEY_EC 1 +#endif + /* FIXME: Use the openssl constants instead of * enum. It is now impossible to match real values * against php constants. Also sorry to break the @@ -88,7 +92,7 @@ enum php_openssl_key_type { OPENSSL_KEYTYPE_DSA, OPENSSL_KEYTYPE_DH, OPENSSL_KEYTYPE_DEFAULT = OPENSSL_KEYTYPE_RSA, -#ifdef EVP_PKEY_EC +#ifdef HAVE_EVP_PKEY_EC OPENSSL_KEYTYPE_EC = OPENSSL_KEYTYPE_DH +1 #endif }; @@ -645,18 +649,28 @@ static time_t asn1_time_to_time_t(ASN1_UTCTIME * timestr TSRMLS_DC) /* {{{ */ char * thestr; long gmadjust = 0; - if (timestr->length < 13) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "extension author too lazy to parse %s correctly", timestr->data); + if (ASN1_STRING_type(timestr) != V_ASN1_UTCTIME) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "illegal ASN1 data type for timestamp"); + return (time_t)-1; + } + + if (ASN1_STRING_length(timestr) != strlen(ASN1_STRING_data(timestr))) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "illegal length in timestamp"); + return (time_t)-1; + } + + if (ASN1_STRING_length(timestr) < 13) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to parse time string %s correctly", timestr->data); return (time_t)-1; } - strbuf = estrdup((char *)timestr->data); + strbuf = estrdup((char *)ASN1_STRING_data(timestr)); memset(&thetime, 0, sizeof(thetime)); /* we work backwards so that we can use atoi more easily */ - thestr = strbuf + timestr->length - 3; + thestr = strbuf + ASN1_STRING_length(timestr) - 3; thetime.tm_sec = atoi(thestr); *thestr = '\0'; @@ -1106,7 +1120,7 @@ PHP_MINIT_FUNCTION(openssl) REGISTER_LONG_CONSTANT("OPENSSL_KEYTYPE_DSA", OPENSSL_KEYTYPE_DSA, CONST_CS|CONST_PERSISTENT); #endif REGISTER_LONG_CONSTANT("OPENSSL_KEYTYPE_DH", OPENSSL_KEYTYPE_DH, CONST_CS|CONST_PERSISTENT); -#ifdef EVP_PKEY_EC +#ifdef HAVE_EVP_PKEY_EC REGISTER_LONG_CONSTANT("OPENSSL_KEYTYPE_EC", OPENSSL_KEYTYPE_EC, CONST_CS|CONST_PERSISTENT); #endif @@ -3004,6 +3018,15 @@ static int php_openssl_is_private_key(EVP_PKEY* pkey TSRMLS_DC) } break; #endif +#ifdef HAVE_EVP_PKEY_EC + case EVP_PKEY_EC: + assert(pkey->pkey.ec != NULL); + + if ( NULL == EC_KEY_get0_private_key(pkey->pkey.ec)) { + return 0; + } + break; +#endif default: php_error_docref(NULL TSRMLS_CC, E_WARNING, "key type not supported in this PHP build!"); break; @@ -3404,7 +3427,7 @@ PHP_FUNCTION(openssl_pkey_get_details) } break; -#ifdef EVP_PKEY_EC +#ifdef HAVE_EVP_PKEY_EC case EVP_PKEY_EC: ktype = OPENSSL_KEYTYPE_EC; break; diff --git a/ext/openssl/php_openssl.h b/ext/openssl/php_openssl.h index 427a643bf9..6b76106f32 100644 --- a/ext/openssl/php_openssl.h +++ b/ext/openssl/php_openssl.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/openssl/tests/bug64802.phpt b/ext/openssl/tests/bug64802.phpt index 9a59701494..be0b5f9b5b 100644 --- a/ext/openssl/tests/bug64802.phpt +++ b/ext/openssl/tests/bug64802.phpt @@ -3,6 +3,7 @@ Bug #64802: openssl_x509_parse fails to parse subject properly in some cases --SKIPIF-- <?php if (!extension_loaded("openssl")) die("skip"); +if (!defined(OPENSSL_KEYTYPE_EC)) die("skip no EC available); ?> --FILE-- <?php diff --git a/ext/openssl/tests/bug66501.phpt b/ext/openssl/tests/bug66501.phpt new file mode 100644 index 0000000000..cd0da1f289 --- /dev/null +++ b/ext/openssl/tests/bug66501.phpt @@ -0,0 +1,22 @@ +--TEST--
+Bug #66501: EC private key support in openssl_sign
+--SKIPIF--
+<?php
+if (!extension_loaded("openssl")) die("skip");
+if (!defined(OPENSSL_KEYTYPE_EC)) die("skip no EC available);
+--FILE--
+<?php
+$pkey = 'ASN1 OID: prime256v1
+-----BEGIN EC PARAMETERS-----
+BggqhkjOPQMBBw==
+-----END EC PARAMETERS-----
+-----BEGIN EC PRIVATE KEY-----
+MHcCAQEEILPkqoeyM7XgwYkuSj3077lrsrfWJK5LqMolv+m2oOjZoAoGCCqGSM49
+AwEHoUQDQgAEPq4hbIWHvB51rdWr8ejrjWo4qVNWVugYFtPg/xLQw0mHkIPZ4DvK
+sqOTOnMoezkbSmVVMuwz9flvnqHGmQvmug==
+-----END EC PRIVATE KEY-----';
+$key = openssl_pkey_get_private($pkey);
+$res = openssl_sign($data ='alpha', $sign, $key, 'ecdsa-with-SHA1');
+var_dump($res);
+--EXPECTF--
+bool(true)
diff --git a/ext/openssl/tests/cve-2013-6420.crt b/ext/openssl/tests/cve-2013-6420.crt new file mode 100644 index 0000000000..454331468b --- /dev/null +++ b/ext/openssl/tests/cve-2013-6420.crt @@ -0,0 +1,29 @@ +-----BEGIN CERTIFICATE----- +MIIEpDCCA4ygAwIBAgIJAJzu8r6u6eBcMA0GCSqGSIb3DQEBBQUAMIHDMQswCQYD +VQQGEwJERTEcMBoGA1UECAwTTm9yZHJoZWluLVdlc3RmYWxlbjEQMA4GA1UEBwwH +S8ODwrZsbjEUMBIGA1UECgwLU2VrdGlvbkVpbnMxHzAdBgNVBAsMFk1hbGljaW91 +cyBDZXJ0IFNlY3Rpb24xITAfBgNVBAMMGG1hbGljaW91cy5zZWt0aW9uZWlucy5k +ZTEqMCgGCSqGSIb3DQEJARYbc3RlZmFuLmVzc2VyQHNla3Rpb25laW5zLmRlMHUY +ZDE5NzAwMTAxMDAwMDAwWgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAXDTE0MTEyODExMzkzNVowgcMxCzAJBgNVBAYTAkRFMRwwGgYDVQQIDBNO +b3JkcmhlaW4tV2VzdGZhbGVuMRAwDgYDVQQHDAdLw4PCtmxuMRQwEgYDVQQKDAtT +ZWt0aW9uRWluczEfMB0GA1UECwwWTWFsaWNpb3VzIENlcnQgU2VjdGlvbjEhMB8G +A1UEAwwYbWFsaWNpb3VzLnNla3Rpb25laW5zLmRlMSowKAYJKoZIhvcNAQkBFhtz +dGVmYW4uZXNzZXJAc2VrdGlvbmVpbnMuZGUwggEiMA0GCSqGSIb3DQEBAQUAA4IB +DwAwggEKAoIBAQDDAf3hl7JY0XcFniyEJpSSDqn0OqBr6QP65usJPRt/8PaDoqBu +wEYT/Na+6fsgPjC0uK9DZgWg2tHWWoanSblAMoz5PH6Z+S4SHRZ7e2dDIjPjdhjh +0mLg2UMO5yp0V797Ggs9lNt6JRfH81MN2obXWs4NtztLMuD6egqpr8dDbr34aOs8 +pkdui5UawTZksy5pLPHq5cMhFGm06v65CLo0V2Pd9+KAokPrPcN5KLKebz7mLpk6 +SMeEXOKP4idEqxyQ7O7fBuHMedsQhu+prY3si3BUyKfQtP5CZnX2bp0wKHxX12DX +1nfFIt9DbGvHTcyOuN+nZLPBm3vWxntyIIvVAgMBAAGjQjBAMAkGA1UdEwQCMAAw +EQYJYIZIAYb4QgEBBAQDAgeAMAsGA1UdDwQEAwIFoDATBgNVHSUEDDAKBggrBgEF +BQcDAjANBgkqhkiG9w0BAQUFAAOCAQEAG0fZYYCTbdj1XYc+1SnoaPR+vI8C8CaD +8+0UYhdnyU4gga0BAcDrY9e94eEAu6ZqycF6FjLqXXdAboppWocr6T6GD1x33Ckl +VArzG/KxQohGD2JeqkhIMlDomxHO7ka39+Oa8i2vWLVyjU8AZvWMAruHa4EENyG7 +lW2AagaFKFCr9TnXTfrdxGVEbv7KVQ6bdhg5p5SjpWH1+Mq03uR3ZXPBYdyV8319 +o0lVj1KFI2DCL/liWisJRoof+1cR35Ctd0wYBcpB6TZslMcOPl76dwKwJgeJo2Qg +Zsfmc2vC1/qOlNuNq/0TzzkVGv8ETT3CgaU+UXe4XOVvkccebJn2dg== +-----END CERTIFICATE----- + + diff --git a/ext/openssl/tests/cve-2013-6420.phpt b/ext/openssl/tests/cve-2013-6420.phpt new file mode 100644 index 0000000000..87c0210b2e --- /dev/null +++ b/ext/openssl/tests/cve-2013-6420.phpt @@ -0,0 +1,18 @@ +--TEST-- +CVE-2013-6420 +--SKIPIF-- +<?php +if (!extension_loaded("openssl")) die("skip"); +?> +--FILE-- +<?php +$crt = substr(__FILE__, 0, -4).'.crt'; +$info = openssl_x509_parse("file://$crt"); +var_dump($info['issuer']['emailAddress'], $info["validFrom_time_t"]); +?> +Done +--EXPECTF-- +%s openssl_x509_parse(): illegal ASN1 data type for timestamp in %s%ecve-2013-6420.php on line 3 +string(27) "stefan.esser@sektioneins.de" +int(-1) +Done diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c index 6e74d8024f..3082c839d9 100644 --- a/ext/openssl/xp_ssl.c +++ b/ext/openssl/xp_ssl.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/pcntl/pcntl.c b/ext/pcntl/pcntl.c index 47d58f51e1..7a8acafb5e 100644 --- a/ext/pcntl/pcntl.c +++ b/ext/pcntl/pcntl.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/pcntl/php_pcntl.h b/ext/pcntl/php_pcntl.h index 280a45bbaf..caafc10d19 100644 --- a/ext/pcntl/php_pcntl.h +++ b/ext/pcntl/php_pcntl.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/pcntl/php_signal.c b/ext/pcntl/php_signal.c index b3cccac44f..003b0dd462 100644 --- a/ext/pcntl/php_signal.c +++ b/ext/pcntl/php_signal.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/pcntl/php_signal.h b/ext/pcntl/php_signal.h index 07bde634ca..5c61b10396 100644 --- a/ext/pcntl/php_signal.h +++ b/ext/pcntl/php_signal.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c index 0d5d505fb7..bd93f723d6 100644 --- a/ext/pcre/php_pcre.c +++ b/ext/pcre/php_pcre.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/pcre/php_pcre.h b/ext/pcre/php_pcre.h index db14ce38fc..4b261871e2 100644 --- a/ext/pcre/php_pcre.h +++ b/ext/pcre/php_pcre.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/pdo/pdo.c b/ext/pdo/pdo.c index 452c27b591..f3c9b65766 100644 --- a/ext/pdo/pdo.c +++ b/ext/pdo/pdo.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/pdo/pdo_dbh.c b/ext/pdo/pdo_dbh.c index d5860b1a1e..4f5a391704 100644 --- a/ext/pdo/pdo_dbh.c +++ b/ext/pdo/pdo_dbh.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | @@ -196,7 +196,7 @@ static char *dsn_from_uri(char *uri, char *buf, size_t buflen TSRMLS_DC) /* {{{ } /* }}} */ -/* {{{ proto void PDO::__construct(string dsn, string username, string passwd [, array options]) +/* {{{ proto void PDO::__construct(string dsn[, string username[, string passwd [, array options]]]) */ static PHP_METHOD(PDO, dbh_constructor) { @@ -460,7 +460,7 @@ static void pdo_stmt_construct(pdo_stmt_t *stmt, zval *object, zend_class_entry if (dbstmt_ce->constructor) { zend_fcall_info fci; zend_fcall_info_cache fcc; - zval *retval; + zval *retval = NULL; fci.size = sizeof(zend_fcall_info); fci.function_table = &dbstmt_ce->function_table; @@ -495,7 +495,7 @@ static void pdo_stmt_construct(pdo_stmt_t *stmt, zval *object, zend_class_entry zval_dtor(object); ZVAL_NULL(object); object = NULL; /* marks failure */ - } else { + } else if (retval) { zval_ptr_dtor(&retval); } @@ -1226,7 +1226,7 @@ static PHP_METHOD(PDO, getAvailableDrivers) /* }}} */ /* {{{ arginfo */ -ZEND_BEGIN_ARG_INFO_EX(arginfo_pdo___construct, 0, 0, 3) +ZEND_BEGIN_ARG_INFO_EX(arginfo_pdo___construct, 0, 0, 1) ZEND_ARG_INFO(0, dsn) ZEND_ARG_INFO(0, username) ZEND_ARG_INFO(0, passwd) diff --git a/ext/pdo/pdo_sql_parser.c b/ext/pdo/pdo_sql_parser.c index 1ed78c1cc5..f4392ab53d 100644 --- a/ext/pdo/pdo_sql_parser.c +++ b/ext/pdo/pdo_sql_parser.c @@ -1,10 +1,10 @@ -/* Generated by re2c 0.13.5 on Tue Aug 20 18:02:48 2013 */ +/* Generated by re2c 0.13.5 on Thu Nov 7 18:02:29 2013 */ #line 1 "ext/pdo/pdo_sql_parser.re" /* +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | @@ -586,7 +586,9 @@ safe: } plc->freeq = 1; } else { - switch (Z_TYPE_P(param->parameter)) { + zval tmp_param = *param->parameter; + zval_copy_ctor(&tmp_param); + switch (Z_TYPE(tmp_param)) { case IS_NULL: plc->quoted = "NULL"; plc->qlen = sizeof("NULL")-1; @@ -594,20 +596,20 @@ safe: break; case IS_BOOL: - convert_to_long(param->parameter); - + convert_to_long(&tmp_param); + /* fall through */ case IS_LONG: case IS_DOUBLE: - convert_to_string(param->parameter); - plc->qlen = Z_STRLEN_P(param->parameter); - plc->quoted = Z_STRVAL_P(param->parameter); - plc->freeq = 0; + convert_to_string(&tmp_param); + plc->qlen = Z_STRLEN(tmp_param); + plc->quoted = estrdup(Z_STRVAL(tmp_param)); + plc->freeq = 1; break; default: - convert_to_string(param->parameter); - if (!stmt->dbh->methods->quoter(stmt->dbh, Z_STRVAL_P(param->parameter), - Z_STRLEN_P(param->parameter), &plc->quoted, &plc->qlen, + convert_to_string(&tmp_param); + if (!stmt->dbh->methods->quoter(stmt->dbh, Z_STRVAL(tmp_param), + Z_STRLEN(tmp_param), &plc->quoted, &plc->qlen, param->param_type TSRMLS_CC)) { /* bork */ ret = -1; @@ -616,6 +618,7 @@ safe: } plc->freeq = 1; } + zval_dtor(&tmp_param); } } else { plc->quoted = Z_STRVAL_P(param->parameter); diff --git a/ext/pdo/pdo_sql_parser.re b/ext/pdo/pdo_sql_parser.re index 1936a37340..fa8ef187fa 100644 --- a/ext/pdo/pdo_sql_parser.re +++ b/ext/pdo/pdo_sql_parser.re @@ -228,7 +228,9 @@ safe: } plc->freeq = 1; } else { - switch (Z_TYPE_P(param->parameter)) { + zval tmp_param = *param->parameter; + zval_copy_ctor(&tmp_param); + switch (Z_TYPE(tmp_param)) { case IS_NULL: plc->quoted = "NULL"; plc->qlen = sizeof("NULL")-1; @@ -236,20 +238,20 @@ safe: break; case IS_BOOL: - convert_to_long(param->parameter); - + convert_to_long(&tmp_param); + /* fall through */ case IS_LONG: case IS_DOUBLE: - convert_to_string(param->parameter); - plc->qlen = Z_STRLEN_P(param->parameter); - plc->quoted = Z_STRVAL_P(param->parameter); - plc->freeq = 0; + convert_to_string(&tmp_param); + plc->qlen = Z_STRLEN(tmp_param); + plc->quoted = estrdup(Z_STRVAL(tmp_param)); + plc->freeq = 1; break; default: - convert_to_string(param->parameter); - if (!stmt->dbh->methods->quoter(stmt->dbh, Z_STRVAL_P(param->parameter), - Z_STRLEN_P(param->parameter), &plc->quoted, &plc->qlen, + convert_to_string(&tmp_param); + if (!stmt->dbh->methods->quoter(stmt->dbh, Z_STRVAL(tmp_param), + Z_STRLEN(tmp_param), &plc->quoted, &plc->qlen, param->param_type TSRMLS_CC)) { /* bork */ ret = -1; @@ -258,6 +260,7 @@ safe: } plc->freeq = 1; } + zval_dtor(&tmp_param); } } else { plc->quoted = Z_STRVAL_P(param->parameter); diff --git a/ext/pdo/pdo_sqlstate.c b/ext/pdo/pdo_sqlstate.c index 7c92c1c0f3..533a35c404 100644 --- a/ext/pdo/pdo_sqlstate.c +++ b/ext/pdo/pdo_sqlstate.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c index 9622cb3cc2..238f547503 100644 --- a/ext/pdo/pdo_stmt.c +++ b/ext/pdo/pdo_stmt.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/pdo/php_pdo.h b/ext/pdo/php_pdo.h index f8a8ce377e..0b8bf6dfa9 100644 --- a/ext/pdo/php_pdo.h +++ b/ext/pdo/php_pdo.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/pdo/php_pdo_driver.h b/ext/pdo/php_pdo_driver.h index ede2d6fb76..56a69cac30 100644 --- a/ext/pdo/php_pdo_driver.h +++ b/ext/pdo/php_pdo_driver.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/pdo/php_pdo_int.h b/ext/pdo/php_pdo_int.h index 57c683ab0f..4ec97ac4d1 100644 --- a/ext/pdo/php_pdo_int.h +++ b/ext/pdo/php_pdo_int.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/pdo/tests/bug65946.phpt b/ext/pdo/tests/bug65946.phpt new file mode 100644 index 0000000000..1c4bd8d6c4 --- /dev/null +++ b/ext/pdo/tests/bug65946.phpt @@ -0,0 +1,32 @@ +--TEST-- +Bug #65946 (pdo_sql_parser.c permanently converts values bound to strings) +--SKIPIF-- +<?php +if (!extension_loaded('pdo')) die('skip'); +$dir = getenv('REDIR_TEST_DIR'); +if (false == $dir) die('skip no driver'); +require_once $dir . 'pdo_test.inc'; +PDOTest::skip(); +?> +--FILE-- +<?php +if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); +require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; +$db = PDOTest::factory(); +$db->setAttribute(PDO::ATTR_EMULATE_PREPARES, true); +$db->exec('CREATE TABLE test(id int)'); +$db->exec('INSERT INTO test VALUES(1)'); +$stmt = $db->prepare('SELECT * FROM test LIMIT :limit'); +$stmt->bindValue('limit', 1, PDO::PARAM_INT); +if(!($res = $stmt->execute())) var_dump($stmt->errorInfo()); +if(!($res = $stmt->execute())) var_dump($stmt->errorInfo()); +var_dump($stmt->fetchAll(PDO::FETCH_ASSOC)); +?> +--EXPECTF-- +array(1) { + [0]=> + array(1) { + ["id"]=> + string(1) "1" + } +} diff --git a/ext/pdo_dblib/dblib_driver.c b/ext/pdo_dblib/dblib_driver.c index daf5494d58..0fa68900b0 100644 --- a/ext/pdo_dblib/dblib_driver.c +++ b/ext/pdo_dblib/dblib_driver.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/pdo_dblib/dblib_stmt.c b/ext/pdo_dblib/dblib_stmt.c index 51cebc48b0..18e9e679cc 100644 --- a/ext/pdo_dblib/dblib_stmt.c +++ b/ext/pdo_dblib/dblib_stmt.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/pdo_dblib/pdo_dblib.c b/ext/pdo_dblib/pdo_dblib.c index bc5d364ed3..2801ece8f1 100644 --- a/ext/pdo_dblib/pdo_dblib.c +++ b/ext/pdo_dblib/pdo_dblib.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/pdo_dblib/php_pdo_dblib.h b/ext/pdo_dblib/php_pdo_dblib.h index 3396f208e5..f7de387b96 100644 --- a/ext/pdo_dblib/php_pdo_dblib.h +++ b/ext/pdo_dblib/php_pdo_dblib.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/pdo_dblib/php_pdo_dblib_int.h b/ext/pdo_dblib/php_pdo_dblib_int.h index 2bdb83c326..df15b229e0 100644 --- a/ext/pdo_dblib/php_pdo_dblib_int.h +++ b/ext/pdo_dblib/php_pdo_dblib_int.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/pdo_firebird/firebird_driver.c b/ext/pdo_firebird/firebird_driver.c index bda6d23fa4..aa5e795594 100644 --- a/ext/pdo_firebird/firebird_driver.c +++ b/ext/pdo_firebird/firebird_driver.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/pdo_firebird/firebird_statement.c b/ext/pdo_firebird/firebird_statement.c index 2b57cd8ba6..efb232bff6 100644 --- a/ext/pdo_firebird/firebird_statement.c +++ b/ext/pdo_firebird/firebird_statement.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/pdo_firebird/pdo_firebird.c b/ext/pdo_firebird/pdo_firebird.c index 1f14b55421..c512004b2c 100644 --- a/ext/pdo_firebird/pdo_firebird.c +++ b/ext/pdo_firebird/pdo_firebird.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/pdo_firebird/php_pdo_firebird.h b/ext/pdo_firebird/php_pdo_firebird.h index cbece41d9f..3816497c2a 100644 --- a/ext/pdo_firebird/php_pdo_firebird.h +++ b/ext/pdo_firebird/php_pdo_firebird.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/pdo_firebird/php_pdo_firebird_int.h b/ext/pdo_firebird/php_pdo_firebird_int.h index 9632edc810..b186eeb474 100644 --- a/ext/pdo_firebird/php_pdo_firebird_int.h +++ b/ext/pdo_firebird/php_pdo_firebird_int.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/pdo_mysql/mysql_driver.c b/ext/pdo_mysql/mysql_driver.c index 32d13bafaf..47a1be31c3 100644 --- a/ext/pdo_mysql/mysql_driver.c +++ b/ext/pdo_mysql/mysql_driver.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/pdo_mysql/mysql_statement.c b/ext/pdo_mysql/mysql_statement.c index 369c389462..95501c22c7 100644 --- a/ext/pdo_mysql/mysql_statement.c +++ b/ext/pdo_mysql/mysql_statement.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/pdo_mysql/pdo_mysql.c b/ext/pdo_mysql/pdo_mysql.c index 0d4e525cd1..697e7c0b58 100644 --- a/ext/pdo_mysql/pdo_mysql.c +++ b/ext/pdo_mysql/pdo_mysql.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | @@ -64,7 +64,12 @@ static MYSQLND * pdo_mysql_convert_zv_to_mysqlnd(zval * zv TSRMLS_DC) if (Z_TYPE_P(zv) == IS_OBJECT && instanceof_function(Z_OBJCE_P(zv), php_pdo_get_dbh_ce() TSRMLS_CC)) { pdo_dbh_t * dbh = zend_object_store_get_object(zv TSRMLS_CC); - if (!dbh || dbh->driver != &pdo_mysql_driver) { + if (!dbh) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to retrieve handle from object store"); + return NULL; + } + + if (dbh->driver != &pdo_mysql_driver) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Provided PDO instance is not using MySQL but %s", dbh->driver->driver_name); return NULL; } diff --git a/ext/pdo_mysql/php_pdo_mysql.h b/ext/pdo_mysql/php_pdo_mysql.h index e4493b569a..e4d37c88ab 100644 --- a/ext/pdo_mysql/php_pdo_mysql.h +++ b/ext/pdo_mysql/php_pdo_mysql.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/pdo_mysql/php_pdo_mysql_int.h b/ext/pdo_mysql/php_pdo_mysql_int.h index 65d7435a73..7533467cab 100644 --- a/ext/pdo_mysql/php_pdo_mysql_int.h +++ b/ext/pdo_mysql/php_pdo_mysql_int.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/pdo_mysql/tests/bug66141.phpt b/ext/pdo_mysql/tests/bug66141.phpt new file mode 100644 index 0000000000..3a28509314 --- /dev/null +++ b/ext/pdo_mysql/tests/bug66141.phpt @@ -0,0 +1,38 @@ +--TEST-- +Bug #66141 (mysqlnd quote function is wrong with NO_BACKSLASH_ESCAPES after failed query) +--SKIPIF-- +<?php +require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc'); +require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc'); +MySQLPDOTest::skip(); +?> +--FILE-- +<?php +include __DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc'; +$db = MySQLPDOTest::factory(); + +$input = 'Something\', 1 as one, 2 as two FROM dual; -- f'; + +$quotedInput0 = $db->quote($input); + +$db->query('set session sql_mode="NO_BACKSLASH_ESCAPES"'); + +// injection text from some user input + +$quotedInput1 = $db->quote($input); + +$db->query('something that throws an exception'); + +$quotedInput2 = $db->quote($input); + +var_dump($quotedInput0); +var_dump($quotedInput1); +var_dump($quotedInput2); +?> +done +--EXPECTF-- +Warning: PDO::query(): SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'something that throws an exception' at line %d in %s on line %d +string(50) "'Something\', 1 as one, 2 as two FROM dual; -- f'" +string(50) "'Something'', 1 as one, 2 as two FROM dual; -- f'" +string(50) "'Something'', 1 as one, 2 as two FROM dual; -- f'" +done
\ No newline at end of file diff --git a/ext/pdo_oci/oci_driver.c b/ext/pdo_oci/oci_driver.c index fcdefa94b3..8f56c674d1 100644 --- a/ext/pdo_oci/oci_driver.c +++ b/ext/pdo_oci/oci_driver.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/pdo_oci/oci_statement.c b/ext/pdo_oci/oci_statement.c index 6a74efa7ba..4e341c08be 100644 --- a/ext/pdo_oci/oci_statement.c +++ b/ext/pdo_oci/oci_statement.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/pdo_oci/pdo_oci.c b/ext/pdo_oci/pdo_oci.c index 69577148f6..8eabb7e7c5 100644 --- a/ext/pdo_oci/pdo_oci.c +++ b/ext/pdo_oci/pdo_oci.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/pdo_oci/php_pdo_oci.h b/ext/pdo_oci/php_pdo_oci.h index d0b1b3d015..3299dfe269 100644 --- a/ext/pdo_oci/php_pdo_oci.h +++ b/ext/pdo_oci/php_pdo_oci.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/pdo_oci/php_pdo_oci_int.h b/ext/pdo_oci/php_pdo_oci_int.h index af5618b61a..4979aadb13 100644 --- a/ext/pdo_oci/php_pdo_oci_int.h +++ b/ext/pdo_oci/php_pdo_oci_int.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/pdo_odbc/odbc_driver.c b/ext/pdo_odbc/odbc_driver.c index f7f3ef34ed..339db5698a 100644 --- a/ext/pdo_odbc/odbc_driver.c +++ b/ext/pdo_odbc/odbc_driver.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.0 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/pdo_odbc/odbc_stmt.c b/ext/pdo_odbc/odbc_stmt.c index 0e3fd3cbb9..8b0ccf34e6 100644 --- a/ext/pdo_odbc/odbc_stmt.c +++ b/ext/pdo_odbc/odbc_stmt.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.0 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -472,7 +472,7 @@ static int odbc_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *p if (P->outbuf) { unsigned long ulen; char *srcbuf; - unsigned long srclen; + unsigned long srclen = 0; switch (P->len) { case SQL_NULL_DATA: @@ -551,7 +551,8 @@ static int odbc_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC) struct pdo_column_data *col = &stmt->columns[colno]; RETCODE rc; SWORD colnamelen; - SDWORD colsize, displaysize; + SDWORD colsize; + SQLLEN displaysize; rc = SQLDescribeCol(S->stmt, colno+1, S->cols[colno].colname, sizeof(S->cols[colno].colname)-1, &colnamelen, diff --git a/ext/pdo_odbc/pdo_odbc.c b/ext/pdo_odbc/pdo_odbc.c index f481c07f26..1fe17c1c30 100644 --- a/ext/pdo_odbc/pdo_odbc.c +++ b/ext/pdo_odbc/pdo_odbc.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.0 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/pdo_odbc/php_pdo_odbc.h b/ext/pdo_odbc/php_pdo_odbc.h index ee80e7517b..cd01ae45e5 100644 --- a/ext/pdo_odbc/php_pdo_odbc.h +++ b/ext/pdo_odbc/php_pdo_odbc.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.0 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/pdo_odbc/php_pdo_odbc_int.h b/ext/pdo_odbc/php_pdo_odbc_int.h index 8594120ef0..87b2f9100d 100644 --- a/ext/pdo_odbc/php_pdo_odbc_int.h +++ b/ext/pdo_odbc/php_pdo_odbc_int.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.0 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/pdo_pgsql/pdo_pgsql.c b/ext/pdo_pgsql/pdo_pgsql.c index 7c37a603f8..8e4cc97fb5 100644 --- a/ext/pdo_pgsql/pdo_pgsql.c +++ b/ext/pdo_pgsql/pdo_pgsql.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/pdo_pgsql/pgsql_driver.c b/ext/pdo_pgsql/pgsql_driver.c index 50136430a0..3be9359216 100644 --- a/ext/pdo_pgsql/pgsql_driver.c +++ b/ext/pdo_pgsql/pgsql_driver.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | @@ -1039,6 +1039,7 @@ static int pdo_pgsql_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_ pdo_pgsql_db_handle *H; int ret = 0; char *conn_str, *p, *e; + char *tmp_pass; long connect_timeout = 30; H = pecalloc(1, sizeof(pdo_pgsql_db_handle), dbh->is_persistent); @@ -1060,18 +1061,44 @@ static int pdo_pgsql_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_ connect_timeout = pdo_attr_lval(driver_options, PDO_ATTR_TIMEOUT, 30 TSRMLS_CC); } + if (dbh->password) { + if (dbh->password[0] != '\'' && dbh->password[strlen(dbh->password) - 1] != '\'') { + char *pwd = dbh->password; + int pos = 1; + + tmp_pass = safe_emalloc(2, strlen(dbh->password), 3); + tmp_pass[0] = '\''; + + while (*pwd != '\0') { + if (*pwd == '\\' || *pwd == '\'') { + tmp_pass[pos++] = '\\'; + } + + tmp_pass[pos++] = *pwd++; + } + + tmp_pass[pos++] = '\''; + tmp_pass[pos] = '\0'; + } else { + tmp_pass = dbh->password; + } + } + /* support both full connection string & connection string + login and/or password */ if (dbh->username && dbh->password) { - spprintf(&conn_str, 0, "%s user=%s password=%s connect_timeout=%ld", dbh->data_source, dbh->username, dbh->password, connect_timeout); + spprintf(&conn_str, 0, "%s user=%s password=%s connect_timeout=%ld", dbh->data_source, dbh->username, tmp_pass, connect_timeout); } else if (dbh->username) { spprintf(&conn_str, 0, "%s user=%s connect_timeout=%ld", dbh->data_source, dbh->username, connect_timeout); } else if (dbh->password) { - spprintf(&conn_str, 0, "%s password=%s connect_timeout=%ld", dbh->data_source, dbh->password, connect_timeout); + spprintf(&conn_str, 0, "%s password=%s connect_timeout=%ld", dbh->data_source, tmp_pass, connect_timeout); } else { spprintf(&conn_str, 0, "%s connect_timeout=%ld", (char *) dbh->data_source, connect_timeout); } H->server = PQconnectdb(conn_str); + if (dbh->password && tmp_pass != dbh->password) { + efree(tmp_pass); + } efree(conn_str); diff --git a/ext/pdo_pgsql/pgsql_statement.c b/ext/pdo_pgsql/pgsql_statement.c index 792ad27078..ea5a67633e 100644 --- a/ext/pdo_pgsql/pgsql_statement.c +++ b/ext/pdo_pgsql/pgsql_statement.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/pdo_pgsql/php_pdo_pgsql.h b/ext/pdo_pgsql/php_pdo_pgsql.h index b7ea2628e7..9c01d9886c 100644 --- a/ext/pdo_pgsql/php_pdo_pgsql.h +++ b/ext/pdo_pgsql/php_pdo_pgsql.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/pdo_pgsql/php_pdo_pgsql_int.h b/ext/pdo_pgsql/php_pdo_pgsql_int.h index 02a6717760..6ca4794c8c 100644 --- a/ext/pdo_pgsql/php_pdo_pgsql_int.h +++ b/ext/pdo_pgsql/php_pdo_pgsql_int.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/pdo_pgsql/tests/bug62479.phpt b/ext/pdo_pgsql/tests/bug62479.phpt new file mode 100644 index 0000000000..a12bb8d1ff --- /dev/null +++ b/ext/pdo_pgsql/tests/bug62479.phpt @@ -0,0 +1,56 @@ +--TEST-- +PDO PgSQL Bug #62479 (PDO-psql cannot connect if password contains spaces) +--SKIPIF-- +<?php +if (!extension_loaded('pdo') || !extension_loaded('pdo_pgsql')) die('skip not loaded'); +require dirname(__FILE__) . '/config.inc'; +require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc'; +PDOTest::skip(); +if (!isset($conf['ENV']['PDOTEST_DSN'])) die('no dsn found in env'); +$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt'); +$rand = rand(5, 5); + +// Assume that if we can't create a user, this test needs to be skipped +$testQuery = "CREATE USER pdo_$rand WITH PASSWORD 'testpass'"; +$db->query($testQuery); +$testQuery = "DROP USER pdo_$rand"; +$db->query($testQuery); +?> +--FILE-- +<?php +require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc'; +$pdo = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt'); +$pdo->setAttribute(PDO::ATTR_EMULATE_PREPARES, true); +$rand = rand(5, 400); +$user = "pdo_$rand"; +$template = "CREATE USER $user WITH PASSWORD '%s'"; +$dropUser = "DROP USER $user"; +$testQuery = 'SELECT 1 as verification'; + +// Create temp user with space in password +$sql = sprintf($template, 'my password'); +$pdo->query($sql); +$testConn = new PDO($conf['ENV']['PDOTEST_DSN'], $user, "my password"); +$result = $testConn->query($testQuery)->fetch(); +$check = $result[0]; +var_dump($check); + +// Remove the user +$pdo->query($dropUser); + +// Create a user with a space and single quote +$sql = sprintf($template, "my pass''word"); +$pdo->query($sql); + +$testConn = new PDO($conf['ENV']['PDOTEST_DSN'], $user, "my pass'word"); +$result = $testConn->query($testQuery)->fetch(); +$check = $result[0]; +var_dump($check); + +// Remove the user +$pdo->query($dropUser); +?> +--EXPECT-- +int(1) +int(1) + diff --git a/ext/pdo_sqlite/pdo_sqlite.c b/ext/pdo_sqlite/pdo_sqlite.c index cc9b03e62d..33cffee821 100644 --- a/ext/pdo_sqlite/pdo_sqlite.c +++ b/ext/pdo_sqlite/pdo_sqlite.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/pdo_sqlite/php_pdo_sqlite.h b/ext/pdo_sqlite/php_pdo_sqlite.h index 6fa3bab1ff..607b3ddedb 100644 --- a/ext/pdo_sqlite/php_pdo_sqlite.h +++ b/ext/pdo_sqlite/php_pdo_sqlite.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/pdo_sqlite/php_pdo_sqlite_int.h b/ext/pdo_sqlite/php_pdo_sqlite_int.h index 8e20ca5cf4..288cc6335e 100644 --- a/ext/pdo_sqlite/php_pdo_sqlite_int.h +++ b/ext/pdo_sqlite/php_pdo_sqlite_int.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/pdo_sqlite/sqlite_driver.c b/ext/pdo_sqlite/sqlite_driver.c index 0f4a2456a1..35fa547f27 100644 --- a/ext/pdo_sqlite/sqlite_driver.c +++ b/ext/pdo_sqlite/sqlite_driver.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/pdo_sqlite/sqlite_statement.c b/ext/pdo_sqlite/sqlite_statement.c index e970ad3e06..ba49f7324c 100644 --- a/ext/pdo_sqlite/sqlite_statement.c +++ b/ext/pdo_sqlite/sqlite_statement.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/pdo_sqlite/tests/bug66033.phpt b/ext/pdo_sqlite/tests/bug66033.phpt new file mode 100644 index 0000000000..28da3b54bf --- /dev/null +++ b/ext/pdo_sqlite/tests/bug66033.phpt @@ -0,0 +1,33 @@ +--TEST-- +Bug #66033 (Segmentation Fault when constructor of PDO statement throws an exception) +--SKIPIF-- +<?php +if (!extension_loaded('pdo_sqlite')) print 'skip not loaded'; +?> +--FILE-- +<?php +class DBStatement extends PDOStatement { + public $dbh; + protected function __construct($dbh) { + $this->dbh = $dbh; + throw new Exception("Blah"); + } +} + +$pdo = new PDO('sqlite::memory:', null, null); +$pdo->setAttribute(PDO::ATTR_STATEMENT_CLASS, array('DBStatement', + array($pdo))); +$pdo->exec("CREATE TABLE IF NOT EXISTS messages ( + id INTEGER PRIMARY KEY, + title TEXT, + message TEXT, + time INTEGER)"); + +try { + $pdoStatement = $pdo->query("select * from messages"); +} catch (Exception $e) { + var_dump($e->getMessage()); +} +?> +--EXPECTF-- +string(4) "Blah" diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index c8f7d3d432..c91677c961 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | @@ -15,8 +15,8 @@ | Authors: Zeev Suraski <zeev@zend.com> | | Jouni Ahto <jouni.ahto@exdec.fi> | | Yasuo Ohgaki <yohgaki@php.net> | - | Youichi Iwakiri <yiwakiri@st.rim.or.jp> (pg_copy_*) | - | Chris Kings-Lynne <chriskl@php.net> (v3 protocol) | + | Youichi Iwakiri <yiwakiri@st.rim.or.jp> (pg_copy_*) | + | Chris Kings-Lynne <chriskl@php.net> (v3 protocol) | +----------------------------------------------------------------------+ */ @@ -37,6 +37,9 @@ #include "ext/standard/php_standard.h" #include "ext/standard/php_smart_str.h" #include "ext/ereg/php_regex.h" +#ifdef PHP_WIN32 +# include "win32/time.h" +#endif #undef PACKAGE_BUGREPORT #undef PACKAGE_NAME @@ -743,6 +746,105 @@ ZEND_GET_MODULE(pgsql) static int le_link, le_plink, le_result, le_lofp, le_string; +/* Compatibility definitions */ + +#ifndef HAVE_PGSQL_WITH_MULTIBYTE_SUPPORT +#define pg_encoding_to_char(x) "SQL_ASCII" +#endif + +#if !HAVE_PQESCAPE_CONN +#define PQescapeStringConn(conn, to, form, len, error) PQescapeString(to, from, len) +#endif + +#if HAVE_PQESCAPELITERAL +#define PGSQLescapeLiteral(conn, str, len) PQescapeLiteral(conn, str, len) +#define PGSQLescapeIdentifier(conn, str, len) PQescapeIdentifier(conn, str, len) +#define PGSQLfree(a) PQfreemem(a) +#else +#define PGSQLescapeLiteral(conn, str, len) php_pgsql_PQescapeInternal(conn, str, len, 1, 0) +#define PGSQLescapeLiteral2(conn, str, len) php_pgsql_PQescapeInternal(conn, str, len, 1, 1) +#define PGSQLescapeIdentifier(conn, str, len) php_pgsql_PQescapeInternal(conn, str, len, 0, 0) +#define PGSQLfree(a) efree(a) + +/* emulate libpq's PQescapeInternal() 9.0 or later */ +static char* php_pgsql_PQescapeInternal(PGconn *conn, const char *str, size_t len, int escape_literal, int safe) { + char *result, *rp, *s; + size_t tmp_len; + + if (!conn) { + return NULL; + } + + /* allocate enough memory */ + rp = result = (char *)safe_emalloc(len, 2, 5); /* leading " E" needs extra 2 bytes + quote_chars on both end for 2 bytes + NULL */ + + if (escape_literal) { + size_t new_len; + + if (safe) { + char *tmp = (char *)safe_emalloc(len, 2, 1); + *rp++ = '\''; + /* PQescapeString does not escape \, but it handles multibyte chars safely. + This escape is incompatible with PQescapeLiteral. */ + new_len = PQescapeStringConn(conn, tmp, str, len, NULL); + strncpy(rp, tmp, new_len); + efree(tmp); + rp += new_len; + } else { + char *encoding; + /* This is compatible with PQescapeLiteral, but it cannot handle multbyte chars + such as SJIS, BIG5. Raise warning and return NULL by checking + client_encoding. */ + encoding = (char *) pg_encoding_to_char(PQclientEncoding(conn)); + if (!strncmp(encoding, "SJIS", sizeof("SJIS")-1) || + !strncmp(encoding, "SHIFT_JIS_2004", sizeof("SHIFT_JIS_2004")-1) || + !strncmp(encoding, "BIG5", sizeof("BIG5")-1) || + !strncmp(encoding, "GB18030", sizeof("GB18030")-1) || + !strncmp(encoding, "GBK", sizeof("GBK")-1) || + !strncmp(encoding, "JOHAB", sizeof("JOHAB")-1) || + !strncmp(encoding, "UHC", sizeof("UHC")-1) ) { + TSRMLS_FETCH(); + + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unsafe encoding is used. Do not use '%s' encoding or use PostgreSQL 9.0 or later libpq.", encoding); + } + /* check backslashes */ + tmp_len = strspn(str, "\\"); + if (tmp_len != len) { + /* add " E" for escaping slashes */ + *rp++ = ' '; + *rp++ = 'E'; + } + *rp++ = '\''; + for (s = (char *)str; s - str < len; ++s) { + if (*s == '\'' || *s == '\\') { + *rp++ = *s; + *rp++ = *s; + } else { + *rp++ = *s; + } + } + } + *rp++ = '\''; + } else { + /* Identifier escape. */ + *rp++ = '"'; + for (s = (char *)str; s - str < len; ++s) { + if (*s == '"') { + *rp++ = '"'; + *rp++ = '"'; + } else { + *rp++ = *s; + } + } + *rp++ = '"'; + } + *rp = '\0'; + + return result; +} +#endif + + /* {{{ _php_pgsql_trim_message */ static char * _php_pgsql_trim_message(const char *message, int *len) { @@ -771,16 +873,16 @@ static inline char * _php_pgsql_trim_result(PGconn * pgsql, char **buf) #define PQErrorMessageTrim(pgsql, buf) _php_pgsql_trim_result(pgsql, buf) -#define PHP_PQ_ERROR(text, pgsql) { \ - char *msgbuf = _php_pgsql_trim_message(PQerrorMessage(pgsql), NULL); \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, text, msgbuf); \ - efree(msgbuf); \ +#define PHP_PQ_ERROR(text, pgsql) { \ + char *msgbuf = _php_pgsql_trim_message(PQerrorMessage(pgsql), NULL); \ + php_error_docref(NULL TSRMLS_CC, E_WARNING, text, msgbuf); \ + efree(msgbuf); \ } \ /* {{{ php_pgsql_set_default_link */ static void php_pgsql_set_default_link(int id TSRMLS_DC) -{ +{ zend_list_addref(id); if (PGG(default_link) != -1) { @@ -848,10 +950,10 @@ static void _php_pgsql_notice_ptr_dtor(void **ptr) { php_pgsql_notice *notice = (php_pgsql_notice *)*ptr; if (notice) { - efree(notice->message); - efree(notice); - notice = NULL; - } + efree(notice->message); + efree(notice); + notice = NULL; + } } /* }}} */ @@ -941,57 +1043,7 @@ static int _php_pgsql_detect_identifier_escape(const char *identifier, size_t le return SUCCESS; } -#if !HAVE_PQESCAPELITERAL -/* {{{ _php_pgsql_escape_identifier - * Since PQescapeIdentifier() is unavailable (PostgreSQL 9.0 <), idenfifers - * should be escaped by pgsql module. - * Note: this function does not care for encoding. Therefore users should not - * use this with SJIS/BIG5 etc. (i.e. Encoding base injection may possible with - * before PostgreSQL 9.0) - */ -static char *_php_pgsql_escape_identifier(const char *field, size_t field_len) -{ - ulong field_escaped_len = field_len*2 + 3; - ulong i, j = 0; - char *field_escaped; - - field_escaped = (char *)malloc(field_escaped_len); - field_escaped[j++] = '"'; - for (i = 0; i < field_len; i++) { - if (field[i] == '"') { - field_escaped[j++] = '"'; - field_escaped[j++] = '"'; - } else { - field_escaped[j++] = field[i]; - } - } - field_escaped[j++] = '"'; - field_escaped[j] = '\0'; - return field_escaped; -} -/* }}} */ -#endif - -/* {{{ _php_pgsql_strndup, no strndup should be used */ -static char *_php_pgsql_strndup(const char *s, size_t len) -{ - char *new; - - if (NULL == s) { - return (char *)NULL; - } - - new = (char *) malloc(len + 1); - - if (NULL == new) { - return (char *)NULL; - } - new[len] = '\0'; - - return memmove(new, s, len); -} -/* }}} */ /* {{{ PHP_INI */ @@ -1020,7 +1072,7 @@ static PHP_GINIT_FUNCTION(pgsql) PHP_MINIT_FUNCTION(pgsql) { REGISTER_INI_ENTRIES(); - + le_link = zend_register_list_destructors_ex(_close_pgsql_link, NULL, "pgsql link", module_number); le_plink = zend_register_list_destructors_ex(NULL, _close_pgsql_plink, "pgsql link persistent", module_number); le_result = zend_register_list_destructors_ex(_free_result, NULL, "pgsql result", module_number); @@ -1156,7 +1208,7 @@ PHP_MINFO_FUNCTION(pgsql) #else php_info_print_table_row(2, "SSL support", "disabled"); #endif -#endif /* HAVE_PG_CONFIG_H */ +#endif /* HAVE_PG_CONFIG_H */ snprintf(buf, sizeof(buf), "%ld", PGG(num_persistent)); php_info_print_table_row(2, "Active Persistent Links", buf); snprintf(buf, sizeof(buf), "%ld", PGG(num_links)); @@ -1224,7 +1276,7 @@ static void php_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) break; } } - + if (persistent && PGG(allow_persistent)) { zend_rsrc_list_entry *le; @@ -1307,7 +1359,7 @@ static void php_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) ZEND_REGISTER_RESOURCE(return_value, pgsql, le_plink); } else { /* Non persistent connection */ zend_rsrc_list_entry *index_ptr,new_index_ptr; - + /* first we check the hash for the hashed_details key. if it exists, * it should point us to the right offset where the actual pgsql link sits. * if it doesn't, open a new pgsql link, add it to the resource list, @@ -1371,7 +1423,7 @@ static void php_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) cleanup: smart_str_free(&str); return; - + err: smart_str_free(&str); RETURN_FALSE; @@ -1415,11 +1467,11 @@ PHP_FUNCTION(pg_close) zval *pgsql_link = NULL; int id = -1, argc = ZEND_NUM_ARGS(); PGconn *pgsql; - + if (zend_parse_parameters(argc TSRMLS_CC, "|r", &pgsql_link) == FAILURE) { return; } - + if (argc == 0) { id = PGG(default_link); CHECK_DEFAULT_LINK(id); @@ -1427,7 +1479,7 @@ PHP_FUNCTION(pg_close) if (pgsql_link == NULL && id == -1) { RETURN_FALSE; - } + } ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink); @@ -1435,7 +1487,7 @@ PHP_FUNCTION(pg_close) zend_list_delete(Z_RESVAL_P(pgsql_link)); } - if (id!=-1 + if (id!=-1 || (pgsql_link && Z_RESVAL_P(pgsql_link)==PGG(default_link))) { zend_list_delete(PGG(default_link)); PGG(default_link) = -1; @@ -1454,6 +1506,7 @@ PHP_FUNCTION(pg_close) #define PHP_PG_HOST 6 #define PHP_PG_VERSION 7 + /* {{{ php_pgsql_get_link_info */ static void php_pgsql_get_link_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type) @@ -1474,7 +1527,7 @@ static void php_pgsql_get_link_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type if (pgsql_link == NULL && id == -1) { RETURN_FALSE; - } + } ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink); @@ -1600,7 +1653,7 @@ PHP_FUNCTION(pg_parameter_status) } if (pgsql_link == NULL && id == -1) { RETURN_FALSE; - } + } ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink); @@ -1631,7 +1684,7 @@ PHP_FUNCTION(pg_ping) } if (pgsql_link == NULL && id == -1) { RETURN_FALSE; - } + } ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink); @@ -1706,7 +1759,7 @@ PHP_FUNCTION(pg_query) } else { status = (ExecStatusType) PQstatus(pgsql); } - + switch (status) { case PGRES_EMPTY_QUERY: case PGRES_BAD_RESPONSE: @@ -1802,7 +1855,7 @@ PHP_FUNCTION(pg_query_params) if (num_params > 0) { int i = 0; params = (char **)safe_emalloc(sizeof(char *), num_params, 0); - + for(i = 0; i < num_params; i++) { if (zend_hash_get_current_data(Z_ARRVAL_P(pv_param_arr), (void **) &tmp) == FAILURE) { php_error_docref(NULL TSRMLS_CC, E_WARNING,"Error getting parameter"); @@ -1899,10 +1952,10 @@ PHP_FUNCTION(pg_prepare) return; } } - + if (pgsql_link == NULL && id == -1) { RETURN_FALSE; - } + } ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink); @@ -1929,7 +1982,7 @@ PHP_FUNCTION(pg_prepare) } else { status = (ExecStatusType) PQstatus(pgsql); } - + switch (status) { case PGRES_EMPTY_QUERY: case PGRES_BAD_RESPONSE: @@ -2009,7 +2062,7 @@ PHP_FUNCTION(pg_execute) if (num_params > 0) { int i = 0; params = (char **)safe_emalloc(sizeof(char *), num_params, 0); - + for(i = 0; i < num_params; i++) { if (zend_hash_get_current_data(Z_ARRVAL_P(pv_param_arr), (void **) &tmp) == FAILURE) { php_error_docref(NULL TSRMLS_CC, E_WARNING,"Error getting parameter"); @@ -2051,7 +2104,7 @@ PHP_FUNCTION(pg_execute) } else { status = (ExecStatusType) PQstatus(pgsql); } - + _php_pgsql_free_params(params, num_params); switch (status) { @@ -2203,7 +2256,7 @@ static char *get_field_name(PGconn *pgsql, Oid oid, HashTable *list TSRMLS_DC) num_rows = PQntuples(result); oid_offset = PQfnumber(result,"oid"); name_offset = PQfnumber(result,"typname"); - + for (i=0; i<num_rows; i++) { if ((tmp_oid = PQgetvalue(result,i,oid_offset))==NULL) { continue; @@ -2213,7 +2266,7 @@ static char *get_field_name(PGconn *pgsql, Oid oid, HashTable *list TSRMLS_DC) smart_str_appends(&str, "pgsql_oid_"); smart_str_appends(&str, tmp_oid); smart_str_0(&str); - + if ((tmp_name = PQgetvalue(result,i,name_offset))==NULL) { continue; } @@ -2230,7 +2283,7 @@ static char *get_field_name(PGconn *pgsql, Oid oid, HashTable *list TSRMLS_DC) smart_str_free(&str); return ret; } -/* }}} */ +/* }}} */ #ifdef HAVE_PQFTABLE /* {{{ proto mixed pg_field_table(resource result, int field_number[, bool oid_only]) @@ -2263,7 +2316,6 @@ PHP_FUNCTION(pg_field_table) RETURN_FALSE; } - if (return_oid) { #if UINT_MAX > LONG_MAX /* Oid is unsigned int, we don't need this code, where LONG is wider */ if (oid > LONG_MAX) { @@ -2293,7 +2345,6 @@ PHP_FUNCTION(pg_field_table) smart_str_append_unsigned(&querystr, oid); smart_str_0(&querystr); - if ((tmp_res = PQexec(pg_result->conn, querystr.c)) == NULL || PQresultStatus(tmp_res) != PGRES_TUPLES_OK) { if (tmp_res) { PQclear(tmp_res); @@ -2321,8 +2372,8 @@ PHP_FUNCTION(pg_field_table) } } -/* }}} */ -#endif +/* }}} */ +#endif #define PHP_PG_FIELD_NAME 1 #define PHP_PG_FIELD_SIZE 2 @@ -2338,11 +2389,11 @@ static void php_pgsql_get_field_info(INTERNAL_FUNCTION_PARAMETERS, int entry_typ PGresult *pgsql_result; pgsql_result_handle *pg_result; Oid oid; - + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &result, &field) == FAILURE) { return; } - + ZEND_FETCH_RESOURCE(pg_result, pgsql_result_handle *, &result, -1, "PostgreSQL result", le_result); pgsql_result = pg_result->result; @@ -2351,7 +2402,7 @@ static void php_pgsql_get_field_info(INTERNAL_FUNCTION_PARAMETERS, int entry_typ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad field offset specified"); RETURN_FALSE; } - + switch (entry_type) { case PHP_PG_FIELD_NAME: Z_STRVAL_P(return_value) = PQfname(pgsql_result, field); @@ -2438,11 +2489,11 @@ PHP_FUNCTION(pg_field_num) if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &result, &field, &field_len) == FAILURE) { return; } - + ZEND_FETCH_RESOURCE(pg_result, pgsql_result_handle *, &result, -1, "PostgreSQL result", le_result); pgsql_result = pg_result->result; - + Z_LVAL_P(return_value) = PQfnumber(pgsql_result, field); Z_TYPE_P(return_value) = IS_LONG; } @@ -2457,7 +2508,7 @@ PHP_FUNCTION(pg_fetch_result) PGresult *pgsql_result; pgsql_result_handle *pg_result; int field_offset, pgsql_row, argc = ZEND_NUM_ARGS(); - + if (argc == 2) { if (zend_parse_parameters(argc TSRMLS_CC, "rZ", &result, &field) == FAILURE) { return; @@ -2500,7 +2551,7 @@ PHP_FUNCTION(pg_fetch_result) php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad column offset specified"); RETURN_FALSE; } - + if (PQgetisnull(pgsql_result, pgsql_row, field_offset)) { Z_TYPE_P(return_value) = IS_NULL; } else { @@ -2603,12 +2654,12 @@ static void php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, long result_type, data = safe_estrndup(element, element_len); data_len = element_len; - + if (result_type & PGSQL_NUM) { add_index_stringl(return_value, i, data, data_len, should_copy); should_copy=1; } - + if (result_type & PGSQL_ASSOC) { field_name = PQfname(pgsql_result, i); add_assoc_stringl(return_value, field_name, data, data_len, should_copy); @@ -2621,11 +2672,11 @@ static void php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, long result_type, zval dataset = *return_value; zend_fcall_info fci; zend_fcall_info_cache fcc; - zval *retval_ptr; - + zval *retval_ptr; + object_and_properties_init(return_value, ce, NULL); zend_merge_properties(return_value, Z_ARRVAL(dataset), 1 TSRMLS_CC); - + if (ce->constructor) { fci.size = sizeof(fci); fci.function_table = &ce->function_table; @@ -2637,7 +2688,7 @@ static void php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, long result_type, if (Z_TYPE_P(ctor_params) == IS_ARRAY) { HashTable *ht = Z_ARRVAL_P(ctor_params); Bucket *p; - + fci.param_count = 0; fci.params = safe_emalloc(sizeof(zval***), ht->nNumOfElements, 0); p = ht->pListHead; @@ -2666,7 +2717,7 @@ static void php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, long result_type, fcc.calling_scope = EG(scope); fcc.called_scope = Z_OBJCE_P(return_value); fcc.object_ptr = return_value; - + if (zend_call_function(&fci, &fcc TSRMLS_CC) == FAILURE) { zend_throw_exception_ex(zend_exception_get_default(TSRMLS_C), 0 TSRMLS_CC, "Could not execute %s::%s()", ce->name, ce->constructor->common.function_name); } else { @@ -2772,7 +2823,7 @@ PHP_FUNCTION(pg_fetch_all_columns) array_init(return_value); - if ((pg_numrows = PQntuples(pgsql_result)) <= 0) { + if ((pg_numrows = PQntuples(pgsql_result)) <= 0) { return; } @@ -2781,7 +2832,7 @@ PHP_FUNCTION(pg_fetch_all_columns) add_next_index_null(return_value); } else { add_next_index_string(return_value, PQgetvalue(pgsql_result, pg_row, colno), 1); - } + } } } /* }}} */ @@ -2803,7 +2854,7 @@ PHP_FUNCTION(pg_result_seek) if (row < 0 || row >= PQntuples(pg_result->result)) { RETURN_FALSE; } - + /* seek to offset */ pg_result->row = row; RETURN_TRUE; @@ -2833,7 +2884,7 @@ static void php_pgsql_data_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type) return; } } - + ZEND_FETCH_RESOURCE(pg_result, pgsql_result_handle *, &result, -1, "PostgreSQL result", le_result); pgsql_result = pg_result->result; @@ -2853,7 +2904,7 @@ static void php_pgsql_data_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type) RETURN_FALSE; } } - + switch(Z_TYPE_PP(field)) { case IS_STRING: convert_to_string_ex(field); @@ -2868,7 +2919,7 @@ static void php_pgsql_data_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type) php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad column offset specified"); RETURN_FALSE; } - + switch (entry_type) { case PHP_PG_DATA_LENGTH: Z_LVAL_P(return_value) = PQgetlength(pgsql_result, pgsql_row, field_offset); @@ -2903,7 +2954,7 @@ PHP_FUNCTION(pg_free_result) { zval *result; pgsql_result_handle *pg_result; - + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &result) == FAILURE) { return; } @@ -2931,7 +2982,7 @@ PHP_FUNCTION(pg_last_oid) if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &result) == FAILURE) { return; } - + ZEND_FETCH_RESOURCE(pg_result, pgsql_result_handle *, &result, -1, "PostgreSQL result", le_result); pgsql_result = pg_result->result; #ifdef HAVE_PQOIDVALUE @@ -2962,18 +3013,18 @@ PHP_FUNCTION(pg_trace) FILE *fp = NULL; php_stream *stream; id = PGG(default_link); - + if (zend_parse_parameters(argc TSRMLS_CC, "s|sr", &z_filename, &z_filename_len, &mode, &mode_len, &pgsql_link) == FAILURE) { return; } if (argc < 3) { CHECK_DEFAULT_LINK(id); - } + } if (pgsql_link == NULL && id == -1) { RETURN_FALSE; - } + } ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink); @@ -3012,7 +3063,7 @@ PHP_FUNCTION(pg_untrace) if (pgsql_link == NULL && id == -1) { RETURN_FALSE; - } + } ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink); PQuntrace(pgsql); @@ -3024,10 +3075,10 @@ PHP_FUNCTION(pg_untrace) Create a large object */ PHP_FUNCTION(pg_lo_create) { - zval *pgsql_link = NULL, *oid = NULL; - PGconn *pgsql; - Oid pgsql_oid, wanted_oid = InvalidOid; - int id = -1, argc = ZEND_NUM_ARGS(); + zval *pgsql_link = NULL, *oid = NULL; + PGconn *pgsql; + Oid pgsql_oid, wanted_oid = InvalidOid; + int id = -1, argc = ZEND_NUM_ARGS(); if (zend_parse_parameters(argc TSRMLS_CC, "|zz", &pgsql_link, &oid) == FAILURE) { return; @@ -3049,12 +3100,12 @@ PHP_FUNCTION(pg_lo_create) ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink); if (oid) { -#ifndef HAVE_PG_LO_CREATE - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "OID value passing not supported"); +#ifndef HAVE_PG_LO_CREATE + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Passing OID value is not supported. Upgrade your PostgreSQL"); #else switch (Z_TYPE_P(oid)) { case IS_STRING: - { + { char *end_ptr; wanted_oid = (Oid)strtoul(Z_STRVAL_P(oid), &end_ptr, 10); if ((Z_STRVAL_P(oid)+Z_STRLEN_P(oid)) != end_ptr) { @@ -3080,7 +3131,7 @@ PHP_FUNCTION(pg_lo_create) RETURN_FALSE; } - PGSQL_RETURN_OID(pgsql_oid); + PGSQL_RETURN_OID(pgsql_oid); #endif } @@ -3089,7 +3140,7 @@ PHP_FUNCTION(pg_lo_create) RETURN_FALSE; } - PGSQL_RETURN_OID(pgsql_oid); + PGSQL_RETURN_OID(pgsql_oid); } /* }}} */ @@ -3151,7 +3202,7 @@ PHP_FUNCTION(pg_lo_unlink) } if (pgsql_link == NULL && id == -1) { RETURN_FALSE; - } + } ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink); @@ -3223,7 +3274,7 @@ PHP_FUNCTION(pg_lo_open) } if (pgsql_link == NULL && id == -1) { RETURN_FALSE; - } + } ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink); @@ -3315,8 +3366,8 @@ PHP_FUNCTION(pg_lo_close) Read a large object */ PHP_FUNCTION(pg_lo_read) { - zval *pgsql_id; - long len; + zval *pgsql_id; + long len; int buf_len = PGSQL_LO_READ_BUF_SIZE, nbytes, argc = ZEND_NUM_ARGS(); char *buf; pgLofp *pgsql; @@ -3443,7 +3494,7 @@ PHP_FUNCTION(pg_lo_import) if (pgsql_link == NULL && id == -1) { RETURN_FALSE; - } + } ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink); @@ -3454,7 +3505,7 @@ PHP_FUNCTION(pg_lo_import) Oid wanted_oid; switch (Z_TYPE_P(oid)) { case IS_STRING: - { + { char *end_ptr; wanted_oid = (Oid)strtoul(Z_STRVAL_P(oid), &end_ptr, 10); if ((Z_STRVAL_P(oid)+Z_STRLEN_P(oid)) != end_ptr) { @@ -3576,13 +3627,13 @@ PHP_FUNCTION(pg_lo_export) if (pgsql_link == NULL && id == -1) { RETURN_FALSE; - } + } ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink); if (lo_export(pgsql, oid, file_out)) { RETURN_TRUE; - } + } RETURN_FALSE; } /* }}} */ @@ -3697,7 +3748,7 @@ PHP_FUNCTION(pg_set_client_encoding) if (pgsql_link == NULL && id == -1) { RETURN_FALSE; - } + } ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink); @@ -3731,10 +3782,6 @@ PHP_FUNCTION(pg_client_encoding) /* Just do the same as found in PostgreSQL sources... */ -#ifndef HAVE_PGSQL_WITH_MULTIBYTE_SUPPORT -#define pg_encoding_to_char(x) "SQL_ASCII" -#endif - Z_STRVAL_P(return_value) = (char *) pg_encoding_to_char(PQclientEncoding(pgsql)); Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value)); Z_STRVAL_P(return_value) = (char *) estrdup(Z_STRVAL_P(return_value)); @@ -3767,7 +3814,7 @@ PHP_FUNCTION(pg_end_copy) if (pgsql_link == NULL && id == -1) { RETURN_FALSE; - } + } ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink); @@ -3903,7 +3950,7 @@ PHP_FUNCTION(pg_copy_to) PHP_PQ_ERROR("getline failed: %s", pgsql); RETURN_FALSE; } - + if (copybuf[0] == '\\' && copybuf[1] == '.' && copybuf[2] == '\0') @@ -4111,12 +4158,11 @@ PHP_FUNCTION(pg_escape_string) } to = (char *) safe_emalloc(from_len, 2, 1); - #ifdef HAVE_PQESCAPE_CONN if (pgsql_link != NULL || id != -1) { ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink); to_len = (int) PQescapeStringConn(pgsql, to, from, (size_t)from_len, NULL); - } else + } else #endif to_len = (int) PQescapeString(to, from, (size_t)from_len); @@ -4191,7 +4237,7 @@ PHP_FUNCTION(pg_escape_bytea) */ static unsigned char * php_pgsql_unescape_bytea(unsigned char *strtext, size_t *retbuflen) { - size_t buflen; + size_t buflen; unsigned char *buffer, *sp, *bp; @@ -4251,7 +4297,7 @@ static unsigned char * php_pgsql_unescape_bytea(unsigned char *strtext, size_t * memcpy(buf, sp-2, 3); buf[3] = '\0'; start = buf; - *bp = (unsigned char)strtoul(start, (char **)&end, 8); + *bp = (unsigned char)strtoul(start, (char **)&end, 8); buflen -= 3; state = 0; } @@ -4299,61 +4345,13 @@ PHP_FUNCTION(pg_unescape_bytea) #endif #ifdef HAVE_PQESCAPE -#if !HAVE_PQESCAPELITERAL -/* emulate libpq's PQescapeInternal() 9.0 or later */ -static char* php_pgsql_PQescapeInternal(PGconn *conn, const char *str, size_t len, int escape_literal) { - char *result, *rp; - const char *s; - size_t tmp_len; - int input_len = len; - char quote_char = escape_literal ? '\'' : '"'; - - if (!conn) { - return NULL; - } - - /* - * NOTE: multibyte strings that could cointain slashes should be considered. - * (e.g. SJIS, BIG5) However, it cannot be done without valid PGconn and mbstring. - * Therefore, this function does not support such encodings currently. - * FIXME: add encoding check and skip multibyte char bytes if there is vaild PGconn. - */ - - /* allocate enough memory */ - rp = result = (char *)emalloc(len*2 + 5); /* leading " E" needs extra 2 bytes + quote_chars on both end for 2 bytes + NULL */ - - if (escape_literal) { - /* check backslashes */ - tmp_len = strspn(str, "\\"); - if (tmp_len != len) { - /* add " E" for escaping slashes */ - *rp++ = ' '; - *rp++ = 'E'; - } - } - /* open quote */ - *rp++ = quote_char; - for (s = str; s - str < input_len; ++s) { - if (*s == quote_char || (escape_literal && *s == '\\')) { - *rp++ = *s; - *rp++ = *s; - } else { - *rp++ = *s; - } - } - *rp++ = quote_char; - *rp = '\0'; - - return result; -} -#endif - static void php_pgsql_escape_internal(INTERNAL_FUNCTION_PARAMETERS, int escape_literal) { char *from = NULL, *to = NULL; zval *pgsql_link = NULL; PGconn *pgsql; int from_len; int id = -1; + char *tmp; switch (ZEND_NUM_ARGS()) { case 1: @@ -4381,30 +4379,18 @@ static void php_pgsql_escape_internal(INTERNAL_FUNCTION_PARAMETERS, int escape_l php_error_docref(NULL TSRMLS_CC, E_WARNING,"Cannot get pgsql link"); RETURN_FALSE; } -#ifdef HAVE_PQESCAPELITERAL - /* Use a block with a local var to avoid unused variable warnings */ - { - char *tmp; - if (escape_literal) { - tmp = PQescapeLiteral(pgsql, from, (size_t)from_len); - } else { - tmp = PQescapeIdentifier(pgsql, from, (size_t)from_len); - } - if (!tmp) { - php_error_docref(NULL TSRMLS_CC, E_WARNING,"Failed to escape"); - RETURN_FALSE; - } - to = estrdup(tmp); - PQfreemem(tmp); + if (escape_literal) { + tmp = PGSQLescapeLiteral(pgsql, from, (size_t)from_len); + } else { + tmp = PGSQLescapeIdentifier(pgsql, from, (size_t)from_len); } -#else - to = php_pgsql_PQescapeInternal(pgsql, from, (size_t)from_len, escape_literal); - if (!to) { + if (!tmp) { php_error_docref(NULL TSRMLS_CC, E_WARNING,"Failed to escape"); RETURN_FALSE; } -#endif + to = estrdup(tmp); + PGSQLfree(tmp); RETURN_STRING(to, 0); } @@ -4452,6 +4438,7 @@ PHP_FUNCTION(pg_result_error) } /* }}} */ + #if HAVE_PQRESULTERRORFIELD /* {{{ proto string pg_result_error_field(resource result, int fieldcode) Get error message field associated with result */ @@ -4497,6 +4484,7 @@ PHP_FUNCTION(pg_result_error_field) /* }}} */ #endif + /* {{{ proto int pg_connection_status(resource connection) Get connection status */ PHP_FUNCTION(pg_connection_status) @@ -4517,6 +4505,7 @@ PHP_FUNCTION(pg_connection_status) /* }}} */ + #if HAVE_PGTRANSACTIONSTATUS /* {{{ proto int pg_transaction_status(resource connection) Get transaction status */ @@ -4539,6 +4528,7 @@ PHP_FUNCTION(pg_transaction_status) /* }}} */ + /* {{{ proto bool pg_connection_reset(resource connection) Reset connection (reconnect) */ PHP_FUNCTION(pg_connection_reset) @@ -4560,12 +4550,13 @@ PHP_FUNCTION(pg_connection_reset) } RETURN_TRUE; } - /* }}} */ + #define PHP_PG_ASYNC_IS_BUSY 1 #define PHP_PG_ASYNC_REQUEST_CANCEL 2 - + + /* {{{ php_pgsql_flush_query */ static int php_pgsql_flush_query(PGconn *pgsql TSRMLS_DC) @@ -4585,7 +4576,8 @@ static int php_pgsql_flush_query(PGconn *pgsql TSRMLS_DC) return leftover; } /* }}} */ - + + /* {{{ php_pgsql_do_async */ static void php_pgsql_do_async(INTERNAL_FUNCTION_PARAMETERS, int entry_type) @@ -4815,7 +4807,7 @@ PHP_FUNCTION(pg_send_prepare) if (pgsql_link == NULL && id == -1) { RETURN_FALSE; - } + } ZEND_FETCH_RESOURCE2(pgsql, PGconn *, &pgsql_link, id, "PostgreSQL link", le_link, le_plink); @@ -5103,7 +5095,7 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z size_t new_len; int i, num_rows; zval *elem; - + if (!*table_name) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "The table name must be specified"); return FAILURE; @@ -5123,25 +5115,17 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z "FROM pg_class as c, pg_attribute a, pg_type t, pg_namespace n " "WHERE a.attnum > 0 AND a.attrelid = c.oid AND c.relname = '"); escaped = (char *)safe_emalloc(strlen(tmp_name2), 2, 1); -#if HAVE_PQESCAPE_CONN new_len = PQescapeStringConn(pg_link, escaped, tmp_name2, strlen(tmp_name2), NULL); -#else - new_len = PQescapeString(escaped, tmp_name2, strlen(tmp_name2)); -#endif if (new_len) { - smart_str_appends(&querystr, escaped); + smart_str_appendl(&querystr, escaped, new_len); } efree(escaped); smart_str_appends(&querystr, "' AND c.relnamespace = n.oid AND n.nspname = '"); escaped = (char *)safe_emalloc(strlen(tmp_name), 2, 1); -#if HAVE_PQESCAPE_CONN new_len = PQescapeStringConn(pg_link, escaped, tmp_name, strlen(tmp_name), NULL); -#else - new_len = PQescapeString(escaped, tmp_name, strlen(tmp_name)); -#endif if (new_len) { - smart_str_appends(&querystr, escaped); + smart_str_appendl(&querystr, escaped, new_len); } efree(escaped); @@ -5204,7 +5188,7 @@ PHP_FUNCTION(pg_meta_data) uint table_name_len; PGconn *pgsql; int id = -1; - + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &pgsql_link, &table_name, &table_name_len) == FAILURE) { return; @@ -5231,13 +5215,14 @@ PHP_FUNCTION(pg_meta_data) } /* }}} */ + /* {{{ php_pgsql_get_data_type */ static php_pgsql_data_type php_pgsql_get_data_type(const char *type_name, size_t len) { - /* This is stupid way to do. I'll fix it when I decied how to support + /* This is stupid way to do. I'll fix it when I decied how to support user defined types. (Yasuo) */ - + /* boolean */ if (!strcmp(type_name, "bool")|| !strcmp(type_name, "boolean")) return PG_BOOL; @@ -5316,25 +5301,35 @@ static php_pgsql_data_type php_pgsql_get_data_type(const char *type_name, size_t return PG_POLYGON; if (!strcmp(type_name, "circle")) return PG_CIRCLE; - + return PG_UNKNOWN; } /* }}} */ /* {{{ php_pgsql_convert_match - * test field value with regular expression specified. + * test field value with regular expression specified. */ -static int php_pgsql_convert_match(const char *str, const char *regex , int icase TSRMLS_DC) +static int php_pgsql_convert_match(const char *str, size_t str_len, const char *regex , int icase TSRMLS_DC) { - regex_t re; + regex_t re; regmatch_t *subs; int regopt = REG_EXTENDED; int regerr, ret = SUCCESS; + int i; + + /* Check invalid chars for POSIX regex */ + for (i = 0; i < str_len; i++) { + if (str[i] == '\n' || + str[i] == '\r' || + str[i] == '\0' ) { + return FAILURE; + } + } if (icase) { regopt |= REG_ICASE; } - + regerr = regcomp(&re, regex, regopt); if (regerr) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot compile regex"); @@ -5345,7 +5340,7 @@ static int php_pgsql_convert_match(const char *str, const char *regex , int icas regerr = regexec(&re, str, re.re_nsub+1, subs, 0); if (regerr == REG_NOMATCH) { -#ifdef PHP_DEBUG +#ifdef PHP_DEBUG php_error_docref(NULL TSRMLS_CC, E_NOTICE, "'%s' does not match with '%s'", str, regex); #endif ret = FAILURE; @@ -5367,7 +5362,7 @@ static int php_pgsql_convert_match(const char *str, const char *regex , int icas static int php_pgsql_add_quotes(zval *src, zend_bool should_free TSRMLS_DC) { smart_str str = {0}; - + assert(Z_TYPE_P(src) == IS_STRING); assert(should_free == 1 || should_free == 0); @@ -5376,7 +5371,7 @@ static int php_pgsql_add_quotes(zval *src, zend_bool should_free TSRMLS_DC) smart_str_appendl(&str, Z_STRVAL_P(src), Z_STRLEN_P(src)); smart_str_appendc(&str, '\''); smart_str_0(&str); - + if (should_free) { efree(Z_STRVAL_P(src)); } @@ -5400,7 +5395,7 @@ static int php_pgsql_add_quotes(zval *src, zend_bool should_free TSRMLS_DC) php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Detected NULL for 'NOT NULL' field '%s'", field ); \ err = 1; \ } \ - } + } /* {{{ php_pgsql_convert * check and convert array values (fieldname=>vlaue pair) for sql @@ -5414,7 +5409,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con zval *meta, **def, **type, **not_null, **has_default, **is_enum, **val, *new_val; int key_type, err = 0, skip_field; php_pgsql_data_type data_type; - + assert(pg_link != NULL); assert(Z_TYPE_P(values) == IS_ARRAY); assert(Z_TYPE_P(result) == IS_ARRAY); @@ -5437,7 +5432,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con zend_hash_move_forward_ex(Z_ARRVAL_P(values), &pos)) { skip_field = 0; new_val = NULL; - + if ((key_type = zend_hash_get_current_key_ex(Z_ARRVAL_P(values), &field, &field_len, &num_idx, 0, &pos)) == HASH_KEY_NON_EXISTANT) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to get array key type"); err = 1; @@ -5518,7 +5513,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con } } break; - + case IS_LONG: case IS_BOOL: if (Z_LVAL_PP(val)) { @@ -5541,7 +5536,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects string, null, long or boolelan value for PostgreSQL '%s' (%s)", Z_STRVAL_PP(type), field); } break; - + case PG_OID: case PG_INT2: case PG_INT4: @@ -5553,7 +5548,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con } else { /* FIXME: better regex must be used */ - if (php_pgsql_convert_match(Z_STRVAL_PP(val), "^([+-]{0,1}[0-9]+)$", 0 TSRMLS_CC) == FAILURE) { + if (php_pgsql_convert_match(Z_STRVAL_PP(val), Z_STRLEN_PP(val), "^([+-]{0,1}[0-9]+)$", 0 TSRMLS_CC) == FAILURE) { err = 1; } else { @@ -5561,7 +5556,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con } } break; - + case IS_DOUBLE: ZVAL_DOUBLE(new_val, Z_DVAL_PP(val)); convert_to_long_ex(&new_val); @@ -5595,7 +5590,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con } else { /* FIXME: better regex must be used */ - if (php_pgsql_convert_match(Z_STRVAL_PP(val), "^([+-]{0,1}[0-9]+)|([+-]{0,1}[0-9]*[\\.][0-9]+)|([+-]{0,1}[0-9]+[\\.][0-9]*)$", 0 TSRMLS_CC) == FAILURE) { + if (php_pgsql_convert_match(Z_STRVAL_PP(val), Z_STRLEN_PP(val), "^([+-]{0,1}[0-9]+)|([+-]{0,1}[0-9]*[\\.][0-9]+)|([+-]{0,1}[0-9]+[\\.][0-9]*)$", 0 TSRMLS_CC) == FAILURE) { err = 1; } else { @@ -5603,15 +5598,15 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con } } break; - + case IS_LONG: ZVAL_LONG(new_val, Z_LVAL_PP(val)); break; - + case IS_DOUBLE: ZVAL_DOUBLE(new_val, Z_DVAL_PP(val)); break; - + case IS_NULL: ZVAL_STRING(new_val, "NULL", 1); break; @@ -5638,26 +5633,20 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con } } else { + char *tmp; Z_TYPE_P(new_val) = IS_STRING; -#if HAVE_PQESCAPE_CONN - { - char *tmp; - tmp = (char *)safe_emalloc(Z_STRLEN_PP(val), 2, 1); - Z_STRLEN_P(new_val) = (int)PQescapeStringConn(pg_link, tmp, Z_STRVAL_PP(val), Z_STRLEN_PP(val), NULL); - Z_STRVAL_P(new_val) = tmp; - } -#else - Z_STRVAL_P(new_val) = (int)PQescapeString(Z_STRVAL_PP(val), Z_STRLEN_PP(val), &Z_STRLEN_P(new_val), 0 TSRMLS_CC); -#endif + tmp = (char *)safe_emalloc(Z_STRLEN_PP(val), 2, 1); + Z_STRLEN_P(new_val) = (int)PQescapeStringConn(pg_link, tmp, Z_STRVAL_PP(val), Z_STRLEN_PP(val), NULL); + Z_STRVAL_P(new_val) = tmp; php_pgsql_add_quotes(new_val, 1 TSRMLS_CC); } break; - + case IS_LONG: ZVAL_LONG(new_val, Z_LVAL_PP(val)); convert_to_string_ex(&new_val); break; - + case IS_DOUBLE: ZVAL_DOUBLE(new_val, Z_DVAL_PP(val)); convert_to_string_ex(&new_val); @@ -5675,7 +5664,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects NULL, string, long or double value for PostgreSQL '%s' (%s)", Z_STRVAL_PP(type), field); } break; - + case PG_UNIX_TIME: case PG_UNIX_TIME_INTERVAL: /* these are the actallay a integer */ @@ -5686,25 +5675,25 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con } else { /* FIXME: Better regex must be used */ - if (php_pgsql_convert_match(Z_STRVAL_PP(val), "^[0-9]+$", 0 TSRMLS_CC) == FAILURE) { + if (php_pgsql_convert_match(Z_STRVAL_PP(val), Z_STRLEN_PP(val), "^[0-9]+$", 0 TSRMLS_CC) == FAILURE) { err = 1; - } + } else { ZVAL_STRING(new_val, Z_STRVAL_PP(val), 1); convert_to_long_ex(&new_val); } } break; - + case IS_DOUBLE: ZVAL_DOUBLE(new_val, Z_DVAL_PP(val)); convert_to_long_ex(&new_val); break; - + case IS_LONG: ZVAL_LONG(new_val, Z_LVAL_PP(val)); break; - + case IS_NULL: ZVAL_STRING(new_val, "NULL", 1); break; @@ -5717,7 +5706,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects NULL, string, long or double value for '%s' (%s)", Z_STRVAL_PP(type), field); } break; - + case PG_CIDR: case PG_INET: switch (Z_TYPE_PP(val)) { @@ -5727,7 +5716,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con } else { /* FIXME: Better regex must be used */ - if (php_pgsql_convert_match(Z_STRVAL_PP(val), "^([0-9]{1,3}\\.){3}[0-9]{1,3}(/[0-9]{1,2}){0,1}$", 0 TSRMLS_CC) == FAILURE) { + if (php_pgsql_convert_match(Z_STRVAL_PP(val), Z_STRLEN_PP(val), "^([0-9]{1,3}\\.){3}[0-9]{1,3}(/[0-9]{1,2}){0,1}$", 0 TSRMLS_CC) == FAILURE) { err = 1; } else { @@ -5743,13 +5732,13 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con default: err = 1; - } + } PGSQL_CONV_CHECK_IGNORE(); if (err) { php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects NULL or string for '%s' (%s)", Z_STRVAL_PP(type), field); } break; - + case PG_TIME_WITH_TIMEZONE: case PG_TIMESTAMP: case PG_TIMESTAMP_WITH_TIMEZONE: @@ -5761,7 +5750,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con ZVAL_STRINGL(new_val, "NOW()", sizeof("NOW()")-1, 1); } else { /* FIXME: better regex must be used */ - if (php_pgsql_convert_match(Z_STRVAL_PP(val), "^([0-9]{4}[/-][0-9]{1,2}[/-][0-9]{1,2})([ \\t]+(([0-9]{1,2}:[0-9]{1,2}){1}(:[0-9]{1,2}){0,1}(\\.[0-9]+){0,1}([ \\t]*([+-][0-9]{1,4}(:[0-9]{1,2}){0,1}|[-a-zA-Z_/+]{1,50})){0,1})){0,1}$", 1 TSRMLS_CC) == FAILURE) { + if (php_pgsql_convert_match(Z_STRVAL_PP(val), Z_STRLEN_PP(val), "^([0-9]{4}[/-][0-9]{1,2}[/-][0-9]{1,2})([ \\t]+(([0-9]{1,2}:[0-9]{1,2}){1}(:[0-9]{1,2}){0,1}(\\.[0-9]+){0,1}([ \\t]*([+-][0-9]{1,4}(:[0-9]{1,2}){0,1}|[-a-zA-Z_/+]{1,50})){0,1})){0,1}$", 1 TSRMLS_CC) == FAILURE) { err = 1; } else { ZVAL_STRING(new_val, Z_STRVAL_PP(val), 1); @@ -5769,7 +5758,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con } } break; - + case IS_NULL: ZVAL_STRINGL(new_val, "NULL", sizeof("NULL")-1, 1); break; @@ -5782,7 +5771,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects NULL or string for PostgreSQL %s field (%s)", Z_STRVAL_PP(type), field); } break; - + case PG_DATE: switch(Z_TYPE_PP(val)) { case IS_STRING: @@ -5791,7 +5780,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con } else { /* FIXME: better regex must be used */ - if (php_pgsql_convert_match(Z_STRVAL_PP(val), "^([0-9]{4}[/-][0-9]{1,2}[/-][0-9]{1,2})$", 1 TSRMLS_CC) == FAILURE) { + if (php_pgsql_convert_match(Z_STRVAL_PP(val), Z_STRLEN_PP(val), "^([0-9]{4}[/-][0-9]{1,2}[/-][0-9]{1,2})$", 1 TSRMLS_CC) == FAILURE) { err = 1; } else { @@ -5800,7 +5789,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con } } break; - + case IS_NULL: ZVAL_STRING(new_val, "NULL", 1); break; @@ -5822,7 +5811,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con } else { /* FIXME: better regex must be used */ - if (php_pgsql_convert_match(Z_STRVAL_PP(val), "^(([0-9]{1,2}:[0-9]{1,2}){1}(:[0-9]{1,2}){0,1})){0,1}$", 1 TSRMLS_CC) == FAILURE) { + if (php_pgsql_convert_match(Z_STRVAL_PP(val), Z_STRLEN_PP(val), "^(([0-9]{1,2}:[0-9]{1,2}){1}(:[0-9]{1,2}){0,1})){0,1}$", 1 TSRMLS_CC) == FAILURE) { err = 1; } else { @@ -5831,7 +5820,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con } } break; - + case IS_NULL: ZVAL_STRING(new_val, "NULL", 1); break; @@ -5868,10 +5857,10 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con Quantities of days, hours, minutes, and seconds can be specified without explicit unit markings. For example, '1 12:59:10' is read the same as '1 day 12 hours 59 min 10 sec'. - */ - if (php_pgsql_convert_match(Z_STRVAL_PP(val), + */ + if (php_pgsql_convert_match(Z_STRVAL_PP(val), Z_STRLEN_PP(val), "^(@?[ \\t]+)?(" - + /* Textual time units and their abbreviations: */ "(([-+]?[ \\t]+)?" "[0-9]+(\\.[0-9]*)?[ \\t]*" @@ -5908,9 +5897,9 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con ZVAL_STRING(new_val, Z_STRVAL_PP(val), 1); php_pgsql_add_quotes(new_val, 1 TSRMLS_CC); } - } + } break; - + case IS_NULL: ZVAL_STRING(new_val, "NULL", 1); break; @@ -5952,12 +5941,12 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con Z_STRLEN_P(new_val) = s.len; } break; - + case IS_LONG: ZVAL_LONG(new_val, Z_LVAL_PP(val)); convert_to_string_ex(&new_val); break; - + case IS_DOUBLE: ZVAL_DOUBLE(new_val, Z_DVAL_PP(val)); convert_to_string_ex(&new_val); @@ -5984,7 +5973,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con ZVAL_STRING(new_val, "NULL", 1); } else { - if (php_pgsql_convert_match(Z_STRVAL_PP(val), "^([0-9a-f]{2,2}:){5,5}[0-9a-f]{2,2}$", 1 TSRMLS_CC) == FAILURE) { + if (php_pgsql_convert_match(Z_STRVAL_PP(val), Z_STRLEN_PP(val), "^([0-9a-f]{2,2}:){5,5}[0-9a-f]{2,2}$", 1 TSRMLS_CC) == FAILURE) { err = 1; } else { @@ -5993,7 +5982,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con } } break; - + case IS_NULL: ZVAL_STRING(new_val, "NULL", 1); break; @@ -6028,7 +6017,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con err = 1; break; } /* switch */ - + if (err) { zval_dtor(new_val); FREE_ZVAL(new_val); @@ -6040,16 +6029,12 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con size_t field_len = strlen(field); if (_php_pgsql_detect_identifier_escape(field, field_len) == SUCCESS) { - escaped = _php_pgsql_strndup(field, field_len); + add_assoc_zval(result, field, new_val); } else { -#if HAVE_PQESCAPELITERAL - escaped = PQescapeIdentifier(pg_link, field, field_len); -#else - escaped = _php_pgsql_escape_identifier(field, field_len); -#endif + escaped = PGSQLescapeIdentifier(pg_link, field, field_len); + add_assoc_zval(result, escaped, new_val); + PGSQLfree(escaped); } - add_assoc_zval(result, escaped, new_val); - free(escaped); } } /* for */ zval_dtor(meta); @@ -6074,7 +6059,7 @@ PHP_FUNCTION(pg_convert) ulong option = 0; PGconn *pg_link; int id = -1; - + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsa|l", &pgsql_link, &table_name, &table_name_len, &values, &option) == FAILURE) { return; @@ -6134,31 +6119,24 @@ static inline void build_tablename(smart_str *querystr, PGconn *pg_link, const c token = php_strtok_r(table_copy, ".", &tmp); len = strlen(token); if (_php_pgsql_detect_identifier_escape(token, len) == SUCCESS) { - escaped = _php_pgsql_strndup(token, len); + smart_str_appendl(querystr, token, len); } else { -#if HAVE_PQESCAPELITERAL - escaped = PQescapeIdentifier(pg_link, token, len); -#else - escaped = _php_pgsql_escape_identifier(token, len); -#endif + escaped = PGSQLescapeIdentifier(pg_link, token, len); + smart_str_appends(querystr, escaped); + PGSQLfree(escaped); } - smart_str_appends(querystr, escaped); - free(escaped); if (tmp && *tmp) { len = strlen(tmp); /* "schema"."table" format */ if (_php_pgsql_detect_identifier_escape(tmp, len) == SUCCESS) { - escaped = _php_pgsql_strndup(tmp, len); + smart_str_appendc(querystr, '.'); + smart_str_appendl(querystr, tmp, len); } else { -#if HAVE_PQESCAPELITERAL - escaped = PQescapeIdentifier(pg_link, tmp, len); -#else - escaped = _php_pgsql_escape_identifier(tmp, len); -#endif + escaped = PGSQLescapeIdentifier(pg_link, tmp, len); + smart_str_appendc(querystr, '.'); + smart_str_appends(querystr, escaped); + PGSQLfree(escaped); } - smart_str_appendc(querystr, '.'); - smart_str_appends(querystr, escaped); - free(escaped); } efree(table_copy); } @@ -6258,7 +6236,7 @@ no_values: cleanup: if (!(opt & PGSQL_DML_NO_CONV) && converted) { - zval_dtor(converted); + zval_dtor(converted); FREE_ZVAL(converted); } if (ret == SUCCESS && (opt & PGSQL_DML_STRING)) { @@ -6319,7 +6297,7 @@ static inline int build_assignment_string(smart_str *querystr, HashTable *ht, in for (zend_hash_internal_pointer_reset_ex(ht, &pos); zend_hash_get_current_data_ex(ht, (void **)&val, &pos) == SUCCESS; zend_hash_move_forward_ex(ht, &pos)) { - key_type = zend_hash_get_current_key_ex(ht, &fld, &fld_len, &num_idx, 0, &pos); + key_type = zend_hash_get_current_key_ex(ht, &fld, &fld_len, &num_idx, 0, &pos); if (key_type == HASH_KEY_IS_LONG) { php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Expects associative array for values to be inserted"); return -1; @@ -6330,7 +6308,7 @@ static inline int build_assignment_string(smart_str *querystr, HashTable *ht, in } else { smart_str_appendc(querystr, '='); } - + switch(Z_TYPE_PP(val)) { case IS_STRING: smart_str_appendl(querystr, Z_STRVAL_PP(val), Z_STRLEN_PP(val)); @@ -6459,7 +6437,7 @@ PHP_FUNCTION(pg_update) RETURN_STRING(sql, 0); } RETURN_TRUE; -} +} /* }}} */ /* {{{ php_pgsql_delete @@ -6506,7 +6484,7 @@ PHP_PGSQL_API int php_pgsql_delete(PGconn *pg_link, const char *table, zval *ids cleanup: if (!(opt & PGSQL_DML_NO_CONV)) { - zval_dtor(ids_converted); + zval_dtor(ids_converted); FREE_ZVAL(ids_converted); } if (ret == SUCCESS && (opt & PGSQL_DML_STRING)) { @@ -6610,7 +6588,7 @@ PHP_PGSQL_API int php_pgsql_select(PGconn *pg_link, const char *table, zval *ids assert(Z_TYPE_P(ids_array) == IS_ARRAY); assert(Z_TYPE_P(ret_array) == IS_ARRAY); assert(!(opt & ~(PGSQL_CONV_OPTS|PGSQL_DML_NO_CONV|PGSQL_DML_EXEC|PGSQL_DML_ASYNC|PGSQL_DML_STRING))); - + if (zend_hash_num_elements(Z_ARRVAL_P(ids_array)) == 0) { return FAILURE; } @@ -6644,7 +6622,7 @@ PHP_PGSQL_API int php_pgsql_select(PGconn *pg_link, const char *table, zval *ids cleanup: if (!(opt & PGSQL_DML_NO_CONV)) { - zval_dtor(ids_converted); + zval_dtor(ids_converted); FREE_ZVAL(ids_converted); } if (ret == SUCCESS && (opt & PGSQL_DML_STRING)) { @@ -6692,7 +6670,7 @@ PHP_FUNCTION(pg_select) RETURN_STRING(sql, 0); } return; -} +} /* }}} */ #endif diff --git a/ext/pgsql/php_pgsql.h b/ext/pgsql/php_pgsql.h index 63f50f0f99..d0853d603e 100644 --- a/ext/pgsql/php_pgsql.h +++ b/ext/pgsql/php_pgsql.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | @@ -16,7 +16,7 @@ | Jouni Ahto <jouni.ahto@exdec.fi> | +----------------------------------------------------------------------+ */ - + /* $Id$ */ #ifndef PHP_PGSQL_H @@ -257,7 +257,7 @@ typedef enum _php_pgsql_data_type { PG_PATH, PG_POLYGON, PG_CIRCLE, - /* unkown and system */ + /* unknown and system */ PG_UNKNOWN } php_pgsql_data_type; diff --git a/ext/phar/dirstream.c b/ext/phar/dirstream.c index 277d058ea6..1cbe522f11 100644 --- a/ext/phar/dirstream.c +++ b/ext/phar/dirstream.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | phar:// stream wrapper support | +----------------------------------------------------------------------+ - | Copyright (c) 2005-2013 The PHP Group | + | Copyright (c) 2005-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 | @@ -168,11 +168,7 @@ static int phar_compare_dir_name(const void *a, const void *b TSRMLS_DC) /* {{{ f = *((Bucket **) a); s = *((Bucket **) b); -#if (PHP_MAJOR_VERSION < 6) result = zend_binary_strcmp(f->arKey, f->nKeyLength, s->arKey, s->nKeyLength); -#else - result = zend_binary_strcmp(f->key.arKey.s, f->nKeyLength, s->key.arKey.s, s->nKeyLength); -#endif if (result < 0) { return -1; diff --git a/ext/phar/dirstream.h b/ext/phar/dirstream.h index 9b07c9d799..1fe2344d2e 100644 --- a/ext/phar/dirstream.h +++ b/ext/phar/dirstream.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | phar php single-file executable PHP extension | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2013 The PHP Group | + | Copyright (c) 2006-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 | diff --git a/ext/phar/func_interceptors.c b/ext/phar/func_interceptors.c index 00cb92ff13..87411fc98d 100644 --- a/ext/phar/func_interceptors.c +++ b/ext/phar/func_interceptors.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | phar php single-file executable PHP extension | +----------------------------------------------------------------------+ - | Copyright (c) 2005-2013 The PHP Group | + | Copyright (c) 2005-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 | diff --git a/ext/phar/func_interceptors.h b/ext/phar/func_interceptors.h index 59d6bf6291..ff271460fe 100644 --- a/ext/phar/func_interceptors.h +++ b/ext/phar/func_interceptors.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | phar php single-file executable PHP extension | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2013 The PHP Group | + | Copyright (c) 2006-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 | diff --git a/ext/phar/phar.1.in b/ext/phar/phar.1.in index 259a2bae86..52c3046222 100644 --- a/ext/phar/phar.1.in +++ b/ext/phar/phar.1.in @@ -507,7 +507,7 @@ contributors all around the world. .SH VERSION INFORMATION This manpage describes \fBphar\fP, version @PHP_VERSION@. .SH COPYRIGHT -Copyright \(co 1997\-2013 The PHP Group +Copyright \(co 1997\-2014 The PHP Group .LP This source file is subject to version 3.01 of the PHP license, that is bundled with this package in the file LICENSE, and is diff --git a/ext/phar/phar.c b/ext/phar/phar.c index c85687ef5c..ec82351410 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | phar php single-file executable PHP extension | +----------------------------------------------------------------------+ - | Copyright (c) 2005-2013 The PHP Group | + | Copyright (c) 2005-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 | diff --git a/ext/phar/phar_internal.h b/ext/phar/phar_internal.h index daa85f1b70..c9306c15f4 100644 --- a/ext/phar/phar_internal.h +++ b/ext/phar/phar_internal.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | phar php single-file executable PHP extension | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2013 The PHP Group | + | Copyright (c) 2006-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 | diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index aeb11851c5..ebaa620080 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | phar php single-file executable PHP extension | +----------------------------------------------------------------------+ - | Copyright (c) 2005-2013 The PHP Group | + | Copyright (c) 2005-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 | diff --git a/ext/phar/phar_path_check.c b/ext/phar/phar_path_check.c index 8275c9c994..c1aff7037d 100644 --- a/ext/phar/phar_path_check.c +++ b/ext/phar/phar_path_check.c @@ -4,7 +4,7 @@ +----------------------------------------------------------------------+ | phar php single-file executable PHP extension | +----------------------------------------------------------------------+ - | Copyright (c) 2007-2013 The PHP Group | + | Copyright (c) 2007-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 | diff --git a/ext/phar/pharzip.h b/ext/phar/pharzip.h index 9c088d3a08..62e3de7376 100644 --- a/ext/phar/pharzip.h +++ b/ext/phar/pharzip.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | phar php single-file executable PHP extension | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2013 The PHP Group | + | Copyright (c) 2006-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 | diff --git a/ext/phar/php_phar.h b/ext/phar/php_phar.h index a6d7bff414..554489f478 100644 --- a/ext/phar/php_phar.h +++ b/ext/phar/php_phar.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | phar php single-file executable PHP extension | +----------------------------------------------------------------------+ - | Copyright (c) 2005-2013 The PHP Group | + | Copyright (c) 2005-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 | diff --git a/ext/phar/stream.c b/ext/phar/stream.c index 924138d8fa..4101008549 100644 --- a/ext/phar/stream.c +++ b/ext/phar/stream.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | phar:// stream wrapper support | +----------------------------------------------------------------------+ - | Copyright (c) 2005-2013 The PHP Group | + | Copyright (c) 2005-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 | diff --git a/ext/phar/stream.h b/ext/phar/stream.h index b22b67ab01..097bf2ca52 100644 --- a/ext/phar/stream.h +++ b/ext/phar/stream.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | phar php single-file executable PHP extension | +----------------------------------------------------------------------+ - | Copyright (c) 2006-2013 The PHP Group | + | Copyright (c) 2006-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 | diff --git a/ext/phar/stub.h b/ext/phar/stub.h index daafa391ca..6d524c69d1 100644 --- a/ext/phar/stub.h +++ b/ext/phar/stub.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | phar php single-file executable PHP extension generated stub | +----------------------------------------------------------------------+ - | Copyright (c) 2005-2013 The PHP Group | + | Copyright (c) 2005-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 | diff --git a/ext/phar/tar.c b/ext/phar/tar.c index 0e60e3db13..ca8eafcc8a 100644 --- a/ext/phar/tar.c +++ b/ext/phar/tar.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | TAR archive support for Phar | +----------------------------------------------------------------------+ - | Copyright (c) 2005-2013 The PHP Group | + | Copyright (c) 2005-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 | diff --git a/ext/phar/tar.h b/ext/phar/tar.h index 8bfc3817a1..0305812849 100644 --- a/ext/phar/tar.h +++ b/ext/phar/tar.h @@ -4,7 +4,7 @@ +----------------------------------------------------------------------+ | TAR archive support for Phar | +----------------------------------------------------------------------+ - | Copyright (c) 2005-2013 The PHP Group | + | Copyright (c) 2005-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 | diff --git a/ext/phar/util.c b/ext/phar/util.c index 227bd15dc7..cd473ad425 100644 --- a/ext/phar/util.c +++ b/ext/phar/util.c @@ -3,7 +3,7 @@ | phar php single-file executable PHP extension | | utility functions | +----------------------------------------------------------------------+ - | Copyright (c) 2005-2013 The PHP Group | + | Copyright (c) 2005-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 | diff --git a/ext/phar/zip.c b/ext/phar/zip.c index 6ba745e9cb..79203c8a9b 100644 --- a/ext/phar/zip.c +++ b/ext/phar/zip.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | ZIP archive support for Phar | +----------------------------------------------------------------------+ - | Copyright (c) 2007-2013 The PHP Group | + | Copyright (c) 2007-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 | diff --git a/ext/posix/php_posix.h b/ext/posix/php_posix.h index 2c073496b5..8ace07c1c0 100644 --- a/ext/posix/php_posix.h +++ b/ext/posix/php_posix.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/posix/posix.c b/ext/posix/posix.c index 32db6705f5..1dfa9997ed 100644 --- a/ext/posix/posix.c +++ b/ext/posix/posix.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/pspell/php_pspell.h b/ext/pspell/php_pspell.h index b4e97f3a6f..83103fae74 100644 --- a/ext/pspell/php_pspell.h +++ b/ext/pspell/php_pspell.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/pspell/pspell.c b/ext/pspell/pspell.c index 79a597e862..85199d621d 100644 --- a/ext/pspell/pspell.c +++ b/ext/pspell/pspell.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/readline/php_readline.h b/ext/readline/php_readline.h index a9f8287ad2..5660bdb7f6 100644 --- a/ext/readline/php_readline.h +++ b/ext/readline/php_readline.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/readline/readline.c b/ext/readline/readline.c index bd460696bd..14859a96bb 100644 --- a/ext/readline/readline.c +++ b/ext/readline/readline.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/readline/readline_cli.c b/ext/readline/readline_cli.c index f4ce12bade..c2bf8764cb 100644 --- a/ext/readline/readline_cli.c +++ b/ext/readline/readline_cli.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/readline/readline_cli.h b/ext/readline/readline_cli.h index d9deb8a04c..becd9d3342 100644 --- a/ext/readline/readline_cli.h +++ b/ext/readline/readline_cli.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/recode/php_recode.h b/ext/recode/php_recode.h index 9faa01cc20..76ae292c56 100644 --- a/ext/recode/php_recode.h +++ b/ext/recode/php_recode.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/recode/recode.c b/ext/recode/recode.c index 7203cb24ea..3fff0a7f7f 100644 --- a/ext/recode/recode.c +++ b/ext/recode/recode.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index c4a7c554f0..f6367cdb4e 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | @@ -1105,29 +1105,26 @@ static void _extension_string(string *str, zend_module_entry *module, char *inde string_free(&str_constants); } - if (module->functions && module->functions->fname) { + { + HashPosition iterator; zend_function *fptr; - const zend_function_entry *func = module->functions; - - string_printf(str, "\n - Functions {\n"); - - /* Is there a better way of doing this? */ - while (func->fname) { - int fname_len = strlen(func->fname); - char *lc_name = zend_str_tolower_dup(func->fname, fname_len); - - if (zend_hash_find(EG(function_table), lc_name, fname_len + 1, (void**) &fptr) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Internal error: Cannot find extension function %s in global function table", func->fname); - func++; - efree(lc_name); - continue; + int first = 1; + + zend_hash_internal_pointer_reset_ex(CG(function_table), &iterator); + while (zend_hash_get_current_data_ex(CG(function_table), (void **) &fptr, &iterator) == SUCCESS) { + if (fptr->common.type==ZEND_INTERNAL_FUNCTION + && fptr->internal_function.module == module) { + if (first) { + string_printf(str, "\n - Functions {\n"); + first = 0; + } + _function_string(str, fptr, NULL, " " TSRMLS_CC); } - - _function_string(str, fptr, NULL, " " TSRMLS_CC); - efree(lc_name); - func++; + zend_hash_move_forward_ex(CG(function_table), &iterator); + } + if (!first) { + string_printf(str, "%s }\n", indent); } - string_printf(str, "%s }\n", indent); } { @@ -5242,6 +5239,9 @@ ZEND_METHOD(reflection_extension, getFunctions) { reflection_object *intern; zend_module_entry *module; + HashPosition iterator; + zval *function; + zend_function *fptr; if (zend_parse_parameters_none() == FAILURE) { return; @@ -5249,29 +5249,15 @@ ZEND_METHOD(reflection_extension, getFunctions) GET_REFLECTION_OBJECT_PTR(module); array_init(return_value); - if (module->functions) { - zval *function; - zend_function *fptr; - const zend_function_entry *func = module->functions; - - /* Is there a better way of doing this? */ - while (func->fname) { - int fname_len = strlen(func->fname); - char *lc_name = zend_str_tolower_dup(func->fname, fname_len); - - if (zend_hash_find(EG(function_table), lc_name, fname_len + 1, (void**) &fptr) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Internal error: Cannot find extension function %s in global function table", func->fname); - func++; - efree(lc_name); - continue; - } - + zend_hash_internal_pointer_reset_ex(CG(function_table), &iterator); + while (zend_hash_get_current_data_ex(CG(function_table), (void **) &fptr, &iterator) == SUCCESS) { + if (fptr->common.type==ZEND_INTERNAL_FUNCTION + && fptr->internal_function.module == module) { ALLOC_ZVAL(function); reflection_function_factory(fptr, NULL, function TSRMLS_CC); - add_assoc_zval_ex(return_value, func->fname, fname_len+1, function); - func++; - efree(lc_name); + add_assoc_zval(return_value, fptr->common.function_name, function); } + zend_hash_move_forward_ex(CG(function_table), &iterator); } } /* }}} */ diff --git a/ext/reflection/php_reflection.h b/ext/reflection/php_reflection.h index 48470f4f63..2c03bd6e7e 100644 --- a/ext/reflection/php_reflection.h +++ b/ext/reflection/php_reflection.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/reflection/tests/ReflectionClass_getStaticPropertyValue_001_2_4.phpt b/ext/reflection/tests/ReflectionClass_getStaticPropertyValue_001_2_4.phpt index c299412e13..8bb62d95f1 100644 --- a/ext/reflection/tests/ReflectionClass_getStaticPropertyValue_001_2_4.phpt +++ b/ext/reflection/tests/ReflectionClass_getStaticPropertyValue_001_2_4.phpt @@ -56,6 +56,6 @@ string(13) "default value" Fatal error: Uncaught exception 'ReflectionException' with message 'Class A does not have a property named ' in %sReflectionClass_getStaticPropertyValue_001_2_4.php:%d Stack trace: -#0 %sReflectionClass_getStaticPropertyValue_001_2_4.php(%d): ReflectionClass->getStaticPropertyValue('?A?privateOverr...') +#0 %sReflectionClass_getStaticPropertyValue_001_2_4.php(%d): ReflectionClass->getStaticPropertyValue('\x00A\x00privateOverr...') #1 {main} thrown in %sReflectionClass_getStaticPropertyValue_001_2_4.php on line %d diff --git a/ext/reflection/tests/ReflectionClass_setStaticPropertyValue_001_2_4.phpt b/ext/reflection/tests/ReflectionClass_setStaticPropertyValue_001_2_4.phpt index 1092f6553d..dc13bf562d 100644 --- a/ext/reflection/tests/ReflectionClass_setStaticPropertyValue_001_2_4.phpt +++ b/ext/reflection/tests/ReflectionClass_setStaticPropertyValue_001_2_4.phpt @@ -56,6 +56,6 @@ Set static values in A: Fatal error: Uncaught exception 'ReflectionException' with message 'Class A does not have a property named ' in %sReflectionClass_setStaticPropertyValue_001_2_4.php:%d Stack trace: -#0 %sReflectionClass_setStaticPropertyValue_001_2_4.php(%d): ReflectionClass->setStaticPropertyValue('?A?privateOverr...', 'new value 1') +#0 %sReflectionClass_setStaticPropertyValue_001_2_4.php(%d): ReflectionClass->setStaticPropertyValue('\x00A\x00privateOverr...', 'new value 1') #1 {main} thrown in %sReflectionClass_setStaticPropertyValue_001_2_4.php on line %d diff --git a/ext/reflection/tests/ReflectionExtension_bug66218.phpt b/ext/reflection/tests/ReflectionExtension_bug66218.phpt new file mode 100644 index 0000000000..e263624bad --- /dev/null +++ b/ext/reflection/tests/ReflectionExtension_bug66218.phpt @@ -0,0 +1,21 @@ +--TEST-- +ReflectionExtension::getFunctions() ##6218 zend_register_functions breaks reflection +--SKIPIF-- +<?php +if (!extension_loaded('reflection')) print 'skip missing reflection extension'; +if (PHP_SAPI != "cli") die("skip CLI only test"); +if (!function_exists("dl")) die("skip need dl"); +?> +--FILE-- +<?php +$r = new ReflectionExtension('standard'); +$t = $r->getFunctions(); +var_dump($t['dl']); +?> +Done +--EXPECTF-- +object(ReflectionFunction)#%d (1) { + ["name"]=> + string(2) "dl" +} +Done diff --git a/ext/session/mod_files.c b/ext/session/mod_files.c index 1665ba53aa..86a2235845 100644 --- a/ext/session/mod_files.c +++ b/ext/session/mod_files.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | @@ -176,10 +176,12 @@ static void ps_files_open(ps_files *data, const char *key TSRMLS_DC) if (fstat(data->fd, &sbuf)) { close(data->fd); + data->fd = -1; return; } if (S_ISLNK(sbuf.st_mode) && php_check_open_basedir(buf TSRMLS_CC)) { close(data->fd); + data->fd = -1; return; } } diff --git a/ext/session/mod_files.h b/ext/session/mod_files.h index c97d168b1e..80493212af 100644 --- a/ext/session/mod_files.h +++ b/ext/session/mod_files.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/session/mod_mm.c b/ext/session/mod_mm.c index e0d16d1924..01b4345ed3 100644 --- a/ext/session/mod_mm.c +++ b/ext/session/mod_mm.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/session/mod_mm.h b/ext/session/mod_mm.h index 3ddadced4e..cafbfa0932 100644 --- a/ext/session/mod_mm.h +++ b/ext/session/mod_mm.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/session/mod_user.c b/ext/session/mod_user.c index 57d7bd0edc..33d403c617 100644 --- a/ext/session/mod_user.c +++ b/ext/session/mod_user.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/session/mod_user.h b/ext/session/mod_user.h index fd149ccff4..dd37d8f9f5 100644 --- a/ext/session/mod_user.h +++ b/ext/session/mod_user.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/session/mod_user_class.c b/ext/session/mod_user_class.c index 1ed1e7bbd5..718b92a690 100644 --- a/ext/session/mod_user_class.c +++ b/ext/session/mod_user_class.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/session/php_session.h b/ext/session/php_session.h index adc5e70402..a9f11f6310 100644 --- a/ext/session/php_session.h +++ b/ext/session/php_session.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/session/session.c b/ext/session/session.c index e699cb9b5c..74a7f4a1da 100644 --- a/ext/session/session.c +++ b/ext/session/session.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | @@ -618,11 +618,10 @@ static PHP_INI_MH(OnUpdateSaveDir) /* {{{ */ static PHP_INI_MH(OnUpdateName) /* {{{ */ { /* Numeric session.name won't work at all */ - if (PG(modules_activated) && - (!new_value_length || is_numeric_string(new_value, new_value_length, NULL, NULL, 0))) { + if ((!new_value_length || is_numeric_string(new_value, new_value_length, NULL, NULL, 0))) { int err_type; - if (stage == ZEND_INI_STAGE_RUNTIME) { + if (stage == ZEND_INI_STAGE_RUNTIME || stage == ZEND_INI_STAGE_ACTIVATE || stage == ZEND_INI_STAGE_STARTUP) { err_type = E_WARNING; } else { err_type = E_ERROR; @@ -1184,6 +1183,49 @@ static int php_session_cache_limiter(TSRMLS_D) /* {{{ */ #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() + * removes all of matching cookie. i.e. It deletes all of Set-Cookie headers. + */ +static void php_session_remove_cookie(TSRMLS_D) { + sapi_header_struct *header; + zend_llist *l = &SG(sapi_headers).headers; + zend_llist_element *next; + zend_llist_element *current; + char *session_cookie, *e_session_name; + int session_cookie_len, len = sizeof("Set-Cookie")-1; + + e_session_name = php_url_encode(PS(session_name), strlen(PS(session_name)), NULL); + spprintf(&session_cookie, 0, "Set-Cookie: %s=", e_session_name); + efree(e_session_name); + + session_cookie_len = strlen(session_cookie); + current = l->head; + while (current) { + header = (sapi_header_struct *)(current->data); + next = current->next; + if (header->header_len > len && header->header[len] == ':' + && !strncmp(header->header, session_cookie, session_cookie_len)) { + if (current->prev) { + current->prev->next = next; + } else { + l->head = next; + } + if (next) { + next->prev = current->prev; + } else { + l->tail = current->prev; + } + sapi_free_header(header); + efree(current); + --l->count; + } + current = next; + } + efree(session_cookie); +} + static void php_session_send_cookie(TSRMLS_D) /* {{{ */ { smart_str ncookie = {0}; @@ -1249,8 +1291,7 @@ static void php_session_send_cookie(TSRMLS_D) /* {{{ */ smart_str_0(&ncookie); - /* 'replace' must be 0 here, else a previous Set-Cookie - header, probably sent with setcookie() will be replaced! */ + php_session_remove_cookie(TSRMLS_C); /* remove already sent session ID cookie */ sapi_add_header_ex(ncookie.c, ncookie.len, 0, 0 TSRMLS_CC); } /* }}} */ diff --git a/ext/session/tests/bug60634.phpt b/ext/session/tests/bug60634.phpt index 2ec0c26c13..86dcb11526 100644 --- a/ext/session/tests/bug60634.phpt +++ b/ext/session/tests/bug60634.phpt @@ -1,7 +1,5 @@ --TEST-- Bug #60634 (Segmentation fault when trying to die() in SessionHandler::write()) ---XFAIL-- -Long term low priority bug, working on it --INI-- session.save_path= session.name=PHPSESSID @@ -44,3 +42,5 @@ echo "um, hi\n"; ?> --EXPECTF-- write: goodbye cruel world +close: goodbye cruel world + diff --git a/ext/session/tests/bug60634_error_1.phpt b/ext/session/tests/bug60634_error_1.phpt index 3b6e394eed..e41592f18d 100644 --- a/ext/session/tests/bug60634_error_1.phpt +++ b/ext/session/tests/bug60634_error_1.phpt @@ -1,7 +1,5 @@ --TEST-- Bug #60634 (Segmentation fault when trying to die() in SessionHandler::write()) - fatal error in write during exec ---XFAIL-- -Long term low priority bug, working on it --INI-- session.save_path= session.name=PHPSESSID @@ -47,3 +45,4 @@ echo "um, hi\n"; write: goodbye cruel world Fatal error: Call to undefined function undefined_function() in %s on line %d +close: goodbye cruel world diff --git a/ext/session/tests/bug60634_error_2.phpt b/ext/session/tests/bug60634_error_2.phpt index 265fb303f7..7c50948ba8 100644 --- a/ext/session/tests/bug60634_error_2.phpt +++ b/ext/session/tests/bug60634_error_2.phpt @@ -1,7 +1,5 @@ --TEST-- Bug #60634 (Segmentation fault when trying to die() in SessionHandler::write()) - exception in write during exec ---XFAIL-- -Long term low priority bug, working on it --INI-- session.save_path= session.name=PHPSESSID @@ -47,3 +45,8 @@ echo "um, hi\n"; write: goodbye cruel world Fatal error: Uncaught exception 'Exception' in %s +Stack trace: +#0 [internal function]: write('%s', '') +#1 %s(%d): session_write_close() +#2 {main} + thrown in %s on line %d diff --git a/ext/session/tests/bug60634_error_3.phpt b/ext/session/tests/bug60634_error_3.phpt index b2004d68bc..4a508a4d8f 100644 --- a/ext/session/tests/bug60634_error_3.phpt +++ b/ext/session/tests/bug60634_error_3.phpt @@ -1,7 +1,5 @@ --TEST-- Bug #60634 (Segmentation fault when trying to die() in SessionHandler::write()) - fatal error in write after exec ---XFAIL-- -Long term low priority bug, working on it --INI-- session.save_path= session.name=PHPSESSID @@ -46,3 +44,4 @@ session_start(); write: goodbye cruel world Fatal error: Call to undefined function undefined_function() in %s on line %d +close: goodbye cruel world diff --git a/ext/session/tests/bug60634_error_4.phpt b/ext/session/tests/bug60634_error_4.phpt index 60bc0dcf54..d0b5786af9 100644 --- a/ext/session/tests/bug60634_error_4.phpt +++ b/ext/session/tests/bug60634_error_4.phpt @@ -1,7 +1,5 @@ --TEST-- Bug #60634 (Segmentation fault when trying to die() in SessionHandler::write()) - exception in write after exec ---XFAIL-- -Long term low priority bug, working on it --INI-- session.save_path= session.name=PHPSESSID @@ -46,3 +44,9 @@ session_start(); write: goodbye cruel world Fatal error: Uncaught exception 'Exception' in %s +Stack trace: +#0 [internal function]: write('%s', '') +#1 {main} + thrown in %s on line %d +close: goodbye cruel world + diff --git a/ext/session/tests/bug66481-win32.phpt b/ext/session/tests/bug66481-win32.phpt new file mode 100644 index 0000000000..4a3b07735b --- /dev/null +++ b/ext/session/tests/bug66481-win32.phpt @@ -0,0 +1,16 @@ +--TEST-- +Bug #66481: Calls to session_name() segfault when session.name is null, Windows. +--INI-- +session.name= +--SKIPIF-- +<?php include('skipif.inc'); ?> +<?php if(substr(PHP_OS, 0, 3) != "WIN") die("skip Windows only"); ?> +--FILE-- +<?php + +var_dump(session_name("foo")); +var_dump(session_name("bar")); +--EXPECTF-- +Warning: PHP Startup: session.name cannot be a numeric or empty '' in Unknown on line 0 +string(9) "PHPSESSID" +string(3) "foo" diff --git a/ext/session/tests/bug66481.phpt b/ext/session/tests/bug66481.phpt new file mode 100644 index 0000000000..5525ae8a38 --- /dev/null +++ b/ext/session/tests/bug66481.phpt @@ -0,0 +1,18 @@ +--TEST-- +Bug #66481: Calls to session_name() segfault when session.name is null. +--INI-- +session.name= +--SKIPIF-- +<?php include('skipif.inc'); ?> +<?php if(substr(PHP_OS, 0, 3) == "WIN") die("skip Not for Windows"); ?> +--FILE-- +<?php + +var_dump(session_name("foo")); +var_dump(session_name("bar")); +--EXPECTF-- +PHP Warning: PHP Startup: session.name cannot be a numeric or empty '' in Unknown on line 0 + +Warning: PHP Startup: session.name cannot be a numeric or empty '' in Unknown on line 0 +string(9) "PHPSESSID" +string(3) "foo" diff --git a/ext/shmop/php_shmop.h b/ext/shmop/php_shmop.h index 0abc703d1f..2779fe14be 100644 --- a/ext/shmop/php_shmop.h +++ b/ext/shmop/php_shmop.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/shmop/shmop.c b/ext/shmop/shmop.c index a14a0b7e45..73372d4e8c 100644 --- a/ext/shmop/shmop.c +++ b/ext/shmop/shmop.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/simplexml/php_simplexml.h b/ext/simplexml/php_simplexml.h index c340a5e8a6..7314d8c825 100644 --- a/ext/simplexml/php_simplexml.h +++ b/ext/simplexml/php_simplexml.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/simplexml/php_simplexml_exports.h b/ext/simplexml/php_simplexml_exports.h index 66ec3bd28d..2c858566b9 100644 --- a/ext/simplexml/php_simplexml_exports.h +++ b/ext/simplexml/php_simplexml_exports.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c index 2358f2be65..b9966ddcce 100644 --- a/ext/simplexml/simplexml.c +++ b/ext/simplexml/simplexml.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/simplexml/sxe.c b/ext/simplexml/sxe.c index e3278da631..9a513e946f 100644 --- a/ext/simplexml/sxe.c +++ b/ext/simplexml/sxe.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/simplexml/sxe.h b/ext/simplexml/sxe.h index 5a40fefcb9..629e7b31d4 100644 --- a/ext/simplexml/sxe.h +++ b/ext/simplexml/sxe.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/snmp/php_snmp.h b/ext/snmp/php_snmp.h index a9e7eb3f2d..09ab8b9e81 100644 --- a/ext/snmp/php_snmp.h +++ b/ext/snmp/php_snmp.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/snmp/snmp.c b/ext/snmp/snmp.c index 93c2b21ddc..ce09c3b762 100644 --- a/ext/snmp/snmp.c +++ b/ext/snmp/snmp.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | @@ -533,7 +533,7 @@ static void php_snmp_error(zval *object, const char *docref TSRMLS_DC, int type, } if (object && (snmp_object->exceptions_enabled & type)) { - zend_throw_exception_ex(php_snmp_exception_ce, type, snmp_object->snmp_errstr TSRMLS_CC); + zend_throw_exception_ex(php_snmp_exception_ce, type TSRMLS_CC, snmp_object->snmp_errstr); } else { va_start(args, format); php_verror(docref, "", E_WARNING, format, args TSRMLS_CC); @@ -896,6 +896,12 @@ retry: keepwalking = 1; } } else { + if (st & SNMP_CMD_WALK && response->errstat == SNMP_ERR_TOOBIG && objid_query->max_repetitions > 1) { /* Answer will not fit into single packet */ + objid_query->max_repetitions /= 2; + snmp_free_pdu(response); + keepwalking = 1; + continue; + } if (!(st & SNMP_CMD_WALK) || response->errstat != SNMP_ERR_NOSUCHNAME || Z_TYPE_P(return_value) == IS_BOOL) { for ( count=1, vars = response->variables; vars && count != response->errindex; diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c index 897956d91b..5e93b8af0d 100644 --- a/ext/soap/php_encoding.c +++ b/ext/soap/php_encoding.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/soap/php_encoding.h b/ext/soap/php_encoding.h index 31a8469390..5a8186ff74 100644 --- a/ext/soap/php_encoding.h +++ b/ext/soap/php_encoding.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/soap/php_http.c b/ext/soap/php_http.c index 7fc755d51b..9e74a7cc40 100644 --- a/ext/soap/php_http.c +++ b/ext/soap/php_http.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/soap/php_http.h b/ext/soap/php_http.h index 70d2cfd4c2..d927daa37f 100644 --- a/ext/soap/php_http.h +++ b/ext/soap/php_http.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/soap/php_packet_soap.c b/ext/soap/php_packet_soap.c index f4d249c4a9..3f4553b16a 100644 --- a/ext/soap/php_packet_soap.c +++ b/ext/soap/php_packet_soap.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/soap/php_packet_soap.h b/ext/soap/php_packet_soap.h index 210539bcd0..dacf5055a2 100644 --- a/ext/soap/php_packet_soap.h +++ b/ext/soap/php_packet_soap.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/soap/php_schema.c b/ext/soap/php_schema.c index 25bb177273..58037199d9 100644 --- a/ext/soap/php_schema.c +++ b/ext/soap/php_schema.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/soap/php_schema.h b/ext/soap/php_schema.h index 81748f5f65..62075b9531 100644 --- a/ext/soap/php_schema.h +++ b/ext/soap/php_schema.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/soap/php_sdl.c b/ext/soap/php_sdl.c index a7a5071c08..03c0748217 100644 --- a/ext/soap/php_sdl.c +++ b/ext/soap/php_sdl.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/soap/php_sdl.h b/ext/soap/php_sdl.h index 78757d15fc..fd2d78db9e 100644 --- a/ext/soap/php_sdl.h +++ b/ext/soap/php_sdl.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/soap/php_soap.h b/ext/soap/php_soap.h index 0e37db5d4c..86facd0b6b 100644 --- a/ext/soap/php_soap.h +++ b/ext/soap/php_soap.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/soap/php_xml.c b/ext/soap/php_xml.c index 939385557d..f7c8fd51e5 100644 --- a/ext/soap/php_xml.c +++ b/ext/soap/php_xml.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/soap/php_xml.h b/ext/soap/php_xml.h index 61c0feb58c..1eddcf9503 100644 --- a/ext/soap/php_xml.h +++ b/ext/soap/php_xml.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/soap/soap.c b/ext/soap/soap.c index 9371df6fb4..ca7f206bdd 100644 --- a/ext/soap/soap.c +++ b/ext/soap/soap.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/sockets/multicast.c b/ext/sockets/multicast.c index 43b6f7dddf..7e311ec48a 100644 --- a/ext/sockets/multicast.c +++ b/ext/sockets/multicast.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/sockets/multicast.h b/ext/sockets/multicast.h index f46a6a8f61..04f352f70e 100644 --- a/ext/sockets/multicast.h +++ b/ext/sockets/multicast.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/sockets/php_sockets.h b/ext/sockets/php_sockets.h index fabc9c4c3e..48e8a7ee85 100644 --- a/ext/sockets/php_sockets.h +++ b/ext/sockets/php_sockets.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/sockets/sockets.c b/ext/sockets/sockets.c index d094b3cc1d..7768d1f758 100644 --- a/ext/sockets/sockets.c +++ b/ext/sockets/sockets.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/sockets/unix_socket_constants.h b/ext/sockets/unix_socket_constants.h index fb190d82b1..485b2534d2 100644 --- a/ext/sockets/unix_socket_constants.h +++ b/ext/sockets/unix_socket_constants.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/sockets/win32_socket_constants.h b/ext/sockets/win32_socket_constants.h index 542347dd07..848e14fb51 100644 --- a/ext/sockets/win32_socket_constants.h +++ b/ext/sockets/win32_socket_constants.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/spl/php_spl.c b/ext/spl/php_spl.c index 35f4e5056b..a37a453c8c 100644 --- a/ext/spl/php_spl.c +++ b/ext/spl/php_spl.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/spl/php_spl.h b/ext/spl/php_spl.h index 4794f12443..aadb69d212 100644 --- a/ext/spl/php_spl.h +++ b/ext/spl/php_spl.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c index 552f67b185..68727d1367 100644 --- a/ext/spl/spl_array.c +++ b/ext/spl/spl_array.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/spl/spl_array.h b/ext/spl/spl_array.h index 0423d89a3a..23ca80bc8f 100644 --- a/ext/spl/spl_array.h +++ b/ext/spl/spl_array.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c index 7f0ce631b1..0762db6259 100644 --- a/ext/spl/spl_directory.c +++ b/ext/spl/spl_directory.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/spl/spl_directory.h b/ext/spl/spl_directory.h index d95ba550f8..8cff7d98d0 100644 --- a/ext/spl/spl_directory.h +++ b/ext/spl/spl_directory.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/spl/spl_dllist.c b/ext/spl/spl_dllist.c index f7be97d4ce..d9a72c1bb8 100644 --- a/ext/spl/spl_dllist.c +++ b/ext/spl/spl_dllist.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/spl/spl_dllist.h b/ext/spl/spl_dllist.h index 8615f748b8..c6f82ce57a 100644 --- a/ext/spl/spl_dllist.h +++ b/ext/spl/spl_dllist.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/spl/spl_engine.c b/ext/spl/spl_engine.c index ea2349f41e..c07ce6846f 100644 --- a/ext/spl/spl_engine.c +++ b/ext/spl/spl_engine.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/spl/spl_engine.h b/ext/spl/spl_engine.h index 103a5c4c76..a67e60c105 100644 --- a/ext/spl/spl_engine.h +++ b/ext/spl/spl_engine.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/spl/spl_exceptions.c b/ext/spl/spl_exceptions.c index d905070f41..221b25df47 100644 --- a/ext/spl/spl_exceptions.c +++ b/ext/spl/spl_exceptions.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/spl/spl_exceptions.h b/ext/spl/spl_exceptions.h index e4e7f270de..5e4e0f702c 100644 --- a/ext/spl/spl_exceptions.h +++ b/ext/spl/spl_exceptions.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/spl/spl_fixedarray.c b/ext/spl/spl_fixedarray.c index fec7e2c4ac..2f5e8c670b 100644 --- a/ext/spl/spl_fixedarray.c +++ b/ext/spl/spl_fixedarray.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/spl/spl_fixedarray.h b/ext/spl/spl_fixedarray.h index 8f1b8df103..9011e8c1d5 100644 --- a/ext/spl/spl_fixedarray.h +++ b/ext/spl/spl_fixedarray.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/spl/spl_functions.c b/ext/spl/spl_functions.c index 7f17d5ef23..f1e59c0234 100644 --- a/ext/spl/spl_functions.c +++ b/ext/spl/spl_functions.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/spl/spl_functions.h b/ext/spl/spl_functions.h index 29ce4a7640..214780f869 100644 --- a/ext/spl/spl_functions.h +++ b/ext/spl/spl_functions.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/spl/spl_heap.c b/ext/spl/spl_heap.c index d2de85b2a7..7ec86b5e81 100644 --- a/ext/spl/spl_heap.c +++ b/ext/spl/spl_heap.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/spl/spl_heap.h b/ext/spl/spl_heap.h index 11bce04553..a3ac4a8f5c 100644 --- a/ext/spl/spl_heap.h +++ b/ext/spl/spl_heap.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/spl/spl_iterators.c b/ext/spl/spl_iterators.c index eb8247654e..f3120b2013 100644 --- a/ext/spl/spl_iterators.c +++ b/ext/spl/spl_iterators.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/spl/spl_iterators.h b/ext/spl/spl_iterators.h index 39cc0d1337..fdb4d69ac0 100644 --- a/ext/spl/spl_iterators.h +++ b/ext/spl/spl_iterators.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/spl/spl_observer.c b/ext/spl/spl_observer.c index 5d89566eec..1a706f7642 100644 --- a/ext/spl/spl_observer.c +++ b/ext/spl/spl_observer.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/spl/spl_observer.h b/ext/spl/spl_observer.h index e93e304310..51573d732f 100644 --- a/ext/spl/spl_observer.h +++ b/ext/spl/spl_observer.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/spl/tests/SplFileObject_getflags_basic.phpt b/ext/spl/tests/SplFileObject_getflags_basic.phpt index 5addadf380..88cf6861a2 100644 --- a/ext/spl/tests/SplFileObject_getflags_basic.phpt +++ b/ext/spl/tests/SplFileObject_getflags_basic.phpt @@ -7,16 +7,16 @@ Erwin Poeze <erwin.poeze@gmail.com> --FILE-- <?php -file_put_contents('testdata.csv', 'eerste;tweede;derde'); +file_put_contents('SplFileObject_getflags_basic.csv', 'eerste;tweede;derde'); -$fo = new SplFileObject('testdata.csv'); +$fo = new SplFileObject('SplFileObject_getflags_basic.csv'); $fo->setFlags(SplFileObject::DROP_NEW_LINE); var_dump($fo->getFlags()); ?> --CLEAN-- <?php -unlink('testdata.csv'); +unlink('SplFileObject_getflags_basic.csv'); ?> --EXPECT-- int(1) diff --git a/ext/spl/tests/SplFileObject_getflags_error001.phpt b/ext/spl/tests/SplFileObject_getflags_error001.phpt index 1602f88885..ca53c857e7 100644 --- a/ext/spl/tests/SplFileObject_getflags_error001.phpt +++ b/ext/spl/tests/SplFileObject_getflags_error001.phpt @@ -7,10 +7,10 @@ Erwin Poeze <erwin.poeze@gmail.com> --FILE-- <?php -file_put_contents('testdata.csv', 'eerste;tweede;derde'); +file_put_contents('SplFileObject_getflags_error001.csv', 'eerste;tweede;derde'); -$fo = new SplFileObject('testdata.csv'); +$fo = new SplFileObject('SplFileObject_getflags_error001.csv'); $fo->setFlags(SplFileObject::READ_CSV); $fo->setFlags(SplFileObject::DROP_NEW_LINE); @@ -20,7 +20,7 @@ var_dump($fo->getFlags()); ?> --CLEAN-- <?php -unlink('testdata.csv'); +unlink('SplFileObject_getflags_error001.csv'); ?> --EXPECT-- int(1) diff --git a/ext/spl/tests/SplFileObject_getflags_error002.phpt b/ext/spl/tests/SplFileObject_getflags_error002.phpt index e2c8255f44..00fd351db8 100644 --- a/ext/spl/tests/SplFileObject_getflags_error002.phpt +++ b/ext/spl/tests/SplFileObject_getflags_error002.phpt @@ -5,9 +5,9 @@ Erwin Poeze <erwin.poeze@gmail.com> --FILE-- <?php -file_put_contents('testdata.csv', 'eerste;tweede;derde'); +file_put_contents('SplFileObject_getflags_error002.csv', 'eerste;tweede;derde'); -$fo = new SplFileObject('testdata.csv'); +$fo = new SplFileObject('SplFileObject_getflags_error002.csv'); $fo->setFlags(SplFileObject::READ_CSV); $fo->getFlags('fake'); @@ -15,7 +15,7 @@ $fo->getFlags('fake'); ?> --CLEAN-- <?php -unlink('testdata.csv'); +unlink('SplFileObject_getflags_error002.csv'); ?> --EXPECTF-- Warning: SplFileObject::getFlags() expects exactly 0 parameters, 1 given in %s on line %d diff --git a/ext/spl/tests/SplFileObject_rewind_error001.phpt b/ext/spl/tests/SplFileObject_rewind_error001.phpt index bdb3301e63..5f2379aa13 100644 --- a/ext/spl/tests/SplFileObject_rewind_error001.phpt +++ b/ext/spl/tests/SplFileObject_rewind_error001.phpt @@ -7,12 +7,16 @@ Erwin Poeze <erwin.poeze@gmail.com> --FILE-- <?php -file_put_contents('testdata.csv', 'eerste;tweede;derde'); +file_put_contents('SplFileObject_rewind_error001.csv', 'eerste;tweede;derde'); -$fo = new SplFileObject('testdata.csv'); +$fo = new SplFileObject('SplFileObject_rewind_error001.csv'); $fo->rewind( "invalid" ); ?> +--CLEAN-- +<?php +unlink('SplFileObject_rewind_error001.csv'); +?> --EXPECTF-- Warning: SplFileObject::rewind() expects exactly 0 parameters, 1 given in %s on line %d diff --git a/ext/spl/tests/bug54291.phpt b/ext/spl/tests/bug54291.phpt index b8f596e02c..9314b6b9ff 100644 --- a/ext/spl/tests/bug54291.phpt +++ b/ext/spl/tests/bug54291.phpt @@ -7,7 +7,7 @@ $dir->isFile(); --EXPECTF-- Fatal error: Uncaught exception 'UnexpectedValueException' with message 'Failed to open directory ""' in %s:%d Stack trace: -#0 %s(%d): DirectoryIterator->__construct('?/abc') +#0 %s(%d): DirectoryIterator->__construct('\x00/abc') #1 {main} thrown in %s on line %d diff --git a/ext/spl/tests/class_implements_variation.phpt b/ext/spl/tests/class_implements_variation.phpt index 52fdbcaf70..84a52ab2da 100644 --- a/ext/spl/tests/class_implements_variation.phpt +++ b/ext/spl/tests/class_implements_variation.phpt @@ -16,8 +16,8 @@ var_dump(class_implements(new fs)); var_dump(class_implements('fs')); echo "\n--- testing autoload ---\n"; -var_dump(class_implements('non-existent')); -var_dump(class_implements('non-existent2', false)); +var_dump(class_implements('non_existent')); +var_dump(class_implements('non_existent2', false)); function __autoload($classname) { @@ -35,11 +35,11 @@ array(0) { } --- testing autoload --- -attempting to autoload non-existent +attempting to autoload non_existent -Warning: class_implements(): Class non-existent does not exist and could not be loaded in %s on line %d +Warning: class_implements(): Class non_existent does not exist and could not be loaded in %s on line %d bool(false) -Warning: class_implements(): Class non-existent2 does not exist in %s on line %d +Warning: class_implements(): Class non_existent2 does not exist in %s on line %d bool(false) ===DONE=== diff --git a/ext/spl/tests/class_uses_variation.phpt b/ext/spl/tests/class_uses_variation.phpt index 9c21521c60..1a13521eaf 100644 --- a/ext/spl/tests/class_uses_variation.phpt +++ b/ext/spl/tests/class_uses_variation.phpt @@ -16,8 +16,8 @@ var_dump(class_uses(new fs)); var_dump(class_uses('fs')); echo "\n--- testing autoload ---\n"; -var_dump(class_uses('non-existent')); -var_dump(class_uses('non-existent2', false)); +var_dump(class_uses('non_existent')); +var_dump(class_uses('non_existent2', false)); function __autoload($classname) { @@ -35,11 +35,11 @@ array(0) { } --- testing autoload --- -attempting to autoload non-existent +attempting to autoload non_existent -Warning: class_uses(): Class non-existent does not exist and could not be loaded in %s on line %d +Warning: class_uses(): Class non_existent does not exist and could not be loaded in %s on line %d bool(false) -Warning: class_uses(): Class non-existent2 does not exist in %s on line %d +Warning: class_uses(): Class non_existent2 does not exist in %s on line %d bool(false) ===DONE=== diff --git a/ext/sqlite3/php_sqlite3.h b/ext/sqlite3/php_sqlite3.h index 131e70102c..5961e4401b 100644 --- a/ext/sqlite3/php_sqlite3.h +++ b/ext/sqlite3/php_sqlite3.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/sqlite3/php_sqlite3_structs.h b/ext/sqlite3/php_sqlite3_structs.h index 6c65e02ee7..5336d116fc 100644 --- a/ext/sqlite3/php_sqlite3_structs.h +++ b/ext/sqlite3/php_sqlite3_structs.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/sqlite3/sqlite3.c b/ext/sqlite3/sqlite3.c index 2aef0414aa..21e5634453 100644 --- a/ext/sqlite3/sqlite3.c +++ b/ext/sqlite3/sqlite3.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/array.c b/ext/standard/array.c index 1deacc7159..c2efca58fc 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/assert.c b/ext/standard/assert.c index 631834c97c..cae4c6fd61 100644 --- a/ext/standard/assert.c +++ b/ext/standard/assert.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/base64.c b/ext/standard/base64.c index 7534c8f8a4..0df7826642 100644 --- a/ext/standard/base64.c +++ b/ext/standard/base64.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/base64.h b/ext/standard/base64.h index 3f9d818baa..2358c58951 100644 --- a/ext/standard/base64.h +++ b/ext/standard/base64.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index a9ce7deefd..c01365589e 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | @@ -1206,7 +1206,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO(arginfo_fstat, 0) ZEND_ARG_INFO(0, fp) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO(arginfo_copy, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_copy, 0, 0, 2) ZEND_ARG_INFO(0, source_file) ZEND_ARG_INFO(0, destination_file) ZEND_ARG_INFO(0, context) @@ -5724,7 +5724,7 @@ PHP_FUNCTION(unregister_tick_function) return; } - if (Z_TYPE_P(function) != IS_ARRAY) { + if (Z_TYPE_P(function) != IS_ARRAY && Z_TYPE_P(function) != IS_OBJECT) { convert_to_string(function); } diff --git a/ext/standard/basic_functions.h b/ext/standard/basic_functions.h index 7327f7d2d2..3af85b3d40 100644 --- a/ext/standard/basic_functions.h +++ b/ext/standard/basic_functions.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/browscap.c b/ext/standard/browscap.c index ed773b851c..a2ff691e8f 100644 --- a/ext/standard/browscap.c +++ b/ext/standard/browscap.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/crc32.c b/ext/standard/crc32.c index e9c36d4cb4..3ce355a45f 100644 --- a/ext/standard/crc32.c +++ b/ext/standard/crc32.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/crc32.h b/ext/standard/crc32.h index 2c8ded4587..be9a99e6e2 100644 --- a/ext/standard/crc32.h +++ b/ext/standard/crc32.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/credits.c b/ext/standard/credits.c index 7ce0819491..0e9f3989ae 100644 --- a/ext/standard/credits.c +++ b/ext/standard/credits.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/credits.h b/ext/standard/credits.h index 7ad99d9f82..a1f57360a5 100644 --- a/ext/standard/credits.h +++ b/ext/standard/credits.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/crypt.c b/ext/standard/crypt.c index c6e0351af2..b0d17153f2 100644 --- a/ext/standard/crypt.c +++ b/ext/standard/crypt.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/css.c b/ext/standard/css.c index d76f9ee662..5eaa6ada2f 100644 --- a/ext/standard/css.c +++ b/ext/standard/css.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/css.h b/ext/standard/css.h index d7275e08ef..9541a34d2c 100644 --- a/ext/standard/css.h +++ b/ext/standard/css.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/cyr_convert.c b/ext/standard/cyr_convert.c index b29b49374e..d8d40cb10f 100644 --- a/ext/standard/cyr_convert.c +++ b/ext/standard/cyr_convert.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/cyr_convert.h b/ext/standard/cyr_convert.h index afcb872541..6b16be2960 100644 --- a/ext/standard/cyr_convert.h +++ b/ext/standard/cyr_convert.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/datetime.c b/ext/standard/datetime.c index 394153264d..69e17240a7 100644 --- a/ext/standard/datetime.c +++ b/ext/standard/datetime.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/datetime.h b/ext/standard/datetime.h index 3612fafae3..bb6673497c 100644 --- a/ext/standard/datetime.h +++ b/ext/standard/datetime.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/dir.c b/ext/standard/dir.c index ef28e9feaf..c6d6ddd263 100644 --- a/ext/standard/dir.c +++ b/ext/standard/dir.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/dl.c b/ext/standard/dl.c index 4d6a94766a..9bf3e443c9 100644 --- a/ext/standard/dl.c +++ b/ext/standard/dl.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/dl.h b/ext/standard/dl.h index 030f50e933..eee70472b5 100644 --- a/ext/standard/dl.h +++ b/ext/standard/dl.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/dns.c b/ext/standard/dns.c index 3584fc1bfe..6a894467ff 100644 --- a/ext/standard/dns.c +++ b/ext/standard/dns.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/dns_win32.c b/ext/standard/dns_win32.c index 2dbf3e2e1d..a784823dd3 100644 --- a/ext/standard/dns_win32.c +++ b/ext/standard/dns_win32.c @@ -334,7 +334,7 @@ static void php_parserr(PDNS_RECORD pRec, int type_to_fetch, int store, int raw, #endif default: - /* unkown type */ + /* unknown type */ zval_ptr_dtor(subarray); *subarray = NULL; return; diff --git a/ext/standard/exec.c b/ext/standard/exec.c index 7b783ca60f..f8a22adf39 100644 --- a/ext/standard/exec.c +++ b/ext/standard/exec.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/exec.h b/ext/standard/exec.h index 14c98c57e3..ddb6367570 100644 --- a/ext/standard/exec.h +++ b/ext/standard/exec.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/file.c b/ext/standard/file.c index f7af63bcf4..c17e1f38e1 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/file.h b/ext/standard/file.h index 0a4512ecd4..933d49479c 100644 --- a/ext/standard/file.h +++ b/ext/standard/file.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/filestat.c b/ext/standard/filestat.c index 73be21d9a9..565888f312 100644 --- a/ext/standard/filestat.c +++ b/ext/standard/filestat.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/filters.c b/ext/standard/filters.c index 15dae1bee6..39ca68f94a 100644 --- a/ext/standard/filters.c +++ b/ext/standard/filters.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/flock_compat.c b/ext/standard/flock_compat.c index 41f95eb724..05e0175311 100644 --- a/ext/standard/flock_compat.c +++ b/ext/standard/flock_compat.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/flock_compat.h b/ext/standard/flock_compat.h index 819d63c800..ab9c445561 100644 --- a/ext/standard/flock_compat.h +++ b/ext/standard/flock_compat.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/formatted_print.c b/ext/standard/formatted_print.c index 0035d204f6..3cd5839313 100644 --- a/ext/standard/formatted_print.c +++ b/ext/standard/formatted_print.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/fsock.c b/ext/standard/fsock.c index b7d5335927..d5a554725a 100644 --- a/ext/standard/fsock.c +++ b/ext/standard/fsock.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/fsock.h b/ext/standard/fsock.h index 70d0a5b50a..8ecb889162 100644 --- a/ext/standard/fsock.h +++ b/ext/standard/fsock.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/ftok.c b/ext/standard/ftok.c index 3b0105994c..4833bddc01 100644 --- a/ext/standard/ftok.c +++ b/ext/standard/ftok.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/ftp_fopen_wrapper.c b/ext/standard/ftp_fopen_wrapper.c index 86975d7f5b..27390a10d1 100644 --- a/ext/standard/ftp_fopen_wrapper.c +++ b/ext/standard/ftp_fopen_wrapper.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/head.c b/ext/standard/head.c index da08c36cf8..ae64099fa1 100644 --- a/ext/standard/head.c +++ b/ext/standard/head.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/head.h b/ext/standard/head.h index 7d657ba445..efca9b8637 100644 --- a/ext/standard/head.h +++ b/ext/standard/head.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/html.c b/ext/standard/html.c index b4d9ba109d..91fc050add 100644 --- a/ext/standard/html.c +++ b/ext/standard/html.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/html.h b/ext/standard/html.h index ae114765b2..b3da83f307 100644 --- a/ext/standard/html.h +++ b/ext/standard/html.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/html_tables.h b/ext/standard/html_tables.h index c24531d11c..05aea46df1 100644 --- a/ext/standard/html_tables.h +++ b/ext/standard/html_tables.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/http.c b/ext/standard/http.c index 3e5073591e..0b5aea314b 100644 --- a/ext/standard/http.c +++ b/ext/standard/http.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/http_fopen_wrapper.c b/ext/standard/http_fopen_wrapper.c index 4605e7494f..7e4fdb43cb 100644 --- a/ext/standard/http_fopen_wrapper.c +++ b/ext/standard/http_fopen_wrapper.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/image.c b/ext/standard/image.c index bd80f11dec..27f60c95a7 100644 --- a/ext/standard/image.c +++ b/ext/standard/image.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/incomplete_class.c b/ext/standard/incomplete_class.c index 9af70f2856..1816ac4605 100644 --- a/ext/standard/incomplete_class.c +++ b/ext/standard/incomplete_class.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/info.c b/ext/standard/info.c index cb2e469845..70b2e2f617 100644 --- a/ext/standard/info.c +++ b/ext/standard/info.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/info.h b/ext/standard/info.h index aca20796fc..871542d3dc 100644 --- a/ext/standard/info.h +++ b/ext/standard/info.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/iptc.c b/ext/standard/iptc.c index 729b0597e3..3257339106 100644 --- a/ext/standard/iptc.c +++ b/ext/standard/iptc.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/lcg.c b/ext/standard/lcg.c index 8bbe603516..311173a137 100644 --- a/ext/standard/lcg.c +++ b/ext/standard/lcg.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/levenshtein.c b/ext/standard/levenshtein.c index c492982101..786ca052d7 100644 --- a/ext/standard/levenshtein.c +++ b/ext/standard/levenshtein.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/link.c b/ext/standard/link.c index 8da63958a7..c57484e766 100644 --- a/ext/standard/link.c +++ b/ext/standard/link.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/link_win32.c b/ext/standard/link_win32.c index 674745e0a1..d410d223fb 100644 --- a/ext/standard/link_win32.c +++ b/ext/standard/link_win32.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/mail.c b/ext/standard/mail.c index b4f6a926c1..1ebc8fecb7 100644 --- a/ext/standard/mail.c +++ b/ext/standard/mail.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | @@ -276,7 +276,7 @@ PHPAPI int php_mail(char *to, char *subject, char *message, char *headers, char if (headers != NULL) { spprintf(&hdr, 0, "X-PHP-Originating-Script: %ld:%s\n%s", php_getuid(TSRMLS_C), f, headers); } else { - spprintf(&hdr, 0, "X-PHP-Originating-Script: %ld:%s\n", php_getuid(TSRMLS_C), f); + spprintf(&hdr, 0, "X-PHP-Originating-Script: %ld:%s", php_getuid(TSRMLS_C), f); } efree(f); } diff --git a/ext/standard/math.c b/ext/standard/math.c index be2d655263..72f6d51c6f 100644 --- a/ext/standard/math.c +++ b/ext/standard/math.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/md5.c b/ext/standard/md5.c index 7fea069dbb..134b650212 100644 --- a/ext/standard/md5.c +++ b/ext/standard/md5.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/md5.h b/ext/standard/md5.h index d7834054e7..43f425e402 100644 --- a/ext/standard/md5.h +++ b/ext/standard/md5.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/metaphone.c b/ext/standard/metaphone.c index 62c6df64aa..07143dfa7d 100644 --- a/ext/standard/metaphone.c +++ b/ext/standard/metaphone.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/microtime.c b/ext/standard/microtime.c index 219e35df16..fe2236683a 100644 --- a/ext/standard/microtime.c +++ b/ext/standard/microtime.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/microtime.h b/ext/standard/microtime.h index 95d4fab294..2af8a677c5 100644 --- a/ext/standard/microtime.h +++ b/ext/standard/microtime.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/pack.c b/ext/standard/pack.c index eb80395f53..d133e66d98 100644 --- a/ext/standard/pack.c +++ b/ext/standard/pack.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/pack.h b/ext/standard/pack.h index 22932887ce..601cc202c2 100644 --- a/ext/standard/pack.h +++ b/ext/standard/pack.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/pageinfo.c b/ext/standard/pageinfo.c index 6add7269cf..a9a4e58de0 100644 --- a/ext/standard/pageinfo.c +++ b/ext/standard/pageinfo.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/pageinfo.h b/ext/standard/pageinfo.h index 9ce76811bc..c3c1846058 100644 --- a/ext/standard/pageinfo.h +++ b/ext/standard/pageinfo.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/php_array.h b/ext/standard/php_array.h index 942c33f9e8..3c8e224e09 100644 --- a/ext/standard/php_array.h +++ b/ext/standard/php_array.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/php_assert.h b/ext/standard/php_assert.h index 02bf27706c..04c85427c3 100644 --- a/ext/standard/php_assert.h +++ b/ext/standard/php_assert.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/php_browscap.h b/ext/standard/php_browscap.h index da48ccebeb..dbe1891af3 100644 --- a/ext/standard/php_browscap.h +++ b/ext/standard/php_browscap.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/php_crypt.h b/ext/standard/php_crypt.h index 47d78377c5..0664a9f438 100644 --- a/ext/standard/php_crypt.h +++ b/ext/standard/php_crypt.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/php_crypt_r.c b/ext/standard/php_crypt_r.c index 8497994625..3098f247ef 100644 --- a/ext/standard/php_crypt_r.c +++ b/ext/standard/php_crypt_r.c @@ -3,7 +3,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/php_crypt_r.h b/ext/standard/php_crypt_r.h index c7f36eaf21..8b78d95d3d 100644 --- a/ext/standard/php_crypt_r.h +++ b/ext/standard/php_crypt_r.h @@ -3,7 +3,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/php_dir.h b/ext/standard/php_dir.h index 432ee33ac3..2b9313aac4 100644 --- a/ext/standard/php_dir.h +++ b/ext/standard/php_dir.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/php_dns.h b/ext/standard/php_dns.h index 0ee8aaab43..5823f5f20f 100644 --- a/ext/standard/php_dns.h +++ b/ext/standard/php_dns.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/php_ext_syslog.h b/ext/standard/php_ext_syslog.h index 21d6cd4762..e3fc582cd2 100644 --- a/ext/standard/php_ext_syslog.h +++ b/ext/standard/php_ext_syslog.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/php_filestat.h b/ext/standard/php_filestat.h index e8e798c510..ef72e584f1 100644 --- a/ext/standard/php_filestat.h +++ b/ext/standard/php_filestat.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/php_fopen_wrapper.c b/ext/standard/php_fopen_wrapper.c index f8d7bda482..4b4180230e 100644 --- a/ext/standard/php_fopen_wrapper.c +++ b/ext/standard/php_fopen_wrapper.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/php_fopen_wrappers.h b/ext/standard/php_fopen_wrappers.h index 5f78256bcb..3964310c50 100644 --- a/ext/standard/php_fopen_wrappers.h +++ b/ext/standard/php_fopen_wrappers.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/php_ftok.h b/ext/standard/php_ftok.h index b339349e49..7e702c942f 100644 --- a/ext/standard/php_ftok.h +++ b/ext/standard/php_ftok.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/php_http.h b/ext/standard/php_http.h index 468fd0508c..54321b39a2 100644 --- a/ext/standard/php_http.h +++ b/ext/standard/php_http.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/php_image.h b/ext/standard/php_image.h index a56e2a0f26..c8bb4ccc7a 100644 --- a/ext/standard/php_image.h +++ b/ext/standard/php_image.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/php_incomplete_class.h b/ext/standard/php_incomplete_class.h index f998996d62..b5a2a322f7 100644 --- a/ext/standard/php_incomplete_class.h +++ b/ext/standard/php_incomplete_class.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/php_iptc.h b/ext/standard/php_iptc.h index 6b8c50efb2..a076aea343 100644 --- a/ext/standard/php_iptc.h +++ b/ext/standard/php_iptc.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/php_lcg.h b/ext/standard/php_lcg.h index 3bdab4aab3..82141e6af2 100644 --- a/ext/standard/php_lcg.h +++ b/ext/standard/php_lcg.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/php_link.h b/ext/standard/php_link.h index ddc00429cf..1ca4acee25 100644 --- a/ext/standard/php_link.h +++ b/ext/standard/php_link.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/php_mail.h b/ext/standard/php_mail.h index 092dded660..925f58ebd5 100644 --- a/ext/standard/php_mail.h +++ b/ext/standard/php_mail.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/php_math.h b/ext/standard/php_math.h index 116acd9df5..8dec21acf3 100644 --- a/ext/standard/php_math.h +++ b/ext/standard/php_math.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/php_metaphone.h b/ext/standard/php_metaphone.h index 6af07bbbb0..14da9d8191 100644 --- a/ext/standard/php_metaphone.h +++ b/ext/standard/php_metaphone.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/php_rand.h b/ext/standard/php_rand.h index e831f32b23..2928d98c5e 100644 --- a/ext/standard/php_rand.h +++ b/ext/standard/php_rand.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/php_smart_str.h b/ext/standard/php_smart_str.h index 2fef1d0bd0..d59258f091 100644 --- a/ext/standard/php_smart_str.h +++ b/ext/standard/php_smart_str.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/php_smart_str_public.h b/ext/standard/php_smart_str_public.h index ed36a7a6fe..b445dd7767 100644 --- a/ext/standard/php_smart_str_public.h +++ b/ext/standard/php_smart_str_public.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/php_standard.h b/ext/standard/php_standard.h index 2ec851632e..3c8f55321e 100644 --- a/ext/standard/php_standard.h +++ b/ext/standard/php_standard.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/php_string.h b/ext/standard/php_string.h index 65219f257a..2396d40461 100644 --- a/ext/standard/php_string.h +++ b/ext/standard/php_string.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | @@ -156,7 +156,7 @@ PHPAPI char *php_strerror(int errnum); # define php_mblen(ptr, len) 1 #else # if defined(_REENTRANT) && defined(HAVE_MBRLEN) && defined(HAVE_MBSTATE_T) -# define php_mblen(ptr, len) ((ptr) == NULL ? mbsinit(&BG(mblen_state)): (int)mbrlen(ptr, len, &BG(mblen_state))) +# define php_mblen(ptr, len) ((ptr) == NULL ? memset(&BG(mblen_state), 0, sizeof(BG(mblen_state))): (int)mbrlen(ptr, len, &BG(mblen_state))) # else # define php_mblen(ptr, len) mblen(ptr, len) # endif diff --git a/ext/standard/php_type.h b/ext/standard/php_type.h index 292b66710f..75bb13b39c 100644 --- a/ext/standard/php_type.h +++ b/ext/standard/php_type.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/php_uuencode.h b/ext/standard/php_uuencode.h index 28bcb09c3e..5b2b852606 100644 --- a/ext/standard/php_uuencode.h +++ b/ext/standard/php_uuencode.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/php_var.h b/ext/standard/php_var.h index afc5f178e4..48692e57c3 100644 --- a/ext/standard/php_var.h +++ b/ext/standard/php_var.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/php_versioning.h b/ext/standard/php_versioning.h index fcbedacc38..b3ea4f8f4d 100644 --- a/ext/standard/php_versioning.h +++ b/ext/standard/php_versioning.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/proc_open.c b/ext/standard/proc_open.c index 6373751107..7ffba0e24d 100644 --- a/ext/standard/proc_open.c +++ b/ext/standard/proc_open.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | @@ -112,8 +112,17 @@ static php_process_env_t _php_array_to_envp(zval *environment, int is_persistent zend_hash_get_current_data_ex(target_hash, (void **) &element, &pos) == SUCCESS; zend_hash_move_forward_ex(target_hash, &pos)) { - convert_to_string_ex(element); - el_len = Z_STRLEN_PP(element); + if (Z_TYPE_PP(element) != IS_STRING) { + zval tmp; + + MAKE_COPY_ZVAL(element, &tmp); + convert_to_string(&tmp); + el_len = Z_STRLEN(tmp); + + zval_dtor(&tmp); + } else { + el_len = Z_STRLEN_PP(element); + } if (el_len == 0) { continue; } @@ -125,7 +134,7 @@ static php_process_env_t _php_array_to_envp(zval *environment, int is_persistent if (string_length == 0) { continue; } - sizeenv += string_length+1; + sizeenv += string_length; break; } } @@ -138,19 +147,26 @@ static php_process_env_t _php_array_to_envp(zval *environment, int is_persistent for (zend_hash_internal_pointer_reset_ex(target_hash, &pos); zend_hash_get_current_data_ex(target_hash, (void **) &element, &pos) == SUCCESS; zend_hash_move_forward_ex(target_hash, &pos)) { + zval tmp; - convert_to_string_ex(element); - el_len = Z_STRLEN_PP(element); + if (Z_TYPE_PP(element) != IS_STRING) { + MAKE_COPY_ZVAL(element, &tmp); + convert_to_string(&tmp); + } else { + tmp = **element; + } + + el_len = Z_STRLEN(tmp); if (el_len == 0) { - continue; + goto next_element; } - data = Z_STRVAL_PP(element); + data = Z_STRVAL(tmp); switch (zend_hash_get_current_key_ex(target_hash, &string_key, &string_length, &num_key, 0, &pos)) { case HASH_KEY_IS_STRING: if (string_length == 0) { - continue; + goto next_element; } l = string_length + el_len + 1; @@ -175,6 +191,11 @@ static php_process_env_t _php_array_to_envp(zval *environment, int is_persistent case HASH_KEY_NON_EXISTANT: break; } + +next_element: + if (Z_TYPE_PP(element) != IS_STRING) { + zval_dtor(&tmp); + } } assert((uint)(p - env.envp) <= sizeenv); diff --git a/ext/standard/proc_open.h b/ext/standard/proc_open.h index da1519b127..6708fded59 100644 --- a/ext/standard/proc_open.h +++ b/ext/standard/proc_open.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/quot_print.c b/ext/standard/quot_print.c index 0df127362f..7f54ce4d21 100644 --- a/ext/standard/quot_print.c +++ b/ext/standard/quot_print.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/quot_print.h b/ext/standard/quot_print.h index f621caf4b4..8be7faa388 100644 --- a/ext/standard/quot_print.h +++ b/ext/standard/quot_print.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/rand.c b/ext/standard/rand.c index 5f55a41f91..b0af30aa9d 100644 --- a/ext/standard/rand.c +++ b/ext/standard/rand.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/scanf.c b/ext/standard/scanf.c index 02e2c7173d..d092bbcfcf 100644 --- a/ext/standard/scanf.c +++ b/ext/standard/scanf.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/scanf.h b/ext/standard/scanf.h index dbffca9bac..9d4acd4a8f 100644 --- a/ext/standard/scanf.h +++ b/ext/standard/scanf.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/sha1.c b/ext/standard/sha1.c index 4326db98a6..67e5d520f4 100644 --- a/ext/standard/sha1.c +++ b/ext/standard/sha1.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/sha1.h b/ext/standard/sha1.h index 450d457c6e..ea63a234cf 100644 --- a/ext/standard/sha1.h +++ b/ext/standard/sha1.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/soundex.c b/ext/standard/soundex.c index bb6818ecaa..cf915d4c1d 100644 --- a/ext/standard/soundex.c +++ b/ext/standard/soundex.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c index f487763b9e..bdb05ec9b8 100644 --- a/ext/standard/streamsfuncs.c +++ b/ext/standard/streamsfuncs.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/streamsfuncs.h b/ext/standard/streamsfuncs.h index b662de5e4f..926cf2d5b5 100644 --- a/ext/standard/streamsfuncs.h +++ b/ext/standard/streamsfuncs.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/string.c b/ext/standard/string.c index c744cb46fc..c4e77f2f29 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | @@ -1441,6 +1441,19 @@ PHPAPI void php_basename(const char *s, size_t len, char *suffix, size_t sufflen state = 0; cend = c; } +#if defined(PHP_WIN32) || defined(NETWARE) + /* Catch relative paths in c:file.txt style. They're not to confuse + with the NTFS streams. This part ensures also, that no drive + letter traversing happens. */ + } else if ((*c == ':' && (c - comp == 1))) { + if (state == 0) { + comp = c; + state = 1; + } else { + cend = c; + state = 0; + } +#endif } else { if (state == 0) { comp = c; diff --git a/ext/standard/syslog.c b/ext/standard/syslog.c index ff98ab8572..acbffe49ad 100644 --- a/ext/standard/syslog.c +++ b/ext/standard/syslog.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/tests/class_object/class_exists_variation_001.phpt b/ext/standard/tests/class_object/class_exists_variation_001.phpt index 52a3584763..5f51b4bd93 100644 --- a/ext/standard/tests/class_object/class_exists_variation_001.phpt +++ b/ext/standard/tests/class_object/class_exists_variation_001.phpt @@ -100,15 +100,12 @@ In __autoload(12345) bool(false) Arg value -2345 -In __autoload(-2345) bool(false) Arg value 10.5 -In __autoload(10.5) bool(false) Arg value -10.5 -In __autoload(-10.5) bool(false) Arg value 101234567000 @@ -116,11 +113,9 @@ In __autoload(101234567000) bool(false) Arg value 1.07654321E-9 -In __autoload(1.07654321E-9) bool(false) Arg value 0.5 -In __autoload(0.5) bool(false) Error: 8 - Array to string conversion, %sclass_exists_variation_001.php(%d) diff --git a/ext/standard/tests/class_object/trait_exists_variation_001.phpt b/ext/standard/tests/class_object/trait_exists_variation_001.phpt index e7fa4afd1e..81df711cfa 100644 --- a/ext/standard/tests/class_object/trait_exists_variation_001.phpt +++ b/ext/standard/tests/class_object/trait_exists_variation_001.phpt @@ -100,15 +100,12 @@ In __autoload(12345) bool(false) Arg value -2345 -In __autoload(-2345) bool(false) Arg value 10.5 -In __autoload(10.5) bool(false) Arg value -10.5 -In __autoload(-10.5) bool(false) Arg value 101234567000 @@ -116,11 +113,9 @@ In __autoload(101234567000) bool(false) Arg value 1.07654321E-9 -In __autoload(1.07654321E-9) bool(false) Arg value 0.5 -In __autoload(0.5) bool(false) Error: 8 - Array to string conversion, %strait_exists_variation_001.php(%d) diff --git a/ext/standard/tests/file/basename_bug66395-win32.phpt b/ext/standard/tests/file/basename_bug66395-win32.phpt new file mode 100644 index 0000000000..a9580dc09e --- /dev/null +++ b/ext/standard/tests/file/basename_bug66395-win32.phpt @@ -0,0 +1,18 @@ +--TEST-- +basename bug #66395 +--SKIPIF-- +<?php if (substr(PHP_OS, 0, 3) != 'WIN') { die('skip Windows only basename tests'); } ?> +--FILE-- +<?php +echo basename("c:file.txt") . "\n"; +echo basename("d:subdir\\file.txt") . "\n"; +echo basename("y:file.txt", ".txt") . "\n"; +echo basename("notdriveletter:file.txt") . "\n"; +?> +==DONE== +--EXPECTF-- +file.txt +file.txt +file +notdriveletter:file.txt +==DONE== diff --git a/ext/standard/tests/file/basename_bug66395_variation2-win32.phpt b/ext/standard/tests/file/basename_bug66395_variation2-win32.phpt new file mode 100644 index 0000000000..0ebe996cd5 --- /dev/null +++ b/ext/standard/tests/file/basename_bug66395_variation2-win32.phpt @@ -0,0 +1,38 @@ +--TEST-- +basename bug #66395 check drive traversing and NTFS streams +--SKIPIF-- +<?php if (substr(PHP_OS, 0, 3) != 'WIN') { die('skip Windows only basename tests'); } ?> +--FILE-- +<?php +echo basename("y:") . "\n"; +echo basename("y:/") . "\n"; +echo basename("notdriveletter:file.txt") . "\n"; +echo basename("a:\\b:c:d:hello.txt\\hcd:c.txt") . "\n"; +echo basename("a:b:c:d:hello.txt\\d:some.txt") . "\n"; +echo basename("a:b:c:d:hello\world\a.bmp\c:d:e:f.txt") . "\n"; +echo basename("a:\\b:\\c:d:hello\\world\\a.bmp\\d:e:f:g.txt") . "\n"; +echo basename("a:\\b:\\c:d:hello/world\\a.bmp\\d:\\e:\\f:g.txt") . "\n"; +echo basename("a:\\b:/c:d:hello\\world:somestream") . "\n"; +echo basename("a:\\b:\\c:d:hello\\world:some.stream") . "\n"; +echo basename("a:/b:\\c:d:hello\\world:some.stream:\$DATA") . "\n"; +echo basename("x:y:z:hello\world:my.stream:\$DATA") . "\n"; +echo basename("a:\\b:\\c:d:hello\\world:c:\$DATA") . "\n"; +echo basename("a:\\b:\\c:d:hello\\d:world:c:\$DATA") . "\n"; +?> +==DONE== +--EXPECTF-- +y +y +notdriveletter:file.txt +hcd:c.txt +some.txt +f.txt +g.txt +g.txt +world:somestream +world:some.stream +world:some.stream:$DATA +world:my.stream:$DATA +world:c:$DATA +world:c:$DATA +==DONE== diff --git a/ext/standard/tests/file/bug66509.phpt b/ext/standard/tests/file/bug66509.phpt new file mode 100644 index 0000000000..0e414f2321 --- /dev/null +++ b/ext/standard/tests/file/bug66509.phpt @@ -0,0 +1,15 @@ +--TEST-- +Bug #66509 (copy() showing $context parameter as required) +--FILE-- +<?php + +$r = new \ReflectionFunction('copy'); + +foreach($r->getParameters() as $p) { + var_dump($p->isOptional()); +} +?> +--EXPECT-- +bool(false) +bool(false) +bool(true) diff --git a/ext/standard/tests/file/fgets_socket_variation1.phpt b/ext/standard/tests/file/fgets_socket_variation1.phpt index 57944d8b56..429ad67d69 100644 --- a/ext/standard/tests/file/fgets_socket_variation1.phpt +++ b/ext/standard/tests/file/fgets_socket_variation1.phpt @@ -5,11 +5,17 @@ Dave Kelsey <d_kelsey@uk.ibm.com> --FILE-- <?php -/* Setup socket server */ -$server = stream_socket_server('tcp://127.0.0.1:31337'); +for ($i=0; $i<100; $i++) { + $port = rand(10000, 65000); + /* Setup socket server */ + $server = @stream_socket_server("tcp://127.0.0.1:$port"); + if ($server) { + break; + } +} /* Connect to it */ -$client = fsockopen('tcp://127.0.0.1:31337'); +$client = fsockopen("tcp://127.0.0.1:$port"); if (!$client) { die("Unable to create socket"); diff --git a/ext/standard/tests/file/fgets_socket_variation2.phpt b/ext/standard/tests/file/fgets_socket_variation2.phpt index 3500837133..da1f0b47ad 100644 --- a/ext/standard/tests/file/fgets_socket_variation2.phpt +++ b/ext/standard/tests/file/fgets_socket_variation2.phpt @@ -16,11 +16,17 @@ for ($i = 0; $i < 1000; $i++) { } fclose($fd); -/* Setup socket server */ -$server = stream_socket_server('tcp://127.0.0.1:31337'); +for ($i=0; $i<100; $i++) { + $port = rand(10000, 65000); + /* Setup socket server */ + $server = @stream_socket_server("tcp://127.0.0.1:$port"); + if ($server) { + break; + } +} /* Connect to it */ -$client = fsockopen('tcp://127.0.0.1:31337'); +$client = fsockopen("tcp://127.0.0.1:$port"); if (!$client) { die("Unable to create socket"); diff --git a/ext/standard/tests/file/file_put_contents_variation9.phpt b/ext/standard/tests/file/file_put_contents_variation9.phpt index 7ad09c449d..79a42fe9b1 100644 --- a/ext/standard/tests/file/file_put_contents_variation9.phpt +++ b/ext/standard/tests/file/file_put_contents_variation9.phpt @@ -17,10 +17,10 @@ if(substr(PHP_OS, 0, 3) == "WIN") echo "*** Testing file_put_contents() : usage variation ***\n"; -$filename = dirname(__FILE__).'/fileGetContentsVar9.tmp'; -$softlink = dirname(__FILE__).'/fileGetContentsVar9.SoftLink'; -$hardlink = dirname(__FILE__).'/fileGetContentsVar9.HardLink'; -$chainlink = dirname(__FILE__).'/fileGetContentsVar9.ChainLink'; +$filename = dirname(__FILE__).'/filePutContentsVar9.tmp'; +$softlink = dirname(__FILE__).'/filePutContentsVar9.SoftLink'; +$hardlink = dirname(__FILE__).'/filePutContentsVar9.HardLink'; +$chainlink = dirname(__FILE__).'/filePutContentsVar9.ChainLink'; // link files even though it original file doesn't exist yet diff --git a/ext/standard/tests/file/fread_socket_variation1.phpt b/ext/standard/tests/file/fread_socket_variation1.phpt index a615d2f414..d65565d3cc 100644 --- a/ext/standard/tests/file/fread_socket_variation1.phpt +++ b/ext/standard/tests/file/fread_socket_variation1.phpt @@ -3,13 +3,20 @@ Testing fread() on a TCP server socket --FILE-- <?php -$tcp_socket = stream_socket_server('tcp://127.0.0.1:31337'); +for ($i=0; $i<100; $i++) { + $port = rand(10000, 65000); + /* Setup socket server */ + $server = @stream_socket_server("tcp://127.0.0.1:$port"); + if ($server) { + break; + } +} -socket_set_timeout($tcp_socket, 0, 1000); +socket_set_timeout($server, 0, 1000); -var_dump(fread($tcp_socket, 1)); +var_dump(fread($server, 1)); -fclose($tcp_socket); +fclose($server); ?> --EXPECT-- diff --git a/ext/standard/tests/general_functions/bug41445_1.phpt b/ext/standard/tests/general_functions/bug41445_1.phpt index e65e7afcc8..4698de436a 100644 --- a/ext/standard/tests/general_functions/bug41445_1.phpt +++ b/ext/standard/tests/general_functions/bug41445_1.phpt @@ -3,7 +3,7 @@ Bug #41445 (parse_ini_file() function parses octal numbers in section names) - 2 --FILE-- <?php -$file = dirname(__FILE__)."/bug41445.ini"; +$file = dirname(__FILE__)."/bug41445_1.ini"; $data = <<<DATA [2454.33] diff --git a/ext/standard/tests/general_functions/bug66094.phpt b/ext/standard/tests/general_functions/bug66094.phpt new file mode 100644 index 0000000000..8b33a4f4c3 --- /dev/null +++ b/ext/standard/tests/general_functions/bug66094.phpt @@ -0,0 +1,12 @@ +--TEST-- +Bug #66094 (unregister_tick_function tries to cast a Closure to a string) +--FILE-- +<?php +declare(ticks=1); +register_tick_function($closure = function () { echo "Tick!\n"; }); +unregister_tick_function($closure); +echo "done"; +?> +--EXPECTF-- +Tick! +done diff --git a/ext/standard/tests/general_functions/var_export-locale.phpt b/ext/standard/tests/general_functions/var_export-locale.phpt index 3cbebe9c72..b6f87c431c 100644 --- a/ext/standard/tests/general_functions/var_export-locale.phpt +++ b/ext/standard/tests/general_functions/var_export-locale.phpt @@ -1,7 +1,7 @@ --TEST-- Test var_export() function with locale --INI-- -precision=14 +serialize_precision=17 --SKIPIF-- <?php if (!setlocale(LC_ALL, "german", "de","de_DE","de_DE.ISO8859-1","de_DE.ISO_8859-1","de_DE.UTF-8")) { diff --git a/ext/standard/tests/general_functions/var_export_basic3.phpt b/ext/standard/tests/general_functions/var_export_basic3.phpt index 9e27d90425..58c0448167 100644 --- a/ext/standard/tests/general_functions/var_export_basic3.phpt +++ b/ext/standard/tests/general_functions/var_export_basic3.phpt @@ -1,7 +1,7 @@ --TEST-- Test var_export() function with valid float values --INI-- -precision=14 +serialize_precision=17 --FILE-- <?php /* Prototype : mixed var_export(mixed var [, bool return]) diff --git a/ext/standard/tests/general_functions/var_export_basic5.phpt b/ext/standard/tests/general_functions/var_export_basic5.phpt index 1512fa8377..dacb355323 100644 --- a/ext/standard/tests/general_functions/var_export_basic5.phpt +++ b/ext/standard/tests/general_functions/var_export_basic5.phpt @@ -1,5 +1,7 @@ --TEST-- Test var_export() function with valid arrays +--INI-- +serialize_precision=17 --FILE-- <?php /* Prototype : mixed var_export(mixed var [, bool return]) diff --git a/ext/standard/tests/mail/bug66535.phpt b/ext/standard/tests/mail/bug66535.phpt new file mode 100644 index 0000000000..db1f449cb6 --- /dev/null +++ b/ext/standard/tests/mail/bug66535.phpt @@ -0,0 +1,43 @@ +--TEST-- +Bug #66535: Extra newline if add_x_header and no additional headers are used +--INI-- +sendmail_path=tee mailBasic.out >/dev/null +mail.add_x_header = On +--SKIPIF-- +<?php +if(substr(PHP_OS, 0, 3) == "WIN") + die("skip Won't run on Windows"); +?> +--FILE-- +<?php +/* Prototype : int mail(string to, string subject, string message [, string additional_headers [, string additional_parameters]]) + * Description: Send an email message + * Source code: ext/standard/mail.c + * Alias to functions: + */ + +echo "*** Testing mail() : send email without additional headers ***\n"; + +// Initialise all required variables +$to = 'user@company.com'; +$subject = 'Test Subject'; +$message = 'A Message'; + +$outFile = "mailBasic.out"; +@unlink($outFile); + +var_dump( mail($to, $subject, $message) ); +echo file_get_contents($outFile); +unlink($outFile); + +?> +===DONE=== +--EXPECTF-- +*** Testing mail() : send email without additional headers *** +bool(true) +To: user@company.com +Subject: Test Subject +X-PHP-Originating-Script: %d:bug66535.php + +A Message +===DONE=== diff --git a/ext/standard/tests/math/tan_basiclong_64bit.phpt b/ext/standard/tests/math/tan_basiclong_64bit.phpt index 8ab083d500..3c8abe9d27 100644 --- a/ext/standard/tests/math/tan_basiclong_64bit.phpt +++ b/ext/standard/tests/math/tan_basiclong_64bit.phpt @@ -1,5 +1,7 @@ --TEST-- Test tan function : 64bit long tests +--INI-- +precision=5 --SKIPIF-- <?php if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only"); @@ -28,33 +30,34 @@ foreach ($longVals as $longVal) { ===DONE=== --EXPECT-- --- testing: 9223372036854775807 --- -float(84.739312968756) +float(84.739) --- testing: -9223372036854775808 --- -float(-84.739312968756) +float(-84.739) --- testing: 2147483647 --- -float(1.0523779637351) +float(1.0524) --- testing: -2147483648 --- -float(4.0842894552986) +float(4.0843) --- testing: 9223372034707292160 --- -float(-0.25738520049439) +float(-0.25739) --- testing: -9223372034707292160 --- -float(0.25738520049439) +float(0.25739) --- testing: 2147483648 --- -float(-4.0842894552986) +float(-4.0843) --- testing: -2147483649 --- -float(0.34328416030117) +float(0.34328) --- testing: 4294967294 --- -float(-19.579238091943) +float(-19.579) --- testing: 4294967295 --- -float(-0.57225137018055) +float(-0.57225) --- testing: 4294967293 --- -float(0.71667000824652) +float(0.71667) --- testing: 9223372036854775806 --- -float(84.739312968756) ---- testing: 9.2233720368548E+18 --- -float(84.739312968756) +float(84.739) +--- testing: 9.2234E+18 --- +float(84.739) --- testing: -9223372036854775807 --- -float(-84.739312968756) ---- testing: -9.2233720368548E+18 --- -float(-84.739312968756) +float(-84.739) +--- testing: -9.2234E+18 --- +float(-84.739) ===DONE=== + diff --git a/ext/standard/tests/network/fsockopen_basic.phpt b/ext/standard/tests/network/fsockopen_basic.phpt index 3ec9366331..227762f899 100644 --- a/ext/standard/tests/network/fsockopen_basic.phpt +++ b/ext/standard/tests/network/fsockopen_basic.phpt @@ -11,12 +11,18 @@ Test fsockopen() function : basic functionality echo "*** Testing fsockopen() : basic functionality ***\n"; echo "Open a server socket\n"; -$server = stream_socket_server('tcp://127.0.0.1:31337'); +for ($i=0; $i<100; $i++) { + $port = rand(10000, 65000); + /* Setup socket server */ + $server = @stream_socket_server("tcp://127.0.0.1:$port"); + if ($server) { + break; + } +} // Initialise all required variables $hostname = 'tcp://127.0.0.1'; // loopback address -$port = 31337; $errno = null; $errstr = null; $timeout = 1.5; diff --git a/ext/standard/tests/network/fsockopen_variation1.phpt b/ext/standard/tests/network/fsockopen_variation1.phpt index 2e5f8d9ada..bb1b0f15c7 100644 --- a/ext/standard/tests/network/fsockopen_variation1.phpt +++ b/ext/standard/tests/network/fsockopen_variation1.phpt @@ -4,11 +4,17 @@ testing fsockopen without a protocol string <?php echo "Open a server socket\n"; -$server = stream_socket_server('tcp://127.0.0.1:31337'); +for ($i=0; $i<100; $i++) { + $port = rand(10000, 65000); + /* Setup socket server */ + $server = @stream_socket_server("tcp://127.0.0.1:$port"); + if ($server) { + break; + } +} echo "\nCalling fsockopen() without a protocol in the hostname string:\n"; $hostname = '127.0.0.1'; -$port = '31337'; $client = fsockopen($hostname, $port); var_dump($client); fclose($client); diff --git a/ext/standard/tests/network/shutdown.phpt b/ext/standard/tests/network/shutdown.phpt index f9ab66476f..1ce77fb80e 100644 --- a/ext/standard/tests/network/shutdown.phpt +++ b/ext/standard/tests/network/shutdown.phpt @@ -6,14 +6,22 @@ stream_socket_shutdown() test on IPv4 TCP Loopback ?> --FILE-- <?php - /* Setup socket server */ - $server = stream_socket_server('tcp://127.0.0.1:31337'); - if (!$server) { + + for ($i=0; $i<100; $i++) { + $port = rand(10000, 65000); + /* Setup socket server */ + $server = @stream_socket_server("tcp://127.0.0.1:$port"); + if ($server) { + break; + } + } + +if (!$server) { die('Unable to create AF_INET socket [server]'); } /* Connect and send request 1 */ - $client1 = stream_socket_client('tcp://127.0.0.1:31337'); + $client1 = stream_socket_client("tcp://127.0.0.1:$port"); if (!$client1) { die('Unable to create AF_INET socket [client]'); } @@ -22,7 +30,7 @@ stream_socket_shutdown() test on IPv4 TCP Loopback @fwrite($client1, "Error 1\n"); /* Connect and send request 2 */ - $client2 = stream_socket_client('tcp://127.0.0.1:31337'); + $client2 = stream_socket_client("tcp://127.0.0.1:$port"); if (!$client2) { die('Unable to create AF_INET socket [client]'); } diff --git a/ext/standard/tests/network/socket_get_status_basic.phpt b/ext/standard/tests/network/socket_get_status_basic.phpt index f72662b166..46215f9838 100644 --- a/ext/standard/tests/network/socket_get_status_basic.phpt +++ b/ext/standard/tests/network/socket_get_status_basic.phpt @@ -3,9 +3,17 @@ Testing socket_get_status() --FILE-- <?php -$tcp_socket = stream_socket_server('tcp://127.0.0.1:31337'); -var_dump(socket_get_status($tcp_socket)); -fclose($tcp_socket); +for ($i=0; $i<100; $i++) { + $port = rand(10000, 65000); + /* Setup socket server */ + $server = @stream_socket_server("tcp://127.0.0.1:$port"); + if ($server) { + break; + } +} + +var_dump(socket_get_status($server)); +fclose($server); ?> --EXPECTF-- diff --git a/ext/standard/tests/network/tcp4loop.phpt b/ext/standard/tests/network/tcp4loop.phpt index afd955918e..a163cd9b35 100644 --- a/ext/standard/tests/network/tcp4loop.phpt +++ b/ext/standard/tests/network/tcp4loop.phpt @@ -2,14 +2,21 @@ Streams Based IPv4 TCP Loopback test --FILE-- <?php # vim:ft=php: - /* Setup socket server */ - $server = stream_socket_server('tcp://127.0.0.1:31337'); + + for ($i=0; $i<100; $i++) { + $port = rand(10000, 65000); + /* Setup socket server */ + $server = @stream_socket_server("tcp://127.0.0.1:$port"); + if ($server) { + break; + } + } if (!$server) { die('Unable to create AF_INET socket [server]'); } /* Connect to it */ - $client = stream_socket_client('tcp://127.0.0.1:31337'); + $client = stream_socket_client("tcp://127.0.0.1:$port"); if (!$client) { die('Unable to create AF_INET socket [client]'); } diff --git a/ext/standard/tests/network/tcp6loop.phpt b/ext/standard/tests/network/tcp6loop.phpt index 3f28cd4437..30b1d7bcd2 100644 --- a/ext/standard/tests/network/tcp6loop.phpt +++ b/ext/standard/tests/network/tcp6loop.phpt @@ -10,14 +10,22 @@ Streams Based IPv6 TCP Loopback test ?> --FILE-- <?php - /* Setup socket server */ - $server = stream_socket_server('tcp://[::1]:31337'); + + for ($i=0; $i<100; $i++) { + $port = rand(10000, 65000); + /* Setup socket server */ + $server = @stream_socket_server("tcp://[::1]:$port"); + if ($server) { + break; + } + } + if (!$server) { die('Unable to create AF_INET6 socket [server]'); } /* Connect to it */ - $client = stream_socket_client('tcp://[::1]:31337'); + $client = stream_socket_client("tcp://[::1]:$port"); if (!$client) { die('Unable to create AF_INET6 socket [client]'); } diff --git a/ext/standard/tests/network/udp6loop.phpt b/ext/standard/tests/network/udp6loop.phpt index 5fcf7a7f46..8241d80bac 100644 --- a/ext/standard/tests/network/udp6loop.phpt +++ b/ext/standard/tests/network/udp6loop.phpt @@ -16,14 +16,22 @@ Streams Based IPv6 UDP Loopback test ?> --FILE-- <?php - /* Setup socket server */ - $server = stream_socket_server('udp://[::1]:31337', $errno, $errstr, STREAM_SERVER_BIND); + + for ($i=0; $i<100; $i++) { + $port = rand(10000, 65000); + /* Setup socket server */ + $server = @stream_socket_server("udp://[::1]:$port", $errno, $errstr, STREAM_SERVER_BIND); + if ($server) { + break; + } + } + if (!$server) { die('Unable to create AF_INET6 socket [server]'); } /* Connect to it */ - $client = stream_socket_client('udp://[::1]:31337'); + $client = stream_socket_client("udp://[::1]:$port"); if (!$client) { die('Unable to create AF_INET6 socket [client]'); } diff --git a/ext/standard/tests/serialize/serialization_error_002.phpt b/ext/standard/tests/serialize/serialization_error_002.phpt new file mode 100644 index 0000000000..70f35e4f3b --- /dev/null +++ b/ext/standard/tests/serialize/serialization_error_002.phpt @@ -0,0 +1,52 @@ +--TEST-- +Test unserialize(): error is indistinguishable from deserialized boolean +--FILE-- +<?php +/* Prototype : proto string serialize(mixed variable) + * Description: Returns a string representation of variable (which can later be unserialized) + * Source code: ext/standard/var.c + * Alias to functions: + */ +/* Prototype : proto mixed unserialize(string variable_representation) + * Description: Takes a string representation of variable and recreates it + * Source code: ext/standard/var.c + * Alias to functions: + */ + +echo "*** Testing unserialize() error/boolean distinction ***\n"; + +$garbage = "obvious non-serialized data"; +$serialized_false = serialize(false); + +var_dump($serialized_false); + +$deserialized_garbage = unserialize($garbage); +var_dump($deserialized_garbage); + +$deserialized_false = unserialize($serialized_false); +var_dump($deserialized_false); + +echo "unserialize error and deserialized false are identical? " . (bool) ($deserialized_false == $deserialized_garbage) . "\n"; + +// candidate safe idiom for determining whether data is serialized +function isSerialized($str) { + return ($str == serialize(false) || @unserialize($str) !== false); +} + +// Test unserialize error idiom +var_dump(isSerialized($garbage)); +var_dump(isSerialized($serialized_false)); + +echo "Done"; +?> +--EXPECTF-- +*** Testing unserialize() error/boolean distinction *** +string(4) "b:0;" + +Notice: unserialize(): Error at offset 0 of 27 bytes in %s%eserialization_error_002.php on line 20 +bool(false) +bool(false) +unserialize error and deserialized false are identical? 1 +bool(false) +bool(true) +Done diff --git a/ext/standard/tests/streams/bug60602.phpt b/ext/standard/tests/streams/bug60602.phpt new file mode 100644 index 0000000000..2c08ce87b7 --- /dev/null +++ b/ext/standard/tests/streams/bug60602.phpt @@ -0,0 +1,57 @@ +--TEST-- +Bug #60602 proc_open() modifies environment if it contains arrays +--FILE-- +<?php + +$descs = array( + 0 => array('pipe', 'r'), // stdin + 1 => array('pipe', 'w'), // stdout + 2 => array('pipe', 'w'), // strerr +); + +$environment = array('test' => array(1, 2, 3)); + +$cmd = (substr(PHP_OS, 0, 3) == 'WIN') ? 'dir' : 'ls'; +$p = proc_open($cmd, $descs, $pipes, '.', $environment); + +if (is_resource($p)) { + $data = ''; + + while (1) { + $w = $e = NULL; + $n = stream_select($pipes, $w, $e, 300); + + if ($n === false) { + echo "no streams \n"; + break; + } else if ($n === 0) { + echo "process timed out\n"; + proc_terminate($p, 9); + break; + } else if ($n > 0) { + $line = fread($pipes[1], 8192); + if (strlen($line) == 0) { + /* EOF */ + break; + } + $data .= $line; + } + } + var_dump(strlen($data)); + + $ret = proc_close($p); + var_dump($ret); + var_dump(is_array($environment['test'])); +} else { + echo "no process\n"; +} +?> +==DONE== +--EXPECTF-- +Notice: Array to string conversion in %s on line %d + +Notice: Array to string conversion in %s on line %d +int(%d) +int(0) +bool(true) +==DONE== diff --git a/ext/standard/tests/streams/stream_set_timeout_error.phpt b/ext/standard/tests/streams/stream_set_timeout_error.phpt index c1d4d1406f..814257dd93 100644 --- a/ext/standard/tests/streams/stream_set_timeout_error.phpt +++ b/ext/standard/tests/streams/stream_set_timeout_error.phpt @@ -13,10 +13,16 @@ echo "*** Testing stream_set_timeout() : error conditions ***\n"; //Test stream_set_timeout with one more than the expected number of arguments echo "\n-- Testing stream_set_timeout() function with more than expected no. of arguments --\n"; -/* Setup socket server */ -$server = stream_socket_server('tcp://127.0.0.1:31337'); +for ($i=0; $i<100; $i++) { + $port = rand(10000, 65000); + /* Setup socket server */ + $server = @stream_socket_server("tcp://127.0.0.1:$port"); + if ($server) { + break; + } +} /* Connect to it */ -$client = fsockopen('tcp://127.0.0.1:31337'); +$client = fsockopen("tcp://127.0.0.1:$port"); $seconds = 10; $microseconds = 10; diff --git a/ext/standard/tests/strings/bug65947.phpt b/ext/standard/tests/strings/bug65947.phpt new file mode 100644 index 0000000000..956aa6049a --- /dev/null +++ b/ext/standard/tests/strings/bug65947.phpt @@ -0,0 +1,17 @@ +--TEST-- +Bug #65947 (basename is no more working after fgetcsv in certain situation) +--SKIPIF-- +<?php if (!PHP_ZTS) { print "skip only for zts build"; } +--FILE-- +<?php +$filename = 'test.toto'; +// é in ISO-8859-1 +$csv = base64_decode('6Q=='); +$adata = str_getcsv($csv,";"); +$b2 = basename($filename); +if ($filename != $b2) + print "BUG"; +else + print "OKEY"; +--EXPECTF-- +OKEY diff --git a/ext/standard/tests/strings/vfprintf_basic1.phpt b/ext/standard/tests/strings/vfprintf_basic1.phpt index 3129d4fcca..84d8ad101d 100644 --- a/ext/standard/tests/strings/vfprintf_basic1.phpt +++ b/ext/standard/tests/strings/vfprintf_basic1.phpt @@ -20,7 +20,7 @@ $arg3 = array("one","two","three"); /* creating dumping file */ -$data_file = dirname(__FILE__) . '/dump.txt'; +$data_file = dirname(__FILE__) . '/vfprintf_basic1.txt'; if (!($fp = fopen($data_file, 'wt'))) return; diff --git a/ext/standard/tests/strings/vfprintf_basic2.phpt b/ext/standard/tests/strings/vfprintf_basic2.phpt index b758caeecc..36d6577bbd 100644 --- a/ext/standard/tests/strings/vfprintf_basic2.phpt +++ b/ext/standard/tests/strings/vfprintf_basic2.phpt @@ -23,7 +23,7 @@ $arg2 = array(111,222); $arg3 = array(111,222,333); /* creating dumping file */ -$data_file = dirname(__FILE__) . '/dump.txt'; +$data_file = dirname(__FILE__) . '/vfprintf_basic2.txt'; if (!($fp = fopen($data_file, 'wt'))) return; diff --git a/ext/standard/tests/strings/vfprintf_basic3.phpt b/ext/standard/tests/strings/vfprintf_basic3.phpt index b675b3db88..565079dc60 100644 --- a/ext/standard/tests/strings/vfprintf_basic3.phpt +++ b/ext/standard/tests/strings/vfprintf_basic3.phpt @@ -24,7 +24,7 @@ $arg2 = array(11.11,22.22); $arg3 = array(11.11,22.22,33.33); /* creating dumping file */ -$data_file = dirname(__FILE__) . '/dump.txt'; +$data_file = dirname(__FILE__) . '/vfprintf_basic3.txt'; if (!($fp = fopen($data_file, 'wt'))) return; diff --git a/ext/standard/tests/strings/vfprintf_basic4.phpt b/ext/standard/tests/strings/vfprintf_basic4.phpt index 1595f034bb..e653f63306 100644 --- a/ext/standard/tests/strings/vfprintf_basic4.phpt +++ b/ext/standard/tests/strings/vfprintf_basic4.phpt @@ -19,7 +19,7 @@ $arg2 = array(TRUE,FALSE); $arg3 = array(TRUE,FALSE,TRUE); /* creating dumping file */ -$data_file = dirname(__FILE__) . '/dump.txt'; +$data_file = dirname(__FILE__) . '/vfprintf_basic4.txt'; if (!($fp = fopen($data_file, 'wt'))) return; diff --git a/ext/standard/tests/strings/vfprintf_basic5.phpt b/ext/standard/tests/strings/vfprintf_basic5.phpt index a080c9e6c4..84fbe33f1c 100644 --- a/ext/standard/tests/strings/vfprintf_basic5.phpt +++ b/ext/standard/tests/strings/vfprintf_basic5.phpt @@ -19,7 +19,7 @@ $arg2 = array(65,66); $arg3 = array(65,66,67); /* creating dumping file */ -$data_file = dirname(__FILE__) . '/dump.txt'; +$data_file = dirname(__FILE__) . '/vfprintf_basic5.txt'; if (!($fp = fopen($data_file, 'wt'))) return; diff --git a/ext/standard/tests/strings/vfprintf_basic6.phpt b/ext/standard/tests/strings/vfprintf_basic6.phpt index ed88a2832e..6c1bbf02a2 100644 --- a/ext/standard/tests/strings/vfprintf_basic6.phpt +++ b/ext/standard/tests/strings/vfprintf_basic6.phpt @@ -20,7 +20,7 @@ $arg2 = array(1000,2000); $arg3 = array(1000,2000,3000); /* creating dumping file */ -$data_file = dirname(__FILE__) . '/dump.txt'; +$data_file = dirname(__FILE__) . '/vfprintf_basic6.txt'; if (!($fp = fopen($data_file, 'wt'))) return; diff --git a/ext/standard/tests/strings/vfprintf_basic7.phpt b/ext/standard/tests/strings/vfprintf_basic7.phpt index 45544a39ec..f4c11edc15 100644 --- a/ext/standard/tests/strings/vfprintf_basic7.phpt +++ b/ext/standard/tests/strings/vfprintf_basic7.phpt @@ -23,7 +23,7 @@ $arg2 = array(-1111,-1234567); $arg3 = array(-1111,-1234567,-2345432); /* creating dumping file */ -$data_file = dirname(__FILE__) . '/dump.txt'; +$data_file = dirname(__FILE__) . '/vfprintf_basic7.txt'; if (!($fp = fopen($data_file, 'wt'))) return; diff --git a/ext/standard/tests/strings/vfprintf_basic7_64bit.phpt b/ext/standard/tests/strings/vfprintf_basic7_64bit.phpt index 77fae2c09b..14cd31ddd2 100644 --- a/ext/standard/tests/strings/vfprintf_basic7_64bit.phpt +++ b/ext/standard/tests/strings/vfprintf_basic7_64bit.phpt @@ -23,7 +23,7 @@ $arg2 = array(-1111,-1234567); $arg3 = array(-1111,-1234567,-2345432); /* creating dumping file */ -$data_file = dirname(__FILE__) . '/dump.txt'; +$data_file = dirname(__FILE__) . '/vfprintf_basic7_64bit.txt'; if (!($fp = fopen($data_file, 'wt'))) return; diff --git a/ext/standard/tests/strings/vfprintf_basic8.phpt b/ext/standard/tests/strings/vfprintf_basic8.phpt index 6fe2151542..bf7eb96ad5 100644 --- a/ext/standard/tests/strings/vfprintf_basic8.phpt +++ b/ext/standard/tests/strings/vfprintf_basic8.phpt @@ -19,7 +19,7 @@ $arg2 = array(021,0347); $arg3 = array(021,0347,05678); /* creating dumping file */ -$data_file = dirname(__FILE__) . '/dump.txt'; +$data_file = dirname(__FILE__) . '/vfprintf_basic8.txt'; if (!($fp = fopen($data_file, 'wt'))) return; diff --git a/ext/standard/tests/strings/vfprintf_basic9.phpt b/ext/standard/tests/strings/vfprintf_basic9.phpt index 8294c8482f..080e52bb64 100644 --- a/ext/standard/tests/strings/vfprintf_basic9.phpt +++ b/ext/standard/tests/strings/vfprintf_basic9.phpt @@ -24,7 +24,7 @@ $arg2 = array(11,132); $arg3 = array(11,132,177); /* creating dumping file */ -$data_file = dirname(__FILE__) . '/dump.txt'; +$data_file = dirname(__FILE__) . '/vfprintf_basic9.txt'; if (!($fp = fopen($data_file, 'wt'))) return; diff --git a/ext/standard/tests/strings/vfprintf_variation10.phpt b/ext/standard/tests/strings/vfprintf_variation10.phpt Binary files differindex e2c066eff8..bb00e70389 100644 --- a/ext/standard/tests/strings/vfprintf_variation10.phpt +++ b/ext/standard/tests/strings/vfprintf_variation10.phpt diff --git a/ext/standard/tests/strings/vfprintf_variation11.phpt b/ext/standard/tests/strings/vfprintf_variation11.phpt index 45f1f61fa6..4bc38851d2 100644 --- a/ext/standard/tests/strings/vfprintf_variation11.phpt +++ b/ext/standard/tests/strings/vfprintf_variation11.phpt @@ -45,7 +45,7 @@ $args_array = array( ); /* creating dumping file */ -$data_file = dirname(__FILE__) . '/dump.txt'; +$data_file = dirname(__FILE__) . '/vfprintf_variation11.txt'; if (!($fp = fopen($data_file, 'wt'))) return; diff --git a/ext/standard/tests/strings/vfprintf_variation11_64bit.phpt b/ext/standard/tests/strings/vfprintf_variation11_64bit.phpt index d6549846b5..a55297999e 100644 --- a/ext/standard/tests/strings/vfprintf_variation11_64bit.phpt +++ b/ext/standard/tests/strings/vfprintf_variation11_64bit.phpt @@ -45,7 +45,7 @@ $args_array = array( ); /* creating dumping file */ -$data_file = dirname(__FILE__) . '/dump.txt'; +$data_file = dirname(__FILE__) . '/vfprintf_variation11_64bit.txt'; if (!($fp = fopen($data_file, 'wt'))) return; diff --git a/ext/standard/tests/strings/vfprintf_variation12.phpt b/ext/standard/tests/strings/vfprintf_variation12.phpt index e95fd5bb7f..f0fa354ea6 100644 --- a/ext/standard/tests/strings/vfprintf_variation12.phpt +++ b/ext/standard/tests/strings/vfprintf_variation12.phpt @@ -68,7 +68,7 @@ $args_array = array( ); /* creating dumping file */ -$data_file = dirname(__FILE__) . '/dump.txt'; +$data_file = dirname(__FILE__) . '/vfprintf_variation12.txt'; if (!($fp = fopen($data_file, 'wt'))) return; diff --git a/ext/standard/tests/strings/vfprintf_variation12_64bit.phpt b/ext/standard/tests/strings/vfprintf_variation12_64bit.phpt index a1e57bc42c..fe786d3f49 100644 --- a/ext/standard/tests/strings/vfprintf_variation12_64bit.phpt +++ b/ext/standard/tests/strings/vfprintf_variation12_64bit.phpt @@ -68,7 +68,7 @@ $args_array = array( ); /* creating dumping file */ -$data_file = dirname(__FILE__) . '/dump.txt'; +$data_file = dirname(__FILE__) . '/vfprintf_variation12_64bit.txt'; if (!($fp = fopen($data_file, 'wt'))) return; diff --git a/ext/standard/tests/strings/vfprintf_variation13.phpt b/ext/standard/tests/strings/vfprintf_variation13.phpt index 245feb5a23..fd34242424 100644 --- a/ext/standard/tests/strings/vfprintf_variation13.phpt +++ b/ext/standard/tests/strings/vfprintf_variation13.phpt @@ -45,7 +45,7 @@ $args_array = array( ); /* creating dumping file */ -$data_file = dirname(__FILE__) . '/dump.txt'; +$data_file = dirname(__FILE__) . '/vfprintf_variation13.txt'; if (!($fp = fopen($data_file, 'wt'))) return; diff --git a/ext/standard/tests/strings/vfprintf_variation13_64bit.phpt b/ext/standard/tests/strings/vfprintf_variation13_64bit.phpt index bf6fcb5ec0..68baed8537 100644 --- a/ext/standard/tests/strings/vfprintf_variation13_64bit.phpt +++ b/ext/standard/tests/strings/vfprintf_variation13_64bit.phpt @@ -45,7 +45,7 @@ $args_array = array( ); /* creating dumping file */ -$data_file = dirname(__FILE__) . '/dump.txt'; +$data_file = dirname(__FILE__) . '/vfprintf_variation13_64bit.txt'; if (!($fp = fopen($data_file, 'wt'))) return; diff --git a/ext/standard/tests/strings/vfprintf_variation14.phpt b/ext/standard/tests/strings/vfprintf_variation14.phpt index c714d89758..0173a27fb7 100644 --- a/ext/standard/tests/strings/vfprintf_variation14.phpt +++ b/ext/standard/tests/strings/vfprintf_variation14.phpt @@ -68,7 +68,7 @@ $args_array = array( ); /* creating dumping file */ -$data_file = dirname(__FILE__) . '/dump.txt'; +$data_file = dirname(__FILE__) . '/vfprintf_variation14.txt'; if (!($fp = fopen($data_file, 'wt'))) return; diff --git a/ext/standard/tests/strings/vfprintf_variation14_64bit.phpt b/ext/standard/tests/strings/vfprintf_variation14_64bit.phpt index 930ee3d03d..fb34befd3c 100644 --- a/ext/standard/tests/strings/vfprintf_variation14_64bit.phpt +++ b/ext/standard/tests/strings/vfprintf_variation14_64bit.phpt @@ -68,7 +68,7 @@ $args_array = array( ); /* creating dumping file */ -$data_file = dirname(__FILE__) . '/dump.txt'; +$data_file = dirname(__FILE__) . '/vfprintf_variation14_64bit.txt'; if (!($fp = fopen($data_file, 'wt'))) return; diff --git a/ext/standard/tests/strings/vfprintf_variation15.phpt b/ext/standard/tests/strings/vfprintf_variation15.phpt index 95667b5a81..19e319a557 100644 --- a/ext/standard/tests/strings/vfprintf_variation15.phpt +++ b/ext/standard/tests/strings/vfprintf_variation15.phpt @@ -38,7 +38,7 @@ $args_array = array( ); /* creating dumping file */ -$data_file = dirname(__FILE__) . '/dump.txt'; +$data_file = dirname(__FILE__) . '/vfprintf_variation15.txt'; if (!($fp = fopen($data_file, 'wt'))) return; diff --git a/ext/standard/tests/strings/vfprintf_variation15_64bit.phpt b/ext/standard/tests/strings/vfprintf_variation15_64bit.phpt index d2e331c2d3..7bb0d150e0 100644 --- a/ext/standard/tests/strings/vfprintf_variation15_64bit.phpt +++ b/ext/standard/tests/strings/vfprintf_variation15_64bit.phpt @@ -38,7 +38,7 @@ $args_array = array( ); /* creating dumping file */ -$data_file = dirname(__FILE__) . '/dump.txt'; +$data_file = dirname(__FILE__) . '/vfprintf_variation15_64bit.txt'; if (!($fp = fopen($data_file, 'wt'))) return; diff --git a/ext/standard/tests/strings/vfprintf_variation16.phpt b/ext/standard/tests/strings/vfprintf_variation16.phpt index 21630521b8..4995ab02a4 100644 --- a/ext/standard/tests/strings/vfprintf_variation16.phpt +++ b/ext/standard/tests/strings/vfprintf_variation16.phpt @@ -61,7 +61,7 @@ $args_array = array( ); /* creating dumping file */ -$data_file = dirname(__FILE__) . '/dump.txt'; +$data_file = dirname(__FILE__) . '/vfprintf_variation16.txt'; if (!($fp = fopen($data_file, 'wt'))) return; diff --git a/ext/standard/tests/strings/vfprintf_variation16_64bit.phpt b/ext/standard/tests/strings/vfprintf_variation16_64bit.phpt index 381e67c339..16d0624018 100644 --- a/ext/standard/tests/strings/vfprintf_variation16_64bit.phpt +++ b/ext/standard/tests/strings/vfprintf_variation16_64bit.phpt @@ -61,7 +61,7 @@ $args_array = array( ); /* creating dumping file */ -$data_file = dirname(__FILE__) . '/dump.txt'; +$data_file = dirname(__FILE__) . '/vfprintf_variation16_64bit.txt'; if (!($fp = fopen($data_file, 'wt'))) return; diff --git a/ext/standard/tests/strings/vfprintf_variation17.phpt b/ext/standard/tests/strings/vfprintf_variation17.phpt index 871ae98d85..6c17b801f6 100644 --- a/ext/standard/tests/strings/vfprintf_variation17.phpt +++ b/ext/standard/tests/strings/vfprintf_variation17.phpt @@ -34,7 +34,7 @@ $args_array = array( ); /* creating dumping file */ -$data_file = dirname(__FILE__) . '/dump.txt'; +$data_file = dirname(__FILE__) . '/vfprintf_variation17.txt'; if (!($fp = fopen($data_file, 'wt'))) return; diff --git a/ext/standard/tests/strings/vfprintf_variation18.phpt b/ext/standard/tests/strings/vfprintf_variation18.phpt index 76168621c3..5467753dc0 100644 --- a/ext/standard/tests/strings/vfprintf_variation18.phpt +++ b/ext/standard/tests/strings/vfprintf_variation18.phpt @@ -57,7 +57,7 @@ $args_array = array( ); /* creating dumping file */ -$data_file = dirname(__FILE__) . '/dump.txt'; +$data_file = dirname(__FILE__) . '/vfprintf_variation18.txt'; if (!($fp = fopen($data_file, 'wt'))) return; diff --git a/ext/standard/tests/strings/vfprintf_variation19.phpt b/ext/standard/tests/strings/vfprintf_variation19.phpt index 7ee01a97e1..26c21e1e3c 100644 --- a/ext/standard/tests/strings/vfprintf_variation19.phpt +++ b/ext/standard/tests/strings/vfprintf_variation19.phpt @@ -46,7 +46,7 @@ $args_array = array( /* creating dumping file */ -$data_file = dirname(__FILE__) . '/dump.txt'; +$data_file = dirname(__FILE__) . '/vfprintf_variation19.txt'; if (!($fp = fopen($data_file, 'wt'))) return; diff --git a/ext/standard/tests/strings/vfprintf_variation19_64bit.phpt b/ext/standard/tests/strings/vfprintf_variation19_64bit.phpt index 58810a811a..a56357cfdf 100644 --- a/ext/standard/tests/strings/vfprintf_variation19_64bit.phpt +++ b/ext/standard/tests/strings/vfprintf_variation19_64bit.phpt @@ -46,7 +46,7 @@ $args_array = array( /* creating dumping file */ -$data_file = dirname(__FILE__) . '/dump.txt'; +$data_file = dirname(__FILE__) . '/vfprintf_variation19_64bit.txt'; if (!($fp = fopen($data_file, 'wt'))) return; diff --git a/ext/standard/tests/strings/vfprintf_variation20.phpt b/ext/standard/tests/strings/vfprintf_variation20.phpt index cd348d8350..48fea341ed 100644 --- a/ext/standard/tests/strings/vfprintf_variation20.phpt +++ b/ext/standard/tests/strings/vfprintf_variation20.phpt @@ -84,7 +84,7 @@ $values = array( ); /* creating dumping file */ -$data_file = dirname(__FILE__) . '/dump.txt'; +$data_file = dirname(__FILE__) . '/vfprintf_variation20.txt'; if (!($fp = fopen($data_file, 'wt'))) return; diff --git a/ext/standard/tests/strings/vfprintf_variation21.phpt b/ext/standard/tests/strings/vfprintf_variation21.phpt index 4dc9ed5666..09bf703957 100644 --- a/ext/standard/tests/strings/vfprintf_variation21.phpt +++ b/ext/standard/tests/strings/vfprintf_variation21.phpt @@ -81,7 +81,7 @@ $values = array( ); /* creating dumping file */ -$data_file = dirname(__FILE__) . '/dump.txt'; +$data_file = dirname(__FILE__) . '/vfprintf_variation21.txt'; if (!($fp = fopen($data_file, 'wt'))) return; diff --git a/ext/standard/tests/strings/vfprintf_variation3.phpt b/ext/standard/tests/strings/vfprintf_variation3.phpt index 02535cefb6..1ae945990c 100644 --- a/ext/standard/tests/strings/vfprintf_variation3.phpt +++ b/ext/standard/tests/strings/vfprintf_variation3.phpt @@ -45,7 +45,7 @@ $args_array = array( // and with int values from the above $args_array array /* creating dumping file */ -$data_file = dirname(__FILE__) . '/dump.txt'; +$data_file = dirname(__FILE__) . '/vfprintf_variation3.txt'; if (!($fp = fopen($data_file, 'wt'))) return; diff --git a/ext/standard/tests/strings/vfprintf_variation4.phpt b/ext/standard/tests/strings/vfprintf_variation4.phpt index 72ca9fe3b9..642f35c46a 100644 --- a/ext/standard/tests/strings/vfprintf_variation4.phpt +++ b/ext/standard/tests/strings/vfprintf_variation4.phpt @@ -62,7 +62,7 @@ $args_array = array( /* creating dumping file */ -$data_file = dirname(__FILE__) . '/dump.txt'; +$data_file = dirname(__FILE__) . '/vfprintf_variation4.txt'; if (!($fp = fopen($data_file, 'wt'))) return; diff --git a/ext/standard/tests/strings/vfprintf_variation4_64bit.phpt b/ext/standard/tests/strings/vfprintf_variation4_64bit.phpt index f7038ff76c..6bf814003a 100644 --- a/ext/standard/tests/strings/vfprintf_variation4_64bit.phpt +++ b/ext/standard/tests/strings/vfprintf_variation4_64bit.phpt @@ -62,7 +62,7 @@ $args_array = array( /* creating dumping file */ -$data_file = dirname(__FILE__) . '/dump.txt'; +$data_file = dirname(__FILE__) . '/vfprintf_variation4_64bit.txt'; if (!($fp = fopen($data_file, 'wt'))) return; diff --git a/ext/standard/tests/strings/vfprintf_variation5.phpt b/ext/standard/tests/strings/vfprintf_variation5.phpt index 4bac1ebe57..eb3646ca1f 100644 --- a/ext/standard/tests/strings/vfprintf_variation5.phpt +++ b/ext/standard/tests/strings/vfprintf_variation5.phpt @@ -42,7 +42,7 @@ $args_array = array( ); /* creating dumping file */ -$data_file = dirname(__FILE__) . '/dump.txt'; +$data_file = dirname(__FILE__) . '/vfprintf_variation5.txt'; if (!($fp = fopen($data_file, 'wt'))) return; diff --git a/ext/standard/tests/strings/vfprintf_variation6.phpt b/ext/standard/tests/strings/vfprintf_variation6.phpt index 6b5425d5cf..b5b82bbc62 100644 --- a/ext/standard/tests/strings/vfprintf_variation6.phpt +++ b/ext/standard/tests/strings/vfprintf_variation6.phpt @@ -57,7 +57,7 @@ $args_array = array( ); /* creating dumping file */ -$data_file = dirname(__FILE__) . '/dump.txt'; +$data_file = dirname(__FILE__) . '/vfprintf_variation6.txt'; if (!($fp = fopen($data_file, 'wt'))) return; diff --git a/ext/standard/tests/strings/vfprintf_variation7.phpt b/ext/standard/tests/strings/vfprintf_variation7.phpt Binary files differindex a206fd8691..ee836edc77 100644 --- a/ext/standard/tests/strings/vfprintf_variation7.phpt +++ b/ext/standard/tests/strings/vfprintf_variation7.phpt diff --git a/ext/standard/tests/strings/vfprintf_variation8.phpt b/ext/standard/tests/strings/vfprintf_variation8.phpt index cda05c4d79..a72e260e09 100644 --- a/ext/standard/tests/strings/vfprintf_variation8.phpt +++ b/ext/standard/tests/strings/vfprintf_variation8.phpt @@ -60,7 +60,7 @@ $args_array = array( ); /* creating dumping file */ -$data_file = dirname(__FILE__) . '/dump.txt'; +$data_file = dirname(__FILE__) . '/vfprintf_variation8.txt'; if (!($fp = fopen($data_file, 'wt'))) return; diff --git a/ext/standard/tests/strings/vfprintf_variation9.phpt b/ext/standard/tests/strings/vfprintf_variation9.phpt Binary files differindex d10c8aed50..dd3093c8c9 100644 --- a/ext/standard/tests/strings/vfprintf_variation9.phpt +++ b/ext/standard/tests/strings/vfprintf_variation9.phpt diff --git a/ext/standard/tests/url/parse_url_basic_001.phpt b/ext/standard/tests/url/parse_url_basic_001.phpt index 1edc32eaba..4c5b0944c6 100644 --- a/ext/standard/tests/url/parse_url_basic_001.phpt +++ b/ext/standard/tests/url/parse_url_basic_001.phpt @@ -743,6 +743,13 @@ echo "Done"; string(1) ":" } +--> http://::#: array(2) { + ["scheme"]=> + string(4) "http" + ["host"]=> + string(1) ":" +} + --> x://::6.5: array(3) { ["scheme"]=> string(1) "x" @@ -856,6 +863,8 @@ echo "Done"; --> http://?: bool(false) +--> http://#: bool(false) + --> http://?:: bool(false) --> http://:?: bool(false) @@ -863,4 +872,4 @@ echo "Done"; --> http://blah.com:123456: bool(false) --> http://blah.com:abcdef: bool(false) -Done
\ No newline at end of file +Done diff --git a/ext/standard/tests/url/parse_url_basic_002.phpt b/ext/standard/tests/url/parse_url_basic_002.phpt index 464e977ffc..ed0f08a84f 100644 --- a/ext/standard/tests/url/parse_url_basic_002.phpt +++ b/ext/standard/tests/url/parse_url_basic_002.phpt @@ -96,6 +96,7 @@ echo "Done"; --> x:/blah.com : string(1) "x" --> x://::abc/? : bool(false) --> http://::? : string(4) "http" +--> http://::# : string(4) "http" --> x://::6.5 : string(1) "x" --> http://?:/ : string(4) "http" --> http://@?:/ : string(4) "http" @@ -118,8 +119,9 @@ echo "Done"; --> http://@:/ : bool(false) --> http://:/ : bool(false) --> http://? : bool(false) +--> http://# : bool(false) --> http://?: : bool(false) --> http://:? : bool(false) --> http://blah.com:123456 : bool(false) --> http://blah.com:abcdef : bool(false) -Done
\ No newline at end of file +Done diff --git a/ext/standard/tests/url/parse_url_basic_003.phpt b/ext/standard/tests/url/parse_url_basic_003.phpt index 57f182bfa3..a2bbfa6482 100644 --- a/ext/standard/tests/url/parse_url_basic_003.phpt +++ b/ext/standard/tests/url/parse_url_basic_003.phpt @@ -95,6 +95,7 @@ echo "Done"; --> x:/blah.com : NULL --> x://::abc/? : bool(false) --> http://::? : string(1) ":" +--> http://::# : string(1) ":" --> x://::6.5 : string(1) ":" --> http://?:/ : string(1) "?" --> http://@?:/ : string(1) "?" @@ -117,8 +118,9 @@ echo "Done"; --> http://@:/ : bool(false) --> http://:/ : bool(false) --> http://? : bool(false) +--> http://# : bool(false) --> http://?: : bool(false) --> http://:? : bool(false) --> http://blah.com:123456 : bool(false) --> http://blah.com:abcdef : bool(false) -Done
\ No newline at end of file +Done diff --git a/ext/standard/tests/url/parse_url_basic_004.phpt b/ext/standard/tests/url/parse_url_basic_004.phpt index 6abf4ed453..839ebee554 100644 --- a/ext/standard/tests/url/parse_url_basic_004.phpt +++ b/ext/standard/tests/url/parse_url_basic_004.phpt @@ -95,6 +95,7 @@ echo "Done"; --> x:/blah.com : NULL --> x://::abc/? : bool(false) --> http://::? : NULL +--> http://::# : NULL --> x://::6.5 : int(6) --> http://?:/ : NULL --> http://@?:/ : NULL @@ -117,8 +118,9 @@ echo "Done"; --> http://@:/ : bool(false) --> http://:/ : bool(false) --> http://? : bool(false) +--> http://# : bool(false) --> http://?: : bool(false) --> http://:? : bool(false) --> http://blah.com:123456 : bool(false) --> http://blah.com:abcdef : bool(false) -Done
\ No newline at end of file +Done diff --git a/ext/standard/tests/url/parse_url_basic_005.phpt b/ext/standard/tests/url/parse_url_basic_005.phpt index 3bcc89106d..c113461fe7 100644 --- a/ext/standard/tests/url/parse_url_basic_005.phpt +++ b/ext/standard/tests/url/parse_url_basic_005.phpt @@ -95,6 +95,7 @@ echo "Done"; --> x:/blah.com : NULL --> x://::abc/? : bool(false) --> http://::? : NULL +--> http://::# : NULL --> x://::6.5 : NULL --> http://?:/ : NULL --> http://@?:/ : string(0) "" @@ -117,8 +118,9 @@ echo "Done"; --> http://@:/ : bool(false) --> http://:/ : bool(false) --> http://? : bool(false) +--> http://# : bool(false) --> http://?: : bool(false) --> http://:? : bool(false) --> http://blah.com:123456 : bool(false) --> http://blah.com:abcdef : bool(false) -Done
\ No newline at end of file +Done diff --git a/ext/standard/tests/url/parse_url_basic_006.phpt b/ext/standard/tests/url/parse_url_basic_006.phpt index 741a424a61..24de1cc233 100644 --- a/ext/standard/tests/url/parse_url_basic_006.phpt +++ b/ext/standard/tests/url/parse_url_basic_006.phpt @@ -95,6 +95,7 @@ echo "Done"; --> x:/blah.com : NULL --> x://::abc/? : bool(false) --> http://::? : NULL +--> http://::# : NULL --> x://::6.5 : NULL --> http://?:/ : NULL --> http://@?:/ : NULL @@ -117,8 +118,9 @@ echo "Done"; --> http://@:/ : bool(false) --> http://:/ : bool(false) --> http://? : bool(false) +--> http://# : bool(false) --> http://?: : bool(false) --> http://:? : bool(false) --> http://blah.com:123456 : bool(false) --> http://blah.com:abcdef : bool(false) -Done
\ No newline at end of file +Done diff --git a/ext/standard/tests/url/parse_url_basic_007.phpt b/ext/standard/tests/url/parse_url_basic_007.phpt index bf8f98042e..d4006879f4 100644 --- a/ext/standard/tests/url/parse_url_basic_007.phpt +++ b/ext/standard/tests/url/parse_url_basic_007.phpt @@ -95,6 +95,7 @@ echo "Done"; --> x:/blah.com : string(9) "/blah.com" --> x://::abc/? : bool(false) --> http://::? : NULL +--> http://::# : NULL --> x://::6.5 : NULL --> http://?:/ : string(1) "/" --> http://@?:/ : string(1) "/" @@ -117,8 +118,9 @@ echo "Done"; --> http://@:/ : bool(false) --> http://:/ : bool(false) --> http://? : bool(false) +--> http://# : bool(false) --> http://?: : bool(false) --> http://:? : bool(false) --> http://blah.com:123456 : bool(false) --> http://blah.com:abcdef : bool(false) -Done
\ No newline at end of file +Done diff --git a/ext/standard/tests/url/parse_url_basic_008.phpt b/ext/standard/tests/url/parse_url_basic_008.phpt index a61fd06943..b283829c46 100644 --- a/ext/standard/tests/url/parse_url_basic_008.phpt +++ b/ext/standard/tests/url/parse_url_basic_008.phpt @@ -95,6 +95,7 @@ echo "Done"; --> x:/blah.com : NULL --> x://::abc/? : bool(false) --> http://::? : NULL +--> http://::# : NULL --> x://::6.5 : NULL --> http://?:/ : NULL --> http://@?:/ : NULL @@ -117,8 +118,9 @@ echo "Done"; --> http://@:/ : bool(false) --> http://:/ : bool(false) --> http://? : bool(false) +--> http://# : bool(false) --> http://?: : bool(false) --> http://:? : bool(false) --> http://blah.com:123456 : bool(false) --> http://blah.com:abcdef : bool(false) -Done
\ No newline at end of file +Done diff --git a/ext/standard/tests/url/parse_url_basic_009.phpt b/ext/standard/tests/url/parse_url_basic_009.phpt index 5302388f6f..a7d70f34da 100644 --- a/ext/standard/tests/url/parse_url_basic_009.phpt +++ b/ext/standard/tests/url/parse_url_basic_009.phpt @@ -95,6 +95,7 @@ echo "Done"; --> x:/blah.com : NULL --> x://::abc/? : bool(false) --> http://::? : NULL +--> http://::# : NULL --> x://::6.5 : NULL --> http://?:/ : NULL --> http://@?:/ : NULL @@ -117,8 +118,9 @@ echo "Done"; --> http://@:/ : bool(false) --> http://:/ : bool(false) --> http://? : bool(false) +--> http://# : bool(false) --> http://?: : bool(false) --> http://:? : bool(false) --> http://blah.com:123456 : bool(false) --> http://blah.com:abcdef : bool(false) -Done
\ No newline at end of file +Done diff --git a/ext/standard/tests/url/urls.inc b/ext/standard/tests/url/urls.inc index 27521c8520..4192f4a869 100644 --- a/ext/standard/tests/url/urls.inc +++ b/ext/standard/tests/url/urls.inc @@ -75,6 +75,7 @@ $urls = array( 'x:/blah.com', 'x://::abc/?', 'http://::?', +'http://::#', 'x://::6.5', 'http://?:/', 'http://@?:/', @@ -99,6 +100,7 @@ $urls = array( 'http://@:/', 'http://:/', 'http://?', +'http://#', 'http://?:', 'http://:?', 'http://blah.com:123456', @@ -106,4 +108,4 @@ $urls = array( ); -?>
\ No newline at end of file +?> diff --git a/ext/standard/type.c b/ext/standard/type.c index 5c4085a28a..45eb82fe3b 100644 --- a/ext/standard/type.c +++ b/ext/standard/type.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/uniqid.c b/ext/standard/uniqid.c index eac389c26c..a87bdb9c52 100644 --- a/ext/standard/uniqid.c +++ b/ext/standard/uniqid.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/uniqid.h b/ext/standard/uniqid.h index 1d0804051a..0ea57fa52a 100644 --- a/ext/standard/uniqid.h +++ b/ext/standard/uniqid.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/url.c b/ext/standard/url.c index 190b4665eb..e4eb9c48b9 100644 --- a/ext/standard/url.c +++ b/ext/standard/url.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/url.h b/ext/standard/url.h index 87e2efbc73..89b4b39cf9 100644 --- a/ext/standard/url.h +++ b/ext/standard/url.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/url_scanner_ex.c b/ext/standard/url_scanner_ex.c index 236276a648..671a22f5ba 100644 --- a/ext/standard/url_scanner_ex.c +++ b/ext/standard/url_scanner_ex.c @@ -4,7 +4,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/url_scanner_ex.h b/ext/standard/url_scanner_ex.h index 667c56c1ec..0a7925e245 100644 --- a/ext/standard/url_scanner_ex.h +++ b/ext/standard/url_scanner_ex.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/user_filters.c b/ext/standard/user_filters.c index b44be124a1..29a4c70d34 100644 --- a/ext/standard/user_filters.c +++ b/ext/standard/user_filters.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/uuencode.c b/ext/standard/uuencode.c index 76701ff24b..52e892ed9e 100644 --- a/ext/standard/uuencode.c +++ b/ext/standard/uuencode.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/var.c b/ext/standard/var.c index 2d0339a6a3..7603ff2ee0 100644 --- a/ext/standard/var.c +++ b/ext/standard/var.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/var_unserializer.c b/ext/standard/var_unserializer.c index 8a35e0a5af..e39a3505cd 100644 --- a/ext/standard/var_unserializer.c +++ b/ext/standard/var_unserializer.c @@ -4,7 +4,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/standard/versioning.c b/ext/standard/versioning.c index aadbcaf84a..9eb3829a08 100644 --- a/ext/standard/versioning.c +++ b/ext/standard/versioning.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/sybase_ct/php_sybase_ct.c b/ext/sybase_ct/php_sybase_ct.c index ee53d484cf..73db73e984 100644 --- a/ext/sybase_ct/php_sybase_ct.c +++ b/ext/sybase_ct/php_sybase_ct.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/sybase_ct/php_sybase_ct.h b/ext/sybase_ct/php_sybase_ct.h index f2ac3d0460..8e4993e0ed 100644 --- a/ext/sybase_ct/php_sybase_ct.h +++ b/ext/sybase_ct/php_sybase_ct.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/sysvmsg/php_sysvmsg.h b/ext/sysvmsg/php_sysvmsg.h index 86c8c1ec21..df8c4d4235 100644 --- a/ext/sysvmsg/php_sysvmsg.h +++ b/ext/sysvmsg/php_sysvmsg.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/sysvmsg/sysvmsg.c b/ext/sysvmsg/sysvmsg.c index a57e25e6c3..adf1d2d6be 100644 --- a/ext/sysvmsg/sysvmsg.c +++ b/ext/sysvmsg/sysvmsg.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/sysvsem/php_sysvsem.h b/ext/sysvsem/php_sysvsem.h index c4598f56f2..964c3d3de4 100644 --- a/ext/sysvsem/php_sysvsem.h +++ b/ext/sysvsem/php_sysvsem.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/sysvsem/sysvsem.c b/ext/sysvsem/sysvsem.c index b6e5ccb7dc..c30def8ba5 100644 --- a/ext/sysvsem/sysvsem.c +++ b/ext/sysvsem/sysvsem.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/sysvshm/php_sysvshm.h b/ext/sysvshm/php_sysvshm.h index 280b3e487c..ba8849d2c4 100644 --- a/ext/sysvshm/php_sysvshm.h +++ b/ext/sysvshm/php_sysvshm.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/sysvshm/sysvshm.c b/ext/sysvshm/sysvshm.c index 2d4f66aead..72ffe0b187 100644 --- a/ext/sysvshm/sysvshm.c +++ b/ext/sysvshm/sysvshm.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/tidy/php_tidy.h b/ext/tidy/php_tidy.h index 94178039b1..efeba3baa9 100644 --- a/ext/tidy/php_tidy.h +++ b/ext/tidy/php_tidy.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/tidy/tidy.c b/ext/tidy/tidy.c index c3b9d8c346..14aff36094 100644 --- a/ext/tidy/tidy.c +++ b/ext/tidy/tidy.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/tokenizer/php_tokenizer.h b/ext/tokenizer/php_tokenizer.h index 761556a14b..1b5490d257 100644 --- a/ext/tokenizer/php_tokenizer.h +++ b/ext/tokenizer/php_tokenizer.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/tokenizer/tests/token_get_all_variation14.phpt b/ext/tokenizer/tests/token_get_all_variation14.phpt index 5fc390e36c..52d29198c7 100644 --- a/ext/tokenizer/tests/token_get_all_variation14.phpt +++ b/ext/tokenizer/tests/token_get_all_variation14.phpt @@ -26,7 +26,7 @@ struct myStruct { ?>'; var_dump( token_get_all($source)); -// with invalid open tag for testing entire source to be unkown token +// with invalid open tag for testing entire source to be unknown token echo "-- with invlalid PHP open tag & valid tokens --\n"; $source = '<pli echo "hello world"; ?>'; diff --git a/ext/tokenizer/tokenizer.c b/ext/tokenizer/tokenizer.c index 132a7f299f..2a30a9819c 100644 --- a/ext/tokenizer/tokenizer.c +++ b/ext/tokenizer/tokenizer.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/tokenizer/tokenizer_data.c b/ext/tokenizer/tokenizer_data.c index 1f563da6b5..d4ef1fdf54 100644 --- a/ext/tokenizer/tokenizer_data.c +++ b/ext/tokenizer/tokenizer_data.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/tokenizer/tokenizer_data_gen.sh b/ext/tokenizer/tokenizer_data_gen.sh index 4ccbd2ac67..9a675c4f97 100755 --- a/ext/tokenizer/tokenizer_data_gen.sh +++ b/ext/tokenizer/tokenizer_data_gen.sh @@ -16,7 +16,7 @@ echo '/* +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/wddx/php_wddx.h b/ext/wddx/php_wddx.h index 923816a40e..7e823f7c8f 100644 --- a/ext/wddx/php_wddx.h +++ b/ext/wddx/php_wddx.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/wddx/php_wddx_api.h b/ext/wddx/php_wddx_api.h index 1a0194535d..66a5134598 100644 --- a/ext/wddx/php_wddx_api.h +++ b/ext/wddx/php_wddx_api.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/wddx/wddx.c b/ext/wddx/wddx.c index 967da6a490..b0a6b82dfe 100644 --- a/ext/wddx/wddx.c +++ b/ext/wddx/wddx.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/xml/compat.c b/ext/xml/compat.c index c2d4497ba1..2a3d097ead 100644 --- a/ext/xml/compat.c +++ b/ext/xml/compat.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/xml/expat_compat.h b/ext/xml/expat_compat.h index 424785f566..e693715813 100644 --- a/ext/xml/expat_compat.h +++ b/ext/xml/expat_compat.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/xml/php_xml.h b/ext/xml/php_xml.h index 7766834ea4..0fc25739c4 100644 --- a/ext/xml/php_xml.h +++ b/ext/xml/php_xml.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/xml/xml.c b/ext/xml/xml.c index 1ef01c8864..a881d910b4 100644 --- a/ext/xml/xml.c +++ b/ext/xml/xml.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/xmlreader/php_xmlreader.c b/ext/xmlreader/php_xmlreader.c index adf282120e..b677b42995 100644 --- a/ext/xmlreader/php_xmlreader.c +++ b/ext/xmlreader/php_xmlreader.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/xmlreader/php_xmlreader.h b/ext/xmlreader/php_xmlreader.h index a163135d36..f559bd18d4 100644 --- a/ext/xmlreader/php_xmlreader.h +++ b/ext/xmlreader/php_xmlreader.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/xmlrpc/php_xmlrpc.h b/ext/xmlrpc/php_xmlrpc.h index 00f902086c..286711b505 100644 --- a/ext/xmlrpc/php_xmlrpc.h +++ b/ext/xmlrpc/php_xmlrpc.h @@ -37,7 +37,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/xmlrpc/xmlrpc-epi-php.c b/ext/xmlrpc/xmlrpc-epi-php.c index 925b554a56..dc832966fc 100644 --- a/ext/xmlrpc/xmlrpc-epi-php.c +++ b/ext/xmlrpc/xmlrpc-epi-php.c @@ -37,7 +37,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/xmlwriter/php_xmlwriter.c b/ext/xmlwriter/php_xmlwriter.c index 0a1439ced5..7bc35dabc4 100644 --- a/ext/xmlwriter/php_xmlwriter.c +++ b/ext/xmlwriter/php_xmlwriter.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/xmlwriter/php_xmlwriter.h b/ext/xmlwriter/php_xmlwriter.h index e21a5e3510..929b87ba08 100644 --- a/ext/xmlwriter/php_xmlwriter.h +++ b/ext/xmlwriter/php_xmlwriter.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/xsl/php_xsl.c b/ext/xsl/php_xsl.c index 6cbd91a797..d8366d14ff 100644 --- a/ext/xsl/php_xsl.c +++ b/ext/xsl/php_xsl.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/xsl/php_xsl.h b/ext/xsl/php_xsl.h index e1a792e84b..a457856815 100644 --- a/ext/xsl/php_xsl.h +++ b/ext/xsl/php_xsl.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/xsl/tests/bug49634.phpt b/ext/xsl/tests/bug49634.phpt new file mode 100644 index 0000000000..b009fd5fb8 --- /dev/null +++ b/ext/xsl/tests/bug49634.phpt @@ -0,0 +1,105 @@ +--TEST-- +bug #49634 (Segfault throwing an exception in a XSL registered function) +--SKIPIF-- +<?php +extension_loaded("xsl") or die("skip need ext/xsl"); +?> +--FILE-- +<?php + +$sXml = <<<XML +<?xml version="1.0" encoding="UTF-8" ?> +<root> + test +</root> +XML; + +$cDIR = __DIR__; +$sXsl = <<<XSL +<xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:ext="http://php.net/xsl" + xsl:extension-element-prefixes="ext" + exclude-result-prefixes="ext"> + <xsl:output encoding="UTF-8" indent="yes" method="xml" /> + <xsl:template match="/"> + <xsl:value-of select="ext:function('testFunction', document('$cDIR/bug49634.xml')/root)"/> + </xsl:template> +</xsl:stylesheet> +XSL; + +function testFunction($a) +{ + throw new Exception('Test exception.'); +} + +$domXml = new DOMDocument; +$domXml->loadXML($sXml); +$domXsl = new DOMDocument; +$domXsl->loadXML($sXsl); + +for ($i = 0; $i < 10; $i++) +{ + $xsltProcessor = new XSLTProcessor(); + $xsltProcessor->registerPHPFunctions(array('testFunction')); + $xsltProcessor->importStyleSheet($domXsl); + try { + @$xsltProcessor->transformToDoc($domXml); + } catch (Exception $e) { + echo $e,"\n"; + } +} +?> +===DONE=== +--EXPECTF-- +exception 'Exception' with message 'Test exception.' in %s:%d +Stack trace: +#0 [internal function]: testFunction(Array) +#1 %s(%d): XSLTProcessor->transformToDoc(Object(DOMDocument)) +#2 {main} +exception 'Exception' with message 'Test exception.' in %s:%d +Stack trace: +#0 [internal function]: testFunction(Array) +#1 %s(%d): XSLTProcessor->transformToDoc(Object(DOMDocument)) +#2 {main} +exception 'Exception' with message 'Test exception.' in %s:%d +Stack trace: +#0 [internal function]: testFunction(Array) +#1 %s(%d): XSLTProcessor->transformToDoc(Object(DOMDocument)) +#2 {main} +exception 'Exception' with message 'Test exception.' in %s:%d +Stack trace: +#0 [internal function]: testFunction(Array) +#1 %s(%d): XSLTProcessor->transformToDoc(Object(DOMDocument)) +#2 {main} +exception 'Exception' with message 'Test exception.' in %s:%d +Stack trace: +#0 [internal function]: testFunction(Array) +#1 %s(%d): XSLTProcessor->transformToDoc(Object(DOMDocument)) +#2 {main} +exception 'Exception' with message 'Test exception.' in %s:%d +Stack trace: +#0 [internal function]: testFunction(Array) +#1 %s(%d): XSLTProcessor->transformToDoc(Object(DOMDocument)) +#2 {main} +exception 'Exception' with message 'Test exception.' in %s:%d +Stack trace: +#0 [internal function]: testFunction(Array) +#1 %s(%d): XSLTProcessor->transformToDoc(Object(DOMDocument)) +#2 {main} +exception 'Exception' with message 'Test exception.' in %s:%d +Stack trace: +#0 [internal function]: testFunction(Array) +#1 %s(%d): XSLTProcessor->transformToDoc(Object(DOMDocument)) +#2 {main} +exception 'Exception' with message 'Test exception.' in %s:%d +Stack trace: +#0 [internal function]: testFunction(Array) +#1 %s(%d): XSLTProcessor->transformToDoc(Object(DOMDocument)) +#2 {main} +exception 'Exception' with message 'Test exception.' in %s:%d +Stack trace: +#0 [internal function]: testFunction(Array) +#1 %s(%d): XSLTProcessor->transformToDoc(Object(DOMDocument)) +#2 {main} +===DONE=== diff --git a/ext/xsl/tests/bug49634.xml b/ext/xsl/tests/bug49634.xml new file mode 100644 index 0000000000..f3f286eafc --- /dev/null +++ b/ext/xsl/tests/bug49634.xml @@ -0,0 +1 @@ +<root/> diff --git a/ext/xsl/xsl_fe.h b/ext/xsl/xsl_fe.h index ba9d49beb7..89726da724 100644 --- a/ext/xsl/xsl_fe.h +++ b/ext/xsl/xsl_fe.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/xsl/xsltprocessor.c b/ext/xsl/xsltprocessor.c index af11104a2e..67c90f501f 100644 --- a/ext/xsl/xsltprocessor.c +++ b/ext/xsl/xsltprocessor.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | @@ -279,7 +279,10 @@ static void xsl_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs, int t node->type = XML_NAMESPACE_DECL; node->parent = nsparent; node->ns = curns; + } else { + node = xmlDocCopyNodeList(domintern->document->ptr, node); } + child = php_dom_create_object(node, &ret, child, domintern TSRMLS_CC); add_next_index_zval(args[i], child); } diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c index 1f435bbb00..abc21c7f15 100644 --- a/ext/zip/php_zip.c +++ b/ext/zip/php_zip.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | @@ -1537,7 +1537,7 @@ static ZIPARCHIVE_METHOD(open) RETURN_LONG((long)err); } ze_obj->filename = estrdup(resolved_path); - ze_obj->filename_len = filename_len; + ze_obj->filename_len = strlen(resolved_path); ze_obj->za = intern; RETURN_TRUE; } diff --git a/ext/zip/php_zip.h b/ext/zip/php_zip.h index 7dd9ff09d0..06571948f1 100644 --- a/ext/zip/php_zip.h +++ b/ext/zip/php_zip.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/zlib/php_zlib.h b/ext/zlib/php_zlib.h index 6b1d0cd80c..b8a778fef0 100644 --- a/ext/zlib/php_zlib.h +++ b/ext/zlib/php_zlib.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/zlib/tests/gzeof_variation1.phpt b/ext/zlib/tests/gzeof_variation1.phpt index 6d1e0401df..77a1eccb66 100644 --- a/ext/zlib/tests/gzeof_variation1.phpt +++ b/ext/zlib/tests/gzeof_variation1.phpt @@ -9,7 +9,7 @@ if (!extension_loaded("zlib")) { --FILE-- <?php -$filename = dirname(__FILE__)."/temp.txt.gz"; +$filename = dirname(__FILE__)."/gzeof_variation1.txt.gz"; $h = gzopen($filename, 'w'); $str = "Here is the string to be written. "; $length = 10; diff --git a/ext/zlib/tests/gzfile_basic.phpt b/ext/zlib/tests/gzfile_basic.phpt index fd7ba18058..17055646d8 100644 --- a/ext/zlib/tests/gzfile_basic.phpt +++ b/ext/zlib/tests/gzfile_basic.phpt @@ -12,7 +12,7 @@ is a very common test for all languages EOT; $dirname = 'gzfile_temp'; -$filename = $dirname.'/plainfile.txt.gz'; +$filename = $dirname.'/gzfile_basic.txt.gz'; mkdir($dirname); $h = gzopen($filename, 'w'); gzwrite($h, $plaintxt); diff --git a/ext/zlib/tests/gzfile_basic2.phpt b/ext/zlib/tests/gzfile_basic2.phpt index 9124d336b0..2bbf315a1a 100644 --- a/ext/zlib/tests/gzfile_basic2.phpt +++ b/ext/zlib/tests/gzfile_basic2.phpt @@ -12,7 +12,7 @@ is a very common test for all languages EOT; $dirname = 'gzfile_temp'; -$filename = $dirname.'/plainfile.txt'; +$filename = $dirname.'/gzfile_basic2.txt'; mkdir($dirname); $h = fopen($filename, 'w'); fwrite($h, $plaintxt); diff --git a/ext/zlib/tests/gzopen_basic2.phpt b/ext/zlib/tests/gzopen_basic2.phpt index 5cc02cd182..90766b1817 100644 --- a/ext/zlib/tests/gzopen_basic2.phpt +++ b/ext/zlib/tests/gzopen_basic2.phpt @@ -18,7 +18,7 @@ echo "*** Testing gzopen() : basic functionality ***\n"; // Initialise all required variables -$filename = "temp.txt.gz"; +$filename = "gzopen_basic2.txt.gz"; $modes = array('w', 'w+'); $data = "This was the information that was written"; diff --git a/ext/zlib/tests/gzputs_basic.phpt b/ext/zlib/tests/gzputs_basic.phpt index 7566e74e72..6456e4b55f 100644 --- a/ext/zlib/tests/gzputs_basic.phpt +++ b/ext/zlib/tests/gzputs_basic.phpt @@ -9,7 +9,7 @@ if (!extension_loaded("zlib")) { --FILE-- <?php -$filename = dirname(__FILE__)."/temp.txt.gz"; +$filename = dirname(__FILE__)."/gzputs_basic.txt.gz"; $h = gzopen($filename, 'w'); $str = "Here is the string to be written. "; $length = 10; diff --git a/ext/zlib/tests/gzread_variation1.phpt b/ext/zlib/tests/gzread_variation1.phpt index 1f50d77126..966351e736 100644 --- a/ext/zlib/tests/gzread_variation1.phpt +++ b/ext/zlib/tests/gzread_variation1.phpt @@ -9,7 +9,7 @@ if (!extension_loaded("zlib")) { --FILE-- <?php -$filename = "temp.txt.gz"; +$filename = "gzread_variation1.txt.gz"; $h = gzopen($filename, 'w'); $str = "Here is the string to be written. "; var_dump(gzread($h, 100)); diff --git a/ext/zlib/tests/gzwrite_basic.phpt b/ext/zlib/tests/gzwrite_basic.phpt index 0d7521625d..46553eedf1 100644 --- a/ext/zlib/tests/gzwrite_basic.phpt +++ b/ext/zlib/tests/gzwrite_basic.phpt @@ -9,7 +9,7 @@ if (!extension_loaded("zlib")) { --FILE-- <?php -$filename = "temp.txt.gz"; +$filename = "gzwrite_basic.txt.gz"; $h = gzopen($filename, 'w'); $str = "Here is the string to be written. "; $length = 10; diff --git a/ext/zlib/tests/gzwrite_error.phpt b/ext/zlib/tests/gzwrite_error.phpt index b84a1db0c8..b4ddbb2ec7 100644 --- a/ext/zlib/tests/gzwrite_error.phpt +++ b/ext/zlib/tests/gzwrite_error.phpt @@ -8,7 +8,7 @@ if (!extension_loaded("zlib")) { ?> --FILE-- <?php -$filename = "temp.txt.gz"; +$filename = "gzwrite_error.txt.gz"; $h = gzopen($filename, 'w'); $str = "Here is the string to be written. "; $length = 10; diff --git a/ext/zlib/tests/gzwrite_error2.phpt b/ext/zlib/tests/gzwrite_error2.phpt index 691275055d..5f2a4197b5 100644 --- a/ext/zlib/tests/gzwrite_error2.phpt +++ b/ext/zlib/tests/gzwrite_error2.phpt @@ -9,7 +9,7 @@ if (!extension_loaded("zlib")) { --FILE-- <?php -$filename = "temp.txt.gz"; +$filename = "gzwrite_error2.txt.gz"; $h = gzopen($filename, 'w'); $str = "Here is the string to be written. "; var_dump(gzwrite( $h, $str, 0 ) ); diff --git a/ext/zlib/tests/readgzfile_basic.phpt b/ext/zlib/tests/readgzfile_basic.phpt index 2d180c1a56..5fd539e21c 100644 --- a/ext/zlib/tests/readgzfile_basic.phpt +++ b/ext/zlib/tests/readgzfile_basic.phpt @@ -13,7 +13,7 @@ for all languages EOT; $dirname = 'readgzfile_temp'; -$filename = $dirname.'/plainfile.txt.gz'; +$filename = $dirname.'/readgzfile_basic.txt.gz'; mkdir($dirname); $h = gzopen($filename, 'w'); gzwrite($h, $plaintxt); diff --git a/ext/zlib/tests/readgzfile_basic2.phpt b/ext/zlib/tests/readgzfile_basic2.phpt index 99d216a55e..5402f960c2 100644 --- a/ext/zlib/tests/readgzfile_basic2.phpt +++ b/ext/zlib/tests/readgzfile_basic2.phpt @@ -13,7 +13,7 @@ for all languages EOT; $dirname = 'readgzfile_temp'; -$filename = $dirname.'/plainfile.txt'; +$filename = $dirname.'/readgzfile_basic2.txt'; mkdir($dirname); $h = fopen($filename, 'w'); fwrite($h, $plaintxt); diff --git a/ext/zlib/tests/zlib_wrapper_fflush_basic.phpt b/ext/zlib/tests/zlib_wrapper_fflush_basic.phpt index 74ccc0dabb..de1318cfed 100644 --- a/ext/zlib/tests/zlib_wrapper_fflush_basic.phpt +++ b/ext/zlib/tests/zlib_wrapper_fflush_basic.phpt @@ -9,7 +9,7 @@ if (!extension_loaded("zlib")) { --FILE-- <?php -$filename = "temp.txt.gz"; +$filename = "zlib_wrapper_fflush_basic.txt.gz"; $h = gzopen($filename, 'w'); $str = "Here is the string to be written."; $length = 10; diff --git a/ext/zlib/tests/zlib_wrapper_ftruncate_basic.phpt b/ext/zlib/tests/zlib_wrapper_ftruncate_basic.phpt index 53b140ac56..348e24505c 100644 --- a/ext/zlib/tests/zlib_wrapper_ftruncate_basic.phpt +++ b/ext/zlib/tests/zlib_wrapper_ftruncate_basic.phpt @@ -9,7 +9,7 @@ if (!extension_loaded("zlib")) { --FILE-- <?php $f = dirname(__FILE__)."/004.txt.gz"; -$f2 = "temp.txt.gz"; +$f2 = "zlib_wrapper_ftruncate_basic.txt.gz"; copy($f, $f2); $h = gzopen($f2, "r"); diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index 1114bc8a65..705fb5dd5f 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/zlib/zlib_filter.c b/ext/zlib/zlib_filter.c index 5f276ad788..2054ec2ca2 100644 --- a/ext/zlib/zlib_filter.c +++ b/ext/zlib/zlib_filter.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/ext/zlib/zlib_fopen_wrapper.c b/ext/zlib/zlib_fopen_wrapper.c index 1b00eb8713..4807d67aa2 100644 --- a/ext/zlib/zlib_fopen_wrapper.c +++ b/ext/zlib/zlib_fopen_wrapper.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/main/SAPI.c b/main/SAPI.c index dcb2da629a..6890db3e65 100644 --- a/main/SAPI.c +++ b/main/SAPI.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | @@ -137,6 +137,7 @@ PHP_FUNCTION(header_register_callback) efree(callback_name); RETURN_FALSE; } + efree(callback_name); if (SG(callback_func)) { @@ -144,10 +145,10 @@ PHP_FUNCTION(header_register_callback) SG(fci_cache) = empty_fcall_info_cache; } - Z_ADDREF_P(callback_func); - SG(callback_func) = callback_func; - + + Z_ADDREF_P(SG(callback_func)); + RETURN_TRUE; } /* }}} */ @@ -156,24 +157,30 @@ static void sapi_run_header_callback(TSRMLS_D) { int error; zend_fcall_info fci; + char *callback_name = NULL; + char *callback_error = NULL; zval *retval_ptr = NULL; - - fci.size = sizeof(fci); - fci.function_table = EG(function_table); - fci.object_ptr = NULL; - fci.function_name = SG(callback_func); - fci.retval_ptr_ptr = &retval_ptr; - fci.param_count = 0; - fci.params = NULL; - fci.no_separation = 0; - fci.symbol_table = NULL; - - error = zend_call_function(&fci, &SG(fci_cache) TSRMLS_CC); - if (error == FAILURE) { + + if (zend_fcall_info_init(SG(callback_func), 0, &fci, &SG(fci_cache), &callback_name, &callback_error TSRMLS_CC) == SUCCESS) { + fci.retval_ptr_ptr = &retval_ptr; + + error = zend_call_function(&fci, &SG(fci_cache) TSRMLS_CC); + if (error == FAILURE) { + goto callback_failed; + } else if (retval_ptr) { + zval_ptr_dtor(&retval_ptr); + } + } else { +callback_failed: php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not call the sapi_header_callback"); - } else if (retval_ptr) { - zval_ptr_dtor(&retval_ptr); } + + if (callback_name) { + efree(callback_name); + } + if (callback_error) { + efree(callback_error); + } } SAPI_API void sapi_handle_post(void *arg TSRMLS_DC) diff --git a/main/SAPI.h b/main/SAPI.h index 92b7329dbc..c86ef6735c 100644 --- a/main/SAPI.h +++ b/main/SAPI.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/main/fopen_wrappers.c b/main/fopen_wrappers.c index 9b8645a061..4f6c79da1d 100644 --- a/main/fopen_wrappers.c +++ b/main/fopen_wrappers.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/main/fopen_wrappers.h b/main/fopen_wrappers.h index ae0001f483..2dcc542016 100644 --- a/main/fopen_wrappers.h +++ b/main/fopen_wrappers.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/main/getopt.c b/main/getopt.c index 591c8c7778..a31a6c75d5 100644 --- a/main/getopt.c +++ b/main/getopt.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/main/internal_functions_nw.c b/main/internal_functions_nw.c index 07aec9a08e..86ba57d486 100644 --- a/main/internal_functions_nw.c +++ b/main/internal_functions_nw.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/main/internal_functions_win32.c b/main/internal_functions_win32.c index 06cd5b2a50..8b5518ca90 100644 --- a/main/internal_functions_win32.c +++ b/main/internal_functions_win32.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/main/logos.h b/main/logos.h index eb2810712d..23026adc73 100644 --- a/main/logos.h +++ b/main/logos.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/main/main.c b/main/main.c index 1fd82c8398..8546500f32 100644 --- a/main/main.c +++ b/main/main.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/main/network.c b/main/network.c index ba2ee1c498..59ce12ef20 100644 --- a/main/network.c +++ b/main/network.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/main/output.c b/main/output.c index 004b066b6b..0777b64e1d 100644 --- a/main/output.c +++ b/main/output.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/main/php.h b/main/php.h index 9a7b092230..63e33fd166 100644 --- a/main/php.h +++ b/main/php.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/main/php_compat.h b/main/php_compat.h index 936dd5231f..20951ba427 100644 --- a/main/php_compat.h +++ b/main/php_compat.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/main/php_content_types.c b/main/php_content_types.c index c4433978ed..c36812f101 100644 --- a/main/php_content_types.c +++ b/main/php_content_types.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/main/php_content_types.h b/main/php_content_types.h index 7ceffff5c0..ed5346c843 100644 --- a/main/php_content_types.h +++ b/main/php_content_types.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/main/php_getopt.h b/main/php_getopt.h index a3f4c1420b..f536ac8a96 100644 --- a/main/php_getopt.h +++ b/main/php_getopt.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/main/php_globals.h b/main/php_globals.h index 170431d079..6a4cf5a627 100644 --- a/main/php_globals.h +++ b/main/php_globals.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/main/php_ini.c b/main/php_ini.c index 444b4ce844..8c76a315c3 100644 --- a/main/php_ini.c +++ b/main/php_ini.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/main/php_ini.h b/main/php_ini.h index 65c80f7593..4159e7591f 100644 --- a/main/php_ini.h +++ b/main/php_ini.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/main/php_logos.c b/main/php_logos.c index 5162c6c9be..7ac3f6b598 100644 --- a/main/php_logos.c +++ b/main/php_logos.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/main/php_logos.h b/main/php_logos.h index d0f0b5ecef..94b1938f99 100644 --- a/main/php_logos.h +++ b/main/php_logos.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/main/php_main.h b/main/php_main.h index 68ae83700e..1325486bd9 100644 --- a/main/php_main.h +++ b/main/php_main.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/main/php_memory_streams.h b/main/php_memory_streams.h index 0f975cc72d..3c4c3280eb 100644 --- a/main/php_memory_streams.h +++ b/main/php_memory_streams.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/main/php_network.h b/main/php_network.h index 8ffb51ca40..dd28f161aa 100644 --- a/main/php_network.h +++ b/main/php_network.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/main/php_open_temporary_file.c b/main/php_open_temporary_file.c index b43d6a7835..58a9c63da1 100644 --- a/main/php_open_temporary_file.c +++ b/main/php_open_temporary_file.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/main/php_open_temporary_file.h b/main/php_open_temporary_file.h index e7dce359bb..c07b2b2dfe 100644 --- a/main/php_open_temporary_file.h +++ b/main/php_open_temporary_file.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/main/php_output.h b/main/php_output.h index 833bddec38..0312e256f8 100644 --- a/main/php_output.h +++ b/main/php_output.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/main/php_reentrancy.h b/main/php_reentrancy.h index 50f2e209cd..2f2e99c0b4 100644 --- a/main/php_reentrancy.h +++ b/main/php_reentrancy.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/main/php_scandir.c b/main/php_scandir.c index 9f3042e0f1..36c0c648e1 100644 --- a/main/php_scandir.c +++ b/main/php_scandir.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/main/php_scandir.h b/main/php_scandir.h index ad68e8d518..90708c6872 100644 --- a/main/php_scandir.h +++ b/main/php_scandir.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/main/php_sprintf.c b/main/php_sprintf.c index 9df43a557d..e9f956f8dd 100644 --- a/main/php_sprintf.c +++ b/main/php_sprintf.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/main/php_streams.h b/main/php_streams.h index f9b94337d2..f3c9879144 100644 --- a/main/php_streams.h +++ b/main/php_streams.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/main/php_syslog.h b/main/php_syslog.h index e070487825..f8280a8a50 100644 --- a/main/php_syslog.h +++ b/main/php_syslog.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/main/php_ticks.c b/main/php_ticks.c index 17ffb9c770..b07f925fab 100644 --- a/main/php_ticks.c +++ b/main/php_ticks.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/main/php_ticks.h b/main/php_ticks.h index cc966fa520..0f58adac6a 100644 --- a/main/php_ticks.h +++ b/main/php_ticks.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/main/php_variables.c b/main/php_variables.c index 4c614692bb..e9ec0789bc 100644 --- a/main/php_variables.c +++ b/main/php_variables.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/main/php_variables.h b/main/php_variables.h index 8f5e96aac3..37b2cf2a04 100644 --- a/main/php_variables.h +++ b/main/php_variables.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/main/php_version.h b/main/php_version.h index 523bda6743..f887b489ac 100644 --- a/main/php_version.h +++ b/main/php_version.h @@ -2,7 +2,7 @@ /* edit configure.in to change version number */ #define PHP_MAJOR_VERSION 5 #define PHP_MINOR_VERSION 4 -#define PHP_RELEASE_VERSION 23 +#define PHP_RELEASE_VERSION 27 #define PHP_EXTRA_VERSION "-dev" -#define PHP_VERSION "5.4.23-dev" -#define PHP_VERSION_ID 50423 +#define PHP_VERSION "5.4.27-dev" +#define PHP_VERSION_ID 50427 diff --git a/main/reentrancy.c b/main/reentrancy.c index 7f85224835..dd411f478b 100644 --- a/main/reentrancy.c +++ b/main/reentrancy.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/main/rfc1867.c b/main/rfc1867.c index 8e4820988d..fab199b543 100644 --- a/main/rfc1867.c +++ b/main/rfc1867.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/main/rfc1867.h b/main/rfc1867.h index 8a502c4b89..1d47165851 100644 --- a/main/rfc1867.h +++ b/main/rfc1867.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/main/snprintf.c b/main/snprintf.c index 4514bd6821..1c73dcdcb7 100644 --- a/main/snprintf.c +++ b/main/snprintf.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/main/snprintf.h b/main/snprintf.h index f4ed4d234d..10f0e24fa5 100644 --- a/main/snprintf.h +++ b/main/snprintf.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/main/spprintf.c b/main/spprintf.c index 596e1ef456..5b16d51441 100644 --- a/main/spprintf.c +++ b/main/spprintf.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/main/spprintf.h b/main/spprintf.h index d9aa9533e5..813bbde01a 100644 --- a/main/spprintf.h +++ b/main/spprintf.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/main/streams/cast.c b/main/streams/cast.c index bf96d3cf80..78073c6187 100644 --- a/main/streams/cast.c +++ b/main/streams/cast.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/main/streams/filter.c b/main/streams/filter.c index 6de3a928fe..71599f0d12 100644 --- a/main/streams/filter.c +++ b/main/streams/filter.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/main/streams/glob_wrapper.c b/main/streams/glob_wrapper.c index 9c051a5921..e0a1561fc3 100644 --- a/main/streams/glob_wrapper.c +++ b/main/streams/glob_wrapper.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/main/streams/memory.c b/main/streams/memory.c index 328d3be399..e6d0baaa86 100644 --- a/main/streams/memory.c +++ b/main/streams/memory.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/main/streams/mmap.c b/main/streams/mmap.c index 4f9388c6e7..050e95f285 100644 --- a/main/streams/mmap.c +++ b/main/streams/mmap.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/main/streams/php_stream_context.h b/main/streams/php_stream_context.h index 240f6e0e8d..ea40e5172e 100644 --- a/main/streams/php_stream_context.h +++ b/main/streams/php_stream_context.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/main/streams/php_stream_filter_api.h b/main/streams/php_stream_filter_api.h index abb5906654..9d9894c1c5 100644 --- a/main/streams/php_stream_filter_api.h +++ b/main/streams/php_stream_filter_api.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/main/streams/php_stream_glob_wrapper.h b/main/streams/php_stream_glob_wrapper.h index 330e917bda..d0322f7190 100644 --- a/main/streams/php_stream_glob_wrapper.h +++ b/main/streams/php_stream_glob_wrapper.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/main/streams/php_stream_mmap.h b/main/streams/php_stream_mmap.h index 7895ac69d4..b3570be48c 100644 --- a/main/streams/php_stream_mmap.h +++ b/main/streams/php_stream_mmap.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/main/streams/php_stream_plain_wrapper.h b/main/streams/php_stream_plain_wrapper.h index d88b30c479..f27dde2e55 100644 --- a/main/streams/php_stream_plain_wrapper.h +++ b/main/streams/php_stream_plain_wrapper.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/main/streams/php_stream_transport.h b/main/streams/php_stream_transport.h index c2d911032e..072625b701 100644 --- a/main/streams/php_stream_transport.h +++ b/main/streams/php_stream_transport.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/main/streams/php_stream_userspace.h b/main/streams/php_stream_userspace.h index 2830dd0d26..28985a5e1e 100644 --- a/main/streams/php_stream_userspace.h +++ b/main/streams/php_stream_userspace.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/main/streams/php_streams_int.h b/main/streams/php_streams_int.h index daae2b8893..489e18b26f 100644 --- a/main/streams/php_streams_int.h +++ b/main/streams/php_streams_int.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/main/streams/plain_wrapper.c b/main/streams/plain_wrapper.c index 4ee81506b3..e689eda9f6 100644 --- a/main/streams/plain_wrapper.c +++ b/main/streams/plain_wrapper.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | @@ -78,11 +78,7 @@ PHPAPI int php_stream_parse_fopen_modes(const char *mode, int *open_flags) /* unknown mode */ return FAILURE; } -#if defined(O_NONBLOCK) - if (strchr(mode, 'n')) { - flags |= O_NONBLOCK; - } -#endif + if (strchr(mode, '+')) { flags |= O_RDWR; } else if (flags) { @@ -91,6 +87,12 @@ PHPAPI int php_stream_parse_fopen_modes(const char *mode, int *open_flags) flags |= O_RDONLY; } +#if defined(O_NONBLOCK) + if (strchr(mode, 'n')) { + flags |= O_NONBLOCK; + } +#endif + #if defined(_O_TEXT) && defined(O_BINARY) if (strchr(mode, 't')) { flags |= _O_TEXT; diff --git a/main/streams/streams.c b/main/streams/streams.c index a835c25d9d..cac50ef03f 100644 --- a/main/streams/streams.c +++ b/main/streams/streams.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/main/streams/transports.c b/main/streams/transports.c index c24bf97ce6..1bf096efb2 100644 --- a/main/streams/transports.c +++ b/main/streams/transports.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/main/streams/userspace.c b/main/streams/userspace.c index 69edbaafa9..b14efdd6a5 100644 --- a/main/streams/userspace.c +++ b/main/streams/userspace.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/main/streams/xp_socket.c b/main/streams/xp_socket.c index a9c050f267..2c7ca8d414 100644 --- a/main/streams/xp_socket.c +++ b/main/streams/xp_socket.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/main/strlcat.c b/main/strlcat.c index ca22839e86..b7aa06e8a2 100644 --- a/main/strlcat.c +++ b/main/strlcat.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/main/strlcpy.c b/main/strlcpy.c index 371faafd82..7738238bd5 100644 --- a/main/strlcpy.c +++ b/main/strlcpy.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/main/win32_internal_function_disabled.h b/main/win32_internal_function_disabled.h index 3a78f6c598..fb96231109 100644 --- a/main/win32_internal_function_disabled.h +++ b/main/win32_internal_function_disabled.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/main/win95nt.h b/main/win95nt.h index 2e944c2b0e..ce2b002f38 100644 --- a/main/win95nt.h +++ b/main/win95nt.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/netware/start.c b/netware/start.c index 8651a6ccca..e0569b1b89 100644 --- a/netware/start.c +++ b/netware/start.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/php.ini-development b/php.ini-development index b935f22eb5..962010746b 100644 --- a/php.ini-development +++ b/php.ini-development @@ -138,16 +138,6 @@ ; Development Value: "GP" ; Production Value: "GP" -; session.bug_compat_42 -; Default Value: On -; Development Value: On -; Production Value: Off - -; session.bug_compat_warn -; Default Value: On -; Development Value: On -; Production Value: Off - ; session.gc_divisor ; Default Value: 100 ; Development Value: 1000 @@ -1476,31 +1466,6 @@ session.gc_maxlifetime = 1440 ; setting session.gc_maxlifetime to 1440 (1440 seconds = 24 minutes): ; find /path/to/sessions -cmin +24 -type f | xargs rm -; PHP 4.2 and less have an undocumented feature/bug that allows you to -; to initialize a session variable in the global scope. -; PHP 4.3 and later will warn you, if this feature is used. -; You can disable the feature and the warning separately. At this time, -; the warning is only displayed, if bug_compat_42 is enabled. This feature -; introduces some serious security problems if not handled correctly. It's -; recommended that you do not use this feature on production servers. But you -; should enable this on development servers and enable the warning as well. If you -; do not enable the feature on development servers, you won't be warned when it's -; used and debugging errors caused by this can be difficult to track down. -; Default Value: On -; Development Value: On -; Production Value: Off -; http://php.net/session.bug-compat-42 -session.bug_compat_42 = On - -; This setting controls whether or not you are warned by PHP when initializing a -; session value into the global space. session.bug_compat_42 must be enabled before -; these warnings can be issued by PHP. See the directive above for more information. -; Default Value: On -; Development Value: On -; Production Value: Off -; http://php.net/session.bug-compat-warn -session.bug_compat_warn = On - ; Check HTTP Referer to invalidate externally stored URLs containing ids. ; HTTP_REFERER has to contain this substring for the session to be ; considered as valid. diff --git a/php.ini-production b/php.ini-production index 4ee7ac92ce..d19c6b84e6 100644 --- a/php.ini-production +++ b/php.ini-production @@ -138,16 +138,6 @@ ; Development Value: "GP" ; Production Value: "GP" -; session.bug_compat_42 -; Default Value: On -; Development Value: On -; Production Value: Off - -; session.bug_compat_warn -; Default Value: On -; Development Value: On -; Production Value: Off - ; session.gc_divisor ; Default Value: 100 ; Development Value: 1000 @@ -1476,31 +1466,6 @@ session.gc_maxlifetime = 1440 ; setting session.gc_maxlifetime to 1440 (1440 seconds = 24 minutes): ; find /path/to/sessions -cmin +24 -type f | xargs rm -; PHP 4.2 and less have an undocumented feature/bug that allows you to -; to initialize a session variable in the global scope. -; PHP 4.3 and later will warn you, if this feature is used. -; You can disable the feature and the warning separately. At this time, -; the warning is only displayed, if bug_compat_42 is enabled. This feature -; introduces some serious security problems if not handled correctly. It's -; recommended that you do not use this feature on production servers. But you -; should enable this on development servers and enable the warning as well. If you -; do not enable the feature on development servers, you won't be warned when it's -; used and debugging errors caused by this can be difficult to track down. -; Default Value: On -; Development Value: On -; Production Value: Off -; http://php.net/session.bug-compat-42 -session.bug_compat_42 = Off - -; This setting controls whether or not you are warned by PHP when initializing a -; session value into the global space. session.bug_compat_42 must be enabled before -; these warnings can be issued by PHP. See the directive above for more information. -; Default Value: On -; Development Value: On -; Production Value: Off -; http://php.net/session.bug-compat-warn -session.bug_compat_warn = Off - ; Check HTTP Referer to invalidate externally stored URLs containing ids. ; HTTP_REFERER has to contain this substring for the session to be ; considered as valid. diff --git a/run-tests.php b/run-tests.php index 317f6077a3..25e480728f 100755 --- a/run-tests.php +++ b/run-tests.php @@ -1088,6 +1088,7 @@ function system_with_timeout($commandline, $env = null, $stdin = null) fwrite($pipes[0], $stdin); } fclose($pipes[0]); + unset($pipes[0]); $timeout = $leak_check ? 300 : (isset($env['TEST_TIMEOUT']) ? $env['TEST_TIMEOUT'] : 60); diff --git a/sapi/aolserver/aolserver.c b/sapi/aolserver/aolserver.c index 3dcbc8d211..a89b98e57a 100644 --- a/sapi/aolserver/aolserver.c +++ b/sapi/aolserver/aolserver.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/sapi/apache/libpre.c b/sapi/apache/libpre.c index 35b47cf5df..ca10e34cdd 100644 --- a/sapi/apache/libpre.c +++ b/sapi/apache/libpre.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/sapi/apache/mod_php5.c b/sapi/apache/mod_php5.c index 8361f7f410..a1e5a70e89 100644 --- a/sapi/apache/mod_php5.c +++ b/sapi/apache/mod_php5.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/sapi/apache/mod_php5.h b/sapi/apache/mod_php5.h index bdbdd478dd..3bc7857380 100644 --- a/sapi/apache/mod_php5.h +++ b/sapi/apache/mod_php5.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/sapi/apache/php_apache.c b/sapi/apache/php_apache.c index 3745197439..43a4c90efe 100644 --- a/sapi/apache/php_apache.c +++ b/sapi/apache/php_apache.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/sapi/apache/php_apache_http.h b/sapi/apache/php_apache_http.h index 12788d304d..a18e5dbac2 100644 --- a/sapi/apache/php_apache_http.h +++ b/sapi/apache/php_apache_http.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/sapi/apache/sapi_apache.c b/sapi/apache/sapi_apache.c index 88c99855c6..f19586da1f 100644 --- a/sapi/apache/sapi_apache.c +++ b/sapi/apache/sapi_apache.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/sapi/apache2filter/apache_config.c b/sapi/apache2filter/apache_config.c index 333c7b8cf2..7c50b9e6a8 100644 --- a/sapi/apache2filter/apache_config.c +++ b/sapi/apache2filter/apache_config.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/sapi/apache2filter/php_apache.h b/sapi/apache2filter/php_apache.h index 4ee3c0aa90..47fe98b5fd 100644 --- a/sapi/apache2filter/php_apache.h +++ b/sapi/apache2filter/php_apache.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/sapi/apache2filter/php_functions.c b/sapi/apache2filter/php_functions.c index e96ceda3f1..f1ae9c974b 100644 --- a/sapi/apache2filter/php_functions.c +++ b/sapi/apache2filter/php_functions.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/sapi/apache2filter/sapi_apache2.c b/sapi/apache2filter/sapi_apache2.c index 8ce490ea43..da920f818c 100644 --- a/sapi/apache2filter/sapi_apache2.c +++ b/sapi/apache2filter/sapi_apache2.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/sapi/apache2handler/apache_config.c b/sapi/apache2handler/apache_config.c index 2b519393d7..76d3ee2264 100644 --- a/sapi/apache2handler/apache_config.c +++ b/sapi/apache2handler/apache_config.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/sapi/apache2handler/mod_php5.c b/sapi/apache2handler/mod_php5.c index 56ef1bca44..4a01ebfd5f 100644 --- a/sapi/apache2handler/mod_php5.c +++ b/sapi/apache2handler/mod_php5.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/sapi/apache2handler/php_apache.h b/sapi/apache2handler/php_apache.h index 8bc46089d7..34846048b0 100644 --- a/sapi/apache2handler/php_apache.h +++ b/sapi/apache2handler/php_apache.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/sapi/apache2handler/php_functions.c b/sapi/apache2handler/php_functions.c index 1f79a538f4..2c57300926 100644 --- a/sapi/apache2handler/php_functions.c +++ b/sapi/apache2handler/php_functions.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/sapi/apache2handler/sapi_apache2.c b/sapi/apache2handler/sapi_apache2.c index b7f95e0c12..d2b3a327ff 100644 --- a/sapi/apache2handler/sapi_apache2.c +++ b/sapi/apache2handler/sapi_apache2.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/sapi/apache_hooks/mod_php5.c b/sapi/apache_hooks/mod_php5.c index 66adb482ed..a069e324c1 100644 --- a/sapi/apache_hooks/mod_php5.c +++ b/sapi/apache_hooks/mod_php5.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/sapi/apache_hooks/mod_php5.h b/sapi/apache_hooks/mod_php5.h index 86a5863ab9..3db828ec83 100644 --- a/sapi/apache_hooks/mod_php5.h +++ b/sapi/apache_hooks/mod_php5.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/sapi/apache_hooks/php_apache.c b/sapi/apache_hooks/php_apache.c index dde6d88773..6531ca20ee 100644 --- a/sapi/apache_hooks/php_apache.c +++ b/sapi/apache_hooks/php_apache.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/sapi/apache_hooks/sapi_apache.c b/sapi/apache_hooks/sapi_apache.c index a9c9d674e0..9ed93aea6d 100644 --- a/sapi/apache_hooks/sapi_apache.c +++ b/sapi/apache_hooks/sapi_apache.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/sapi/caudium/caudium.c b/sapi/caudium/caudium.c index d3b834fe93..e707f3576e 100644 --- a/sapi/caudium/caudium.c +++ b/sapi/caudium/caudium.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c index c8dfec0f95..b8ff878fe4 100644 --- a/sapi/cgi/cgi_main.c +++ b/sapi/cgi/cgi_main.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | @@ -2220,9 +2220,9 @@ consult the installation file that came with this distribution, or visit \n\ SG(request_info).no_headers = 1; } #if ZEND_DEBUG - php_printf("PHP %s (%s) (built: %s %s) (DEBUG)\nCopyright (c) 1997-2013 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); + php_printf("PHP %s (%s) (built: %s %s) (DEBUG)\nCopyright (c) 1997-2014 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); #else - php_printf("PHP %s (%s) (built: %s %s)\nCopyright (c) 1997-2013 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); + php_printf("PHP %s (%s) (built: %s %s)\nCopyright (c) 1997-2014 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); #endif php_request_shutdown((void *) 0); fcgi_shutdown(); diff --git a/sapi/cgi/fastcgi.c b/sapi/cgi/fastcgi.c index 72977b6330..8ddc2e4577 100644 --- a/sapi/cgi/fastcgi.c +++ b/sapi/cgi/fastcgi.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/sapi/cgi/fastcgi.h b/sapi/cgi/fastcgi.h index f1f464dc05..702f51df6b 100644 --- a/sapi/cgi/fastcgi.h +++ b/sapi/cgi/fastcgi.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/sapi/cli/cli.h b/sapi/cli/cli.h index 7686522a20..dc85893a0b 100644 --- a/sapi/cli/cli.h +++ b/sapi/cli/cli.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/sapi/cli/php.1.in b/sapi/cli/php.1.in index c113030d14..8672b3ba33 100644 --- a/sapi/cli/php.1.in +++ b/sapi/cli/php.1.in @@ -178,15 +178,6 @@ Parse and execute .IR file .TP .PD 0 -.B \-\-global \fIname\fP -.TP -.PD 1 -.B \-g \fIname\fP -Make variable -.IR name -global in script. -.TP -.PD 0 .B \-\-help .TP .PD 1 @@ -298,7 +289,7 @@ Specify the document root to be used by the built-in web server Version number .TP .PD 0 -.B \-\-stripped +.B \-\-strip .TP .PD 1 .B \-w diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index aa300ce88d..07371ee8e3 100644 --- a/sapi/cli/php_cli.c +++ b/sapi/cli/php_cli.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | @@ -688,7 +688,7 @@ static int do_cli(int argc, char **argv TSRMLS_DC) /* {{{ */ goto out; case 'v': /* show php version & quit */ - php_printf("PHP %s (%s) (built: %s %s) %s\nCopyright (c) 1997-2013 The PHP Group\n%s", + php_printf("PHP %s (%s) (built: %s %s) %s\nCopyright (c) 1997-2014 The PHP Group\n%s", PHP_VERSION, cli_sapi_module.name, __DATE__, __TIME__, #if ZEND_DEBUG && defined(HAVE_GCOV) "(DEBUG GCOV)", diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c index aa4b2cd622..e838d30558 100644 --- a/sapi/cli/php_cli_server.c +++ b/sapi/cli/php_cli_server.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/sapi/cli/php_cli_server.h b/sapi/cli/php_cli_server.h index ed716f99f8..f8dff05d02 100644 --- a/sapi/cli/php_cli_server.h +++ b/sapi/cli/php_cli_server.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/sapi/continuity/capi.c b/sapi/continuity/capi.c index 26762a5a96..953991474d 100644 --- a/sapi/continuity/capi.c +++ b/sapi/continuity/capi.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/sapi/embed/php_embed.c b/sapi/embed/php_embed.c index 414b4dbb02..dad54de1ae 100644 --- a/sapi/embed/php_embed.c +++ b/sapi/embed/php_embed.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/sapi/embed/php_embed.h b/sapi/embed/php_embed.h index ad5f4bc476..84c0e36336 100644 --- a/sapi/embed/php_embed.h +++ b/sapi/embed/php_embed.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/sapi/fpm/fpm/events/devpoll.c b/sapi/fpm/fpm/events/devpoll.c index 223d0729c8..3fa7cd4545 100644 --- a/sapi/fpm/fpm/events/devpoll.c +++ b/sapi/fpm/fpm/events/devpoll.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/sapi/fpm/fpm/events/devpoll.h b/sapi/fpm/fpm/events/devpoll.h index f9bc4af194..2753cb5abe 100644 --- a/sapi/fpm/fpm/events/devpoll.h +++ b/sapi/fpm/fpm/events/devpoll.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/sapi/fpm/fpm/events/epoll.c b/sapi/fpm/fpm/events/epoll.c index c9c7f1fd6d..2857ea2a09 100644 --- a/sapi/fpm/fpm/events/epoll.c +++ b/sapi/fpm/fpm/events/epoll.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/sapi/fpm/fpm/events/epoll.h b/sapi/fpm/fpm/events/epoll.h index abc5a21b10..f89e59a5f5 100644 --- a/sapi/fpm/fpm/events/epoll.h +++ b/sapi/fpm/fpm/events/epoll.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/sapi/fpm/fpm/events/kqueue.c b/sapi/fpm/fpm/events/kqueue.c index 7ce0760691..9fde33842b 100644 --- a/sapi/fpm/fpm/events/kqueue.c +++ b/sapi/fpm/fpm/events/kqueue.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/sapi/fpm/fpm/events/kqueue.h b/sapi/fpm/fpm/events/kqueue.h index 2642acaae5..16f8046529 100644 --- a/sapi/fpm/fpm/events/kqueue.h +++ b/sapi/fpm/fpm/events/kqueue.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/sapi/fpm/fpm/events/poll.c b/sapi/fpm/fpm/events/poll.c index 185eceb1a9..d49661413c 100644 --- a/sapi/fpm/fpm/events/poll.c +++ b/sapi/fpm/fpm/events/poll.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/sapi/fpm/fpm/events/poll.h b/sapi/fpm/fpm/events/poll.h index d55319214c..4a05755d07 100644 --- a/sapi/fpm/fpm/events/poll.h +++ b/sapi/fpm/fpm/events/poll.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/sapi/fpm/fpm/events/port.c b/sapi/fpm/fpm/events/port.c index 3cbf092cbc..0e6a880554 100644 --- a/sapi/fpm/fpm/events/port.c +++ b/sapi/fpm/fpm/events/port.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/sapi/fpm/fpm/events/port.h b/sapi/fpm/fpm/events/port.h index 666a157d23..f127b8cdad 100644 --- a/sapi/fpm/fpm/events/port.h +++ b/sapi/fpm/fpm/events/port.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/sapi/fpm/fpm/events/select.c b/sapi/fpm/fpm/events/select.c index e3af067d86..cf3331c04b 100644 --- a/sapi/fpm/fpm/events/select.c +++ b/sapi/fpm/fpm/events/select.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/sapi/fpm/fpm/events/select.h b/sapi/fpm/fpm/events/select.h index db52503fc1..74f7be2bc1 100644 --- a/sapi/fpm/fpm/events/select.h +++ b/sapi/fpm/fpm/events/select.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/sapi/fpm/fpm/fastcgi.c b/sapi/fpm/fpm/fastcgi.c index 10fd9efa95..80745a9c7e 100644 --- a/sapi/fpm/fpm/fastcgi.c +++ b/sapi/fpm/fpm/fastcgi.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/sapi/fpm/fpm/fastcgi.h b/sapi/fpm/fpm/fastcgi.h index ee786752e8..34f9eef9da 100644 --- a/sapi/fpm/fpm/fastcgi.h +++ b/sapi/fpm/fpm/fastcgi.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/sapi/fpm/fpm/fpm_conf.c b/sapi/fpm/fpm/fpm_conf.c index cd5fc34d0f..688c640250 100644 --- a/sapi/fpm/fpm/fpm_conf.c +++ b/sapi/fpm/fpm/fpm_conf.c @@ -148,6 +148,7 @@ static struct ini_value_parser_s ini_fpm_pool_options[] = { { "chroot", &fpm_conf_set_string, WPO(chroot) }, { "chdir", &fpm_conf_set_string, WPO(chdir) }, { "catch_workers_output", &fpm_conf_set_boolean, WPO(catch_workers_output) }, + { "clear_env", &fpm_conf_set_boolean, WPO(clear_env) }, { "security.limit_extensions", &fpm_conf_set_string, WPO(security_limit_extensions) }, { 0, 0, 0 } }; @@ -603,6 +604,7 @@ static void *fpm_worker_pool_config_alloc() /* {{{ */ wp->config->listen_backlog = FPM_BACKLOG_DEFAULT; wp->config->pm_process_idle_timeout = 10; /* 10s by default */ wp->config->process_priority = 64; /* 64 means unset */ + wp->config->clear_env = 1; if (!fpm_worker_all_pools) { fpm_worker_all_pools = wp; @@ -1600,6 +1602,7 @@ static void fpm_conf_dump() /* {{{ */ zlog(ZLOG_NOTICE, "\tchroot = %s", STR2STR(wp->config->chroot)); zlog(ZLOG_NOTICE, "\tchdir = %s", STR2STR(wp->config->chdir)); zlog(ZLOG_NOTICE, "\tcatch_workers_output = %s", BOOL2STR(wp->config->catch_workers_output)); + zlog(ZLOG_NOTICE, "\tclear_env = %s", BOOL2STR(wp->config->clear_env)); zlog(ZLOG_NOTICE, "\tsecurity.limit_extensions = %s", wp->config->security_limit_extensions); for (kv = wp->config->env; kv; kv = kv->next) { diff --git a/sapi/fpm/fpm/fpm_conf.h b/sapi/fpm/fpm/fpm_conf.h index efd65dc6d9..19bd7ff1f8 100644 --- a/sapi/fpm/fpm/fpm_conf.h +++ b/sapi/fpm/fpm/fpm_conf.h @@ -83,6 +83,7 @@ struct fpm_worker_pool_config_s { char *chroot; char *chdir; int catch_workers_output; + int clear_env; char *security_limit_extensions; struct key_value_s *env; struct key_value_s *php_admin_values; diff --git a/sapi/fpm/fpm/fpm_env.c b/sapi/fpm/fpm/fpm_env.c index 6b64fedfec..2ff0bdc0e4 100644 --- a/sapi/fpm/fpm/fpm_env.c +++ b/sapi/fpm/fpm/fpm_env.c @@ -143,7 +143,9 @@ int fpm_env_init_child(struct fpm_worker_pool_s *wp) /* {{{ */ fpm_env_setproctitle(title); efree(title); - clearenv(); + if (wp->config->clear_env) { + clearenv(); + } for (kv = wp->config->env; kv; kv = kv->next) { setenv(kv->key, kv->value, 1); diff --git a/sapi/fpm/fpm/fpm_main.c b/sapi/fpm/fpm/fpm_main.c index 043e0e00a4..e8793259b4 100644 --- a/sapi/fpm/fpm/fpm_main.c +++ b/sapi/fpm/fpm/fpm_main.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | @@ -1721,9 +1721,9 @@ int main(int argc, char *argv[]) SG(request_info).no_headers = 1; #if ZEND_DEBUG - php_printf("PHP %s (%s) (built: %s %s) (DEBUG)\nCopyright (c) 1997-2013 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); + php_printf("PHP %s (%s) (built: %s %s) (DEBUG)\nCopyright (c) 1997-2014 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); #else - php_printf("PHP %s (%s) (built: %s %s)\nCopyright (c) 1997-2013 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); + php_printf("PHP %s (%s) (built: %s %s)\nCopyright (c) 1997-2014 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); #endif php_request_shutdown((void *) 0); fcgi_shutdown(); diff --git a/sapi/fpm/php-fpm.conf.in b/sapi/fpm/php-fpm.conf.in index af4f2fa325..6ce9b63256 100644 --- a/sapi/fpm/php-fpm.conf.in +++ b/sapi/fpm/php-fpm.conf.in @@ -475,6 +475,15 @@ pm.max_spare_servers = 3 ; Default Value: no ;catch_workers_output = yes +; Clear environment in FPM workers +; Prevents arbitrary environment variables from reaching FPM worker processes +; by clearing the environment in workers before env vars specified in this +; pool configuration are added. +; Setting to "no" will make all environment variables available to PHP code +; via getenv(), $_ENV and $_SERVER. +; Default Value: yes +;clear_env = no + ; Limits the extensions of the main script FPM will allow to parse. This can ; prevent configuration mistakes on the web server side. You should only limit ; FPM to .php extensions to prevent malicious users to use other extensions to diff --git a/sapi/isapi/php5isapi.c b/sapi/isapi/php5isapi.c index 002ad2ae3e..d83c81ad9e 100644 --- a/sapi/isapi/php5isapi.c +++ b/sapi/isapi/php5isapi.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/sapi/litespeed/lsapi_main.c b/sapi/litespeed/lsapi_main.c index f33b049780..84e870d628 100644 --- a/sapi/litespeed/lsapi_main.c +++ b/sapi/litespeed/lsapi_main.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | @@ -719,9 +719,9 @@ static int cli_main( int argc, char * argv[] ) case 'v': if (php_request_startup(TSRMLS_C) != FAILURE) { #if ZEND_DEBUG - php_printf("PHP %s (%s) (built: %s %s) (DEBUG)\nCopyright (c) 1997-2013 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); + php_printf("PHP %s (%s) (built: %s %s) (DEBUG)\nCopyright (c) 1997-2014 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); #else - php_printf("PHP %s (%s) (built: %s %s)\nCopyright (c) 1997-2013 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); + php_printf("PHP %s (%s) (built: %s %s)\nCopyright (c) 1997-2014 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); #endif #ifdef PHP_OUTPUT_NEWAPI php_output_end_all(TSRMLS_C); diff --git a/sapi/litespeed/lsapidef.h b/sapi/litespeed/lsapidef.h index c8940a930e..3bdadac1d1 100644 --- a/sapi/litespeed/lsapidef.h +++ b/sapi/litespeed/lsapidef.h @@ -3,7 +3,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/sapi/litespeed/lsapilib.c b/sapi/litespeed/lsapilib.c index 10ea74981a..1bb16b3268 100644 --- a/sapi/litespeed/lsapilib.c +++ b/sapi/litespeed/lsapilib.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/sapi/litespeed/lsapilib.h b/sapi/litespeed/lsapilib.h index 3a987b4064..45934ad464 100644 --- a/sapi/litespeed/lsapilib.h +++ b/sapi/litespeed/lsapilib.h @@ -3,7 +3,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/sapi/milter/php_milter.c b/sapi/milter/php_milter.c index 6856c07bb6..432fd806c2 100644 --- a/sapi/milter/php_milter.c +++ b/sapi/milter/php_milter.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | @@ -1109,7 +1109,7 @@ int main(int argc, char *argv[]) } SG(headers_sent) = 1; SG(request_info).no_headers = 1; - php_printf("PHP %s (%s) (built: %s %s)\nCopyright (c) 1997-2013 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); + php_printf("PHP %s (%s) (built: %s %s)\nCopyright (c) 1997-2014 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); php_output_teardown(); exit(1); break; diff --git a/sapi/nsapi/nsapi.c b/sapi/nsapi/nsapi.c index 1e6a680c91..ec3137ca51 100644 --- a/sapi/nsapi/nsapi.c +++ b/sapi/nsapi/nsapi.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/sapi/phttpd/php_phttpd.h b/sapi/phttpd/php_phttpd.h index 49089cffbf..92409ac905 100644 --- a/sapi/phttpd/php_phttpd.h +++ b/sapi/phttpd/php_phttpd.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/sapi/phttpd/phttpd.c b/sapi/phttpd/phttpd.c index c2e917202f..60fc48ba35 100644 --- a/sapi/phttpd/phttpd.c +++ b/sapi/phttpd/phttpd.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/sapi/pi3web/pi3web_sapi.c b/sapi/pi3web/pi3web_sapi.c index 64eb2a6c99..4bc08e5382 100644 --- a/sapi/pi3web/pi3web_sapi.c +++ b/sapi/pi3web/pi3web_sapi.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/sapi/roxen/roxen.c b/sapi/roxen/roxen.c index c897ef62be..b3a64345ea 100644 --- a/sapi/roxen/roxen.c +++ b/sapi/roxen/roxen.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/sapi/thttpd/php_thttpd.h b/sapi/thttpd/php_thttpd.h index 40d63d27b1..75e79b4054 100644 --- a/sapi/thttpd/php_thttpd.h +++ b/sapi/thttpd/php_thttpd.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/sapi/thttpd/thttpd.c b/sapi/thttpd/thttpd.c index 548bcda170..843e4a62fb 100644 --- a/sapi/thttpd/thttpd.c +++ b/sapi/thttpd/thttpd.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/sapi/tux/php_tux.c b/sapi/tux/php_tux.c index 968dd9eb91..55d911f8ab 100644 --- a/sapi/tux/php_tux.c +++ b/sapi/tux/php_tux.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/sapi/webjames/php_webjames.h b/sapi/webjames/php_webjames.h index f9903d1647..dcb6cdb911 100644 --- a/sapi/webjames/php_webjames.h +++ b/sapi/webjames/php_webjames.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/sapi/webjames/webjames.c b/sapi/webjames/webjames.c index 9237ac7dd3..264f910af4 100644 --- a/sapi/webjames/webjames.c +++ b/sapi/webjames/webjames.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/tests/classes/autoload_021.phpt b/tests/classes/autoload_021.phpt new file mode 100644 index 0000000000..13562b4000 --- /dev/null +++ b/tests/classes/autoload_021.phpt @@ -0,0 +1,13 @@ +--TEST-- +Validation of class names in the autoload process +--FILE-- +<?php +function __autoload($name) { + echo "$name\n"; +} +$a = "../BUG"; +$x = new $a; +echo "BUG\n"; +?> +--EXPECTF-- +Fatal error: Class '../BUG' not found in %sautoload_021.php on line 6 diff --git a/tests/lang/bug24640.phpt b/tests/lang/bug24640.phpt index e41d0201b7..d02889101e 100644 --- a/tests/lang/bug24640.phpt +++ b/tests/lang/bug24640.phpt @@ -2,6 +2,7 @@ Bug #24640 (var_export and var_dump can't output large float) --INI-- precision=12 +serialize_precision=17 --FILE-- <?php function test($v) diff --git a/tests/security/open_basedir_linkinfo.phpt b/tests/security/open_basedir_linkinfo.phpt index f8be45305e..55cf2c2f4b 100644 --- a/tests/security/open_basedir_linkinfo.phpt +++ b/tests/security/open_basedir_linkinfo.phpt @@ -41,6 +41,7 @@ test_open_basedir_after("linkinfo"); ?> --CLEAN-- <?php +chdir(__DIR__); require_once "open_basedir.inc"; delete_directories(); ?> diff --git a/tests/security/open_basedir_readlink.phpt b/tests/security/open_basedir_readlink.phpt index b102ee9d9c..33720bbf1b 100644 --- a/tests/security/open_basedir_readlink.phpt +++ b/tests/security/open_basedir_readlink.phpt @@ -37,6 +37,7 @@ test_open_basedir_after("readlink"); ?> --CLEAN-- <?php +chdir(__DIR__); require_once "open_basedir.inc"; delete_directories(); ?> diff --git a/win32/build/config.w32 b/win32/build/config.w32 index 1a4b834be4..f025ae2f39 100644 --- a/win32/build/config.w32 +++ b/win32/build/config.w32 @@ -352,7 +352,7 @@ ADD_SOURCES("Zend", "zend_language_parser.c zend_language_scanner.c \ zend_ini_parser.c zend_ini_scanner.c zend_alloc.c zend_compile.c \ zend_constants.c zend_dynamic_array.c zend_exceptions.c \ zend_execute_API.c zend_highlight.c \ - zend_llist.c zend_opcode.c zend_operators.c zend_ptr_stack.c \ + zend_llist.c zend_vm_opcodes.c zend_opcode.c zend_operators.c zend_ptr_stack.c \ zend_stack.c zend_variables.c zend.c zend_API.c zend_extensions.c \ zend_hash.c zend_list.c zend_indent.c zend_builtin_functions.c \ zend_sprintf.c zend_ini.c zend_qsort.c zend_multibyte.c zend_ts_hash.c \ diff --git a/win32/build/deplister.c b/win32/build/deplister.c index 8da65ba302..31f1f07e67 100644 --- a/win32/build/deplister.c +++ b/win32/build/deplister.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/win32/build/libs_version.txt b/win32/build/libs_version.txt index ddbd925934..75a6b30e5b 100644 --- a/win32/build/libs_version.txt +++ b/win32/build/libs_version.txt @@ -3,7 +3,7 @@ cclient-2007e freetype-2.4.10 icu-49.1.2 jpeglib-8 -libcurl-7.30.0 +libcurl-7.35.0 libiconv-1.14 libmcrypt-2.5.8 libmpir-2.5.1 diff --git a/win32/globals.c b/win32/globals.c index b381cc1237..0f88e4cc63 100644 --- a/win32/globals.c +++ b/win32/globals.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/win32/grp.h b/win32/grp.h index a3fb97b205..899d3ac0cd 100644 --- a/win32/grp.h +++ b/win32/grp.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/win32/php_win32_globals.h b/win32/php_win32_globals.h index b2b07f68e1..6bf9ba5b71 100644 --- a/win32/php_win32_globals.h +++ b/win32/php_win32_globals.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/win32/select.c b/win32/select.c index d77ef3de00..94d4a6988c 100644 --- a/win32/select.c +++ b/win32/select.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/win32/select.h b/win32/select.h index 7cff1f303e..a8d8496295 100644 --- a/win32/select.h +++ b/win32/select.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/win32/sockets.c b/win32/sockets.c index c8fddd6e52..8b3898bb3c 100644 --- a/win32/sockets.c +++ b/win32/sockets.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/win32/sockets.h b/win32/sockets.h index f0b9f27484..78a0d3a967 100644 --- a/win32/sockets.h +++ b/win32/sockets.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/win32/syslog.h b/win32/syslog.h index e24737fe2f..06397d0f90 100644 --- a/win32/syslog.h +++ b/win32/syslog.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/win32/time.h b/win32/time.h index f841a2b601..d5d86eb1ed 100644 --- a/win32/time.h +++ b/win32/time.h @@ -50,4 +50,6 @@ PHPAPI extern int setitimer(int which, const struct itimerval *value, PHPAPI int nanosleep( const struct timespec * rqtp, struct timespec * rmtp ); +PHPAPI int usleep(unsigned int useconds); + #endif diff --git a/win32/winutil.c b/win32/winutil.c index 4afc28feca..22e2d45304 100644 --- a/win32/winutil.c +++ b/win32/winutil.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | diff --git a/win32/winutil.h b/win32/winutil.h index 8cf07ec286..773063e5f6 100644 --- a/win32/winutil.h +++ b/win32/winutil.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | 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 | |
