Compare commits

...
185 Commits
Author SHA1 Message Date
Johannes Schlüter babeca356b It's 2014 already, fix copyright year where user visible
Left out all file headers
2014-08-13 21:22:50 +02:00
Johannes Schlüter 1847cf10c1 PHP 5.3.29 2014-08-13 18:36:10 +02:00
Johannes Schlüter 990ecc12fc PHP 5.3.29RC1 2014-07-31 15:40:51 +02:00
Stanislav Malyshev 0fe07a0e74 Fix missing type checks in various functions 2014-07-31 15:36:24 +02:00
Stanislav Malyshev 1ffb7fddc2 update NEWS 2014-07-18 16:49:00 -07:00
Stanislav Malyshev c74efe1b2e Fix bug #67492: unserialize() SPL ArrayObject / SPLObjectStorage Type Confusion
Conflicts:
	ext/spl/spl_array.c
	ext/spl/tests/SplObjectStorage_unserialize_bad.phpt
2014-07-18 16:31:59 -07:00
Xinchen Hui b5051ff939 Fixed bug #67359 (Segfault in recursiveDirectoryIterator) 2014-07-18 16:28:58 -07:00
Stanislav Malyshev e2ba5c7987 Fix bug #66127 (Segmentation fault with ArrayObject unset) 2014-07-18 16:28:16 -07:00
Stanislav Malyshev 8e9777a1f1 Fix test - because of big #67397 we don't allow overlong locales anymore 2014-07-18 16:27:11 -07:00
Stanislav Malyshev e644aad3f9 Fix bug #67397 (Buffer overflow in locale_get_display_name->uloc_getDisplayName (libicu 4.8.1)) 2014-07-18 16:26:51 -07:00
Stanislav Malyshev 8ab4e2e90d Fix bug #67349: Locale::parseLocale Double Free 2014-07-18 16:26:05 -07:00
Stanislav Malyshev b512adf78d Fixed bug #67399 (putenv with empty variable may lead to crash)
Conflicts:
	ext/standard/basic_functions.c
2014-07-18 16:24:54 -07:00
Remi Collet 2fe5bcbeb5 Fixed Bug #67413 fileinfo: cdf_read_property_info insufficient boundary chec
Upstream:
https://github.com/file/file/commit/93e063ee374b6a75729df9e7201fb511e47e259d

Adapted for C standard.
2014-07-18 16:21:01 -07:00
Remi Collet 892def5f12 Bug #67412 fileinfo: cdf_count_chain insufficient boundary check
Upstream:
https://github.com/file/file/commit/40bade80cbe2af1d0b2cd0420cebd5d5905a2382
2014-07-18 16:20:19 -07:00
Remi Collet 8d1d038509 Fixed Bug #67411 fileinfo: cdf_check_stream_offset insufficient boundary check
Upstream:
https://github.com/file/file/commit/36fadd29849b8087af9f4586f89dbf74ea45be67

Conflicts:
	ext/fileinfo/libmagic/cdf.c
2014-07-18 16:19:30 -07:00
Remi Collet 6bd5a06894 Fixed Bug #67410 fileinfo: mconvert incorrect handling of truncated pascal string size
Upstream
https://github.com/file/file/commit/27a14bc7ba285a0a5ebfdb55e54001aa11932b08
2014-07-18 16:17:36 -07:00
Stanislav Malyshev ec002bd837 Fix bug #67498 - phpinfo() Type Confusion Information Leak Vulnerability 2014-07-18 16:14:42 -07:00
Remi Collet 52de149ebc Fix bug #67326 fileinfo: cdf_read_short_sector insufficient boundary check
Upstream fix https://github.com/file/file/commit/6d209c1c489457397a5763bca4b28e43aac90391.patch
Only revelant part applied
2014-07-18 16:13:07 -07:00
Stanislav Malyshev 2326401fc1 fix bug #67253: timelib_meridian_with_check out-of-bounds read
Conflicts:
	ext/date/lib/parse_date.c
2014-07-18 16:11:54 -07:00
Stanislav Malyshev 7f527897fe Fix bug #67252: convert_uudecode out-of-bounds read 2014-07-18 16:05:52 -07:00
Stanislav Malyshev d4b67896ec Fix bug #67250 (iptcparse out-of-bounds read) 2014-07-18 16:02:52 -07:00
Stanislav Malyshev 84605098bc Fix bug #67247 spl_fixedarray_resize integer overflow 2014-07-18 15:59:59 -07:00
Stanislav Malyshev ee1ab62763 Fix bug #67328 (fileinfo: numerous file_printf calls resulting in performance degradation)
Upstream patch: https://github.com/file/file/commit/b8acc83781d5a24cc5101e525d15efe0482c280d
2014-07-18 15:52:00 -07:00
Stanislav Malyshev d77ea459bd Fix bug #67327: fileinfo: CDF infinite loop in nelements DoS
Upstream fix: https://github.com/file/file/commit/f97486ef5dc3e8735440edc4fc8808c63e1a3ef0
2014-07-18 15:50:58 -07:00
Anatol Belski 44be7b7f27 backport this piece from 5.6, related to the #66307 fix
Conflicts:
	ext/fileinfo/libmagic/readcdf.c
2014-07-18 15:50:04 -07:00
Anatol Belski 0335d2ef3e Fixed bug #66307 Fileinfo crashes with powerpoint files
Conflicts:
	ext/fileinfo/libmagic/readcdf.c
	ext/fileinfo/tests/finfo_file_002.phpt
2014-07-18 15:48:18 -07:00
Remi Collet a0bb3fd679 Fixed bug #66060 (Heap buffer over-read in DateInterval)
Conflicts:
	ext/date/lib/parse_iso_intervals.c
2014-07-18 15:39:37 -07:00
Stanislav Malyshev eca037a51d Fix bug #65873 - Integer overflow in exif_read_data() 2014-07-18 15:37:15 -07:00
Xinchen Hui f3230e3522 let make test report the run-test result 2014-07-18 15:33:59 -07:00
Stanislav Malyshev 3c328f0984 Fix bug #67251 - date_parse_from_format out-of-bounds read
Conflicts:
	ext/date/lib/parse_date.c
	ext/date/lib/parse_date.re
2014-06-15 00:33:24 -07:00
Stanislav Malyshev d780c2a673 Fix bug #67249: printf out-of-bounds read 2014-06-13 16:43:56 -07:00
Sara Golemon d400b74296 Fix potential segfault in dns_get_record()
If the remote sends us a packet with a malformed TXT record,
we could end up trying to over-consume the packet and wander
off into overruns.
2014-06-13 16:42:55 -07:00
Remi Collet 08334293f8 Fix bug #67390 insecure temporary file use in the configure script 2014-06-13 16:41:13 -07:00
Stanislav Malyshev adc070ca99 fix typo in ODBC code 2014-05-18 23:42:30 -07:00
Stanislav Malyshev 8a22540a95 Fix bug #67060: use default mode of 660 2014-05-11 23:32:35 -07:00
Ferenc Kovacs 4b48b29988 fix the primary qa email address and update the list of available people being able to add moderators to our lists 2014-01-24 16:06:58 +01:00
Will Fitch 8aa93b7f2c Revert "Fix #62479: Some chars not parsed in passwords"
This reverts commit e6bb90c66a.
2014-01-19 13:02:20 -05:00
Will Fitch e6bb90c66a Fix #62479: Some chars not parsed in passwords
This fixes an issue where backslashes and spaces aren't
correctly parsed for passwords.
2014-01-18 19:27:00 -05:00
Julien Pauli 3eb2b1ac40 Updated release process 2013-12-13 13:16:54 +01:00
Anatol Belski 6f739318fd fix dir separator in cve-2013-6420 test 2013-12-11 13:31:29 +01:00
Stanislav Malyshev 8650bbc8dc 5.3.29-dev 2013-12-10 11:32:11 -08:00
Stanislav Malyshev c1224573c7 Fix CVE-2013-6420 - memory corruption in openssl_x509_parse 2013-12-10 11:03:49 -08:00
Christopher Jones 32873cd0dd Merge branch 'PHP-5.3' of https://git.php.net/repository/php-src into PHP-5.3
* 'PHP-5.3' of https://git.php.net/repository/php-src:
  fix using wrong buffer pointer
2013-08-19 10:53:41 -07:00
Stanislav Malyshev c1c49d6e39 fix using wrong buffer pointer 2013-08-19 01:02:12 -07:00
Stanislav Malyshev dcea4ec698 Fix CVE-2013-4073 - handling of certs with null bytes 2013-08-13 22:24:11 -07:00
Christopher Jones 7c9bb87edd Merge branch 'PHP-5.3' of https://git.php.net/repository/php-src into PHP-5.3
# By Johannes Schlüter
# Via Christopher Jones (1) and Johannes Schlüter (1)
* 'PHP-5.3' of https://git.php.net/repository/php-src:
  Merge PHP 5.3.27 NEWS
  add test for bug #65236
2013-07-22 10:58:52 -07:00
Christopher Jones e2e002d4ea Merge branch 'PHP-5.3' of https://git.php.net/repository/php-src into PHP-5.3
* 'PHP-5.3' of https://git.php.net/repository/php-src:
  Merge PHP 5.3.27 NEWS
  add test for bug #65236
2013-07-10 11:13:15 -07:00
Johannes Schlüter 9c4ef50146 Merge PHP 5.3.27 NEWS 2013-07-10 19:45:45 +02:00
Johannes Schlüter 710eee5555 add test for bug #65236 2013-07-10 19:35:18 +02:00
Rob Richards 7d163e8a08 truncate results at depth of 255 to prevent corruption 2013-07-06 07:53:07 -04:00
Nuno Lopes e964817b24 fix assembly of safe_address() for x86 and x86_64 2013-07-03 18:02:28 -04:00
Sebastian Bergmann 50ac53e1b1 Add bison 2.6.4 to the list of supported versions 2013-07-03 06:36:54 +02:00
Johannes Schlüter e4ee921b7e Update git rules (5.5 is stable, 5.3 sec only) 2013-06-20 11:51:21 +02:00
Johannes Schlüter f0eaa02f6f This will be PHP 5.3.28 2013-06-19 15:08:02 +02:00
Matteo Beccati 6238dd6f32 Fixed bug #63186 (compile failure on netbsd) 2013-06-14 16:51:54 +02:00
Anatol Belski cd1b44c4b6 ensure the error_reporting level to get expected notice 2013-06-12 13:13:48 +02:00
Anatol Belski eccc05fc44 fixed tests 2013-06-11 12:38:49 +02:00
Anatol Belski f16143f5ac missing tests for bug #53437 2013-06-11 11:19:57 +02:00
Anatol Belski 18403e496d missing colon 2013-06-10 19:54:29 +02:00
Anatol Belski 88c2dbe5fc Backported the fix for bug #53437 2013-06-10 19:48:18 +02:00
Dmitry Stogov f5f6404260 Fixed test script 2013-06-10 12:53:19 +04:00
Xinchen Hui 75c57122e3 Fixed bug #64997 (Segfault while using RecursiveIteratorIterator on 64-bits systems) 2013-06-09 22:24:48 +08:00
Xinchen Hui e8f004d542 Fixed bug #64966 (segfault in zend_do_fcall_common_helper_SPEC) 2013-06-09 13:20:40 +08:00
Anatol Belski 1aee7ad636 Fixed bug #64934 Apache2 TS crash with get_browser()
In favour of reading the browscap.ini into a true global var
only once in MINIT, the price for that is to deep copy the
any data from it.
2013-06-06 18:49:04 +02:00
Johannes Schlüter ec3bcbcb5a Add NEWS for PHP 5.3.26 2013-06-05 16:34:18 +02:00
Xinchen Hui 3c87945c95 Fixed bug #64960 (Segfault in gc_zval_possible_root) 2013-06-05 17:25:00 +08:00
Stanislav Malyshev 93e0d78ec6 fix CVE-2013-2110 - use correct formula to calculate string size 2013-06-04 21:56:33 -07:00
Matteo Beccati 2463e89794 Clean up leftover test files 2013-06-02 13:38:43 +02:00
Matteo Beccati 25aae37229 Fixed bug #64609 (pg_convert enum type support) 2013-06-02 06:29:35 +02:00
Matteo Beccati 79803bebde Fixed bug #62857 (bytea test failures)
Postgres 9.1+ test fixes. Tests were failing due to the default
standard_conforming_strings GUC being changed to on. Also the
pg_escape_bytea test was encoding the data before estabilishing
a connection, thus falling back to the old escaping type which
isn't properly handled by the backend when using a default
configuration.

I haven't updated the NEWS file as it's just test fixes.
2013-06-01 23:15:48 +02:00
Matteo Beccati 598e2690b8 Merge branch 'pull-request/309' into PHP-5.3 2013-05-31 16:26:38 +02:00
Matteo Beccati bf4a034e3e NEWS 2013-05-31 16:26:06 +02:00
Matteo Beccati 510498947e Slightly edited tests and fix for bug #62024 2013-05-31 16:19:58 +02:00
Matheus Degiovani df6ca450ce Fixed bug #62024 (unable to run consecutive prepared querys with null values)
Credits to james@kenjim.com for the patch.
2013-05-31 14:30:57 +02:00
Matheus Degiovani 65d233f06c Fixed bug #64037 (wrong value returned when using a negative numeric field equal to the scale) 2013-05-31 14:30:51 +02:00
Remi Collet 1c623e3b07 Fixed Bug #64949 (Buffer overflow in _pdo_pgsql_error)
There is a lot of call such as:
	pdo_pgsql_error(dbh, PGRES_FATAL_ERROR, "Copy command failed");
Where the 3rd paramater is a error message string where a sqlstate (5 chars)
is expected. This cause a segfault in copy_from.phpt and copy_to.phpt.

This is only a sanity check to avoid buffer overflow, but obviously this
calls need to be fixed (using NULL or a correct sqlstate).
2013-05-31 08:39:32 +02:00
Dmitry Stogov 13e5c97ffd Fixed incorrect argument number 2013-05-29 11:09:55 +04:00
Johannes Schlüter 4cb25d25f1 This will be PHP 5.3.27 2013-05-22 17:13:17 +02:00
Remi Collet c50cef1dc5 Fixed bug #64895 Integer overflow in SndToJewish 2013-05-22 08:30:50 +02:00
Stanislav Malyshev d4ad889824 fix order 2013-05-21 23:25:35 -07:00
Sara Golemon 2d5695cbc5 Don't double-quote name of namespaced function.
ZEND_NS_NAMED_FE(ns, zend_name, name, arg_info)

was resulting in a function declaration of:

ns\"zend_name"()

including the errant quotes.

This diff corrects that.  There are currently no uses of ZEND_NS_NAMED_FE
in core and reason to believe that there are no uses in the wild either.
2013-05-19 13:32:17 -07:00
Remi Collet 4828f7343b Integer overflow in SndToJewish leads to php hang
AT least in (inputDay is long, metonicCycle is int):
   metonicCycle = (inputDay + 310) / 6940;

So large value give strange (negative) results or php hangs.
This is patch already applied in some linux distro.
2013-05-21 18:04:17 +02:00
Pierre Joye 46b05bc57a entry for #64214 2013-05-17 11:49:13 +02:00
Pierre Joye 3eb1745643 other fix for #64214, unmodified file may not have old fp set, causing other possible crashes 2013-05-17 11:45:13 +02:00
Anatol Belski 86db5fb4c2 Fix unitialized vars when sql.safe_mode=1
which can break the subsequent mysqlnd_connect() call
2013-05-15 11:12:17 +02:00
Pierre Joye ba1af29805 more check for php_stream_fopen_tmpfile failure 2013-05-14 16:45:11 +02:00
Pierre Joye 533e636a62 php_stream_fopen_tmpfile may file, causing any following stream usage to crash 2013-05-14 09:20:53 +02:00
Anatol Belski fe21accfb4 fix heap overflow warnings on win x64 debug crt 2013-05-13 14:24:21 +02:00
Anatol Belski d6505acbf5 Fixed bug #64821 Custom Exceptions crash when internal properties overridden
If user inherits Exception and overrides the properties to arbitrary data types,
or simply doesn't run parent::__construct(), here we go. Just convert everything
to the appropriate data type, like Exception::__toString() does.
2013-05-12 14:00:32 +02:00
Johannes Schlüter 1cc2162b83 PHP 5.3.25 NEWS 2013-05-08 18:01:39 +02:00
Anatol Belski 5c701d19ac better fix for bug #64770 2013-05-04 12:16:38 +02:00
Boris Lytochkin f1269d80c5 Merge branch 'PHP-5.3' of https://git.php.net/push/php-src into PHP-5.3
* 'PHP-5.3' of https://git.php.net/push/php-src:
  Fixed bug #64770 stream_select() fails with pipes
2013-05-03 19:23:46 +04:00
Anatol Belski b1ea0b7a7a Fixed bug #64770 stream_select() fails with pipes
returned by proc_open() on Windows x64
2013-05-03 17:01:33 +02:00
Boris Lytochkin aa448adc83 Merge branch 'PHP-5.3' of https://git.php.net/push/php-src into PHP-5.3
* 'PHP-5.3' of https://git.php.net/push/php-src: (39 commits)
  NEWS
  From code coverity scan, syscall return value must be check.
  fix more resource leaks
  From code coverity scan - fix some memory leak - fix some resources leak (fd) - create fpm_worker_pool_free (shared use) - possible null dref (wp->user and wp->home can be null)
  fixed size array cannot be null
  use limit_extensions as we use security_limit_extensions later (free)
  unused variable
  fix possible null deref (detected by code coverity scan)
  Also fixed bug #64726 in 5.3
  Fix memory realted to #64726
  Fix Test Bug #64714
  PHP 5.3.26 this will be
  Fix NEWS
  Fix bug #64458 (dns_get_record result with string of length -1)
  Fixed incorrect check. SEND_REF may be executed before DO_FCALL when EX(function_state).function is not yet set to the calling function.
  Fixed stream_socket_pair() on Windows x64 and
  - Updated to version 2013.3 (2013c)
  lower the limit, should fit in a byte
  updated lib versions
  allow lcov 1.10
  ...
2013-05-03 11:21:48 +04:00
Remi Collet 4a34d4a83c NEWS 2013-05-03 08:29:56 +02:00
Remi Collet 0549e55d82 From code coverity scan, syscall return value must be check.
To not alter current behaviour, we simply log the problem,
so, if it occurs, the message will give explanation.

This are only warning as they don't block the server,
but such fail can explain strange (not expected) behaviour later.
2013-05-03 08:19:14 +02:00
Remi Collet 444e59eb20 fix more resource leaks 2013-05-02 13:47:24 +02:00
Remi Collet 331540d20c From code coverity scan
- fix some memory leak
- fix some resources leak (fd)
- create fpm_worker_pool_free (shared use)
- possible null dref (wp->user and wp->home can be null)
2013-05-02 13:27:16 +02:00
Remi Collet d0c40220d1 fixed size array cannot be null 2013-05-02 10:32:45 +02:00
Remi Collet 8492bbefbb use limit_extensions as we use security_limit_extensions later (free) 2013-05-02 10:15:12 +02:00
Remi Collet a7d6cb2360 unused variable 2013-05-02 10:15:05 +02:00
Remi Collet ab117573cd fix possible null deref (detected by code coverity scan) 2013-05-02 09:38:00 +02:00
Xinchen Hui 15b554cd9b Also fixed bug #64726 in 5.3 2013-04-27 23:49:43 +08:00
Xinchen Hui c7b8368ed5 Fix memory realted to #64726 2013-04-27 23:38:00 +08:00
Matt Ficken bf5506f511 Fix Test Bug #64714 2013-04-25 11:34:57 -07:00
Johannes Schlüter 63434524f8 PHP 5.3.26 this will be 2013-04-25 18:02:53 +02:00
Johannes Schlüter 671ef9fda7 Fix NEWS 2013-04-25 17:58:02 +02:00
Stanislav Malyshev 18fdab5a09 Fix bug #64458 (dns_get_record result with string of length -1) 2013-04-23 21:43:35 -07:00
Dmitry Stogov 4cf0647399 Fixed incorrect check. SEND_REF may be executed before DO_FCALL when EX(function_state).function is not yet set to the calling function. 2013-04-23 23:43:23 +04:00
Anatol Belski f082d6311b Fixed stream_socket_pair() on Windows x64 and
improved errorhandling in the socketpair() implementation.
2013-04-22 18:55:32 +02:00
Derick Rethans 70b67f2e50 - Updated to version 2013.3 (2013c) 2013-04-22 17:51:41 +01:00
Andrey Hristov 0802961bd1 lower the limit, should fit in a byte 2013-04-19 15:54:35 +02:00
Anatol Belski 323fdb9879 updated lib versions 2013-04-17 13:12:18 +02:00
Nuno Lopes a9271a8b0d allow lcov 1.10 2013-04-13 16:57:25 -04:00
Anatol Belski 56b028e590 Merge branch 'PHP-5.3' of git.php.net:php-src into PHP-5.3 2013-04-10 20:50:57 +02:00
Anatol Belski 968ae4a56a Fixed bug #64342 ZipArchive::addFile() has to check for file existence 2013-04-10 20:39:17 +02:00
Pierre Joye 224a67fb9f add external 2.1 detection and fix gd_compat for 2.1+ 2013-04-10 20:12:25 +02:00
Johannes Schlüter ecdf8bcc45 PHP 5.3.24 release date 2013-04-10 09:41:21 +02:00
Pierre Joye 88b3cdc4e9 fix possible NULL deref 2013-04-09 10:09:17 +02:00
Pierre Joye 4d4adf47e0 fix null deref 2013-04-09 10:04:01 +02:00
Rasmus Lerdorf 1b60c189ad Fixed bugs #47675 and #64577 (fd leak on Solaris) 2013-04-04 19:15:52 -07:00
Xinchen Hui 934dfae4e1 no tab here 2013-04-04 14:52:27 +08:00
Xinchen Hui c96a5bc6be Fixed bug #64578 (debug_backtrace in set_error_handler corrupts zend heap: segfault) 2013-04-04 14:34:11 +08:00
Xinchen Hui 9456dac54e Fix test 2013-04-01 18:12:16 +08:00
Nikita Popov fecce5a55f Exclude Travis build for 5.3 and 5.4 2013-03-28 18:40:57 +01:00
Johannes Schlüter 46ee57f2d7 This will PHP 5.3.25 2013-03-28 15:05:46 +01:00
Dmitry Stogov c4686b4de9 Fixed bug #63914 (zend_do_fcall_common_helper_SPEC does not handle exceptions properly). (Jeff Welch) 2013-03-25 15:07:27 +04:00
Johannes Schlüter 66682f5abe It's 2013, even for a manpage 2013-03-24 17:31:29 +01:00
Anatol Belski 638c4b89b7 Reworked the changes for bug #64452 2013-03-23 20:57:59 +01:00
Anatol Belski b022e54bd1 Fixed possible precision loss in microtime
This is related to the fix for bug #64370. MSVC natively supports __int64 type,
so calculating with 32 bit ints is neither necessary nor reliable. Therefore
an older piece of code is reused.
2013-03-23 17:40:06 +01:00
Anatol Belski bb935ff8dc Fixed bug #64452 Zip PHPTs crash intermittently 2013-03-20 09:10:10 +01:00
Anatol Belski 8d199c7c4f Backported fix for bug #62852 2013-03-19 21:19:55 +01:00
Dmitry Stogov 4a6291508d Fixed bug #62343 (Show class_alias In get_declared_classes()) 2013-03-19 14:56:53 +04:00
Stanislav Malyshev 87c8ea15f2 fix NEWS 2013-03-18 00:52:15 -07:00
Etienne Kneuss 62364e6e01 Remove spurious int cast in between two longs 2013-03-16 18:19:14 +01:00
Anatol Belski b903d2d6cd Backported patch for #64370 2013-03-15 19:04:40 +01:00
Ferenc Kovacs 9350f45aca explain the step updating the git submodule reference in web/php.git 2013-03-15 09:40:28 +01:00
Anatol Belski e43c5a8395 fix zts check 2013-03-14 14:38:20 +01:00
Andrey Hristov f1e2edff8b fix for bug #63530 mysqlnd_stmt::bind_one_parameter uses wrong alloc for stmt->param_bind 2013-03-13 13:37:51 +01:00
Anatol Belski bdaafe3c7b fixed headers order 2013-03-12 08:33:36 +01:00
Derick Rethans 50ad2af503 - Updated to version 2013.2 (2013b) 2013-03-11 21:36:36 +00:00
Stephen A. Zarkos b6fdb60ecf Fixed PCRE locale crash in Windows/TS 2013-03-04 09:09:45 +01:00
Stanislav Malyshev 656fcb67f1 rename NEWS back 2013-03-03 13:18:58 -08:00
Anatol Belski fe2612d71e Merge branch 'PHP-5.3' of git.php.net:php-src into PHP-5.3
* 'PHP-5.3' of git.php.net:php-src:
  Rename to create a NEWS file per version to fix the annoying merging issue with NEWS files.
