Compare commits

..
Author SHA1 Message Date
Johannes Schlüter d5643fd201 PHP 5.3.9RC4 2011-12-22 12:35:09 +00:00
Johannes Schlüter 712be66d05 PHP 5.3.9RC4 2011-12-22 12:33:04 +00:00
Gustavo André dos Santos Lopes ae054ae502 - Fixed bug #60570 (http wrapper leaks context resource if request fails/is
redirected).
2011-12-21 15:44:58 +00:00
Scott MacVicar 6c841dfda3 Add tests for OpenSSL crash. 2011-12-19 03:09:05 +00:00
Scott MacVicar 095cbc48a8 Fix segfault in older versions of OpenSSL (before 0.9.8i) 2011-12-18 05:14:32 +00:00
Dmitry Stogov b8a08bf263 Added max_input_vars directive to prevent attacks based on hash collisions 2011-12-15 10:31:02 +00:00
Dmitry Stogov 0d1998e34f Added max_input_vars directive to prevent attacks based on hash collisions 2011-12-15 08:47:03 +00:00
Andrey Hristov 2f0d084ab8 fix for 5.5.19 2011-12-14 19:29:45 +00:00
Andrey Hristov f16c10898b another fix 2011-12-14 19:28:41 +00:00
Andrey Hristov 536e675bfa fix test 2011-12-14 18:37:49 +00:00
Andrey Hristov 63ded0f5e9 fix test 2011-12-14 18:36:04 +00:00
Andrey Hristov 8a65304a01 fix typo 2011-12-14 17:59:11 +00:00
Pierre Joye 83841052e0 - add announce steps, s,cvs,svn, MFH 2011-12-14 16:32:50 +00:00
Andrey Hristov 141905ce54 fix test 2011-12-14 16:27:52 +00:00
Pierre Joye 848d71da29 - tmp dir is system depedent 2011-12-13 23:18:12 +00:00
Pierre Joye 8e54a63133 - skip on win 2011-12-13 23:04:01 +00:00
Pierre Joye 603bfaaff4 - ignore notices here, not what we test (array to string conversion) 2011-12-13 13:46:27 +00:00
Pierre Joye 3a68270fcf - use the test itself, making the test passes when ran outside the src tree 2011-12-12 19:09:01 +00:00
Pierre Joye 4e03e70575 - copy run-test php 2011-12-12 15:10:40 +00:00
Pierre Joye 52e77c9bc8 - skip on win 2011-12-12 14:03:24 +00:00
Pierre Joye 7eee6fa759 - skip on win 2011-12-12 14:02:06 +00:00
Pierre Joye aa37291e20 - skip on win 2011-12-12 13:56:42 +00:00
Pierre Joye ec9b8149e1 - skip on win 2011-12-12 13:53:38 +00:00
Pierre Joye c0ba404054 - skip on win 2011-12-12 13:49:21 +00:00
Pierre Joye 1a7f05705f - skip on win 2011-12-12 13:34:21 +00:00
Pierre Joye a4ecf57a30 - skip on win 2011-12-12 13:31:43 +00:00
Derick Rethans 9cbf9472b6 This test should no longer fail, and is perfectly okay for Linux to test on too. 2011-12-12 12:57:46 +00:00
Gustavo André dos Santos Lopes 74d2b2f0bd - Fixed bug #60455: stream_get_line misbehaves if EOF is not detected together
with the last read.
2011-12-11 21:08:15 +00:00
Popa Adrian Marius c55f9258b9 bug fixed #48877 - bindValue and bindParam do not work for PDO Firebird 2011-12-10 22:09:59 +00:00
Felipe Pena fbe48da396 - Fixed bug #60489 (Simple Typo In php.ini Files)
patch by: danbrown at php.net
2011-12-09 22:43:01 +00:00
Patrick Allaert 183493d624 Added tests contributions on spl_autoload and stream_context_set_option()
Thank you Jean-Marc Fontaine and Alter Way
2011-12-09 11:23:19 +00:00
Christopher Jones 77b821d3c5 Fix skipif 2011-12-08 20:43:23 +00:00
Pierrick Charron e8eab79ac8 Fix curl_copy_handle_basic_008.phpt when display_errors is On
(Thanks Chris Jones)
2011-12-08 18:57:01 +00:00
Hannes Magnusson 0a7fd1962b Uhh.. Can't believe noone noticed the gc option was missing from our ini files 2011-12-08 14:57:02 +00:00
Johannes Schlüter 451263f7d0 - Back to -dev 2011-12-08 13:46:45 +00:00
Johannes Schlüter 4307bd57db - 5.3.9RC3 2011-12-08 11:01:37 +00:00
Johannes Schlüter 52169a44af - These changes were done after RC2. 2011-12-08 11:00:16 +00:00
Derick Rethans 109cc0bfab Test cosmetics. 2011-12-07 19:42:44 +00:00
Derick Rethans 60d195dc44 Sorting out the tests *once* more.
Please keep them consistent and only change them if you are 110% certain what
you're doing. Otherwise -> please ask.
2011-12-07 19:24:58 +00:00
Pierrick Charron bc8fc80049 Fix test 2011-12-07 16:46:48 +00:00
Pierrick Charron 4093e5e797 Add new test for CURLOPT_POSTFIELDS 2011-12-07 16:32:50 +00:00
Pierre Joye 2ae3a4d849 - print_r seems to display 0 or nothing for days, let make that test works in both cases, that's not the purpose of this test to test print_r 2011-12-07 09:03:07 +00:00
Pierre Joye 361c162058 - fix warning and fix buggy behavior of timelib_diff due to bad assumption of floor signature (fixes almost date_diff tests too) 2011-12-07 08:39:43 +00:00
Pierre Joye 7e2d5315ec - force LF 2011-12-06 13:42:08 +00:00
Pierre Joye c46e5a1b7d - add windows version of this test 2011-12-06 13:35:41 +00:00
Pierre Joye 0c4915d580 - add windows version of this test 2011-12-06 13:34:45 +00:00
Pierre Joye 4a91e36366 - force LF 2011-12-06 13:16:40 +00:00
Pierre Joye d2fad53032 - force LF 2011-12-06 13:07:08 +00:00
Pierre Joye b84d8a5050 - force LF as EOL as the code expects it.
however it sounds like a bug in the implementation
phar.c:720
	if (4 != php_stream_read(fp, buffer, 4)) {
		MAPPHAR_ALLOC_FAIL("internal corruption of phar \"%s\" (truncated manifest at manifest length)")
	}

that code will fail if non LF eol are used. Or does phar supports only LF?
2011-12-06 11:58:05 +00:00
Derick Rethans 9aaec1c6e0 - Fixed bug number. 2011-12-06 06:23:13 +00:00
Derick Rethans 5b2ce47f2e - Fixed bug #53502 (strtotime with timezone memory leak).
- Fixed bug #52062 (large timestamps with DateTime::getTimestamp and
  DateTime::setTimestamp).
- Fixed bug #51994 (date_parse_from_format is parsing invalid date using 'yz'
  format).
- Fixed bug #51223 (Seg fault while creating (by unserialization)
  DatePeriod).
2011-12-06 06:21:08 +00:00
Derick Rethans 2a0343fb18 Make tests similar to the ones in 5.4 and trunk. 2011-12-06 06:13:41 +00:00
Derick Rethans 9f78bca569 - Added a test case for #53437. 2011-12-06 06:07:41 +00:00
Derick Rethans 2679ccc50b - Fixed bug #52062: large timestamps with DateTime::getTimestamp and DateTime::setTimestamp. 2011-12-06 06:04:24 +00:00
Derick Rethans 300b3efff5 - Cosmetics for test case for #48678. 2011-12-06 06:00:45 +00:00
Derick Rethans 70b782bc9a - Fixed test case for #54851.
- Make test case for #32555 the same for all branches.
2011-12-06 05:59:24 +00:00
Derick Rethans 0dcf098efd This changes adds the --EXTENSION-- section to .phpt files as
described in http://marc.info/?t=132248616300007&r=1&w=2.
2011-12-06 05:44:54 +00:00
Pierrick Charron a204f8fcfd Added myself as curl maintainer 2011-12-04 16:46:45 +00:00
Ilia Alshanetsky 8222ae737c Fixed Bug #55478 (FILTER_VALIDATE_EMAIL fails with internationalized
domain name addresses containing >1 -).
2011-12-04 14:52:40 +00:00
Pierrick Charron 109346779a Fixed bug #60439curl_copy_handle segfault when used with CURLOPT_PROGRESSFUNCTION 2011-12-04 01:34:54 +00:00
Pierrick Charron 3fe47ef089 Cleans up test file 2011-12-02 04:16:46 +00:00
Felipe Pena 78742a33a7 - Replace possible esc char to <esc> in the XML output 2011-12-01 15:47:58 +00:00
Christopher Jones 5fdb19fba0 Miscellaneous: move misplaced entry; fix typos; note more precise OCI8 DLL dependency; remove session.entropy_file setting which was only in PHP_5_3 php.ini-development 2011-11-29 22:33:55 +00:00
Dmitry Stogov d1432d434c Fixed bug #54911 (Access to a undefined member in inherit SoapClient may cause Segmentation Fault) 2011-11-28 14:20:35 +00:00
Felipe Pena 43a373437d - Added JUnit output format option
patch by: Ferenc Kovacs (tyrael at php.net)
2011-11-26 20:18:03 +00:00
Ferenc Kovacs 6f8518fbf5 adding some tests for string offsets 2011-11-26 18:41:45 +00:00
Felipe Pena 350325d42a - Fixed bug #55788 (test redirects should abide SHOW_ONLY_GROUPS in run-tests.php)
patch by: tyrael at php.net
2011-11-26 17:56:43 +00:00
Felipe Pena 06bc6bdc29 - Fix test 2011-11-26 17:35:19 +00:00
Felipe Pena 3ee878169b - Clean up 2011-11-26 17:30:03 +00:00
Derick Rethans 92e9a0bd91 - Fixed bug #54851 (DateTime::createFromFormat() doesn't interpret "D"). 2011-11-26 16:44:21 +00:00
Derick Rethans 1324d5d9c5 - Fixed bug #54596 (incorrect years for DateTime objects created with 4-digit
years).
2011-11-25 15:51:37 +00:00
Derick Rethans 016e57a712 - Force setting for tests. 2011-11-25 15:47:11 +00:00
Derick Rethans 45ae82d3f1 - Fixed bug #60373 (Startup errors with log_errors on cause segfault). 2011-11-25 14:06:55 +00:00
Xinchen Hui aa5ce0b58d warning: suggest parentheses around && within || 2011-11-25 07:50:18 +00:00
Derick Rethans 7411ae09f5 - Fixed bug #60236 (TLA timezone dates are not converted properly from
timestamp).
- Fixed bug #55253 (DateTime::add() and sub() result -1 hour on objects with
  time zone type 2).

And fixed some test cases.
2011-11-24 17:13:47 +00:00
Johannes Schlüter fb573462ca - Back to -dev 2011-11-24 14:00:10 +00:00
Johannes Schlüter e9087c9d4a - PHP 5.3.9RC2 2011-11-24 12:57:59 +00:00
Pierre Joye 91983739e7 - add crt warning ini 2011-11-24 12:51:28 +00:00
Pierre Joye fb53dd80d8 - merge crt warning change (r216594) and rename the ini to windows.show_crt_warning 2011-11-24 12:46:45 +00:00
Xinchen Hui fe96e8e64c Fixed bug #60367 (Reflection and Late Static Binding) 2011-11-24 09:16:11 +00:00
Ulf Wendel 0f799cc410 Good to fix something, but don't forget to update tests 2011-11-23 17:30:59 +00:00
Ulf Wendel 1d1d88bec0 Good to fix something, but don't forget to update tests 2011-11-23 17:23:57 +00:00
Ulf Wendel 2bfd24071b Always good to fix something, but don't forget to update tests 2011-11-23 17:01:09 +00:00
Ulf Wendel b5054a7c7b Fix test 2011-11-23 16:47:22 +00:00
Ulf Wendel 6c1f4e58ce Message can vary depending on server version 2011-11-23 16:38:50 +00:00
Dmitry Stogov 48a5ab0eca Fixed bug #48216 (PHP Fatal error: SOAP-ERROR: Parsing WSDL: Extra content at the end of the doc, when server uses chunked transfer encoding with spaces after chunk size) 2011-11-23 10:49:42 +00:00
Felipe Pena b6137f4cb1 - Fixed memory leak when calling the Finfo constructor twice 2011-11-23 01:20:49 +00:00
Felipe Pena c446440235 - Fix the fix (thanks Chris Jones!) 2011-11-22 19:18:34 +00:00
Pierrick Charron b0b58c3d08 Fix test to remove dependancy over php.net 2011-11-22 18:50:57 +00:00
Ulf Wendel 09a9df8d59 Skipping with libmysql. If a documentation points to more or less unmaintained wiki contents, I take it as a request to stop testing a feature. Can't tell if I get false positive, hit a bug or not. This is not libmysql testing. Its PHP MySQL API testing. 2011-11-22 16:52:42 +00:00
Andrey Hristov 692e7f2bd9 use the method in all builds. Thus it can be used for detection
of state transitioning in every case
2011-11-22 16:38:06 +00:00
Felipe Pena 72ad61733a - Fix the fix 2011-11-22 15:12:44 +00:00
Felipe Pena 8a4d75fe85 - Fixed possible memory leak in finfo_open() 2011-11-22 15:04:19 +00:00
Felipe Pena 4fffb5f5e0 - Fixed invalid free in call_user_method() function 2011-11-22 12:47:08 +00:00
Felipe Pena 735dc01811 - Fixed memory leak in several Intl locale functions 2011-11-22 12:29:15 +00:00
Pierrick Charron 0f26db6956 Fix this test to work with all version (even old) of libcurl 2011-11-22 08:29:26 +00:00
Pierrick Charron a1f1e0bcf9 Fix memory leak when using libcurl < 7.17.0 2011-11-22 05:19:37 +00:00
Felipe Pena f7048d0925 - Fixed possible crash in mb_ereg_search_init() using empty pattern 2011-11-21 19:15:18 +00:00
Pierrick Charron 0d73c76bec Fix memory leak 2011-11-21 02:29:24 +00:00
Pierrick Charron 1260d8e1c3 Fix test to use PHP_CURL_HTTP_REMOTE_SERVER 2011-11-21 02:10:57 +00:00
Pierre Joye 72004f29c2 - restore correct window_size 2011-11-20 10:10:43 +00:00
Pierre Joye 1e8fc920e1 - fix build, ansi c requires constant value, no expresion, even constant var 2011-11-19 23:09:12 +00:00
Felipe Pena 0c5bb1702b - Fixed bug #60339 (valgrind reports LEAK --with-mm)
patch by: yohgaki at ohgaki dot net
2011-11-19 18:50:49 +00:00
Felipe Pena b3b3eb8c2f - Fix tests 2011-11-19 18:01:26 +00:00
Felipe Pena 31ef559712 - Fixed bug #43200 (Interface implementation / inheritence not possible in abstract classes) 2011-11-19 13:36:03 +00:00
Antony Dovgal 75adcc8db0 backport the line from trunk and fix uninitialized variables 2011-11-19 13:23:16 +00:00
Mateusz Kocielski 17b39638d0 - Fixed bug #60337 bcscale related crashed on 64bits platforms 2011-11-19 12:46:43 +00:00
Felipe Pena b7e84d6b83 - Removed C++ comment style 2011-11-19 12:16:47 +00:00
Stanislav Malyshev 449907fb76 fix bug #60164 (Stubs of a specific length break phar_open_from_fp scanning for __HALT_COMPILER) 2011-11-19 04:59:56 +00:00
Stanislav Malyshev 1d0d8abc5f fix NEWS 2011-11-19 04:52:06 +00:00
Stanislav Malyshev 1dfbe61e2a fix bug #60150 for 5.3 too 2011-11-19 04:49:36 +00:00
Christopher Jones 57de041b14 r319456 also fixed the OCI8 part of #55301 (multiple null pointer) 2011-11-18 18:14:15 +00:00
Dmitry Stogov f7278c161f Fixed bug #60138 (GC crash with referenced array in RecursiveArrayIterator) 2011-11-18 12:43:53 +00:00
Christopher Jones 092a21cde3 Sync to 5.3 and check additional cases for #55748 2011-11-18 09:59:35 +00:00
Antony Dovgal c3b83e833d fix bug #60082 (Crash in ArrayObject() when using recursive references)
--Tis line, and those below, will be ignored--