2013-03-03 19:21:45 +01:00
Anatol Belski e1023affc1 updated NEWS 2013-03-03 19:13:38 +01:00
Derick Rethans b36df28dca Rename to create a NEWS file per version to fix the annoying merging issue with NEWS files. 2013-03-03 13:08:19 -05:00
Anatol Belski 357ab3cbad merged PCRE 8.32
- defined HAVE_CONFIG_H to simplify the future merges
- PCRE NEWS http://pcre.org/news.txt
2013-03-03 19:06:22 +01:00
Derick Rethans c134f2a1a5 - Updated to version 2013.1 (2013a) 2013-03-03 12:53:22 -05:00
Dmitry Stogov b6656d0ec9 Fixed timestamp update on Phar contents modification. 2013-03-01 19:17:08 +04:00
Stanislav Malyshev 5c5bc7cf1b 5.4.24-dev 2013-02-28 21:25:36 -08:00
Stanislav Malyshev 8f533d2dfd 5.3.23RC1 2013-02-28 21:22:06 -08:00
Mike Willbanks 61099f8585 Bug #52861: unset fails with ArrayObject and deep arrays
When checking to make into a reference write, readwrite are checked but not unset
2013-02-26 22:11:52 -08:00
Xinchen Hui 1b58bd39a6 Fixed bug #64264 (SPLFixedArray toArray problem) 2013-02-24 12:55:53 +08:00
Johannes Schlüter fcd4b5335a Fix TSRM (after afc1debb) 2013-02-21 15:08:58 +01:00
Dmitry Stogov 7b113d789d PHAR should modify entry timestamp when it's modified 2013-02-21 15:55:20 +04:00
Sara Golemon bc55a8eb9f http-stream test requires network connectivity 2013-02-21 03:21:23 -08:00
Anatol Belski 81e9aa6c8d updated lib versions 2013-02-21 09:46:50 +01:00
Dmitry Stogov 8e76d0404b Fixed external entity loading 2013-02-20 22:14:59 +04:00
Johannes Schlüter afc1debb2f 5.3.22 NEWS 2013-02-20 11:56:29 +01:00
Anatol Belski 558c5dbe65 fix the test for curl 7.29.0+ 2013-02-19 09:04:06 +01:00
Xinchen Hui 01ae5c3c2f Fixed bug #64228 (RecursiveDirectoryIterator always assumes SKIP_DOTS) 2013-02-17 11:04:36 +08:00
Dmitry Stogov 188c196d4d Proper bit reset code 2013-02-13 22:06:37 +04:00
Dmitry Stogov afe98b7829 Disabled external entities loading 2013-02-07 16:07:05 +04:00
Dmitry Stogov cc4c318b0c Check if soap.wsdl_cache_dir confirms to open_basedir 2013-02-07 13:04:47 +04:00
Johannes Schlüter a80fdc47b3 This will be PHP 5.3.23 2013-01-31 00:57:29 +01:00
Nikita Popov 321f4f18e5 Fixed bug #64106: Segfault on SplFixedArray[][x] = y when extended 2013-01-30 20:23:39 +01:00
Johannes Schlüter ec53b60072 Merge branch 'PHP-5.3' of git.php.net:/php-src into PHP-5.3 2013-01-29 19:49:13 +01:00
Johannes Schlüter 93fd9c704b Fix bug #64099 (Wrong TSRM usage in zend_register_class_alias) 2013-01-29 19:47:45 +01:00
Gustavo Lopes 38bf6951b3 NEWS for bug #64023 (see aa0adce) 2013-01-23 13:30:40 +01:00
Gustavo Lopes aa0adce47d Fix bug #64023 (__toString() & SplFileInfo)
Defining a __toString() method was having no effect when concatenating
the object. This was because the cast_object() handler would ignore
__toString().

Using echo() directly would actually use __toString(), but this was a
bug: the ECHO handler would try zend_std_cast_object_tostring() before
cast_object(), but cast_object() should have priority as
zend_std_cast_object_tostring() assumes an object with a
zend_class_entry.
2013-01-22 11:33:29 +01:00
Stanislav Malyshev 33b104c778 fix bug #63462 (Magic methods called twice for unset protected properties) 2013-01-18 13:29:43 -08:00
Johannes Schlüter be2f547497 Fix NEWS after 5.3.21 2013-01-16 17:38:17 +01:00
Adam Harvey f63a9f6c11 Update the arguments in the prototype of fpm_socket_unix_test_connect().
Fixes bug #63999 (php with fpm fails to build on Solaris 10 or 11).
2013-01-16 10:06:56 +08:00
Adam Harvey c077074c13 Revert "Update fputcsv() to escape all characters equally."
On second thoughts, while the behaviour _is_ broken, this isn't the right fix.

This reverts commit 9b5cb0e805.
2013-01-15 17:33:54 +08:00
Adam Harvey 9b5cb0e805 Update fputcsv() to escape all characters equally.
At present, backslashes have special case handling within fputcsv(): when one
is encountered within a field that's being escaped, escaping stops until the
next instance of the enclosure character is hit.  This can result in malformed
CSV.

Fixes bug #43225 (fputcsv incorrectly handles cells ending in \ followed by ").
2013-01-15 15:17:45 +08:00
Dmitry Stogov e1410b5a70 Fixed uninitialized zval.type (Yoram) 2013-01-10 18:53:10 +04:00
Remi Collet dc9f0e70b7 Fix test after fix for bug #63943 (Bad warning text from strpos() on empty needle)
See commit c05ee74e7f
2013-01-10 11:14:38 +01:00
Andrey Hristov 12e759c2ea Use during connect the flags set with set_client_option() 2013-01-09 18:27:06 +01:00
Dmitry Stogov d4650c5d69 Fixed compilator bug that might cause jump depended on unitialized value 2013-01-09 17:16:47 +04:00
Xinchen Hui c05ee74e7f Fixed bug #63943 (Bad warning text from strpos() on empty needle) 2013-01-09 10:53:20 +08:00
Derick Rethans 67c662a0a2 Update news with new bug fix. 2013-01-06 15:08:26 +00:00
Derick Rethans ff9c1b12ff Fixed bug #55397: Comparsion of incomplete DateTime causes SIGSEGV. 2013-01-06 13:39:34 +00:00
Xinchen Hui bc11e6fdbb bump year 2013-01-06 10:19:09 +08:00
Xinchen Hui c3e6de2227 Fixed bug #63899 (Use after scope error in zend_compile) 2013-01-04 11:02:21 +08:00
Johannes Schlüter 712710bfec This will be PHP 5.3.22 2013-01-03 22:56:46 +01:00
261 changed files with 16481 additions and 8717 deletions

No files matched your search