M    trunk/ext/spl/spl_array.c
M    branches/PHP_5_4/ext/spl/spl_array.c
M    branches/PHP_5_3/ext/spl/spl_array.c
M    branches/PHP_5_3/NEWS
2011-11-18 05:22:35 +00:00
Felipe Pena 7735ef1c2d - Fixed bug #60099 (__halt_compiler() works in braced namespaces) 2011-11-16 17:41:40 +00:00
Felipe Pena 48b853c82f - Fixed bug #60267 (Compile failure with freetds 0.91) 2011-11-16 12:13:22 +00:00
George Wang 56728f11a8 keep code to be compatible with PHP4 2011-11-16 03:58:57 +00:00
George Wang badd6a91d4 keep PHP_5_4 in sync with PHP_5_3 branch 2011-11-16 03:44:42 +00:00
Jérôme Loyet e5ccae408e - Added .phar to default authorized extensions 2011-11-16 00:21:38 +00:00
Jérôme Loyet 772164446a typo 2011-11-16 00:19:43 +00:00
Jérôme Loyet bc169ba823 - FR #60199 (enhance FPM error log when the primary script can't be open) 2011-11-15 22:29:59 +00:00
Christopher Jones bf4cc0d564 Minor NEWS grammar fixes 2011-11-15 22:03:40 +00:00
Felipe Pena 42776c0259 - Fixed bug #55874 (GCC does not provide __sync_fetch_and_add on some archs)
patch by: klightspeed at netspace dot net dot au
2011-11-15 20:33:26 +00:00
Ilia Alshanetsky b6530d8978 Fixed bug #60244 (pg_fetch_* functions do not validate that row param is >0). 2011-11-15 18:02:58 +00:00
Felipe Pena 5f0e6a74ba - Fixed bug #52624 (tempnam() by-pass open_basedir with inexistent directory) 2011-11-15 16:59:59 +00:00
Felipe Pena bb6835f727 - Fixed bug #54682 (Tidy::diagnose() NULL pointer dereference) 2011-11-15 15:16:20 +00:00
Mateusz Kocielski 7cac52f58f #- Added information about NPD bug fix in the OpenSSL extension. 2011-11-14 19:20:34 +00:00
Johannes Schlüter 2ec0a9c5c8 - Add missing include. 2011-11-14 17:56:33 +00:00
Florian Anderiasch d0c1bd9457 Fixed a typo in README.SVN-RULES. 2011-11-14 15:39:35 +00:00
Dmitry Stogov cf2803d463 Fixed bug #44686 (SOAP-ERROR: Parsing WSDL with references) 2011-11-14 08:43:00 +00:00
Gustavo André dos Santos Lopes edea1c7b45 - Fixed tests in ext/standard/tests/http by adding the INI setting value
allow_url_fopen=1
- Converted test file from dos line endings to unix line endings.
2011-11-14 01:12:23 +00:00
Mateusz Kocielski 2c970a52e8 - Fixed NULL pointer dereference in stream_socket_enable_crypto, case when
ssl_handle of session_stream is not initialized.
2011-11-12 10:36:55 +00:00
Christopher Jones 9a03ce581f I can only guess what "dos" is. Also added missing fullstops for consistency. 2011-11-11 22:28:20 +00:00
Felipe Pena 72a133f155 - Fixed bug #60261 (phar dos null pointer) 2011-11-11 21:39:11 +00:00
Christopher Jones 0c00f3a15c OCI8: Fixed bug #59985 (show normal warning text for OCI_NO_DATA). Sync NEWS. 2011-11-10 22:47:00 +00:00
Christopher Jones 1437890872 Add tests for unsupported types 2011-11-09 06:19:07 +00:00
Antony Dovgal 152aaba03f bail out if reading HTTP headers failed 2011-11-08 16:38:56 +00:00
Christopher Jones b44adcd5ce Improve OCI8 NLS env creation error messages (#58925) 2011-11-07 20:10:41 +00:00
Christopher Jones acd96cdebe Bump OCI8 version to 1.4.7 stable in preparation for PHP 5.3.9 2011-11-03 22:13:34 +00:00
Christopher Jones 2e6db16f51 Replace custom "stress_test" setting with generic SKIP_SLOW_TESTS 2011-11-03 21:52:59 +00:00
Ulf Wendel 52e836611f Improving test to reflect latest API changes 2011-11-03 17:39:39 +00:00
Florian Anderiasch 01317b6915 Added info to 2 fixed bugs 2011-11-03 16:23:48 +00:00
Florian Anderiasch 635e2c28fe Redid the fix for #60192 with suggestions by Pierre and Kalle 2011-11-03 16:20:11 +00:00
Jérôme Loyet 0e25118cc4 - Fixed bug #60179 (php_flag and php_value does not work properly) 2011-11-03 15:47:19 +00:00
Johannes Schlüter 98dfe36852 Back to -dev 2011-11-03 15:26:34 +00:00
Johannes Schlüter 60937c2cf6 - PHP 5.3.9RC1 2011-11-03 15:08:19 +00:00
Johannes Schlüter c819de692b - Minor NEWS cleanup
# 80 columns, indention, entries are sentences ending with a period.
2011-11-03 14:51:10 +00:00
Xinchen Hui a391535e00 Fixed bug #60206 (possible integer overflow in content_length) 2011-11-03 07:26:09 +00:00
Ferenc Kovacs 6c01aacc0d adding memory check for FreeBSD also, TODO: refactor the free memory check into a function in an include file 2011-11-02 21:27:03 +00:00
Johannes Schlüter 6781f17575 - Fix bug #60155 (pdo_mysql.default_socket ignored). 2011-11-02 15:45:53 +00:00
Derick Rethans e3269e029e - Updated to version 2011.14 (2011n) 2011-11-02 10:58:51 +00:00
Dmitry Stogov 19a0522a42 Prevent possible integer overflow 2011-11-02 08:07:12 +00:00
Florian Anderiasch fe5f6f9188 Fix #60192 SegFault when Collator not constructed properly 2011-11-02 07:36:52 +00:00
Dmitry Stogov e95bb57da9 Fixed bug #60139 (Anonymous functions create cycles not detected by the GC) 2011-11-02 06:31:33 +00:00
Christopher Jones 8b4890e18e Update for new Oracle patchset variation 2011-11-01 21:30:57 +00:00
Ferenc Kovacs 67e148a2ff allocating more than 2GB memory is slow. 2011-11-01 21:27:57 +00:00
Rasmus Lerdorf 09f8573a77 Fix bug 60183 2011-11-01 15:15:51 +00:00
Florian Anderiasch 6972b94ae5 Fixed #60160 and added a test for it 2011-11-01 11:51:53 +00:00
Ferenc Kovacs 28faed47c4 ignore this test on FreeBSD per #60186 2011-11-01 10:25:47 +00:00
Ferenc Kovacs bb4f96b2a1 duh 2011-11-01 10:20:39 +00:00
Ferenc Kovacs 5a2a02f655 marking ext/spl/tests/bug60082.phpt as slow test 2011-11-01 10:10:24 +00:00
Christopher Jones 677c7c974b OCI8: improve initialization error message (See bug 60154) 2011-10-31 20:48:25 +00:00
Christopher Jones 89a4d34646 oci8 - Increase Oracle error message length for 11.2.0.3+ 2011-10-25 22:01:42 +00:00
Xinchen Hui f6dfff1081 force LF, fix test faild on windows 2011-10-25 11:04:57 +00:00
Derick Rethans 117b150360 - Updated to version 2011.13 (2011m) 2011-10-24 15:19:08 +00:00
Pierre Joye 03b39896a6 - fixed bug #60120, proc_open's streams may hang with stdin/out/err when the data exceeds or is equal to 2048 bytes 2011-10-24 12:39:55 +00:00
Pierre Joye b7354a30cd - win9x is not supported anymore since 5.3 2011-10-24 10:53:17 +00:00
Ferenc Kovacs c18a8bfe63 duh, I didn't wanted to commit that modification 2011-10-23 20:14:26 +00:00
Ferenc Kovacs b38d56616b adding SKIP_SLOW_TESTS checks for the slow tests, and additionaly sync the domains used in the ext/standard/tests/network/getmxrr.phpt with the other branches 2011-10-23 10:09:29 +00:00
Ferenc Kovacs 6c67aa07b4 check the available memory on linux and skip if it is not enough 2011-10-23 00:07:01 +00:00
Ferenc Kovacs 1b556f6114 shave off 900M memory from this test 2011-10-22 23:47:52 +00:00
Ferenc Kovacs a7a5776be7 fix test, it was fixed for trunk and 5.4 in r314005 2011-10-22 22:57:55 +00:00
Ferenc Kovacs 263ab7e2d4 stream_socket_server("unix://..." has a length limit, so it is better to use the tmp dir instead of the current test dir for the socket file. see https://bugs.php.net/bug.php?id=60106 2011-10-22 21:44:05 +00:00
Ferenc Kovacs 8bbbfadcfe there is a length limit on the shebang line, ignore the tests for >= 127 2011-10-20 18:09:44 +00:00
Xinchen Hui dc31f1e99e Fixed bug #60094 (C++ comment fails in c89) 2011-10-19 15:08:50 +00:00
Xinchen Hui d2c8d30bb9 Test for #60082 2011-10-19 02:28:53 +00:00
Daniel Convissor 6da5dfd0ac Tests for the DST RFC. 2011-10-18 21:45:07 +00:00
Andrey Hristov 5117bf657e move change_user closer to connect 2011-10-18 14:10:44 +00:00
Ilia Alshanetsky 199b52c1d4 Fixed bug #55543 (json_encode() with JSON_NUMERIC_CHECK fails on objects with numeric string properties) 2011-10-17 23:51:25 +00:00
Andrey Hristov 1619ebbec6 this should be decided by configure 2011-10-14 14:12:16 +00:00
Ilia Alshanetsky f1eaaa5dc6 Fixed bug #60019 (Function time_nanosleep() is undefined on OS X). 2011-10-14 12:43:27 +00:00
Felipe Pena 1694d78769 - Fixed bug #60048 (sa_len a #define on IRIX)
patch by: china at thewrittenword dot com
2011-10-13 22:56:05 +00:00
Felipe Pena 83ca3c8ff9 - Fixed bug #60042 (spl_autoload_call may manipulate a dangling pointer)
patch by: tom at punkave dot com
2011-10-12 01:03:15 +00:00
Andrey Hristov 68ce999e18 MYSQLND_NET refactored not to use any direct reference to MYSQLND (the connection)
QC will need an ifdef-layer to compile with this
2011-10-10 20:49:28 +00:00
Derick Rethans f3d88a7bba - Updated to version 2011.12 (2011l) 2011-10-10 08:05:55 +00:00
Christian Stocker 777a29fce2 Added the xsl.security_prefs option to 5_4 and trunk and
mark it as deprecated for BC-reasons
Added tests for ini option and combination of both
2011-10-10 07:59:19 +00:00
Jérôme Loyet 92039e00b0 - ensure request_terminate_timeout >= request_slowlog_timeout 2011-10-09 15:21:06 +00:00
Jérôme Loyet f58cf75068 - Fixed bug #55526 (Heartbeat causes a lot of unnecessary events) 2011-10-09 15:12:26 +00:00
Jérôme Loyet 3982cda83b - Fixed bug #55533 (The -d parameter doesn't work) 2011-10-09 14:36:11 +00:00
Jérôme Loyet e7c6f9c62d - Implemented FR #52569 (Add the "ondemand" process-manager to allow zero children) 2011-10-08 21:04:10 +00:00
Jérôme Loyet 95bd5f1872 - fix r317913 2011-10-08 20:43:12 +00:00
Jérôme Loyet 0c2752169c - Fixed bug #55486 (status show BIG processes number) 2011-10-08 19:50:26 +00:00
Jérôme Loyet 4d554c45b9 - Fixed bug #55577 (status.html does not install) 2011-10-08 19:31:32 +00:00
Andrey Hristov 3701485d97 null the value before usage 2011-10-08 14:48:14 +00:00
Jérôme Loyet dd243e5c75 ws 2011-10-08 14:11:37 +00:00
Jérôme Loyet 509629d8b5 - Backported from 5.4 branch (Dropped restriction of not setting the same value multiple times, the last one holds). 2011-10-08 14:07:47 +00:00
Jérôme Loyet 4e396d7333 - Backported from 5.4 branch:
* enhanced log messages
  * code cosmetic
2011-10-08 14:04:09 +00:00
Jérôme Loyet 93c3c0abfa - Backported from 5.4 branch (order fpm configuration items the same way in php-fpm.conf.in, fpm_conf.h and fpm_conf.c) 2011-10-08 14:00:07 +00:00
Jérôme Loyet 7fc36a5210 - Backported from 5.4 branch (don't write directly to stderr, use the internal logger instead (zlog)) 2011-10-08 13:57:31 +00:00
Jérôme Loyet 4ef746ae25 remove unused variable 2011-10-08 13:53:49 +00:00
Jérôme Loyet 9018d9434e - backparted from 5.4 branch (remove is_fastcgi because FPM is always fastcgi) 2011-10-08 13:52:27 +00:00
Jérôme Loyet c6b633a32a - Backported FR #55166 from 5.4 branch (Added process.max to control the number of process FPM can fork) 2011-10-08 13:47:52 +00:00
Jérôme Loyet c4e961f06e - Backported FR #55181 from 5.4 branch (Enhance security by limiting access to user defined extensions) 2011-10-08 13:42:31 +00:00
Jérôme Loyet a0f2d34b19 - Backported FR #54098 from 5.4 branch (Lowered process manager default value) 2011-10-08 13:38:28 +00:00
Jérôme Loyet eccb940419 - Backported FR #52052 from 5.4 branch (Added partial syslog support) 2011-10-08 13:35:03 +00:00
Jérôme Loyet eb2878ceb7 fix ws 2011-10-08 13:33:38 +00:00
Jérôme Loyet 4a0cd3946f - commit r312812 again (dropped in r312913):
Implemented FR #54577 (Enhanced status page with full status and details
    about each processes. Also provide a web page (status.html) for
    real-time FPM status.
2011-10-08 13:29:14 +00:00
Pierre Joye e1ad60d3d5 - fix bug #55870, PDO ignores all SSL parameters when used with mysql native driver 2011-10-08 06:17:08 +00:00
Christian Stocker c9b5d92821 Fix wrong comment
Add new xsl ini options to php.ini
2011-10-06 18:30:55 +00:00
Andrey Hristov 48077f321f Add test case 2011-10-06 17:06:02 +00:00
Andrey Hristov 7a7b550003 Be consistent, add mysqli::stat property, as equivalent of mysqli_stat().
Fix for Bug #55859 mysqli->stat property access gives error
2011-10-06 11:25:05 +00:00
Christian Stocker 192511f75d Added test for Bug 54446
Init a variable to a default value to avoid issues
2011-10-05 18:11:29 +00:00
Christian Stocker b2287a42a0 Added xsl.security_prefs ini option to define forbidden operations within XSLT
stylesheets, default is not to enable write operations. This option won't be 
in 5.4, since there's a new method. Bug #54446
2011-10-05 09:56:01 +00:00
Ilia Alshanetsky 347a04711b Fixed bug #55750 (memory copy issue in sysvshm extension). 2011-10-03 18:17:12 +00:00
Xinchen Hui 554dd6cd02 A better fix for #55817 (thanks to bjori) 2011-09-30 15:08:32 +00:00
Hannes Magnusson f40e5204d4 Fixed bug #55807 (Wrong value for splFileObject::SKIP_EMPTY) 2011-09-30 14:17:23 +00:00
Xinchen Hui f9745282f3 Fix wrong codes #55817 2011-09-30 13:34:07 +00:00
Gustavo André dos Santos Lopes d3fdacb99f - Fixed #55798: serialize followed by unserialize with numeric object prop.
gives integer prop.
2011-09-28 14:47:42 +00:00
Gustavo André dos Santos Lopes cb33a3a2c0 - Oops missed return. Also improved the readability of a test. 2011-09-27 11:43:07 +00:00
Gustavo André dos Santos Lopes 74cc4c8cc6 - Added tests and NEWS for r306475; see bug #55797.
- Removed now redundant previous overflow check, which relied on
  undefined behavior (wraparound) and was ignored in optimized builds.
2011-09-27 10:57:25 +00:00
Alan Knowles d25f2d4e06 document fix for #55475 in NEWS 2011-09-27 09:35:50 +00:00
Antony Dovgal c0edddbebd fix bug #55768 (PDO_OCI can't resume Oracle session after it's been killed) 2011-09-27 09:12:13 +00:00
Alan Knowles 0db9b9b141 remove paths from is_a and is_subclass tests 2011-09-27 07:59:47 +00:00
Ferenc Kovacs 3945c4f9a6 split the ext/calendar/tests/bug53574.phpt into two test, as we expect different result on 32 and 64 bit 2011-09-27 00:53:41 +00:00
Alan Knowles 60093a0ca5 fix is_a errror test so they test correctly against new behaviour of is_a and is_subclass_of 2011-09-27 00:42:56 +00:00
Alan Knowles 779ca152bf move autoloaded is_a test to where all the other is_a tests are 2011-09-27 00:19:43 +00:00
Ferenc Kovacs b2f1ae9673 fix #49599, the eol-style is important here, as this is a regression test for #36459 2011-09-26 23:28:24 +00:00
Gustavo André dos Santos Lopes 43f215a463 - Fixed bug in SdnToGregorian (see comments on #53574, though that bug is about
another function). NEWS & tests tomorrow.
2011-09-26 22:38:21 +00:00
Christopher Jones 5ad03cd41a MFH to fix PHP_5_3 diffs shown on http://qa.php.net/reports/?version=5.3.9-dev 2011-09-26 20:31:11 +00:00
Christopher Jones fe6bd56020 Use TZ similar to easter_date.phpt else gcov et al give a diff for unixtojd(1000000000) 2011-09-26 19:13:06 +00:00
Derick Rethans 56c96790bb - Updated to version 2011.11 (2011k) 2011-09-26 17:23:00 +00:00
Pierre Joye 0f78629c28 - update news 2011-09-26 08:56:56 +00:00
Pierre Joye aeee365d72 - be sure to check if the var ha not been removed between the two calls 2011-09-26 08:49:28 +00:00
Pierre Joye 3e0e2820b8 - Fix bug #55622, better fix for this issue, old fix can break if sizeof(size_t) > sizeof(int) like on sparc 2011-09-26 08:36:33 +00:00
Johannes Schlüter a7410ea03d - Fix folding 2011-09-25 13:06:09 +00:00
Johannes Schlüter 127d7bc79e - Fix bug #55776 (PDORow to session bug) 2011-09-25 12:39:05 +00:00
Rui Hirokawa 3d888412da MFH: fixed #40685: removed '&' in mb_decode_numericentity(). 2011-09-24 02:20:38 +00:00
Alan Knowles d296cea9f1 clean up is_a test title 2011-09-24 01:34:46 +00:00
Alan Knowles 55573c1418 clean up is_a test, so that it covers more use cases - negative and positive testing 2011-09-24 01:29:48 +00:00
Alan Knowles dbc999c6e1 add is_a and is_subclass_of test with autoloader feature
Its a bit of an overkill, but should ensure breaks are easier to spot in future.
2011-09-24 01:18:29 +00:00
Rasmus Lerdorf 92f68921cf Re-committing Alan's is_a revert/fix for bug #55475
Dmitry had done so earlier, but reverted pending discussion.
It is completely clear that this should never have been changed in the
5.3 branch in the first place giving the number of things that broke
because of it.
2011-09-23 09:52:09 +00:00
Ferenc Kovacs ce68c06ece the TZ environment variable also needed to be set here, didn't dug up why date.timezone isn't sufficient 2011-09-22 22:29:28 +00:00
Ferenc Kovacs d26af683c9 skip the interbase tests if cannot connect to the server 2011-09-22 22:07:02 +00:00
Ferenc Kovacs f3af205bcb the julian date for timestamp 1000000000 is 2452161.5740741, which is rounded to 2452162 2011-09-22 21:50:45 +00:00
Ferenc Kovacs ee0ecceb80 it seems that easter_date doesn't use the date.timezone but the TZ environment variable, so it passing the return value of easter_date() to date() which uses the date.timezone will create wrong result. 2011-09-22 20:59:10 +00:00
Johannes Schlüter bb10815f7e - Fix folding 2011-09-19 12:31:06 +00:00
Xinchen Hui 2ec2b9e9f9 Update NEWS 2011-09-17 03:23:38 +00:00
Xinchen Hui 08201e11fe Fix Bug #55703(PHP crash when calling mysqli_fetch_fields)
Since the catalog values always is "def" now, see http://dev.mysql.com/doc/refman/5.0/en/c-api-data-structures.html
2011-09-17 03:12:23 +00:00
Felipe Pena 1ec077e060 - Fixed bug #55707 (undefined reference to `__sync_fetch_and_add_4' on Linux parisc) 2011-09-17 00:05:31 +00:00
Felipe Pena 3d34acbb5f - Fixed bug #55231 (Unsatisfied symbols __sync_fetch_and_add_4) 2011-09-17 00:01:45 +00:00
Christopher Jones bf9933573a Test portability fix 2011-09-16 19:56:32 +00:00
Pierrick Charron ee534ac62f Fixed test bug #55713 (Christopher Jones) 2011-09-16 18:29:22 +00:00
Hannes Magnusson 5382f03c9f bfn 2011-09-16 07:43:32 +00:00
Christopher Jones ef83bd744c Fix skipif for non zlib builds re message http://lxr.php.net/opengrok/xref/PHP_TRUNK/ext/phar/phar_object.c#351 2011-09-15 17:23:29 +00:00
Dmitry Stogov 77bda2614d Fixed bug #50982 (incorrect assumption of PAGE_SIZE size) 2011-09-15 11:30:17 +00:00
Dmitry Stogov 59ad27b0aa Reverted the fix for #55475 (is_a() triggers autoloader) before the common decision 2011-09-15 10:59:39 +00:00
Dmitry Stogov e98759eecf Fixed bug #55475 (is_a() triggers autoloader). (alan at akbkhome dot com) 2011-09-15 09:58:33 +00:00
Pierre Joye 9457ed351c - force LF 2011-09-15 09:15:07 +00:00
Gustavo André dos Santos Lopes da4a27333d - ext/openssl/tests/bug36732.phpt more portable. 2011-09-14 10:55:46 +00:00
Xinchen Hui 29bba1fd42 Fix test, Make warning message bison independed 2011-09-14 08:49:29 +00:00
Xinchen Hui 1acb5b2b0c Fix warning "implicit declaration of function `vasprintf'" 2011-09-14 02:19:22 +00:00
Ferenc Kovacs 6f39604ff3 I don't see why would be this a win only test. it works for me on linux, checked the history, find no explanation. 2011-09-13 21:06:06 +00:00
Pierre Joye 4fffbad733 - skip on win, runtime TZ via putenv is not supported with ext/date 2011-09-13 13:58:03 +00:00
Pierre Joye 14300717d8 - skip on win, runtime TZ via putenv is not supported with ext/date 2011-09-13 13:51:47 +00:00
Pierre Joye 65be07be67 - TZ auto detection varies, not always UTC 2011-09-13 13:42:03 +00:00
Pierre Joye 98171e881b - TZ auto detection varies, not always UTC 2011-09-13 13:39:49 +00:00
Pierre Joye 09507f0ba4 - fix test 2011-09-13 13:27:20 +00:00
Pierre Joye ec820e1454 - skip on win, runtime TZ via putenv is not supported with ext/date 2011-09-13 13:26:48 +00:00
Xinchen Hui 4c7cd475dc MFH, fix test 2011-09-13 13:20:09 +00:00
Xinchen Hui 71c9674e1c Fix test (gzdecode not valid in 5.3 branch, maybe need add ? ) 2011-09-13 13:18:57 +00:00
Xinchen Hui 07a2b4817f update news 2011-09-13 13:11:42 +00:00
Xinchen Hui 3331bfb604 MFH, fix test 2011-09-13 13:02:57 +00:00
Xinchen Hui 1bbda643f2 Fixed Bug #55674 (fgetcsv & str_getcsv skip empty fields in some tab-separated records) which was introduced by r311543 2011-09-13 12:44:13 +00:00
Pierre Joye 8815e14451 - fix test on win, putenv is not supported for TZ and ext/date 2011-09-13 12:04:57 +00:00
Dmitry Stogov 68365b6d32 sort changelog according to bug number 2011-09-13 07:08:36 +00:00
Dmitry Stogov 12c3dc1b00 Fixed Bug #55649 (Undefined function Bug()). (Laruence) 2011-09-13 07:07:06 +00:00
Dmitry Stogov 12864e4769 Fixed bug #55509 (segfault on x86_64 using more than 2G memory). (Laruence) 2011-09-13 07:01:46 +00:00
Pierre Joye 08a25c405e - skip on win, strftime uses system TZ 2011-09-12 23:31:22 +00:00
Hannes Magnusson f19a112185 Test for non-string replacement, bug#54304 2011-09-12 17:20:44 +00:00
Ilia Alshanetsky 2ef05a8fa4 Fixed bug #55273 (base64_decode() with strict rejects whitespace after pad) 2011-09-12 17:20:24 +00:00
Derick Rethans 5236225cb2 - Updated to version 2011.10 (2011j) 2011-09-12 15:49:12 +00:00
Ulf Wendel b509ba6dbd This should please gcov.php.net which hits error 1044 instead of 1049. 2011-09-12 15:05:10 +00:00
Tjerk Anne Meesters e29302576c Reverted changes in connect.inc based on Ulf's feedback
- Moved the ini_set() entries into a separate script 'setupdefault.inc'
- Let mysql_affected_rows and mysql_insert_id test cases use the newly created script

With the ini_set() statements inside connect.inc, some test cases would be forced to 'undo' them in order to test other scenarios.

Tested on all three dev lines with and without passing db credentials. No changes detected.
2011-09-12 14:35:45 +00:00
Ulf Wendel 019e96a7f6 Fix typo. 2011-09-12 13:55:28 +00:00
Popa Adrian Marius f86bd3407b fix gcov Warning: ibase_drop_db(): lock time-out on wait transaction object 2011-09-12 13:43:42 +00:00
Ulf Wendel 27c73aa542 Minor issue. Seems to fail the same way on various PHP + MySQL combinations. Setting XFAIL until we fix it. 2011-09-12 13:39:57 +00:00
Hannes Magnusson 75c4d6f888 Allow replacement to be any scalar value 2011-09-12 13:21:57 +00:00
Ulf Wendel c4de2c8654 Hits libmysql/MySQL bug, works with mysqlnd 2011-09-12 13:14:16 +00:00
Pierre Joye 43d20bca91 - revert incorrect fix introduced in r316528 2011-09-12 12:59:52 +00:00
Ulf Wendel 496d6d45e9 Those will fail with MySQL 5.5. Running them because they have unveiled a crash, which has been fixed already. Setting to XFAIL, need to be decide if and/or how the functionality shall be supported. 2011-09-12 12:14:56 +00:00
Hannes Magnusson 5e661cf904 Ensure we are working with strings here 2011-09-12 11:44:55 +00:00
Popa Adrian Marius ddac8c1789 fix test 006 for firebird driver 2011-09-12 09:56:45 +00:00
Hannes Magnusson 0a90ea4dcd curl news 2011-09-12 09:23:29 +00:00
Pierre Joye e3aaeaa857 - force LF 2011-09-12 09:16:19 +00:00
Hannes Magnusson e43c21e53a Fixed issues when streams were closed before curl read/write from them, or cleaning
Closing a original handle after copying it now no longer cleans up all resources (fixes missing CURLOPT_POSTFIELDS values among others)
2011-09-12 09:16:04 +00:00
Ulf Wendel 8ed1dc2fa9 Bug #55653 2011-09-09 12:12:08 +00:00
Hannes Magnusson 0cac42b482 Being smart and cleanup/rename/modify tests seconds before committing isn't very smart. 2011-09-09 08:28:57 +00:00
Hannes Magnusson 23010d52ad Merge tests from trunk 2011-09-09 08:14:04 +00:00
Pierre Joye 260df5e802 - force LF 2011-09-09 08:11:43 +00:00
Christopher Jones 4840a4a28b Update SKIPIFs for test portability 2011-09-08 20:13:32 +00:00
Christopher Jones e77138f7ae Fix skipifs 2011-09-08 17:52:45 +00:00
Christopher Jones 1c809df001 Fix skipifs to match other tests for the case when connection fails 2011-09-08 17:40:15 +00:00
Hannes Magnusson 33bee161f6 Fixed bug#54798 Segfault when CURLOPT_STDERR file pointer is closed before calling curl_exec 2011-09-08 14:37:18 +00:00
Ferenc Kovacs e1357bdbd1 skip these tests if can't connect to mysql 2011-09-08 11:30:58 +00:00
Pierre Joye 26255062b1 - force LF and fix... and blame me for not reading the code correctly, zlib tests pass now, linux/bsd/win 100% 2011-09-08 10:20:38 +00:00
Pierre Joye f81a30961e - force LF 2011-09-08 10:15:10 +00:00
Pierre Joye 255913f5f4 - skip if no hash 2011-09-08 10:00:47 +00:00
Hannes Magnusson 41db75ccbe Fix the path to the .pem 2011-09-08 09:27:47 +00:00
Christopher Jones 19d13e2521 Use unique object names to reduce potential clashes when testing in parallel 2011-09-07 19:19:00 +00:00
Rasmus Lerdorf d8a0b1a9e3 This test was added to verify that bug 39322 was fixed, which the test
does test for and this works. However, it consistently failed because
it relied on a SIGHUP not terminating a sh -c /usr/bin/nohup sleep 50
process which doesn't work because the SIGHUP goes to the sh process
not the nohup'ed sleep process. So, I have sped up the test and removed
the nohup and instead of trying to SIGHUP I am just doing the equivalent
of a kill 0 on it to verify that the resource sticks around.
2011-09-07 18:09:34 +00:00
Hannes Magnusson 797a1ce88f Fixed bug #55504 (Content-Type header is not parsed correctly on HTTP POST request 2011-09-07 16:19:09 +00:00
Hannes Magnusson 565cf8b76a Fix errormessage 2011-09-07 13:47:31 +00:00
Hannes Magnusson 5d8a5ed33d Add skip message 2011-09-07 12:06:21 +00:00
Hannes Magnusson a6c07ae0d3 Fix cleanup routines 2011-09-07 12:05:19 +00:00
Pierre Joye 618d638898 - skip on win, diff TZ format 2011-09-07 11:26:59 +00:00
Hannes Magnusson 631055c459 Update skipif 2011-09-07 10:39:55 +00:00
Hannes Magnusson c038ac2251 Sync tests between branches and fix the getcontent test 2011-09-07 10:38:53 +00:00
Hannes Magnusson d80adbcc93 Update skipif message 2011-09-07 10:34:58 +00:00
Pierre Joye 4426bfee51 - force LF (svn prop and config) 2011-09-07 10:14:18 +00:00
Pierre Joye bd858f3b3c - force LF 2011-09-07 09:41:54 +00:00
Pierre Joye 08d015d1db - force LF 2011-09-07 09:37:56 +00:00
Pierre Joye 34eebd4f58 - fix test for OS where dir sep is \ 2011-09-07 09:19:28 +00:00
Pierre Joye 8fca015947 - fix test for OS where dir sep is \ 2011-09-07 09:03:07 +00:00
Pierre Joye cb621bf1a0 - force LF 2011-09-07 08:41:59 +00:00
Pierre Joye 5687180f61 - force LF 2011-09-07 08:18:20 +00:00
Pierre Joye 1a166b2100 - add skipif for dom 2011-09-07 08:12:08 +00:00
Pierre Joye 4bb816605a - force LF 2011-09-07 08:01:19 +00:00
Pierre Joye 8affe814ed - force LF 2011-09-07 07:51:37 +00:00
Xinchen Hui 16d0023daf fix skipif description 2011-09-07 00:59:10 +00:00
Xinchen Hui 0f672ac0ba fixed typo 2011-09-07 00:56:52 +00:00
Andrey Hristov fd4fc39dc9 Fix problems with the unbuffered set detection, for libmysql, which resulted
in always true. Thanks Stas.
2011-09-06 19:52:19 +00:00
Pierre Joye c74679be0a - fix #55622, mem corruption on large input 2011-09-06 17:41:08 +00:00
Ulf Wendel 58e167974c Fixing SKIPIF 2011-09-06 16:39:55 +00:00
Johannes Schlüter 9554e24547 - Fix bug #55609 (mysqlnd cannot be built shared)
# This adds an option --enable-mysqlnd to explicitly built mysqlnd, like any
# other extension it can be used with =shared to build mysqlnd shared;
# mysqlnd will implicitly enabled when requested from another extension
2011-09-06 16:38:22 +00:00
Ulf Wendel 1ffe46c020 Fixing SKIPIF 2011-09-06 16:37:45 +00:00
Ulf Wendel 78b2f1c488 Fixing SKIPIF fatal error. 6.0 is history, thus SKIPIF might need further updates? 2011-09-06 16:30:53 +00:00
Ulf Wendel cc24c30307 More parenthesis, credits to Nikita Popov 2011-09-06 16:13:03 +00:00
Pierre Joye 8e330affd6 - useless skipif 2011-09-06 15:49:28 +00:00
Pierre Joye f6bdb6ff61 - fix skipif 2011-09-06 15:40:12 +00:00
Ulf Wendel 661a69b873 BORK hunting - Fixing SKIPIF 2011-09-06 14:47:57 +00:00
Ulf Wendel e21ea5e7ce Fix SKIPIF 2011-09-06 13:57:03 +00:00
Ulf Wendel 79b605a89b Fix SKIPIF 2011-09-06 13:50:45 +00:00
Ulf Wendel 85e6b8141d Prevent Notice 2011-09-06 13:39:46 +00:00
Ulf Wendel 64cca9fb95 Reverting to proper --INI-- section usage. Improve SKIPIF to skip test if open_basedir setting is too restrictive during test run for whatever reason. 2011-09-06 12:58:01 +00:00
Pierre Joye 1e30a4ecb0 - use only zlib function and reported the failure with base64 in #55620 2011-09-06 12:30:17 +00:00
Pierre Joye 23006f5089 - force LF 2011-09-06 12:24:16 +00:00
Florian Anderiasch c5741472b0 MFH: Fixed ext/sockets/tests/socket_strerror.phpt
So it seems a missing ) killed the test.
2011-09-06 11:15:23 +00:00
Xinchen Hui 1159cd2002 move it to right place 2011-09-06 09:45:21 +00:00
Xinchen Hui df2504b0ff Add skipif 2011-09-06 09:29:04 +00:00
Pierre Joye 423816ef64 - move it to the right place 2011-09-06 09:23:10 +00:00
Xinchen Hui 3d107d07ee Added skipif 2011-09-06 09:22:06 +00:00
Pierre Joye f15401086b - fix skipif msg 2011-09-06 09:20:14 +00:00
Xinchen Hui 30d1410817 Added skipif 2011-09-06 09:19:46 +00:00
Xinchen Hui 3901f5abb8 Added skipif 2011-09-06 09:17:12 +00:00
Xinchen Hui 13eb205d6c add skipif 2011-09-06 08:11:37 +00:00
Pierre Joye 84954e1869 - add skipif 2011-09-06 07:49:31 +00:00
Pierre Joye 09e3a1c2de - fix test 2011-09-06 07:47:20 +00:00
Pierre Joye e240c51632 - skip on win 2011-09-06 07:32:37 +00:00
Pierre Joye b660f32dab - add skipif 2011-09-06 07:29:59 +00:00
Pierre Joye 9fa90f8a90 - add skipif 2011-09-06 07:28:38 +00:00
Pierre Joye f438a87d90 - use something we know it exists... 2011-09-06 07:26:05 +00:00
Pierre Joye c97a56e77f - skip on win, name.. name. are not valid names 2011-09-06 07:23:20 +00:00
Pierre Joye 9d33b167af - add skipif 2011-09-06 07:09:56 +00:00
Pierre Joye 24f71e30cb - force LF 2011-09-06 07:03:48 +00:00
Pierre Joye 7bdb10f479 - force LF 2011-09-06 07:00:05 +00:00
Pierre Joye 9a6b6f3dc7 - add skipif 2011-09-06 06:57:53 +00:00
Pierre Joye 8f7fab9358 - add skipif 2011-09-06 06:52:26 +00:00
Pierre Joye 0295d0d1aa - add skipif 2011-09-06 06:50:56 +00:00
Pierre Joye 17f78b92c4 - add skipif 2011-09-06 06:47:12 +00:00
Pierre Joye 8ab88f2e72 - add skipif 2011-09-06 06:44:59 +00:00
Pierre Joye 7e9bc5f70b - add skipif 2011-09-05 19:59:42 +00:00
Ulf Wendel d6e15cc517 No more test failure for libmysql, http://news.php.net/php.internals/55210 2011-09-05 16:24:40 +00:00
Andrey Hristov 3a510c616d missing from previous commit for #55582 2011-09-05 15:37:58 +00:00
Andrey Hristov 13c5106f43 Fix for Bug #55582 mysqli_num_rows() returns always 0 for unbuffered, when mysqlnd is used 2011-09-05 15:29:45 +00:00
Shein Alexey 491df98386 Reduced timeout in this test to 1ms, no need to wait further. 2011-09-05 14:43:08 +00:00
Pierre Joye 5d62cd1530 - add skipif 2011-09-05 13:52:24 +00:00
Pierre Joye 07fae45eb7 - add skipif 2011-09-05 13:41:01 +00:00
Pierre Joye af203fc7c4 - close the stream before removing the file (win and other system may lock it) and use test dir for tmp data 2011-09-05 13:31:13 +00:00
Pierre Joye 3c3fa89bf5 - stupid me. 2011-09-05 13:06:51 +00:00
Pierre Joye 60a0348ccc - disable on win 2011-09-05 13:05:28 +00:00
Pierre Joye 8acede547d - disable on win 2011-09-05 13:04:12 +00:00
Pierre Joye df4515dec8 - other hostname can be defined or returned first 2011-09-05 12:34:55 +00:00
Hannes Magnusson ddb7740944 typo 2011-09-05 12:00:24 +00:00
Pierre Joye 4a99471b07 - force LF 2011-09-05 11:46:05 +00:00
Hannes Magnusson c6f9556f37 Fix the test in 5.4 and trunk.
older libraries will emmit error here, while new won't. So lets just suppress it rather then making the test uselessly fail for random people.
2011-09-05 11:07:38 +00:00
Pierre Joye a65e04be53 - not used anymore, one version to rule them all 2011-09-05 11:00:52 +00:00
Shein Alexey fae3000d44 Make the test faster, what was done:
1) replaced multiple htmlentities calls with one call to get_html_translation table since they share the same code internally
2) reduced the upper range of the "for" loop to 0x2710 (10000), according to http://www.w3.org/TR/html4/sgml/entities.html it's enough
3) placed additional check to make sure all entities from get_html_translation_table were checked in the test
2011-09-05 11:00:14 +00:00
Pierre Joye 4b17810a7a - force LF and enable it on windows now 2011-09-05 10:59:26 +00:00
Hannes Magnusson a1ecf8c887 Fix test to use microtime() as time() doesn't always catchup fast enough :] 2011-09-05 10:55:07 +00:00
Pierre Joye 25b4dfdc51 - force LF 2011-09-05 10:52:01 +00:00
Hannes Magnusson cd8f903d7e Fix test, one skipif is enough 2011-09-05 10:30:41 +00:00
Stanislav Malyshev cc9483f19e fix tests 2011-09-05 00:49:03 +00:00
Gustavo André dos Santos Lopes dbe8c7c4fa - Fixed bad xor in signed types due to integer promotion.
- Replaced undefined signed overflow with char -> unsigned char conversion.
2011-09-05 00:39:39 +00:00
Gustavo André dos Santos Lopes cc45ce4586 - Fixed bug #55576: Cannot conditionally move uploaded file without race
condition.
2011-09-04 23:00:47 +00:00
Gustavo André dos Santos Lopes 08f78070a5 - Fixed borked refactoring in r307437 (using SUCCESS/FAILURE return instead of
out parameter).
- Fixed signature of php_stream_copy_to_stream_ex to return int in 5.4/trunk
  instead of size_t, as the function only returns SUCCESS/FAILURE.
2011-09-04 22:36:33 +00:00
Pierre Joye d7be9cf675 - add skipif 2011-09-04 22:21:58 +00:00
Pierre Joye fdb22b418d - force LF eol 2011-09-04 22:12:42 +00:00
Pierre Joye c70b78c445 - skip on win, TZ cannot be set using putenv at runtime 2011-09-04 22:04:42 +00:00
Pierre Joye c3380e42c8 - skip on win, TZs differ with strftime 2011-09-04 21:59:27 +00:00
Pierre Joye 8d0096e2d9 - unify warning between win and unix and enable test 2011-09-04 21:48:22 +00:00
Pierre Joye 9ef72e259b - fix test on win, does not use putenv to set the TZ but date_default_timezone_set (should be the case on all platforms actually...) 2011-09-04 21:40:22 +00:00
Pierre Joye e0792c2590 - wrong variable used (ended as non initiazed usage) 2011-09-04 16:33:51 +00:00
Tjerk Anne Meesters 7170a996c5 Patch to run two more mysql test cases that would usually be skipped.
Replaced skipifdefaultconnectionfailure.inc by three additional ini_set() statements in connect.inc for the default connection settings

Patch also includes a typo in connect.inc concerning mysql.default_socket
2011-09-04 14:21:27 +00:00
Ferenc Kovacs 1313220640 These regexes don't fail under the new backtrack limit, so lower it just for the test to check the failure. 2011-09-04 13:27:19 +00:00
Christopher Jones 43e4d8cade gcov test fixes 2011-09-02 22:19:03 +00:00
Ferenc Kovacs c6d59bd2fa pass an absolute path for the php binary to proc_open, without this the test would fail if ran with a relative TEST_DEV_EXECUTABLE 2011-09-02 20:28:39 +00:00
Shein Alexey 920fa567bd Removed old (< 5.3) version of test and cleaned up the actual version. 2011-09-02 17:41:39 +00:00
Andrey Hristov ab99790eca Fix for Bug #54158 MYSQLND + PDO MySQL requires #define MYSQL_OPT_LOCAL_INFILE
and a bunch of other small preprocessor fixes
2011-09-02 13:53:41 +00:00
Ulf Wendel b23baaf0fc Coverage for bug#54704, of which I think it is bogus, thus no dedicated test. 2011-09-02 13:35:17 +00:00
Andrey Hristov 0c4e2acbe3 here comes the news 2011-09-02 13:24:05 +00:00
Andrey Hristov e35e394a79 fix message 2011-09-02 12:59:32 +00:00
Andrey Hristov d96e924b25 function rename to comply with the schema of other callbacks 2011-09-02 11:22:41 +00:00
Ulf Wendel 864f8106be Hopefully, this is an even better way to check for InnoDB support as of MySQL 5.6.1 2011-09-02 11:06:51 +00:00
Ulf Wendel 248a9a7f4d As of MySQL 5.6.1 the server variable have_innodb is no more. Updating InnoDB check... 2011-09-02 10:38:51 +00:00
Ulf Wendel 65a3b6e0bb MySQL 5.6 update 2011-09-02 09:27:23 +00:00
Ferenc Kovacs fbb4b70bad revert to the previous good revision, as the new improved parse error syntax only used in version >= 5.4 2011-09-01 22:45:18 +00:00
Ferenc Kovacs 9bb94d26f8 revert to the previous good revision, as the new improved parse error syntax only used in version >= 5.4 2011-09-01 22:42:35 +00:00
Ulf Wendel ec4eb7ab17 Check for LOAD DATA support during SKIPIF 2011-09-01 16:35:13 +00:00
Ulf Wendel 286d8afda9 Fixing error handling. Skip if load data is not allowed 2011-09-01 15:45:47 +00:00
Ulf Wendel afb0cce4c9 Can't reproduce the server has gone away messages, Andrey. Please, have a look. I tried MySQL 5.1, 5.5 and 5.6. 2011-09-01 15:25:15 +00:00
Johannes Schlüter e58f72b6a3 Improve speed of finding tests (no more CVS, we're on svn now) 2011-09-01 14:52:55 +00:00
Ulf Wendel 46910fd722 Fix test. First element within the parantheses is a SQL status code. Should please gcov 2011-09-01 14:04:52 +00:00
Christian Stocker e1813b69c5 Merge from Trunk
simplexml->query returns empty array if no nodes were found
and false if libxml thinks the xpath-expression was invalid.
Behaves now the same like DomXPath and fixes Bug #48601
Adjusted a test to reflect that change
2011-09-01 13:42:45 +00:00
Ulf Wendel 3c15d50c80 Fixing tests debug output 2011-09-01 13:37:49 +00:00
Pierre Joye f079dffe07 - use %s, bad c/p 2011-09-01 13:28:12 +00:00
Ulf Wendel 3eb3eb406e Check if MySQL server supports SSL and, if using mysqlnd, check if PHP streams will support SSL 2011-09-01 13:17:16 +00:00
Hannes Magnusson 958326c843 Move the XFAILED printout way up the list so we can actually notice the really failing ones 2011-09-01 13:06:12 +00:00
Pierre Joye 1f8c94b7e2 - win and nux work the same way 2011-09-01 12:42:54 +00:00
Pierre Joye ddf760eb60 - force LF eol style as this test depends on it 2011-09-01 12:35:41 +00:00
Ulf Wendel 80ec77df04 Simplify mysqlnd debug trace marginally for debugging 2011-09-01 11:48:18 +00:00
Pierre Joye 1cef55952f - consider that bison 2.x is used. updated our ci boxes accordingly (windows too), which were using 1.4 2011-09-01 11:40:37 +00:00
Pierre Joye d763969344 - consider that bison 2.x is used. updated our ci boxes accordingly (windows too), which were using 1.4 2011-09-01 11:40:23 +00:00
Ulf Wendel 04b6ce21d2 Hack around http://bugs.mysql.com/62320 2011-09-01 11:27:14 +00:00
Hannes Magnusson 2da2b54899 Seeing thousands of PASS tests flying by is meaningless.
Add an option to only print certain result groups.
2011-09-01 11:00:51 +00:00
Pierre Joye 53ee01975f - force LF eol style as this test depends on it 2011-09-01 09:33:43 +00:00
Matteo Beccati d66630f625 Fixed test randomly failing due to different error messages. Also added a skip
section in case "fakeURL" resolves to an IP address, as some empty error
messages and HTML can be seen in the reports
2011-09-01 00:45:56 +00:00
Johannes Schlüter 48c69c378a - Change PDO_oci connection defaults to match Oracle XE defaults, higher chance
to work out of the box
2011-08-31 23:42:04 +00:00
Pierre Joye 5d09938423 - error msg may vary (parser) 2011-08-31 23:12:35 +00:00
Matteo Beccati 953b10c59c Fixed test. Apparently it was already fixed on PHP_5_3 98% of the cases and
the fix wasn't ported to trunk/PHP_5_4. However the very same test was failing
on my FreeBSD 6.2 box, that appears to also decode the "ks_c_5601-1987" parts,
so I've made the test more generic.
2011-08-31 22:38:20 +00:00
Matteo Beccati f4e100e47f Fixed false positive failure on gcov 2011-08-31 22:12:53 +00:00
Pierre Joye 96abb9d611 - error msg may vary (parser) 2011-08-31 20:16:11 +00:00
Pierre Joye df3cb6f2a0 - error msg may vary (parser) 2011-08-31 20:14:13 +00:00
Pierre Joye 8b76f0f0d3 - error msg may vary 2011-08-31 20:10:22 +00:00
Pierre Joye 38eec652ce - typo 2011-08-31 20:07:44 +00:00
Tjerk Anne Meesters 323ee1fe4c Fixed expect format to ignore the textual error message from readlink().
Bug #55555
2011-08-31 18:26:23 +00:00
Andrey Hristov fa8a1c387a Fix valgrind error (sending of initialized bytes over the network).
When the compression was successful the compressed data + uninitialized data
at the end was sent to the server, because the length of the compressed payload
wasn't correctly calculated (actually the length of the uncompressed payload as assumed).
However, the uncompress() function has internally the length of the real payload and skips
the binary trash at the end - thus no data damage occurs!
2011-08-31 18:18:23 +00:00
Johannes Schlüter c25f0424c8 - Update PDO_mysql error mapping 2011-08-31 15:46:07 +00:00
Pierre Joye 6612bb1073 - force LF eol style as this test depends on it 2011-08-31 15:44:01 +00:00
Pierre Joye 5fcfc528c5 - force LF eol style as this test depends on it 2011-08-31 15:42:42 +00:00
Johannes Schlüter 262cc2f37a - Be less restrictive on the SQL state, some server versions might fool us 2011-08-31 15:25:18 +00:00
Ulf Wendel c05bfdf490 Please, whenever changing the mysqli API update the tests. Don't wait for me to catch up. 2011-08-31 13:59:28 +00:00
Ulf Wendel a7500f1c81 New utility function to check for '[1148] The used command is not allowed with this MySQL version' during SKIPIF 2011-08-31 13:50:58 +00:00
Ulf Wendel 4c3115a011 Check if server supports LOAD DATA LOCAL INFILE to catch [1148] The used command is not allowed with this MySQL version during SKIPIF 2011-08-31 12:58:25 +00:00
Pierre Joye bb988ee300 - force LF eol style as this test depends on it (size) 2011-08-31 12:26:55 +00:00
Pierre Joye 8e679c2fcf - force LF eol style as this test depends on it (size) 2011-08-31 11:26:27 +00:00
Pierre Joye ae896ddce4 - force LF eol style as this test depends on it (size) 2011-08-31 11:25:09 +00:00
Johannes Schlüter 1cb8c01f0d - Fix Bug #55550 mysql.trace_mode miscounts result sets,
fixes ext/mysql/tests/mysql_deprecated_api.phpt
2011-08-31 11:11:08 +00:00
Pierre Joye 3d74cffc20 - use only the test name 2011-08-31 10:30:39 +00:00
Hannes Magnusson 84fc76e94c Remove annoying extra newline on XFAIL summaries
and sync text to trunk
2011-08-31 10:09:54 +00:00
Pierre Joye 9bedfa520b - force LF eol style as this test depends on it (size) 2011-08-31 10:08:55 +00:00
Pierre Joye 3853e85a79 - make it parser version independent 2011-08-31 10:05:54 +00:00
Christian Stocker bbecdf57d3 fix xsl tests 2011-08-31 09:16:04 +00:00
Pierre Joye d892a4299c - force LF eol style as this test depends on it (size) 2011-08-31 08:35:57 +00:00
Arpad Ray 73eac3e5a2 fix news entries 2011-08-30 14:01:35 +00:00
Matteo Beccati 18b8a3bcb7 Fixed a few false positives on gcov for ext/pgsql 2011-08-30 14:01:03 +00:00
Hannes Magnusson 850d865551 Add skipifs for bug#54971 (patch by datibbaw@) 2011-08-30 13:46:24 +00:00
Hannes Magnusson a84c667e0e Fixed bug#48476 2011-08-30 13:41:57 +00:00
Pierre Joye 63fa1fb1ca - ws 2011-08-30 05:44:37 +00:00
Arpad Ray 84adf49281 news entry for r66021 Log: 2011-08-29 21:45:42 +00:00
Arpad Ray a6a08dc322 Fixed bug #55366: keys lost when using substr_replace an array 2011-08-29 21:35:28 +00:00
Hannes Magnusson e481f05470 fixed bug #55267 - session_regenerate_id fails after header sent even if session.use_cookies = 0 2011-08-29 21:20:41 +00:00
Arpad Ray f117d56170 NEWS entry for fix #55510: $_FILES 'name' missing first character after upload 2011-08-29 21:15:04 +00:00
Arpad Ray 1e1bfba576 fix #55510: $_FILES 'name' missing first character after upload 2011-08-29 21:11:07 +00:00
Derick Rethans 9d504da334 - Updated to version 2011.9 (2011i) 2011-08-29 16:37:56 +00:00
Hannes Magnusson e723c7631c Fixed bug#53872 (internal corruption of phar) 2011-08-29 16:05:45 +00:00
Hannes Magnusson 269724ebcc Whopsy, this change in 5.4, not 5.3 2011-08-29 14:27:17 +00:00
Hannes Magnusson 9e20746611 Fixed bug#52013 (Unable to decompress files in a compressed phar) 2011-08-29 14:19:54 +00:00
Hannes Magnusson abbf8be0d6 The Phar class extends RecursiveDirectoryIterator, which has changed the way it ensures its ctor is called 2011-08-29 14:17:41 +00:00
Christian Stocker 5250f01d15 fix xsl date tests 2011-08-29 11:44:30 +00:00
Rasmus Lerdorf 8348d96656 The link error on an out-of-sync command doesn't start with 0
uwe/andrey please double-check
2011-08-29 06:47:07 +00:00
Rasmus Lerdorf 78a46b87e3 Fix another broken test. root can read 0200 files. 2011-08-29 06:19:40 +00:00
Andrey Hristov 9756f766b6 fix valgrind warnings in debug builds 2011-08-26 12:14:31 +00:00
Joey Smith ec5b65473b Revert my previous change - getting different results in different environments, shouldn't have committed it 2011-08-24 16:15:35 +00:00
Joey Smith 864774c5b2 Fix tests/lang/bug45392.phpt to log expected error when run with -n flag 2011-08-24 15:56:12 +00:00
Shein Alexey 6feb8cb74b Fixed failed test to take into account printed warnings like in 5.4 and trunk branches. 2011-08-24 12:25:30 +00:00
Xinchen Hui 344136e8e9 Apply r315270 to 5.3
Fixed test script failed when host mysql doesn't listen on 3306
Fxied test script failed due to mysql_pconnect trigger a warning
2011-08-24 08:00:23 +00:00
Christopher Jones 04b5bb7d3c Update log, marking 5.4 and trunk as XFAIL due to bug #55496 2011-08-23 20:59:10 +00:00
Uwe Schindler e04fe7986d Fix NEWS entries for ongoing 5.3.9 development 2011-08-23 17:03:19 +00:00
Daniel Convissor 7473a889ec Fix differences in some sub() results that were causing tests to fail. 2011-08-23 16:40:19 +00:00
Xinchen Hui 9fb62f3382 Sync r314808 to 5_3 branch
Eliminated compiler warnings "comparison is always false",  "cast to pointer from integer of different siz" and tail zero warnings
2011-08-23 10:18:48 +00:00
Hannes Magnusson 5f38ffb167 Sync -development with -production 2011-08-23 10:00:18 +00:00
Adam Harvey 8c007d8179 Fix bug #55483 (extra > at the end of html tag in phpinfo). 2011-08-23 06:07:24 +00:00
Pierrick Charron c27da034d0 Reapply the commit of revision 315259 on 5.3.9 2011-08-23 03:09:09 +00:00
Christopher Jones dbf744ad78 Sync date with actual PECL release date for correctness 2011-08-22 23:56:34 +00:00
Johannes Schlüter e4a83170c7 Fix year (we won't make 2001 anymore, I assume) 2011-08-22 23:34:05 +00:00
Johannes Schlüter 5f502879ff Back to -dev 2011-08-22 23:24:22 +00:00
Johannes Schlüter 952b9a9695 - PHP 5.3.8 2011-08-22 22:08:48 +00:00
Johannes Schlüter e63bf6e63e - Update NEWS 2011-08-22 21:37:57 +00:00
Johannes Schlüter 0d2a921916 - Revert r313616 (When we have a blocking SSL socket, respect the timeout
option, scottmac)

# This caused bug #55283, we should investigate a proper solution without
# breaking anything.
2011-08-22 21:32:04 +00:00
Daniel Convissor 4e2cd3ee63 Fix spring tests for dst/st transition second. 2011-08-22 14:47:12 +00:00
Pierrick Charron 18aac27b28 Revert commit 315259 as requested
# Will apply the patch on this branch after 5.3.8
2011-08-22 11:35:19 +00:00
Andrey Hristov 36c11fcaf3 Don't run the test on windows, Unix specific 2011-08-22 11:07:35 +00:00
Andrey Hristov 1da5b05dbd Fix Bug #55473 mysql_pconnect leaks file descriptors on reconnect
The fix is for now in 5_4 and trunk, to be merged into 5_3 after 5.3.8
is packaged (expected today). The test case goes to all branches
2011-08-22 10:42:43 +00:00
Pierrick Charron ef48624cd3 - Fixed bug #55156 (ReflectionClass::getDocComment() returns comment even though the class has none)
# Patch was not committed on the PHP5.3 branch
2011-08-22 01:11:22 +00:00
Rasmus Lerdorf 0bea1fea8f Debian/Ubuntu don't have any special CFLAGS listed here for
gssapi which shouldn't break the build.
2011-08-21 22:57:13 +00:00
Pierre Joye 408d0a0420 - merge two mysqli section 2011-08-21 14:31:11 +00:00
Stanislav Malyshev 81ad401604 Unbreak crypt() (fix bug #55439)
# If you want to remove static analyser messages, be my guest,
# but please run unit tests after
2011-08-19 22:49:18 +00:00
Pierre Joye 0d82e0c266 - Fixed bug #52461 (Incomplete doctype and missing xmlns) 2011-08-19 09:59:47 +00:00
Uwe Schindler 2c0ab6fc33 Bug #55403: Don't set $_SERVER['HTTPS'] on unsecure connection 2011-08-18 19:12:49 +00:00
Ilia Alshanetsky eb1470aa3f Back to dev 2011-08-17 14:28:24 +00:00
Ilia Alshanetsky 6e284c6ce7 5.3.7 2011-08-17 13:30:04 +00:00
Christopher Jones f2b8b4879d More test portability fixes mostly for gcov.php.net 2011-08-13 00:43:34 +00:00
Andrey Hristov aa480a4f4f prevent a crash if cs is NULL, which can happen with MS and lazy connections 2011-08-12 14:55:00 +00:00
Ulf Wendel d3d7da14e6 MySQL 5.6 fractional seconds and PS 2011-08-12 11:51:44 +00:00
Ulf Wendel 12954aa27d Andrey, please have a look. Not sure if the test is correct, e.g. MySQL 5.5.3+ really needed? 2011-08-12 11:23:36 +00:00
Ulf Wendel e0cc7032f1 Andrey, please have a look. This should not cause errors. 2011-08-12 11:23:16 +00:00
Rasmus Lerdorf 6051aa795c Fix bug number there 2011-08-11 19:20:53 +00:00
Ilia Alshanetsky d090061f5e Back to dev 2011-08-11 14:35:08 +00:00
Ilia Alshanetsky db472c60cf 5.3.7RC5 2011-08-11 13:02:49 +00:00
Ilia Alshanetsky cc93e8e51f Fixed bug #55399 (parse_url() incorrectly treats ':' as a valid path) 2011-08-11 13:01:52 +00:00
Pierre Joye beea66d595 - fix build (introduce by r314641) 2011-08-11 07:11:39 +00:00
Dmitry Stogov cea8df3af5 Fixed possible memory leak 2011-08-11 06:38:42 +00:00
Rasmus Lerdorf de90c602e1 Use HOST_NAME_MAX constant here instead for the gethostname() func 2011-08-10 17:40:56 +00:00
Ilia Alshanetsky 9fd373d8b6 Fix win32 build 2011-08-10 15:59:32 +00:00
Ilia Alshanetsky 4ef26e2379 Fixed memset usage (identified by coverity) 2011-08-10 15:30:07 +00:00
Andrey Hristov 56d6f23196 relax constraint 2011-08-10 14:12:24 +00:00
Dmitry Stogov 6ddfa33aad Fixed bug #55323 (SoapClient segmentation fault when XSD_TYPEKIND_EXTENSION contains itself) 2011-08-10 13:44:48 +00:00
Nuno Lopes 8f54a74d60 terminate timeouting processes with SIGKILL (9) 2011-08-09 21:53:44 +00:00
Scott MacVicar e34dc6c6f7 Fix building of pure C++ extensions as static 2011-08-09 18:12:06 +00:00
Ilia Alshanetsky 1488704098 Make static analyzers happy 2011-08-09 14:11:56 +00:00
Ilia Alshanetsky d091516c31 Minimize stack usage and added missing dtors 2011-08-09 13:10:57 +00:00
Xinchen Hui 409022b742 Fixed built (missing 2nd arg for strncpy) 2011-08-09 13:04:35 +00:00
Xinchen Hui 0630945ac4 Avoiding strcpy, strcat, sprintf usage to make static analyzer happy 2011-08-09 12:16:58 +00:00
Xinchen Hui 79aa564f8d Avoiding strcpy usage, Make static analyzer happy 2011-08-09 09:35:42 +00:00
Scott MacVicar 929e0f185c Update SQLite3 to the latest version 2011-08-09 07:31:34 +00:00
Xinchen Hui a60513240f Eliminated compiler's warnings and make static analyzer silent 2011-08-09 05:11:19 +00:00
Pierrick Charron 6290b8814c Remove unused variable 2011-08-09 02:42:25 +00:00
Pierrick Charron f6c2511748 Remove unused variable 2011-08-09 02:37:02 +00:00
Xinchen Hui fa161f96fa Remove unnecessary(no sense) memset and making the static analyzer silent 2011-08-08 16:57:46 +00:00
Etienne Kneuss baf2e822cc Fix typo 2011-08-08 14:54:50 +00:00
Ilia Alshanetsky e2e96913bf Deadcode & sizeof fix for issues found by coverity
(different patch for 5.4+ will follow shortly)
2011-08-08 12:29:32 +00:00
Ilia Alshanetsky 92d68c62af Make static analyzers happy 2011-08-08 12:10:27 +00:00
Pierrick Charron 19b6735d86 Fix typo 2011-08-08 11:30:56 +00:00
Pierrick Charron cbd4f7602e Use snprintf to make the static analyzers happy 2011-08-08 11:19:49 +00:00
Xinchen Hui 6c0c4896b3 Prevented the warning about truncate int to char 2011-08-08 07:12:12 +00:00
Pierrick Charron 08a499f142 Use snprintf and strncat to make the static analyzers happy 2011-08-08 03:08:59 +00:00
Xinchen Hui 44e2c266c3 Remove no sense statements 2011-08-08 00:47:40 +00:00
Ilia Alshanetsky 42f3972e61 Avoid strcpy() usage 2011-08-08 00:07:54 +00:00
Ilia Alshanetsky 34f08a3715 Fixes for variety of issues identified by coverity scan 2011-08-07 23:46:00 +00:00
Gwynne Raskind 04b575f409 possible use without init fixed 2011-08-07 18:12:52 +00:00
Gwynne Raskind f4f7a32121 Front- and back-port rev 314431 (missing php.h include) 2011-08-07 17:15:40 +00:00
Gwynne Raskind 159635f4f5 Back- and front-port fixes for #55019 2011-08-07 17:14:14 +00:00
Rasmus Lerdorf 37c18f5ebe Fix more signed 1-bit bitfield, and let's use strlcpy/strlcat instead for these
static string copies
2011-08-07 16:10:34 +00:00
Rasmus Lerdorf 2449c41698 Not an issue here, but a good habit to follow consistently. Never use strcpy/strcat. 2011-08-07 15:45:18 +00:00
Rasmus Lerdorf bcf8485ef5 Make static analyzers happy 2011-08-07 15:38:36 +00:00
Xinchen Hui 57ec3758b7 revert -r314422
No need to check erealloc's return
2011-08-07 14:25:30 +00:00
Xinchen Hui b2110c3eea Fixed bug that may dereferenced NULL pointer before checking 2011-08-07 13:19:04 +00:00
Xinchen Hui 4c2e6c1cf6 Initialize variable with fixed value for avoiding compile warnings 2011-08-07 11:13:27 +00:00
Pierrick Charron bfd10cfee9 function_name cannot be false 2011-08-07 06:19:43 +00:00
Pierrick Charron 029d7f4c6c class entry is never used 2011-08-07 06:04:11 +00:00
Pierrick Charron 757a32cd0c Pointer returned is never used 2011-08-07 05:46:31 +00:00
Rasmus Lerdorf f2bc53b88b Oops 2011-08-07 05:08:08 +00:00
Rasmus Lerdorf b61c50a004 These naked strcpy()s scare me 2011-08-07 00:18:38 +00:00
Rasmus Lerdorf 636c61c1d5 Not our issue, but fixing here for now and reporting upstream 2011-08-06 23:34:13 +00:00
Rasmus Lerdorf 14e1bc89bc Fix another Coverity warning by initializing this to NULL prior to the strtok_r call 2011-08-06 21:10:29 +00:00
Felipe Pena 997f323e3a - Added ZEND_MOD_END macro to use in the end of zend_module_dep[] 2011-08-06 14:47:44 +00:00
Felipe Pena 13eb47a8bc - Added missing PHP_FE_END/ZEND_FE_END 2011-08-06 01:22:27 +00:00
Felipe Pena edfa1988fc - Fixed bug #55313 (Number of retries not set when params specified)
patch by: kevin at kevinlocke dot name
2011-08-06 00:59:21 +00:00
Rasmus Lerdorf 741f41ff18 efree match_sets on an error here - found by Coverity 2011-08-05 22:39:40 +00:00
Rasmus Lerdorf 2b6a290d55 Another potential missing va_end() found by Coverity 2011-08-05 22:26:16 +00:00
Christopher Jones ae1baaa592 Improve test portabilty 2011-08-05 22:18:50 +00:00
Rasmus Lerdorf 0c2bbe47b2 Fix missing va_end() found by Coverity 2011-08-05 22:18:42 +00:00
Andrey Hristov 8a929d8942 Fix for bug #55283 SSL options set by mysqli_ssl_set ignored for MySQLi persistent connections 2011-08-05 13:39:30 +00:00
Felipe Pena 32319a142f - Added missing check (thanks neweracracker at gmail dot com) 2011-08-04 10:56:59 +00:00
Felipe Pena 8b27b6d559 - Fixed possible efree(NULL) (bug #55296) 2011-08-04 00:59:43 +00:00
Pierre Joye bb78412b07 - update libcurl to 7.21.7 2011-08-03 13:19:03 +00:00
Andrey Hristov 395ebb5c8b Remove a warning by explicitly compiling out a non-used variable 2011-08-02 15:30:58 +00:00
Andrey Hristov 4a7bf95c90 completely compile out a currently non-needed function 2011-08-02 14:18:56 +00:00
Andrey Hristov 66bba32627 compile out both parts of the code that are currently unused - fixes a compilation warning 2011-08-02 14:02:21 +00:00
Dmitry Stogov 0ea2ef125b Fixed bug #55339 (Segfault with allow_call_time_pass_reference = Off) 2011-08-02 07:38:23 +00:00
Dmitry Stogov b0e5d35202 Fixed bug #50816 (Using class constants in array definition fails). 2011-08-01 11:21:23 +00:00
Stanislav Malyshev 44add6d195 fix termination in sha-512 too 2011-07-31 23:14:04 +00:00
Stanislav Malyshev 6e246ad0d5 fix salt truncation bug in sha256 2011-07-31 21:47:03 +00:00
Pierre Joye caf6a6dc7a - blowfish 1.2 update, 2nd part 2011-07-31 20:50:09 +00:00
Pierre Joye 673fe19b39 - add test for blowfish 1.2 (Solar Designer) 2011-07-31 10:11:20 +00:00
Pierre Joye 363b56f261 - Fix #55301 (sybase part, take #2) check if malloc succeded 2011-07-28 21:16:51 +00:00
Ilia Alshanetsky 5b0373b060 back to dev 2011-07-28 11:54:53 +00:00
Ilia Alshanetsky d69796f23f 5.3.7RC4 2011-07-28 11:53:46 +00:00
Pierre Joye a3796f27fb - Fix #55301 (mssql part) check if malloc succeded 2011-07-28 11:01:04 +00:00
Pierre Joye c8a621b191 - Fix #55301 (sybase part) check if malloc succeded 2011-07-28 10:57:31 +00:00
Pierre Joye b3ccd26eb4 - Fix #55301 (url scanner part) check if malloc succeded 2011-07-28 10:52:45 +00:00
Pierre Joye d3fd31b6dd - Fix #55301 (readline part) check if malloc succeded 2011-07-28 10:42:45 +00:00
Pierre Joye 7ec6d3ae47 - Fix #55301 (interbase part) check if malloc succeded 2011-07-28 10:39:19 +00:00
Pierre Joye a20deb1607 - Fix #55301 (pdo_odbc part) check if malloc succeded 2011-07-28 10:37:04 +00:00
Pierre Joye 8535adfb31 - Fix #55301 (com_dotnet part) check if malloc succeded 2011-07-28 10:34:16 +00:00
Pierre Joye 42c4b86c88 - Fix #55301 (curl part) check if malloc succeded 2011-07-28 10:31:34 +00:00
Pierre Joye 0e3ec21e6f - Fix #55295, check if malloc failed 2011-07-27 14:23:06 +00:00
Andrey Hristov 94ccf70c77 longer error messages, don't cut them 2011-07-27 10:26:59 +00:00
Christopher Jones cf8bf9f2f0 Add explicit casts to remove some of Pierre's snapshot build warnings 2011-07-27 00:04:23 +00:00
Ulf Wendel e2ad8e9c1c Double check if line is sill usable and connected to last successfully selected db. 2011-07-26 16:14:59 +00:00
Ulf Wendel 823de19461 Check what happens if switching DB via API fails. Expected: no change of current DB/schema. 2011-07-26 15:37:59 +00:00
Ulf Wendel 61b2568310 Would be nice if tests get updated whenever a feature is added by the person adding the feature... 2011-07-26 09:33:01 +00:00
Ulf Wendel ac9708ccf2 Fix mysqlnd detection 2011-07-26 09:30:49 +00:00
Christopher Jones 987db5f747 Fix cast warning seen on some platforms 2011-07-25 23:40:57 +00:00
Felipe Pena 2df7afeb1c - Revert accidental change 2011-07-25 21:39:53 +00:00
Christopher Jones fc83d523b8 Patch r313663 and r313665 to allow PECL builds to work with earlier releases 2011-07-25 17:30:09 +00:00
Christopher Jones 99049e2fdd Update skipif 2011-07-25 17:22:48 +00:00
Felipe Pena a10e7fe11d - Use ZEND_FE_END macro here 2011-07-25 11:50:10 +00:00
Felipe Pena 23e438594d - Make usage of new PHP_FE_END macro 2011-07-25 11:42:53 +00:00
Felipe Pena 054e1cafa0 - Added new macro to be used in the end of zend_function_entry declaration (Gwynne) 2011-07-25 11:30:53 +00:00
Scott MacVicar 04c2df66a3 When we have a blocking SSL socket, respect the timeout option.
reading from SSL sockets could block indefinitely due to the lack
of timeout
2011-07-23 01:29:44 +00:00
Felipe Pena fcb9e4b2b3 - Disable __sync_fetch_and_add for HPUX for now, gcc seems not provide __sync_fetch_and_add_4 for all targets 2011-07-23 01:08:24 +00:00
Daniel Convissor 3c63a836cf Fix spelling error. 2011-07-21 19:56:54 +00:00
Daniel Convissor 22710d1c44 Have test for add/sub/diff one second during ST/DST transition in spring. 2011-07-21 15:35:06 +00:00
Pierre Joye 83b69f4034 - Fixed bug #55258 (Windows Version Detecting Error) (already fixed in trunk/5.4) 2011-07-21 14:49:55 +00:00
Ryan Biesemeyer 5dc5c26a5f removing openssl test for bug #55169 per Scott MacVicar's request; duplicate coverage of opensssl_random_pseudo_bytes.phpt 2011-07-20 21:25:39 +00:00
Ryan Biesemeyer 7acdad749c update test for bug #55169, fix skipif 2011-07-20 21:13:03 +00:00
Ryan Biesemeyer 74d6fe4f00 update test for bug #55169, don't require the extension in INI 2011-07-20 20:57:17 +00:00
Ryan Biesemeyer 292abd1240 tests for bug #55169 (mcrypt and openssl) 2011-07-20 18:59:05 +00:00
Daniel Convissor d31c5e8a4d Rename and enhance test for bug 55253 now that bugs web is up. 2011-07-20 18:24:14 +00:00
Scott MacVicar 946456425e openssl_encrypt() / openssl_decrypt() were flawed and truncated the key to the default size for the case of a variable key length cipher.
The result is a key of 448 bits being passed to the blowfish algorithm would be truncated to 128 bit.

Also fixed an error in the zend_parse_parameters() having an invalid character being used.
2011-07-19 22:15:56 +00:00
Felipe Pena c3c761ffeb - Fixed bug #55231 (Unsatisfied symbols __sync_fetch_and_add_4) 2011-07-19 22:12:13 +00:00
Popa Adrian Marius 23e564762a Fix for bug http://bugs.php.net/54426
Checks for NULL are wrong as the values can be provided by the triggers
2011-07-19 20:25:51 +00:00
Pierre Joye e825d1b579 - update libpng to 1.2.46 2011-07-19 10:22:42 +00:00
Pierre Joye 8280b0a710 - update blowfish to 1.2 (Solar Designer) 2011-07-18 21:26:29 +00:00
Jérôme Loyet 627540cc0b fix a segfault when passing an empty value to a ini parameter from the web server (php_(admin_)?value) 2011-07-18 21:03:44 +00:00
Pierre Joye 8d1012b2c3 - MFH: Fixed bug #54204 (Can't set a value with a PATH section in php.ini). 2011-07-18 21:00:59 +00:00
Jérôme Loyet 1d3696eecb remove forgotten debug log 2011-07-18 20:59:18 +00:00
Jérôme Loyet 577d81faa2 - get rid of FPM_AUTOCONFIG_H which has never existed since FPM integration into core 2011-07-17 23:33:22 +00:00
Stanislav Malyshev 9c2b6c7b58 Register warning change 2011-07-17 07:03:19 +00:00
Philip Olson 0b9be2918d Updated is_a() and is_subclass_of() tests as per the removed E_WARNING from r313162 which was inspired by discussion after r312904 and PHP Bug #53727 2011-07-15 19:17:22 +00:00
Ilia Alshanetsky 329449f799 Back to dev 2011-07-14 12:02:33 +00:00
827 changed files with 21498 additions and 7531 deletions

No files matched your search

+1 -1
View File
@@ -337,7 +337,7 @@ MAINTENANCE: Maintained
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: curl
PRIMARY MAINTAINER: Sterling Hughes <sterling@php.net>,Ilia Alshanetsky <iliaa@php.net>
PRIMARY MAINTAINER: Sterling Hughes <sterling@php.net>, Ilia Alshanetsky <iliaa@php.net>, Pierrick Charron <pierrick@php.net>
MAINTENANCE: Maintained
STATUS: Working
SINCE: 4.0.2
+374 -80
View File
@@ -1,67 +1,298 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
14 Jul 2011, PHP 5.3.7 RC3
22 Dec 2011, PHP 5.3.9RC4
- Core:
. Added max_input_vars directive to prevent attacks based on hash collisions
(Dmitry).
- OpenSSL:
. Fix segfault with older versions of OpenSSL. (Scott)
- Streams:
. Fixed bug #60455 (stream_get_line misbehaves if EOF is not detected together
with the last read). (Gustavo)
08 Dec 2011, PHP 5.3.9RC3
- Filter:
. Fixed Bug #55478 (FILTER_VALIDATE_EMAIL fails with internationalized
domain name addresses containing >1 -). (Ilia)
- cURL:
. Fixed bug #60439 (curl_copy_handle segfault when used with
CURLOPT_PROGRESSFUNCTION). (Pierrick)
- Date:
. Fixed bug #54851 (DateTime::createFromFormat() doesn't interpret "D").
(Derick)
. Fixed bug #53502 (strtotime with timezone memory leak). (Derick)
. Fixed bug #52062 (large timestamps with DateTime::getTimestamp and
DateTime::setTimestamp). (Derick)
. Fixed bug #51994 (date_parse_from_format is parsing invalid date using 'yz'
format). (Derick)
. Fixed bug #52113 (Seg fault while creating (by unserialization)
DatePeriod). (Derick)
- SOAP
. Fixed bug #54911 (Access to a undefined member in inherit SoapClient may
cause Segmentation Fault). (Dmitry)
24 Nov 2011, PHP 5.3.9RC2
- Core:
. Fixed bug #60138 (GC crash with referenced array in RecursiveArrayIterator)
(Dmitry).
. Fixed bug #60099 (__halt_compiler() works in braced namespaces). (Felipe)
. Fixed bug #55874 (GCC does not provide __sync_fetch_and_add on some archs).
(klightspeed at netspace dot net dot au)
. Fixed bug #52624 (tempnam() by-pass open_basedir with nonnexistent
directory). (Felipe)
. Fixed invalid free in call_user_method() function. (Felipe)
- Zend Engine:
. Fixed bug #43200 (Interface implementation / inheritence not possible in
abstract classes). (Felipe)
- PHP-FPM SAPI:
. Fixed bug #60179 (php_flag and php_value does not work properly). (fat)
. Enhance error log when the primary script can't be open. FR #60199. (fat)
. Added .phar to default authorized extensions. (fat)
- BCmath:
. Fixed bug #60377 (bcscale related crashes on 64bits platforms). (shm)
- Date:
. Fixed bug #60373 (Startup errors with log_errors on cause segfault).
(Derick)
. Fixed bug #60236 (TLA timezone dates are not converted properly from
timestamp). (Derick)
. Fixed bug #55253 (DateTime::add() and sub() result -1 hour on objects with
time zone type 2). (Derick)
- EXIF:
. Fixed bug #60150 (Integer overflow during the parsing of invalid exif
header). (Stas, flolechaud at gmail dot com)
- Fileinfo:
. Fixed possible memory leak in finfo_open(). (Felipe)
. Fixed memory leak when calling the Finfo constructor twice. (Felipe)
- Intl:
. Fixed bug #60192 (SegFault when Collator not constructed
properly). (Florian)
. Fixed memory leak in several Intl locale functions. (Felipe)
- Gd:
. Fixed bug #60160 (imagefill() doesn't work correctly
for small images). (Florian)
- Mbstring:
. Fixed possible crash in mb_ereg_search_init() using empty pattern. (Felipe)
- MS SQL:
. Fixed bug #60267 (Compile failure with freetds 0.91). (Felipe)
- OpenSSL:
. Fixed bug #60279 (Fixed NULL pointer dereference in
stream_socket_enable_crypto, case when ssl_handle of session_stream is not
initialized.) (shm)
- Oracle Database extension (OCI8):
. Fixed bug #59985 (show normal warning text for OCI_NO_DATA).
(Chris Jones)
- Phar:
. Fixed bug #60261 (NULL pointer dereference in phar). (Felipe)
. Fixed bug #60164 (Stubs of a specific length break phar_open_from_fp
scanning for __HALT_COMPILER). (Ralph Schindler)
- Postgres:
. Fixed bug #60244 (pg_fetch_* functions do not validate that row param
is >0). (Ilia)
- SOAP
. Fixed bug #48216 (PHP Fatal error: SOAP-ERROR: Parsing WSDL:
Extra content at the end of the doc, when server uses chunked transfer
encoding with spaces after chunk size). (Dmitry)
. Fixed bug #44686 (SOAP-ERROR: Parsing WSDL with references). (Dmitry)
- Tidy:
. Fixed bug #54682 (Tidy::diagnose() NULL pointer dereference).
(Maksymilian Arciemowicz, Felipe)
- Reflection:
. Fixed bug #60367 (Reflection and Late Static Binding). (Laruence)
03 Nov 2011, PHP 5.3.9RC1
- Core:
. Fixed bug #60139 (Anonymous functions create cycles not detected by the
GC). (Dmitry)
. Fixed bug #60120 (proc_open's streams may hang with stdin/out/err when
the data exceeds or is equal to 2048 bytes). (Pierre, Pascal Borreli)
. Fixed bug #60019 (Function time_nanosleep() is undefined on OS X). (Ilia)
. Fixed bug #55798 (serialize followed by unserialize with numeric object
prop. gives integer prop). (Gustavo)
. Fixed bug #55749 (TOCTOU issue in getenv() on Windows builds). (Pierre)
. Fixed bug #55707 (undefined reference to `__sync_fetch_and_add_4' on Linux
parisc). (Felipe)
. Fixed bug #55674 (fgetcsv & str_getcsv skip empty fields in some
tab-separated records). (Laruence)
. Fixed bug #55649 (Undefined function Bug()). (Laruence)
. Fixed bug #55622 (memory corruption in parse_ini_string). (Pierre)
. Fixed bug #55576 (Cannot conditionally move uploaded file without race
condition). (Gustavo)
. Fixed bug #55510: $_FILES 'name' missing first character after upload.
(Arpad)
. Fixed bug #55509 (segfault on x86_64 using more than 2G memory). (Laruence)
. Fixed bug #55504 (Content-Type header is not parsed correctly on
HTTP POST request). (Hannes)
. Fixed bug #55475 (is_a() triggers autoloader, new optional 3rd argument to
is_a and is_subclass_of). (alan_k)
. Fixed bug #52461 (Incomplete doctype and missing xmlns).
(virsacer at web dot de, Pierre)
. Fixed bug #55366 (keys lost when using substr_replace an array). (Arpad)
. Fixed bug #55273 (base64_decode() with strict rejects whitespace after
pad). (Ilia)
. Fixed bug #50982 (incorrect assumption of PAGE_SIZE size). (Dmitry)
- Calendar:
. Fixed bug #55797 (Integer overflow in SdnToGregorian leads to segfault (in
optimized builds). (Gustavo)
- Curl:
. Fixed bug #54798 (Segfault when CURLOPT_STDERR file pointer is closed
before calling curl_exec). (Hannes)
. Fixed issues were curl_copy_handle() would sometimes lose copied
preferences. (Hannes)
- DateTime:
. Fixed bug #48476 (cloning extended DateTime class without calling
parent::__constr crashed PHP). (Hannes)
- Json:
. Fixed bug #55543 (json_encode() with JSON_NUMERIC_CHECK fails on objects
with numeric string properties). (Ilia, dchurch at sciencelogic dot com)
- MySQL:
. Fixed bug #55550 (mysql.trace_mode miscounts result sets). (Johannes)
- MySQLi extension:
. Fixed bug #55859 (mysqli->stat property access gives error). (Andrey)
. Fixed bug #55582 (mysqli_num_rows() returns always 0 for unbuffered, when
mysqlnd is used). (Andrey)
. Fixed bug #55703 (PHP crash when calling mysqli_fetch_fields).
(eran at zend dot com, Laruence)
- mysqlnd
. Fixed bug #55609 (mysqlnd cannot be built shared). (Johannes)
. Fixed bug #55067 (MySQL doesn't support compression - wrong config option).
(Andrey)
- Oracle Database extension (OCI8):
. Increased maximum Oracle error message buffer length for new 11.2.0.3 size.
(Chris Jones)
. Improve internal initalization failure error messages. (Chris Jones)
- PDO
. Fixed bug #55776 (PDORow to session bug). (Johannes)
- PDO MySQL driver:
. Fixed bug #60155 (pdo_mysql.default_socket ignored). (Johannes)
. Fixed bug #55870 (PDO ignores all SSL parameters when used with mysql
native driver). (Pierre)
. Fixed bug #54158 (MYSQLND+PDO MySQL requires #define
MYSQL_OPT_LOCAL_INFILE). (Andrey)
- PDO OCI driver:
. Fixed bug #55768 (PDO_OCI can't resume Oracle session after it's been
killed). (mikhail dot v dot gavrilov at gmail dot com, Chris Jones, Tony)
- Phar:
. Fixed bug #52013 (Unable to decompress files in a compressed phar). (Hannes)
. Fixed bug #53872 (internal corruption of phar). (Hannes)
- PHP-FPM SAPI:
. Fixed bug #55526 (Heartbeat causes a lot of unnecessary events). (fat)
. Fixed bug #55533 (The -d parameter doesn't work). (fat)
. Implemented FR #52569 (Add the "ondemand" process-manager
to allow zero children). (fat)
. Fixed bug #55486 (status show BIG processes number). (fat)
. Fixed bug #55577 (status.html does not install). (fat)
. Backported from 5.4 branch (Dropped restriction of not setting the same
value multiple times, the last one holds).
(giovanni at giacobbi dot net, fat)
. Backported FR #55166 from 5.4 branch (Added process.max to control
the number of process FPM can fork). (fat)
. Backported FR #55181 from 5.4 branch (Enhance security by limiting access
to user defined extensions). (fat)
. Backported FR #54098 from 5.4 branch (Lowered process manager
default value). (fat)
. Backported FR #52052 from 5.4 branch (Added partial syslog support). (fat)
. Implemented FR #54577 (Enhanced status page with full status and details
about each processes. Also provide a web page (status.html) for
real-time FPM status. (fat)
- Session:
. Fixed bug #55267 (session_regenerate_id fails after header sent). (Hannes)
- NSAPI SAPI:
. Don't set $_SERVER['HTTPS'] on unsecure connection (bug #55403). (Uwe
Schindler)
- SimpleXML:
. Reverted the SimpleXML->query() behaviour to returning empty arrays
instead of false when no nodes are found as it was since 5.3.3
(bug #48601). (chregu, rrichards)
- Sockets:
. Fixed bug #60048 (sa_len a #define on IRIX). (china at thewrittenword dot
com)
- SPL:
. Fixed bug #60082 (Crash in ArrayObject() when using recursive references).
(Tony)
. Fixed bug #55807 (Wrong value for splFileObject::SKIP_EMPTY).
(jgotti at modedemploi dot fr, Hannes)
. Fixed bug #54304 (RegexIterator::accept() doesn't work with scalar values).
(Hannes)
- XSL:
. Added xsl.security_prefs ini option to define forbidden operations within
XSLT stylesheets, default is not to enable write operations. This option
won't be in 5.4, since there's a new method. Fixes Bug #54446. (Chregu,
Nicolas Gregoire)
- Fileinfo:
. Fixed bug #60094 (C++ comment fails in c89). (Laruence)
- FTP:
. Fixed bug #60183 (out of sync ftp responses). (bram at ebskamp dot me,
rasmus)
- SAPI:
. Fixed bug #60205 (possible integer overflow in content_length). (Laruence)
23 Aug 2011, PHP 5.3.8
- Core:
. Fixed bug #55439 (crypt() returns only the salt for MD5). (Stas)
- OpenSSL:
. Reverted a change in timeout handling restoring PHP 5.3.6 behavior,
as the new behavior caused mysqlnd SSL connections to hang (#55283).
(Pierre, Andrey, Johannes)
18 Aug 2011, PHP 5.3.7
- Upgraded bundled SQLite to version 3.7.7.1. (Scott)
- Upgraded bundled PCRE to version 8.12. (Scott)
- Zend Engine:
. Fixed bug #55156 (ReflectionClass::getDocComment() returns comment even
though the class has none). (Felipe)
- Core
. Fixed bug #55187 (readlink returns weird characters when false result).
(Pierre)
. Fixed bug #55014 (Compile failure due to improper use of ctime_r()). (Ilia)
. Fixed bug #54332 (Crash in zend_mm_check_ptr // Heap corruption). (Dmitry)
. Fixed bug #54305 (Crash in gc_remove_zval_from_buffer). (Dmitry)
. Fixed bug #53727 (Inconsistent behavior of is_subclass_of with interfaces)
(Ralph Schindler, Dmitry)
. Fixed buffer overflow on overlog salt in crypt(). (Clément LECIGNE, Stas)
. Fixed bug #52935 (call exit in user_error_handler cause stream relate
core). (Gustavo)
- MCrypt
. Change E_ERROR to E_WARNING in mcrypt_create_iv when not enough data
has been fetched (Windows). (Pierre)
. Fixed bug #55169 (mcrypt_create_iv always fails to gather sufficient random
data on Windows). (Pierre)
- PDO DBlib:
. Fixed bug #54329 (MSSql extension memory leak).
(dotslashpok at gmail dot com)
30 Jun 2011, PHP 5.3.7 RC2
- Core:
. Fixed crash in error_log(). (Felipe) Reported by Mateusz Kocielski.
. Fixed bug #55082 (var_export() doesn't escape properties properly).
(Gustavo)
- DateTime extension:
. Fixed bug where the DateTime object got changed while using date_diff().
(Derick)
- DBA extension:
. Supress warning on non-existent file open with Berkeley DB 5.2 (Chris Jones)
- PDO ODBC driver:
. Fixed data type usage in 64bit. (leocsilva at gmail dot com)
- PHP-FPM SAPI:
. Implemented FR #54499 (FPM ping and status_path should handle HEAD request). (fat)
. Implemented FR #54172 (Overriding the pid file location of php-fpm). (fat)
. Fixed missing Expires and Cache-Control headers for ping and status pages.
(fat)
. Fixed memory leak. (fat) Reported and fixed by Giovanni Giacobbi.
. Fixed wrong value of log_level when invoking fpm with -tt. (fat)
- SPL extension:
. Fixed bug #54971 (Wrong result when using iterator_to_array with use_keys
on true). (Pierrick)
16 Jun 2011, PHP 5.3.7 RC1
- Upgraded bundled SQLite to version 3.7.6.3. (Scott)
- Upgraded bundled PCRE to version 8.12. (Scott)
- Increased the backtrack limit from 100000 to 1000000 (Rasmus)
- Zend Engine:
. Fixed bug #55007 (compiler fail after previous fail). (Felipe)
. Fixed bug #54910 (Crash when calling call_user_func with unknown function
name). (Dmitry)
@@ -73,45 +304,72 @@ PHP NEWS
(Tony, Dmitry)
. Fixed bug #54372 (Crash accessing global object itself returned from its
__get() handle). (Dmitry)
. Fixed bug #54358 (Closure, use and reference). (Dmitry)
. Fixed bug #54367 (Use of closure causes problem in ArrayAccess). (Dmitry)
. Fixed bug #54039 (use() of static variables in lambda functions can break
staticness). (Dmitry)
. Fixed bug #54358 (Closure, use and reference). (Dmitry)
. Fixed bug #54262 (Crash when assigning value to a dimension in a non-array).
(Dmitry)
. Fixed bug #54039 (use() of static variables in lambda functions can break
staticness). (Dmitry)
- Core:
. Implemented FR #54459 (Range function accuracy). (Adam)
- Core
. Updated crypt_blowfish to 1.2. ((CVE-2011-2483) (Solar Designer)
. Removed warning when argument of is_a() or is_subclass_of() is not
a known class. (Stas)
. Fixed crash in error_log(). (Felipe) Reported by Mateusz Kocielski.
. Added PHP_MANDIR constant telling where the manpages were installed into,
and an --man-dir argument to php-config. (Hannes)
. Fixed a crash inside dtor for error handling. (Ilia)
. Fixed buffer overflow on overlog salt in crypt(). (Clément LECIGNE, Stas)
. Implemented FR #54459 (Range function accuracy). (Adam)
. Fixed bug #55399 (parse_url() incorrectly treats ':' as a valid path).
(Ilia)
. Fixed bug #55339 (Segfault with allow_call_time_pass_reference = Off).
(Dmitry)
. Fixed bug #55295 [NEW]: popen_ex on windows, fixed possible heap overflow
(Pierre)
. Fixed bug #55258 (Windows Version Detecting Error).
( xiaomao5 at live dot com, Pierre)
. Fixed bug #55187 (readlink returns weird characters when false result).
(Pierre)
. Fixed bug #55082 (var_export() doesn't escape properties properly).
(Gustavo)
. Fixed bug #55014 (Compile failure due to improper use of ctime_r()). (Ilia)
. Fixed bug #54939 (File path injection vulnerability in RFC1867 File upload
filename). (Felipe) Reported by Krzysztof Kotowicz. (CVE-2011-2202)
. Fixed bug #54935 php_win_err can lead to crash. (Pierre)
. Fixed bug #54924 (assert.* is not being reset upon request shutdown). (Ilia)
. Fixed bug #54895 (Fix compiling with older gcc version without need for
membar_producer macro). (mhei at heimpold dot de)
. Fixed bug #54866 (incorrect accounting for realpath_cache_size).
(Dustin Ward)
. Fixed bug #54723 (getimagesize() doesn't check the full ico signature).
(Scott)
. Fixed bug #54721 (Different Hashes on Windows, BSD and Linux on wrong Salt
size). (Pierre, os at irj dot ru)
. Fixed bug #54580 (get_browser() segmentation fault when browscap ini
directive is set through php_admin_value). (Gustavo)
. Fixed bug #54332 (Crash in zend_mm_check_ptr // Heap corruption). (Dmitry)
. Fixed bug #54305 (Crash in gc_remove_zval_from_buffer). (Dmitry)
. Fixed bug #54238 (use-after-free in substr_replace()). (Stas)
(CVE-2011-1148)
. Fixed bug #54204 (Can't set a value with a PATH section in php.ini).
(Pierre)
. Fixed bug #54180 (parse_url() incorrectly parses path when ? in fragment).
(tomas dot brastavicius at quantum dot lt, Pierrick)
. Fixed bug #54137 (file_get_contents POST request sends additional line
break). (maurice-php at mertinkat dot net, Ilia)
. Fixed bug #54866 (incorrect accounting for realpath_cache_size).
(Dustin Ward)
. Fixed bug #54721 (Different Hashes on Windows, BSD and Linux on wrong Salt
size). (Pierre, os at irj dot ru)
. Fixed bug #53848 (fgetcsv() ignores spaces at beginnings of fields). (Ilia)
. Alternative fix for bug #52550, as applied to the round() function (signed
overflow), as the old fix impacted the algorithm for numbers with magnitude
smaller than 0. (Gustavo)
. Fixed bug #53727 (Inconsistent behavior of is_subclass_of with interfaces)
(Ralph Schindler, Dmitry)
. Fixed bug #52935 (call exit in user_error_handler cause stream relate
core). (Gustavo)
. Fixed bug #51997 (SEEK_CUR with 0 value, returns a warning). (Ilia)
. Fixed bug #50816 (Using class constants in array definition fails).
(Pierrick, Dmitry)
. Fixed bug #50363 (Invalid parsing in convert.quoted-printable-decode
filter). (slusarz at curecanti dot org)
. Fixed bug #48465 (sys_get_temp_dir() possibly inconsistent when using
@@ -124,13 +382,15 @@ PHP NEWS
- CLI SAPI:
. Fixed bug #52496 (Zero exit code on option parsing failure). (Ilia)
- cURL:
- cURL extension:
. Added ini option curl.cainfo (support for custom cert db). (Pierre)
. Added CURLINFO_REDIRECT_URL support. (Daniel Stenberg, Pierre)
. Added support for CURLOPT_MAX_RECV_SPEED_LARGE and
CURLOPT_MAX_SEND_SPEED_LARGE. FR #51815. (Pierrick)
- DateTime extension:
. Fixed bug where the DateTime object got changed while using date_diff().
(Derick)
. Fixed bug #54340 (DateTime::add() method bug). (Adam)
. Fixed bug #54316 (DateTime::createFromFormat does not handle trailing '|'
correctly). (Adam)
@@ -139,6 +399,7 @@ PHP NEWS
exception and fatal error). (Hannes)
- DBA extension:
. Supress warning on non-existent file open with Berkeley DB 5.2. (Chris Jones)
. Fixed bug #54242 (dba_insert returns true if key already exists). (Felipe)
- Exif extesion:
@@ -156,9 +417,13 @@ PHP NEWS
. Fixed bug #54269 (Short exception message buffer causes crash). (Felipe)
- intl extension:
. Implemented FR #54561 (Expose ICU version info). (David Zuelke, Ilia)
. Implemented FR #54540 (Allow loading of arbitrary resource bundles when
fallback is disabled). (David Zuelke, Stas)
. Implemented FR #54561 (Expose ICU version info). (David Zuelke, Ilia)
- Imap extension:
. Fixed bug #55313 (Number of retries not set when params specified).
(kevin at kevinlocke dot name)
- json extension:
. Fixed bug #54484 (Empty string in json_decode doesn't reset
@@ -175,9 +440,11 @@ PHP NEWS
- mbstring extension:
. Fixed bug #54494 (mb_substr() mishandles UTF-32LE and UCS-2LE). (Gustavo)
- MySQL Improved extension:
. Fixed Bug #54221 (mysqli::get_warnings segfault when used in multi queries).
(Andrey)
- MCrypt extension:
. Change E_ERROR to E_WARNING in mcrypt_create_iv when not enough data
has been fetched (Windows). (Pierre)
. Fixed bug #55169 (mcrypt_create_iv always fails to gather sufficient random
data on Windows). (Pierre)
- mysqlnd
. Fixed crash when using more than 28,000 bound parameters. Workaround is to
@@ -185,23 +452,41 @@ PHP NEWS
. Fixed bug #54674 mysqlnd valid_sjis_(head|tail) is using invalid operator
and range). (nihen at megabbs dot com, Andrey)
- OpenSSL extension
- MySQLi extension:
. Fixed bug #55283 (SSL options set by mysqli_ssl_set ignored for MySQLi
persistent connections). (Andrey)
. Fixed Bug #54221 (mysqli::get_warnings segfault when used in multi queries).
(Andrey)
- OpenSSL extension:
. openssl_encrypt()/openssl_decrypt() truncated keys of variable length
ciphers to the OpenSSL default for the algorithm. (Scott)
. On blocking SSL sockets respect the timeout option where possible.
(Scott)
. Fixed bug #54992 (Stream not closed and error not returned when SSL
CN_match fails). (Gustavo, laird_ngrps at dodo dot com dot au)
- Oracle Database extension (OCI8):
. Added oci_client_version() returning the runtime Oracle client library
version (Chris Jones)
version. (Chris Jones)
. PCRE extension:
. Increased the backtrack limit from 100000 to 1000000 (Rasmus)
- PDO extension:
. Fixed bug #54929 (Parse error with single quote in sql comment). (Felipe)
. Fixed bug #52104 (bindColumn creates Warning regardless of ATTR_ERRMODE
settings). (Ilia)
- PDO DBlib driver:
. Fixed bug #54329 (MSSql extension memory leak).
(dotslashpok at gmail dot com)
. Fixed bug #54167 (PDO_DBLIB returns null on SQLUNIQUE field).
(mjh at hodginsmedia dot com, Felipe)
- PDO ODBC driver:
. Fixed data type usage in 64bit. (leocsilva at gmail dot com)
- PDO MySQL driver:
. Fixed bug #54644 (wrong pathes in php_pdo_mysql_int.h). (Tony, Johannes)
. Fixed bug #53782 (foreach throws irrelevant exception). (Johannes, Andrey)
@@ -221,6 +506,12 @@ PHP NEWS
(Felipe)
- PHP-FPM SAPI:
. Implemented FR #54499 (FPM ping and status_path should handle HEAD request). (fat)
. Implemented FR #54172 (Overriding the pid file location of php-fpm). (fat)
. Fixed missing Expires and Cache-Control headers for ping and status pages.
(fat)
. Fixed memory leak. (fat) Reported and fixed by Giovanni Giacobbi.
. Fixed wrong value of log_level when invoking fpm with -tt. (fat)
. Added xml format to the status page. (fat)
. Removed timestamp in logs written by children processes. (fat)
. Fixed exit at FPM startup on fpm_resources_prepare() errors. (fat)
@@ -236,6 +527,8 @@ PHP NEWS
name). (Felipe, laruence at yahoo dot com dot cn)
- SOAP extension:
. Fixed bug #55323 (SoapClient segmentation fault when XSD_TYPEKIND_EXTENSION
contains itself). (Dmitry)
. Fixed bug #54312 (soap_version logic bug). (tom at samplonius dot org)
- Sockets extension:
@@ -246,6 +539,8 @@ PHP NEWS
. Fixed bug #51958 (socket_accept() fails on IPv6 server sockets). (Gustavo)
- SPL extension:
. Fixed bug #54971 (Wrong result when using iterator_to_array with use_keys
on true). (Pierrick)
. Fixed bug #54970 (SplFixedArray::setSize() isn't resizing). (Felipe)
. Fixed bug #54609 (Certain implementation(s) of SplFixedArray cause hard
crash). (Felipe)
@@ -263,10 +558,9 @@ PHP NEWS
. Fixed bug #54946 (stream_get_contents infinite loop). (Hannes)
. Fixed bug #54623 (Segfault when writing to a persistent socket after
closing a copy of the socket). (Gustavo)
. Zip extension:
. Fixed bug #54681 (addGlob() crashes on invalid flags). (Felipe)
17 Mar 2011, PHP 5.3.6
- Upgraded bundled Sqlite3 to version 3.7.4. (Ilia)
- Upgraded bundled PCRE to version 8.11. (Ilia)
+20 -7
View File
@@ -51,27 +51,40 @@ SUCH DAMAGE.
6. ext/standard crypt's blowfish implementation
The crypt_blowfish homepage is:
http://www.openwall.com/crypt/
This code comes from John the Ripper password cracker, with reentrant
and crypt(3) interfaces added, but optimizations specific to password
cracking removed.
Written by Solar Designer <solar at openwall.com> in 1998-2002 and
placed in the public domain.
Written by Solar Designer <solar at openwall.com> in 1998-2011.
No copyright is claimed, and the software is hereby placed in the public
domain. In case this attempt to disclaim copyright and place the software
in the public domain is deemed null and void, then the software is
Copyright (c) 1998-2011 Solar Designer and it is hereby released to the
general public under the following terms:
There's absolutely no warranty.
Redistribution and use in source and binary forms, with or without
modification, are permitted.
There's ABSOLUTELY NO WARRANTY, express or implied.
It is my intent that you should be able to use this on your system,
as a part of a software package, or anywhere else to improve security,
as part of a software package, or anywhere else to improve security,
ensure compatibility, or for any other purpose. I would appreciate
it if you give credit where it is due and keep your modifications in
the public domain as well, but I don't require that in order to let
you place this code and any modifications you make under a license
of your choice.
This implementation is compatible with OpenBSD bcrypt.c (version 2a)
by Niels Provos <provos at citi.umich.edu>, and uses some of his
This implementation is mostly compatible with OpenBSD's bcrypt.c (prefix
"$2a$") by Niels Provos <provos at citi.umich.edu>, and uses some of his
ideas. The password hashing algorithm was designed by David Mazieres
<dm at lcs.mit.edu>.
<dm at lcs.mit.edu>. For more information on the level of compatibility,
please refer to the comments in BF_set_key() and to the crypt(3) man page
included in the crypt_blowfish tarball.
There's a paper on the algorithm that explains its design decisions:
+29 -26
View File
@@ -20,12 +20,18 @@ 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.
6. Moving extensions from/to PECL requires root level access to the CVS server.
Contact systems@php.net to get this taken care of.
6. Moving extensions from/to PECL requires write acces to the destination.
Most developers should have this.
Moving extensions from php-src to PECL
- Filesystem: cp -r php-src/ext/foo pecl/foo
- cvs rm php-src/ext/foo
- Checkout the pecl directory, most likely you want a sparse-root checkout
svn co --depth=empty https://svn.php.net/repository/pecl
- Create an directory for the extension incl. branch and tag structure,
no trunk at this point and commit this to svn
cd pecl; mkdir foo foo/tags foo/branches; svn add foo; svn commit
- Move the extension from php-src to the new location
svn mv https://svn.php.net/repository/php/php-src/trunk/ext/foo \
https://svn.php.net/repository/pecl/foo/trunk
If the extension is still usable or not dead, in cooperation with the extension
maintainers if any:
@@ -33,26 +39,24 @@ maintainers if any:
- create the package.xml, commit
- release the package
Moving extensions from PECL to php-src
- Filesystem: cp -r pecl/foo php-src/ext/foo
OR depending on the wishes from the PECL extension maintainer.
- Filesystem: ln -s pecl/foo php-src/ext/foo
For Moving extensions from PECL to php-src the svn mv has to be tone the other
way round.
Rolling a non stable release (alpha/beta/RC)
--------------------------------------------
1. Check windows snapshot builder logs (http://snaps.php.net/win32/snapshot-STABLE.log f.e.)
1. Check windows snapshot builder logs (http://windows.php.net/downloads/snaps/ the last revision)
2. Bump the version numbers in ``main/php_version.h``, ``configure.in`` and possibly ``NEWS``.
Do not use abbreviations for alpha and beta.
3. Commit those changes
4. run the "scripts/dev/credits" script in php-src and commit the changes in the
2. run the "scripts/dev/credits" script in php-src and commit the changes in the
credits files in ext/standard.
5. tag the repository with the version f.e. "``cvs tag php_4_4_1RC1``"
(of course, you need to change that to the version you're rolling an RC for).
3. Bump the version numbers in ``main/php_version.h``, ``configure.in`` and possibly ``NEWS``.
Do not use abbreviations for alpha and beta.
4. Commit those changes and note the revision id.
5. tag the repository with the version. To do the tag in a fast way do a svn copy on the server using full URLs. You should use the revision id from the above commit to prevent mistakes in case there was a commit in between. f.e. "``svn cp https://svn.php.net/repository/php/php-src/branches/PHP_5_3@308399 https://svn.php.net/repository/php/php-src/tags/php_5_3_6RC1``"
(of course, you need to change that to the version you're rolling an RC for). Mail php-internals to announce the tag so tests/validation/check can be done prior to package it. It is especially important for RCs.
6. 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
@@ -65,7 +69,7 @@ correctly work.
8. Log in onto the snaps box and go into the correct tree (f.e. the PHP_4_4
branch if you're rolling 4.4.x releases).
9. You do not have to update the tree, but of course you can with "``cvs up -dP``".
9. You do not have to update the tree, but of course you can with "``svn up``".
10. run: ``./makedist php 4.4.1RC1``, this will export the tree, create configure
and build two tarballs (one gz and one bz2).
@@ -109,22 +113,21 @@ Derick) run the following commands for you:
Note: Remember to update the MD5 checksum information.
1. Update in ``php-bugs/trunk/include/functions.inc`` the ``show_version_option``
function to include the new RC and commit.
2. Update ``phpweb/include/version.inc`` (x=major version number)
4. Update ``web/php/trunk/include/version.inc`` (x=major version number)
a. ``$PHP_x_RC`` = "5.3.0RC1"
b. ``$PHP_x_RC_DATE`` = "06 September 2007"
3. Commit those changes:
5. Commit those changes:
a. ``cvs commit include/version.inc include/releases.inc``
a. ``svn commit web/qa/trunk web/php-bugs/trunk web/php/trunk``
4. For the first RC, write the doc team (phpdoc@lists.php.net) about updating the
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
------------------------
@@ -162,7 +165,7 @@ and build two tarballs (one gz and one bz2).
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 CVS too.
those are made, they should be committed to SVN too.
14. Check if the pear files are updated (phar for 5.1+ or run pear/make-pear-bundle.php with 4.4)
+1 -1
View File
@@ -39,7 +39,7 @@ Having said that, here are the organizational rules::
To do so use "make test".
7. For development use the --enable-maintainer-zts switch to ensure your
code handles TSRM correctly and doesn't break for thos who need that.
code handles TSRM correctly and doesn't break for those who need that.
Currently we have the following branches in use::
+4
View File
@@ -532,6 +532,10 @@ TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd,
}
cmd = (char*)malloc(strlen(command)+strlen(TWG(comspec))+sizeof(" /c ")+2);
if (!cmd) {
return NULL;
}
sprintf(cmd, "%s /c \"%s\"", TWG(comspec), command);
if (asuser) {
res = CreateProcessAsUser(token_user, NULL, cmd, &security, &security, security.bInheritHandle, dwCreateFlags, env, cwd, &startup, &process);
+17
View File
@@ -153,6 +153,20 @@ UPGRADE NOTES - PHP 5.3
- SplObjectStorage now has ArrayAccess support. It is also now possible to
store associative information with objects in SplObjectStorage.
=====================
4.1 New in PHP 5.3.9
=====================
- Write operations within XSLT (for example with the extension sax:output) are
disabled by default. You can define what is forbidden with the INI option
xsl.security_prefs. This option will be marked as deprecated in 5.4 again.
Use the method XsltProcess::setSecurityPrefs($options) there.
- the following new directives were added
- max_input_vars - specifies how many GET/POST/COOKIE input variables may be
accepted. default value 1000.
=============
5. Deprecated
@@ -334,6 +348,9 @@ UPGRADE NOTES - PHP 5.3
- A new directive, request_order, controls the behavior of $_REQUEST
independently of variables_order.
- A new directive, called windows.show_crt_warning, has been introduced.
This directive shows the CRT warnings when enabled. These warnings were
displayed by default until now. It is disabled by default.
- New INI directives:
- mail.add_x_header
-2
View File
@@ -1,7 +1,5 @@
--TEST--
Bug #31683 (changes to $name in __get($name) override future parameters)
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
+51
View File
@@ -0,0 +1,51 @@
--TEST--
Bug #43200 (Interface implementation / inheritence not possible in abstract classes)
--FILE--
<?php
interface a {
function foo();
function bar();
}
interface b {
function foo();
}
abstract class c {
function bar() { }
}
class x extends c implements a, b {
function foo() { }
}
ReflectionClass::export('x');
?>
--EXPECTF--
Class [ <user> class x extends c implements a, b ] {
@@ %s 15-17
- Constants [0] {
}
- Static properties [0] {
}
- Static methods [0] {
}
- Properties [0] {
}
- Methods [2] {
Method [ <user, prototype b> public method foo ] {
@@ %s 16 - 16
}
Method [ <user, inherits c, prototype a> public method bar ] {
@@ %s 12 - 12
}
}
}
+25
View File
@@ -0,0 +1,25 @@
--TEST--
Bug #43200.2 (Interface implementation / inheritence not possible in abstract classes)
--FILE--
<?php
interface A {
function foo();
}
abstract class B implements A {
abstract public function foo();
}
class C extends B {
public function foo() {
echo 'works';
}
}
$o = new C();
$o->foo();
?>
--EXPECTF--
works
+1 -1
View File
@@ -20,5 +20,5 @@ var_dump( ArrayProperty::$array );
--EXPECT--
array(1) {
[1]=>
int(23)
int(42)
}
+2 -2
View File
@@ -18,9 +18,9 @@ var_dump(
?>
--EXPECTF--
Parse error: syntax error, unexpected '}' in %s(%d) : runtime-created function on line 1
Parse error: %s in %s(%d) : runtime-created function on line 1
Parse error: syntax error, unexpected $end in %s(%d) : runtime-created function on line 1
Parse error: %s %s(%d) : runtime-created function on line 1
bool(false)
int(2)
bool(false)
+48
View File
@@ -0,0 +1,48 @@
--TEST--
Bug #50816 (Using class constants in array definition fails)
--FILE--
<?php
define("ONE", 1);
define("TWO", 1);
class Foo {
const ONE = 1;
const TWO = 1;
public static $mapWithConst = array(self::ONE => 'one', self::TWO => 'two',);
public static $mapWithConst1 = array(1 => 'one', self::TWO => 'two',);
public static $mapWithConst2 = array(self::ONE => 'one', 1 => 'two',);
public static $mapWithoutConst = array(1 => 'one', 1 => 'two',);
}
$mapWithConst = array(1 => 'one', 1 => 'two',);
$mapWithoutConst = array(Foo::ONE => 'one', Foo::TWO => 'two',);
$mapWithoutConst0 = array(1 => 'one', 1 => 'two',);
$mapWithoutConst1 = array(ONE => 'one', 1 => 'two',);
$mapWithoutConst2 = array(1 => 'one', TWO => 'two',);
$mapWithoutConst3 = array(ONE => 'one', TWO => 'two',);
var_dump(Foo::$mapWithConst[1]);
var_dump(Foo::$mapWithConst1[1]);
var_dump(Foo::$mapWithConst2[1]);
var_dump(Foo::$mapWithoutConst[1]);
var_dump($mapWithConst[1]);
var_dump($mapWithoutConst[1]);
var_dump($mapWithoutConst0[1]);
var_dump($mapWithoutConst1[1]);
var_dump($mapWithoutConst2[1]);
var_dump($mapWithoutConst3[1]);
--EXPECT--
string(3) "two"
string(3) "two"
string(3) "two"
string(3) "two"
string(3) "two"
string(3) "two"
string(3) "two"
string(3) "two"
string(3) "two"
string(3) "two"
+3 -3
View File
@@ -11,7 +11,7 @@ echo "ok\n";
--EXPECTF--
bool(true)
Warning: Attempt to modify property of non-object in %s/Zend/tests/bug54262.php on line 4
Warning: Attempt to modify property of non-object in %sbug54262.php on line 4
Warning: Cannot use a scalar value as an array in %s/Zend/tests/bug54262.php on line 5
ok
Warning: Cannot use a scalar value as an array in %sbug54262.php on line 5
ok
+31
View File
@@ -0,0 +1,31 @@
--TEST--
Bug #55339 (Segfault with allow_call_time_pass_reference = Off)
--INI--
allow_call_time_pass_reference=off
--FILE--
<?php
function error_handler($errno, $errstr, $errfile, $errline) {
eval(';');
}
set_error_handler('error_handler');
eval(<<<'EOF'
function foo()
{
$array = array();
foreach ($array as $key => $value) {
bar($key, &$value);
}
}
function bar()
{
}
EOF
);
echo "OK\n";
--EXPECT--
OK
+65
View File
@@ -0,0 +1,65 @@
--TEST--
Bug #55509 (segfault on x86_64 using more than 2G memory)
--SKIPIF--
<?php
if (PHP_INT_SIZE == 4) {
die('skip Not for 32-bits OS');
}
if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
// check the available memory
if (PHP_OS == 'Linux') {
$lines = file('/proc/meminfo');
$infos = array();
foreach ($lines as $line) {
$tmp = explode(":", $line);
$index = strtolower($tmp[0]);
$value = (int)ltrim($tmp[1], " ")*1024;
$infos[$index] = $value;
}
$freeMemory = $infos['memfree']+$infos['buffers']+$infos['cached'];
if ($freeMemory < 2100*1024*1024) {
die('skip Not enough memory.');
}
}
elseif (PHP_OS == 'FreeBSD') {
$lines = explode("\n",`sysctl -a`);
$infos = array();
foreach ($lines as $line) {
if(!$line){
continue;
}
$tmp = explode(":", $line);
$index = strtolower($tmp[0]);
$value = trim($tmp[1], " ");
$infos[$index] = $value;
}
$freeMemory = ($infos['vm.stats.vm.v_inactive_count']*$infos['hw.pagesize'])
+($infos['vm.stats.vm.v_cache_count']*$infos['hw.pagesize'])
+($infos['vm.stats.vm.v_free_count']*$infos['hw.pagesize']);
if ($freeMemory < 2100*1024*1024) {
die('skip Not enough memory.');
}
}
?>
--INI--
memory_limit=2100M
--FILE--
<?php
$a1 = str_repeat("1", 1024 * 1024 * 1024 * 0.5);
echo "1\n";
$a2 = str_repeat("2", 1024 * 1024 * 1024 * 0.5);
echo "2\n";
$a3 = str_repeat("3", 1024 * 1024 * 1024 * 0.5);
echo "3\n";
$a4 = str_repeat("4", 1024 * 1024 * 1024 * 0.5);
echo "4\n";
$a5 = str_repeat("5", 1024 * 1024 * 1024 * 0.5);
echo "5\n";
?>
--EXPECTF--
1
2
3
4
Fatal error: Allowed memory size of %d bytes exhausted%s(tried to allocate %d bytes) in %sbug55509.php on line %d
+10
View File
@@ -0,0 +1,10 @@
--TEST--
Bug #60099 (__halt_compiler() works in braced namespaces)
--FILE--
<?php
namespace foo {
__halt_compiler();
?>
--EXPECTF--
Fatal error: __HALT_COMPILER() can only be used from the outermost scope in %s on line %d
+16
View File
@@ -0,0 +1,16 @@
--TEST--
Bug #60138 (GC crash with referenced array in RecursiveArrayIterator)
--FILE--
<?php
$tree = array(array("f"));
$category =& $tree[0];
$iterator = new RecursiveIteratorIterator(
new RecursiveArrayIterator($tree),
RecursiveIteratorIterator::SELF_FIRST
);
foreach($iterator as $file);
echo "ok\n";
?>
--EXPECT--
ok
+30
View File
@@ -0,0 +1,30 @@
--TEST--
Bug #60139 (Anonymous functions create cycles not detected by the GC)
--FILE--
<?php
class Foo {
public $x;
public function __construct() {
$this->x = function() {};
}
}
class Bar {
public $x;
public function __construct() {
$self = $this;
$this->x = function() use ($self) {};
}
}
gc_collect_cycles();
new Foo;
var_dump(gc_collect_cycles());
new Bar;
var_dump(gc_collect_cycles());
?>
--EXPECT--
int(0)
int(2)
+1 -1
View File
@@ -17,4 +17,4 @@ interface a extends d, w { }
?>
--EXPECTF--
Fatal error: Can't inherit abstract function c::B() (previously declared abstract in d) in %s on line %d
Fatal error: Cannot make non static method c::B() static in class d in %s on line %d
+3 -1
View File
@@ -14,6 +14,8 @@ interface b {
interface c extends a, b {
}
echo "done!\n";
?>
--EXPECTF--
Fatal error: Can't inherit abstract function b::b() (previously declared abstract in a) in %s on line %d
done!
+3 -1
View File
@@ -14,6 +14,8 @@ interface Itest2 {
interface Itest3 extends Itest, Itest2 {
}
echo "done!\n";
?>
--EXPECTF--
Fatal error: Can't inherit abstract function Itest2::a() (previously declared abstract in Itest) in %s on line %d
done!
+44 -3
View File
@@ -821,7 +821,7 @@ void zend_append_version_info(const zend_extension *extension) /* {{{ */
char *new_info;
uint new_info_length;
new_info_length = sizeof(" with v, by \n")
new_info_length = sizeof(" with v, , by \n")
+ strlen(extension->name)
+ strlen(extension->version)
+ strlen(extension->copyright)
@@ -829,10 +829,10 @@ void zend_append_version_info(const zend_extension *extension) /* {{{ */
new_info = (char *) malloc(new_info_length + 1);
sprintf(new_info, " with %s v%s, %s, by %s\n", extension->name, extension->version, extension->copyright, extension->author);
snprintf(new_info, new_info_length, " with %s v%s, %s, by %s\n", extension->name, extension->version, extension->copyright, extension->author);
zend_version_info = (char *) realloc(zend_version_info, zend_version_info_length+new_info_length + 1);
strcat(zend_version_info, new_info);
strncat(zend_version_info, new_info, new_info_length);
zend_version_info_length += new_info_length;
free(new_info);
}
@@ -958,6 +958,23 @@ ZEND_API int zend_get_configuration_directive(const char *name, uint name_length
}
/* }}} */
#define SAVE_STACK(stack) do { \
if (CG(stack).top) { \
memcpy(&stack, &CG(stack), sizeof(zend_stack)); \
CG(stack).top = CG(stack).max = 0; \
CG(stack).elements = NULL; \
} else { \
stack.top = 0; \
} \
} while (0)
#define RESTORE_STACK(stack) do { \
if (stack.top) { \
zend_stack_destroy(&CG(stack)); \
memcpy(&CG(stack), &stack, sizeof(zend_stack)); \
} \
} while (0)
ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
{
va_list args;
@@ -970,6 +987,14 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
zval *orig_user_error_handler;
zend_bool in_compilation;
zend_class_entry *saved_class_entry;
zend_stack bp_stack;
zend_stack function_call_stack;
zend_stack switch_cond_stack;
zend_stack foreach_copy_stack;
zend_stack object_stack;
zend_stack declare_stack;
zend_stack list_stack;
zend_stack labels_stack;
TSRMLS_FETCH();
/* Obtain relevant filename and lineno */
@@ -1097,6 +1122,14 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
if (in_compilation) {
saved_class_entry = CG(active_class_entry);
CG(active_class_entry) = NULL;
SAVE_STACK(bp_stack);
SAVE_STACK(function_call_stack);
SAVE_STACK(switch_cond_stack);
SAVE_STACK(foreach_copy_stack);
SAVE_STACK(object_stack);
SAVE_STACK(declare_stack);
SAVE_STACK(list_stack);
SAVE_STACK(labels_stack);
}
if (call_user_function_ex(CG(function_table), NULL, orig_user_error_handler, &retval, 5, params, 1, NULL TSRMLS_CC) == SUCCESS) {
@@ -1113,6 +1146,14 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
if (in_compilation) {
CG(active_class_entry) = saved_class_entry;
RESTORE_STACK(bp_stack);
RESTORE_STACK(function_call_stack);
RESTORE_STACK(switch_cond_stack);
RESTORE_STACK(foreach_copy_stack);
RESTORE_STACK(object_stack);
RESTORE_STACK(declare_stack);
RESTORE_STACK(list_stack);
RESTORE_STACK(labels_stack);
}
if (!EG(user_error_handler)) {
+3 -2
View File
@@ -941,6 +941,7 @@ ZEND_API int zend_parse_method_parameters_ex(int flags, int num_args TSRMLS_DC,
zend_error(E_CORE_ERROR, "%s::%s() must be derived from %s::%s",
ce->name, get_active_function_name(TSRMLS_C), Z_OBJCE_P(this_ptr)->name, get_active_function_name(TSRMLS_C));
}
va_end(va);
return FAILURE;
}
@@ -2307,7 +2308,7 @@ ZEND_API ZEND_FUNCTION(display_disabled_function)
static zend_function_entry disabled_function[] = {
ZEND_FE(display_disabled_function, NULL)
{ NULL, NULL, NULL }
ZEND_FE_END
};
ZEND_API int zend_disable_function(char *function_name, uint function_name_length TSRMLS_DC) /* {{{ */
@@ -2333,7 +2334,7 @@ static zend_object_value display_disabled_class(zend_class_entry *class_type TSR
/* }}} */
static const zend_function_entry disabled_class_new[] = {
{ NULL, NULL, NULL }
ZEND_FE_END
};
ZEND_API int zend_disable_class(char *class_name, uint class_name_length TSRMLS_DC) /* {{{ */
+2
View File
@@ -96,6 +96,8 @@ typedef struct _zend_fcall_info_cache {
#define ZEND_NS_FALIAS(ns, name, alias, arg_info) ZEND_NS_FENTRY(ns, name, ZEND_FN(alias), arg_info, 0)
#define ZEND_NS_DEP_FALIAS(ns, name, alias, arg_info) ZEND_NS_FENTRY(ns, name, ZEND_FN(alias), arg_info, ZEND_ACC_DEPRECATED)
#define ZEND_FE_END { NULL, NULL, NULL, 0, 0 }
#define ZEND_ARG_INFO(pass_by_ref, name) { #name, sizeof(#name)-1, NULL, 0, 0, 0, pass_by_ref, 0, 0 },
#define ZEND_ARG_PASS_INFO(pass_by_ref) { NULL, 0, NULL, 0, 0, 0, pass_by_ref, 0, 0 },
#define ZEND_ARG_OBJ_INFO(pass_by_ref, name, classname, allow_null) { #name, sizeof(#name)-1, #classname, sizeof(#classname)-1, 0, allow_null, pass_by_ref, 0, 0 },
+1 -1
View File
@@ -510,7 +510,7 @@ static unsigned int _zend_mm_cookie = 0;
#define ZEND_MM_IS_GUARD_BLOCK(b) (((b)->info._size & ZEND_MM_TYPE_MASK) == ZEND_MM_GUARD_BLOCK)
#define ZEND_MM_NEXT_BLOCK(b) ZEND_MM_BLOCK_AT(b, ZEND_MM_BLOCK_SIZE(b))
#define ZEND_MM_PREV_BLOCK(b) ZEND_MM_BLOCK_AT(b, -(int)((b)->info._prev & ~ZEND_MM_TYPE_MASK))
#define ZEND_MM_PREV_BLOCK(b) ZEND_MM_BLOCK_AT(b, -(ssize_t)((b)->info._prev & ~ZEND_MM_TYPE_MASK))
#define ZEND_MM_PREV_BLOCK_IS_FREE(b) (!((b)->info._prev & ZEND_MM_USED_BLOCK))
+15 -9
View File
@@ -283,7 +283,7 @@ static const zend_function_entry builtin_functions[] = { /* {{{ */
ZEND_FE(gc_enabled, arginfo_zend__void)
ZEND_FE(gc_enable, arginfo_zend__void)
ZEND_FE(gc_disable, arginfo_zend__void)
{ NULL, NULL, NULL }
ZEND_FE_END
};
/* }}} */
@@ -816,13 +816,19 @@ static void is_a_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool only_subclass)
int class_name_len;
zend_class_entry *instance_ce;
zend_class_entry **ce;
zend_bool allow_string = only_subclass;
zend_bool retval;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zs", &obj, &class_name, &class_name_len) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zs|b", &obj, &class_name, &class_name_len, &allow_string) == FAILURE) {
return;
}
if (Z_TYPE_P(obj) == IS_STRING) {
/*
allow_string - is_a default is no, is_subclass_of is yes.
if it's allowed, then the autoloader will be called if the class does not exist.
default behaviour is different, as 'is_a' usage is normally to test mixed return values
*/
if (allow_string && Z_TYPE_P(obj) == IS_STRING) {
zend_class_entry **the_ce;
if (zend_lookup_class(Z_STRVAL_P(obj), Z_STRLEN_P(obj), &the_ce TSRMLS_CC) == FAILURE) {
RETURN_FALSE;
@@ -848,7 +854,7 @@ static void is_a_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool only_subclass)
}
/* {{{ proto bool is_subclass_of(object object, string class_name)
/* {{{ proto bool is_subclass_of(mixed object_or_string, string class_name [, bool allow_string=true])
Returns true if the object has this class as one of its parents */
ZEND_FUNCTION(is_subclass_of)
{
@@ -857,8 +863,8 @@ ZEND_FUNCTION(is_subclass_of)
/* }}} */
/* {{{ proto bool is_a(object object, string class_name)
Returns true if the object is of this class or has this class as one of its parents */
/* {{{ proto bool is_a(mixed object_or_string, string class_name [, bool allow_string=false])
Returns true if the first argument is an object and is this class or has this class as one of its parents, */
ZEND_FUNCTION(is_a)
{
is_a_impl(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
@@ -1713,7 +1719,7 @@ ZEND_FUNCTION(create_function)
function_name[0] = '\0';
do {
function_name_length = 1 + sprintf(function_name + 1, "lambda_%d", ++EG(lambda_count));
function_name_length = 1 + snprintf(function_name + 1, sizeof("lambda_")+MAX_LENGTH_OF_LONG, "lambda_%d", ++EG(lambda_count));
} while (zend_hash_add(EG(function_table), function_name, function_name_length+1, &new_function, sizeof(zend_function), NULL)==FAILURE);
zend_hash_del(EG(function_table), LAMBDA_TEMP_FUNCNAME, sizeof(LAMBDA_TEMP_FUNCNAME));
RETURN_STRINGL(function_name, function_name_length, 0);
@@ -2047,7 +2053,7 @@ ZEND_FUNCTION(debug_print_backtrace)
ZEND_PUTS(class_name);
ZEND_PUTS(call_type);
}
zend_printf("%s(", function_name?function_name:"main");
zend_printf("%s(", function_name);
if (arg_array) {
debug_print_backtrace_args(arg_array TSRMLS_CC);
zval_ptr_dtor(&arg_array);
+13
View File
@@ -280,6 +280,18 @@ static HashTable *zend_closure_get_debug_info(zval *object, int *is_temp TSRMLS_
}
/* }}} */
static HashTable *zend_closure_get_properties(zval *obj TSRMLS_DC) /* {{{ */
{
zend_closure *closure = (zend_closure *)zend_object_store_get_object(obj TSRMLS_CC);
if (GC_G(gc_active)) {
return (closure->func.type == ZEND_USER_FUNCTION) ? closure->func.op_array.static_variables : NULL;
}
return closure->std.properties;
}
/* }}} */
/* {{{ proto Closure::__construct()
Private constructor preventing instantiation */
ZEND_METHOD(Closure, __construct)
@@ -316,6 +328,7 @@ void zend_register_closure_ce(TSRMLS_D) /* {{{ */
closure_handlers.clone_obj = NULL;
closure_handlers.get_debug_info = zend_closure_get_debug_info;
closure_handlers.get_closure = zend_closure_get_closure;
closure_handlers.get_properties = zend_closure_get_properties;
}
/* }}} */
+13 -1
View File
@@ -2628,7 +2628,8 @@ static zend_bool do_inherit_method_check(HashTable *child_function_table, zend_f
return 1; /* method doesn't exist in child, copy from parent */
}
if (parent->common.fn_flags & ZEND_ACC_ABSTRACT
if ((parent->common.scope->ce_flags & ZEND_ACC_INTERFACE) == 0
&& parent->common.fn_flags & ZEND_ACC_ABSTRACT
&& parent->common.scope != (child->common.prototype ? child->common.prototype->common.scope : child->common.scope)
&& child->common.fn_flags & (ZEND_ACC_ABSTRACT|ZEND_ACC_IMPLEMENTED_ABSTRACT)) {
zend_error(E_COMPILE_ERROR, "Can't inherit abstract function %s::%s() (previously declared abstract in %s)",
@@ -3757,6 +3758,11 @@ void zend_do_halt_compiler_register(TSRMLS_D) /* {{{ */
char *name, *cfilename;
char haltoff[] = "__COMPILER_HALT_OFFSET__";
int len, clen;
if (CG(has_bracketed_namespaces) && CG(in_namespace)) {
zend_error(E_COMPILE_ERROR, "__HALT_COMPILER() can only be used from the outermost scope");
}
cfilename = zend_get_compiled_filename(TSRMLS_C);
clen = strlen(cfilename);
zend_mangle_property_name(&name, &len, haltoff, sizeof(haltoff) - 1, cfilename, clen, 0);
@@ -5184,6 +5190,12 @@ void zend_do_begin_namespace(const znode *name, zend_bool with_bracket TSRMLS_DC
efree(CG(current_import));
CG(current_import) = NULL;
}
if (CG(doc_comment)) {
efree(CG(doc_comment));
CG(doc_comment) = NULL;
CG(doc_comment_len) = 0;
}
}
/* }}} */
+5 -4
View File
@@ -865,10 +865,11 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
&& (EX(function_state).function->common.fn_flags & ZEND_ACC_CALL_VIA_HANDLER) == 0
&& !ARG_SHOULD_BE_SENT_BY_REF(EX(function_state).function, i + 1)
&& PZVAL_IS_REF(*fci->params[i])) {
SEPARATE_ZVAL(fci->params[i]);
}
if (ARG_SHOULD_BE_SENT_BY_REF(EX(function_state).function, i + 1)
ALLOC_ZVAL(param);
*param = **(fci->params[i]);
INIT_PZVAL(param);
zval_copy_ctor(param);
} else if (ARG_SHOULD_BE_SENT_BY_REF(EX(function_state).function, i + 1)
&& !PZVAL_IS_REF(*fci->params[i])) {
if (Z_REFCOUNT_PP(fci->params[i]) > 1) {
+99 -74
View File
@@ -735,6 +735,7 @@ ZEND_API void zend_hash_apply_with_arguments(HashTable *ht TSRMLS_DC, apply_func
p = p->pListNext;
}
if (result & ZEND_HASH_APPLY_STOP) {
va_end(args);
break;
}
va_end(args);
@@ -1168,12 +1169,12 @@ ZEND_API int zend_hash_get_current_data_ex(HashTable *ht, void **pData, HashPosi
}
}
/* This function changes key of currevt element without changing elements'
/* This function changes key of current element without changing elements'
* order. If element with target key already exists, it will be deleted first.
*/
ZEND_API int zend_hash_update_current_key_ex(HashTable *ht, int key_type, const char *str_index, uint str_length, ulong num_index, int mode, HashPosition *pos)
{
Bucket *p;
Bucket *p, *q;
p = pos ? (*pos) : ht->pInternalPointer;
@@ -1186,100 +1187,124 @@ ZEND_API int zend_hash_update_current_key_ex(HashTable *ht, int key_type, const
return SUCCESS;
}
if (mode != HASH_UPDATE_KEY_ANYWAY) {
Bucket *q = ht->arBuckets[num_index & ht->nTableMask];
int found = 0;
while (q != NULL) {
if (q == p) {
found = 1;
} else if (!q->nKeyLength && q->h == num_index) {
if (found) {
if (mode & HASH_UPDATE_KEY_IF_BEFORE) {
break;
} else {
if (p->nKeyLength) {
zend_hash_del(ht, p->arKey, p->nKeyLength);
} else {
zend_hash_index_del(ht, p->h);
}
return FAILURE;
}
} else {
if (mode & HASH_UPDATE_KEY_IF_AFTER) {
break;
} else {
if (p->nKeyLength) {
zend_hash_del(ht, p->arKey, p->nKeyLength);
} else {
zend_hash_index_del(ht, p->h);
}
return FAILURE;
}
}
}
q = q->pNext;
q = ht->arBuckets[num_index & ht->nTableMask];
while (q != NULL) {
if (!q->nKeyLength && q->h == num_index) {
break;
}
q = q->pNext;
}
zend_hash_index_del(ht, num_index);
} else if (key_type == HASH_KEY_IS_STRING) {
ulong h;
if (p->nKeyLength == str_length &&
memcmp(p->arKey, str_index, str_length) == 0) {
return SUCCESS;
}
if (mode != HASH_UPDATE_KEY_ANYWAY) {
ulong h = zend_inline_hash_func(str_index, str_length);
Bucket *q = ht->arBuckets[h & ht->nTableMask];
int found = 0;
h = zend_inline_hash_func(str_index, str_length);
q = ht->arBuckets[h & ht->nTableMask];
while (q != NULL) {
if (q == p) {
found = 1;
} else if (q->h == h && q->nKeyLength == str_length &&
memcmp(q->arKey, str_index, str_length) == 0) {
if (found) {
if (mode & HASH_UPDATE_KEY_IF_BEFORE) {
break;
} else {
if (p->nKeyLength) {
zend_hash_del(ht, p->arKey, p->nKeyLength);
} else {
zend_hash_index_del(ht, p->h);
}
return FAILURE;
}
} else {
if (mode & HASH_UPDATE_KEY_IF_AFTER) {
break;
} else {
if (p->nKeyLength) {
zend_hash_del(ht, p->arKey, p->nKeyLength);
} else {
zend_hash_index_del(ht, p->h);
}
return FAILURE;
}
}
}
q = q->pNext;
while (q != NULL) {
if (q->h == h && q->nKeyLength == str_length &&
memcmp(q->arKey, str_index, str_length) == 0) {
break;
}
q = q->pNext;
}
zend_hash_del(ht, str_index, str_length);
} else {
return FAILURE;
}
HANDLE_BLOCK_INTERRUPTIONS();
if (q) {
if (mode != HASH_UPDATE_KEY_ANYWAY) {
Bucket *r = p->pListLast;
int found = HASH_UPDATE_KEY_IF_BEFORE;
while (r) {
if (r == q) {
found = HASH_UPDATE_KEY_IF_AFTER;
break;
}
r = r->pListLast;
}
if (mode & found) {
/* delete current bucket */
if (p == ht->arBuckets[p->h & ht->nTableMask]) {
ht->arBuckets[p->h & ht->nTableMask] = p->pNext;
} else {
p->pLast->pNext = p->pNext;
}
if (p->pNext) {
p->pNext->pLast = p->pLast;
}
if (p->pListLast != NULL) {
p->pListLast->pListNext = p->pListNext;
} else {
/* Deleting the head of the list */
ht->pListHead = p->pListNext;
}
if (p->pListNext != NULL) {
p->pListNext->pListLast = p->pListLast;
} else {
ht->pListTail = p->pListLast;
}
if (ht->pInternalPointer == p) {
ht->pInternalPointer = p->pListNext;
}
if (ht->pDestructor) {
ht->pDestructor(p->pData);
}
if (p->pData != &p->pDataPtr) {
pefree(p->pData, ht->persistent);
}
pefree(p, ht->persistent);
ht->nNumOfElements--;
HANDLE_UNBLOCK_INTERRUPTIONS();
return FAILURE;
}
}
/* delete another bucket with the same key */
if (q == ht->arBuckets[q->h & ht->nTableMask]) {
ht->arBuckets[q->h & ht->nTableMask] = q->pNext;
} else {
q->pLast->pNext = q->pNext;
}
if (q->pNext) {
q->pNext->pLast = q->pLast;
}
if (q->pListLast != NULL) {
q->pListLast->pListNext = q->pListNext;
} else {
/* Deleting the head of the list */
ht->pListHead = q->pListNext;
}
if (q->pListNext != NULL) {
q->pListNext->pListLast = q->pListLast;
} else {
ht->pListTail = q->pListLast;
}
if (ht->pInternalPointer == q) {
ht->pInternalPointer = q->pListNext;
}
if (ht->pDestructor) {
ht->pDestructor(q->pData);
}
if (q->pData != &q->pDataPtr) {
pefree(q->pData, ht->persistent);
}
pefree(q, ht->persistent);
ht->nNumOfElements--;
}
if (p->pNext) {
p->pNext->pLast = p->pLast;
}
if (p->pLast) {
p->pLast->pNext = p->pNext;
} else{
} else {
ht->arBuckets[p->h & ht->nTableMask] = p->pNext;
}
+1 -1
View File
@@ -1,4 +1,4 @@
/* Generated by re2c 0.13.5 on Sun Aug 1 12:07:43 2010 */
/* Generated by re2c 0.13.5 on Fri Aug 26 18:01:17 2011 */
#line 1 "Zend/zend_ini_scanner.l"
/*
+----------------------------------------------------------------------+
+1 -1
View File
@@ -1,4 +1,4 @@
/* Generated by re2c 0.13.5 on Sun Aug 1 12:07:43 2010 */
/* Generated by re2c 0.13.5 on Fri Aug 26 18:01:17 2011 */
#line 3 "Zend/zend_ini_scanner_defs.h"
enum YYCONDTYPE {
+2
View File
@@ -113,6 +113,8 @@ struct _zend_module_entry {
#define ZEND_MOD_CONFLICTS(name) ZEND_MOD_CONFLICTS_EX(name, NULL, NULL)
#define ZEND_MOD_OPTIONAL(name) ZEND_MOD_OPTIONAL_EX(name, NULL, NULL)
#define ZEND_MOD_END { NULL, NULL, NULL, 0 }
struct _zend_module_dep {
const char *name; /* module name */
const char *rel; /* version relationship: NULL (exists), lt|le|eq|ge|gt (to given version) */
+21 -5
View File
@@ -27,10 +27,24 @@
#include <sys/types.h>
#include <sys/stat.h>
#if HAVE_SYS_MMAN_H
# include <sys/mman.h>
# ifndef PAGE_SIZE
# define PAGE_SIZE 4096
#if HAVE_MMAP
# if HAVE_UNISTD_H
# include <unistd.h>
# if defined(_SC_PAGESIZE)
# define REAL_PAGE_SIZE sysconf(_SC_PAGESIZE);
# elif defined(_SC_PAGE_SIZE)
# define REAL_PAGE_SIZE sysconf(_SC_PAGE_SIZE);
# endif
# endif
# if HAVE_SYS_MMAN_H
# include <sys/mman.h>
# endif
# ifndef REAL_PAGE_SIZE
# ifdef PAGE_SIZE
# define REAL_PAGE_SIZE PAGE_SIZE
# else
# define REAL_PAGE_SIZE 4096
# endif
# endif
#endif
@@ -215,9 +229,11 @@ ZEND_API int zend_stream_fixup(zend_file_handle *file_handle, char **buf, size_t
if (old_type == ZEND_HANDLE_FP && !file_handle->handle.stream.isatty && size) {
#if HAVE_MMAP
size_t page_size = REAL_PAGE_SIZE;
if (file_handle->handle.fp &&
size != 0 &&
((size - 1) % PAGE_SIZE) <= PAGE_SIZE - ZEND_MMAP_AHEAD) {
((size - 1) % page_size) <= page_size - ZEND_MMAP_AHEAD) {
/* *buf[size] is zeroed automatically by the kernel */
*buf = mmap(0, size + ZEND_MMAP_AHEAD, PROT_READ, MAP_PRIVATE, fileno(file_handle->handle.fp), 0);
if (*buf != MAP_FAILED) {
+6
View File
@@ -445,6 +445,12 @@ static MUTEX_T pow5mult_mutex;
#endif /* ZTS */
#ifdef DEBUG
static void Bug(const char *message) {
fprintf(stderr, "%s\n", message);
}
#endif
ZEND_API int zend_startup_strtod(void) /* {{{ */
{
#ifdef ZTS
+1 -1
View File
@@ -2256,7 +2256,7 @@ AC_DEFUN([PHP_SETUP_KERBEROS],[
KERBEROS_LIBS=`$KRB5_CONFIG --libs gssapi`
KERBEROS_CFLAGS=`$KRB5_CONFIG --cflags gssapi`
if test -n "$KERBEROS_LIBS" && test -n "$KERBEROS_CFLAGS"; then
if test -n "$KERBEROS_LIBS"; then
found_kerberos=yes
PHP_EVAL_LIBLINE($KERBEROS_LIBS, $1)
PHP_EVAL_INCLINE($KERBEROS_CFLAGS)
+1 -1
View File
@@ -24,7 +24,7 @@ cd $srcdir
module_ptrs="$extra_module_ptrs`echo $@ | $awk -f ./build/order_by_dep.awk`"
for ext in ${1+"$@"} ; do
header_list="$header_list ext/$ext/*.h"
header_list="$header_list ext/$ext/*.h*"
done
includes=`$awk -f ./build/print_include.awk $header_list`
+10 -2
View File
@@ -41,8 +41,8 @@ AC_CONFIG_HEADER(main/php_config.h)
PHP_MAJOR_VERSION=5
PHP_MINOR_VERSION=3
PHP_RELEASE_VERSION=7
PHP_EXTRA_VERSION="RC3"
PHP_RELEASE_VERSION=9
PHP_EXTRA_VERSION="RC4"
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`
@@ -608,6 +608,7 @@ utime \
vsnprintf \
vasprintf \
asprintf \
nanosleep \
)
dnl Some systems (like OpenSolaris) do not have nanosleep in libc
@@ -660,6 +661,13 @@ if test "$ac_cv_func_getaddrinfo" = yes; then
AC_DEFINE(HAVE_GETADDRINFO,1,[Define if you have the getaddrinfo function])
fi
dnl Check for the __sync_fetch_and_add builtin
AC_CACHE_CHECK([for __sync_fetch_and_add], ac_cv_func_sync_fetch_and_add,
[AC_TRY_LINK([],[int x;__sync_fetch_and_add(&x,1);],ac_cv_func_sync_fetch_and_add=yes,ac_cv_func_sync_fetch_and_add=no)])
if test "$ac_cv_func_sync_fetch_and_add" = yes; then
AC_DEFINE(HAVE_SYNC_FETCH_AND_ADD,1,[Define if you have the __sync_fetch_and_add function])
fi
AC_REPLACE_FUNCS(strlcat strlcpy getopt)
AC_FUNC_UTIME_NULL
AC_FUNC_ALLOCA
+2 -2
View File
@@ -106,7 +106,7 @@ const zend_function_entry bcmath_functions[] = {
PHP_FE(bcscale, arginfo_bcscale)
PHP_FE(bccomp, arginfo_bccomp)
PHP_FE(bcpowmod, arginfo_bcpowmod)
{NULL, NULL, NULL}
PHP_FE_END
};
zend_module_entry bcmath_module_entry = {
@@ -560,7 +560,7 @@ PHP_FUNCTION(bcscale)
return;
}
BCG(bc_precision) = (new_scale < 0) ? 0 : new_scale;
BCG(bc_precision) = ((int)new_scale < 0) ? 0 : new_scale;
RETURN_TRUE;
}
+13
View File
@@ -0,0 +1,13 @@
--TEST--
bcscale related problem on 64bits platforms
--SKIPIF--
<?php if(!extension_loaded("bcmath")) print "skip"; ?>
--FILE--
<?php
$var48 = bcscale(634314234334311);
$var67 = bcsqrt(false);
$var414 = bcadd(false,null,10);
die('ALIVE');
?>
--EXPECTF--
ALIVE
+1 -1
View File
@@ -107,7 +107,7 @@ static const zend_function_entry bz2_functions[] = {
PHP_FE(bzerror, arginfo_bzerror)
PHP_FE(bzcompress, arginfo_bzcompress)
PHP_FE(bzdecompress, arginfo_bzdecompress)
{NULL, NULL, NULL}
PHP_FE_END
};
zend_module_entry bz2_module_entry = {
+1 -1
View File
@@ -148,7 +148,7 @@ const zend_function_entry calendar_functions[] = {
PHP_FE(cal_from_jd, arginfo_cal_from_jd)
PHP_FE(cal_days_in_month, arginfo_cal_days_in_month)
PHP_FE(cal_info, arginfo_cal_info)
{NULL, NULL, NULL}
PHP_FE_END
};
+10 -12
View File
@@ -127,6 +127,7 @@
**************************************************************************/
#include "sdncal.h"
#include <limits.h>
#define GREGOR_SDN_OFFSET 32045
#define DAYS_PER_5_MONTHS 153
@@ -146,21 +147,12 @@ void SdnToGregorian(
long int temp;
int dayOfYear;
if (sdn <= 0) {
*pYear = 0;
*pMonth = 0;
*pDay = 0;
return;
if (sdn <= 0 ||
sdn > (LONG_MAX - 4 * GREGOR_SDN_OFFSET) / 4) {
goto fail;
}
temp = (sdn + GREGOR_SDN_OFFSET) * 4 - 1;
if (temp < 0) {
*pYear = 0;
*pMonth = 0;
*pDay = 0;
return;
}
/* Calculate the century (year/100). */
century = temp / DAYS_PER_400_YEARS;
@@ -190,6 +182,12 @@ void SdnToGregorian(
*pYear = year;
*pMonth = month;
*pDay = day;
return;
fail:
*pYear = 0;
*pMonth = 0;
*pDay = 0;
}
long int GregorianToSdn(
+36
View File
@@ -0,0 +1,36 @@
--TEST--
Bug #53574 (Integer overflow in SdnToJulian; leads to segfault)
--SKIPIF--
<?php
include 'skipif.inc';
if (PHP_INT_SIZE != 4) {
die("skip this test is for 32bit platform only");
}
?>
--FILE--
<?php
$x = 882858043;
var_dump(cal_from_jd($x, CAL_JULIAN));
--EXPECT--
array(9) {
["date"]=>
string(5) "0/0/0"
["month"]=>
int(0)
["day"]=>
int(0)
["year"]=>
int(0)
["dow"]=>
int(5)
["abbrevdayname"]=>
string(3) "Fri"
["dayname"]=>
string(6) "Friday"
["abbrevmonth"]=>
string(0) ""
["monthname"]=>
string(0) ""
}
@@ -1,14 +1,15 @@
--TEST--
Bug #53574 (Integer overflow in SdnToJulian; leads to segfault)
--SKIPIF--
<?php include 'skipif.inc'; ?>
<?php
include 'skipif.inc';
if (PHP_INT_SIZE == 4) {
die("skip this test is for 64bit platform only");
}
?>
--FILE--
<?php
if (PHP_INT_MAX == 0x7FFFFFFF) {
$x = 882858043;
} else {
$x = 3315881921229094912;
}
$x = 3315881921229094912;
var_dump(cal_from_jd($x, CAL_JULIAN));
--EXPECT--
+36
View File
@@ -0,0 +1,36 @@
--TEST--
Bug #55797: Integer overflow in SdnToGregorian leads to segfault (in optimized builds)
--SKIPIF--
<?php
include 'skipif.inc';
if (PHP_INT_SIZE != 4) {
die("skip this test is for 32bit platform only");
}
?>
--FILE--
<?php
$x = 882858030;
var_dump(cal_from_jd($x, CAL_GREGORIAN));
--EXPECTF--
array(9) {
["date"]=>
string(5) "0/0/0"
["month"]=>
int(0)
["day"]=>
int(0)
["year"]=>
int(0)
["dow"]=>
int(%d)
["abbrevdayname"]=>
string(%d) "%s"
["dayname"]=>
string(%d) "%s"
["abbrevmonth"]=>
string(0) ""
["monthname"]=>
string(0) ""
}
+36
View File
@@ -0,0 +1,36 @@
--TEST--
Bug #55797: Integer overflow in SdnToGregorian leads to segfault (in optimized builds)
--SKIPIF--
<?php
include 'skipif.inc';
if (PHP_INT_SIZE == 4) {
die("skip this test is for 64bit platform only");
}
?>
--FILE--
<?php
$x = 9223372036854743639;
var_dump(cal_from_jd($x, CAL_GREGORIAN));
--EXPECTF--
array(9) {
["date"]=>
string(5) "0/0/0"
["month"]=>
int(0)
["day"]=>
int(0)
["year"]=>
int(0)
["dow"]=>
int(%d)
["abbrevdayname"]=>
string(%d) "%s"
["dayname"]=>
string(%d) "%s"
["abbrevmonth"]=>
string(0) ""
["monthname"]=>
string(0) ""
}
+1
View File
@@ -6,6 +6,7 @@ date.timezone=UTC
<?php include 'skipif.inc'; ?>
--FILE--
<?php
putenv('TZ=UTC');
echo date("Y-m-d", easter_date(2000))."\n";
echo date("Y-m-d", easter_date(2001))."\n";
echo date("Y-m-d", easter_date(2002))."\n";
+12
View File
@@ -14,30 +14,37 @@ $jd_days = Array(
);
foreach ($jd_days as $jd_day) {
echo "=== ", $jd_day, "\n";
var_dump(jdmonthname($jd_day,0));
var_dump(jdmonthname($jd_day,1));
var_dump(jdmonthname($jd_day,2));
var_dump(jdmonthname($jd_day,3));
var_dump(jdmonthname($jd_day,4));
var_dump(jdmonthname($jd_day,5));
echo "\n";
}
echo "Done\n";
?>
--EXPECTF--
=== 2453396
string(3) "Jan"
string(7) "January"
string(3) "Jan"
string(7) "January"
string(6) "Shevat"
string(0) ""
=== 2440588
string(3) "Jan"
string(7) "January"
string(3) "Dec"
string(8) "December"
string(5) "Tevet"
string(0) ""
=== -1
string(0) ""
string(0) ""
string(0) ""
@@ -45,6 +52,8 @@ string(0) ""
string(0) ""
string(0) ""
=== Array
Warning: jdmonthname() expects parameter 1 to be long, array given in %s on line %d
bool(false)
@@ -62,10 +71,13 @@ bool(false)
Warning: jdmonthname() expects parameter 1 to be long, array given in %s on line %d
bool(false)
=== 10000000
string(3) "Dec"
string(8) "December"
string(3) "Jul"
string(4) "July"
string(6) "Tishri"
string(0) ""
Done
+2 -1
View File
@@ -4,11 +4,12 @@ unixtojd()
<?php include 'skipif.inc'; ?>
--FILE--
<?php
putenv('TZ=UTC');
echo unixtojd(40000). "\n";
echo unixtojd(1000000000). "\n";
echo unixtojd(1152459009). "\n";
?>
--EXPECT--
2440588
2452161
2452162
2453926
+3
View File
@@ -129,6 +129,9 @@ static HRESULT dotnet_init(char **p_where TSRMLS_DC)
char *where = "";
stuff = malloc(sizeof(*stuff));
if (!stuff) {
return S_FALSE;
}
memset(stuff, 0, sizeof(*stuff));
where = "CoCreateInstance";
+1 -1
View File
@@ -228,7 +228,7 @@ const zend_function_entry com_dotnet_functions[] = {
PHP_FE(com_message_pump, arginfo_com_message_pump)
PHP_FE(com_load_typelib, arginfo_com_load_typelib)
PHP_FE(com_get_active_object, arginfo_com_get_active_object)
{ NULL, NULL, NULL }
PHP_FE_END
};
/* {{{ com_dotnet_module_entry
+1 -1
View File
@@ -697,7 +697,7 @@ static const zend_function_entry com_persist_helper_methods[] = {
CPH_ME(InitNew, NULL)
CPH_ME(LoadFromStream, NULL)
CPH_ME(SaveToStream, NULL)
{NULL, NULL, NULL}
PHP_FE_END
};
static void helper_free_storage(void *obj TSRMLS_DC)
+1 -1
View File
@@ -106,7 +106,7 @@ static const zend_function_entry ctype_functions[] = {
PHP_FE(ctype_space, arginfo_ctype_space)
PHP_FE(ctype_upper, arginfo_ctype_upper)
PHP_FE(ctype_xdigit, arginfo_ctype_xdigit)
{NULL, NULL, NULL} /* Must be the last line in ctype_functions[] */
PHP_FE_END
};
/* }}} */
+119 -29
View File
@@ -150,6 +150,7 @@ static struct gcry_thread_cbs php_curl_gnutls_tsl = {
static void _php_curl_close_ex(php_curl *ch TSRMLS_DC);
static void _php_curl_close(zend_rsrc_list_entry *rsrc TSRMLS_DC);
#define SAVE_CURL_ERROR(__handle, __err) (__handle)->err.no = (int) __err;
#define CAAL(s, v) add_assoc_long_ex(return_value, s, sizeof(s), (long) v);
@@ -197,13 +198,79 @@ static int php_curl_option_url(php_curl *ch, const char *url, const int len) /*
#else
copystr = estrndup(url, len);
error = curl_easy_setopt(ch->cp, CURLOPT_URL, copystr);
zend_llist_add_element(&ch->to_free.str, &copystr);
zend_llist_add_element(&ch->to_free->str, &copystr);
#endif
return (error == CURLE_OK ? 1 : 0);
}
/* }}} */
int _php_curl_verify_handlers(php_curl *ch, int reporterror TSRMLS_DC) /* {{{ */
{
php_stream *stream;
if (!ch || !ch->handlers) {
return 0;
}
if (ch->handlers->std_err) {
stream = (php_stream *) zend_fetch_resource(&ch->handlers->std_err TSRMLS_CC, -1, NULL, NULL, 2, php_file_le_stream(), php_file_le_pstream());
if (stream == NULL) {
if (reporterror) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "CURLOPT_STDERR resource has gone away, resetting to stderr");
}
zval_ptr_dtor(&ch->handlers->std_err);
ch->handlers->std_err = NULL;
curl_easy_setopt(ch->cp, CURLOPT_STDERR, stderr);
}
}
if (ch->handlers->read && ch->handlers->read->stream) {
stream = (php_stream *) zend_fetch_resource(&ch->handlers->read->stream TSRMLS_CC, -1, NULL, NULL, 2, php_file_le_stream(), php_file_le_pstream());
if (stream == NULL) {
if (reporterror) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "CURLOPT_INFILE resource has gone away, resetting to default");
}
zval_ptr_dtor(&ch->handlers->read->stream);
ch->handlers->read->fd = 0;
ch->handlers->read->fp = 0;
ch->handlers->read->stream = NULL;
curl_easy_setopt(ch->cp, CURLOPT_INFILE, (void *) ch);
}
}
if (ch->handlers->write_header && ch->handlers->write_header->stream) {
stream = (php_stream *) zend_fetch_resource(&ch->handlers->write_header->stream TSRMLS_CC, -1, NULL, NULL, 2, php_file_le_stream(), php_file_le_pstream());
if (stream == NULL) {
if (reporterror) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "CURLOPT_WRITEHEADER resource has gone away, resetting to default");
}
zval_ptr_dtor(&ch->handlers->write_header->stream);
ch->handlers->write_header->fp = 0;
ch->handlers->write_header->stream = NULL;
ch->handlers->write_header->method = PHP_CURL_IGNORE;
curl_easy_setopt(ch->cp, CURLOPT_WRITEHEADER, (void *) ch);
}
}
if (ch->handlers->write && ch->handlers->write->stream) {
stream = (php_stream *) zend_fetch_resource(&ch->handlers->write->stream TSRMLS_CC, -1, NULL, NULL, 2, php_file_le_stream(), php_file_le_pstream());
if (stream == NULL) {
if (reporterror) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "CURLOPT_FILE resource has gone away, resetting to default");
}
zval_ptr_dtor(&ch->handlers->write->stream);
ch->handlers->write->fp = 0;
ch->handlers->write->stream = NULL;
ch->handlers->write->method = PHP_CURL_STDOUT;
ch->handlers->write->type = PHP_CURL_ASCII;
curl_easy_setopt(ch->cp, CURLOPT_FILE, (void *) ch);
}
}
return 1;
}
/* }}} */
/* {{{ arginfo */
ZEND_BEGIN_ARG_INFO_EX(arginfo_curl_version, 0, 0, 0)
ZEND_ARG_INFO(0, version)
@@ -307,7 +374,7 @@ const zend_function_entry curl_functions[] = {
PHP_FE(curl_multi_getcontent, arginfo_curl_multi_getcontent)
PHP_FE(curl_multi_info_read, arginfo_curl_multi_info_read)
PHP_FE(curl_multi_close, arginfo_curl_multi_close)
{NULL, NULL, NULL}
PHP_FE_END
};
/* }}} */
@@ -337,7 +404,6 @@ PHP_INI_BEGIN()
PHP_INI_END()
/* }}} */
/* }}} */
/* {{{ PHP_MINFO_FUNCTION
*/
PHP_MINFO_FUNCTION(curl)
@@ -821,6 +887,9 @@ PHP_MINIT_FUNCTION(curl)
int i, c = CRYPTO_num_locks();
php_curl_openssl_tsl = malloc(c * sizeof(MUTEX_T));
if (!php_curl_openssl_tsl) {
return FAILURE;
}
for (i = 0; i < c; ++i) {
php_curl_openssl_tsl[i] = tsrm_mutex_alloc();
@@ -1343,6 +1412,7 @@ PHP_FUNCTION(curl_version)
static void alloc_curl_handle(php_curl **ch)
{
*ch = emalloc(sizeof(php_curl));
(*ch)->to_free = ecalloc(1, sizeof(struct _php_curl_free));
(*ch)->handlers = ecalloc(1, sizeof(php_curl_handlers));
(*ch)->handlers->write = ecalloc(1, sizeof(php_curl_write));
(*ch)->handlers->write_header = ecalloc(1, sizeof(php_curl_write));
@@ -1353,10 +1423,13 @@ static void alloc_curl_handle(php_curl **ch)
(*ch)->header.str_len = 0;
memset(&(*ch)->err, 0, sizeof((*ch)->err));
(*ch)->handlers->write->stream = NULL;
(*ch)->handlers->write_header->stream = NULL;
(*ch)->handlers->read->stream = NULL;
zend_llist_init(&(*ch)->to_free.str, sizeof(char *), (llist_dtor_func_t) curl_free_string, 0);
zend_llist_init(&(*ch)->to_free.slist, sizeof(struct curl_slist), (llist_dtor_func_t) curl_free_slist, 0);
zend_llist_init(&(*ch)->to_free.post, sizeof(struct HttpPost), (llist_dtor_func_t) curl_free_post, 0);
zend_llist_init(&(*ch)->to_free->str, sizeof(char *), (llist_dtor_func_t) curl_free_string, 0);
zend_llist_init(&(*ch)->to_free->slist, sizeof(struct curl_slist), (llist_dtor_func_t) curl_free_slist, 0);
zend_llist_init(&(*ch)->to_free->post, sizeof(struct HttpPost), (llist_dtor_func_t) curl_free_post, 0);
}
/* }}} */
@@ -1391,6 +1464,7 @@ static void split_certinfo(char *string, zval *hash)
efree(org);
}
}
/* }}} */
/* {{{ create_certinfo
*/
@@ -1534,6 +1608,7 @@ PHP_FUNCTION(curl_copy_handle)
dupch->cp = cp;
dupch->uses = 0;
ch->uses++;
if (ch->handlers->write->stream) {
Z_ADDREF_P(dupch->handlers->write->stream);
dupch->handlers->write->stream = ch->handlers->write->stream;
@@ -1574,18 +1649,21 @@ PHP_FUNCTION(curl_copy_handle)
zval_add_ref(&ch->handlers->write_header->func_name);
dupch->handlers->write_header->func_name = ch->handlers->write_header->func_name;
}
if (ch->handlers->progress->func_name) {
zval_add_ref(&ch->handlers->progress->func_name);
dupch->handlers->progress->func_name = ch->handlers->progress->func_name;
}
dupch->handlers->progress->method = ch->handlers->progress->method;
curl_easy_setopt(dupch->cp, CURLOPT_ERRORBUFFER, dupch->err.str);
curl_easy_setopt(dupch->cp, CURLOPT_FILE, (void *) dupch);
curl_easy_setopt(dupch->cp, CURLOPT_INFILE, (void *) dupch);
curl_easy_setopt(dupch->cp, CURLOPT_WRITEHEADER, (void *) dupch);
curl_easy_setopt(dupch->cp, CURLOPT_PROGRESSDATA, (void *) dupch);
zend_llist_copy(&dupch->to_free.str, &ch->to_free.str);
/* Don't try to free copied strings, they're free'd when the original handle is destroyed */
dupch->to_free.str.dtor = NULL;
zend_llist_copy(&dupch->to_free.slist, &ch->to_free.slist);
zend_llist_copy(&dupch->to_free.post, &ch->to_free.post);
efree(dupch->to_free);
dupch->to_free = ch->to_free;
/* Keep track of cloned copies to avoid invoking curl destructors for every clone */
Z_ADDREF_P(ch->clone);
@@ -1779,7 +1857,7 @@ string_copy:
#endif
copystr = estrndup(Z_STRVAL_PP(zvalue), Z_STRLEN_PP(zvalue));
error = curl_easy_setopt(ch->cp, option, copystr);
zend_llist_add_element(&ch->to_free.str, &copystr);
zend_llist_add_element(&ch->to_free->str, &copystr);
} else {
#if LIBCURL_VERSION_NUM >= 0x071100
/* Strings passed to libcurl as ’char *’ arguments, are copied by the library... NOTE: before 7.17.0 strings were not copied. */
@@ -1819,6 +1897,9 @@ string_copy:
switch (option) {
case CURLOPT_FILE:
if (((php_stream *) what)->mode[0] != 'r' || ((php_stream *) what)->mode[1] == '+') {
if (ch->handlers->write->stream) {
Z_DELREF_P(ch->handlers->write->stream);
}
Z_ADDREF_PP(zvalue);
ch->handlers->write->fp = fp;
ch->handlers->write->method = PHP_CURL_FILE;
@@ -1831,6 +1912,9 @@ string_copy:
break;
case CURLOPT_WRITEHEADER:
if (((php_stream *) what)->mode[0] != 'r' || ((php_stream *) what)->mode[1] == '+') {
if (ch->handlers->write_header->stream) {
Z_DELREF_P(ch->handlers->write_header->stream);
}
Z_ADDREF_PP(zvalue);
ch->handlers->write_header->fp = fp;
ch->handlers->write_header->method = PHP_CURL_FILE;
@@ -1842,6 +1926,9 @@ string_copy:
}
break;
case CURLOPT_INFILE:
if (ch->handlers->read->stream) {
Z_DELREF_P(ch->handlers->read->stream);
}
Z_ADDREF_PP(zvalue);
ch->handlers->read->fp = fp;
ch->handlers->read->fd = Z_LVAL_PP(zvalue);
@@ -2011,7 +2098,7 @@ string_copy:
return 1;
}
zend_llist_add_element(&ch->to_free.post, &first);
zend_llist_add_element(&ch->to_free->post, &first);
error = curl_easy_setopt(ch->cp, CURLOPT_HTTPPOST, first);
} else {
@@ -2025,7 +2112,7 @@ string_copy:
convert_to_string_ex(zvalue);
post = estrndup(Z_STRVAL_PP(zvalue), Z_STRLEN_PP(zvalue));
zend_llist_add_element(&ch->to_free.str, &post);
zend_llist_add_element(&ch->to_free->str, &post);
error = curl_easy_setopt(ch->cp, CURLOPT_POSTFIELDS, post);
error = curl_easy_setopt(ch->cp, CURLOPT_POSTFIELDSIZE, Z_STRLEN_PP(zvalue));
@@ -2061,7 +2148,7 @@ string_copy:
return 1;
}
}
zend_llist_add_element(&ch->to_free.slist, &slist);
zend_llist_add_element(&ch->to_free->slist, &slist);
error = curl_easy_setopt(ch->cp, option, slist);
@@ -2091,7 +2178,7 @@ string_copy:
copystr = estrndup(Z_STRVAL_PP(zvalue), Z_STRLEN_PP(zvalue));
error = curl_easy_setopt(ch->cp, option, copystr);
zend_llist_add_element(&ch->to_free.str, &copystr);
zend_llist_add_element(&ch->to_free->str, &copystr);
#endif
break;
}
@@ -2208,6 +2295,8 @@ PHP_FUNCTION(curl_exec)
ZEND_FETCH_RESOURCE(ch, php_curl *, &zid, -1, le_curl_name, le_curl);
_php_curl_verify_handlers(ch, 1 TSRMLS_CC);
_php_curl_cleanup_handle(ch);
error = curl_easy_perform(ch->cp);
@@ -2220,6 +2309,14 @@ PHP_FUNCTION(curl_exec)
RETURN_FALSE;
}
if (ch->handlers->std_err) {
php_stream *stream;
stream = (php_stream*)zend_fetch_resource(&ch->handlers->std_err TSRMLS_CC, -1, NULL, NULL, 2, php_file_le_stream(), php_file_le_pstream());
if (stream) {
php_stream_flush(stream);
}
}
if (ch->handlers->write->method == PHP_CURL_RETURN && ch->handlers->write->buf.len > 0) {
smart_str_0(&ch->handlers->write->buf);
RETURN_STRINGL(ch->handlers->write->buf.c, ch->handlers->write->buf.len, 1);
@@ -2497,25 +2594,18 @@ static void _php_curl_close_ex(php_curl *ch TSRMLS_DC)
fprintf(stderr, "DTOR CALLED, ch = %x\n", ch);
#endif
/* Prevent crash inside cURL if passed file has already been closed */
if (ch->handlers->std_err && Z_REFCOUNT_P(ch->handlers->std_err) <= 0) {
curl_easy_setopt(ch->cp, CURLOPT_STDERR, stderr);
}
_php_curl_verify_handlers(ch, 0 TSRMLS_CC);
curl_easy_cleanup(ch->cp);
zend_llist_clean(&ch->to_free.str);
/* cURL destructors should be invoked only by last curl handle */
if (Z_REFCOUNT_P(ch->clone) <= 1) {
zend_llist_clean(&ch->to_free.slist);
zend_llist_clean(&ch->to_free.post);
zend_llist_clean(&ch->to_free->str);
zend_llist_clean(&ch->to_free->slist);
zend_llist_clean(&ch->to_free->post);
efree(ch->to_free);
FREE_ZVAL(ch->clone);
} else {
Z_DELREF_P(ch->clone);
ch->to_free.slist.dtor = NULL;
ch->to_free.post.dtor = NULL;
zend_llist_clean(&ch->to_free.slist);
zend_llist_clean(&ch->to_free.post);
}
if (ch->handlers->write->buf.len > 0) {
+24
View File
@@ -211,6 +211,19 @@ PHP_FUNCTION(curl_multi_exec)
ZEND_FETCH_RESOURCE(mh, php_curlm *, &z_mh, -1, le_curl_multi_handle_name, le_curl_multi_handle);
{
zend_llist_position pos;
php_curl *ch;
zval *pz_ch;
for(pz_ch = (zval *)zend_llist_get_first_ex(&mh->easyh, &pos); pz_ch;
pz_ch = (zval *)zend_llist_get_next_ex(&mh->easyh, &pos)) {
ZEND_FETCH_RESOURCE(ch, php_curl *, &pz_ch, -1, le_curl_name, le_curl);
_php_curl_verify_handlers(ch, 1 TSRMLS_CC);
}
}
convert_to_long_ex(&z_still_running);
still_running = Z_LVAL_P(z_still_running);
result = curl_multi_perform(mh->multi, &still_running);
@@ -324,6 +337,17 @@ void _php_curl_multi_close(zend_rsrc_list_entry *rsrc TSRMLS_DC) /* {{{ */
{
php_curlm *mh = (php_curlm *) rsrc->ptr;
if (mh) {
zend_llist_position pos;
php_curl *ch;
zval *pz_ch;
for(pz_ch = (zval *)zend_llist_get_first_ex(&mh->easyh, &pos); pz_ch;
pz_ch = (zval *)zend_llist_get_next_ex(&mh->easyh, &pos)) {
ch = (php_curl *) zend_fetch_resource(&pz_ch TSRMLS_CC, -1, le_curl_name, NULL, 1, le_curl);
_php_curl_verify_handlers(ch, 0 TSRMLS_CC);
}
curl_multi_cleanup(mh->multi);
zend_llist_clean(&mh->easyh);
efree(mh);
+2 -1
View File
@@ -131,7 +131,7 @@ struct _php_curl_free {
typedef struct {
struct _php_curl_error err;
struct _php_curl_free to_free;
struct _php_curl_free *to_free;
struct _php_curl_send_headers header;
void ***thread_ctx;
CURL *cp;
@@ -150,6 +150,7 @@ typedef struct {
void _php_curl_cleanup_handle(php_curl *);
void _php_curl_multi_cleanup_list(void *data);
int _php_curl_verify_handlers(php_curl *ch, int reporterror TSRMLS_DC);
/* streams support */
+48
View File
@@ -0,0 +1,48 @@
--TEST--
Bug #27023 (CURLOPT_POSTFIELDS does not parse content types for files)
--SKIPIF--
<?php
if (!extension_loaded("curl")) {
exit("skip curl extension not loaded");
}
if (false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) {
exit("skip PHP_CURL_HTTP_REMOTE_SERVER env variable is not defined");
}
?>
--FILE--
<?php
$host = getenv('PHP_CURL_HTTP_REMOTE_SERVER');
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "{$host}/get.php?test=file");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$params = array('file' => '@' . __DIR__ . '/curl_testdata1.txt');
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
var_dump(curl_exec($ch));
$params = array('file' => '@' . __DIR__ . '/curl_testdata1.txt;type=text/plain');
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
var_dump(curl_exec($ch));
$params = array('file' => '@' . __DIR__ . '/curl_testdata1.txt;filename=foo.txt');
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
var_dump(curl_exec($ch));
$params = array('file' => '@' . __DIR__ . '/curl_testdata1.txt;type=text/plain;filename=foo.txt');
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
var_dump(curl_exec($ch));
$params = array('file' => '@' . __DIR__ . '/curl_testdata1.txt;filename=foo.txt;type=text/plain');
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
var_dump(curl_exec($ch));
curl_close($ch);
?>
--EXPECTF--
string(%d) "curl_testdata1.txt|application/octet-stream"
string(%d) "curl_testdata1.txt|text/plain"
string(%d) "foo.txt|application/octet-stream"
string(%d) "foo.txt|text/plain"
string(%d) "foo.txt|text/plain"
+5 -2
View File
@@ -18,16 +18,19 @@ $ch = curl_init();
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_STDERR, $fp);
curl_setopt($ch, CURLOPT_URL, "");
curl_setopt($ch, CURLOPT_URL, getenv('PHP_CURL_HTTP_REMOTE_SERVER'));
fclose($fp); // <-- premature close of $fp caused a crash!
curl_exec($ch);
curl_close($ch);
echo "Ok\n";
?>
--CLEAN--
<?php @unlink(dirname(__FILE__) . '/bug48203.tmp'); ?>
--EXPECT--
--EXPECTF--
Warning: curl_exec(): CURLOPT_STDERR resource has gone away, resetting to stderr in %sbug48203.php on line %d
%A
Ok
+90
View File
@@ -0,0 +1,90 @@
--TEST--
Variation of bug #48203 with curl_multi_exec (Crash when file pointers passed to curl are closed before calling curl_multi_exec)
--SKIPIF--
<?php
if (!extension_loaded("curl")) {
exit("skip curl extension not loaded");
}
if (false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) {
exit("skip PHP_CURL_HTTP_REMOTE_SERVER env variable is not defined");
}
?>
--FILE--
<?php
function checkForClosedFilePointer($curl_option, $description) {
$fp = fopen(dirname(__FILE__) . '/bug48203.tmp', 'w');
$ch1 = curl_init();
$ch2 = curl_init();
$options = array(
CURLOPT_RETURNTRANSFER => 1,
$curl_option => $fp,
CURLOPT_URL => getenv("PHP_CURL_HTTP_REMOTE_SERVER")
);
// we also need to set CURLOPT_VERBOSE to test CURLOPT_STDERR properly
if (CURLOPT_STDERR == $curl_option) {
$options[CURLOPT_VERBOSE] = 1;
}
if (CURLOPT_INFILE == $curl_option) {
$options[CURLOPT_UPLOAD] = 1;
}
curl_setopt_array($ch1, $options);
curl_setopt_array($ch2, $options);
fclose($fp); // <-- premature close of $fp caused a crash!
$mh = curl_multi_init();
curl_multi_add_handle($mh, $ch1);
curl_multi_add_handle($mh, $ch2);
$active = 0;
do {
curl_multi_exec($mh, $active);
} while ($active > 0);
curl_multi_remove_handle($mh, $ch1);
curl_multi_remove_handle($mh, $ch2);
curl_multi_close($mh);
echo "Ok for $description\n";
}
$options_to_check = array(
"CURLOPT_STDERR", "CURLOPT_WRITEHEADER", "CURLOPT_FILE", "CURLOPT_INFILE"
);
foreach($options_to_check as $option) {
checkForClosedFilePointer(constant($option), $option);
}
?>
--CLEAN--
<?php @unlink(dirname(__FILE__) . '/bug48203.tmp'); ?>
--EXPECTF--
Warning: curl_multi_exec(): CURLOPT_STDERR resource has gone away, resetting to stderr in %sbug48203_multi.php on line 36
Warning: curl_multi_exec(): CURLOPT_STDERR resource has gone away, resetting to stderr in %sbug48203_multi.php on line 36
%A
Ok for CURLOPT_STDERR
%A
Warning: curl_multi_exec(): CURLOPT_WRITEHEADER resource has gone away, resetting to default in %sbug48203_multi.php on line 36
Warning: curl_multi_exec(): CURLOPT_WRITEHEADER resource has gone away, resetting to default in %sbug48203_multi.php on line 36
Ok for CURLOPT_WRITEHEADER
Warning: curl_multi_exec(): CURLOPT_FILE resource has gone away, resetting to default in %sbug48203_multi.php on line 36
Warning: curl_multi_exec(): CURLOPT_FILE resource has gone away, resetting to default in %sbug48203_multi.php on line 36
%A
Ok for CURLOPT_FILE
Warning: curl_multi_exec(): CURLOPT_INFILE resource has gone away, resetting to default in %sbug48203_multi.php on line 36
Warning: curl_multi_exec(): CURLOPT_INFILE resource has gone away, resetting to default in %sbug48203_multi.php on line 36
Ok for CURLOPT_INFILE
+72
View File
@@ -0,0 +1,72 @@
--TEST--
Bug #54798 (Segfault when CURLOPT_STDERR file pointer is closed before calling curl_exec)
--SKIPIF--
<?php
if (!extension_loaded("curl")) {
exit("skip curl extension not loaded");
}
if (false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) {
exit("skip PHP_CURL_HTTP_REMOTE_SERVER env variable is not defined");
}
?>
--FILE--
<?php
function checkForClosedFilePointer($host, $curl_option, $description) {
$fp = fopen(dirname(__FILE__) . '/bug54798.tmp', 'w+');
$ch = curl_init();
// we also need CURLOPT_VERBOSE to be set to test CURLOPT_STDERR properly
if (CURLOPT_STDERR == $curl_option) {
curl_setopt($ch, CURLOPT_VERBOSE, 1);
}
if (CURLOPT_INFILE == $curl_option) {
curl_setopt($ch, CURLOPT_UPLOAD, 1);
}
curl_setopt($ch, $curl_option, $fp);
curl_setopt($ch, CURLOPT_URL, $host);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
fclose($fp); // <-- premature close of $fp caused a crash!
curl_exec($ch);
curl_close($ch);
echo "Ok for $description\n";
}
$options_to_check = array(
"CURLOPT_STDERR",
"CURLOPT_WRITEHEADER",
"CURLOPT_FILE",
"CURLOPT_INFILE"
);
$host = getenv('PHP_CURL_HTTP_REMOTE_SERVER');
foreach($options_to_check as $option) {
checkForClosedFilePointer($host, constant($option), $option);
}
?>
--CLEAN--
<?php @unlink(dirname(__FILE__) . '/bug54798.tmp'); ?>
--EXPECTF--
Warning: curl_exec(): CURLOPT_STDERR resource has gone away, resetting to stderr in %sbug54798.php on line %d
* About to connect() %a
* Closing connection #%d
Ok for CURLOPT_STDERR
Warning: curl_exec(): CURLOPT_WRITEHEADER resource has gone away, resetting to default in %sbug54798.php on line 24
Ok for CURLOPT_WRITEHEADER
Warning: curl_exec(): CURLOPT_FILE resource has gone away, resetting to default in %sbug54798.php on line 24
%a
Ok for CURLOPT_FILE
Warning: curl_exec(): CURLOPT_INFILE resource has gone away, resetting to default in %sbug54798.php on line %d
Ok for CURLOPT_INFILE
+1 -1
View File
@@ -4,7 +4,7 @@ Test CURLOPT_READDATA without a callback function
Mattijs Hoitink mattijshoitink@gmail.com
#Testfest Utrecht 2009
--SKIPIF--
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip"; ?>
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip need PHP_CURL_HTTP_REMOTE_SERVER environment variable"; ?>
--FILE--
<?php
+7 -1
View File
@@ -3,7 +3,13 @@ Test curl_error() & curl_errno() function with problematic host
--CREDITS--
TestFest 2009 - AFUP - Perrick Penet <perrick@noparking.net>
--SKIPIF--
<?php if (!extension_loaded("curl")) print "skip"; ?>
<?php
if (!extension_loaded("curl")) print "skip";
$addr = "www.".uniqid().".".uniqid();
if (gethostbyname($addr) != $addr) {
print "skip catch all dns";
}
?>
--FILE--
<?php
+7 -1
View File
@@ -3,7 +3,13 @@ Test curl_error() & curl_errno() function with problematic proxy
--CREDITS--
TestFest 2009 - AFUP - Perrick Penet <perrick@noparking.net>
--SKIPIF--
<?php if (!extension_loaded("curl")) print "skip"; ?>
<?php
if (!extension_loaded("curl")) print "skip";
$addr = "www.".uniqid().".".uniqid();
if (gethostbyname($addr) != $addr) {
print "skip catch all dns";
}
?>
--FILE--
<?php
+2 -2
View File
@@ -3,7 +3,7 @@ Test curl_opt() function with COOKIE
--CREDITS--
TestFest 2009 - AFUP - Xavier Gorse <xgorse@elao.com>
--SKIPIF--
<?php if (!extension_loaded("curl") || false === getenv(b'PHP_CURL_HTTP_REMOTE_SERVER')) print "skip"; ?>
<?php if (!extension_loaded("curl") || false === getenv(b'PHP_CURL_HTTP_REMOTE_SERVER')) print "skip need PHP_CURL_HTTP_REMOTE_SERVER environment variable"; ?>
--FILE--
<?php
/* Prototype : bool curl_setopt(resource ch, int option, mixed value)
@@ -35,4 +35,4 @@ TestFest 2009 - AFUP - Xavier Gorse <xgorse@elao.com>
*** Testing curl with cookie ***
string(3) "bar"
===DONE===
@@ -4,7 +4,7 @@ Test curl_copy_handle() with simple get
Rick Buitenman <rick@meritos.nl>
#testfest Utrecht 2009
--SKIPIF--
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip"; ?>
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip need PHP_CURL_HTTP_REMOTE_SERVER environment variable"; ?>
--FILE--
<?php
@@ -39,4 +39,4 @@ string(106) "array(2) {
array(0) {
}
"
===DONE===
===DONE===
@@ -4,7 +4,7 @@ Test curl_copy_handle() with simple POST
Rick Buitenman <rick@meritos.nl>
#testfest Utrecht 2009
--SKIPIF--
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip"; ?>
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip need PHP_CURL_HTTP_REMOTE_SERVER environment variable"; ?>
--FILE--
<?php
$host = getenv('PHP_CURL_HTTP_REMOTE_SERVER');
@@ -29,8 +29,6 @@ Rick Buitenman <rick@meritos.nl>
var_dump( $curl_content );
?>
===DONE===
--XFAIL--
This test fails, the copy seems to be missing the CURLOPT_POSTFIELDS after the original is closed
--EXPECTF--
*** Testing curl copy handle with simple POST ***
string(163) "array(1) {
@@ -4,7 +4,7 @@ Test curl_copy_handle() after exec()
Rick Buitenman <rick@meritos.nl>
#testfest Utrecht 2009
--SKIPIF--
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip"; ?>
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip need PHP_CURL_HTTP_REMOTE_SERVER environment variable"; ?>
--FILE--
<?php
@@ -41,4 +41,4 @@ string(106) "array(2) {
array(0) {
}
"
===DONE===
===DONE===
@@ -4,7 +4,7 @@ Test curl_copy_handle() after exec() with POST
Rick Buitenman <rick@meritos.nl>
#testfest Utrecht 2009
--SKIPIF--
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip"; ?>
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip need PHP_CURL_HTTP_REMOTE_SERVER environment variable"; ?>
--FILE--
<?php
@@ -32,8 +32,6 @@ Rick Buitenman <rick@meritos.nl>
var_dump( $curl_content_copy );
?>
===DONE===
--XFAIL--
This test fails, the output of the copy seems to be corrupted if the original is closed after exec()
--EXPECTF--
*** Test curl_copy_handle() after exec() with POST ***
string(163) "array(1) {
@@ -4,7 +4,7 @@ Test curl_copy_handle() with User Agent
Rick Buitenman <rick@meritos.nl>
#testfest Utrecht 2009
--SKIPIF--
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip"; ?>
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip need PHP_CURL_HTTP_REMOTE_SERVER environment variable"; ?>
--FILE--
<?php
@@ -1,7 +1,7 @@
--TEST--
Test curl_copy_handle() with simple POST
--SKIPIF--
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip"; ?>
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip need PHP_CURL_HTTP_REMOTE_SERVER environment variable"; ?>
--FILE--
<?php
$host = getenv('PHP_CURL_HTTP_REMOTE_SERVER');
@@ -0,0 +1,25 @@
--TEST--
Test curl_copy_handle() with CURLOPT_PROGRESSFUNCTION
--SKIPIF--
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip need PHP_CURL_HTTP_REMOTE_SERVER environment variable"; ?>
--FILE--
<?php
$host = getenv('PHP_CURL_HTTP_REMOTE_SERVER');
$url = "{$host}/get.php";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_NOPROGRESS, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_PROGRESSFUNCTION, function() { });
$ch2 = curl_copy_handle($ch);
echo curl_exec($ch), PHP_EOL;
unset($ch);
echo curl_exec($ch2);
?>
--EXPECTF--
Hello World!
Hello World!
Hello World!
Hello World!
+13 -5
View File
@@ -4,7 +4,15 @@ curl_error() function - basic test for curl_error using a fake url
Mattijs Hoitink mattijshoitink@gmail.com
#Testfest Utrecht 2009
--SKIPIF--
<?php if (!extension_loaded("curl")) print "skip"; ?>
<?php
if (!extension_loaded("curl")) die("skip\n");
$url = "fakeURL";
$ip = gethostbyname($url);
if ($ip != $url) die("skip 'fakeURL' resolves to $ip\n");
?>
--FILE--
<?php
/*
@@ -21,13 +29,13 @@ echo "== Testing curl_error with a fake URL ==\n";
// cURL handler
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
ob_start(); // start output buffering
curl_exec($ch);
echo "Error: " . curl_error($ch);
var_dump(curl_error($ch));
curl_close($ch);
?>
--EXPECT--
--EXPECTF--
== Testing curl_error with a fake URL ==
Error: Couldn't resolve host 'fakeURL'
string(%d) "%sfakeURL%s"
@@ -0,0 +1,38 @@
--TEST--
Memory corruption error if fp of just created file is closed before curl_close.
--CREDITS--
Alexey Shein <confik@gmail.com>
--SKIPIF--
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip"; ?>
--FILE--
<?php
$ch = curl_init(getenv('PHP_CURL_HTTP_REMOTE_SERVER'));
$temp_file = dirname(__FILE__) . '/curl_file_deleted_before_curl_close.tmp';
if (file_exists($temp_file)) {
unlink($temp_file); // file should not exist before test
}
$handle = fopen($temp_file, 'w');
curl_setopt($ch, CURLOPT_STDERR, $handle);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_exec($ch);
fclose($handle); // causes glibc memory error
//unlink($temp_file); // uncomment to test segfault (file not found on iowrite.c)
curl_close($ch);
echo "Closed correctly\n";
?>
--CLEAN--
<?php
unlink(dirname(__FILE__) . '/curl_file_deleted_before_curl_close.tmp');
?>
--EXPECTF--
* Closing connection #%d
Closed correctly
@@ -5,7 +5,10 @@ Rein Velt (rein@velt.org)
#TestFest Utrecht 20090509
--SKIPIF--
<?php
if (!extension_loaded('curl')) print 'skip';
if (!extension_loaded('curl')) print 'skip need ext/curl';
if (false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) {
exit("skip PHP_CURL_HTTP_REMOTE_SERVER env variable is not defined");
}
?>
--FILE--
<?php
@@ -16,7 +19,8 @@ if (!extension_loaded('curl')) print 'skip';
$ch2=curl_init();
//SET URL AND OTHER OPTIONS
curl_setopt($ch1, CURLOPT_URL, "http://php.net/robots.txt");
$host = getenv('PHP_CURL_HTTP_REMOTE_SERVER');
curl_setopt($ch1, CURLOPT_URL, "{$host}/get.php?test=getpost&get_param=Hello%20World");
curl_setopt($ch2, CURLOPT_URL, "file://".dirname(__FILE__). DIRECTORY_SEPARATOR . "curl_testdata2.txt");
curl_setopt($ch1, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch2, CURLOPT_RETURNTRANSFER, true);
@@ -46,19 +50,13 @@ if (!extension_loaded('curl')) print 'skip';
echo $results2;
?>
--EXPECT--
User-agent: *
Disallow: /backend/
Disallow: /distributions/
Disallow: /stats/
Disallow: /source.php
Disallow: /search.php
Disallow: /mod.php
Disallow: /manual/add-note.php
Disallow: /harming/humans
Disallow: /ignoring/human/orders
Disallow: /harm/to/self
--EXPECTF--
array(2) {
["test"]=>
string(7) "getpost"
["get_param"]=>
string(11) "Hello World"
}
array(0) {
}
CURL2
@@ -46,6 +46,7 @@ $returnContent = curl_exec($ch);
curl_close($ch);
var_dump($returnContent);
isset($tempname) and is_file($tempname) and @unlink($tempname);
?>
--EXPECT--
+5 -3
View File
@@ -4,7 +4,7 @@ curl_setopt basic tests with CURLOPT_STDERR.
Paul Sohier
#phptestfest utrecht
--SKIPIF--
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip"; ?>
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip need PHP_CURL_HTTP_REMOTE_SERVER environment variable"; ?>
--FILE--
<?php
@@ -26,7 +26,7 @@ $curl_content = curl_exec($ch);
fclose($handle);
unset($handle);
var_dump( file_get_contents($temp_file) );
var_dump(preg_replace('/[\r\n]/', ' ', file_get_contents($temp_file)));
@unlink($temp_file);
ob_start(); // start output buffering
@@ -38,7 +38,7 @@ ob_end_clean();
fclose($handle);
unset($handle);
var_dump( file_get_contents($temp_file) );
var_dump(preg_replace('/[\r\n]/', ' ', file_get_contents($temp_file)));
@unlink($temp_file);
curl_close($ch);
@@ -48,3 +48,5 @@ curl_close($ch);
*** Testing curl_setopt with CURLOPT_STDERR
string(%d) "%S"
string(%d) "%S"
* Closing connection #%d
+1 -1
View File
@@ -4,7 +4,7 @@ curl_setopt() call with CURLOPT_HTTPHEADER
Paul Sohier
#phptestfest utrecht
--SKIPIF--
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip"; ?>
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip need PHP_CURL_HTTP_REMOTE_SERVER environment variable"; ?>
--FILE--
<?php
+1 -1
View File
@@ -4,7 +4,7 @@ curl_setopt() call with CURLOPT_RETURNTRANSFER
Paul Sohier
#phptestfest utrecht
--SKIPIF--
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip"; ?>
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip need PHP_CURL_HTTP_REMOTE_SERVER environment variable"; ?>
--FILE--
<?php
+4 -1
View File
@@ -2,9 +2,12 @@
Test curl_version() function : error conditions
--SKIPIF--
<?php
if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) {
if (!extension_loaded("curl")) {
die('skip - curl extension not available in this build');
}
if (!getenv('PHP_CURL_HTTP_REMOTE_SERVER')) {
echo "skip need PHP_CURL_HTTP_REMOTE_SERVER environment variable";
}
?>
--FILE--
<?php
+5 -2
View File
@@ -2,8 +2,11 @@
Test curl_version() function : usage variations - test values for $ascii argument
--SKIPIF--
<?php
if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) {
die('skip - curl extension not available in this build');
if (!extension_loaded("curl")) {
echo "skip - curl extension not available in this build";
}
if (!getenv('PHP_CURL_HTTP_REMOTE_SERVER')) {
echo "skip need PHP_CURL_HTTP_REMOTE_SERVER environment variable";
}
?>
--FILE--
@@ -6,7 +6,14 @@ Dutch UG, TestFest 2009, Utrecht
--DESCRIPTION--
Hit the host identified by PHP_CURL_HTTP_REMOTE_SERVER and determine that the headers are sent to the callback specified for CURLOPT_HEADERFUNCTION. Different test servers specified for PHP_CURL_HTTP_REMOTE_SERVER might return different sets of headers. Just test for HTTP/1.1 200 OK.
--SKIPIF--
<?php if (!extension_loaded("curl") || false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) print "skip"; ?>
<?php
if (!extension_loaded("curl")) {
echo "skip - curl extension not available in this build";
}
if (!getenv('PHP_CURL_HTTP_REMOTE_SERVER')) {
echo "skip need PHP_CURL_HTTP_REMOTE_SERVER environment variable";
}
?>
--FILE--
<?php
+7 -1
View File
@@ -1,5 +1,6 @@
<?php
switch($_GET['test']) {
$test = isset($_GET['test']) ? $_GET['test'] : null;
switch($test) {
case 'post':
var_dump($_POST);
break;
@@ -25,6 +26,11 @@
case 'contenttype':
header('Content-Type: text/plain;charset=utf-8');
break;
case 'file':
if (isset($_FILES['file'])) {
echo $_FILES['file']['name'] . '|' . $_FILES['file']['type'];
}
break;
default:
echo "Hello World!\n";
echo "Hello World!";
+1
View File
@@ -19,6 +19,7 @@
/* $Id$ */
#include "timelib.h"
#include <math.h>
timelib_rel_time *timelib_diff(timelib_time *one, timelib_time *two)
{
+219 -153
View File
File diff suppressed because it is too large. Load diff
+122 -56
View File
@@ -119,8 +119,8 @@ typedef unsigned char uchar;
#define TIMELIB_DEINIT timelib_string_free(str)
#define TIMELIB_ADJUST_RELATIVE_WEEKDAY() if (in->time.have_weekday_relative && (in.rel.d > 0)) { in.rel.d -= 7; }
#define TIMELIB_PROCESS_YEAR(x) { \
if ((x) == TIMELIB_UNSET) { \
#define TIMELIB_PROCESS_YEAR(x, l) { \
if (((x) == TIMELIB_UNSET) || ((l) >= 4)) { \
/* (x) = 0; */ \
} else if ((x) < 100) { \
if ((x) < 70) { \
@@ -438,7 +438,7 @@ static char *timelib_string(Scanner *s)
return tmp;
}
static timelib_sll timelib_get_nr(char **ptr, int max_length)
static timelib_sll timelib_get_nr_ex(char **ptr, int max_length, int *scanned_length)
{
char *begin, *end, *str;
timelib_sll tmp_nr = TIMELIB_UNSET;
@@ -456,6 +456,9 @@ static timelib_sll timelib_get_nr(char **ptr, int max_length)
++len;
}
end = *ptr;
if (scanned_length) {
*scanned_length = end - begin;
}
str = calloc(1, end - begin + 1);
memcpy(str, begin, end - begin);
tmp_nr = strtoll(str, NULL, 10);
@@ -463,6 +466,11 @@ static timelib_sll timelib_get_nr(char **ptr, int max_length)
return tmp_nr;
}
static timelib_sll timelib_get_nr(char **ptr, int max_length)
{
return timelib_get_nr_ex(ptr, max_length, NULL);
}
static void timelib_skip_day_suffix(char **ptr)
{
if (isspace(**ptr)) {
@@ -775,7 +783,7 @@ static long timelib_lookup_zone(char **ptr, int *dst, char **tz_abbr, int *found
return value;
}
static long timelib_get_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_found, const timelib_tzdb *tzdb)
static long timelib_get_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_found, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_wrapper)
{
timelib_tzinfo *res;
long retval = 0;
@@ -824,7 +832,7 @@ static long timelib_get_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_
#endif
/* If we have a TimeZone identifier to start with, use it */
if (strstr(tz_abbr, "/") || strcmp(tz_abbr, "UTC") == 0) {
if ((res = timelib_parse_tzfile(tz_abbr, tzdb)) != NULL) {
if ((res = tz_wrapper(tz_abbr, tzdb)) != NULL) {
t->tz_info = res;
t->zone_type = TIMELIB_ZONETYPE_ID;
found++;
@@ -853,7 +861,7 @@ static long timelib_get_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_
} \
}
static int scan(Scanner *s)
static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper)
{
uchar *cursor = s->cur;
char *str, *ptr = NULL;
@@ -1186,7 +1194,7 @@ weekdayof = (reltextnumber|reltexttext) space (dayfull|dayabbr) space 'of
}
if (*ptr != '\0') {
s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb);
s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_get_wrapper);
if (tz_not_found) {
add_error(s, "The timezone could not be found in the database");
}
@@ -1227,7 +1235,7 @@ weekdayof = (reltextnumber|reltexttext) space (dayfull|dayabbr) space 'of
s->time->h = timelib_get_nr((char **) &ptr, 2);
s->time->i = timelib_get_nr((char **) &ptr, 2);
s->time->s = 0;
s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, s->tzdb);
s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, s->tzdb, tz_get_wrapper);
break;
case 1:
s->time->y = timelib_get_nr((char **) &ptr, 4);
@@ -1252,7 +1260,7 @@ weekdayof = (reltextnumber|reltexttext) space (dayfull|dayabbr) space 'of
s->time->s = timelib_get_nr((char **) &ptr, 2);
if (*ptr != '\0') {
s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb);
s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_get_wrapper);
if (tz_not_found) {
add_error(s, "The timezone could not be found in the database");
}
@@ -1263,14 +1271,15 @@ weekdayof = (reltextnumber|reltexttext) space (dayfull|dayabbr) space 'of
americanshort | american
{
int length = 0;
DEBUG_OUTPUT("americanshort | american");
TIMELIB_INIT;
TIMELIB_HAVE_DATE();
s->time->m = timelib_get_nr((char **) &ptr, 2);
s->time->d = timelib_get_nr((char **) &ptr, 2);
if (*ptr == '/') {
s->time->y = timelib_get_nr((char **) &ptr, 4);
TIMELIB_PROCESS_YEAR(s->time->y);
s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
TIMELIB_PROCESS_YEAR(s->time->y, length);
}
TIMELIB_DEINIT;
return TIMELIB_AMERICAN;
@@ -1290,53 +1299,57 @@ weekdayof = (reltextnumber|reltexttext) space (dayfull|dayabbr) space 'of
iso8601date2
{
int length = 0;
DEBUG_OUTPUT("iso8601date2");
TIMELIB_INIT;
TIMELIB_HAVE_DATE();
s->time->y = timelib_get_nr((char **) &ptr, 4);
s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
s->time->m = timelib_get_nr((char **) &ptr, 2);
s->time->d = timelib_get_nr((char **) &ptr, 2);
TIMELIB_PROCESS_YEAR(s->time->y);
TIMELIB_PROCESS_YEAR(s->time->y, length);
TIMELIB_DEINIT;
return TIMELIB_ISO_DATE;
}
gnudateshorter
{
int length = 0;
DEBUG_OUTPUT("gnudateshorter");
TIMELIB_INIT;
TIMELIB_HAVE_DATE();
s->time->y = timelib_get_nr((char **) &ptr, 4);
s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
s->time->m = timelib_get_nr((char **) &ptr, 2);
s->time->d = 1;
TIMELIB_PROCESS_YEAR(s->time->y);
TIMELIB_PROCESS_YEAR(s->time->y, length);
TIMELIB_DEINIT;
return TIMELIB_ISO_DATE;
}
gnudateshort
{
int length = 0;
DEBUG_OUTPUT("gnudateshort");
TIMELIB_INIT;
TIMELIB_HAVE_DATE();
s->time->y = timelib_get_nr((char **) &ptr, 4);
s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
s->time->m = timelib_get_nr((char **) &ptr, 2);
s->time->d = timelib_get_nr((char **) &ptr, 2);
TIMELIB_PROCESS_YEAR(s->time->y);
TIMELIB_PROCESS_YEAR(s->time->y, length);
TIMELIB_DEINIT;
return TIMELIB_ISO_DATE;
}
datefull
{
int length = 0;
DEBUG_OUTPUT("datefull");
TIMELIB_INIT;
TIMELIB_HAVE_DATE();
s->time->d = timelib_get_nr((char **) &ptr, 2);
timelib_skip_day_suffix((char **) &ptr);
s->time->m = timelib_get_month((char **) &ptr);
s->time->y = timelib_get_nr((char **) &ptr, 4);
TIMELIB_PROCESS_YEAR(s->time->y);
s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
TIMELIB_PROCESS_YEAR(s->time->y, length);
TIMELIB_DEINIT;
return TIMELIB_DATE_FULL;
}
@@ -1355,52 +1368,56 @@ weekdayof = (reltextnumber|reltexttext) space (dayfull|dayabbr) space 'of
pointeddate2
{
int length = 0;
DEBUG_OUTPUT("pointed date YY");
TIMELIB_INIT;
TIMELIB_HAVE_DATE();
s->time->d = timelib_get_nr((char **) &ptr, 2);
s->time->m = timelib_get_nr((char **) &ptr, 2);
s->time->y = timelib_get_nr((char **) &ptr, 2);
TIMELIB_PROCESS_YEAR(s->time->y);
s->time->y = timelib_get_nr_ex((char **) &ptr, 2, &length);
TIMELIB_PROCESS_YEAR(s->time->y, length);
TIMELIB_DEINIT;
return TIMELIB_DATE_FULL_POINTED;
}
datenoday
{
int length = 0;
DEBUG_OUTPUT("datenoday");
TIMELIB_INIT;
TIMELIB_HAVE_DATE();
s->time->m = timelib_get_month((char **) &ptr);
s->time->y = timelib_get_nr((char **) &ptr, 4);
s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
s->time->d = 1;
TIMELIB_PROCESS_YEAR(s->time->y);
TIMELIB_PROCESS_YEAR(s->time->y, length);
TIMELIB_DEINIT;
return TIMELIB_DATE_NO_DAY;
}
datenodayrev
{
int length = 0;
DEBUG_OUTPUT("datenodayrev");
TIMELIB_INIT;
TIMELIB_HAVE_DATE();
s->time->y = timelib_get_nr((char **) &ptr, 4);
s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
s->time->m = timelib_get_month((char **) &ptr);
s->time->d = 1;
TIMELIB_PROCESS_YEAR(s->time->y);
TIMELIB_PROCESS_YEAR(s->time->y, length);
TIMELIB_DEINIT;
return TIMELIB_DATE_NO_DAY;
}
datetextual | datenoyear
{
int length = 0;
DEBUG_OUTPUT("datetextual | datenoyear");
TIMELIB_INIT;
TIMELIB_HAVE_DATE();
s->time->m = timelib_get_month((char **) &ptr);
s->time->d = timelib_get_nr((char **) &ptr, 2);
s->time->y = timelib_get_nr((char **) &ptr, 4);
TIMELIB_PROCESS_YEAR(s->time->y);
s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
TIMELIB_PROCESS_YEAR(s->time->y, length);
TIMELIB_DEINIT;
return TIMELIB_DATE_TEXT;
}
@@ -1445,7 +1462,7 @@ weekdayof = (reltextnumber|reltexttext) space (dayfull|dayabbr) space 'of
if (*ptr == '.') {
s->time->f = timelib_get_frac_nr((char **) &ptr, 9);
if (*ptr) { /* timezone is optional */
s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb);
s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_get_wrapper);
if (tz_not_found) {
add_error(s, "The timezone could not be found in the database");
}
@@ -1457,13 +1474,14 @@ weekdayof = (reltextnumber|reltexttext) space (dayfull|dayabbr) space 'of
pgydotd
{
int length = 0;
DEBUG_OUTPUT("pgydotd");
TIMELIB_INIT;
TIMELIB_HAVE_DATE();
s->time->y = timelib_get_nr((char **) &ptr, 4);
s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
s->time->d = timelib_get_nr((char **) &ptr, 3);
s->time->m = 1;
TIMELIB_PROCESS_YEAR(s->time->y);
TIMELIB_PROCESS_YEAR(s->time->y, length);
TIMELIB_DEINIT;
return TIMELIB_PG_YEARDAY;
}
@@ -1508,26 +1526,28 @@ weekdayof = (reltextnumber|reltexttext) space (dayfull|dayabbr) space 'of
pgtextshort
{
int length = 0;
DEBUG_OUTPUT("pgtextshort");
TIMELIB_INIT;
TIMELIB_HAVE_DATE();
s->time->m = timelib_get_month((char **) &ptr);
s->time->d = timelib_get_nr((char **) &ptr, 2);
s->time->y = timelib_get_nr((char **) &ptr, 4);
TIMELIB_PROCESS_YEAR(s->time->y);
s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
TIMELIB_PROCESS_YEAR(s->time->y, length);
TIMELIB_DEINIT;
return TIMELIB_PG_TEXT;
}
pgtextreverse
{
int length = 0;
DEBUG_OUTPUT("pgtextreverse");
TIMELIB_INIT;
TIMELIB_HAVE_DATE();
s->time->y = timelib_get_nr((char **) &ptr, 4);
s->time->y = timelib_get_nr_ex((char **) &ptr, 4, &length);
s->time->m = timelib_get_month((char **) &ptr);
s->time->d = timelib_get_nr((char **) &ptr, 2);
TIMELIB_PROCESS_YEAR(s->time->y);
TIMELIB_PROCESS_YEAR(s->time->y, length);
TIMELIB_DEINIT;
return TIMELIB_PG_TEXT;
}
@@ -1545,7 +1565,7 @@ weekdayof = (reltextnumber|reltexttext) space (dayfull|dayabbr) space 'of
s->time->h = timelib_get_nr((char **) &ptr, 2);
s->time->i = timelib_get_nr((char **) &ptr, 2);
s->time->s = timelib_get_nr((char **) &ptr, 2);
s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb);
s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_get_wrapper);
if (tz_not_found) {
add_error(s, "The timezone could not be found in the database");
}
@@ -1658,7 +1678,7 @@ weekdayof = (reltextnumber|reltexttext) space (dayfull|dayabbr) space 'of
DEBUG_OUTPUT("tzcorrection | tz");
TIMELIB_INIT;
TIMELIB_HAVE_TZ();
s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb);
s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_get_wrapper);
if (tz_not_found) {
add_error(s, "The timezone could not be found in the database");
}
@@ -1711,7 +1731,7 @@ weekdayof = (reltextnumber|reltexttext) space (dayfull|dayabbr) space 'of
}
if (*ptr != '\0') {
s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb);
s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_get_wrapper);
if (tz_not_found) {
add_error(s, "The timezone could not be found in the database");
}
@@ -1757,7 +1777,7 @@ weekdayof = (reltextnumber|reltexttext) space (dayfull|dayabbr) space 'of
/*!max:re2c */
timelib_time* timelib_strtotime(char *s, int len, struct timelib_error_container **errors, const timelib_tzdb *tzdb)
timelib_time* timelib_strtotime(char *s, int len, struct timelib_error_container **errors, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_get_wrapper)
{
Scanner in;
int t;
@@ -1812,7 +1832,7 @@ timelib_time* timelib_strtotime(char *s, int len, struct timelib_error_container
in.time->zone_type = 0;
do {
t = scan(&in);
t = scan(&in, tz_get_wrapper);
#ifdef DEBUG_PARSER
printf("%d\n", t);
#endif
@@ -1867,7 +1887,7 @@ static void timelib_time_reset_unset_fields(timelib_time *time)
if (time->f == TIMELIB_UNSET ) time->f = 0.0;
}
timelib_time *timelib_parse_from_format(char *format, char *string, int len, timelib_error_container **errors, const timelib_tzdb *tzdb)
timelib_time *timelib_parse_from_format(char *format, char *string, int len, timelib_error_container **errors, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_get_wrapper)
{
char *fptr = format;
char *ptr = string;
@@ -1875,6 +1895,7 @@ timelib_time *timelib_parse_from_format(char *format, char *string, int len, tim
timelib_sll tmp;
Scanner in;
Scanner *s = &in;
int allow_extra = 0;
memset(&in, 0, sizeof(in));
in.errors = malloc(sizeof(struct timelib_error_container));
@@ -1903,8 +1924,19 @@ timelib_time *timelib_parse_from_format(char *format, char *string, int len, tim
switch (*fptr) {
case 'D': /* three letter day */
case 'l': /* full day */
if (!timelib_lookup_relunit((char **) &ptr)) {
add_pbf_error(s, "A textual day could not be found", string, begin);
{
const timelib_relunit* tmprel = 0;
tmprel = timelib_lookup_relunit((char **) &ptr);
if (!tmprel) {
add_pbf_error(s, "A textual day could not be found", string, begin);
break;
} else {
in.time->have_relative = 1;
in.time->relative.have_weekday_relative = 1;
in.time->relative.weekday = tmprel->multiplier;
in.time->relative.weekday_behavior = 1;
}
}
break;
case 'd': /* two digit day, with leading zero */
@@ -1917,13 +1949,14 @@ timelib_time *timelib_parse_from_format(char *format, char *string, int len, tim
case 'S': /* day suffix, ignored, nor checked */
timelib_skip_day_suffix((char **) &ptr);
break;
case 'z': /* day of year - resets month (0 based) */
case 'z': /* day of year - resets month (0 based) - also initializes everything else to !TIMELIB_UNSET */
TIMELIB_CHECK_NUMBER;
if ((tmp = timelib_get_nr((char **) &ptr, 3)) == TIMELIB_UNSET) {
add_pbf_error(s, "A three digit day-of-year could not be found", string, begin);
} else {
s->time->m = 1;
s->time->d = tmp + 1;
timelib_do_normalize(s->time);
}
break;
@@ -1944,11 +1977,14 @@ timelib_time *timelib_parse_from_format(char *format, char *string, int len, tim
}
break;
case 'y': /* two digit year */
TIMELIB_CHECK_NUMBER;
if ((s->time->y = timelib_get_nr((char **) &ptr, 2)) == TIMELIB_UNSET) {
add_pbf_error(s, "A two digit year could not be found", string, begin);
{
int length = 0;
TIMELIB_CHECK_NUMBER;
if ((s->time->y = timelib_get_nr_ex((char **) &ptr, 2, &length)) == TIMELIB_UNSET) {
add_pbf_error(s, "A two digit year could not be found", string, begin);
}
TIMELIB_PROCESS_YEAR(s->time->y, length);
}
TIMELIB_PROCESS_YEAR(s->time->y);
break;
case 'Y': /* four digit year */
TIMELIB_CHECK_NUMBER;
@@ -1984,15 +2020,31 @@ timelib_time *timelib_parse_from_format(char *format, char *string, int len, tim
}
break;
case 'i': /* two digit minute, with leading zero */
TIMELIB_CHECK_NUMBER;
if ((s->time->i = timelib_get_nr((char **) &ptr, 2)) == TIMELIB_UNSET) {
add_pbf_error(s, "A two digit minute could not be found", string, begin);
{
int length;
timelib_sll min;
TIMELIB_CHECK_NUMBER;
min = timelib_get_nr_ex((char **) &ptr, 2, &length);
if (min == TIMELIB_UNSET || length != 2) {
add_pbf_error(s, "A two digit minute could not be found", string, begin);
} else {
s->time->i = min;
}
}
break;
case 's': /* two digit second, with leading zero */
TIMELIB_CHECK_NUMBER;
if ((s->time->s = timelib_get_nr((char **) &ptr, 2)) == TIMELIB_UNSET) {
add_pbf_error(s, "A two digit second could not be found", string, begin);
{
int length;
timelib_sll sec;
TIMELIB_CHECK_NUMBER;
sec = timelib_get_nr_ex((char **) &ptr, 2, &length);
if (sec == TIMELIB_UNSET || length != 2) {
add_pbf_error(s, "A two second minute could not be found", string, begin);
} else {
s->time->s = sec;
}
}
break;
case 'u': /* up to six digit millisecond */
@@ -2033,7 +2085,7 @@ timelib_time *timelib_parse_from_format(char *format, char *string, int len, tim
case 'O': /* timezone */
{
int tz_not_found;
s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb);
s->time->z = timelib_get_zone((char **) &ptr, &s->time->dst, s->time, &tz_not_found, s->tzdb, tz_get_wrapper);
if (tz_not_found) {
add_pbf_error(s, "The timezone could not be found in the database", string, begin);
}
@@ -2088,6 +2140,10 @@ timelib_time *timelib_parse_from_format(char *format, char *string, int len, tim
timelib_eat_until_separator((char **) &ptr);
break;
case '+': /* allow extra chars in the format */
allow_extra = 1;
break;
default:
if (*fptr != *ptr) {
add_pbf_error(s, "The format separator does not match", string, begin);
@@ -2097,11 +2153,20 @@ timelib_time *timelib_parse_from_format(char *format, char *string, int len, tim
fptr++;
}
if (*ptr) {
add_pbf_error(s, "Trailing data", string, ptr);
if (allow_extra) {
add_pbf_warning(s, "Trailing data", string, ptr);
} else {
add_pbf_error(s, "Trailing data", string, ptr);
}
}
/* ignore trailing +'s */
while (*fptr == '+') {
fptr++;
}
if (*fptr) {
/* Trailing | and ! specifiers are valid. */
while (*fptr) {
int done = 0;
while (*fptr && !done) {
switch (*fptr++) {
case '!': /* reset all fields to default */
timelib_time_reset_fields(s->time);
@@ -2113,6 +2178,7 @@ timelib_time *timelib_parse_from_format(char *format, char *string, int len, tim
default:
add_pbf_error(s, "Data missing", string, ptr);
done = 1;
}
}
}
+2 -2
View File
@@ -1,4 +1,4 @@
/* Generated by re2c 0.13.5 on Sat Nov 13 14:57:59 2010 */
/* Generated by re2c 0.13.5 on Mon Dec 5 22:02:31 2011 */
#line 1 "ext/date/lib/parse_iso_intervals.re"
/*
+----------------------------------------------------------------------+
@@ -396,7 +396,7 @@ yy6:
break;
}
nr = timelib_get_unsigned_nr((char **) &ptr, 9);
nr = timelib_get_unsigned_nr((char **) &ptr, 12);
switch (*ptr) {
case 'Y': s->period->y = nr; break;
case 'W': s->period->d = nr * 7; break;
+1 -1
View File
@@ -364,7 +364,7 @@ isoweek = year4 "-"? "W" weekofyear;
break;
}
nr = timelib_get_unsigned_nr((char **) &ptr, 9);
nr = timelib_get_unsigned_nr((char **) &ptr, 12);
switch (*ptr) {
case 'Y': s->period->y = nr; break;
case 'W': s->period->d = nr * 7; break;
+9 -3
View File
@@ -26,12 +26,14 @@
#include <limits.h>
#endif
#define TIMELIB_VERSION 201101
#define TIMELIB_VERSION 201102
#define TIMELIB_NONE 0x00
#define TIMELIB_OVERRIDE_TIME 0x01
#define TIMELIB_NO_CLONE 0x02
#define TIMELIB_UNSET -99999
#define TIMELIB_SPECIAL_WEEKDAY 0x01
#define TIMELIB_SPECIAL_DAY_OF_WEEK_IN_MONTH 0x02
#define TIMELIB_SPECIAL_LAST_DAY_OF_WEEK_IN_MONTH 0x03
@@ -52,6 +54,9 @@
#define strncasecmp strnicmp
#endif
/* Function pointers */
typedef timelib_tzinfo* (*timelib_tz_get_wrapper)(char *tzname, const timelib_tzdb *tzdb);
/* From dow.c */
timelib_sll timelib_day_of_week(timelib_sll y, timelib_sll m, timelib_sll d);
timelib_sll timelib_iso_day_of_week(timelib_sll y, timelib_sll m, timelib_sll d);
@@ -63,8 +68,8 @@ int timelib_valid_time(timelib_sll h, timelib_sll i, timelib_sll s);
int timelib_valid_date(timelib_sll y, timelib_sll m, timelib_sll d);
/* From parse_date.re */
timelib_time *timelib_strtotime(char *s, int len, timelib_error_container **errors, const timelib_tzdb *tzdb);
timelib_time *timelib_parse_from_format(char *format, char *s, int len, timelib_error_container **errors, const timelib_tzdb *tzdb);
timelib_time *timelib_strtotime(char *s, int len, timelib_error_container **errors, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_get_wrapper);
timelib_time *timelib_parse_from_format(char *format, char *s, int len, timelib_error_container **errors, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_get_wrapper);
void timelib_fill_holes(timelib_time *parsed, timelib_time *now, int options);
char *timelib_timezone_id_from_abbr(const char *abbr, long gmtoffset, int isdst);
const timelib_tz_lookup_table *timelib_timezone_abbreviations_list(void);
@@ -78,6 +83,7 @@ void timelib_strtointerval(char *s, int len,
/* From tm2unixtime.c */
void timelib_update_ts(timelib_time* time, timelib_tzinfo* tzi);
void timelib_do_normalize(timelib_time *base);
void timelib_do_rel_normalize(timelib_time *base, timelib_rel_time *rt);
/* From unixtime2tm.c */
+769 -753
View File
File diff suppressed because it is too large. Load diff
+8 -8
View File
@@ -179,11 +179,11 @@ void timelib_do_rel_normalize(timelib_time *base, timelib_rel_time *rt)
do {} while (do_range_limit(0, 12, 12, &rt->m, &rt->y));
}
static void do_normalize(timelib_time* time)
void timelib_do_normalize(timelib_time* time)
{
do {} while (do_range_limit(0, 60, 60, &time->s, &time->i));
do {} while (do_range_limit(0, 60, 60, &time->i, &time->h));
do {} while (do_range_limit(0, 24, 24, &time->h, &time->d));
if (time->s != TIMELIB_UNSET) do {} while (do_range_limit(0, 60, 60, &time->s, &time->i));
if (time->s != TIMELIB_UNSET) do {} while (do_range_limit(0, 60, 60, &time->i, &time->h));
if (time->s != TIMELIB_UNSET) do {} while (do_range_limit(0, 24, 24, &time->h, &time->d));
do {} while (do_range_limit(1, 13, 12, &time->m, &time->y));
do {} while (do_range_limit_days(&time->y, &time->m, &time->d));
@@ -195,7 +195,7 @@ static void do_adjust_relative(timelib_time* time)
if (time->relative.have_weekday_relative) {
do_adjust_for_weekday(time);
}
do_normalize(time);
timelib_do_normalize(time);
if (time->have_relative) {
time->s += time->relative.s;
@@ -215,7 +215,7 @@ static void do_adjust_relative(timelib_time* time)
time->m++;
break;
}
do_normalize(time);
timelib_do_normalize(time);
}
static void do_adjust_special_weekday(timelib_time* time)
@@ -280,7 +280,7 @@ static void do_adjust_special(timelib_time* time)
break;
}
}
do_normalize(time);
timelib_do_normalize(time);
memset(&(time->relative.special), 0, sizeof(time->relative.special));
}
@@ -300,7 +300,7 @@ static void do_adjust_special_early(timelib_time* time)
break;
}
}
do_normalize(time);
timelib_do_normalize(time);
}
static timelib_sll do_years(timelib_sll year)
+2 -2
View File
@@ -146,7 +146,7 @@ void timelib_update_from_sse(timelib_time *tm)
int z = tm->z;
signed int dst = tm->dst;
timelib_unixtime2gmt(tm, tm->sse - (tm->z * 60));
timelib_unixtime2gmt(tm, tm->sse - (tm->z * 60) + (tm->dst * 3600));
tm->z = z;
tm->dst = dst;
@@ -184,7 +184,7 @@ void timelib_unixtime2local(timelib_time *tm, timelib_sll ts)
int z = tm->z;
signed int dst = tm->dst;
timelib_unixtime2gmt(tm, ts - (tm->z * 60));
timelib_unixtime2gmt(tm, ts - (tm->z * 60) + (tm->dst * 3600));
tm->z = z;
tm->dst = dst;
+96 -17
View File
@@ -425,7 +425,7 @@ const zend_function_entry date_functions[] = {
PHP_FE(date_sunrise, arginfo_date_sunrise)
PHP_FE(date_sunset, arginfo_date_sunset)
PHP_FE(date_sun_info, arginfo_date_sun_info)
{NULL, NULL, NULL}
PHP_FE_END
};
const zend_function_entry date_funcs_date[] = {
@@ -447,7 +447,7 @@ const zend_function_entry date_funcs_date[] = {
PHP_ME_MAPPING(setTimestamp, date_timestamp_set, arginfo_date_method_timestamp_set, 0)
PHP_ME_MAPPING(getTimestamp, date_timestamp_get, arginfo_date_method_timestamp_get, 0)
PHP_ME_MAPPING(diff, date_diff, arginfo_date_method_diff, 0)
{NULL, NULL, NULL}
PHP_FE_END
};
const zend_function_entry date_funcs_timezone[] = {
@@ -458,19 +458,21 @@ const zend_function_entry date_funcs_timezone[] = {
PHP_ME_MAPPING(getLocation, timezone_location_get, arginfo_timezone_method_location_get, 0)
PHP_ME_MAPPING(listAbbreviations, timezone_abbreviations_list, arginfo_timezone_abbreviations_list, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
PHP_ME_MAPPING(listIdentifiers, timezone_identifiers_list, arginfo_timezone_identifiers_list, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
{NULL, NULL, NULL}
PHP_FE_END
};
const zend_function_entry date_funcs_interval[] = {
PHP_ME(DateInterval, __construct, arginfo_date_interval_construct, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC)
PHP_ME(DateInterval, __wakeup, NULL, ZEND_ACC_PUBLIC)
PHP_ME(DateInterval, __set_state, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
PHP_ME_MAPPING(format, date_interval_format, arginfo_date_method_interval_format, 0)
PHP_ME_MAPPING(createFromDateString, date_interval_create_from_date_string, arginfo_date_interval_create_from_date_string, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
{NULL, NULL, NULL}
PHP_FE_END
};
const zend_function_entry date_funcs_period[] = {
PHP_ME(DatePeriod, __construct, arginfo_date_period_construct, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC)
{NULL, NULL, NULL}
PHP_FE_END
};
static char* guess_timezone(const timelib_tzdb *tzdb TSRMLS_DC);
@@ -832,6 +834,12 @@ static timelib_tzinfo *php_date_parse_tzfile(char *formal_tzname, const timelib_
}
return tzi;
}
timelib_tzinfo *php_date_parse_tzfile_wrapper(char *formal_tzname, const timelib_tzdb *tzdb)
{
TSRMLS_FETCH();
return php_date_parse_tzfile(formal_tzname, tzdb TSRMLS_CC);
}
/* }}} */
/* {{{ Helper functions */
@@ -1367,7 +1375,7 @@ PHPAPI signed long php_parse_date(char *string, signed long *now)
int error2;
signed long retval;
parsed_time = timelib_strtotime(string, strlen(string), &error, DATE_TIMEZONEDB);
parsed_time = timelib_strtotime(string, strlen(string), &error, DATE_TIMEZONEDB, php_date_parse_tzfile_wrapper);
if (error->error_count) {
timelib_error_container_dtor(error);
return -1;
@@ -1404,7 +1412,7 @@ PHP_FUNCTION(strtotime)
initial_ts = emalloc(25);
snprintf(initial_ts, 24, "@%ld UTC", preset_ts);
t = timelib_strtotime(initial_ts, strlen(initial_ts), NULL, DATE_TIMEZONEDB); /* we ignore the error here, as this should never fail */
t = timelib_strtotime(initial_ts, strlen(initial_ts), NULL, DATE_TIMEZONEDB, php_date_parse_tzfile_wrapper); /* we ignore the error here, as this should never fail */
timelib_update_ts(t, tzi);
now->tz_info = tzi;
now->zone_type = TIMELIB_ZONETYPE_ID;
@@ -1426,7 +1434,7 @@ PHP_FUNCTION(strtotime)
RETURN_FALSE;
}
t = timelib_strtotime(times, time_len, &error, DATE_TIMEZONEDB);
t = timelib_strtotime(times, time_len, &error, DATE_TIMEZONEDB, php_date_parse_tzfile_wrapper);
error1 = error->error_count;
timelib_error_container_dtor(error);
timelib_fill_holes(t, now, TIMELIB_NO_CLONE);
@@ -2047,6 +2055,9 @@ static zend_object_value date_object_clone_date(zval *this_ptr TSRMLS_DC)
zend_object_value new_ov = date_object_new_date_ex(old_obj->std.ce, &new_obj TSRMLS_CC);
zend_objects_clone_members(&new_obj->std, new_ov, &old_obj->std, Z_OBJ_HANDLE_P(this_ptr) TSRMLS_CC);
if (!old_obj->time) {
return new_ov;
}
/* this should probably moved to a new `timelib_time *timelime_time_clone(timelib_time *)` */
new_obj->time = timelib_time_ctor();
@@ -2168,6 +2179,10 @@ static zend_object_value date_object_clone_timezone(zval *this_ptr TSRMLS_DC)
zend_object_value new_ov = date_object_new_timezone_ex(old_obj->std.ce, &new_obj TSRMLS_CC);
zend_objects_clone_members(&new_obj->std, new_ov, &old_obj->std, Z_OBJ_HANDLE_P(this_ptr) TSRMLS_CC);
if (!old_obj->initialized) {
return new_ov;
}
new_obj->type = old_obj->type;
new_obj->initialized = 1;
switch (new_obj->type) {
@@ -2378,7 +2393,7 @@ static void update_errors_warnings(timelib_error_container *last_errors TSRMLS_D
PHPAPI int php_date_initialize(php_date_obj *dateobj, /*const*/ char *time_str, int time_str_len, char *format, zval *timezone_object, int ctor TSRMLS_DC)
{
timelib_time *now;
timelib_tzinfo *tzi;
timelib_tzinfo *tzi = NULL;
timelib_error_container *err = NULL;
int type = TIMELIB_ZONETYPE_ID, new_dst;
char *new_abbr;
@@ -2388,9 +2403,9 @@ PHPAPI int php_date_initialize(php_date_obj *dateobj, /*const*/ char *time_str,
timelib_time_dtor(dateobj->time);
}
if (format) {
dateobj->time = timelib_parse_from_format(format, time_str_len ? time_str : "", time_str_len ? time_str_len : 0, &err, DATE_TIMEZONEDB);
dateobj->time = timelib_parse_from_format(format, time_str_len ? time_str : "", time_str_len ? time_str_len : 0, &err, DATE_TIMEZONEDB, php_date_parse_tzfile_wrapper);
} else {
dateobj->time = timelib_strtotime(time_str_len ? time_str : "now", time_str_len ? time_str_len : sizeof("now") -1, &err, DATE_TIMEZONEDB);
dateobj->time = timelib_strtotime(time_str_len ? time_str : "now", time_str_len ? time_str_len : sizeof("now") -1, &err, DATE_TIMEZONEDB, php_date_parse_tzfile_wrapper);
}
/* update last errors and warnings */
@@ -2724,7 +2739,7 @@ PHP_FUNCTION(date_parse)
RETURN_FALSE;
}
parsed_time = timelib_strtotime(date, date_len, &error, DATE_TIMEZONEDB);
parsed_time = timelib_strtotime(date, date_len, &error, DATE_TIMEZONEDB, php_date_parse_tzfile_wrapper);
php_date_do_return_parsed_time(INTERNAL_FUNCTION_PARAM_PASSTHRU, parsed_time, error);
}
/* }}} */
@@ -2743,7 +2758,7 @@ PHP_FUNCTION(date_parse_from_format)
RETURN_FALSE;
}
parsed_time = timelib_parse_from_format(format, date, date_len, &error, DATE_TIMEZONEDB);
parsed_time = timelib_parse_from_format(format, date, date_len, &error, DATE_TIMEZONEDB, php_date_parse_tzfile_wrapper);
php_date_do_return_parsed_time(INTERNAL_FUNCTION_PARAM_PASSTHRU, parsed_time, error);
}
/* }}} */
@@ -2785,7 +2800,7 @@ PHP_FUNCTION(date_modify)
dateobj = (php_date_obj *) zend_object_store_get_object(object TSRMLS_CC);
DATE_CHECK_INITIALIZED(dateobj->time, DateTime);
tmp_time = timelib_strtotime(modify, modify_len, &err, DATE_TIMEZONEDB);
tmp_time = timelib_strtotime(modify, modify_len, &err, DATE_TIMEZONEDB, php_date_parse_tzfile_wrapper);
/* update last errors and warnings */
update_errors_warnings(err TSRMLS_CC);
@@ -3606,6 +3621,70 @@ PHP_METHOD(DateInterval, __construct)
}
/* }}} */
static long php_date_long_from_hash_element(HashTable *myht, char *element, size_t size)
{
zval **z_arg = NULL;
if (zend_hash_find(myht, element, size + 1, (void**) &z_arg) == SUCCESS) {
convert_to_long(*z_arg);
return Z_LVAL_PP(z_arg);
} else {
return -1;
}
}
static int php_date_interval_initialize_from_hash(zval **return_value, php_interval_obj **intobj, HashTable *myht TSRMLS_DC)
{
(*intobj)->diff = timelib_rel_time_ctor();
(*intobj)->diff->y = php_date_long_from_hash_element(myht, "y", 1);
(*intobj)->diff->m = php_date_long_from_hash_element(myht, "m", 1);
(*intobj)->diff->d = php_date_long_from_hash_element(myht, "d", 1);
(*intobj)->diff->h = php_date_long_from_hash_element(myht, "h", 1);
(*intobj)->diff->i = php_date_long_from_hash_element(myht, "i", 1);
(*intobj)->diff->s = php_date_long_from_hash_element(myht, "s", 1);
(*intobj)->diff->invert = php_date_long_from_hash_element(myht, "invert", 6);
(*intobj)->diff->days = php_date_long_from_hash_element(myht, "days", 4);
(*intobj)->initialized = 1;
return 0;
}
/* {{{ proto DateInterval::__set_state()
*/
PHP_METHOD(DateInterval, __set_state)
{
php_interval_obj *intobj;
zval *array;
HashTable *myht;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &array) == FAILURE) {
RETURN_FALSE;
}
myht = HASH_OF(array);
php_date_instantiate(date_ce_interval, return_value TSRMLS_CC);
intobj = (php_interval_obj *) zend_object_store_get_object(return_value TSRMLS_CC);
php_date_interval_initialize_from_hash(&return_value, &intobj, myht TSRMLS_CC);
}
/* }}} */
/* {{{ proto DateInterval::__wakeup()
*/
PHP_METHOD(DateInterval, __wakeup)
{
zval *object = getThis();
php_interval_obj *intobj;
HashTable *myht;
intobj = (php_interval_obj *) zend_object_store_get_object(object TSRMLS_CC);
myht = Z_OBJPROP_P(object);
php_date_interval_initialize_from_hash(&return_value, &intobj, myht TSRMLS_CC);
}
/* }}} */
/* {{{ proto DateInterval date_interval_create_from_date_string(string time)
Uses the normal date parsers and sets up a DateInterval from the relative parts of the parsed string
*/
@@ -3623,7 +3702,7 @@ PHP_FUNCTION(date_interval_create_from_date_string)
php_date_instantiate(date_ce_interval, return_value TSRMLS_CC);
time = timelib_strtotime(time_str, time_str_len, &err, DATE_TIMEZONEDB);
time = timelib_strtotime(time_str, time_str_len, &err, DATE_TIMEZONEDB, php_date_parse_tzfile_wrapper);
diobj = (php_interval_obj *) zend_object_store_get_object(return_value TSRMLS_CC);
diobj->diff = timelib_rel_time_clone(&time->relative);
diobj->initialized = 1;
@@ -3661,8 +3740,8 @@ static char *date_interval_format(char *format, int format_len, timelib_rel_time
case 'I': length = slprintf(buffer, 32, "%02d", (int) t->i); break;
case 'i': length = slprintf(buffer, 32, "%d", (int) t->i); break;
case 'S': length = slprintf(buffer, 32, "%02d", (int) t->s); break;
case 's': length = slprintf(buffer, 32, "%d", (int) t->s); break;
case 'S': length = slprintf(buffer, 32, "%02ld", (long) t->s); break;
case 's': length = slprintf(buffer, 32, "%ld", (long) t->s); break;
case 'a': {
if ((int) t->days != -99999) {
+2
View File
@@ -82,6 +82,8 @@ PHP_FUNCTION(timezone_abbreviations_list);
PHP_FUNCTION(timezone_version_get);
PHP_METHOD(DateInterval, __construct);
PHP_METHOD(DateInterval, __wakeup);
PHP_METHOD(DateInterval, __set_state);
PHP_FUNCTION(date_interval_format);
PHP_FUNCTION(date_interval_create_from_date_string);
@@ -8,10 +8,7 @@ date.timezone=UTC
--SKIPIF--
<?php
if (!method_exists('DateInterval', 'format')) die("skip: method doesn't exist");
if (substr(PHP_OS, 0, 3) != 'WIN') die("skip this test is for Windows platforms only");
?>
--XFAIL--
Windows VC6 libs' floor()/ceil() choke on floats
--FILE--
<?php
@@ -29,3 +29,5 @@ test_time_spring_type2_post_type2_prev: ADD: 2010-03-15 19:59:59 EDT + P-0Y0M2DT
test_time_spring_type2_post_type2_st: ADD: 2010-03-15 19:59:59 EDT + P-0Y0M1DT18H49M39S = **2010-03-14 00:10:20 EST**
test_time_spring_type2_post_type2_dt: ADD: 2010-03-15 19:59:59 EDT + P-0Y0M1DT16H43M4S = **2010-03-14 03:16:55 EDT**
test_time_spring_type2_post_type2_post: ADD: 2010-03-15 18:57:55 EDT + P+0Y0M0DT1H2M4S = **2010-03-15 19:59:59 EDT**
test_time_spring_type2_stsec_type2_dtsec: ADD: 2010-03-13 01:59:59 EST + P+0Y0M0DT0H0M1S = **2010-03-15 03:00:00 EDT**
test_time_spring_type2_dtsec_type2_stsec: ADD: 2010-03-15 03:00:00 EDT + P-0Y0M0DT0H0M1S = **2010-03-15 01:59:59 EST**
@@ -29,3 +29,5 @@ test_time_spring_type2_post_type3_prev: ADD: 2010-03-15 19:59:59 EDT + P-0Y0M2DT
test_time_spring_type2_post_type3_st: ADD: 2010-03-15 19:59:59 EDT + P-0Y0M1DT18H49M39S = **2010-03-14 00:10:20 EST**
test_time_spring_type2_post_type3_dt: ADD: 2010-03-15 19:59:59 EDT + P-0Y0M1DT16H43M4S = **2010-03-14 03:16:55 EDT**
test_time_spring_type2_post_type3_post: ADD: 2010-03-15 18:57:55 EDT + P+0Y0M0DT1H2M4S = **2010-03-15 19:59:59 EDT**
test_time_spring_type2_stsec_type3_dtsec: ADD: 2010-03-13 01:59:59 EST + P+0Y0M0DT0H0M1S = **2010-03-15 03:00:00 EDT**
test_time_spring_type2_dtsec_type3_stsec: ADD: 2010-03-15 03:00:00 EDT + P-0Y0M0DT0H0M1S = **2010-03-15 01:59:59 EST**
@@ -29,3 +29,5 @@ test_time_spring_type3_post_type2_prev: ADD: 2010-03-15 19:59:59 EDT + P-0Y0M2DT
test_time_spring_type3_post_type2_st: ADD: 2010-03-15 19:59:59 EDT + P-0Y0M1DT18H49M39S = **2010-03-14 00:10:20 EST**
test_time_spring_type3_post_type2_dt: ADD: 2010-03-15 19:59:59 EDT + P-0Y0M1DT16H43M4S = **2010-03-14 03:16:55 EDT**
test_time_spring_type3_post_type2_post: ADD: 2010-03-15 18:57:55 EDT + P+0Y0M0DT1H2M4S = **2010-03-15 19:59:59 EDT**
test_time_spring_type3_stsec_type2_dtsec: ADD: 2010-03-13 01:59:59 EST + P+0Y0M0DT0H0M1S = **2010-03-15 03:00:00 EDT**
test_time_spring_type3_dtsec_type2_stsec: ADD: 2010-03-15 03:00:00 EDT + P-0Y0M0DT0H0M1S = **2010-03-15 01:59:59 EST**
@@ -29,3 +29,5 @@ test_time_spring_type3_post_type3_prev: ADD: 2010-03-15 19:59:59 EDT + P-0Y0M2DT
test_time_spring_type3_post_type3_st: ADD: 2010-03-15 19:59:59 EDT + P-0Y0M1DT18H49M39S = **2010-03-14 00:10:20 EST**
test_time_spring_type3_post_type3_dt: ADD: 2010-03-15 19:59:59 EDT + P-0Y0M1DT16H43M4S = **2010-03-14 03:16:55 EDT**
test_time_spring_type3_post_type3_post: ADD: 2010-03-15 18:57:55 EDT + P+0Y0M0DT1H2M4S = **2010-03-15 19:59:59 EDT**
test_time_spring_type3_stsec_type3_dtsec: ADD: 2010-03-13 01:59:59 EST + P+0Y0M0DT0H0M1S = **2010-03-15 03:00:00 EDT**
test_time_spring_type3_dtsec_type3_stsec: ADD: 2010-03-15 03:00:00 EDT + P-0Y0M0DT0H0M1S = **2010-03-15 01:59:59 EST**
Loaded 100 of 827 files, more files were not shown because too many files have changed in this diff. Show more