+4 -5
View File
@@ -1,10 +1,9 @@
language: php
php:
# We only specify one version so we only get one worker
- 5.4
branches:
except:
- /^PHP-5\.3.*/
- /^PHP-5\.4.*/
notifications:
email: false
script: exit 0
+2
View File
@@ -98,7 +98,9 @@ test: all
TEST_PHP_SRCDIR=$(top_srcdir) \
CC="$(CC)" \
$(PHP_EXECUTABLE) -n -c $(top_builddir)/tmp-php.ini $(PHP_TEST_SETTINGS) $(top_srcdir)/run-tests.php -n -c $(top_builddir)/tmp-php.ini -d extension_dir=$(top_builddir)/modules/ $(PHP_TEST_SHARED_EXTENSIONS) $(TESTS); \
TEST_RESULT_EXIT_CODE=$$?; \
rm $(top_builddir)/tmp-php.ini; \
exit $$TEST_RESULT_EXIT_CODE; \
else \
echo "ERROR: Cannot run tests without CLI sapi."; \
fi
+211 -1
View File
@@ -1,6 +1,216 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 2013, PHP 5.3.21
14 Aug 2014, PHP 5.3.29
- Core:
. Fixed bug #66127 (Segmentation fault with ArrayObject unset). (Stas)
. Fixed bug #67247 (spl_fixedarray_resize integer overflow). (Stas)
. Fixed bug #67249 (printf out-of-bounds read). (Stas)
. Fixed bug #67250 (iptcparse out-of-bounds read). (Stas)
. Fixed bug #67252 (convert_uudecode out-of-bounds read). (Stas)
. Fixed bug #67359 (Segfault in recursiveDirectoryIterator). (Laruence)
. Fixed bug #67390 (insecure temporary file use in the configure script).
(Remi) (CVE-2014-3981)
. Fixed bug #67399 (putenv with empty variable may lead to crash). (Stas)
. Fixed bug #67492 (unserialize() SPL ArrayObject / SPLObjectStorage Type
Confusion) (CVE-2014-3515). (Stefan Esser)
. Fixed bug #67498 (phpinfo() Type Confusion Information Leak Vulnerability).
(Stefan Esser)
- COM:
. Fixed missing type checks in com_event_sink (Yussuf Khalil, Stas).
- Date:
. Fixed bug #66060 (Heap buffer over-read in DateInterval). (CVE-2013-6712)
(Remi)
. Fixed bug #67251 (date_parse_from_format out-of-bounds read). (Stas)
. Fixed bug #67253 (timelib_meridian_with_check out-of-bounds read). (Stas)
- Exif:
. Fixed bug #65873 (Integer overflow in exif_read_data()). (Stas)
- Fileinfo:
. Fixed bug #66307 (Fileinfo crashes with powerpoint files). (Anatol)
. Fixed bug #67326 (fileinfo: cdf_read_short_sector insufficient boundary
check). (CVE-2014-0207)
. Fixed bug #67327 (fileinfo: CDF infinite loop in nelements DoS).
(CVE-2014-0238)
. Fixed bug #67328 (fileinfo: fileinfo: numerous file_printf calls resulting
in performance degradation). (CVE-2014-0237)
. Fixed bug #67410 (fileinfo: mconvert incorrect handling of truncated pascal
string size). (Francisco Alonso, Jan Kaluza, Remi)
. Fixed bug #67411 (fileinfo: cdf_check_stream_offset insufficient boundary
check). (Francisco Alonso, Jan Kaluza, Remi)
. Fixed bug #67412 (fileinfo: cdf_count_chain insufficient boundary check).
(Francisco Alonso, Jan Kaluza, Remi)
. Fixed bug #67413 (fileinfo: cdf_read_property_info insufficient boundary
check). (Francisco Alonso, Jan Kaluza, Remi)
- Intl:
. Fixed bug #67349 (Locale::parseLocale Double Free). (Stas)
. Fixed bug #67397 (Buffer overflow in locale_get_display_name and
uloc_getDisplayName (libicu 4.8.1)). (Stas)
- Network:
. Fixed bug #67432 (Fix potential segfault in dns_check_record()).
(CVE-2014-4049). (Sara)
- OpenSSL:
. Fixed missing type checks in OpenSSL options (Yussuf Khalil, Stas).
- Session:
. Fixed missing type checks in php_session_create_id (Yussuf Khalil, Stas).
12 Dec 2013, PHP 5.3.28
- Openssl:
. Fixed handling null bytes in subjectAltName (CVE-2013-4073).
(Christian Heimes)
. Fixed memory corruption in openssl_x509_parse() (CVE-2013-6420).
(Stefan Esser).
- FPM:
. Fixed bug #67060 (sapi/fpm: possible privilege escalation due to insecure
default configuration) (CVE-2014-0185). (Stas)
11 Jul 2013, PHP 5.3.27
- Core:
. Fixed bug #64966 (segfault in zend_do_fcall_common_helper_SPEC). (Laruence)
. Fixed bug #64960 (Segfault in gc_zval_possible_root). (Laruence)
. Fixed bug #64934 (Apache2 TS crash with get_browser()). (Anatol)
. Fixed bug #63186 (compile failure on netbsd). (Matteo)
- DateTime:
. Fixed bug #53437 (Crash when using unserialized DatePeriod instance).
(Gustavo, Derick, Anatol)
- PDO_firebird:
. Fixed bug #64037 (Firebird return wrong value for numeric field).
(Matheus Degiovani, Matteo)
. Fixed bug #62024 (Cannot insert second row with null using parametrized
query). (patch by james@kenjim.com, Matheus Degiovani, Matteo)
- PDO_pgsql:
. Fixed bug #64949 (Buffer overflow in _pdo_pgsql_error). (Remi)
- pgsql:
. Fixed bug #64609 (pg_convert enum type support). (Matteo)
- SPL:
. Fixed bug #64997 (Segfault while using RecursiveIteratorIterator on
64-bits systems). (Laruence)
- XML:
. Fixed bug #65236 (heap corruption in xml parser). (Rob)
06 Jun 2013, PHP 5.3.26
- Core:
. Fixed bug #64879 (Heap based buffer overflow in quoted_printable_encode,
CVE 2013-2110). (Stas)
- Calendar:
. Fixed bug #64895 (Integer overflow in SndToJewish). (Remi)
- FPM:
. Fixed some possible memory or resource leaks and possible null dereference
detected by code coverity scan. (Remi)
. Log a warning when a syscall fails. (Remi)
- MySQLi:
. Fixed bug #64726 (Segfault when calling fetch_object on a use_result and DB
pointer has closed). (Laruence)
- Phar
. Fixed bug #64214 (PHAR PHPTs intermittently crash when run on DFS, SMB or
with non std tmp dir). (Pierre)
- Streams:
. Fixed bug #64770 (stream_select() fails with pipes returned by proc_open()
on Windows x64). (Anatol)
- Zend Engine:
. Fixed bug #64821 (Custom Exception crash when internal properties
overridden). (Anatol)
09 May 2013, PHP 5.3.25
- Core:
. Fixed bug #64578 (debug_backtrace in set_error_handler corrupts zend heap:
segfault). (Laruence)
. Fixed bug #64458 (dns_get_record result with string of length -1). (Stas)
. Fixed bugs #47675 and #64577 (fd leak on Solaris). (Rasmus)
- Streams:
. Fixed Windows x64 version of stream_socket_pair() and improved error
handling. (Anatol Belski)
- Zip:
. Fixed bug #64342 (ZipArchive::addFile() has to check for file existence).
(Anatol)
11 Apr 2013, PHP 5.3.24
- Core
. Fixed bug #64370 (microtime(true) less than $_SERVER['REQUEST_TIME_FLOAT']).
(Anatol)
. Fixed bug #63914 (zend_do_fcall_common_helper_SPEC does not handle
exceptions properly). (Jeff Welch)
. Fixed bug #62343 (Show class_alias In get_declared_classes()) (Dmitry)
- PCRE:
. Merged PCRE 8.32). (Anatol)
- mysqlnd
. Fixed bug #63530 (mysqlnd_stmt::bind_one_parameter crashes, uses wrong alloc
for stmt->param_bind). (Andrey)
- DateTime
. Fixed bug #62852 (Unserialize Invalid Date causes crash). (Anatol)
- Zip:
. Bug #64452 (Zip crash intermittently). (Anatol)
14 Mar 2013, PHP 5.3.23
- Phar:
. Fixed timestamp update on Phar contents modification. (Dmitry)
- SPL:
. Fixed bug #64264 (SPLFixedArray toArray problem). (Laruence)
. Fixed bug #64228 (RecursiveDirectoryIterator always assumes SKIP_DOTS).
(patch by kriss@krizalys.com, Laruence)
. Fixed bug #52861 (unset fails with ArrayObject and deep arrays).
(Mike Willbanks)
21 Feb 2013, PHP 5.3.22
- Zend Engine:
. Fixed bug #64099 (Wrong TSRM usage in zend_Register_class alias). (Johannes)
. Fixed bug #63899 (Use after scope error in zend_compile). (Laruence)
- Core
. Fixed bug #63943 (Bad warning text from strpos() on empty needle).
(Laruence)
- Date:
. Fixed bug #55397 (comparsion of incomplete DateTime causes SIGSEGV).
(Laruence, Derick)
- FPM:
. Fixed bug #63999 (php with fpm fails to build on Solaris 10 or 11). (Adam)
- SOAP
. Added check that soap.wsdl_cache_dir conforms to open_basedir
(CVE-2013-1635). (Dmitry)
. Disabled external entities loading (CVE-2013-1643). (Dmitry)
- SPL:
. Fixed bug #64106 (Segfault on SplFixedArray[][x] = y when extended). (Nikita Popov)
17 Jan 2013, PHP 5.3.21
- Zend Engine:
. Fixed bug #63762 (Sigsegv when Exception::$trace is changed by user).
+9 -6
View File
@@ -45,14 +45,17 @@ Currently we have the following branches in use::
master The active development branch.
PHP-5.4 Is used to release the PHP 5.4.x series. It still allows for
larger enhancements.
PHP-5.3 Is used to release the PHP 5.3.x series. This is current
PHP-5.5 Is used to release the PHP 5.5.x series. This is a current
stable version and is open for bugfixes only.
PHP-5.2 Is used to release the PHP 5.2.x series. It is closed for
changes now.
PHP-5.4 Is used to release the PHP 5.4.x series. This is a current
stable version and is open for bugfixes only.
PHP-5.3 Is used to release the PHP 5.3.x series. This is currently
in extended support and open forsecurity fixes only. Triaged
via security@php.net
PHP-5.2 This branch is closed.
PHP-5.1 This branch is closed.
+86 -76
View File
@@ -8,15 +8,16 @@ General notes and tips
1. Do not release on Fridays, Saturdays or Sundays
because the sysadmins can not upgrade stuff then.
2. Package the day before a release. So if the release is to be on Thursday,
package on Wednesday.
2. Package two days before a release. So if the release is to be on Thursday,
package on Tuesday. Think about timezones as well.
3. Ensure that Windows builds will work before packaging
4. Follow all steps to the letter. When unclear ask previous RM's (Derick/Ilia)
before proceeding. Ideally make sure that for the first releases one of the
previous RM's is around to answer questions. For the steps related to the
php/QA/bug websites try to have someone from the webmaster team (Bjori) on hand.
4. Follow all steps to the letter. When unclear ask previous RM's (David/Julien/
Johannes/Stas/Derick/Ilia) before proceeding. Ideally make sure that for the
first releases one of the previous RM's is around to answer questions. For the
steps related to the php/QA/bug websites try to have someone from the webmaster
team (Bjori) on hand.
5. Verify the tags to be extra sure everything was tagged properly.
@@ -50,38 +51,44 @@ Rolling a non stable release (alpha/beta/RC)
2. run the "scripts/dev/credits" script in php-src and commit the changes in the
credits files in ext/standard.
3. Bump the version numbers in ``main/php_version.h``, ``configure.in`` and possibly ``NEWS``.
Do not use abbreviations for alpha and beta.
3. Checkout the release branch for this release (e.g., PHP-5.4.2) from the main branch.
4. Commit those changes and note the revision id.
4. Bump the version numbers in ``main/php_version.h``, ``configure.in`` and possibly ``NEWS``.
Do not use abbreviations for alpha and beta. Do not use dashes, you should
``#define PHP_VERSION "5.4.22RC1"`` and not ``#define PHP_VERSION "5.4.22-RC1"``
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.
5. Compile and make test, with and without ZTS, using the right Bison version
(for example, for 5.5, Bison 2.4.1 is used)
6. Bump up the version numbers in ``main/php_version.h``, ``configure.in``
and possibly ``NEWS`` again, to the **next** version. F.e. if the release
candidate was "4.4.1RC1" then the new one should be "4.4.1RC2-dev" - regardless
if we get a new RC or not. This is to make sure ``version_compare()`` can
correctly work.
6. Check ./sapi/cli/php -v output for version matching.
7. Commit those changes
7. If all is right, commit the changes to the release branch with ``git commit -a``.
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).
8. Tag the repository release branch with the version, e.g.:
``git tag -u YOURKEYID php-5.4.2RC2``
9. You do not have to update the tree, but of course you can with "``svn up``".
9. Bump the version numbers in ``main/php_version.h``, ``configure.in`` and ``NEWS``
in the *main* branch (PHP-5.4 for example) to prepare for the **next** version.
F.e. if the RC is "5.4.1RC1" then the new one should be "5.4.2-dev" - regardless if we get
a new RC or not. This is to make sure ``version_compare()`` can correctly work.
Commit the changes to the main branch.
10. run: ``./makedist php 4.4.1RC1``, this will export the tree, create configure
and build two tarballs (one gz and one bz2).
10. Push the changes to the main repo, the tag, the main branch and the release branch :
``git push --tags origin HEAD``
``git push origin {main branch}``
``git push origin {release branch}``
11. Copy those two tarballs to www.php.net, in your homedir there should be a
11. run: ``PHPROOT=. ./makedist 5.4.2RC2``, this will export the tree, create configure
and build three tarballs (gz, bz2 and xz).
12. Copy those tarballs (scp, rsync) to downloads.php.net, in your homedir there should be a
directory "downloads/". Copy them into there, so that the system can generate
MD5 sums. If you do not have this directory, talk to Derick.
MD5 sums. If you do not have this directory, talk to Derick or Dan.
12. Now the RC can be found on http://downloads.php.net/yourname,
13. Now the RC can be found on http://downloads.php.net/yourname,
f.e. http://downloads.php.net/derick/
13. Once the release has been tagged, contact the PHP Windows development team
14. Once the release has been tagged, contact the PHP Windows development team
(internals-win@lists.php.net) so that Windows binaries can be created. Once
those are made, they should be placed into the same directory as the source snapshots.
@@ -94,10 +101,10 @@ pointing out "the location of the release" and "the possible release date of
either the next RC, or the final release".
2. Send an email (see example here http://news.php.net/php.pear.qa/5201) **To**
``php-qa@lists.php.net`` and ``primary-qa-tests@lists.php.net``.
``php-qa@lists.php.net`` and ``primary-qa-tester@lists.php.net``.
This email is to notify the selected projects about a new release so that they
can make sure their projects keep working. Make sure that you have been setup
as a moderator for ``primary-qa-tests@lists.php.net`` by having someone (Wez,
as a moderator for ``primary-qa-tester@lists.php.net`` by having someone (Hannes, Dan,
Derick) run the following commands for you:
``ssh lists.php.net``
@@ -113,9 +120,9 @@ Derick) run the following commands for you:
Note: Remember to update the MD5 checksum information.
4. Update ``php.git/include/version.inc`` (x=major version number)
4. Update ``web/php.git/include/version.inc`` (x=major version number)
a. ``$PHP_x_RC`` = "5.3.0RC1"
a. ``$PHP_x_RC`` = "5.4.0RC1" (should be set to "false" before)
b. ``$PHP_x_RC_DATE`` = "06 September 2007"
@@ -126,59 +133,61 @@ Derick) run the following commands for you:
6. For the first RC, write the doc team (phpdoc@lists.php.net) about updating the
INSTALL and win32/install.txt files which are generated from the PHP manual sources.
7. Publish the announce on www.php.net as well (for all releases, alpha, RCs or other)
Rolling a stable release
------------------------
1. Check windows snapshot builder logs (http://snaps.php.net/win32/snapshot-STABLE.log f.e.)
1. Checkout your release branch, you should have created when releasing previous RC
and bump the version numbers in ``main/php_version.h``, ``configure.in`` and possibly ``NEWS``.
2. Bump the version numbers in ``main/php_version.h``, ``configure.in`` and possibly ``NEWS``.
2. If a CVE commit needs to be merged to the release, then have it commited to
the base branches and merged upwards as usual (f.e commit the CVE fix to 5.3,
merge to 5.4, 5.5 etc...). Then you can cherry-pick it in your release branch.
Don't forget to update NEWS manually in an extra commit then.
3. **Merge** all related sections in NEWS (f.e. merge the 5.4.1RC1 and 5.4.0 sections)
3. Commit those changes
4. Commit those changes
5. run the "scripts/dev/credits" script in php-src and commit the changes in the
4. run the "scripts/dev/credits" script in php-src and commit the changes in the
credits files in ext/standard.
6. tag the repository with the version f.e. "``git tag -s php-5.4.1``"
(of course, you need to change that to the version you're rolling an RC for).
When making 5.X release, you need to tag the Zend directory separately!!
5. Compile and make test, with and without ZTS, using the right Bison version
(for example, for 5.5, Bison 2.4.1 is used)
7. Bump up the version numbers in ``main/php_version.h``, ``configure.in`` and
possibly ``NEWS`` again, to the **next** version. F.e. if the release candidate
was "5.4.1RC1" then the new one should be "5.4.1RC2-dev" - regardless if we get
a new RC or not. This is to make sure ``version_compare()`` can correctly work.
6. Check ./sapi/cli/php -v output for version matching.
8. Commit those changes
7. tag the repository with the version f.e. "``git tag -s php-5.4.1``"
9. Log in onto the snaps box and go into the correct tree (f.e. the PHP-5.4
branch if you're rolling 5.5.x releases).
8. Push the tag f.e. "``git push origin php-5.4.1``"
10. You do not have to update the tree, but of course you can with "``git pull
origin <branch>``".
9. run: ``PHPROOT=. ./makedist php 5.4.1``, this will export the tag, create configure
and build three tarballs (gz, bz2 and xz).
Check if the pear files are updated (phar).
11. run: ``./makedist php 5.4.1``, this will export the tree, create configure
and build two tarballs (one gz and one bz2).
10. Generate the GPG signature files for the archives.
``gpg -u YOUREMAIL --armor --detach-sign php-X.Y.Z.tar.xxx``
12. Commit those two tarballs to Git (php-distributions.git)
11. Commit and push all the tarballs and signature files to web/php-distributions.git,
then update the git submodule reference in web/php.git:
``git submodule init;
git submodule update;
cd distributions;
git pull origin master;
cd ..;
git commit distributions;
git push;``
This is to fetch the last commit id from php-distributions.git and commit this
last commit id to web/php.git, then, mirrors will now sync
13. Once the release has been tagged, contact the PHP Windows development team
(internals-win@lists.php.net) so that Windows binaries can be created. Once
those are made, they should be committed to SVN too.
14. Check if the pear files are updated (phar for 5.1+ or run pear/make-pear-bundle.php with 4.4)
15. When making a final release, also remind the PHP Windows development team
(internals-win@lists.php.net) to prepare the installer packages for Win32.
12. Once the release has been tagged, contact the PHP Windows development team
(internals-win@lists.php.net) so that Windows binaries can be created.
Getting the stable release announced
------------------------------------
1. Run the bumpRelease script for phpweb on your local checkout
a. ``php bin/bumpRelease 5`` (or ``php bin/bumpRelease 4`` for PHP4)
a. ``php bin/bumpRelease 5`` to create the release file (releases/x_y_z.php)
The release announcement file should list in detail security fixes and
changes in behavior (whether due to a bug fix or not).
b. In case multiple PHP minor versions are in active development you have
to manually copy the old information to include/releases.inc
@@ -198,7 +207,13 @@ Getting the stable release announced
f. if the windows builds aren't ready yet prefix the "windows" key with a dot (".windows")
3. Update the ChangeLog file for the given major version
3. Update phpweb/include/releases.php with the old release info
(updates the download archives)
4. Update php-qa/include/release-qa.php and add the next version as an QARELEASE
(prepare for next RC)
5. Update the ChangeLog file for the given major version
f.e. ``ChangeLog-5.php`` from the NEWS file
a. go over the list and put every element on one line
@@ -218,19 +233,10 @@ f.e. ``ChangeLog-5.php`` from the NEWS file
IV. ``s/Fixed PECL bug #\([0-9]\+\)/<?php peclbugfix(\1); ?>/``
V. ``s/FR #\([0-9]\+\)/FR <?php bugl(\1); ?>/``
e. You may want to try php-web/bin/news2html to automate this task
4. ``cp releases/5_4_0.php releases/5_4_1.php``
5. ``git add releases/5_4_1.php``
6. Update the ``releases/*.php`` file with relevant data. The release
announcement file should list in detail:
a. security fixes,
b. changes in behavior (whether due to a bug fix or not)
7. Add a short notice to phpweb stating that there is a new release, and
6. Add a short notice to phpweb stating that there is a new release, and
highlight the major important things (security fixes) and when it is important
to upgrade.
@@ -238,7 +244,11 @@ to upgrade.
b. Add the content for the news entry
8. Commit all the changes.
7. **Check mirrors have been synced before announcing or pushing news**
Try, f.e. http://www.php.net/get/php-5.5.1.tar.bz2/from/a/mirror
Try several mirrors, mirrors may update slowly (may take an hour)
8. Commit all the changes to their respective git repos
9. Wait an hour or two, then send a mail to php-announce@lists.php.net,
php-general@lists.php.net and internals@lists.php.net with a text similar to
+1 -1
View File
@@ -4,7 +4,7 @@ dnl This file contains local autoconf functions.
AC_DEFUN([LIBZEND_BISON_CHECK],[
# we only support certain bison versions
bison_version_list="1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3 2.4 2.4.1 2.4.2 2.4.3 2.5 2.5.1 2.6 2.6.1 2.6.2"
bison_version_list="1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3 2.4 2.4.1 2.4.2 2.4.3 2.5 2.5.1 2.6 2.6.1 2.6.2 2.6.4"
# for standalone build of Zend Engine
test -z "$SED" && SED=sed
+13
View File
@@ -0,0 +1,13 @@
--TEST--
Bug #62343 (Show class_alias In get_declared_classes())
--FILE--
<?php
class a { }
class_alias("a", "b");
$c = get_declared_classes();
var_dump(end($c));
var_dump(prev($c));
?>
--EXPECT--
string(1) "b"
string(1) "a"
+74
View File
@@ -0,0 +1,74 @@
--TEST--
Test script to verify that magic methods should be called only once when accessing an unset property.
--CREDITS--
Marco Pivetta <ocramius@gmail.com>
--FILE--
<?php
class Test {
public $publicProperty;
protected $protectedProperty;
private $privateProperty;
public function __construct() {
unset(
$this->publicProperty,
$this->protectedProperty,
$this->privateProperty
);
}
function __get($name) {
echo '__get ' . $name . "\n";
return $this->$name;
}
function __set($name, $value) {
echo '__set ' . $name . "\n";
$this->$name = $value;
}
function __isset($name) {
echo '__isset ' . $name . "\n";
return isset($this->$name);
}
}
$test = new Test();
$test->nonExisting;
$test->publicProperty;
$test->protectedProperty;
$test->privateProperty;
isset($test->nonExisting);
isset($test->publicProperty);
isset($test->protectedProperty);
isset($test->privateProperty);
$test->nonExisting = 'value';
$test->publicProperty = 'value';
$test->protectedProperty = 'value';
$test->privateProperty = 'value';
?>
--EXPECTF--
__get nonExisting
Notice: Undefined property: Test::$nonExisting in %s on line %d
__get publicProperty
Notice: Undefined property: Test::$publicProperty in %s on line %d
__get protectedProperty
Notice: Undefined property: Test::$protectedProperty in %s on line %d
__get privateProperty
Notice: Undefined property: Test::$privateProperty in %s on line %d
__isset nonExisting
__isset publicProperty
__isset protectedProperty
__isset privateProperty
__set nonExisting
__set publicProperty
__set protectedProperty
__set privateProperty
+15
View File
@@ -0,0 +1,15 @@
--TEST--
Bug #64578 (debug_backtrace in set_error_handler corrupts zend heap: segfault)
--FILE--
<?php
function x($s) {
$resource = fopen("php://input", "r");
$s[$resource] = '2';
}
$y = "1";
x($y);
var_dump($y);
?>
--EXPECTF--
Warning: Illegal offset type in %sbug64578.php on line %d
string(1) "1"
+22
View File
@@ -0,0 +1,22 @@
--TEST--
Bug #64821 Custom Exceptions crash when internal properties overridden (variation 1)
--FILE--
<?php
class a extends exception {
public function __construct() {
$this->message = NULL;
$this->string = NULL;
$this->code = array();
$this->line = "hello";
}
}
throw new a;
?>
--EXPECTF--
Fatal error: Uncaught exception 'a' in %s:0
Stack trace:
#0 {main}
thrown in %s on line %d
+19
View File
@@ -0,0 +1,19 @@
--TEST--
Bug #64821 Custom Exceptions crash when internal properties overridden (variation 2)
--FILE--
<?php
class a extends exception {
public function __construct() {
$this->line = array();
}
}
throw new a;
?>
--EXPECTF--
Fatal error: Uncaught exception 'a' in %s:0
Stack trace:
#0 {main}
thrown in %s on line %d
+20
View File
@@ -0,0 +1,20 @@
--TEST--
Bug #64821 Custom Exceptions crash when internal properties overridden (variation 3)
--FILE--
<?php
class a extends exception {
public function __construct() {
$this->line = array();
$this->file = NULL;
}
}
throw new a;
?>
--EXPECTF--
Fatal error: Uncaught exception 'a' in :0
Stack trace:
#0 {main}
thrown in Unknown on line %d
+40
View File
@@ -0,0 +1,40 @@
--TEST--
Bug #64960 (Segfault in gc_zval_possible_root)
--FILE--
<?php
// this makes ob_end_clean raise an error
ob_end_flush();
class ExceptionHandler {
public function __invoke (Exception $e)
{
// this triggers the custom error handler
ob_end_clean();
}
}
// this must be a class, closure does not trigger segfault
set_exception_handler(new ExceptionHandler());
// exception must be throwed from error handler.
set_error_handler(function()
{
$e = new Exception;
$e->_trace = debug_backtrace();
throw $e;
});
// trigger error handler
$a['waa'];
?>
--EXPECTF--
Notice: ob_end_flush(): failed to delete and flush buffer. No buffer to delete or flush in %sbug64960.php on line 3
Fatal error: Uncaught exception 'Exception' in %sbug64960.php:19
Stack trace:
#0 [internal function]: {closure}(8, 'ob_end_clean():...', '%s', 9, Array)
#1 %sbug64960.php(9): ob_end_clean()
#2 [internal function]: ExceptionHandler->__invoke(Object(Exception))
#3 {main}
thrown in %sbug64960.php on line 19
+30
View File
@@ -0,0 +1,30 @@
--TEST--
Bug #64966 (segfault in zend_do_fcall_common_helper_SPEC)
--FILE--
<?php
error_reporting(E_ALL);
set_error_handler(function($error) { throw new Exception(); }, E_RECOVERABLE_ERROR);
function test($func) {
$a = $func("");
return true;
}
class A {
public function b() {
test("strlen");
test("iterator_apply");
}
}
$a = new A();
$a->b();
?>
--EXPECTF--
Fatal error: Uncaught exception 'Exception' in %sbug64966.php:3
Stack trace:
#0 [internal function]: {closure}(4096, 'Argument 1 pass...', '%s', 6, Array)
#1 %sbug64966.php(6): iterator_apply('')
#2 %sbug64966.php(12): test('iterator_apply')
#3 %sbug64966.php(17): A->b()
#4 {main}
thrown in %sbug64966.php on line 3
+1 -1
View File
@@ -114,7 +114,7 @@ ZEND_API zval zval_used_for_init; /* True global variable */
/* version information */
static char *zend_version_info;
static uint zend_version_info_length;
#define ZEND_CORE_VERSION_INFO "Zend Engine v" ZEND_VERSION ", Copyright (c) 1998-2013 Zend Technologies\n"
#define ZEND_CORE_VERSION_INFO "Zend Engine v" ZEND_VERSION ", Copyright (c) 1998-2014 Zend Technologies\n"
#define PRINT_ZVAL_INDENT 4
static void print_hash(zend_write_func_t write_func, HashTable *ht, int indent, zend_bool is_object TSRMLS_DC) /* {{{ */
+3 -3
View File
@@ -90,7 +90,7 @@ typedef struct _zend_fcall_info_cache {
#define ZEND_NS_RAW_FENTRY(ns, zend_name, name, arg_info, flags) ZEND_RAW_FENTRY(ZEND_NS_NAME(ns, zend_name), name, arg_info, flags)
#define ZEND_NS_RAW_NAMED_FE(ns, zend_name, name, arg_info) ZEND_NS_RAW_FENTRY(ns, #zend_name, name, arg_info, 0)
#define ZEND_NS_NAMED_FE(ns, zend_name, name, arg_info) ZEND_NS_FENTRY(ns, #zend_name, name, arg_info, 0)
#define ZEND_NS_NAMED_FE(ns, zend_name, name, arg_info) ZEND_NS_FENTRY(ns, zend_name, name, arg_info, 0)
#define ZEND_NS_FE(ns, name, arg_info) ZEND_NS_FENTRY(ns, name, ZEND_FN(name), arg_info, 0)
#define ZEND_NS_DEP_FE(ns, name, arg_info) ZEND_NS_FENTRY(ns, name, ZEND_FN(name), arg_info, ZEND_ACC_DEPRECATED)
#define ZEND_NS_FALIAS(ns, name, alias, arg_info) ZEND_NS_FENTRY(ns, name, ZEND_FN(alias), arg_info, 0)
@@ -268,9 +268,9 @@ ZEND_API void zend_class_implements(zend_class_entry *class_entry TSRMLS_DC, int
ZEND_API int zend_register_class_alias_ex(const char *name, int name_len, zend_class_entry *ce TSRMLS_DC);
#define zend_register_class_alias(name, ce) \
zend_register_class_alias_ex(name, sizeof(name)-1, ce TSRMLS_DC)
zend_register_class_alias_ex(name, sizeof(name)-1, ce TSRMLS_CC)
#define zend_register_ns_class_alias(ns, name, ce) \
zend_register_class_alias_ex(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name))-1, ce TSRMLS_DC)
zend_register_class_alias_ex(ZEND_NS_NAME(ns, name), sizeof(ZEND_NS_NAME(ns, name))-1, ce TSRMLS_CC)
ZEND_API int zend_disable_function(char *function_name, uint function_name_length TSRMLS_DC);
ZEND_API int zend_disable_class(char *class_name, uint class_name_length TSRMLS_DC);
+2 -2
View File
@@ -2386,7 +2386,7 @@ static inline size_t safe_address(size_t nmemb, size_t size, size_t offset)
size_t res = nmemb;
unsigned long overflow = 0;
__asm__ ("mull %3\n\taddl %4,%0\n\tadcl %1,%1"
__asm__ ("mull %3\n\taddl %4,%0\n\tadcl $0,%1"
: "=&a"(res), "=&d" (overflow)
: "%0"(res),
"rm"(size),
@@ -2406,7 +2406,7 @@ static inline size_t safe_address(size_t nmemb, size_t size, size_t offset)
size_t res = nmemb;
unsigned long overflow = 0;
__asm__ ("mulq %3\n\taddq %4,%0\n\tadcq %1,%1"
__asm__ ("mulq %3\n\taddq %4,%0\n\tadcq $0,%1"
: "=&a"(res), "=&d" (overflow)
: "%0"(res),
"rm"(size),
+14 -1
View File
@@ -1541,6 +1541,13 @@ ZEND_FUNCTION(restore_exception_handler)
}
/* }}} */
static int same_name(const char *key, const char *name, zend_uint name_len)
{
char *lcname = zend_str_tolower_dup(name, name_len);
int ret = memcmp(lcname, key, name_len) == 0;
efree(lcname);
return ret;
}
static int copy_class_or_interface_name(zend_class_entry **pce TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key)
{
@@ -1552,7 +1559,13 @@ static int copy_class_or_interface_name(zend_class_entry **pce TSRMLS_DC, int nu
if ((hash_key->nKeyLength==0 || hash_key->arKey[0]!=0)
&& (comply_mask == (ce->ce_flags & mask))) {
add_next_index_stringl(array, ce->name, ce->name_length, 1);
if (ce->refcount > 1 &&
(ce->name_length != hash_key->nKeyLength - 1 ||
!same_name(hash_key->arKey, ce->name, ce->name_length))) {
add_next_index_stringl(array, hash_key->arKey, hash_key->nKeyLength - 1, 1);
} else {
add_next_index_stringl(array, ce->name, ce->name_length, 1);
}
}
return ZEND_HASH_APPLY_KEEP;
}
+4 -3
View File
@@ -3414,10 +3414,11 @@ void zend_do_begin_class_declaration(const znode *class_token, znode *class_name
/* Prefix class name with name of current namespace */
znode tmp;
tmp.op_type = IS_CONST;
tmp.u.constant = *CG(current_namespace);
zval_copy_ctor(&tmp.u.constant);
zend_do_build_namespace_name(&tmp, &tmp, class_name TSRMLS_CC);
class_name = &tmp;
*class_name = tmp;
efree(lcname);
lcname = zend_str_tolower_dup(Z_STRVAL(class_name->u.constant), Z_STRLEN(class_name->u.constant));
}
@@ -3529,7 +3530,7 @@ void zend_do_end_class_declaration(const znode *class_token, const znode *parent
ce->line_end = zend_get_compiled_lineno(TSRMLS_C);
if (!(ce->ce_flags & (ZEND_ACC_INTERFACE|ZEND_ACC_EXPLICIT_ABSTRACT_CLASS))
&& ((parent_token->op_type != IS_UNUSED) || (ce->num_interfaces > 0))) {
&& (parent_token || (ce->num_interfaces > 0))) {
zend_verify_abstract_class(ce TSRMLS_CC);
if (ce->num_interfaces) {
do_verify_abstract_class(TSRMLS_C);
@@ -4018,7 +4019,7 @@ void zend_do_shell_exec(znode *result, const znode *cmd TSRMLS_DC) /* {{{ */
break;
}
opline->op1 = *cmd;
opline->op2.u.opline_num = 0;
opline->op2.u.opline_num = 1;
opline->extended_value = ZEND_DO_FCALL;
SET_UNUSED(opline->op2);
+9 -1
View File
@@ -803,6 +803,10 @@ ZEND_API void zend_exception_error(zval *exception, int severity TSRMLS_DC) /* {
if (instanceof_function(ce_exception, default_exception_ce TSRMLS_CC)) {
file = zend_read_property(default_exception_ce, EG(exception), "file", sizeof("file")-1, 1 TSRMLS_CC);
line = zend_read_property(default_exception_ce, EG(exception), "line", sizeof("line")-1, 1 TSRMLS_CC);
convert_to_string(file);
file = (Z_STRLEN_P(file) > 0) ? file : NULL;
line = (Z_TYPE_P(line) == IS_LONG) ? line : NULL;
} else {
file = NULL;
line = NULL;
@@ -814,7 +818,11 @@ ZEND_API void zend_exception_error(zval *exception, int severity TSRMLS_DC) /* {
file = zend_read_property(default_exception_ce, exception, "file", sizeof("file")-1, 1 TSRMLS_CC);
line = zend_read_property(default_exception_ce, exception, "line", sizeof("line")-1, 1 TSRMLS_CC);
zend_error_va(severity, Z_STRVAL_P(file), Z_LVAL_P(line), "Uncaught %s\n thrown", Z_STRVAL_P(str));
convert_to_string(str);
convert_to_string(file);
convert_to_long(line);
zend_error_va(severity, (Z_STRLEN_P(file) > 0) ? Z_STRVAL_P(file) : NULL, Z_LVAL_P(line), "Uncaught %s\n thrown", Z_STRVAL_P(str));
} else {
zend_error(severity, "Uncaught exception '%s'", ce_exception->name);
}
+4 -3
View File
@@ -937,6 +937,10 @@ convert_to_array:
zend_error_noreturn(E_ERROR, "[] operator not supported for strings");
}
if (type != BP_VAR_UNSET) {
SEPARATE_ZVAL_IF_NOT_REF(container_ptr);
}
if (Z_TYPE_P(dim) != IS_LONG) {
switch(Z_TYPE_P(dim)) {
/* case IS_LONG: */
@@ -956,9 +960,6 @@ convert_to_array:
convert_to_long(&tmp);
dim = &tmp;
}
if (type != BP_VAR_UNSET) {
SEPARATE_ZVAL_IF_NOT_REF(container_ptr);
}
container = *container_ptr;
result->str_offset.str = container;
PZVAL_LOCK(container);
+2 -4
View File
@@ -263,15 +263,13 @@ void shutdown_executor(TSRMLS_D) /* {{{ */
if (EG(user_error_handler)) {
zeh = EG(user_error_handler);
EG(user_error_handler) = NULL;
zval_dtor(zeh);
FREE_ZVAL(zeh);
zval_ptr_dtor(&zeh);
}
if (EG(user_exception_handler)) {
zeh = EG(user_exception_handler);
EG(user_exception_handler) = NULL;
zval_dtor(zeh);
FREE_ZVAL(zeh);
zval_ptr_dtor(&zeh);
}
zend_stack_destroy(&EG(user_error_handlers_error_reporting));
+2 -2
View File
@@ -316,13 +316,13 @@ unticked_class_declaration_statement:
implements_list
'{'
class_statement_list
'}' { zend_do_end_class_declaration(&$1, &$2 TSRMLS_CC); }
'}' { zend_do_end_class_declaration(&$1, &$3 TSRMLS_CC); }
| interface_entry T_STRING
{ zend_do_begin_class_declaration(&$1, &$2, NULL TSRMLS_CC); }
interface_extends_list
'{'
class_statement_list
'}' { zend_do_end_class_declaration(&$1, &$2 TSRMLS_CC); }
'}' { zend_do_end_class_declaration(&$1, NULL TSRMLS_CC); }
;
+10
View File
@@ -296,6 +296,16 @@ static int zend_get_property_guard(zend_object *zobj, zend_property_info *proper
info.name = Z_STRVAL_P(member);
info.name_length = Z_STRLEN_P(member);
info.h = zend_get_hash_value(Z_STRVAL_P(member), Z_STRLEN_P(member) + 1);
} else if(property_info->name[0] == '\0'){
const char *class_name = NULL, *prop_name = NULL;
zend_unmangle_property_name(property_info->name, property_info->name_length, &class_name, &prop_name);
if(class_name) {
/* use unmangled name for protected properties */
info.name = prop_name;
info.name_length = strlen(prop_name);
info.h = zend_get_hash_value(info.name, info.name_length+1);
property_info = &info;
}
}
if (!zobj->guards) {
ALLOC_HASHTABLE(zobj->guards);
+23 -27
View File
@@ -896,23 +896,12 @@ ZEND_VM_HANDLER(40, ZEND_ECHO, CONST|TMP|VAR|CV, ANY)
{
zend_op *opline = EX(opline);
zend_free_op free_op1;
zval z_copy;
zval *z = GET_OP1_ZVAL_PTR(BP_VAR_R);
if (OP1_TYPE != IS_CONST &&
Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get_method != NULL) {
if (OP1_TYPE == IS_TMP_VAR) {
INIT_PZVAL(z);
}
if (zend_std_cast_object_tostring(z, &z_copy, IS_STRING TSRMLS_CC) == SUCCESS) {
zend_print_variable(&z_copy);
zval_dtor(&z_copy);
} else {
zend_print_variable(z);
}
} else {
zend_print_variable(z);
if (OP1_TYPE == IS_TMP_VAR && Z_TYPE_P(z) == IS_OBJECT) {
INIT_PZVAL(z);
}
zend_print_variable(z);
FREE_OP1();
ZEND_VM_NEXT_OPCODE();
@@ -2312,10 +2301,6 @@ ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY)
EX(function_state).arguments = zend_vm_stack_push_args(opline->extended_value TSRMLS_CC);
if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION) {
ALLOC_INIT_ZVAL(EX_T(opline->result.u.var).var.ptr);
EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr;
EX_T(opline->result.u.var).var.fcall_returned_reference = EX(function_state).function->common.return_reference;
if (EX(function_state).function->common.arg_info) {
zend_uint i=0;
zval **p = (zval**)EX(function_state).arguments;
@@ -2326,15 +2311,24 @@ ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY)
arg_count--;
}
}
if (!zend_execute_internal) {
/* saves one function call if zend_execute_internal is not used */
((zend_internal_function *) EX(function_state).function)->handler(opline->extended_value, EX_T(opline->result.u.var).var.ptr, EX(function_state).function->common.return_reference?&EX_T(opline->result.u.var).var.ptr:NULL, EX(object), RETURN_VALUE_USED(opline) TSRMLS_CC);
} else {
zend_execute_internal(EXECUTE_DATA, RETURN_VALUE_USED(opline) TSRMLS_CC);
}
if (!RETURN_VALUE_USED(opline)) {
zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr);
if (EXPECTED(EG(exception) == NULL)) {
ALLOC_INIT_ZVAL(EX_T(opline->result.u.var).var.ptr);
EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr;
EX_T(opline->result.u.var).var.fcall_returned_reference = EX(function_state).function->common.return_reference;
if (!zend_execute_internal) {
/* saves one function call if zend_execute_internal is not used */
((zend_internal_function *) EX(function_state).function)->handler(opline->extended_value, EX_T(opline->result.u.var).var.ptr, EX(function_state).function->common.return_reference?&EX_T(opline->result.u.var).var.ptr:NULL, EX(object), RETURN_VALUE_USED(opline) TSRMLS_CC);
} else {
zend_execute_internal(EXECUTE_DATA, RETURN_VALUE_USED(opline) TSRMLS_CC);
}
if (!RETURN_VALUE_USED(opline)) {
zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr);
}
} else if (RETURN_VALUE_USED(opline)) {
EX_T(opline->result.u.var).var.ptr = NULL;
}
} else if (EX(function_state).function->type == ZEND_USER_FUNCTION) {
EX(original_return_value) = EG(return_value_ptr_ptr);
@@ -2718,7 +2712,9 @@ ZEND_VM_HANDLER(67, ZEND_SEND_REF, VAR|CV, ANY)
ZEND_VM_NEXT_OPCODE();
}
if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION && !ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) {
if (opline->extended_value == ZEND_DO_FCALL_BY_NAME &&
EX(function_state).function->type == ZEND_INTERNAL_FUNCTION &&
!ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) {
ZEND_VM_DISPATCH_TO_HELPER(zend_send_by_var_helper);
}
+35 -70
View File
@@ -301,10 +301,6 @@ static int ZEND_FASTCALL zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_AR
EX(function_state).arguments = zend_vm_stack_push_args(opline->extended_value TSRMLS_CC);
if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION) {
ALLOC_INIT_ZVAL(EX_T(opline->result.u.var).var.ptr);
EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr;
EX_T(opline->result.u.var).var.fcall_returned_reference = EX(function_state).function->common.return_reference;
if (EX(function_state).function->common.arg_info) {
zend_uint i=0;
zval **p = (zval**)EX(function_state).arguments;
@@ -315,15 +311,24 @@ static int ZEND_FASTCALL zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_AR
arg_count--;
}
}
if (!zend_execute_internal) {
/* saves one function call if zend_execute_internal is not used */
((zend_internal_function *) EX(function_state).function)->handler(opline->extended_value, EX_T(opline->result.u.var).var.ptr, EX(function_state).function->common.return_reference?&EX_T(opline->result.u.var).var.ptr:NULL, EX(object), RETURN_VALUE_USED(opline) TSRMLS_CC);
} else {
zend_execute_internal(execute_data, RETURN_VALUE_USED(opline) TSRMLS_CC);
}
if (!RETURN_VALUE_USED(opline)) {
zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr);
if (EXPECTED(EG(exception) == NULL)) {
ALLOC_INIT_ZVAL(EX_T(opline->result.u.var).var.ptr);
EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr;
EX_T(opline->result.u.var).var.fcall_returned_reference = EX(function_state).function->common.return_reference;
if (!zend_execute_internal) {
/* saves one function call if zend_execute_internal is not used */
((zend_internal_function *) EX(function_state).function)->handler(opline->extended_value, EX_T(opline->result.u.var).var.ptr, EX(function_state).function->common.return_reference?&EX_T(opline->result.u.var).var.ptr:NULL, EX(object), RETURN_VALUE_USED(opline) TSRMLS_CC);
} else {
zend_execute_internal(execute_data, RETURN_VALUE_USED(opline) TSRMLS_CC);
}
if (!RETURN_VALUE_USED(opline)) {
zval_ptr_dtor(&EX_T(opline->result.u.var).var.ptr);
}
} else if (RETURN_VALUE_USED(opline)) {
EX_T(opline->result.u.var).var.ptr = NULL;
}
} else if (EX(function_state).function->type == ZEND_USER_FUNCTION) {
EX(original_return_value) = EG(return_value_ptr_ptr);
@@ -1320,23 +1325,12 @@ static int ZEND_FASTCALL ZEND_ECHO_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
zval z_copy;
zval *z = &opline->op1.u.constant;
if (IS_CONST != IS_CONST &&
Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get_method != NULL) {
if (IS_CONST == IS_TMP_VAR) {
INIT_PZVAL(z);
}
if (zend_std_cast_object_tostring(z, &z_copy, IS_STRING TSRMLS_CC) == SUCCESS) {
zend_print_variable(&z_copy);
zval_dtor(&z_copy);
} else {
zend_print_variable(z);
}
} else {
zend_print_variable(z);
if (IS_CONST == IS_TMP_VAR && Z_TYPE_P(z) == IS_OBJECT) {
INIT_PZVAL(z);
}
zend_print_variable(z);
ZEND_VM_NEXT_OPCODE();
}
@@ -4635,23 +4629,12 @@ static int ZEND_FASTCALL ZEND_ECHO_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
zend_free_op free_op1;
zval z_copy;
zval *z = _get_zval_ptr_tmp(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
if (IS_TMP_VAR != IS_CONST &&
Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get_method != NULL) {
if (IS_TMP_VAR == IS_TMP_VAR) {
INIT_PZVAL(z);
}
if (zend_std_cast_object_tostring(z, &z_copy, IS_STRING TSRMLS_CC) == SUCCESS) {
zend_print_variable(&z_copy);
zval_dtor(&z_copy);
} else {
zend_print_variable(z);
}
} else {
zend_print_variable(z);
if (IS_TMP_VAR == IS_TMP_VAR && Z_TYPE_P(z) == IS_OBJECT) {
INIT_PZVAL(z);
}
zend_print_variable(z);
zval_dtor(free_op1.var);
ZEND_VM_NEXT_OPCODE();
@@ -7898,23 +7881,12 @@ static int ZEND_FASTCALL ZEND_ECHO_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
zend_free_op free_op1;
zval z_copy;
zval *z = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC);
if (IS_VAR != IS_CONST &&
Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get_method != NULL) {
if (IS_VAR == IS_TMP_VAR) {
INIT_PZVAL(z);
}
if (zend_std_cast_object_tostring(z, &z_copy, IS_STRING TSRMLS_CC) == SUCCESS) {
zend_print_variable(&z_copy);
zval_dtor(&z_copy);
} else {
zend_print_variable(z);
}
} else {
zend_print_variable(z);
if (IS_VAR == IS_TMP_VAR && Z_TYPE_P(z) == IS_OBJECT) {
INIT_PZVAL(z);
}
zend_print_variable(z);
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
ZEND_VM_NEXT_OPCODE();
@@ -8429,7 +8401,9 @@ static int ZEND_FASTCALL ZEND_SEND_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
ZEND_VM_NEXT_OPCODE();
}
if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION && !ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) {
if (opline->extended_value == ZEND_DO_FCALL_BY_NAME &&
EX(function_state).function->type == ZEND_INTERNAL_FUNCTION &&
!ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) {
return zend_send_by_var_helper_SPEC_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
}
@@ -21823,23 +21797,12 @@ static int ZEND_FASTCALL ZEND_ECHO_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
zend_op *opline = EX(opline);
zval z_copy;
zval *z = _get_zval_ptr_cv(&opline->op1, EX(Ts), BP_VAR_R TSRMLS_CC);
if (IS_CV != IS_CONST &&
Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get_method != NULL) {
if (IS_CV == IS_TMP_VAR) {
INIT_PZVAL(z);
}
if (zend_std_cast_object_tostring(z, &z_copy, IS_STRING TSRMLS_CC) == SUCCESS) {
zend_print_variable(&z_copy);
zval_dtor(&z_copy);
} else {
zend_print_variable(z);
}
} else {
zend_print_variable(z);
if (IS_CV == IS_TMP_VAR && Z_TYPE_P(z) == IS_OBJECT) {
INIT_PZVAL(z);
}
zend_print_variable(z);
ZEND_VM_NEXT_OPCODE();
}
@@ -22353,7 +22316,9 @@ static int ZEND_FASTCALL ZEND_SEND_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
ZEND_VM_NEXT_OPCODE();
}
if (EX(function_state).function->type == ZEND_INTERNAL_FUNCTION && !ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) {
if (opline->extended_value == ZEND_DO_FCALL_BY_NAME &&
EX(function_state).function->type == ZEND_INTERNAL_FUNCTION &&
!ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->op2.u.opline_num)) {
return zend_send_by_var_helper_SPEC_CV(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
}
+1 -1
View File
@@ -1700,7 +1700,7 @@ int main(int argc, char *argv[])
{
FILE *fp;
long position;
char *filename = "/tmp/phpglibccheck";
char *filename = tmpnam(NULL);
fp = fopen(filename, "w");
if (fp == NULL) {
+3 -3
View File
@@ -41,8 +41,8 @@ AC_CONFIG_HEADER(main/php_config.h)
PHP_MAJOR_VERSION=5
PHP_MINOR_VERSION=3
PHP_RELEASE_VERSION=21
PHP_EXTRA_VERSION="-dev"
PHP_RELEASE_VERSION=29
PHP_EXTRA_VERSION=""
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`
@@ -712,7 +712,7 @@ if test "$PHP_GCOV" = "yes"; then
AC_MSG_ERROR([ccache must be disabled when --enable-gcov option is used. You can disable ccache by setting environment variable CCACHE_DISABLE=1.])
fi
ltp_version_list="1.5 1.6 1.7"
ltp_version_list="1.5 1.6 1.7 1.9 1.10"
AC_CHECK_PROG(LTP, lcov, lcov)
AC_CHECK_PROG(LTP_GENHTML, genhtml, genhtml)
+2 -1
View File
@@ -272,6 +272,7 @@
#define HALAKIM_PER_METONIC_CYCLE (HALAKIM_PER_LUNAR_CYCLE * (12 * 19 + 7))
#define JEWISH_SDN_OFFSET 347997
#define JEWISH_SDN_MAX 324542846L /* 12/13/887605, greater value raises interger overflow */
#define NEW_MOON_OF_CREATION 31524
#define SUNDAY 0
@@ -519,7 +520,7 @@ void SdnToJewish(
int tishri1After;
int yearLength;
if (sdn <= JEWISH_SDN_OFFSET) {
if (sdn <= JEWISH_SDN_OFFSET || sdn > JEWISH_SDN_MAX) {
*pYear = 0;
*pMonth = 0;
*pDay = 0;
+19
View File
@@ -0,0 +1,19 @@
--TEST--
Bug #64895: Integer overflow in SndToJewish
--SKIPIF--
<?php
include 'skipif.inc';
if (PHP_INT_SIZE == 4) {
die("skip this test is for 64bit platform only");
}
?>
--FILE--
<?php
$a = array(38245310, 324542846, 324542847, 9223372036854743639);
foreach ($a as $x) var_dump(jdtojewish($x));
--EXPECTF--
string(11) "2/22/103759"
string(12) "12/13/887605"
string(5) "0/0/0"
string(5) "0/0/0"
+2 -2
View File
@@ -698,9 +698,9 @@ PHP_FUNCTION(com_event_sink)
/* 0 => typelibname, 1 => dispname */
zval **tmp;
if (zend_hash_index_find(Z_ARRVAL_P(sink), 0, (void**)&tmp) == SUCCESS)
if (zend_hash_index_find(Z_ARRVAL_P(sink), 0, (void**)&tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_STRING)
typelibname = Z_STRVAL_PP(tmp);
if (zend_hash_index_find(Z_ARRVAL_P(sink), 1, (void**)&tmp) == SUCCESS)
if (zend_hash_index_find(Z_ARRVAL_P(sink), 1, (void**)&tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_STRING)
dispname = Z_STRVAL_PP(tmp);
} else if (sink != NULL) {
convert_to_string(sink);
+1 -1
View File
@@ -38,4 +38,4 @@ curl_close($ch);
?>
--EXPECTF--
== Testing curl_error with a fake URL ==
string(%d) "%sfakeURL%s"
string(%d) "%sfakeURL%S"
+107 -100
View File
@@ -1,4 +1,4 @@
/* Generated by re2c 0.13.5 on Mon Dec 5 22:02:41 2011 */
/* Generated by re2c 0.13.5 on Fri Jul 18 16:11:36 2014 */
#line 1 "ext/date/lib/parse_date.re"
/*
+----------------------------------------------------------------------+
@@ -403,9 +403,12 @@ static timelib_sll timelib_meridian_with_check(char **ptr, timelib_sll h)
{
timelib_sll retval = 0;
while (!strchr("AaPp", **ptr)) {
while (**ptr && !strchr("AaPp", **ptr)) {
++*ptr;
}
if(!**ptr) {
return TIMELIB_UNSET;
}
if (**ptr == 'a' || **ptr == 'A') {
if (h == 12) {
retval = -12;
@@ -871,11 +874,11 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper)
std:
s->tok = cursor;
s->len = 0;
#line 997 "ext/date/lib/parse_date.re"
#line 1000 "ext/date/lib/parse_date.re"
#line 879 "ext/date/lib/parse_date.c"
#line 882 "ext/date/lib/parse_date.c"
{
YYCTYPE yych;
unsigned int yyaccept = 0;
@@ -995,7 +998,7 @@ std:
}
yy2:
YYDEBUG(2, *YYCURSOR);
#line 1082 "ext/date/lib/parse_date.re"
#line 1085 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("firstdayof | lastdayof");
TIMELIB_INIT;
@@ -1011,7 +1014,7 @@ yy2:
TIMELIB_DEINIT;
return TIMELIB_LF_DAY_OF_MONTH;
}
#line 1015 "ext/date/lib/parse_date.c"
#line 1018 "ext/date/lib/parse_date.c"
yy3:
YYDEBUG(3, *YYCURSOR);
++YYCURSOR;
@@ -1034,7 +1037,7 @@ yy3:
}
yy4:
YYDEBUG(4, *YYCURSOR);
#line 1676 "ext/date/lib/parse_date.re"
#line 1679 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("tzcorrection | tz");
@@ -1047,7 +1050,7 @@ yy4:
TIMELIB_DEINIT;
return TIMELIB_TIMEZONE;
}
#line 1051 "ext/date/lib/parse_date.c"
#line 1054 "ext/date/lib/parse_date.c"
yy5:
YYDEBUG(5, *YYCURSOR);
yych = *++YYCURSOR;
@@ -1358,12 +1361,12 @@ yy12:
if (yych <= '9') goto yy1385;
yy13:
YYDEBUG(13, *YYCURSOR);
#line 1771 "ext/date/lib/parse_date.re"
#line 1774 "ext/date/lib/parse_date.re"
{
add_error(s, "Unexpected character");
goto std;
}
#line 1367 "ext/date/lib/parse_date.c"
#line 1370 "ext/date/lib/parse_date.c"
yy14:
YYDEBUG(14, *YYCURSOR);
yych = *++YYCURSOR;
@@ -2420,11 +2423,11 @@ yy49:
if (yych <= '9') goto yy55;
yy50:
YYDEBUG(50, *YYCURSOR);
#line 1760 "ext/date/lib/parse_date.re"
#line 1763 "ext/date/lib/parse_date.re"
{
goto std;
}
#line 2428 "ext/date/lib/parse_date.c"
#line 2431 "ext/date/lib/parse_date.c"
yy51:
YYDEBUG(51, *YYCURSOR);
yych = *++YYCURSOR;
@@ -2433,12 +2436,12 @@ yy52:
YYDEBUG(52, *YYCURSOR);
++YYCURSOR;
YYDEBUG(53, *YYCURSOR);
#line 1765 "ext/date/lib/parse_date.re"
#line 1768 "ext/date/lib/parse_date.re"
{
s->pos = cursor; s->line++;
goto std;
}
#line 2442 "ext/date/lib/parse_date.c"
#line 2445 "ext/date/lib/parse_date.c"
yy54:
YYDEBUG(54, *YYCURSOR);
yych = *++YYCURSOR;
@@ -2825,7 +2828,7 @@ yy72:
if (yych == 's') goto yy74;
yy73:
YYDEBUG(73, *YYCURSOR);
#line 1744 "ext/date/lib/parse_date.re"
#line 1747 "ext/date/lib/parse_date.re"
{
timelib_ull i;
DEBUG_OUTPUT("relative");
@@ -2840,7 +2843,7 @@ yy73:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 2844 "ext/date/lib/parse_date.c"
#line 2847 "ext/date/lib/parse_date.c"
yy74:
YYDEBUG(74, *YYCURSOR);
yych = *++YYCURSOR;
@@ -3602,7 +3605,7 @@ yy166:
}
yy167:
YYDEBUG(167, *YYCURSOR);
#line 1607 "ext/date/lib/parse_date.re"
#line 1610 "ext/date/lib/parse_date.re"
{
const timelib_relunit* relunit;
DEBUG_OUTPUT("daytext");
@@ -3619,7 +3622,7 @@ yy167:
TIMELIB_DEINIT;
return TIMELIB_WEEKDAY;
}
#line 3623 "ext/date/lib/parse_date.c"
#line 3626 "ext/date/lib/parse_date.c"
yy168:
YYDEBUG(168, *YYCURSOR);
yych = *++YYCURSOR;
@@ -4139,7 +4142,7 @@ yy193:
}
yy194:
YYDEBUG(194, *YYCURSOR);
#line 1666 "ext/date/lib/parse_date.re"
#line 1669 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("monthtext");
TIMELIB_INIT;
@@ -4148,7 +4151,7 @@ yy194:
TIMELIB_DEINIT;
return TIMELIB_DATE_TEXT;
}
#line 4152 "ext/date/lib/parse_date.c"
#line 4155 "ext/date/lib/parse_date.c"
yy195:
YYDEBUG(195, *YYCURSOR);
++YYCURSOR;
@@ -4199,7 +4202,7 @@ yy198:
}
yy199:
YYDEBUG(199, *YYCURSOR);
#line 1412 "ext/date/lib/parse_date.re"
#line 1415 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("datetextual | datenoyear");
@@ -4212,7 +4215,7 @@ yy199:
TIMELIB_DEINIT;
return TIMELIB_DATE_TEXT;
}
#line 4216 "ext/date/lib/parse_date.c"
#line 4219 "ext/date/lib/parse_date.c"
yy200:
YYDEBUG(200, *YYCURSOR);
yyaccept = 6;
@@ -4481,7 +4484,7 @@ yy222:
}
yy223:
YYDEBUG(223, *YYCURSOR);
#line 1714 "ext/date/lib/parse_date.re"
#line 1717 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("dateshortwithtimeshort | dateshortwithtimelong | dateshortwithtimelongtz");
@@ -4510,7 +4513,7 @@ yy223:
TIMELIB_DEINIT;
return TIMELIB_SHORTDATE_WITH_TIME;
}
#line 4514 "ext/date/lib/parse_date.c"
#line 4517 "ext/date/lib/parse_date.c"
yy224:
YYDEBUG(224, *YYCURSOR);
yyaccept = 7;
@@ -5208,7 +5211,7 @@ yy278:
YYDEBUG(278, *YYCURSOR);
++YYCURSOR;
YYDEBUG(279, *YYCURSOR);
#line 1690 "ext/date/lib/parse_date.re"
#line 1693 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("dateshortwithtimeshort12 | dateshortwithtimelong12");
TIMELIB_INIT;
@@ -5231,7 +5234,7 @@ yy278:
TIMELIB_DEINIT;
return TIMELIB_SHORTDATE_WITH_TIME;
}
#line 5235 "ext/date/lib/parse_date.c"
#line 5238 "ext/date/lib/parse_date.c"
yy280:
YYDEBUG(280, *YYCURSOR);
yych = *++YYCURSOR;
@@ -5409,7 +5412,7 @@ yy294:
++YYCURSOR;
yy295:
YYDEBUG(295, *YYCURSOR);
#line 1384 "ext/date/lib/parse_date.re"
#line 1387 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("datenoday");
@@ -5422,7 +5425,7 @@ yy295:
TIMELIB_DEINIT;
return TIMELIB_DATE_NO_DAY;
}
#line 5426 "ext/date/lib/parse_date.c"
#line 5429 "ext/date/lib/parse_date.c"
yy296:
YYDEBUG(296, *YYCURSOR);
yych = *++YYCURSOR;
@@ -6642,7 +6645,7 @@ yy362:
if (yych <= '9') goto yy365;
yy364:
YYDEBUG(364, *YYCURSOR);
#line 1528 "ext/date/lib/parse_date.re"
#line 1531 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("pgtextshort");
@@ -6655,7 +6658,7 @@ yy364:
TIMELIB_DEINIT;
return TIMELIB_PG_TEXT;
}
#line 6659 "ext/date/lib/parse_date.c"
#line 6662 "ext/date/lib/parse_date.c"
yy365:
YYDEBUG(365, *YYCURSOR);
yych = *++YYCURSOR;
@@ -7293,7 +7296,7 @@ yy392:
}
yy393:
YYDEBUG(393, *YYCURSOR);
#line 1586 "ext/date/lib/parse_date.re"
#line 1589 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("ago");
TIMELIB_INIT;
@@ -7313,7 +7316,7 @@ yy393:
TIMELIB_DEINIT;
return TIMELIB_AGO;
}
#line 7317 "ext/date/lib/parse_date.c"
#line 7320 "ext/date/lib/parse_date.c"
yy394:
YYDEBUG(394, *YYCURSOR);
yyaccept = 5;
@@ -9063,7 +9066,7 @@ yy454:
++YYCURSOR;
yy455:
YYDEBUG(455, *YYCURSOR);
#line 1289 "ext/date/lib/parse_date.re"
#line 1292 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("iso8601date4 | iso8601date2 | iso8601dateslash | dateslash");
TIMELIB_INIT;
@@ -9074,7 +9077,7 @@ yy455:
TIMELIB_DEINIT;
return TIMELIB_ISO_DATE;
}
#line 9078 "ext/date/lib/parse_date.c"
#line 9081 "ext/date/lib/parse_date.c"
yy456:
YYDEBUG(456, *YYCURSOR);
yyaccept = 0;
@@ -9634,7 +9637,7 @@ yy475:
}
yy476:
YYDEBUG(476, *YYCURSOR);
#line 1426 "ext/date/lib/parse_date.re"
#line 1429 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("datenoyearrev");
TIMELIB_INIT;
@@ -9645,7 +9648,7 @@ yy476:
TIMELIB_DEINIT;
return TIMELIB_DATE_TEXT;
}
#line 9649 "ext/date/lib/parse_date.c"
#line 9652 "ext/date/lib/parse_date.c"
yy477:
YYDEBUG(477, *YYCURSOR);
yyaccept = 10;
@@ -9786,7 +9789,7 @@ yy488:
YYDEBUG(488, *YYCURSOR);
++YYCURSOR;
YYDEBUG(489, *YYCURSOR);
#line 1144 "ext/date/lib/parse_date.re"
#line 1147 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("timetiny12 | timeshort12 | timelong12");
TIMELIB_INIT;
@@ -9802,7 +9805,7 @@ yy488:
TIMELIB_DEINIT;
return TIMELIB_TIME12;
}
#line 9806 "ext/date/lib/parse_date.c"
#line 9809 "ext/date/lib/parse_date.c"
yy490:
YYDEBUG(490, *YYCURSOR);
yyaccept = 11;
@@ -9815,7 +9818,7 @@ yy490:
}
yy491:
YYDEBUG(491, *YYCURSOR);
#line 1181 "ext/date/lib/parse_date.re"
#line 1184 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("timeshort24 | timelong24 | iso8601long");
@@ -9840,7 +9843,7 @@ yy491:
TIMELIB_DEINIT;
return TIMELIB_TIME24_WITH_ZONE;
}
#line 9844 "ext/date/lib/parse_date.c"
#line 9847 "ext/date/lib/parse_date.c"
yy492:
YYDEBUG(492, *YYCURSOR);
yyaccept = 11;
@@ -10150,7 +10153,7 @@ yy523:
YYDEBUG(523, *YYCURSOR);
++YYCURSOR;
YYDEBUG(524, *YYCURSOR);
#line 1161 "ext/date/lib/parse_date.re"
#line 1164 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("mssqltime");
TIMELIB_INIT;
@@ -10169,7 +10172,7 @@ yy523:
TIMELIB_DEINIT;
return TIMELIB_TIME24_WITH_ZONE;
}
#line 10173 "ext/date/lib/parse_date.c"
#line 10176 "ext/date/lib/parse_date.c"
yy525:
YYDEBUG(525, *YYCURSOR);
yyaccept = 11;
@@ -10275,7 +10278,7 @@ yy534:
if (yych <= '9') goto yy541;
yy535:
YYDEBUG(535, *YYCURSOR);
#line 1343 "ext/date/lib/parse_date.re"
#line 1346 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("datefull");
@@ -10289,7 +10292,7 @@ yy535:
TIMELIB_DEINIT;
return TIMELIB_DATE_FULL;
}
#line 10293 "ext/date/lib/parse_date.c"
#line 10296 "ext/date/lib/parse_date.c"
yy536:
YYDEBUG(536, *YYCURSOR);
yych = *++YYCURSOR;
@@ -11026,7 +11029,7 @@ yy605:
YYDEBUG(606, *YYCURSOR);
++YYCURSOR;
YYDEBUG(607, *YYCURSOR);
#line 1358 "ext/date/lib/parse_date.re"
#line 1361 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("pointed date YYYY");
TIMELIB_INIT;
@@ -11037,7 +11040,7 @@ yy605:
TIMELIB_DEINIT;
return TIMELIB_DATE_FULL_POINTED;
}
#line 11041 "ext/date/lib/parse_date.c"
#line 11044 "ext/date/lib/parse_date.c"
yy608:
YYDEBUG(608, *YYCURSOR);
yyaccept = 11;
@@ -11073,7 +11076,7 @@ yy611:
if (yych <= '9') goto yy605;
yy612:
YYDEBUG(612, *YYCURSOR);
#line 1370 "ext/date/lib/parse_date.re"
#line 1373 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("pointed date YY");
@@ -11086,7 +11089,7 @@ yy612:
TIMELIB_DEINIT;
return TIMELIB_DATE_FULL_POINTED;
}
#line 11090 "ext/date/lib/parse_date.c"
#line 11093 "ext/date/lib/parse_date.c"
yy613:
YYDEBUG(613, *YYCURSOR);
yyaccept = 11;
@@ -11727,7 +11730,7 @@ yy656:
}
yy657:
YYDEBUG(657, *YYCURSOR);
#line 1329 "ext/date/lib/parse_date.re"
#line 1332 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("gnudateshort");
@@ -11740,7 +11743,7 @@ yy657:
TIMELIB_DEINIT;
return TIMELIB_ISO_DATE;
}
#line 11744 "ext/date/lib/parse_date.c"
#line 11747 "ext/date/lib/parse_date.c"
yy658:
YYDEBUG(658, *YYCURSOR);
yyaccept = 13;
@@ -11846,7 +11849,7 @@ yy666:
}
yy667:
YYDEBUG(667, *YYCURSOR);
#line 1273 "ext/date/lib/parse_date.re"
#line 1276 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("americanshort | american");
@@ -11861,7 +11864,7 @@ yy667:
TIMELIB_DEINIT;
return TIMELIB_AMERICAN;
}
#line 11865 "ext/date/lib/parse_date.c"
#line 11868 "ext/date/lib/parse_date.c"
yy668:
YYDEBUG(668, *YYCURSOR);
yyaccept = 14;
@@ -12094,7 +12097,7 @@ yy700:
if (yych <= ':') goto yy704;
yy701:
YYDEBUG(701, *YYCURSOR);
#line 1556 "ext/date/lib/parse_date.re"
#line 1559 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("clf");
@@ -12114,7 +12117,7 @@ yy701:
TIMELIB_DEINIT;
return TIMELIB_CLF;
}
#line 12118 "ext/date/lib/parse_date.c"
#line 12121 "ext/date/lib/parse_date.c"
yy702:
YYDEBUG(702, *YYCURSOR);
yych = *++YYCURSOR;
@@ -12666,7 +12669,7 @@ yy763:
}
yy764:
YYDEBUG(764, *YYCURSOR);
#line 1301 "ext/date/lib/parse_date.re"
#line 1304 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("iso8601date2");
@@ -12679,7 +12682,7 @@ yy764:
TIMELIB_DEINIT;
return TIMELIB_ISO_DATE;
}
#line 12683 "ext/date/lib/parse_date.c"
#line 12686 "ext/date/lib/parse_date.c"
yy765:
YYDEBUG(765, *YYCURSOR);
yych = *++YYCURSOR;
@@ -12718,7 +12721,7 @@ yy771:
YYDEBUG(771, *YYCURSOR);
++YYCURSOR;
YYDEBUG(772, *YYCURSOR);
#line 1542 "ext/date/lib/parse_date.re"
#line 1545 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("pgtextreverse");
@@ -12731,7 +12734,7 @@ yy771:
TIMELIB_DEINIT;
return TIMELIB_PG_TEXT;
}
#line 12735 "ext/date/lib/parse_date.c"
#line 12738 "ext/date/lib/parse_date.c"
yy773:
YYDEBUG(773, *YYCURSOR);
yych = *++YYCURSOR;
@@ -12869,7 +12872,7 @@ yy783:
}
yy784:
YYDEBUG(784, *YYCURSOR);
#line 1577 "ext/date/lib/parse_date.re"
#line 1580 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("year4");
TIMELIB_INIT;
@@ -12877,7 +12880,7 @@ yy784:
TIMELIB_DEINIT;
return TIMELIB_CLF;
}
#line 12881 "ext/date/lib/parse_date.c"
#line 12884 "ext/date/lib/parse_date.c"
yy785:
YYDEBUG(785, *YYCURSOR);
yych = *++YYCURSOR;
@@ -13028,7 +13031,7 @@ yy793:
}
yy794:
YYDEBUG(794, *YYCURSOR);
#line 1398 "ext/date/lib/parse_date.re"
#line 1401 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("datenodayrev");
@@ -13041,7 +13044,7 @@ yy794:
TIMELIB_DEINIT;
return TIMELIB_DATE_NO_DAY;
}
#line 13045 "ext/date/lib/parse_date.c"
#line 13048 "ext/date/lib/parse_date.c"
yy795:
YYDEBUG(795, *YYCURSOR);
yych = *++YYCURSOR;
@@ -13256,7 +13259,7 @@ yy814:
if (yych <= '7') goto yy817;
yy815:
YYDEBUG(815, *YYCURSOR);
#line 1509 "ext/date/lib/parse_date.re"
#line 1512 "ext/date/lib/parse_date.re"
{
timelib_sll w, d;
DEBUG_OUTPUT("isoweek");
@@ -13274,7 +13277,7 @@ yy815:
TIMELIB_DEINIT;
return TIMELIB_ISO_WEEK;
}
#line 13278 "ext/date/lib/parse_date.c"
#line 13281 "ext/date/lib/parse_date.c"
yy816:
YYDEBUG(816, *YYCURSOR);
yych = *++YYCURSOR;
@@ -13284,7 +13287,7 @@ yy817:
YYDEBUG(817, *YYCURSOR);
++YYCURSOR;
YYDEBUG(818, *YYCURSOR);
#line 1490 "ext/date/lib/parse_date.re"
#line 1493 "ext/date/lib/parse_date.re"
{
timelib_sll w, d;
DEBUG_OUTPUT("isoweekday");
@@ -13302,7 +13305,7 @@ yy817:
TIMELIB_DEINIT;
return TIMELIB_ISO_WEEK;
}
#line 13306 "ext/date/lib/parse_date.c"
#line 13309 "ext/date/lib/parse_date.c"
yy819:
YYDEBUG(819, *YYCURSOR);
yych = *++YYCURSOR;
@@ -13366,7 +13369,7 @@ yy821:
}
yy822:
YYDEBUG(822, *YYCURSOR);
#line 1476 "ext/date/lib/parse_date.re"
#line 1479 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("pgydotd");
@@ -13379,7 +13382,7 @@ yy822:
TIMELIB_DEINIT;
return TIMELIB_PG_YEARDAY;
}
#line 13383 "ext/date/lib/parse_date.c"
#line 13386 "ext/date/lib/parse_date.c"
yy823:
YYDEBUG(823, *YYCURSOR);
yych = *++YYCURSOR;
@@ -13482,7 +13485,7 @@ yy842:
++YYCURSOR;
yy843:
YYDEBUG(843, *YYCURSOR);
#line 1450 "ext/date/lib/parse_date.re"
#line 1453 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("xmlrpc | xmlrpcnocolon | soap | wddx | exif");
@@ -13507,7 +13510,7 @@ yy843:
TIMELIB_DEINIT;
return TIMELIB_XMLRPC_SOAP;
}
#line 13511 "ext/date/lib/parse_date.c"
#line 13514 "ext/date/lib/parse_date.c"
yy844:
YYDEBUG(844, *YYCURSOR);
yych = *++YYCURSOR;
@@ -13769,7 +13772,7 @@ yy848:
}
yy849:
YYDEBUG(849, *YYCURSOR);
#line 1438 "ext/date/lib/parse_date.re"
#line 1441 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("datenocolon");
TIMELIB_INIT;
@@ -13780,7 +13783,7 @@ yy849:
TIMELIB_DEINIT;
return TIMELIB_DATE_NOCOLON;
}
#line 13784 "ext/date/lib/parse_date.c"
#line 13787 "ext/date/lib/parse_date.c"
yy850:
YYDEBUG(850, *YYCURSOR);
yych = *++YYCURSOR;
@@ -14700,7 +14703,7 @@ yy973:
if (yych <= '9') goto yy996;
yy974:
YYDEBUG(974, *YYCURSOR);
#line 1315 "ext/date/lib/parse_date.re"
#line 1318 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("gnudateshorter");
@@ -14713,7 +14716,7 @@ yy974:
TIMELIB_DEINIT;
return TIMELIB_ISO_DATE;
}
#line 14717 "ext/date/lib/parse_date.c"
#line 14720 "ext/date/lib/parse_date.c"
yy975:
YYDEBUG(975, *YYCURSOR);
yyaccept = 22;
@@ -15722,7 +15725,7 @@ yy1066:
}
yy1068:
YYDEBUG(1068, *YYCURSOR);
#line 1207 "ext/date/lib/parse_date.re"
#line 1210 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("gnunocolon");
TIMELIB_INIT;
@@ -15744,7 +15747,7 @@ yy1068:
TIMELIB_DEINIT;
return TIMELIB_GNU_NOCOLON;
}
#line 15748 "ext/date/lib/parse_date.c"
#line 15751 "ext/date/lib/parse_date.c"
yy1069:
YYDEBUG(1069, *YYCURSOR);
yych = *++YYCURSOR;
@@ -15836,7 +15839,7 @@ yy1075:
}
yy1076:
YYDEBUG(1076, *YYCURSOR);
#line 1253 "ext/date/lib/parse_date.re"
#line 1256 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("iso8601nocolon");
@@ -15855,7 +15858,7 @@ yy1076:
TIMELIB_DEINIT;
return TIMELIB_ISO_NOCOLON;
}
#line 15859 "ext/date/lib/parse_date.c"
#line 15862 "ext/date/lib/parse_date.c"
yy1077:
YYDEBUG(1077, *YYCURSOR);
yyaccept = 25;
@@ -16753,7 +16756,7 @@ yy1117:
}
yy1118:
YYDEBUG(1118, *YYCURSOR);
#line 1649 "ext/date/lib/parse_date.re"
#line 1652 "ext/date/lib/parse_date.re"
{
timelib_sll i;
int behavior = 0;
@@ -16769,7 +16772,7 @@ yy1118:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 16773 "ext/date/lib/parse_date.c"
#line 16776 "ext/date/lib/parse_date.c"
yy1119:
YYDEBUG(1119, *YYCURSOR);
++YYCURSOR;
@@ -16820,7 +16823,7 @@ yy1126:
YYDEBUG(1126, *YYCURSOR);
++YYCURSOR;
YYDEBUG(1127, *YYCURSOR);
#line 1122 "ext/date/lib/parse_date.re"
#line 1125 "ext/date/lib/parse_date.re"
{
timelib_sll i;
int behavior = 0;
@@ -16841,7 +16844,7 @@ yy1126:
TIMELIB_DEINIT;
return TIMELIB_WEEK_DAY_OF_MONTH;
}
#line 16845 "ext/date/lib/parse_date.c"
#line 16848 "ext/date/lib/parse_date.c"
yy1128:
YYDEBUG(1128, *YYCURSOR);
yyaccept = 26;
@@ -16949,7 +16952,7 @@ yy1141:
}
yy1142:
YYDEBUG(1142, *YYCURSOR);
#line 1625 "ext/date/lib/parse_date.re"
#line 1628 "ext/date/lib/parse_date.re"
{
timelib_sll i;
int behavior = 0;
@@ -16972,7 +16975,7 @@ yy1142:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 16976 "ext/date/lib/parse_date.c"
#line 16979 "ext/date/lib/parse_date.c"
yy1143:
YYDEBUG(1143, *YYCURSOR);
yych = *++YYCURSOR;
@@ -19649,7 +19652,7 @@ yy1294:
goto yy1298;
yy1295:
YYDEBUG(1295, *YYCURSOR);
#line 1099 "ext/date/lib/parse_date.re"
#line 1102 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("backof | frontof");
TIMELIB_INIT;
@@ -19671,7 +19674,7 @@ yy1295:
TIMELIB_DEINIT;
return TIMELIB_LF_DAY_OF_MONTH;
}
#line 19675 "ext/date/lib/parse_date.c"
#line 19678 "ext/date/lib/parse_date.c"
yy1296:
YYDEBUG(1296, *YYCURSOR);
yyaccept = 28;
@@ -21362,7 +21365,7 @@ yy1385:
if (yych <= '9') goto yy1385;
yy1387:
YYDEBUG(1387, *YYCURSOR);
#line 1057 "ext/date/lib/parse_date.re"
#line 1060 "ext/date/lib/parse_date.re"
{
timelib_ull i;
@@ -21386,7 +21389,7 @@ yy1387:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 21390 "ext/date/lib/parse_date.c"
#line 21393 "ext/date/lib/parse_date.c"
yy1388:
YYDEBUG(1388, *YYCURSOR);
yych = *++YYCURSOR;
@@ -21822,7 +21825,7 @@ yy1416:
++YYCURSOR;
yy1417:
YYDEBUG(1417, *YYCURSOR);
#line 1045 "ext/date/lib/parse_date.re"
#line 1048 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("tomorrow");
TIMELIB_INIT;
@@ -21833,7 +21836,7 @@ yy1417:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 21837 "ext/date/lib/parse_date.c"
#line 21840 "ext/date/lib/parse_date.c"
yy1418:
YYDEBUG(1418, *YYCURSOR);
yych = *++YYCURSOR;
@@ -21868,7 +21871,7 @@ yy1419:
}
yy1420:
YYDEBUG(1420, *YYCURSOR);
#line 1035 "ext/date/lib/parse_date.re"
#line 1038 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("midnight | today");
TIMELIB_INIT;
@@ -21877,7 +21880,7 @@ yy1420:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 21881 "ext/date/lib/parse_date.c"
#line 21884 "ext/date/lib/parse_date.c"
yy1421:
YYDEBUG(1421, *YYCURSOR);
yych = *++YYCURSOR;
@@ -23889,7 +23892,7 @@ yy1499:
}
yy1500:
YYDEBUG(1500, *YYCURSOR);
#line 1014 "ext/date/lib/parse_date.re"
#line 1017 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("now");
TIMELIB_INIT;
@@ -23897,7 +23900,7 @@ yy1500:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 23901 "ext/date/lib/parse_date.c"
#line 23904 "ext/date/lib/parse_date.c"
yy1501:
YYDEBUG(1501, *YYCURSOR);
yych = *++YYCURSOR;
@@ -24036,7 +24039,7 @@ yy1507:
}
yy1508:
YYDEBUG(1508, *YYCURSOR);
#line 1023 "ext/date/lib/parse_date.re"
#line 1026 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("noon");
TIMELIB_INIT;
@@ -24047,7 +24050,7 @@ yy1508:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 24051 "ext/date/lib/parse_date.c"
#line 24054 "ext/date/lib/parse_date.c"
yy1509:
YYDEBUG(1509, *YYCURSOR);
yyaccept = 0;
@@ -24580,7 +24583,7 @@ yy1530:
++YYCURSOR;
yy1531:
YYDEBUG(1531, *YYCURSOR);
#line 1002 "ext/date/lib/parse_date.re"
#line 1005 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("yesterday");
TIMELIB_INIT;
@@ -24591,7 +24594,7 @@ yy1531:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 24595 "ext/date/lib/parse_date.c"
#line 24598 "ext/date/lib/parse_date.c"
yy1532:
YYDEBUG(1532, *YYCURSOR);
yyaccept = 0;
@@ -24764,7 +24767,7 @@ yy1537:
goto yy1531;
}
}
#line 1775 "ext/date/lib/parse_date.re"
#line 1778 "ext/date/lib/parse_date.re"
}
@@ -25121,7 +25124,11 @@ timelib_time *timelib_parse_from_format(char *format, char *string, int len, tim
break;
case '\\': /* escaped char */
*fptr++;
if(!fptr[1]) {
add_pbf_error(s, "Escaped character expected", string, begin);
break;
}
fptr++;
if (*ptr == *fptr) {
++ptr;
} else {
+9 -2
View File
@@ -401,9 +401,12 @@ static timelib_sll timelib_meridian_with_check(char **ptr, timelib_sll h)
{
timelib_sll retval = 0;
while (!strchr("AaPp", **ptr)) {
while (**ptr && !strchr("AaPp", **ptr)) {
++*ptr;
}
if(!**ptr) {
return TIMELIB_UNSET;
}
if (**ptr == 'a' || **ptr == 'A') {
if (h == 12) {
retval = -12;
@@ -2128,7 +2131,11 @@ timelib_time *timelib_parse_from_format(char *format, char *string, int len, tim
break;
case '\\': /* escaped char */
*fptr++;
if(!fptr[1]) {
add_pbf_error(s, "Escaped character expected", string, begin);
break;
}
fptr++;
if (*ptr == *fptr) {
++ptr;
} else {
+2 -2
View File
@@ -1,4 +1,4 @@
/* Generated by re2c 0.13.5 on Mon Dec 5 22:02:31 2011 */
/* Generated by re2c 0.13.5 on Fri Jul 18 16:11:41 2014 */
#line 1 "ext/date/lib/parse_iso_intervals.re"
/*
+----------------------------------------------------------------------+
@@ -415,7 +415,7 @@ yy6:
break;
}
ptr++;
} while (*ptr);
} while (!s->errors->error_count && *ptr);
s->have_period = 1;
TIMELIB_DEINIT;
return TIMELIB_PERIOD;
+1 -1
View File
@@ -383,7 +383,7 @@ isoweek = year4 "-"? "W" weekofyear;
break;
}
ptr++;
} while (*ptr);
} while (!s->errors->error_count && *ptr);
s->have_period = 1;
TIMELIB_DEINIT;
return TIMELIB_PERIOD;
+952 -780
View File
File diff suppressed because it is too large. Load diff
+305 -29
View File
@@ -39,6 +39,20 @@ static __inline __int64_t php_date_llabs( __int64_t i ) { return i >= 0 ? i : -i
static inline long long php_date_llabs( long long i ) { return i >= 0 ? i : -i; }
#endif
#ifdef PHP_WIN32
#define DATE_I64_BUF_LEN 65
# define DATE_I64A(i, s, len) _i64toa_s(i, s, len, 10)
# define DATE_A64I(i, s) i = _atoi64(s)
#else
#define DATE_I64_BUF_LEN 65
# define DATE_I64A(i, s, len) \
do { \
int st = snprintf(s, len, "%lld", i); \
s[st] = '\0'; \
} while (0);
# define DATE_A64I(i, s) i = atoll(s)
#endif
/* {{{ arginfo */
ZEND_BEGIN_ARG_INFO_EX(arginfo_date, 0, 0, 1)
ZEND_ARG_INFO(0, format)
@@ -472,6 +486,8 @@ const zend_function_entry date_funcs_interval[] = {
const zend_function_entry date_funcs_period[] = {
PHP_ME(DatePeriod, __construct, arginfo_date_period_construct, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC)
PHP_ME(DatePeriod, __wakeup, NULL, ZEND_ACC_PUBLIC)
PHP_ME(DatePeriod, __set_state, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
PHP_FE_END
};
@@ -565,9 +581,12 @@ static zend_object_value date_object_clone_period(zval *this_ptr TSRMLS_DC);
static int date_object_compare_date(zval *d1, zval *d2 TSRMLS_DC);
static HashTable *date_object_get_properties(zval *object TSRMLS_DC);
static HashTable *date_object_get_properties_interval(zval *object TSRMLS_DC);
static HashTable *date_object_get_properties_period(zval *object TSRMLS_DC);
zval *date_interval_read_property(zval *object, zval *member, int type TSRMLS_DC);
void date_interval_write_property(zval *object, zval *member, zval *value TSRMLS_DC);
static zval *date_period_read_property(zval *object, zval *member, int type TSRMLS_DC);
static void date_period_write_property(zval *object, zval *member, zval *value TSRMLS_DC);
/* {{{ Module struct */
zend_module_entry date_module_entry = {
@@ -2015,6 +2034,10 @@ static void date_register_classes(TSRMLS_D)
zend_class_implements(date_ce_period TSRMLS_CC, 1, zend_ce_traversable);
memcpy(&date_object_handlers_period, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
date_object_handlers_period.clone_obj = date_object_clone_period;
date_object_handlers_period.get_properties = date_object_get_properties_period;
date_object_handlers_period.get_property_ptr_ptr = NULL;
date_object_handlers_period.read_property = date_period_read_property;
date_object_handlers_period.write_property = date_period_write_property;
#define REGISTER_PERIOD_CLASS_CONST_STRING(const_name, value) \
zend_declare_class_constant_long(date_ce_period, const_name, sizeof(const_name)-1, value TSRMLS_CC);
@@ -2079,7 +2102,11 @@ static int date_object_compare_date(zval *d1, zval *d2 TSRMLS_DC)
instanceof_function(Z_OBJCE_P(d2), date_ce_date TSRMLS_CC)) {
php_date_obj *o1 = zend_object_store_get_object(d1 TSRMLS_CC);
php_date_obj *o2 = zend_object_store_get_object(d2 TSRMLS_CC);
if (!o1->time || !o2->time) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Trying to compare an incomplete DateTime object");
return 1;
}
if (!o1->time->sse_uptodate) {
timelib_update_ts(o1->time, o1->time->tz_info);
}
@@ -2246,7 +2273,6 @@ static HashTable *date_object_get_properties_interval(zval *object TSRMLS_DC)
zval *zv;
php_interval_obj *intervalobj;
intervalobj = (php_interval_obj *) zend_object_store_get_object(object TSRMLS_CC);
props = zend_std_get_properties(object TSRMLS_CC);
@@ -2257,7 +2283,7 @@ static HashTable *date_object_get_properties_interval(zval *object TSRMLS_DC)
#define PHP_DATE_INTERVAL_ADD_PROPERTY(n,f) \
MAKE_STD_ZVAL(zv); \
ZVAL_LONG(zv, intervalobj->diff->f); \
ZVAL_LONG(zv, (long)intervalobj->diff->f); \
zend_hash_update(props, n, strlen(n) + 1, &zv, sizeof(zval), NULL);
PHP_DATE_INTERVAL_ADD_PROPERTY("y", y);
@@ -2266,6 +2292,9 @@ static HashTable *date_object_get_properties_interval(zval *object TSRMLS_DC)
PHP_DATE_INTERVAL_ADD_PROPERTY("h", h);
PHP_DATE_INTERVAL_ADD_PROPERTY("i", i);
PHP_DATE_INTERVAL_ADD_PROPERTY("s", s);
PHP_DATE_INTERVAL_ADD_PROPERTY("weekday", weekday);
PHP_DATE_INTERVAL_ADD_PROPERTY("weekday_behavior", weekday_behavior);
PHP_DATE_INTERVAL_ADD_PROPERTY("first_last_day_of", first_last_day_of);
PHP_DATE_INTERVAL_ADD_PROPERTY("invert", invert);
if (intervalobj->diff->days != -99999) {
PHP_DATE_INTERVAL_ADD_PROPERTY("days", days);
@@ -2274,6 +2303,10 @@ static HashTable *date_object_get_properties_interval(zval *object TSRMLS_DC)
ZVAL_FALSE(zv);
zend_hash_update(props, "days", 5, &zv, sizeof(zval), NULL);
}
PHP_DATE_INTERVAL_ADD_PROPERTY("special_type", special.type);
PHP_DATE_INTERVAL_ADD_PROPERTY("special_amount", special.amount);
PHP_DATE_INTERVAL_ADD_PROPERTY("have_weekday_relative", have_weekday_relative);
PHP_DATE_INTERVAL_ADD_PROPERTY("have_special_relative", have_special_relative);
return props;
}
@@ -2376,6 +2409,7 @@ PHPAPI zval *php_date_instantiate(zend_class_entry *pce, zval *object TSRMLS_DC)
object_init_ex(object, pce);
Z_SET_REFCOUNT_P(object, 1);
Z_UNSET_ISREF_P(object);
return object;
}
@@ -2550,13 +2584,15 @@ static int php_date_initialize_from_hash(zval **return_value, php_date_obj **dat
case TIMELIB_ZONETYPE_OFFSET:
case TIMELIB_ZONETYPE_ABBR: {
char *tmp = emalloc(Z_STRLEN_PP(z_date) + Z_STRLEN_PP(z_timezone) + 2);
int ret;
snprintf(tmp, Z_STRLEN_PP(z_date) + Z_STRLEN_PP(z_timezone) + 2, "%s %s", Z_STRVAL_PP(z_date), Z_STRVAL_PP(z_timezone));
php_date_initialize(*dateobj, tmp, Z_STRLEN_PP(z_date) + Z_STRLEN_PP(z_timezone) + 1, NULL, NULL, 0 TSRMLS_CC);
ret = php_date_initialize(*dateobj, tmp, Z_STRLEN_PP(z_date) + Z_STRLEN_PP(z_timezone) + 1, NULL, NULL, 0 TSRMLS_CC);
efree(tmp);
return 1;
return 1 == ret;
}
case TIMELIB_ZONETYPE_ID:
case TIMELIB_ZONETYPE_ID: {
int ret;
convert_to_string(*z_timezone);
tzi = php_date_parse_tzfile(Z_STRVAL_PP(z_timezone), DATE_TIMEZONEDB TSRMLS_CC);
@@ -2567,9 +2603,10 @@ static int php_date_initialize_from_hash(zval **return_value, php_date_obj **dat
tzobj->tzi.tz = tzi;
tzobj->initialized = 1;
php_date_initialize(*dateobj, Z_STRVAL_PP(z_date), Z_STRLEN_PP(z_date), NULL, tmp_obj, 0 TSRMLS_CC);
ret = php_date_initialize(*dateobj, Z_STRVAL_PP(z_date), Z_STRLEN_PP(z_date), NULL, tmp_obj, 0 TSRMLS_CC);
zval_ptr_dtor(&tmp_obj);
return 1;
return 1 == ret;
}
}
}
}
@@ -2593,7 +2630,9 @@ PHP_METHOD(DateTime, __set_state)
php_date_instantiate(date_ce_date, return_value TSRMLS_CC);
dateobj = (php_date_obj *) zend_object_store_get_object(return_value TSRMLS_CC);
php_date_initialize_from_hash(&return_value, &dateobj, myht TSRMLS_CC);
if (!php_date_initialize_from_hash(&return_value, &dateobj, myht TSRMLS_CC)) {
php_error(E_ERROR, "Invalid serialization data for DateTime object");
}
}
/* }}} */
@@ -2609,7 +2648,9 @@ PHP_METHOD(DateTime, __wakeup)
myht = Z_OBJPROP_P(object);
php_date_initialize_from_hash(&return_value, &dateobj, myht TSRMLS_CC);
if (!php_date_initialize_from_hash(&return_value, &dateobj, myht TSRMLS_CC)) {
php_error(E_ERROR, "Invalid serialization data for DateTime object");
}
}
/* }}} */
@@ -3638,30 +3679,48 @@ 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);
#define PHP_DATE_INTERVAL_READ_PROPERTY(element, member, itype, def) \
do { \
zval **z_arg = NULL; \
if (zend_hash_find(myht, element, strlen(element) + 1, (void**) &z_arg) == SUCCESS) { \
convert_to_long(*z_arg); \
(*intobj)->diff->member = (itype)Z_LVAL_PP(z_arg); \
} else { \
(*intobj)->diff->member = (itype)def; \
} \
} while (0);
#define PHP_DATE_INTERVAL_READ_PROPERTY_I64(element, member) \
do { \
zval **z_arg = NULL; \
if (zend_hash_find(myht, element, strlen(element) + 1, (void**) &z_arg) == SUCCESS) { \
convert_to_string(*z_arg); \
DATE_A64I((*intobj)->diff->member, Z_STRVAL_PP(z_arg)); \
} else { \
(*intobj)->diff->member = -1LL; \
} \
} while (0);
PHP_DATE_INTERVAL_READ_PROPERTY("y", y, timelib_sll, -1)
PHP_DATE_INTERVAL_READ_PROPERTY("m", m, timelib_sll, -1)
PHP_DATE_INTERVAL_READ_PROPERTY("d", d, timelib_sll, -1)
PHP_DATE_INTERVAL_READ_PROPERTY("h", h, timelib_sll, -1)
PHP_DATE_INTERVAL_READ_PROPERTY("i", i, timelib_sll, -1)
PHP_DATE_INTERVAL_READ_PROPERTY("s", s, timelib_sll, -1)
PHP_DATE_INTERVAL_READ_PROPERTY("weekday", weekday, int, -1)
PHP_DATE_INTERVAL_READ_PROPERTY("weekday_behavior", weekday_behavior, int, -1)
PHP_DATE_INTERVAL_READ_PROPERTY("first_last_day_of", first_last_day_of, int, -1)
PHP_DATE_INTERVAL_READ_PROPERTY("invert", invert, int, 0);
PHP_DATE_INTERVAL_READ_PROPERTY_I64("days", days);
PHP_DATE_INTERVAL_READ_PROPERTY("special_type", special.type, unsigned int, 0);
PHP_DATE_INTERVAL_READ_PROPERTY_I64("special_amount", special.amount);
PHP_DATE_INTERVAL_READ_PROPERTY("have_weekday_relative", have_weekday_relative, unsigned int, 0);
PHP_DATE_INTERVAL_READ_PROPERTY("have_special_relative", have_special_relative, unsigned int, 0);
(*intobj)->initialized = 1;
return 0;
@@ -4265,6 +4324,223 @@ PHP_FUNCTION(date_sun_info)
timelib_time_dtor(t2);
}
/* }}} */
static HashTable *date_object_get_properties_period(zval *object TSRMLS_DC)
{
HashTable *props;
zval *zv;
php_period_obj *period_obj;
period_obj = zend_object_store_get_object(object TSRMLS_CC);
props = zend_std_get_properties(object TSRMLS_CC);
if (!period_obj->start) {
return props;
}
MAKE_STD_ZVAL(zv);
if (period_obj->start) {
php_date_obj *date_obj;
object_init_ex(zv, date_ce_date);
date_obj = zend_object_store_get_object(zv TSRMLS_CC);
date_obj->time = timelib_time_clone(period_obj->start);
} else {
ZVAL_NULL(zv);
}
zend_hash_update(props, "start", sizeof("start"), &zv, sizeof(zv), NULL);
MAKE_STD_ZVAL(zv);
if (period_obj->current) {
php_date_obj *date_obj;
object_init_ex(zv, date_ce_date);
date_obj = zend_object_store_get_object(zv TSRMLS_CC);
date_obj->time = timelib_time_clone(period_obj->current);
} else {
ZVAL_NULL(zv);
}
zend_hash_update(props, "current", sizeof("current"), &zv, sizeof(zv), NULL);
MAKE_STD_ZVAL(zv);
if (period_obj->end) {
php_date_obj *date_obj;
object_init_ex(zv, date_ce_date);
date_obj = zend_object_store_get_object(zv TSRMLS_CC);
date_obj->time = timelib_time_clone(period_obj->end);
} else {
ZVAL_NULL(zv);
}
zend_hash_update(props, "end", sizeof("end"), &zv, sizeof(zv), NULL);
MAKE_STD_ZVAL(zv);
if (period_obj->interval) {
php_interval_obj *interval_obj;
object_init_ex(zv, date_ce_interval);
interval_obj = zend_object_store_get_object(zv TSRMLS_CC);
interval_obj->diff = timelib_rel_time_clone(period_obj->interval);
interval_obj->initialized = 1;
} else {
ZVAL_NULL(zv);
}
zend_hash_update(props, "interval", sizeof("interval"), &zv, sizeof(zv), NULL);
/* converted to larger type (int->long); must check when unserializing */
MAKE_STD_ZVAL(zv);
ZVAL_LONG(zv, (long) period_obj->recurrences);
zend_hash_update(props, "recurrences", sizeof("recurrences"), &zv, sizeof(zv), NULL);
MAKE_STD_ZVAL(zv);
ZVAL_BOOL(zv, period_obj->include_start_date);
zend_hash_update(props, "include_start_date", sizeof("include_start_date"), &zv, sizeof(zv), NULL);
return props;
}
static int php_date_period_initialize_from_hash(php_period_obj *period_obj, HashTable *myht TSRMLS_DC)
{
zval **ht_entry;
/* this function does no rollback on error */
if (zend_hash_find(myht, "start", sizeof("start"), (void**) &ht_entry) == SUCCESS) {
if (Z_TYPE_PP(ht_entry) == IS_OBJECT && Z_OBJCE_PP(ht_entry) == date_ce_date) {
php_date_obj *date_obj;
date_obj = zend_object_store_get_object(*ht_entry TSRMLS_CC);
period_obj->start = timelib_time_clone(date_obj->time);
} else if (Z_TYPE_PP(ht_entry) != IS_NULL) {
return 0;
}
} else {
return 0;
}
if (zend_hash_find(myht, "end", sizeof("end"), (void**) &ht_entry) == SUCCESS) {
if (Z_TYPE_PP(ht_entry) == IS_OBJECT && Z_OBJCE_PP(ht_entry) == date_ce_date) {
php_date_obj *date_obj;
date_obj = zend_object_store_get_object(*ht_entry TSRMLS_CC);
period_obj->end = timelib_time_clone(date_obj->time);
} else if (Z_TYPE_PP(ht_entry) != IS_NULL) {
return 0;
}
} else {
return 0;
}
if (zend_hash_find(myht, "current", sizeof("current"), (void**) &ht_entry) == SUCCESS) {
if (Z_TYPE_PP(ht_entry) == IS_OBJECT && Z_OBJCE_PP(ht_entry) == date_ce_date) {
php_date_obj *date_obj;
date_obj = zend_object_store_get_object(*ht_entry TSRMLS_CC);
period_obj->current = timelib_time_clone(date_obj->time);
} else if (Z_TYPE_PP(ht_entry) != IS_NULL) {
return 0;
}
} else {
return 0;
}
if (zend_hash_find(myht, "interval", sizeof("interval"), (void**) &ht_entry) == SUCCESS) {
if (Z_TYPE_PP(ht_entry) == IS_OBJECT && Z_OBJCE_PP(ht_entry) == date_ce_interval) {
php_interval_obj *interval_obj;
interval_obj = zend_object_store_get_object(*ht_entry TSRMLS_CC);
period_obj->interval = timelib_rel_time_clone(interval_obj->diff);
} else { /* interval is required */
return 0;
}
} else {
return 0;
}
if (zend_hash_find(myht, "recurrences", sizeof("recurrences"), (void**) &ht_entry) == SUCCESS &&
Z_TYPE_PP(ht_entry) == IS_LONG && Z_LVAL_PP(ht_entry) >= 0 && Z_LVAL_PP(ht_entry) <= INT_MAX) {
period_obj->recurrences = Z_LVAL_PP(ht_entry);
} else {
return 0;
}
if (zend_hash_find(myht, "include_start_date", sizeof("include_start_date"), (void**) &ht_entry) == SUCCESS &&
Z_TYPE_PP(ht_entry) == IS_BOOL) {
period_obj->include_start_date = Z_BVAL_PP(ht_entry);
} else {
return 0;
}
period_obj->initialized = 1;
return 1;
}
/* {{{ proto DatePeriod::__set_state()
*/
PHP_METHOD(DatePeriod, __set_state)
{
php_period_obj *period_obj;
zval *array;
HashTable *myht;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &array) == FAILURE) {
RETURN_FALSE;
}
myht = Z_ARRVAL_P(array);
object_init_ex(return_value, date_ce_period);
period_obj = zend_object_store_get_object(return_value TSRMLS_CC);
if (!php_date_period_initialize_from_hash(period_obj, myht TSRMLS_CC)) {
php_error(E_ERROR, "Invalid serialization data for DatePeriod object");
}
}
/* }}} */
/* {{{ proto DatePeriod::__wakeup()
*/
PHP_METHOD(DatePeriod, __wakeup)
{
zval *object = getThis();
php_period_obj *period_obj;
HashTable *myht;
period_obj = zend_object_store_get_object(object TSRMLS_CC);
myht = Z_OBJPROP_P(object);
if (!php_date_period_initialize_from_hash(period_obj, myht TSRMLS_CC)) {
php_error(E_ERROR, "Invalid serialization data for DatePeriod object");
}
}
/* }}} */
/* {{{ date_period_read_property */
static zval *date_period_read_property(zval *object, zval *member, int type TSRMLS_DC)
{
zval *zv;
if (type != BP_VAR_IS && type != BP_VAR_R) {
php_error_docref(NULL TSRMLS_CC, E_ERROR, "Retrieval of DatePeriod properties for modification is unsupported");
}
Z_OBJPROP_P(object); /* build properties hash table */
zv = std_object_handlers.read_property(object, member, type TSRMLS_CC);
if (Z_TYPE_P(zv) == IS_OBJECT && Z_OBJ_HANDLER_P(zv, clone_obj)) {
/* defensive copy */
zend_object_value zov = Z_OBJ_HANDLER_P(zv, clone_obj)(zv TSRMLS_CC);
MAKE_STD_ZVAL(zv);
Z_TYPE_P(zv) = IS_OBJECT;
Z_OBJVAL_P(zv) = zov;
}
return zv;
}
/* }}} */
/* {{{ date_period_write_property */
static void date_period_write_property(zval *object, zval *member, zval *value TSRMLS_DC)
{
php_error_docref(NULL TSRMLS_CC, E_ERROR, "Writing to DatePeriod properties is unsupported");
}
/* }}} */
/*
* Local variables:
* tab-width: 4
+2
View File
@@ -88,6 +88,8 @@ PHP_FUNCTION(date_interval_format);
PHP_FUNCTION(date_interval_create_from_date_string);
PHP_METHOD(DatePeriod, __construct);
PHP_METHOD(DatePeriod, __wakeup);
PHP_METHOD(DatePeriod, __set_state);
/* Options and Configuration */
PHP_FUNCTION(date_default_timezone_set);
+16 -2
View File
@@ -11,8 +11,8 @@ $other = new DateTime("31-July-2008");
$diff = date_diff($date, $other);
var_dump($diff);
--EXPECT--
object(DateInterval)#3 (8) {
--EXPECTF--
object(DateInterval)#%d (15) {
["y"]=>
int(0)
["m"]=>
@@ -25,8 +25,22 @@ object(DateInterval)#3 (8) {
int(0)
["s"]=>
int(0)
["weekday"]=>
int(0)
["weekday_behavior"]=>
int(0)
["first_last_day_of"]=>
int(0)
["invert"]=>
int(0)
["days"]=>
int(3)
["special_type"]=>
int(0)
["special_amount"]=>
int(0)
["have_weekday_relative"]=>
int(0)
["have_special_relative"]=>
int(0)
}
+16 -2
View File
@@ -15,8 +15,15 @@ DateInterval Object
[h] => 12
[i] => 30
[s] => 5
[weekday] => 0
[weekday_behavior] => 0
[first_last_day_of] => 0
[invert] => 0
[days] =>%s
[days] =>
[special_type] => 0
[special_amount] => 0
[have_weekday_relative] => 0
[have_special_relative] => 0
)
DateInterval Object
(
@@ -26,6 +33,13 @@ DateInterval Object
[h] => 12
[i] => 30
[s] => 5
[weekday] => 0
[weekday_behavior] => 0
[first_last_day_of] => 0
[invert] => 0
[days] =>%s
[days] => 0
[special_type] => 0
[special_amount] => 0
[have_weekday_relative] => 0
[have_special_relative] => 0
)
+7
View File
@@ -17,6 +17,13 @@ DateInterval Object
[h] => 4
[i] => 0
[s] => 0
[weekday] => 0
[weekday_behavior] => 0
[first_last_day_of] => 0
[invert] => 0
[days] => 30
[special_type] => 0
[special_amount] => 0
[have_weekday_relative] => 0
[have_special_relative] => 0
)
+15 -1
View File
@@ -8,7 +8,7 @@ echo $i->format("%d"), "\n";
echo $i->format("%a"), "\n";
?>
--EXPECT--
object(DateInterval)#1 (8) {
object(DateInterval)#1 (15) {
["y"]=>
int(0)
["m"]=>
@@ -21,10 +21,24 @@ object(DateInterval)#1 (8) {
int(0)
["s"]=>
int(0)
["weekday"]=>
int(0)
["weekday_behavior"]=>
int(0)
["first_last_day_of"]=>
int(0)
["invert"]=>
int(0)
["days"]=>
bool(false)
["special_type"]=>
int(0)
["special_amount"]=>
int(0)
["have_weekday_relative"]=>
int(0)
["have_special_relative"]=>
int(0)
}
7
(unknown)
+155 -6
View File
@@ -32,7 +32,7 @@ var_dump($unser, $p);
?>
--EXPECT--
object(DateInterval)#3 (8) {
object(DateInterval)#3 (15) {
["y"]=>
int(0)
["m"]=>
@@ -45,12 +45,26 @@ object(DateInterval)#3 (8) {
int(0)
["s"]=>
int(0)
["weekday"]=>
int(0)
["weekday_behavior"]=>
int(0)
["first_last_day_of"]=>
int(0)
["invert"]=>
int(0)
["days"]=>
int(0)
["special_type"]=>
int(0)
["special_amount"]=>
int(0)
["have_weekday_relative"]=>
int(0)
["have_special_relative"]=>
int(0)
}
string(128) "O:12:"DateInterval":8:{s:1:"y";i:0;s:1:"m";i:0;s:1:"d";i:0;s:1:"h";i:4;s:1:"i";i:0;s:1:"s";i:0;s:6:"invert";i:0;s:4:"days";i:0;}"
string(320) "O:12:"DateInterval":15:{s:1:"y";i:0;s:1:"m";i:0;s:1:"d";i:0;s:1:"h";i:4;s:1:"i";i:0;s:1:"s";i:0;s:7:"weekday";i:0;s:16:"weekday_behavior";i:0;s:17:"first_last_day_of";i:0;s:6:"invert";i:0;s:4:"days";i:0;s:12:"special_type";i:0;s:14:"special_amount";i:0;s:21:"have_weekday_relative";i:0;s:21:"have_special_relative";i:0;}"
DateInterval::__set_state(array(
'y' => 0,
'm' => 0,
@@ -58,9 +72,16 @@ DateInterval::__set_state(array(
'h' => 4,
'i' => 0,
's' => 0,
'weekday' => 0,
'weekday_behavior' => 0,
'first_last_day_of' => 0,
'invert' => 0,
'days' => 0,
))object(DateInterval)#5 (8) {
'special_type' => 0,
'special_amount' => 0,
'have_weekday_relative' => 0,
'have_special_relative' => 0,
))object(DateInterval)#5 (15) {
["y"]=>
int(0)
["m"]=>
@@ -73,14 +94,78 @@ DateInterval::__set_state(array(
int(0)
["s"]=>
int(0)
["weekday"]=>
int(0)
["weekday_behavior"]=>
int(0)
["first_last_day_of"]=>
int(0)
["invert"]=>
int(0)
["days"]=>
int(0)
["special_type"]=>
int(0)
["special_amount"]=>
int(0)
["have_weekday_relative"]=>
int(0)
["have_special_relative"]=>
int(0)
}
object(DatePeriod)#6 (0) {
object(DatePeriod)#6 (6) {
["start"]=>
object(DateTime)#4 (3) {
["date"]=>
string(19) "2003-01-02 08:00:00"
["timezone_type"]=>
int(3)
["timezone"]=>
string(3) "UTC"
}
["current"]=>
NULL
["end"]=>
NULL
["interval"]=>
object(DateInterval)#7 (15) {
["y"]=>
int(0)
["m"]=>
int(0)
["d"]=>
int(0)
["h"]=>
int(4)
["i"]=>
int(0)
["s"]=>
int(0)
["weekday"]=>
int(0)
["weekday_behavior"]=>
int(0)
["first_last_day_of"]=>
int(0)
["invert"]=>
int(0)
["days"]=>
int(0)
["special_type"]=>
int(0)
["special_amount"]=>
int(0)
["have_weekday_relative"]=>
int(0)
["have_special_relative"]=>
int(0)
}
["recurrences"]=>
int(3)
["include_start_date"]=>
bool(true)
}
object(DateInterval)#4 (8) {
object(DateInterval)#8 (15) {
["y"]=>
int(7)
["m"]=>
@@ -93,10 +178,74 @@ object(DateInterval)#4 (8) {
int(3)
["s"]=>
int(2)
["weekday"]=>
int(-1)
["weekday_behavior"]=>
int(-1)
["first_last_day_of"]=>
int(-1)
["invert"]=>
int(1)
["days"]=>
int(2400)
["special_type"]=>
int(0)
["special_amount"]=>
int(-1)
["have_weekday_relative"]=>
int(0)
["have_special_relative"]=>
int(0)
}
object(DatePeriod)#7 (0) {
object(DatePeriod)#9 (6) {
["start"]=>
object(DateTime)#6 (3) {
["date"]=>
string(19) "2003-01-02 08:00:00"
["timezone_type"]=>
int(3)
["timezone"]=>
string(3) "UTC"
}
["current"]=>
NULL
["end"]=>
NULL
["interval"]=>
object(DateInterval)#7 (15) {
["y"]=>
int(0)
["m"]=>
int(0)
["d"]=>
int(0)
["h"]=>
int(4)
["i"]=>
int(0)
["s"]=>
int(0)
["weekday"]=>
int(0)
["weekday_behavior"]=>
int(0)
["first_last_day_of"]=>
int(0)
["invert"]=>
int(0)
["days"]=>
int(0)
["special_type"]=>
int(0)
["special_amount"]=>
int(0)
["have_weekday_relative"]=>
int(0)
["have_special_relative"]=>
int(0)
}
["recurrences"]=>
int(3)
["include_start_date"]=>
bool(true)
}
+7
View File
@@ -27,6 +27,13 @@ di Object
[h] => 0
[i] => 0
[s] => 0
[weekday] => 0
[weekday_behavior] => 0
[first_last_day_of] => 0
[invert] => 0
[days] =>
[special_type] => 0
[special_amount] => 0
[have_weekday_relative] => 0
[have_special_relative] => 0
)
+45 -3
View File
@@ -25,7 +25,7 @@ foreach($intervals as $iv) {
echo "==DONE==\n";
?>
--EXPECTF--
object(DateInterval)#%d (8) {
object(DateInterval)#%d (15) {
["y"]=>
int(1)
["m"]=>
@@ -38,12 +38,26 @@ object(DateInterval)#%d (8) {
int(30)
["s"]=>
int(0)
["weekday"]=>
int(0)
["weekday_behavior"]=>
int(0)
["first_last_day_of"]=>
int(0)
["invert"]=>
int(1)
["days"]=>
int(437)
["special_type"]=>
int(0)
["special_amount"]=>
int(0)
["have_weekday_relative"]=>
int(0)
["have_special_relative"]=>
int(0)
}
object(DateInterval)#%d (8) {
object(DateInterval)#%d (15) {
["y"]=>
int(0)
["m"]=>
@@ -56,12 +70,26 @@ object(DateInterval)#%d (8) {
int(30)
["s"]=>
int(0)
["weekday"]=>
int(0)
["weekday_behavior"]=>
int(0)
["first_last_day_of"]=>
int(0)
["invert"]=>
int(0)
["days"]=>
int(294)
["special_type"]=>
int(0)
["special_amount"]=>
int(0)
["have_weekday_relative"]=>
int(0)
["have_special_relative"]=>
int(0)
}
object(DateInterval)#%d (8) {
object(DateInterval)#%d (15) {
["y"]=>
int(0)
["m"]=>
@@ -74,10 +102,24 @@ object(DateInterval)#%d (8) {
int(30)
["s"]=>
int(0)
["weekday"]=>
int(0)
["weekday_behavior"]=>
int(0)
["first_last_day_of"]=>
int(0)
["invert"]=>
int(0)
["days"]=>
int(294)
["special_type"]=>
int(0)
["special_amount"]=>
int(0)
["have_weekday_relative"]=>
int(0)
["have_special_relative"]=>
int(0)
}
DateInterval::__construct(): Failed to parse interval (2007-05-11T15:30:00Z/)
DateInterval::__construct(): Failed to parse interval (2007-05-11T15:30:00Z)
+130 -4
View File
@@ -1,7 +1,5 @@
--TEST--
Bug #53437 (Crash when using unserialized DatePeriod instance)
--XFAIL--
Bug #53437 Not fixed yet
Bug #53437 (Crash when using unserialized DatePeriod instance), variation 1
--FILE--
<?php
$dp = new DatePeriod(new DateTime('2010-01-01 UTC'), new DateInterval('P1D'), 2);
@@ -20,9 +18,137 @@ $dpu = unserialize($ser); // $dpu has invalid values???
var_dump($dpu);
echo "Unserialized:\r\n";
// ???which leads to CRASH:
foreach($dpu as $dt) {
echo $dt->format('Y-m-d H:i:s')."\r\n";
}
?>
==DONE==
--EXPECT--
Original:
2010-01-01 00:00:00
2010-01-02 00:00:00
2010-01-03 00:00:00
object(DatePeriod)#1 (6) {
["start"]=>
object(DateTime)#2 (3) {
["date"]=>
string(19) "2010-01-01 00:00:00"
["timezone_type"]=>
int(3)
["timezone"]=>
string(3) "UTC"
}
["current"]=>
object(DateTime)#4 (3) {
["date"]=>
string(19) "2010-01-04 00:00:00"
["timezone_type"]=>
int(3)
["timezone"]=>
string(3) "UTC"
}
["end"]=>
NULL
["interval"]=>
object(DateInterval)#5 (15) {
["y"]=>
int(0)
["m"]=>
int(0)
["d"]=>
int(1)
["h"]=>
int(0)
["i"]=>
int(0)
["s"]=>
int(0)
["weekday"]=>
int(0)
["weekday_behavior"]=>
int(0)
["first_last_day_of"]=>
int(0)
["invert"]=>
int(0)
["days"]=>
bool(false)
["special_type"]=>
int(0)
["special_amount"]=>
int(0)
["have_weekday_relative"]=>
int(0)
["have_special_relative"]=>
int(0)
}
["recurrences"]=>
int(3)
["include_start_date"]=>
bool(true)
}
object(DatePeriod)#5 (6) {
["start"]=>
object(DateTime)#10 (3) {
["date"]=>
string(19) "2010-01-01 00:00:00"
["timezone_type"]=>
int(3)
["timezone"]=>
string(3) "UTC"
}
["current"]=>
object(DateTime)#7 (3) {
["date"]=>
string(19) "2010-01-04 00:00:00"
["timezone_type"]=>
int(3)
["timezone"]=>
string(3) "UTC"
}
["end"]=>
NULL
["interval"]=>
object(DateInterval)#8 (15) {
["y"]=>
int(0)
["m"]=>
int(0)
["d"]=>
int(1)
["h"]=>
int(0)
["i"]=>
int(0)
["s"]=>
int(0)
["weekday"]=>
int(0)
["weekday_behavior"]=>
int(0)
["first_last_day_of"]=>
int(0)
["invert"]=>
int(0)
["days"]=>
int(0)
["special_type"]=>
int(0)
["special_amount"]=>
int(0)
["have_weekday_relative"]=>
int(0)
["have_special_relative"]=>
int(0)
}
["recurrences"]=>
int(3)
["include_start_date"]=>
bool(true)
}
Unserialized:
2010-01-01 00:00:00
2010-01-02 00:00:00
2010-01-03 00:00:00
==DONE==
+13
View File
@@ -0,0 +1,13 @@
--TEST--
Bug #53437 (Crash when using unserialized DatePeriod instance), variation 2
--FILE--
<?php
$s = 'O:10:"DatePeriod":0:{}';
$dp = unserialize($s);
var_dump($dp);
?>
==DONE==
--EXPECTF--
Fatal error: Invalid serialization data for DatePeriod object in %sbug53437_var1.php on line %d
+80
View File
@@ -0,0 +1,80 @@
--TEST--
Bug #53437 DateInterval basic serialization
--FILE--
<?php
$di0 = new DateInterval('P2Y4DT6H8M');
$s = serialize($di0);
$di1 = unserialize($s);
var_dump($di0, $di1);
?>
==DONE==
--EXPECT--
object(DateInterval)#1 (15) {
["y"]=>
int(2)
["m"]=>
int(0)
["d"]=>
int(4)
["h"]=>
int(6)
["i"]=>
int(8)
["s"]=>
int(0)
["weekday"]=>
int(0)
["weekday_behavior"]=>
int(0)
["first_last_day_of"]=>
int(0)
["invert"]=>
int(0)
["days"]=>
bool(false)
["special_type"]=>
int(0)
["special_amount"]=>
int(0)
["have_weekday_relative"]=>
int(0)
["have_special_relative"]=>
int(0)
}
object(DateInterval)#2 (15) {
["y"]=>
int(2)
["m"]=>
int(0)
["d"]=>
int(4)
["h"]=>
int(6)
["i"]=>
int(8)
["s"]=>
int(0)
["weekday"]=>
int(0)
["weekday_behavior"]=>
int(0)
["first_last_day_of"]=>
int(0)
["invert"]=>
int(0)
["days"]=>
int(0)
["special_type"]=>
int(0)
["special_amount"]=>
int(0)
["have_weekday_relative"]=>
int(0)
["have_special_relative"]=>
int(0)
}
==DONE==
+47
View File
@@ -0,0 +1,47 @@
--TEST--
Bug #53437 DateInterval unserialize bad data, 32 bit
--SKIPIF--
<?php if (PHP_INT_SIZE != 4) { die('skip 32 bit only'); } ?>
--FILE--
<?php
$s = 'O:12:"DateInterval":15:{s:1:"y";s:1:"2";s:1:"m";s:1:"0";s:1:"d";s:3:"bla";s:1:"h";s:1:"6";s:1:"i";s:1:"8";s:1:"s";s:1:"0";s:7:"weekday";i:10;s:16:"weekday_behavior";i:10;s:17:"first_last_day_of";i:0;s:6:"invert";i:0;s:4:"days";s:4:"aoeu";s:12:"special_type";i:0;s:14:"special_amount";s:21:"234523452345234532455";s:21:"have_weekday_relative";i:21474836489;s:21:"have_special_relative";s:3:"bla";}';
$di = unserialize($s);
var_dump($di);
?>
==DONE==
--EXPECTF--
object(DateInterval)#%d (15) {
["y"]=>
int(2)
["m"]=>
int(0)
["d"]=>
int(0)
["h"]=>
int(6)
["i"]=>
int(8)
["s"]=>
int(0)
["weekday"]=>
int(10)
["weekday_behavior"]=>
int(10)
["first_last_day_of"]=>
int(0)
["invert"]=>
int(0)
["days"]=>
int(0)
["special_type"]=>
int(0)
["special_amount"]=>
int(-1)
["have_weekday_relative"]=>
int(9)
["have_special_relative"]=>
int(0)
}
==DONE==
+64
View File
@@ -0,0 +1,64 @@
--TEST--
Bug #53437 (Check that var_dump out is the same using the whole object or it's single properties), variation 4
--INI--
date.timezone = Europe/Berlin
--FILE--
<?php
$dt = new DateTime('2009-10-11');
$df = $dt->diff(new DateTime('2009-10-13'));
var_dump($df,
$df->y,
$df->m,
$df->d,
$df->h,
$df->i,
$df->s,
$df->invert,
$df->days);
?>
==DONE==
--EXPECTF--
object(DateInterval)#%d (15) {
["y"]=>
int(0)
["m"]=>
int(0)
["d"]=>
int(2)
["h"]=>
int(0)
["i"]=>
int(0)
["s"]=>
int(0)
["weekday"]=>
int(0)
["weekday_behavior"]=>
int(0)
["first_last_day_of"]=>
int(0)
["invert"]=>
int(0)
["days"]=>
int(2)
["special_type"]=>
int(0)
["special_amount"]=>
int(0)
["have_weekday_relative"]=>
int(0)
["have_special_relative"]=>
int(0)
}
int(0)
int(0)
int(2)
int(0)
int(0)
int(0)
int(0)
int(2)
==DONE==
+47
View File
@@ -0,0 +1,47 @@
--TEST--
Bug #53437 DateInterval unserialize bad data, 64 bit
--SKIPIF--
<?php if (PHP_INT_SIZE != 8) { die('skip true 64 bit only'); } ?>
--FILE--
<?php
$s = 'O:12:"DateInterval":15:{s:1:"y";s:1:"2";s:1:"m";s:1:"0";s:1:"d";s:3:"bla";s:1:"h";s:1:"6";s:1:"i";s:1:"8";s:1:"s";s:1:"0";s:7:"weekday";i:10;s:16:"weekday_behavior";i:10;s:17:"first_last_day_of";i:0;s:6:"invert";i:0;s:4:"days";s:4:"aoeu";s:12:"special_type";i:0;s:14:"special_amount";s:21:"234523452345234532455";s:21:"have_weekday_relative";i:21474836489;s:21:"have_special_relative";s:3:"bla";}';
$di = unserialize($s);
var_dump($di);
?>
==DONE==
--EXPECTF--
object(DateInterval)#%d (15) {
["y"]=>
int(2)
["m"]=>
int(0)
["d"]=>
int(0)
["h"]=>
int(6)
["i"]=>
int(8)
["s"]=>
int(0)
["weekday"]=>
int(10)
["weekday_behavior"]=>
int(10)
["first_last_day_of"]=>
int(0)
["invert"]=>
int(0)
["days"]=>
int(0)
["special_type"]=>
int(0)
["special_amount"]=>
int(9223372036854775807)
["have_weekday_relative"]=>
int(9)
["have_special_relative"]=>
int(0)
}
==DONE==
+10
View File
@@ -0,0 +1,10 @@
--TEST--
Bug #55397 (comparsion of incomplete DateTime causes SIGSEGV)
--INI--
--FILE--
<?php
date_default_timezone_set('Europe/Prague');
var_dump(unserialize('O:8:"DateTime":0:{}') == new DateTime);
?>
--EXPECTF--
Fatal error: Invalid serialization data for DateTime object in %sbug55397.php on line %d
+2 -24
View File
@@ -1,36 +1,14 @@
--TEST--
Bug #62852 (Unserialize invalid DateTime causes crash)
Bug #62852 (Unserialize invalid DateTime causes crash), variation 1
--INI--
date.timezone=GMT
--XFAIL--
bug is not fixed yet
--FILE--
<?php
$s1 = 'O:8:"DateTime":3:{s:4:"date";s:20:"10007-06-07 03:51:49";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}';
$s2 = 'O:3:"Foo":3:{s:4:"date";s:20:"10007-06-07 03:51:49";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}';
global $foo;
class Foo extends DateTime {
function __wakeup() {
global $foo;
$foo = $this;
parent::__wakeup();
}
}
// Old test case
try {
unserialize( $s1 );
} catch ( Exception $e ) {}
// My test case
try {
unserialize( $s2 );
} catch ( Exception $e ) {}
var_dump( $foo );
echo "okey";
?>
--EXPECTF--
okey
Fatal error: Invalid serialization data for DateTime object in %sbug62852.php on line %d
+25
View File
@@ -0,0 +1,25 @@
--TEST--
Bug #62852 (Unserialize invalid DateTime causes crash), variation 2
--INI--
date.timezone=GMT
--FILE--
<?php
$s2 = 'O:3:"Foo":3:{s:4:"date";s:20:"10007-06-07 03:51:49";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}';
global $foo;
class Foo extends DateTime {
function __wakeup() {
global $foo;
$foo = $this;
parent::__wakeup();
}
}
try {
unserialize( $s2 );
} catch ( Exception $e ) {}
var_dump( $foo );
--EXPECTF--
Fatal error: Invalid serialization data for DateTime object in %sbug62852_var2.php on line %d
+25
View File
@@ -0,0 +1,25 @@
--TEST--
Bug #62852 (Unserialize invalid DateTime causes crash), variation 3
--INI--
date.timezone=GMT
--FILE--
<?php
$s2 = 'O:3:"Foo":3:{s:4:"date";s:19:"0000-00-00 00:00:00";s:13:"timezone_type";i:0;s:8:"timezone";s:3:"UTC";}';
global $foo;
class Foo extends DateTime {
function __wakeup() {
global $foo;
$foo = $this;
parent::__wakeup();
}
}
try {
unserialize( $s2 );
} catch ( Exception $e ) {}
var_dump( $foo );
--EXPECTF--
Fatal error: Invalid serialization data for DateTime object in %sbug62852_var3.php on line %d
+38
View File
@@ -0,0 +1,38 @@
--TEST--
Bug #67251 (date_parse_from_format out-of-bounds read)
--INI--
date.timezone=Europe/Berlin
--FILE--
<?php
var_dump(date_parse_from_format("\\","AAAABBBB"));
--EXPECT--
array(12) {
["year"]=>
bool(false)
["month"]=>
bool(false)
["day"]=>
bool(false)
["hour"]=>
bool(false)
["minute"]=>
bool(false)
["second"]=>
bool(false)
["fraction"]=>
bool(false)
["warning_count"]=>
int(0)
["warnings"]=>
array(0) {
}
["error_count"]=>
int(2)
["errors"]=>
array(1) {
[0]=>
string(13) "Trailing data"
}
["is_localtime"]=>
bool(false)
}
+44
View File
@@ -0,0 +1,44 @@
--TEST--
Bug #67253 (timelib_meridian_with_check out-of-bounds read)
--INI--
date.timezone=Europe/Berlin
--FILE--
<?php
$z = '';
var_dump(date_parse_from_format("aHa0", "0=G{$z}9UCNnF"));
--EXPECT--
array(12) {
["year"]=>
bool(false)
["month"]=>
bool(false)
["day"]=>
bool(false)
["hour"]=>
int(0)
["minute"]=>
int(0)
["second"]=>
int(0)
["fraction"]=>
bool(false)
["warning_count"]=>
int(0)
["warnings"]=>
array(0) {
}
["error_count"]=>
int(3)
["errors"]=>
array(3) {
[0]=>
string(51) "Meridian can only come after an hour has been found"
[1]=>
string(29) "A meridian could not be found"
[9]=>
string(12) "Data missing"
}
["is_localtime"]=>
bool(false)
}
+15 -1
View File
@@ -28,7 +28,7 @@ object(DateTime)#2 (3) {
["timezone"]=>
string(3) "EDT"
}
object(DateInterval)#3 (8) {
object(DateInterval)#3 (15) {
["y"]=>
int(0)
["m"]=>
@@ -41,8 +41,22 @@ object(DateInterval)#3 (8) {
int(19)
["s"]=>
int(40)
["weekday"]=>
int(0)
["weekday_behavior"]=>
int(0)
["first_last_day_of"]=>
int(0)
["invert"]=>
int(0)
["days"]=>
int(33)
["special_type"]=>
int(0)
["special_amount"]=>
int(0)
["have_weekday_relative"]=>
int(0)
["have_special_relative"]=>
int(0)
}
+1 -1
View File
@@ -23,10 +23,10 @@
#include "config.h"
#endif
#include <enchant.h>
#include "php.h"
#include "php_ini.h"
#include "ext/standard/info.h"
#include <enchant.h>
#include "php_enchant.h"
typedef EnchantBroker * EnchantBrokerPtr;
+6 -1
View File
@@ -2874,7 +2874,12 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
offset_val = php_ifd_get32u(dir_entry+8, ImageInfo->motorola_intel);
/* If its bigger than 4 bytes, the dir entry contains an offset. */
value_ptr = offset_base+offset_val;
if (byte_count > IFDlength || offset_val > IFDlength-byte_count || value_ptr < dir_entry) {
/*
dir_entry is ImageInfo->file.list[sn].data+2+i*12
offset_base is ImageInfo->file.list[sn].data-dir_offset
dir_entry - offset_base is dir_offset+2+i*12
*/
if (byte_count > IFDlength || offset_val > IFDlength-byte_count || value_ptr < dir_entry || offset_val < (size_t)(dir_entry-offset_base)) {
/* It is important to check for IMAGE_FILETYPE_TIFF
* JPEG does not use absolute pointers instead its pointers are
* relative to the start of the TIFF header in APP1 section. */
+26 -21
View File
@@ -277,13 +277,15 @@ cdf_check_stream_offset(const cdf_stream_t *sst, const cdf_header_t *h,
{
const char *b = (const char *)sst->sst_tab;
const char *e = ((const char *)p) + tail;
size_t ss = sst->sst_dirlen < h->h_min_size_standard_stream ?
CDF_SHORT_SEC_SIZE(h) : CDF_SEC_SIZE(h);
(void)&line;
if (e >= b && (size_t)(e - b) < CDF_SEC_SIZE(h) * sst->sst_len)
if (e >= b && (size_t)(e - b) <= ss * sst->sst_len)
return 0;
DPRINTF(("%d: offset begin %p end %p %" SIZE_T_FORMAT "u"
" >= %" SIZE_T_FORMAT "u [%" SIZE_T_FORMAT "u %"
SIZE_T_FORMAT "u]\n", line, b, e, (size_t)(e - b),
CDF_SEC_SIZE(h) * sst->sst_len, CDF_SEC_SIZE(h), sst->sst_len));
ss * sst->sst_len, ss, sst->sst_len));
errno = EFTYPE;
return -1;
}
@@ -365,10 +367,10 @@ cdf_read_short_sector(const cdf_stream_t *sst, void *buf, size_t offs,
size_t ss = CDF_SHORT_SEC_SIZE(h);
size_t pos = CDF_SHORT_SEC_POS(h, id);
assert(ss == len);
if (pos > CDF_SEC_SIZE(h) * sst->sst_len) {
if (pos + len > CDF_SEC_SIZE(h) * sst->sst_len) {
DPRINTF(("Out of bounds read %" SIZE_T_FORMAT "u > %"
SIZE_T_FORMAT "u\n",
pos, CDF_SEC_SIZE(h) * sst->sst_len));
pos + len, CDF_SEC_SIZE(h) * sst->sst_len));
return -1;
}
(void)memcpy(((char *)buf) + offs,
@@ -468,7 +470,8 @@ size_t
cdf_count_chain(const cdf_sat_t *sat, cdf_secid_t sid, size_t size)
{
size_t i, j;
cdf_secid_t maxsector = (cdf_secid_t)(sat->sat_len * size);
cdf_secid_t maxsector = (cdf_secid_t)((sat->sat_len * size)
/ sizeof(maxsector));
DPRINTF(("Chain:"));
for (j = i = 0; sid >= 0; i++, j++) {
@@ -478,8 +481,8 @@ cdf_count_chain(const cdf_sat_t *sat, cdf_secid_t sid, size_t size)
errno = EFTYPE;
return (size_t)-1;
}
if (sid > maxsector) {
DPRINTF(("Sector %d > %d\n", sid, maxsector));
if (sid >= maxsector) {
DPRINTF(("Sector %d >= %d\n", sid, maxsector));
errno = EFTYPE;
return (size_t)-1;
}
@@ -809,7 +812,11 @@ cdf_read_property_info(const cdf_stream_t *sst, const cdf_header_t *h,
if (cdf_check_stream_offset(sst, h, e, 0, __LINE__) == -1)
goto out;
for (i = 0; i < sh.sh_properties; i++) {
size_t ofs = CDF_GETUINT32(p, (i << 1) + 1);
size_t ofs, tail = (i << 1) + 1;
if (cdf_check_stream_offset(sst, h, p, tail * sizeof(uint32_t),
__LINE__) == -1)
goto out;
ofs = CDF_GETUINT32(p, tail);
q = (const uint8_t *)(const void *)
((const char *)(const void *)p + ofs
- 2 * sizeof(uint32_t));
@@ -823,6 +830,10 @@ cdf_read_property_info(const cdf_stream_t *sst, const cdf_header_t *h,
i, inp[i].pi_id, inp[i].pi_type, q - p, offs));
if (inp[i].pi_type & CDF_VECTOR) {
nelements = CDF_GETUINT32(q, 1);
if (nelements == 0) {
DPRINTF(("CDF_VECTOR with nelements == 0\n"));
goto out;
}
o = 2;
} else {
nelements = 1;
@@ -897,7 +908,9 @@ cdf_read_property_info(const cdf_stream_t *sst, const cdf_header_t *h,
}
DPRINTF(("nelements = %" SIZE_T_FORMAT "u\n",
nelements));
for (j = 0; j < nelements; j++, i++) {
for (j = 0; j < nelements && i < sh.sh_properties;
j++, i++)
{
uint32_t l = CDF_GETUINT32(q, o);
inp[i].pi_str.s_len = l;
inp[i].pi_str.s_buf = (const char *)
@@ -942,7 +955,7 @@ int
cdf_unpack_summary_info(const cdf_stream_t *sst, const cdf_header_t *h,
cdf_summary_info_header_t *ssi, cdf_property_info_t **info, size_t *count)
{
size_t i, maxcount;
size_t maxcount;
const cdf_summary_info_header_t *si =
CAST(const cdf_summary_info_header_t *, sst->sst_tab);
const cdf_section_declaration_t *sd =
@@ -957,21 +970,13 @@ cdf_unpack_summary_info(const cdf_stream_t *sst, const cdf_header_t *h,
ssi->si_os = CDF_TOLE2(si->si_os);
ssi->si_class = si->si_class;
cdf_swap_class(&ssi->si_class);
ssi->si_count = CDF_TOLE2(si->si_count);
ssi->si_count = CDF_TOLE4(si->si_count);
*count = 0;
maxcount = 0;
*info = NULL;
for (i = 0; i < CDF_TOLE4(si->si_count); i++) {
if (i >= CDF_LOOP_LIMIT) {
DPRINTF(("Unpack summary info loop limit"));
errno = EFTYPE;
if (cdf_read_property_info(sst, h, CDF_TOLE4(sd->sd_offset), info,
count, &maxcount) == -1)
return -1;
}
if (cdf_read_property_info(sst, h, CDF_TOLE4(sd->sd_offset),
info, count, &maxcount) == -1) {
return -1;
}
}
return 0;
}
+6 -2
View File
@@ -56,6 +56,8 @@ cdf_file_property_info(struct magic_set *ms, const cdf_property_info_t *info,
const char *s;
int len;
memset(&ts, 0, sizeof(ts));
for (i = 0; i < count; i++) {
cdf_print_property_name(buf, sizeof(buf), info[i].pi_id);
switch (info[i].pi_type) {
@@ -142,11 +144,13 @@ cdf_file_property_info(struct magic_set *ms, const cdf_property_info_t *info,
return -1;
} else {
char *c, *ec;
const time_t sec = ts.tv_sec;
if (cdf_timestamp_to_timespec(&ts, tp) == -1) {
return -1;
}
c = cdf_ctime(&ts.tv_sec);
if ((ec = strchr(c, '\n')) != NULL)
c = cdf_ctime(&sec);
if (c != NULL &&
(ec = strchr(c, '\n')) != NULL)
*ec = '\0';
if (NOTMIME(ms) && file_printf(ms,
+11 -3
View File
@@ -777,10 +777,18 @@ mconvert(struct magic_set *ms, struct magic *m)
return 1;
}
case FILE_PSTRING: {
char *ptr1 = p->s, *ptr2 = ptr1 + file_pstring_length_size(m);
size_t sz = file_pstring_length_size(m);
char *ptr1 = p->s, *ptr2 = ptr1 + sz;
size_t len = file_pstring_get_length(m, ptr1);
if (len >= sizeof(p->s))
len = sizeof(p->s) - 1;
if (len >= sizeof(p->s)) {
/*
* The size of the pascal string length (sz)
* is 1, 2, or 4. We need at least 1 byte for NUL
* termination, but we've already truncated the
* string by p->s, so we need to deduct sz.
*/
len = sizeof(p->s) - sz;
}
while (len--)
*ptr1++ = *ptr2++;
*ptr1 = '\0';
+3 -1
View File
@@ -18,7 +18,7 @@ ksort($results);
var_dump($results);
?>
--EXPECTF--
array(7) {
array(8) {
["%s/resources/dir.zip"]=>
string(15) "application/zip"
["%s/resources/test.awk"]=>
@@ -33,4 +33,6 @@ array(7) {
string(15) "application/pdf"
["%s/resources/test.png"]=>
string(9) "image/png"
["%s/resources/test.ppt"]=>
string(29) "application/vnd.ms-powerpoint"
}
Binary file not shown.
+2
View File
@@ -252,6 +252,8 @@ AC_DEFUN([PHP_GD_CHECK_VERSION],[
PHP_CHECK_LIBRARY(gd, gdFreeFontCache, [AC_DEFINE(HAVE_GD_FREEFONTCACHE, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ])
PHP_CHECK_LIBRARY(gd, gdFontCacheMutexSetup, [AC_DEFINE(HAVE_GD_FONTMUTEX, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ])
PHP_CHECK_LIBRARY(gd, gdNewDynamicCtxEx, [AC_DEFINE(HAVE_GD_DYNAMIC_CTX_EX, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ])
PHP_CHECK_LIBRARY(gd, gdImageConvolution, [AC_DEFINE(HAVE_GD_IMAGE_CONVOLUTION, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ])
PHP_CHECK_LIBRARY(gd, gdImagePixelate, [AC_DEFINE(HAVE_GD_IMAGE_PIXELATE, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ])
])
dnl
+6 -2
View File
@@ -1241,9 +1241,13 @@ PHP_RSHUTDOWN_FUNCTION(gd)
/* }}} */
#if HAVE_GD_BUNDLED
#define PHP_GD_VERSION_STRING "bundled (2.0.34 compatible)"
#define PHP_GD_VERSION_STRING "bundled (2.1.0 compatible)"
#else
#define PHP_GD_VERSION_STRING "2.0"
# ifdef GD_VERSION_STRING
# define PHP_GD_VERSION_STRING GD_VERSION_STRING
# else
# define PHP_GD_VERSION_STRING "2.0"
# endif
#endif
/* {{{ PHP_MINFO_FUNCTION
+7
View File
@@ -32,6 +32,7 @@ int gdImageContrast(gdImagePtr src, double contrast);
/* Simply adds or substracts respectively red, green or blue to a pixel */
int gdImageColor(gdImagePtr src, const int red, const int green, const int blue, const int alpha);
#if !defined(HAVE_GD_IMAGE_CONVOLUTION)
/* Image convolution by a 3x3 custom matrix */
int gdImageConvolution(gdImagePtr src, float ft[3][3], float filter_div, float offset);
int gdImageEdgeDetectQuick(gdImagePtr src);
@@ -40,11 +41,17 @@ int gdImageSelectiveBlur( gdImagePtr src);
int gdImageEmboss(gdImagePtr im);
int gdImageMeanRemoval(gdImagePtr im);
int gdImageSmooth(gdImagePtr im, float weight);
#endif
#if !defined(HAVE_GD_IMAGE_PIXELATE)
enum gdPixelateMode {
GD_PIXELATE_UPPERLEFT,
GD_PIXELATE_AVERAGE
};
int gdImagePixelate(gdImagePtr im, int block_size, const unsigned int mode);
#endif
int gdImagePixelate(gdImagePtr im, int block_size, const unsigned int mode);
#if !HAVE_GD_IMAGEELLIPSE
+6 -3
View File
@@ -216,12 +216,13 @@ gdImagePtr gdImageRotate90 (gdImagePtr src, int ignoretransparent)
f = gdImageGetPixel;
}
dst = gdImageCreateTrueColor(src->sy, src->sx);
dst->transparent = src->transparent;
if (dst != NULL) {
int old_blendmode = dst->alphaBlendingFlag;
dst->alphaBlendingFlag = 0;
dst->transparent = src->transparent;
gdImagePaletteCopy (dst, src);
for (uY = 0; uY<src->sy; uY++) {
@@ -262,12 +263,13 @@ gdImagePtr gdImageRotate180 (gdImagePtr src, int ignoretransparent)
f = gdImageGetPixel;
}
dst = gdImageCreateTrueColor(src->sx, src->sy);
dst->transparent = src->transparent;
if (dst != NULL) {
int old_blendmode = dst->alphaBlendingFlag;
dst->alphaBlendingFlag = 0;
dst->transparent = src->transparent;
gdImagePaletteCopy (dst, src);
for (uY = 0; uY<src->sy; uY++) {
@@ -309,12 +311,13 @@ gdImagePtr gdImageRotate270 (gdImagePtr src, int ignoretransparent)
f = gdImageGetPixel;
}
dst = gdImageCreateTrueColor (src->sy, src->sx);
dst->transparent = src->transparent;
if (dst != NULL) {
int old_blendmode = dst->alphaBlendingFlag;
dst->alphaBlendingFlag = 0;
dst->transparent = src->transparent;
gdImagePaletteCopy (dst, src);
for (uY = 0; uY<src->sy; uY++) {
+12 -5
View File
@@ -269,8 +269,7 @@ static char* get_icu_value_internal( char* loc_name , char* tag_name, int* resul
grOffset = findOffset( LOC_GRANDFATHERED , loc_name );
if( grOffset >= 0 ){
if( strcmp(tag_name , LOC_LANG_TAG)==0 ){
tag_value = estrdup(loc_name);
return tag_value;
return estrdup(loc_name);
} else {
/* Since Grandfathered , no value , do nothing , retutn NULL */
return NULL;
@@ -280,8 +279,8 @@ static char* get_icu_value_internal( char* loc_name , char* tag_name, int* resul
if( fromParseLocale==1 ){
/* Handle singletons */
if( strcmp(tag_name , LOC_LANG_TAG)==0 ){
if( strlen(loc_name)>1 && (isIDPrefix(loc_name) ==1 ) ){
return loc_name;
if( strlen(loc_name)>1 && isIDPrefix(loc_name) ){
return estrdup(loc_name);
}
}
@@ -498,8 +497,16 @@ static void get_icu_disp_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAME
RETURN_FALSE;
}
if(loc_name_len > ULOC_FULLNAME_CAPACITY) {
/* See bug 67397: overlong locale names cause trouble in uloc_getDisplayName */
spprintf(&msg , 0, "locale_get_display_%s : name too long", tag_name );
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, msg , 1 TSRMLS_CC );
efree(msg);
RETURN_FALSE;
}
if(loc_name_len == 0) {
loc_name = INTL_G(default_locale);
loc_name = INTL_G(default_locale);
}
if( strcmp(tag_name, DISP_NAME) != 0 ){
+4 -3
View File
@@ -10,6 +10,7 @@ var_dump(locale_get_display_name(str_repeat("a", 300), null));
var_dump(locale_get_display_name(str_repeat("a", 512), null));
var_dump(locale_get_display_name(str_repeat("a", 600), null));
--EXPECT--
string(300) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
string(512) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
string(600) "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
bool(false)
bool(false)
bool(false)
+21
View File
@@ -0,0 +1,21 @@
--TEST--
Bug #67397 (Buffer overflow in locale_get_display_name->uloc_getDisplayName (libicu 4.8.1))
--SKIPIF--
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
--FILE--
<?php
function ut_main()
{
$ret = var_export(ut_loc_get_display_name(str_repeat('*', 256), 'en_us'), true);
$ret .= "\n";
$ret .= var_export(intl_get_error_message(), true);
return $ret;
}
include_once( 'ut_common.inc' );
ut_run();
?>
--EXPECTF--
false
'locale_get_display_name : name too long: U_ILLEGAL_ARGUMENT_ERROR'
+5 -1
View File
@@ -63,7 +63,8 @@ function ut_main()
//Some Invalid Tags:
'de-419-DE',
'a-DE',
'ar-a-aaa-b-bbb-a-ccc'
'ar-a-aaa-b-bbb-a-ccc',
'x-AAAAAA',
);
@@ -201,3 +202,6 @@ No values found from Locale parsing.
---------------------
ar-a-aaa-b-bbb-a-ccc:
language : 'ar' ,
---------------------
x-AAAAAA:
private0 : 'AAAAAA' ,
+15 -18
View File
@@ -261,6 +261,7 @@ static PHP_GINIT_FUNCTION(libxml)
libxml_globals->stream_context = NULL;
libxml_globals->error_buffer.c = NULL;
libxml_globals->error_list = NULL;
libxml_globals->entity_loader_disabled = 0;
}
/* Channel libxml file io layer through the PHP streams subsystem.
@@ -347,17 +348,16 @@ static int php_libxml_streams_IO_close(void *context)
return php_stream_close((php_stream*)context);
}
static xmlParserInputBufferPtr
php_libxml_input_buffer_noload(const char *URI, xmlCharEncoding enc)
{
return NULL;
}
static xmlParserInputBufferPtr
php_libxml_input_buffer_create_filename(const char *URI, xmlCharEncoding enc)
{
xmlParserInputBufferPtr ret;
void *context = NULL;
TSRMLS_FETCH();
if (LIBXML(entity_loader_disabled)) {
return NULL;
}
if (URI == NULL)
return(NULL);
@@ -834,28 +834,25 @@ static PHP_FUNCTION(libxml_clear_errors)
}
/* }}} */
PHP_LIBXML_API zend_bool php_libxml_disable_entity_loader(zend_bool disable TSRMLS_DC)
{
zend_bool old = LIBXML(entity_loader_disabled);
LIBXML(entity_loader_disabled) = disable;
return old;
}
/* {{{ proto bool libxml_disable_entity_loader([boolean disable])
Disable/Enable ability to load external entities */
static PHP_FUNCTION(libxml_disable_entity_loader)
{
zend_bool disable = 1;
xmlParserInputBufferCreateFilenameFunc old;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &disable) == FAILURE) {
return;
}
if (disable == 0) {
old = xmlParserInputBufferCreateFilenameDefault(php_libxml_input_buffer_create_filename);
} else {
old = xmlParserInputBufferCreateFilenameDefault(php_libxml_input_buffer_noload);
}
if (old == php_libxml_input_buffer_noload) {
RETURN_TRUE;
}
RETURN_FALSE;
RETURN_BOOL(php_libxml_disable_entity_loader(disable TSRMLS_CC));
}
/* }}} */
+2
View File
@@ -43,6 +43,7 @@ ZEND_BEGIN_MODULE_GLOBALS(libxml)
zval *stream_context;
smart_str error_buffer;
zend_llist *error_list;
zend_bool entity_loader_disabled;
ZEND_END_MODULE_GLOBALS(libxml)
typedef struct _libxml_doc_props {
@@ -93,6 +94,7 @@ PHP_LIBXML_API void php_libxml_ctx_error(void *ctx, const char *msg, ...);
PHP_LIBXML_API int php_libxml_xmlCheckUTF8(const unsigned char *s);
PHP_LIBXML_API zval *php_libxml_switch_context(zval *context TSRMLS_DC);
PHP_LIBXML_API void php_libxml_issue_error(int level, const char *msg TSRMLS_DC);
PHP_LIBXML_API zend_bool php_libxml_disable_entity_loader(zend_bool disable TSRMLS_DC);
/* Init/shutdown functions*/
PHP_LIBXML_API void php_libxml_initialize(void);
+1 -1
View File
@@ -690,7 +690,7 @@ PHP_MINFO_FUNCTION(mysql)
static void php_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
{
char *user=NULL, *passwd=NULL, *host_and_port=NULL, *socket=NULL, *tmp=NULL, *host=NULL;
int user_len, passwd_len, host_len;
int user_len = 0, passwd_len = 0, host_len = 0;
char *hashed_details=NULL;
int hashed_details_length, port = MYSQL_PORT;
long client_flags = 0;
+1 -1
View File
@@ -1259,7 +1259,7 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags
#endif
if (into_object && Z_TYPE_P(return_value) != IS_NULL) {
if (into_object && Z_TYPE_P(return_value) == IS_ARRAY) {
zval dataset = *return_value;
zend_fcall_info fci;
zend_fcall_info_cache fcc;
+23
View File
@@ -0,0 +1,23 @@
--TEST--
Bug #63398 (Memleak when calling fetch_object on a use_result and DB pointer has closed)
--SKIPIF--
<?php
require_once('skipif.inc');
require_once("connect.inc");
if (!$IS_MYSQLND) {
die("skip mysqlnd only test");
}
require_once('skipifconnectfailure.inc');
?>
--FILE--
<?php
require 'connect.inc';
$db = new my_mysqli($host, $user, $passwd, $db, $port, $socket);
$result = $db->query('SELECT 1', MYSQLI_USE_RESULT);
$db->close();
var_dump($result->fetch_object());
?>
--EXPECTF--
Warning: mysqli_result::fetch_object(): Error while reading a row in %sbug64726.php on line %d
bool(false)
+3 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2012 The PHP Group |
| Copyright (c) 2006-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -691,6 +691,8 @@ MYSQLND_METHOD(mysqlnd_conn, connect)(MYSQLND * conn,
mysql_flags |= CLIENT_LOCAL_FILES | CLIENT_PS_MULTI_RESULTS;
mysql_flags |= MYSQLND_CAPABILITIES;
mysql_flags |= conn->options.flags; /* use the flags from set_client_option() */
if (db) {
mysql_flags |= CLIENT_CONNECT_WITH_DB;
}
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2012 The PHP Group |
| Copyright (c) 2006-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2012 The PHP Group |
| Copyright (c) 2006-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2012 The PHP Group |
| Copyright (c) 2006-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2012 The PHP Group |
| Copyright (c) 2006-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2012 The PHP Group |
| Copyright (c) 2006-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2012 The PHP Group |
| Copyright (c) 2006-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2012 The PHP Group |
| Copyright (c) 2006-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+2 -2
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2012 The PHP Group |
| Copyright (c) 2006-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -39,7 +39,7 @@
#define MYSQLND_SQLSTATE_LENGTH 5
#define MYSQLND_SQLSTATE_NULL "00000"
#define MYSQLND_MAX_ALLOWED_USER_LEN 256 /* 64 char * 4byte . MySQL supports now only 16 char, but let it be forward compatible */
#define MYSQLND_MAX_ALLOWED_USER_LEN 252 /* 63 char * 4byte . MySQL supports now only 16 char, but let it be forward compatible */
#define MYSQLND_MAX_ALLOWED_DB_LEN 1024 /* 256 char * 4byte. MySQL supports now only 64 char in the tables, but on the FS could be different. Forward compatible. */
#define MYSQLND_NET_CMD_BUFFER_MIN_SIZE 4096
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2012 The PHP Group |
| Copyright (c) 2006-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2012 The PHP Group |
| Copyright (c) 2006-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2012 The PHP Group |
| Copyright (c) 2006-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2012 The PHP Group |
| Copyright (c) 2006-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2012 The PHP Group |
| Copyright (c) 2006-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+2 -2
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2012 The PHP Group |
| Copyright (c) 2006-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -1485,7 +1485,7 @@ MYSQLND_METHOD(mysqlnd_stmt, bind_one_parameter)(MYSQLND_STMT * const s, unsigne
if (stmt->param_count) {
if (!stmt->param_bind) {
stmt->param_bind = mnd_ecalloc(stmt->param_count, sizeof(MYSQLND_PARAM_BIND));
stmt->param_bind = mnd_pecalloc(stmt->param_count, sizeof(MYSQLND_PARAM_BIND), stmt->persistent);
if (!stmt->param_bind) {
DBG_RETURN(FAIL);
}
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2012 The PHP Group |
| Copyright (c) 2006-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+2 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2012 The PHP Group |
| Copyright (c) 2006-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -1547,6 +1547,7 @@ MYSQLND_METHOD(mysqlnd_res, fetch_into)(MYSQLND_RES * result, unsigned int flags
mysqlnd_array_init(return_value, mysqlnd_num_fields(result) * 2);
if (FAIL == result->m.fetch_row(result, (void *)return_value, flags, &fetched_anything TSRMLS_CC)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error while reading a row");
zval_dtor(return_value);
RETVAL_FALSE;
} else if (fetched_anything == FALSE) {
zval_dtor(return_value);
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2012 The PHP Group |
| Copyright (c) 2006-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2012 The PHP Group |
| Copyright (c) 2006-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2012 The PHP Group |
| Copyright (c) 2006-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
+1 -1
View File
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 2006-2012 The PHP Group |
| Copyright (c) 2006-2013 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
Loaded 100 of 261 files, more files were not shown because too many files have changed in this diff. Show more