Compare commits

...
253 Commits
Author SHA1 Message Date
Ferenc Kovacs f94c1df85f update the certificate used for the test, as it expired recently 2014-10-15 14:59:32 +02:00
Ferenc Kovacs 9a51848409 update NEWS 2014-10-15 14:03:11 +02:00
Ferenc Kovacs a2cda214d6 5.6.2 2014-10-15 13:59:03 +02:00
Stanislav Malyshev 8d553829cc Fix return code (merges are hard :( ) 2014-10-15 13:33:44 +02:00
Stanislav Malyshev 5818f5db62 Fix bug #68113 (Heap corruption in exif_thumbnail()) 2014-10-15 13:32:12 +02:00
Stanislav Malyshev e194927b26 Fix bug #68089 - do not accept options with embedded \0
Conflicts:
	ext/curl/interface.c
2014-10-15 13:32:02 +02:00
Stanislav Malyshev 2d7461f7bf Fixed bug #68044: Integer overflow in unserialize() (32-bits only)
Conflicts:
	ext/standard/var_unserializer.c
2014-10-15 13:31:48 +02:00
Stanislav Malyshev 5f64da15bb Fix bug #68027 - fix date parsing in XMLRPC lib 2014-10-15 13:29:05 +02:00
Ferenc Kovacs 939409d36f update NEWS about the release date of 5.6.1 2014-10-01 11:17:38 +02:00
Ferenc Kovacs 4c4a354223 5.6.1 2014-09-24 10:30:08 +02:00
Ferenc Kovacs c7c360ed37 removing the NEWS entry as we had to revert this fix for now 2014-09-24 10:27:42 +02:00
Ferenc Kovacs 4879eb7242 Revert "Merge branch 'PHP-5.5' into PHP-5.6"
This reverts commit 98e67add15, reversing
changes made to 2cdc1a2b74.
2014-09-24 10:17:25 +02:00
Ferenc Kovacs 43c72ea2cb Revert "fix TS build"
This reverts commit 84a4041ba4.
2014-09-24 10:15:53 +02:00
Ferenc Kovacs dc5f587e07 Revert "Merge branch 'PHP-5.4' into PHP-5.5"
This reverts commit 30a73658c6, reversing
changes made to 7fac56e072.
2014-09-24 10:14:15 +02:00
Ferenc Kovacs 4465b0f415 Revert "Bug #67965: Fix blocking behavior in non-blocking crypto streams"
This reverts commit f86b2193a4.
2014-09-24 10:13:24 +02:00
Ferenc Kovacs 4310db437a Revert "Bug #41631: Fix regression from first attempt (6569db8)"
This reverts commit 372844918a.
2014-09-24 10:12:56 +02:00
Sebastian Zartner 725748cd25 Fixed typo 2014-09-24 09:50:56 +02:00
Ferenc Kovacs d841843c2f add NEWS entry for #68088 2014-09-24 09:42:47 +02:00
Ferenc Kovacs ee8e2373ac the order of the blocks should be Core, then exts in alphabetical order 2014-09-24 09:42:23 +02:00
Julien Pauli afcda556be NEWS for last commit 2014-09-15 15:37:05 +02:00
Bob Weinand 2f57d19f76 Fix bug #111 (compile error without ZEND_SIGNALS) 2014-09-15 15:12:54 +02:00
Julien Pauli 78e8b1511c 5.6.1RC1 2014-09-11 18:46:38 +02:00
Anatol Belski 0b89bb83ba Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fix precision when fetching float through mysqlnd
2014-09-10 19:31:59 +02:00
Anatol Belski dff820cea3 fix precision when fetching float through mysqlnd
fixes failing ext/mysqli/tests/010.phpt
2014-09-10 19:29:11 +02:00
Michael Wallner 4f2563329b Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  make LTP version check a blacklist
2014-09-10 13:31:22 +02:00
Michael Wallner 3b78a24ee9 make LTP version check a blacklist 2014-09-10 13:30:52 +02:00
Matteo Beccati 0b648a424f FR #67990 - Added nowait argument to sem_acquire 2014-09-10 07:31:25 +02:00
Stanislav Malyshev 3571a68ab9 update NEWS 2014-09-09 16:11:32 -07:00
Daniel Lowrey edb2799333 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Bug #41631: Fix regression from first attempt (6569db8)
  Bug #67965: Fix blocking behavior in non-blocking crypto streams
2014-09-09 10:24:40 -06:00
Daniel Lowrey bf2f80b223 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Bug #41631: Fix regression from first attempt (6569db8)
  Bug #67965: Fix blocking behavior in non-blocking crypto streams
2014-09-09 09:27:20 -06:00
Daniel Lowrey 372844918a Bug #41631: Fix regression from first attempt (6569db8) 2014-09-09 09:01:42 -06:00
Daniel Lowrey f86b2193a4 Bug #67965: Fix blocking behavior in non-blocking crypto streams 2014-09-09 07:37:57 -06:00
Tjerk Meesters da7c87e2f8 Updated NEWS for #67985 2014-09-09 18:04:09 +08:00
Tjerk Meesters 7e9daf60c1 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed #67985 - Incorrect last used array index copied to new array after unset
2014-09-09 18:03:10 +08:00
Tjerk Meesters b9ac5e23fb Updated NEWS for #67985 2014-09-09 18:02:45 +08:00
Tjerk Meesters aca474fa14 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fixed #67985 - Incorrect last used array index copied to new array after unset
2014-09-09 18:00:49 +08:00
Tjerk Meesters 99f0760bfb Fixed #67985 - Incorrect last used array index copied to new array after unset
In master zend_array_dup() is used to do this properly; this is a workaround.
2014-09-09 17:58:45 +08:00
Michael Wallner 8d1099ac05 duplicate value's string for the SAPI filter
reported by sesser; tyrael, do you take care of the bug/NEWS?
2014-09-09 06:54:23 +02:00
George Wang 4bdd9aabdd Fine tuned the order of adding request variables. 2014-09-09 00:01:03 -04:00
George Wang bdac08bcdd Fine tuned the order of adding request variables. 2014-09-09 00:00:14 -04:00
George Wang d2e1a04b10 Fine tuned the order of adding request variables. 2014-09-08 23:58:05 -04:00
Adam Harvey 0cbfdc9df5 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fix bug #67972 (SessionHandler Invalid memory read create_sid()).
  Update LSAPI to 6.7, added support for 'filter_input'. Fixed a crash in CLI mode.
  5.5.18 now

Conflicts:
	configure.in
	main/php_version.h
2014-09-08 19:28:15 +00:00
Adam Harvey bc44eb6172 Fix bug #67972 (SessionHandler Invalid memory read create_sid()).
SessionHandler::create_sid() didn't check if PS(default_mod) was initialised
before attempting to call its create_sid() handler.
2014-09-08 19:25:14 +00:00
Nikita Popov 03797a73b2 Split GMP tests testing multiple functions
Also drop dummy test
2014-09-04 21:18:37 +02:00
Nikita Popov 9586b15229 Give proper names to GMP test files 2014-09-04 21:10:41 +02:00
Nikita Popov 15c139b99a Throw warnings when using zero modulus in gmp_powm
Also fixes a leak in this case.
2014-09-04 20:55:09 +02:00
Nikita Popov f10d194c8c Add GMP tests for some uncovered branches 2014-09-04 20:03:29 +02:00
Tjerk Meesters af3bd57d33 Updated NEWS for #67955 2014-09-04 07:00:14 +08:00
Tjerk Meesters fa08ff9245 Fixed #67955: SoapClient prepends 0-byte to cookie names 2014-09-04 06:58:04 +08:00
George Wang b85b78db4f Update LSAPI to 6.7, added support for 'filter_input'.
Fixed a crash in CLI mode.
2014-09-03 11:29:44 -04:00
George Wang b16929ca72 Merge branch 'PHP-5.5' of git.php.net:php-src into PHP-5.5 2014-09-03 11:28:30 -04:00
George Wang bba16dde5d Update LSAPI to 6.7, added support for 'filter_input'.
Fixed a crash in CLI mode.
2014-09-03 11:27:54 -04:00
George Wang 582f42b8d4 Update LSAPI to 6.7, added support for 'filter_input'.
Fixed a crash in CLI mode.
2014-09-03 11:24:45 -04:00
Philip Hofstetter 9befa8c5f7 fix bug #67955
this fixes a regression from 6c2a806820.

smart_str_appendl is expecting the length as the length of the string,
but key_length is the byte length of the key, including the 0
terminator.

As such, the cookie name appeneded to the header would now also include
the 0 terminator of the key name which then would be sent to the server.
2014-09-03 14:35:40 +02:00
Julien Pauli 9266227402 5.5.18 now 2014-09-03 10:18:51 +02:00
Matteo Beccati 627704b38e Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed test with freetype >= 2.4.12
2014-09-03 09:45:09 +02:00
Matteo Beccati 72c9b0e12b Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fixed test with freetype >= 2.4.12
2014-09-03 09:44:59 +02:00
Matteo Beccati 592df89027 Fixed test with freetype >= 2.4.12 2014-09-03 09:43:29 +02:00
Stanislav Malyshev 3e7d11b632 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  5.4.34 is next
2014-09-02 15:04:00 -07:00
Stanislav Malyshev a734acd439 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  5.4.34 is next

Conflicts:
	configure.in
	main/php_version.h
2014-09-02 15:03:54 -07:00
Stanislav Malyshev 5e95b61639 5.4.34 is next 2014-09-02 15:03:04 -07:00
Stanislav Malyshev 0c6e2b5219 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Revert "Fix bug #67644 - Memory corruption & crash during ob_start function callback"
2014-09-02 14:19:03 -07:00
Stanislav Malyshev 70f92aa97e Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Revert "Fix bug #67644 - Memory corruption & crash during ob_start function callback"
2014-09-02 14:18:05 -07:00
Stanislav Malyshev fe551c089a Revert "Fix bug #67644 - Memory corruption & crash during ob_start function callback"
This reverts commit 53fa6c5b6b.
The change breaks tests, so not putting it into 5.4.
2014-09-02 14:15:39 -07:00
Stanislav Malyshev 63f42adbb2 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fix bug #67644 - Memory corruption & crash during ob_start function callback
2014-09-02 12:32:40 -07:00
Stanislav Malyshev af85eff5b6 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fix bug #67644 - Memory corruption & crash during ob_start function callback
2014-09-02 12:32:03 -07:00
Stanislav Malyshev 53fa6c5b6b Fix bug #67644 - Memory corruption & crash during ob_start function callback 2014-09-02 12:31:03 -07:00
Nikita Popov 834daa455b Fixed bug #50175
0x and 0b prefix is now only handled if either no base is given
or if the base is 16 (0x) or 2 (0b). Always handling it is incorrect
because 0x and 0b are perfectly valid numbers in other bases.
2014-09-02 19:04:55 +02:00
Nikita Popov 7533243f0c Fix C89 build and small cleanup 2014-09-02 18:52:13 +02:00
Leigh 47d630e7f0 Implement gmp_import() and gmp_export() 2014-09-02 14:19:18 +02:00
Tjerk Meesters f54451cf39 Make DOMNode::textContent writeable 2014-09-02 06:34:18 +08:00
Tjerk Meesters 8da58e36b4 Updated UPGRADING 2014-09-02 06:32:56 +08:00
Tjerk Meesters 83bacd2fe0 Updated NEWS 2014-09-02 06:32:56 +08:00
Stanislav Malyshev 57f82819e9 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  update NEWS
  Only destruct if EG(active) in zend_shutdown(). (bug #65463, #66036)
  Fix typo from commit 32314f6b6
  Fix destruction order in zend_shutdown (bug #65463, #66036)
2014-09-01 12:20:34 -07:00
Stanislav Malyshev 4b9fcc01d4 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  update NEWS
  Only destruct if EG(active) in zend_shutdown(). (bug #65463, #66036)
  Fix typo from commit 32314f6b6
  Fix destruction order in zend_shutdown (bug #65463, #66036)
2014-09-01 12:15:54 -07:00
Stanislav Malyshev 30aceaf1a7 update NEWS 2014-09-01 12:13:43 -07:00
Stanislav Malyshev 197095c29e Merge branch 'pull-request/770' into PHP-5.4
* pull-request/770:
  Only destruct if EG(active) in zend_shutdown(). (bug #65463, #66036)
  Fix typo from commit 32314f6b6
  Fix destruction order in zend_shutdown (bug #65463, #66036)
2014-09-01 12:11:42 -07:00
Derick Rethans f89b7ec389 Merge branch 'PHP-5.5' into PHP-5.6 2014-09-01 16:40:54 +01:00
Derick Rethans 21446cd7b6 Merge branch 'PHP-5.4' into PHP-5.5 2014-09-01 16:40:50 +01:00
Derick Rethans e665a07ab9 - Updated to version 2014.7 (2014g) 2014-09-01 16:40:49 +01:00
Tjerk Meesters f0ba3e265a Updated UPGRADING for #38409 2014-09-01 22:15:53 +08:00
Tjerk Meesters 65c1e14cb9 Updated NEWS for #38409 2014-09-01 22:13:38 +08:00
Tjerk Meesters 1bf996b324 Added test case 2014-09-01 22:04:25 +08:00
Tjerk Meesters 5270ee1aef Making ini parser typed
- Added ZEND_INI_SCANNER_TYPED mode for parse_ini_string() and parse_ini_file()
- Added NULL_NULL token to separate it from BOOL_FALSE and BOOL_TRUE
- Added zend_ini_copy_typed_value() function for zval initialisation
- Updated RETURN_TOKEN() to observe scanner_mode
2014-09-01 22:04:06 +08:00
Nikita Popov d7368c2531 Fix bug #67938: Segfault when extending interface method with variadic
We only want to check extra optional args if the proto function is
variadic, not when we're adding extra variadic args.
2014-08-30 20:43:34 +02:00
Anatol Belski daefca44b5 updated NEWS 2014-08-30 04:06:00 +02:00
Anatol Belski c301467f9b Fixed bug #67731 finfo::file() returns invalid mime type for binary files 2014-08-30 04:04:42 +02:00
Lior Kaplan 13b45a36f0 Add missing CVE IDs for 5.6.0 2014-08-29 11:42:12 +03:00
Lior Kaplan 210e35a2fa Align entiries format to "Fixed bug #..." 2014-08-29 11:42:12 +03:00
Lior Kaplan 49d6472f9f Use #66356 instead of #66714, as the latter is only a regression fix from the former. 2014-08-29 11:42:12 +03:00
Lior Kaplan cd38d72eee Add an entry for bug#66060 (fixed in 5.5.8) 2014-08-29 11:42:12 +03:00
Stanislav Malyshev 08c63e2a56 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fix NEWS for fcgi fix merge
  restore FPM compatibility with mod_fastcgi broken since #694 / 67541, fixes bug 67606
2014-08-28 23:12:41 -07:00
Stanislav Malyshev e55c641792 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  fix NEWS for fcgi fix merge
  restore FPM compatibility with mod_fastcgi broken since #694 / 67541, fixes bug 67606
2014-08-28 23:11:55 -07:00
Stanislav Malyshev b206b0e29d fix NEWS for fcgi fix merge 2014-08-28 23:10:32 -07:00
David Zuelke ee275e34c8 restore FPM compatibility with mod_fastcgi broken since #694 / 67541, fixes bug 67606 2014-08-28 23:06:00 -07:00
Lior Kaplan a8b97086d7 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  config.guess: add ppc64le / ppcle support by Anton Blanchard <anton@samba.org>
  libtool: powerpc*le-linux support by Alan Modra <amodra@bigpond.net.au>
2014-08-28 00:48:28 +03:00
Lior Kaplan b38ca3adee config.guess: add ppc64le / ppcle support by Anton Blanchard <anton@samba.org>
Based on http://git.savannah.gnu.org/cgit/config.git/commit/?id=29900d3b
2014-08-28 00:44:31 +03:00
Lior Kaplan 302ccc195b libtool: powerpc*le-linux support by Alan Modra <amodra@bigpond.net.au>
Patch created using the following changes in libtool:
http://git.savannah.gnu.org/cgit/libtool.git/commit/?id=75ffb257
http://git.savannah.gnu.org/cgit/libtool.git/commit/?id=056889b8
http://git.savannah.gnu.org/cgit/libtool.git/commit/?id=bd998a7e
http://git.savannah.gnu.org/cgit/libtool.git/commit/?id=429d40a0
http://git.savannah.gnu.org/cgit/libtool.git/commit/?id=8a8dfaec
2014-08-28 00:37:01 +03:00
Nikita Popov fc5f931663 Fix bug #67917 (gmp compound assignment operator leak) 2014-08-27 22:16:20 +02:00
Chris Wright db03216e62 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fix stream_select() issue with OpenSSL buffer
2014-08-27 16:06:28 +01:00
Chris Wright 30a73658c6 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fix stream_select() issue with OpenSSL buffer

Conflicts:
	ext/openssl/xp_ssl.c
2014-08-27 16:01:18 +01:00
Chris Wright 32be79dcfa Fix stream_select() issue with OpenSSL buffer
Ensure data from OpenSSL internal buffer has been
transfered to PHP stream buffer before a select()
emulation operation is performed

Addresses bug #65137
https://bugs.php.net/bug.php?id=65137

Conflicts:
	ext/openssl/xp_ssl.c
2014-08-27 13:25:50 +01:00
Anatol Belski 4d667eeaf3 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fixed DBG_INF macro name
2014-08-27 12:11:35 +02:00
Anatol Belski 7fac56e072 fixed DBG_INF macro name 2014-08-27 12:10:35 +02:00
Julien Pauli 1d6e9e8fb7 reworked NEWS for 5.6.0GA 2014-08-27 10:47:44 +02:00
Ferenc Kovacs f39ff29366 fix the NEWS 2014-08-27 04:51:24 +02:00
Ferenc Kovacs bd3e758cf8 add the NEWS entries from the last stable release 2014-08-27 04:23:55 +02:00
Ferenc Kovacs 7ec03b481a almost forgot to bump this 2014-08-27 04:18:23 +02:00
Ferenc Kovacs b165be9ae1 from now on, this should be 5.6.1-dev 2014-08-27 04:14:23 +02:00
Ferenc Kovacs f7b7c14594 update NEWS to reflect what makes into 5.6.0 final 2014-08-27 04:07:37 +02:00
Ferenc Kovacs 86b2d7b523 remove the -dev suffix from the Zend version 2014-08-27 03:52:46 +02:00
Ferenc Kovacs e0a177d676 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  update the GIT-RULES with the 5.6 and the release branches
2014-08-27 00:47:57 +02:00
Ferenc Kovacs 1e1b7c74fb Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  update the GIT-RULES with the 5.6 and the release branches
2014-08-27 00:47:37 +02:00
Ferenc Kovacs 52f35b984c update the GIT-RULES with the 5.6 and the release branches 2014-08-27 00:47:09 +02:00
Ferenc Kovacs dbe8c37476 better heading for UPGRADING.INTERNALS 2014-08-26 00:31:36 +02:00
Daniel Lowrey ffab52ad7d Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Update NEWS
2014-08-25 19:50:02 +02:00
Daniel Lowrey f463523cda Update NEWS 2014-08-25 19:47:35 +02:00
Daniel Lowrey 546a32e2b3 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Bug #67850: Build when OpenSSL compiled without SSLv3 support

Conflicts:
	ext/openssl/xp_ssl.c
2014-08-25 18:16:38 +02:00
Daniel Lowrey 640214701c Bug #67850: Build when OpenSSL compiled without SSLv3 support 2014-08-25 17:28:09 +02:00
Lior Kaplan 6e87b01e95 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Bug #67730: Add tests by Ryan Mauger <ryan@rmauger.co.uk>
2014-08-25 00:30:40 +03:00
Lior Kaplan c8b3bce407 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Bug #67730: Add tests by Ryan Mauger <ryan@rmauger.co.uk>
2014-08-25 00:30:01 +03:00
Lior Kaplan bda1cc6946 Bug #67730: Add tests by Ryan Mauger <ryan@rmauger.co.uk> 2014-08-25 00:29:05 +03:00
Ferenc Kovacs 86966a092b Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  this test depends on the simplexml ext, not just on xml
2014-08-24 00:09:31 +02:00
Ferenc Kovacs a90d05a430 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  this test depends on the simplexml ext, not just on xml
2014-08-24 00:09:00 +02:00
Ferenc Kovacs cb41a7bad1 this test depends on the simplexml ext, not just on xml 2014-08-24 00:08:09 +02:00
Keyur Govande 437612f656 Only destruct if EG(active) in zend_shutdown(). (bug #65463, #66036) 2014-08-23 14:17:37 +00:00
Tjerk Meesters ce9bdae33f Fixed #67694: Regression in session_regenerate_id() 2014-08-23 09:18:02 +08:00
Michael Wallner 3b82c4e520 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fix bug #67865
  updated NEWS to fit last release
  NEWS
  Fix bug #67878 program_prefix not honoured in man pages
2014-08-21 22:45:33 +02:00
Michael Wallner c4fb183b9f Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  fix bug #67865
2014-08-21 22:43:25 +02:00
Michael Wallner 54fbbded37 fix bug #67865 2014-08-21 22:41:36 +02:00
Julien Pauli dbbf1c2a3c updated NEWS to fit last release 2014-08-21 11:34:38 +02:00
Remi Collet 76c2a9f4f4 NEWS 2014-08-21 09:14:39 +02:00
Remi Collet e02616866f Fix bug #67878 program_prefix not honoured in man pages
- add @program_prefix@ in php, phpize and php-config man pages
- set date to 2014
- fix "SEE ALSO" alignment
2014-08-21 09:14:38 +02:00
Remi Collet 43ed561222 NEWS 2014-08-21 09:14:16 +02:00
Remi Collet e9166fec62 Fix bug #67878 program_prefix not honoured in man pages
- add @program_prefix@ in php, phpize and php-config man pages
- set date to 2014
- fix "SEE ALSO" alignment
2014-08-21 09:14:16 +02:00
Anatol Belski d3ca974ff5 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  avoid clash when stdint.h was included after win32/php_stdint.h
2014-08-21 09:09:29 +02:00
Anatol Belski 713e9a7eaa avoid clash when stdint.h was included after win32/php_stdint.h 2014-08-21 09:08:44 +02:00
Stanislav Malyshev 89d3a356d1 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fix test
2014-08-20 14:44:33 -07:00
Stanislav Malyshev 6da2a977fc fix test 2014-08-20 14:44:25 -07:00
Stanislav Malyshev 2dfabd8b51 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fix test
2014-08-20 14:43:22 -07:00
Stanislav Malyshev 6424bf659d fix test 2014-08-20 14:42:48 -07:00
Remi Collet 42e1df9b01 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  NEWS
2014-08-20 15:17:20 +02:00
Remi Collet 825ddbb3c6 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  NEWS
2014-08-20 15:17:05 +02:00
Remi Collet 9185cfd539 NEWS 2014-08-20 15:16:53 +02:00
Remi Collet f4120e53c8 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fixed variable corruption under win x64
2014-08-20 15:10:54 +02:00
Remi Collet 6d19358ae0 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  fixed variable corruption under win x64
2014-08-20 15:10:02 +02:00
Anatol Belski 20941b71aa fixed variable corruption under win x64 2014-08-20 15:08:52 +02:00
Lior Kaplan 96f812e411 Add NEWS entry for bug #67730 2014-08-20 01:34:57 +03:00
Lior Kaplan ac0c864c63 Add CVE ID for bug #67539 2014-08-20 01:18:15 +03:00
Lior Kaplan 6aa7466492 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Add NEWS entry for bug #67492
  Add NEWS entry for bug #67730
  Add NEWS entry for bug #67730
  Add CVE ID for bug #67539
2014-08-20 01:16:04 +03:00
Lior Kaplan d382d6f3dc Add NEWS entry for bug #67492
Included in 5.5.14 with commit d9c5a1d
2014-08-20 01:10:38 +03:00
Lior Kaplan 9360b6eeee Add NEWS entry for bug #67730 2014-08-20 01:05:22 +03:00
Lior Kaplan aa6dc6c108 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Add NEWS entry for bug #67730
  Add CVE ID for bug #67539
2014-08-20 01:01:23 +03:00
Lior Kaplan 276bead9c4 Add NEWS entry for bug #67730
Included in 5.4.32 with commit 706aefb
2014-08-20 00:54:19 +03:00
Lior Kaplan 359bc0ee2f Add CVE ID for bug #67539 2014-08-20 00:51:37 +03:00
Sara Golemon a309dda777 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Switch use of strtok() to gd_strtok_r()
2014-08-19 13:22:14 -07:00
Sara Golemon ac4569621d Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Switch use of strtok() to gd_strtok_r()

Conflicts:
	NEWS
2014-08-19 13:17:56 -07:00
Sara Golemon cbe1597b74 Switch use of strtok() to gd_strtok_r()
strtok() is not thread safe, so this will potentially break in
very bad ways if used in ZTS mode.

I'm not sure why gd_strtok_r() exists since it seems to do the
same thing as strtok_r(), but I'll assume it's a portability
decision and do as the Romans do.
2014-08-19 13:16:44 -07:00
Stanislav Malyshev fae17a00f5 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  5.4.32
  fix potentially missing NUL termination
  Fix bug #67730 - Null byte injection possible with imagexxx functions
  Fixed bug #67717 - segfault in dns_get_record
  Fix bug #67716 - Segfault in cdf.c
  5.4.32 RC1
2014-08-19 01:34:25 -07:00
Stanislav Malyshev b278be894f Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  5.4.32
  fix potentially missing NUL termination
  Fix bug #67730 - Null byte injection possible with imagexxx functions
  Fixed bug #67717 - segfault in dns_get_record
  Fix bug #67716 - Segfault in cdf.c
  5.4.32 RC1
2014-08-19 01:34:09 -07:00
Stanislav Malyshev 5a7039035c Merge tag 'PHP-5.4.32' into PHP-5.4
5.4.32

* tag 'PHP-5.4.32':
  5.4.32
  fix potentially missing NUL termination
  Fix bug #67730 - Null byte injection possible with imagexxx functions
  Fixed bug #67717 - segfault in dns_get_record
  Fix bug #67716 - Segfault in cdf.c
  5.4.32 RC1

Conflicts:
	configure.in
	main/php_version.h
2014-08-19 01:33:45 -07:00
Stanislav Malyshev eb2360602e 5.4.32 2014-08-19 00:40:27 -07:00
Remi Collet cdd987b16c NEWS 2014-08-19 08:41:42 +02:00
Remi Collet 230804b08d Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  NEWS
  NEWS
  Fixed Sec Bug #67717 segfault in dns_get_record CVE-2014-3597
2014-08-19 08:41:14 +02:00
Remi Collet 335d89ec4d NEWS 2014-08-19 08:40:58 +02:00
Remi Collet 5e9e0a2c74 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  NEWS
  Fixed Sec Bug #67717 segfault in dns_get_record CVE-2014-3597
2014-08-19 08:40:30 +02:00
Remi Collet 88c48a4b95 NEWS 2014-08-19 08:40:18 +02:00
Remi Collet 2fefae4771 Fixed Sec Bug #67717 segfault in dns_get_record CVE-2014-3597
Incomplete fix for CVE-2014-4049

Check possible buffer overflow
- pass real buffer end to dn_expand calls
- check buffer len before each read
2014-08-19 08:33:49 +02:00
Stanislav Malyshev 2b10db8e10 fix potentially missing NUL termination 2014-08-18 23:04:24 -07:00
Stanislav Malyshev 706aefb781 Fix bug #67730 - Null byte injection possible with imagexxx functions 2014-08-18 22:49:10 -07:00
Stanislav Malyshev 529da0f74c Fixed bug #67717 - segfault in dns_get_record 2014-08-18 22:37:25 -07:00
Derick Rethans 77cc6aabb7 Merge branch 'PHP-5.5' into PHP-5.6 2014-08-18 20:27:44 +01:00
Derick Rethans 299d8f339f Merge branch 'datetimebugs' into PHP-5.5 2014-08-18 20:27:33 +01:00
Derick Rethans 05d1612e16 BFN. 2014-08-18 18:46:56 +01:00
Derick Rethans 36d05d75c8 Fixed bug #67109: First uppercase letter breaks date string parsing. 2014-08-18 18:41:50 +01:00
Derick Rethans 2b9af967fb Fixed bug #66985: Some timezones are no longer valid in PHP 5.5.10. 2014-08-18 18:41:50 +01:00
Ferenc Kovacs d07f49118a improve the grammar for my recent UPGRADING note 2014-08-18 18:47:07 +02:00
Ferenc Kovacs 003c2c1005 mention the changes regarding ReflectionClass::newInstanceWithoutConstructor in UPGRADING
see the discussion on the mailing list and in the pull request for details:
https://github.com/php/php-src/pull/733
2014-08-18 16:59:03 +02:00
Lior Kaplan f1d0e50ea8 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Correct typo in comments: 'initialized'
2014-08-17 21:34:03 +03:00
Lior Kaplan fac08a960b Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Correct typo in comments: 'initialized'
2014-08-17 21:33:41 +03:00
Lior Kaplan 1504f7d630 Correct typo in comments: 'initialized' 2014-08-17 21:32:53 +03:00
Lior Kaplan 56d02d564e Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  typofixes
2014-08-17 15:51:15 +03:00
Lior Kaplan be2128c805 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  typofixes
2014-08-17 15:48:22 +03:00
Veres Lajos 3f42f2f5d1 typofixes 2014-08-17 15:44:02 +03:00
Keyur Govande c6d9bf2946 Update NEWS 2014-08-15 23:49:07 +00:00
Keyur Govande 032dee4982 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Update NEWS
  Fix another failing test
  Add NEWS
  Fix failing tests
  Patch for bug #67839 (mysqli does not handle 4-byte floats correctly)

Conflicts:
	ext/mysqli/tests/mysqli_change_user.phpt
2014-08-15 23:47:06 +00:00
Keyur Govande 6279246d2c Update NEWS 2014-08-15 23:38:14 +00:00
Keyur Govande 48dc203408 Fix another failing test 2014-08-15 23:26:21 +00:00
Keyur Govande 7c4b5d9187 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Add NEWS
  Fix failing tests
  Patch for bug #67839 (mysqli does not handle 4-byte floats correctly)

Conflicts:
	ext/mysqli/tests/table.inc
2014-08-15 23:13:36 +00:00
Keyur Govande 0407bdf252 Add NEWS 2014-08-15 23:08:29 +00:00
Keyur Govande 7bfe9bf951 Merge branch 'pull-request/772' into PHP-5.4
* pull-request/772:
  Fix failing tests
  Patch for bug #67839 (mysqli does not handle 4-byte floats correctly)

Before the patch, a value of 9.99 in a FLOAT column came out of mysqli
as 9.9998998641968. This is because it would naively cast a 4-byte float
into PHP's internal 8-byte double.
To fix this, with GCC we use the built-in decimal support to "up-convert"
the 4-byte float to a 8-byte double.
When that is not available, we fall back to converting the float
to a string and then converting the string to a double. This mimics
what MySQL does.
2014-08-15 23:06:55 +00:00
Stanislav Malyshev 3e6cfeed8f add NEWS for 5.6 too 2014-08-14 18:16:33 -07:00
Remi Collet 7ba1409a1a Fix bug #67716 - Segfault in cdf.c 2014-08-14 17:44:19 -07:00
Stanislav Malyshev 23122ba69c Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fix bug #67716 - Segfault in cdf.c
  Fix bug #67716 - Segfault in cdf.c
2014-08-14 17:22:06 -07:00
Stanislav Malyshev 59c2477bc3 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fix bug #67716 - Segfault in cdf.c
2014-08-14 17:21:37 -07:00
Stanislav Malyshev 3468f03b6f Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fix bug #67716 - Segfault in cdf.c
2014-08-14 17:21:29 -07:00
Remi Collet 35f32637b0 Fix bug #67716 - Segfault in cdf.c 2014-08-14 17:21:20 -07:00
Remi Collet 49387b31cf Fix bug #67716 - Segfault in cdf.c 2014-08-14 17:19:03 -07:00
Stanislav Malyshev ed7ab762de Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fix test
2014-08-14 17:08:37 -07:00
Stanislav Malyshev ff4cf1a838 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  fix test
2014-08-14 17:07:45 -07:00
Stanislav Malyshev eab42649ab fix test 2014-08-14 17:07:28 -07:00
Stanislav Malyshev 41fccab023 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  split the glob() test to test different basedir
  fixed glob() edge case on windows, ref bug #47358
  - fix bug #47358, glob returns error, should be empty array()
2014-08-14 17:05:12 -07:00
Stanislav Malyshev 008330e5b3 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  split the glob() test to test different basedir
2014-08-14 17:05:03 -07:00
Anatol Belski b7cd099ae0 split the glob() test to test different basedir 2014-08-14 17:04:51 -07:00
Stanislav Malyshev 4185633207 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  fixed glob() edge case on windows, ref bug #47358
  - fix bug #47358, glob returns error, should be empty array()
2014-08-14 17:00:36 -07:00
Anatol Belski ad492ca932 fixed glob() edge case on windows, ref bug #47358 2014-08-14 16:58:16 -07:00
Pierre Joye 481c4715d4 - fix bug #47358, glob returns error, should be empty array()
Conflicts:
	ext/standard/dir.c
2014-08-14 16:56:22 -07:00
Keyur Govande 4e2c01617f Fix failing tests 2014-08-14 18:20:26 +00:00
Keyur Govande c044164a96 Patch for bug #67839 (mysqli does not handle 4-byte floats correctly)
Before the patch, a value of 9.99 in a FLOAT column came out of mysqli
as 9.9998998641968. This is because it would naively cast a 4-byte float
into PHP's internal 8-byte double.
To fix this, with GCC we use the built-in decimal support to "up-convert"
the 4-byte float to a 8-byte double.
When that is not available, we fall back to converting the float
to a string and then converting the string to a double. This mimics
what MySQL does.
2014-08-14 18:19:56 +00:00
Johannes Schlüter a68f63156c Merge branch 'PHP-5.5' into PHP-5.6 2014-08-14 17:25:22 +02:00
Johannes Schlüter d1dd71454d Merge branch 'PHP-5.4' into PHP-5.5 2014-08-14 17:22:25 +02:00
Johannes Schlüter aeb633543b Merge branch 'PHP-5.3' into PHP-5.4 2014-08-14 17:13:44 +02:00
Johannes Schlüter 7311087cf0 Update Git rules 2014-08-14 17:08:02 +02:00
Johannes Schlüter 1355ea60cc Back to -dev (with EOL notice in NEWS) 2014-08-14 17:05:20 +02:00
Keyur Govande 5e338836ff Fix typo from commit 32314f6b6 2014-08-14 01:14:11 +00:00
Keyur Govande 32314f6b67 Fix destruction order in zend_shutdown (bug #65463, #66036)
If Apache or a similar SAPI receives a signal during PHP processing
it calls zend_shutdown() without calling shutdown_executor().
	#65463: If a module like Gearman or Memcached is loaded,
in the unfixed version it is unloaded by zend_destroy_modules() before the
CG(CLASS_TABLE) is destructed. When CG(CLASS_TABLE) is destructed,
any pointers to methods (specifically around destruction) in the unloaded
module's .so are now dangling and the process segfaults.
	#66036: Any subclasses of an internal class like ArrayObject need
to be destructed in order: subclass first and then the internal class. In the
unfixed version zend_shutdown() clears the CG(CLASS_TABLE) from the head
of the list onwards, so internal classes are destructed first and user-defined
classes last. Internal classes are alloc/deallocated with malloc/free while
user-defined classes with emalloc/efree. If there's shared data between them
then efree() could be called instead of free() leading to a seg-fault.
2014-08-14 00:55:14 +00:00
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
Tjerk Meesters 7fbc99e390 Some changes were lost in the merge commit of #66091 2014-08-13 20:57:10 +08:00
Tjerk Meesters e4905b38b7 Updated NEWS for #66091 2014-08-13 20:24:43 +08:00
Tjerk Meesters 4b85f1d46a Fixed #66091 2014-08-13 20:24:43 +08:00
Stanislav Malyshev fd28010e20 5.4.32 RC1 2014-08-05 21:03:35 -07: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
157 changed files with 17316 additions and 6495 deletions

No files matched your search

+9668 -533
View File
File diff suppressed because it is too large. Load diff
+8 -4
View File
@@ -45,15 +45,16 @@ Currently we have the following branches in use::
master The active development branch.
PHP-5.6 Is used to release the PHP 5.6.x series. This is a current
stable version and is open for bugfixes only.
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.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.3 This branch is closed.
PHP-5.2 This branch is closed.
@@ -61,9 +62,12 @@ Currently we have the following branches in use::
PHP-4.4 This branch is closed.
PHP-X.Y.Z These branches are used for the release managers for tagging
the releases, hence they are closed to the general public.
The next few rules are more of a technical nature::
1. All changes should first go to the lowest branch (i.e. 5.3) and then
1. All changes should first go to the lowest branch (i.e. 5.4) and then
get merged up to all other branches. If a change is not needed for
later branches (i.e. fixes for features which where dropped from later
branches) an empty merge should be done.
+17
View File
@@ -232,6 +232,13 @@ PHP 5.6 UPGRADE NOTES
crypto method from the context is used as a fallback if no crypto method is
specified at call-time.
- Reflection:
ReflectionClass::newInstanceWithoutConstructor previously didn't allow the
instantiation of any internal class which used custom object storage
(overriding the default create_object handler), this was changed to only
reject the instantiation of such classes if the class is also marked as
final.
- XMLReader:
XMLReader::getAttributeNs and XMLReader::getAttributeNo now return NULL if
the attribute could not be found, just like XMLReader::getAttribute.
@@ -249,12 +256,19 @@ PHP 5.6 UPGRADE NOTES
Manipulated serialization strings for objects implementing Serializable by
replacing "C:" with "O:" at the start will now produce an error.
- parse_ini_file():
- parse_ini_string():
Added scanner mode INI_SCANNER_TYPED to yield typed .ini values.
For PHP >= 5.6.1
========================================
6. New Functions
========================================
- GMP:
Added gmp_root($a, $nth) and gmp_rootrem($a, $nth) for calculating nth roots.
Added gmp_import($data, $word_size = 1, $options = GMP_MSW_FIRST | GMP_NATIVE_ENDIAN) in PHP 5.6.1.
Added gmp_export($gmpnumber, $word_size = 1, $options = GMP_MSW_FIRST | GMP_NATIVE_ENDIAN) in PHP 5.6.1.
- Hash
Added hash_equals($known_string, $user_string)
@@ -362,6 +376,9 @@ PHP 5.6 UPGRADE NOTES
- Added LISTEN/NOTIFY support via PDO::pgsqlGetNotify / PDO::pgsqlGetPid()
as described in https://bugs.php.net/bug.php?id=42614.
- DOM:
- DOMNode::textContent is now a writeable property. (>= 5.6.1)
========================================
10. New Global Constants
========================================
+1 -1
View File
@@ -1,6 +1,6 @@
$Id$
UPGRADE NOTES - PHP X.Y
PHP 5.6 INTERNALS UPGRADE NOTES
1. Internal API changes
a. Addition of do_operation and compare object handlers
+27
View File
@@ -0,0 +1,27 @@
--TEST--
Bug #67938: Segfault when extending interface method with variadic
--FILE--
<?php
interface TestInterface {
public function foo();
public function bar(array $bar);
}
class Test implements TestInterface {
public function foo(...$args) {
echo __METHOD__, "\n";
}
public function bar(array $bar, ...$args) {
echo __METHOD__, "\n";
}
}
$obj = new Test;
$obj->foo();
$obj->bar([]);
?>
--EXPECT--
Test::foo
Test::bar
+16
View File
@@ -0,0 +1,16 @@
--TEST--
Bug #67985 - Last used array index not copied to new array at assignment
--FILE--
<?php
$a = ['zero', 'one', 'two'];
unset($a[2]);
$b = $a;
$a[] = 'three';
$b[] = 'three';
var_dump($a === $b);
?>
--EXPECT--
bool(true)
+14
View File
@@ -822,6 +822,20 @@ void zend_shutdown(TSRMLS_D) /* {{{ */
zend_shutdown_timeout_thread();
#endif
zend_destroy_rsrc_list(&EG(persistent_list) TSRMLS_CC);
if (EG(active))
{
/*
* The order of destruction is important here.
* See bugs #65463 and 66036.
*/
zend_hash_reverse_apply(GLOBAL_FUNCTION_TABLE, (apply_func_t) zend_cleanup_function_data_full TSRMLS_CC);
zend_hash_reverse_apply(GLOBAL_CLASS_TABLE, (apply_func_t) zend_cleanup_user_class_data TSRMLS_CC);
zend_cleanup_internal_classes(TSRMLS_C);
zend_hash_reverse_apply(GLOBAL_FUNCTION_TABLE, (apply_func_t) clean_non_persistent_function_full TSRMLS_CC);
zend_hash_reverse_apply(GLOBAL_CLASS_TABLE, (apply_func_t) clean_non_persistent_class_full TSRMLS_CC);
}
zend_destroy_modules();
virtual_cwd_deactivate(TSRMLS_C);
+1 -1
View File
@@ -22,7 +22,7 @@
#ifndef ZEND_H
#define ZEND_H
#define ZEND_VERSION "2.6.0-dev"
#define ZEND_VERSION "2.6.0"
#define ZEND_ENGINE_2
+1 -1
View File
@@ -3258,7 +3258,7 @@ static zend_bool zend_do_perform_implementation_check(const zend_function *fe, c
* go through all the parameters of the function and not just those present in the
* prototype. */
num_args = proto->common.num_args;
if ((fe->common.fn_flags & ZEND_ACC_VARIADIC)
if ((proto->common.fn_flags & ZEND_ACC_VARIADIC)
&& fe->common.num_args > proto->common.num_args) {
num_args = fe->common.num_args;
}
+2
View File
@@ -686,6 +686,8 @@ ZEND_API void zend_cleanup_internal_class_data(zend_class_entry *ce TSRMLS_DC);
ZEND_API void zend_cleanup_internal_classes(TSRMLS_D);
ZEND_API int zend_cleanup_function_data(zend_function *function TSRMLS_DC);
ZEND_API int zend_cleanup_function_data_full(zend_function *function TSRMLS_DC);
ZEND_API int clean_non_persistent_function_full(zend_function *function TSRMLS_DC);
ZEND_API int clean_non_persistent_class_full(zend_class_entry **ce TSRMLS_DC);
ZEND_API void destroy_zend_function(zend_function *function TSRMLS_DC);
ZEND_API void zend_function_dtor(zend_function *function);
+2 -2
View File
@@ -109,7 +109,7 @@ static int clean_non_persistent_function(zend_function *function TSRMLS_DC) /* {
}
/* }}} */
static int clean_non_persistent_function_full(zend_function *function TSRMLS_DC) /* {{{ */
ZEND_API int clean_non_persistent_function_full(zend_function *function TSRMLS_DC) /* {{{ */
{
return (function->type == ZEND_INTERNAL_FUNCTION) ? ZEND_HASH_APPLY_KEEP : ZEND_HASH_APPLY_REMOVE;
}
@@ -121,7 +121,7 @@ static int clean_non_persistent_class(zend_class_entry **ce TSRMLS_DC) /* {{{ */
}
/* }}} */
static int clean_non_persistent_class_full(zend_class_entry **ce TSRMLS_DC) /* {{{ */
ZEND_API int clean_non_persistent_class_full(zend_class_entry **ce TSRMLS_DC) /* {{{ */
{
return ((*ce)->type == ZEND_INTERNAL_CLASS) ? ZEND_HASH_APPLY_KEEP : ZEND_HASH_APPLY_REMOVE;
}
+1 -1
View File
@@ -283,7 +283,7 @@ struct _zend_ini_scanner_globals {
char *filename;
int lineno;
/* Modes are: ZEND_INI_SCANNER_NORMAL, ZEND_INI_SCANNER_RAW */
/* Modes are: ZEND_INI_SCANNER_NORMAL, ZEND_INI_SCANNER_RAW, ZEND_INI_SCANNER_TYPED */
int scanner_mode;
};
+4 -2
View File
@@ -265,6 +265,7 @@ ZEND_API int zend_parse_ini_string(char *str, zend_bool unbuffered_errors, int s
%token TC_QUOTED_STRING
%token BOOL_TRUE
%token BOOL_FALSE
%token NULL_NULL
%token END_OF_LINE
%token '=' ':' ',' '.' '"' '\'' '^' '+' '-' '/' '*' '%' '$' '~' '<' '>' '?' '@' '{' '}'
%left '|' '&' '^'
@@ -291,7 +292,7 @@ statement:
#endif
ZEND_INI_PARSER_CB(&$1, &$3, NULL, ZEND_INI_PARSER_ENTRY, ZEND_INI_PARSER_ARG TSRMLS_CC);
free(Z_STRVAL($1));
free(Z_STRVAL($3));
zval_internal_dtor(&$3);
}
| TC_OFFSET option_offset ']' '=' string_or_value {
#if DEBUG_CFG_PARSER
@@ -300,7 +301,7 @@ statement:
ZEND_INI_PARSER_CB(&$1, &$5, &$2, ZEND_INI_PARSER_POP_ENTRY, ZEND_INI_PARSER_ARG TSRMLS_CC);
free(Z_STRVAL($1));
free(Z_STRVAL($2));
free(Z_STRVAL($5));
zval_internal_dtor(&$5);
}
| TC_LABEL { ZEND_INI_PARSER_CB(&$1, NULL, NULL, ZEND_INI_PARSER_ENTRY, ZEND_INI_PARSER_ARG TSRMLS_CC); free(Z_STRVAL($1)); }
| END_OF_LINE
@@ -315,6 +316,7 @@ string_or_value:
expr { $$ = $1; }
| BOOL_TRUE { $$ = $1; }
| BOOL_FALSE { $$ = $1; }
| NULL_NULL { $$ = $1; }
| END_OF_LINE { zend_ini_init_string(&$$); }
;
+4827 -4663
View File
File diff suppressed because it is too large. Load diff
+1
View File
@@ -25,6 +25,7 @@
/* Scanner modes */
#define ZEND_INI_SCANNER_NORMAL 0 /* Normal mode. [DEFAULT] */
#define ZEND_INI_SCANNER_RAW 1 /* Raw mode. Option values are not parsed */
#define ZEND_INI_SCANNER_TYPED 2 /* Typed mode. */
BEGIN_EXTERN_C()
int zend_ini_scanner_get_lineno(TSRMLS_D);
+56 -5
View File
@@ -24,6 +24,7 @@
#include <errno.h>
#include "zend.h"
#include "zend_API.h"
#include "zend_globals.h"
#include <zend_ini_parser.h>
#include "zend_ini_scanner.h"
@@ -137,9 +138,55 @@ ZEND_API zend_ini_scanner_globals ini_scanner_globals;
Z_TYPE_P(retval) = IS_STRING; \
}
#define RETURN_TOKEN(type, str, len) { \
zend_ini_copy_value(ini_lval, str, len); \
return type; \
#define RETURN_TOKEN(type, str, len) { \
if (SCNG(scanner_mode) == ZEND_INI_SCANNER_TYPED) { \
zend_ini_copy_typed_value(ini_lval, type, str, len); \
} else { \
zend_ini_copy_value(ini_lval, str, len); \
} \
return type; \
}
static inline int convert_to_number(zval *retval, const char *str, const int str_len)
{
zend_uchar type;
int overflow;
long lval;
double dval;
if ((type = is_numeric_string_ex(str, str_len, &lval, &dval, 0, &overflow)) != 0) {
if (type == IS_LONG) {
ZVAL_LONG(retval, lval);
return SUCCESS;
} else if (type == IS_DOUBLE && !overflow) {
ZVAL_DOUBLE(retval, dval);
return SUCCESS;
}
}
return FAILURE;
}
static void zend_ini_copy_typed_value(zval *retval, const int type, const char *str, int len)
{
switch (type) {
case BOOL_FALSE:
case BOOL_TRUE:
ZVAL_BOOL(retval, type == BOOL_TRUE);
break;
case NULL_NULL:
ZVAL_NULL(retval);
break;
case TC_NUMBER:
if (convert_to_number(retval, str, len) == SUCCESS) {
break;
}
/* intentional fall-through */
default:
zend_ini_copy_value(retval, str, len);
}
}
static void _yy_push_state(int new_state TSRMLS_DC)
@@ -172,7 +219,7 @@ static void yy_scan_buffer(char *str, unsigned int len TSRMLS_DC)
static int init_ini_scanner(int scanner_mode, zend_file_handle *fh TSRMLS_DC)
{
/* Sanity check */
if (scanner_mode != ZEND_INI_SCANNER_NORMAL && scanner_mode != ZEND_INI_SCANNER_RAW) {
if (scanner_mode != ZEND_INI_SCANNER_NORMAL && scanner_mode != ZEND_INI_SCANNER_RAW && scanner_mode != ZEND_INI_SCANNER_TYPED) {
zend_error(E_WARNING, "Invalid scanner mode");
return FAILURE;
}
@@ -422,10 +469,14 @@ SECTION_VALUE_CHARS ([^$\n\r;"'\]\\]|("\\"{ANY_CHAR})|{LITERAL_DOLLAR})
RETURN_TOKEN(BOOL_TRUE, "1", 1);
}
<INITIAL,ST_VALUE>("false"|"off"|"no"|"none"|"null"){TABS_AND_SPACES}* { /* FALSE value (when used outside option value/offset this causes parse error!)*/
<INITIAL,ST_VALUE>("false"|"off"|"no"|"none"){TABS_AND_SPACES}* { /* FALSE value (when used outside option value/offset this causes parse error!)*/
RETURN_TOKEN(BOOL_FALSE, "", 0);
}
<INITIAL,ST_VALUE>("null"){TABS_AND_SPACES}* {
RETURN_TOKEN(NULL_NULL, "", 0);
}
<INITIAL>{LABEL} { /* Get option name */
/* Eat leading whitespace */
EAT_LEADING_WHITESPACE();
+1
View File
@@ -138,6 +138,7 @@ ZEND_API void _zval_copy_ctor_func(zval *zvalue ZEND_FILE_LINE_DC)
ALLOC_HASHTABLE_REL(tmp_ht);
zend_hash_init(tmp_ht, zend_hash_num_elements(original_ht), NULL, ZVAL_PTR_DTOR, 0);
zend_hash_copy(tmp_ht, original_ht, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
tmp_ht->nNextFreeElement = original_ht->nNextFreeElement;
zvalue->value.ht = tmp_ht;
}
break;
+1 -1
View File
@@ -2800,7 +2800,7 @@ AC_DEFUN([PHP_DETECT_ICC],
dnl PHP_DETECT_SUNCC
dnl Detect if the systems default compiler is suncc.
dnl We also set some usefull CFLAGS if the user didn't set any
dnl We also set some useful CFLAGS if the user didn't set any
AC_DEFUN([PHP_DETECT_SUNCC],[
SUNCC="no"
AC_MSG_CHECKING([for suncc])
+9 -3
View File
@@ -615,7 +615,7 @@ ia64-*-hpux*)
rm -rf conftest*
;;
x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
s390*-*linux*|sparc*-*linux*)
# Find out which ABI we are using.
echo 'int i;' > conftest.$ac_ext
@@ -629,7 +629,10 @@ s390*-*linux*|sparc*-*linux*)
x86_64-*linux*)
LD="${LD-ld} -m elf_i386"
;;
ppc64-*linux*|powerpc64-*linux*)
powerpc64le-*linux*)
LD="${LD-ld} -m elf32lppclinux"
;;
powerpc64-*linux*)
LD="${LD-ld} -m elf32ppclinux"
;;
s390x-*linux*)
@@ -648,7 +651,10 @@ s390*-*linux*|sparc*-*linux*)
x86_64-*linux*)
LD="${LD-ld} -m elf_x86_64"
;;
ppc*-*linux*|powerpc*-*linux*)
powerpcle-*linux*)
LD="${LD-ld} -m elf64lppc"
;;
powerpc-*linux*)
LD="${LD-ld} -m elf64ppc"
;;
s390*-*linux*)
+6
View File
@@ -982,6 +982,12 @@ EOF
ppc:Linux:*:*)
echo powerpc-unknown-linux-gnu
exit ;;
ppc64le:Linux:*:*)
echo powerpc64le-unknown-linux-gnu
exit ;;
ppcle:Linux:*:*)
echo powerpcle-unknown-linux-gnu
exit ;;
s390:Linux:*:* | s390x:Linux:*:*)
echo ${UNAME_MACHINE}-ibm-linux
exit ;;
+24 -10
View File
@@ -119,8 +119,8 @@ int zend_sprintf(char *buffer, const char *format, ...);
PHP_MAJOR_VERSION=5
PHP_MINOR_VERSION=6
PHP_RELEASE_VERSION=0
PHP_EXTRA_VERSION="-dev"
PHP_RELEASE_VERSION=2
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`
@@ -787,7 +787,12 @@ 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 1.9 1.10"
dnl min: 1.5 (i.e. 105, major * 100 + minor for easier comparison)
ltp_version_min="105"
dnl non-working versions, e.g. "1.8 1.18";
dnl remove "none" when introducing the first incompatible LTP version an
dnl separate any following additions by spaces
ltp_version_exclude="1.8"
AC_CHECK_PROG(LTP, lcov, lcov)
AC_CHECK_PROG(LTP_GENHTML, genhtml, genhtml)
@@ -797,21 +802,30 @@ if test "$PHP_GCOV" = "yes"; then
if test "$LTP"; then
AC_CACHE_CHECK([for ltp version], php_cv_ltp_version, [
php_cv_ltp_version=invalid
ltp_version=`$LTP -v 2>/dev/null | $SED -e 's/^.* //'`
for ltp_check_version in $ltp_version_list; do
if test "$ltp_version" = "$ltp_check_version"; then
php_cv_ltp_version="$ltp_check_version (ok)"
ltp_version_vars=`$LTP -v 2>/dev/null | $SED -e 's/^.* //' -e 's/\./ /g' | tr -d a-z`
if test -n "$ltp_version_vars"; then
set $ltp_version_vars
ltp_version="${1}.${2}"
ltp_version_num="`expr ${1} \* 100 + ${2}`"
if test $ltp_version_num -ge $ltp_version_min; then
php_cv_ltp_version="$ltp_version (ok)"
for ltp_check_version in $ltp_version_exclude; do
if test "$ltp_version" = "$ltp_check_version"; then
php_cv_ltp_version=invalid
break
fi
done
fi
done
fi
])
else
ltp_msg="To enable code coverage reporting you must have one of the following LTP versions installed: $ltp_version_list"
ltp_msg="To enable code coverage reporting you must have LTP installed"
AC_MSG_ERROR([$ltp_msg])
fi
case $php_cv_ltp_version in
""|invalid[)]
ltp_msg="You must have one of the following versions of LTP: $ltp_version_list (found: $ltp_version)."
ltp_msg="This LTP version is not supported (found: $ltp_version, min: $ltp_version_min, excluded: $ltp_version_exclude)."
AC_MSG_ERROR([$ltp_msg])
LTP="exit 0;"
;;
+5
View File
@@ -169,6 +169,11 @@ static int php_curl_option_str(php_curl *ch, long option, const char *str, const
{
CURLcode error = CURLE_OK;
if (strlen(str) != len) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Curl option contains invalid characters (\\0)");
return FAILURE;
}
#if LIBCURL_VERSION_NUM >= 0x071100
if (make_copy) {
#endif
+18
View File
@@ -0,0 +1,18 @@
--TEST--
Bug #68089 (NULL byte injection - cURL lib)
--SKIPIF--
<?php
include 'skipif.inc';
?>
--FILE--
<?php
$url = "file:///etc/passwd\0http://google.com";
$ch = curl_init();
var_dump(curl_setopt($ch, CURLOPT_URL, $url));
?>
Done
--EXPECTF--
Warning: curl_setopt(): Curl option contains invalid characters (\0) in %s/bug68089.php on line 4
bool(false)
Done
+110 -136
View File
@@ -1,4 +1,4 @@
/* Generated by re2c 0.13.5 on Thu Jul 31 14:33:37 2014 */
/* Generated by re2c 0.13.5 on Mon Aug 18 18:28:27 2014 */
#line 1 "ext/date/lib/parse_date.re"
/*
+----------------------------------------------------------------------+
@@ -670,7 +670,7 @@ static void timelib_set_relative(char **ptr, timelib_sll amount, int behavior, S
}
}
const static timelib_tz_lookup_table* zone_search(const char *word, long gmtoffset, int isdst)
const static timelib_tz_lookup_table* abbr_search(const char *word, long gmtoffset, int isdst)
{
int first_found = 0;
const timelib_tz_lookup_table *tp, *first_found_elem = NULL;
@@ -698,25 +698,6 @@ const static timelib_tz_lookup_table* zone_search(const char *word, long gmtoffs
return first_found_elem;
}
for (tp = timelib_timezone_lookup; tp->name; tp++) {
if (tp->full_tz_name && strcasecmp(word, tp->full_tz_name) == 0) {
if (!first_found) {
first_found = 1;
first_found_elem = tp;
if (gmtoffset == -1) {
return tp;
}
}
if (tp->gmtoffset == gmtoffset) {
return tp;
}
}
}
if (first_found) {
return first_found_elem;
}
/* Still didn't find anything, let's find the zone solely based on
* offset/isdst then */
for (fmp = timelib_timezone_fallbackmap; fmp->name; fmp++) {
@@ -727,7 +708,7 @@ const static timelib_tz_lookup_table* zone_search(const char *word, long gmtoffs
return NULL;
}
static long timelib_lookup_zone(char **ptr, int *dst, char **tz_abbr, int *found)
static long timelib_lookup_abbr(char **ptr, int *dst, char **tz_abbr, int *found)
{
char *word;
char *begin = *ptr, *end;
@@ -741,7 +722,7 @@ static long timelib_lookup_zone(char **ptr, int *dst, char **tz_abbr, int *found
word = calloc(1, end - begin + 1);
memcpy(word, begin, end - begin);
if ((tp = zone_search(word, -1, 0))) {
if ((tp = abbr_search(word, -1, 0))) {
value = -tp->gmtoffset / 60;
*dst = tp->type;
value += tp->type * 60;
@@ -785,33 +766,26 @@ long timelib_parse_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_found
retval = timelib_parse_tz_cor(ptr);
} else {
int found = 0;
long offset;
long offset = 0;
char *tz_abbr;
t->is_localtime = 1;
offset = timelib_lookup_zone(ptr, dst, &tz_abbr, &found);
/* First, we lookup by abbreviation only */
offset = timelib_lookup_abbr(ptr, dst, &tz_abbr, &found);
if (found) {
t->zone_type = TIMELIB_ZONETYPE_ABBR;
timelib_time_tz_abbr_update(t, tz_abbr);
}
#if 0
/* If we found a TimeZone identifier, use it */
if (tz_name) {
t->tz_info = timelib_parse_tzfile(tz_name);
t->zone_type = TIMELIB_ZONETYPE_ID;
}
#endif
/* If we have a TimeZone identifier to start with, use it */
if (strstr(tz_abbr, "/") || strcmp(tz_abbr, "UTC") == 0) {
/* Otherwise, we look if we have a TimeZone identifier */
if (!found || strcmp("UTC", tz_abbr) == 0) {
if ((res = tz_wrapper(tz_abbr, tzdb)) != NULL) {
t->tz_info = res;
t->zone_type = TIMELIB_ZONETYPE_ID;
found++;
}
}
if (found && t->zone_type != TIMELIB_ZONETYPE_ID) {
timelib_time_tz_abbr_update(t, tz_abbr);
}
free(tz_abbr);
*tz_not_found = (found == 0);
retval = offset;
@@ -840,11 +814,11 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper)
std:
s->tok = cursor;
s->len = 0;
#line 966 "ext/date/lib/parse_date.re"
#line 940 "ext/date/lib/parse_date.re"
#line 848 "ext/date/lib/parse_date.c"
#line 822 "ext/date/lib/parse_date.c"
{
YYCTYPE yych;
unsigned int yyaccept = 0;
@@ -984,7 +958,7 @@ yy2:
}
yy3:
YYDEBUG(3, *YYCURSOR);
#line 1646 "ext/date/lib/parse_date.re"
#line 1620 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("tzcorrection | tz");
@@ -997,7 +971,7 @@ yy3:
TIMELIB_DEINIT;
return TIMELIB_TIMEZONE;
}
#line 1001 "ext/date/lib/parse_date.c"
#line 975 "ext/date/lib/parse_date.c"
yy4:
YYDEBUG(4, *YYCURSOR);
yych = *++YYCURSOR;
@@ -1308,12 +1282,12 @@ yy11:
if (yych <= '9') goto yy1385;
yy12:
YYDEBUG(12, *YYCURSOR);
#line 1741 "ext/date/lib/parse_date.re"
#line 1715 "ext/date/lib/parse_date.re"
{
add_error(s, "Unexpected character");
goto std;
}
#line 1317 "ext/date/lib/parse_date.c"
#line 1291 "ext/date/lib/parse_date.c"
yy13:
YYDEBUG(13, *YYCURSOR);
yych = *++YYCURSOR;
@@ -2370,11 +2344,11 @@ yy48:
if (yych <= '9') goto yy54;
yy49:
YYDEBUG(49, *YYCURSOR);
#line 1730 "ext/date/lib/parse_date.re"
#line 1704 "ext/date/lib/parse_date.re"
{
goto std;
}
#line 2378 "ext/date/lib/parse_date.c"
#line 2352 "ext/date/lib/parse_date.c"
yy50:
YYDEBUG(50, *YYCURSOR);
yych = *++YYCURSOR;
@@ -2383,12 +2357,12 @@ yy51:
YYDEBUG(51, *YYCURSOR);
++YYCURSOR;
YYDEBUG(52, *YYCURSOR);
#line 1735 "ext/date/lib/parse_date.re"
#line 1709 "ext/date/lib/parse_date.re"
{
s->pos = cursor; s->line++;
goto std;
}
#line 2392 "ext/date/lib/parse_date.c"
#line 2366 "ext/date/lib/parse_date.c"
yy53:
YYDEBUG(53, *YYCURSOR);
yych = *++YYCURSOR;
@@ -2775,7 +2749,7 @@ yy71:
if (yych == 's') goto yy73;
yy72:
YYDEBUG(72, *YYCURSOR);
#line 1714 "ext/date/lib/parse_date.re"
#line 1688 "ext/date/lib/parse_date.re"
{
timelib_ull i;
DEBUG_OUTPUT("relative");
@@ -2790,7 +2764,7 @@ yy72:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 2794 "ext/date/lib/parse_date.c"
#line 2768 "ext/date/lib/parse_date.c"
yy73:
YYDEBUG(73, *YYCURSOR);
yych = *++YYCURSOR;
@@ -3552,7 +3526,7 @@ yy165:
}
yy166:
YYDEBUG(166, *YYCURSOR);
#line 1577 "ext/date/lib/parse_date.re"
#line 1551 "ext/date/lib/parse_date.re"
{
const timelib_relunit* relunit;
DEBUG_OUTPUT("daytext");
@@ -3569,7 +3543,7 @@ yy166:
TIMELIB_DEINIT;
return TIMELIB_WEEKDAY;
}
#line 3573 "ext/date/lib/parse_date.c"
#line 3547 "ext/date/lib/parse_date.c"
yy167:
YYDEBUG(167, *YYCURSOR);
yych = *++YYCURSOR;
@@ -4089,7 +4063,7 @@ yy192:
}
yy193:
YYDEBUG(193, *YYCURSOR);
#line 1636 "ext/date/lib/parse_date.re"
#line 1610 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("monthtext");
TIMELIB_INIT;
@@ -4098,7 +4072,7 @@ yy193:
TIMELIB_DEINIT;
return TIMELIB_DATE_TEXT;
}
#line 4102 "ext/date/lib/parse_date.c"
#line 4076 "ext/date/lib/parse_date.c"
yy194:
YYDEBUG(194, *YYCURSOR);
++YYCURSOR;
@@ -4149,7 +4123,7 @@ yy197:
}
yy198:
YYDEBUG(198, *YYCURSOR);
#line 1382 "ext/date/lib/parse_date.re"
#line 1356 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("datetextual | datenoyear");
@@ -4162,7 +4136,7 @@ yy198:
TIMELIB_DEINIT;
return TIMELIB_DATE_TEXT;
}
#line 4166 "ext/date/lib/parse_date.c"
#line 4140 "ext/date/lib/parse_date.c"
yy199:
YYDEBUG(199, *YYCURSOR);
yyaccept = 6;
@@ -4431,7 +4405,7 @@ yy221:
}
yy222:
YYDEBUG(222, *YYCURSOR);
#line 1684 "ext/date/lib/parse_date.re"
#line 1658 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("dateshortwithtimeshort | dateshortwithtimelong | dateshortwithtimelongtz");
@@ -4460,7 +4434,7 @@ yy222:
TIMELIB_DEINIT;
return TIMELIB_SHORTDATE_WITH_TIME;
}
#line 4464 "ext/date/lib/parse_date.c"
#line 4438 "ext/date/lib/parse_date.c"
yy223:
YYDEBUG(223, *YYCURSOR);
yyaccept = 7;
@@ -5158,7 +5132,7 @@ yy277:
YYDEBUG(277, *YYCURSOR);
++YYCURSOR;
YYDEBUG(278, *YYCURSOR);
#line 1660 "ext/date/lib/parse_date.re"
#line 1634 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("dateshortwithtimeshort12 | dateshortwithtimelong12");
TIMELIB_INIT;
@@ -5181,7 +5155,7 @@ yy277:
TIMELIB_DEINIT;
return TIMELIB_SHORTDATE_WITH_TIME;
}
#line 5185 "ext/date/lib/parse_date.c"
#line 5159 "ext/date/lib/parse_date.c"
yy279:
YYDEBUG(279, *YYCURSOR);
yych = *++YYCURSOR;
@@ -5359,7 +5333,7 @@ yy293:
++YYCURSOR;
yy294:
YYDEBUG(294, *YYCURSOR);
#line 1354 "ext/date/lib/parse_date.re"
#line 1328 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("datenoday");
@@ -5372,7 +5346,7 @@ yy294:
TIMELIB_DEINIT;
return TIMELIB_DATE_NO_DAY;
}
#line 5376 "ext/date/lib/parse_date.c"
#line 5350 "ext/date/lib/parse_date.c"
yy295:
YYDEBUG(295, *YYCURSOR);
yych = *++YYCURSOR;
@@ -6592,7 +6566,7 @@ yy361:
if (yych <= '9') goto yy364;
yy363:
YYDEBUG(363, *YYCURSOR);
#line 1498 "ext/date/lib/parse_date.re"
#line 1472 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("pgtextshort");
@@ -6605,7 +6579,7 @@ yy363:
TIMELIB_DEINIT;
return TIMELIB_PG_TEXT;
}
#line 6609 "ext/date/lib/parse_date.c"
#line 6583 "ext/date/lib/parse_date.c"
yy364:
YYDEBUG(364, *YYCURSOR);
yych = *++YYCURSOR;
@@ -7243,7 +7217,7 @@ yy391:
}
yy392:
YYDEBUG(392, *YYCURSOR);
#line 1556 "ext/date/lib/parse_date.re"
#line 1530 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("ago");
TIMELIB_INIT;
@@ -7263,7 +7237,7 @@ yy392:
TIMELIB_DEINIT;
return TIMELIB_AGO;
}
#line 7267 "ext/date/lib/parse_date.c"
#line 7241 "ext/date/lib/parse_date.c"
yy393:
YYDEBUG(393, *YYCURSOR);
yyaccept = 5;
@@ -9013,7 +8987,7 @@ yy453:
++YYCURSOR;
yy454:
YYDEBUG(454, *YYCURSOR);
#line 1259 "ext/date/lib/parse_date.re"
#line 1233 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("iso8601date4 | iso8601date2 | iso8601dateslash | dateslash");
TIMELIB_INIT;
@@ -9024,7 +8998,7 @@ yy454:
TIMELIB_DEINIT;
return TIMELIB_ISO_DATE;
}
#line 9028 "ext/date/lib/parse_date.c"
#line 9002 "ext/date/lib/parse_date.c"
yy455:
YYDEBUG(455, *YYCURSOR);
yyaccept = 0;
@@ -9584,7 +9558,7 @@ yy474:
}
yy475:
YYDEBUG(475, *YYCURSOR);
#line 1396 "ext/date/lib/parse_date.re"
#line 1370 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("datenoyearrev");
TIMELIB_INIT;
@@ -9595,7 +9569,7 @@ yy475:
TIMELIB_DEINIT;
return TIMELIB_DATE_TEXT;
}
#line 9599 "ext/date/lib/parse_date.c"
#line 9573 "ext/date/lib/parse_date.c"
yy476:
YYDEBUG(476, *YYCURSOR);
yyaccept = 10;
@@ -9736,7 +9710,7 @@ yy487:
YYDEBUG(487, *YYCURSOR);
++YYCURSOR;
YYDEBUG(488, *YYCURSOR);
#line 1114 "ext/date/lib/parse_date.re"
#line 1088 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("timetiny12 | timeshort12 | timelong12");
TIMELIB_INIT;
@@ -9752,7 +9726,7 @@ yy487:
TIMELIB_DEINIT;
return TIMELIB_TIME12;
}
#line 9756 "ext/date/lib/parse_date.c"
#line 9730 "ext/date/lib/parse_date.c"
yy489:
YYDEBUG(489, *YYCURSOR);
yyaccept = 11;
@@ -9765,7 +9739,7 @@ yy489:
}
yy490:
YYDEBUG(490, *YYCURSOR);
#line 1151 "ext/date/lib/parse_date.re"
#line 1125 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("timeshort24 | timelong24 | iso8601long");
@@ -9790,7 +9764,7 @@ yy490:
TIMELIB_DEINIT;
return TIMELIB_TIME24_WITH_ZONE;
}
#line 9794 "ext/date/lib/parse_date.c"
#line 9768 "ext/date/lib/parse_date.c"
yy491:
YYDEBUG(491, *YYCURSOR);
yyaccept = 11;
@@ -10100,7 +10074,7 @@ yy522:
YYDEBUG(522, *YYCURSOR);
++YYCURSOR;
YYDEBUG(523, *YYCURSOR);
#line 1131 "ext/date/lib/parse_date.re"
#line 1105 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("mssqltime");
TIMELIB_INIT;
@@ -10119,7 +10093,7 @@ yy522:
TIMELIB_DEINIT;
return TIMELIB_TIME24_WITH_ZONE;
}
#line 10123 "ext/date/lib/parse_date.c"
#line 10097 "ext/date/lib/parse_date.c"
yy524:
YYDEBUG(524, *YYCURSOR);
yyaccept = 11;
@@ -10225,7 +10199,7 @@ yy533:
if (yych <= '9') goto yy540;
yy534:
YYDEBUG(534, *YYCURSOR);
#line 1313 "ext/date/lib/parse_date.re"
#line 1287 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("datefull");
@@ -10239,7 +10213,7 @@ yy534:
TIMELIB_DEINIT;
return TIMELIB_DATE_FULL;
}
#line 10243 "ext/date/lib/parse_date.c"
#line 10217 "ext/date/lib/parse_date.c"
yy535:
YYDEBUG(535, *YYCURSOR);
yych = *++YYCURSOR;
@@ -10976,7 +10950,7 @@ yy604:
YYDEBUG(605, *YYCURSOR);
++YYCURSOR;
YYDEBUG(606, *YYCURSOR);
#line 1328 "ext/date/lib/parse_date.re"
#line 1302 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("pointed date YYYY");
TIMELIB_INIT;
@@ -10987,7 +10961,7 @@ yy604:
TIMELIB_DEINIT;
return TIMELIB_DATE_FULL_POINTED;
}
#line 10991 "ext/date/lib/parse_date.c"
#line 10965 "ext/date/lib/parse_date.c"
yy607:
YYDEBUG(607, *YYCURSOR);
yyaccept = 11;
@@ -11023,7 +10997,7 @@ yy610:
if (yych <= '9') goto yy604;
yy611:
YYDEBUG(611, *YYCURSOR);
#line 1340 "ext/date/lib/parse_date.re"
#line 1314 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("pointed date YY");
@@ -11036,7 +11010,7 @@ yy611:
TIMELIB_DEINIT;
return TIMELIB_DATE_FULL_POINTED;
}
#line 11040 "ext/date/lib/parse_date.c"
#line 11014 "ext/date/lib/parse_date.c"
yy612:
YYDEBUG(612, *YYCURSOR);
yyaccept = 11;
@@ -11677,7 +11651,7 @@ yy655:
}
yy656:
YYDEBUG(656, *YYCURSOR);
#line 1299 "ext/date/lib/parse_date.re"
#line 1273 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("gnudateshort");
@@ -11690,7 +11664,7 @@ yy656:
TIMELIB_DEINIT;
return TIMELIB_ISO_DATE;
}
#line 11694 "ext/date/lib/parse_date.c"
#line 11668 "ext/date/lib/parse_date.c"
yy657:
YYDEBUG(657, *YYCURSOR);
yyaccept = 13;
@@ -11796,7 +11770,7 @@ yy665:
}
yy666:
YYDEBUG(666, *YYCURSOR);
#line 1243 "ext/date/lib/parse_date.re"
#line 1217 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("americanshort | american");
@@ -11811,7 +11785,7 @@ yy666:
TIMELIB_DEINIT;
return TIMELIB_AMERICAN;
}
#line 11815 "ext/date/lib/parse_date.c"
#line 11789 "ext/date/lib/parse_date.c"
yy667:
YYDEBUG(667, *YYCURSOR);
yyaccept = 14;
@@ -12044,7 +12018,7 @@ yy699:
if (yych <= ':') goto yy703;
yy700:
YYDEBUG(700, *YYCURSOR);
#line 1526 "ext/date/lib/parse_date.re"
#line 1500 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("clf");
@@ -12064,7 +12038,7 @@ yy700:
TIMELIB_DEINIT;
return TIMELIB_CLF;
}
#line 12068 "ext/date/lib/parse_date.c"
#line 12042 "ext/date/lib/parse_date.c"
yy701:
YYDEBUG(701, *YYCURSOR);
yych = *++YYCURSOR;
@@ -12616,7 +12590,7 @@ yy762:
}
yy763:
YYDEBUG(763, *YYCURSOR);
#line 1271 "ext/date/lib/parse_date.re"
#line 1245 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("iso8601date2");
@@ -12629,7 +12603,7 @@ yy763:
TIMELIB_DEINIT;
return TIMELIB_ISO_DATE;
}
#line 12633 "ext/date/lib/parse_date.c"
#line 12607 "ext/date/lib/parse_date.c"
yy764:
YYDEBUG(764, *YYCURSOR);
yych = *++YYCURSOR;
@@ -12668,7 +12642,7 @@ yy770:
YYDEBUG(770, *YYCURSOR);
++YYCURSOR;
YYDEBUG(771, *YYCURSOR);
#line 1512 "ext/date/lib/parse_date.re"
#line 1486 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("pgtextreverse");
@@ -12681,7 +12655,7 @@ yy770:
TIMELIB_DEINIT;
return TIMELIB_PG_TEXT;
}
#line 12685 "ext/date/lib/parse_date.c"
#line 12659 "ext/date/lib/parse_date.c"
yy772:
YYDEBUG(772, *YYCURSOR);
yych = *++YYCURSOR;
@@ -12819,7 +12793,7 @@ yy782:
}
yy783:
YYDEBUG(783, *YYCURSOR);
#line 1547 "ext/date/lib/parse_date.re"
#line 1521 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("year4");
TIMELIB_INIT;
@@ -12827,7 +12801,7 @@ yy783:
TIMELIB_DEINIT;
return TIMELIB_CLF;
}
#line 12831 "ext/date/lib/parse_date.c"
#line 12805 "ext/date/lib/parse_date.c"
yy784:
YYDEBUG(784, *YYCURSOR);
yych = *++YYCURSOR;
@@ -12978,7 +12952,7 @@ yy792:
}
yy793:
YYDEBUG(793, *YYCURSOR);
#line 1368 "ext/date/lib/parse_date.re"
#line 1342 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("datenodayrev");
@@ -12991,7 +12965,7 @@ yy793:
TIMELIB_DEINIT;
return TIMELIB_DATE_NO_DAY;
}
#line 12995 "ext/date/lib/parse_date.c"
#line 12969 "ext/date/lib/parse_date.c"
yy794:
YYDEBUG(794, *YYCURSOR);
yych = *++YYCURSOR;
@@ -13206,7 +13180,7 @@ yy813:
if (yych <= '7') goto yy816;
yy814:
YYDEBUG(814, *YYCURSOR);
#line 1479 "ext/date/lib/parse_date.re"
#line 1453 "ext/date/lib/parse_date.re"
{
timelib_sll w, d;
DEBUG_OUTPUT("isoweek");
@@ -13224,7 +13198,7 @@ yy814:
TIMELIB_DEINIT;
return TIMELIB_ISO_WEEK;
}
#line 13228 "ext/date/lib/parse_date.c"
#line 13202 "ext/date/lib/parse_date.c"
yy815:
YYDEBUG(815, *YYCURSOR);
yych = *++YYCURSOR;
@@ -13234,7 +13208,7 @@ yy816:
YYDEBUG(816, *YYCURSOR);
++YYCURSOR;
YYDEBUG(817, *YYCURSOR);
#line 1460 "ext/date/lib/parse_date.re"
#line 1434 "ext/date/lib/parse_date.re"
{
timelib_sll w, d;
DEBUG_OUTPUT("isoweekday");
@@ -13252,7 +13226,7 @@ yy816:
TIMELIB_DEINIT;
return TIMELIB_ISO_WEEK;
}
#line 13256 "ext/date/lib/parse_date.c"
#line 13230 "ext/date/lib/parse_date.c"
yy818:
YYDEBUG(818, *YYCURSOR);
yych = *++YYCURSOR;
@@ -13316,7 +13290,7 @@ yy820:
}
yy821:
YYDEBUG(821, *YYCURSOR);
#line 1446 "ext/date/lib/parse_date.re"
#line 1420 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("pgydotd");
@@ -13329,7 +13303,7 @@ yy821:
TIMELIB_DEINIT;
return TIMELIB_PG_YEARDAY;
}
#line 13333 "ext/date/lib/parse_date.c"
#line 13307 "ext/date/lib/parse_date.c"
yy822:
YYDEBUG(822, *YYCURSOR);
yych = *++YYCURSOR;
@@ -13432,7 +13406,7 @@ yy841:
++YYCURSOR;
yy842:
YYDEBUG(842, *YYCURSOR);
#line 1420 "ext/date/lib/parse_date.re"
#line 1394 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("xmlrpc | xmlrpcnocolon | soap | wddx | exif");
@@ -13457,7 +13431,7 @@ yy842:
TIMELIB_DEINIT;
return TIMELIB_XMLRPC_SOAP;
}
#line 13461 "ext/date/lib/parse_date.c"
#line 13435 "ext/date/lib/parse_date.c"
yy843:
YYDEBUG(843, *YYCURSOR);
yych = *++YYCURSOR;
@@ -13719,7 +13693,7 @@ yy847:
}
yy848:
YYDEBUG(848, *YYCURSOR);
#line 1408 "ext/date/lib/parse_date.re"
#line 1382 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("datenocolon");
TIMELIB_INIT;
@@ -13730,7 +13704,7 @@ yy848:
TIMELIB_DEINIT;
return TIMELIB_DATE_NOCOLON;
}
#line 13734 "ext/date/lib/parse_date.c"
#line 13708 "ext/date/lib/parse_date.c"
yy849:
YYDEBUG(849, *YYCURSOR);
yych = *++YYCURSOR;
@@ -14650,7 +14624,7 @@ yy972:
if (yych <= '9') goto yy995;
yy973:
YYDEBUG(973, *YYCURSOR);
#line 1285 "ext/date/lib/parse_date.re"
#line 1259 "ext/date/lib/parse_date.re"
{
int length = 0;
DEBUG_OUTPUT("gnudateshorter");
@@ -14663,7 +14637,7 @@ yy973:
TIMELIB_DEINIT;
return TIMELIB_ISO_DATE;
}
#line 14667 "ext/date/lib/parse_date.c"
#line 14641 "ext/date/lib/parse_date.c"
yy974:
YYDEBUG(974, *YYCURSOR);
yyaccept = 22;
@@ -15672,7 +15646,7 @@ yy1065:
}
yy1067:
YYDEBUG(1067, *YYCURSOR);
#line 1177 "ext/date/lib/parse_date.re"
#line 1151 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("gnunocolon");
TIMELIB_INIT;
@@ -15694,7 +15668,7 @@ yy1067:
TIMELIB_DEINIT;
return TIMELIB_GNU_NOCOLON;
}
#line 15698 "ext/date/lib/parse_date.c"
#line 15672 "ext/date/lib/parse_date.c"
yy1068:
YYDEBUG(1068, *YYCURSOR);
yych = *++YYCURSOR;
@@ -15786,7 +15760,7 @@ yy1074:
}
yy1075:
YYDEBUG(1075, *YYCURSOR);
#line 1223 "ext/date/lib/parse_date.re"
#line 1197 "ext/date/lib/parse_date.re"
{
int tz_not_found;
DEBUG_OUTPUT("iso8601nocolon");
@@ -15805,7 +15779,7 @@ yy1075:
TIMELIB_DEINIT;
return TIMELIB_ISO_NOCOLON;
}
#line 15809 "ext/date/lib/parse_date.c"
#line 15783 "ext/date/lib/parse_date.c"
yy1076:
YYDEBUG(1076, *YYCURSOR);
yyaccept = 25;
@@ -16703,7 +16677,7 @@ yy1116:
}
yy1117:
YYDEBUG(1117, *YYCURSOR);
#line 1619 "ext/date/lib/parse_date.re"
#line 1593 "ext/date/lib/parse_date.re"
{
timelib_sll i;
int behavior = 0;
@@ -16719,7 +16693,7 @@ yy1117:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 16723 "ext/date/lib/parse_date.c"
#line 16697 "ext/date/lib/parse_date.c"
yy1118:
YYDEBUG(1118, *YYCURSOR);
++YYCURSOR;
@@ -16770,7 +16744,7 @@ yy1125:
YYDEBUG(1125, *YYCURSOR);
++YYCURSOR;
YYDEBUG(1126, *YYCURSOR);
#line 1092 "ext/date/lib/parse_date.re"
#line 1066 "ext/date/lib/parse_date.re"
{
timelib_sll i;
int behavior = 0;
@@ -16791,7 +16765,7 @@ yy1125:
TIMELIB_DEINIT;
return TIMELIB_WEEK_DAY_OF_MONTH;
}
#line 16795 "ext/date/lib/parse_date.c"
#line 16769 "ext/date/lib/parse_date.c"
yy1127:
YYDEBUG(1127, *YYCURSOR);
yyaccept = 26;
@@ -16899,7 +16873,7 @@ yy1140:
}
yy1141:
YYDEBUG(1141, *YYCURSOR);
#line 1595 "ext/date/lib/parse_date.re"
#line 1569 "ext/date/lib/parse_date.re"
{
timelib_sll i;
int behavior = 0;
@@ -16922,7 +16896,7 @@ yy1141:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 16926 "ext/date/lib/parse_date.c"
#line 16900 "ext/date/lib/parse_date.c"
yy1142:
YYDEBUG(1142, *YYCURSOR);
yych = *++YYCURSOR;
@@ -19599,7 +19573,7 @@ yy1293:
goto yy1297;
yy1294:
YYDEBUG(1294, *YYCURSOR);
#line 1069 "ext/date/lib/parse_date.re"
#line 1043 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("backof | frontof");
TIMELIB_INIT;
@@ -19621,7 +19595,7 @@ yy1294:
TIMELIB_DEINIT;
return TIMELIB_LF_DAY_OF_MONTH;
}
#line 19625 "ext/date/lib/parse_date.c"
#line 19599 "ext/date/lib/parse_date.c"
yy1295:
YYDEBUG(1295, *YYCURSOR);
yyaccept = 28;
@@ -19882,14 +19856,14 @@ yy1315:
YYDEBUG(1315, *YYCURSOR);
++YYCURSOR;
YYDEBUG(1316, *YYCURSOR);
#line 1052 "ext/date/lib/parse_date.re"
#line 1026 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("firstdayof | lastdayof");
TIMELIB_INIT;
TIMELIB_HAVE_RELATIVE();
/* skip "last day of" or "first day of" */
if (*ptr == 'l') {
if (*ptr == 'l' || *ptr == 'L') {
s->time->relative.first_last_day_of = 2;
} else {
s->time->relative.first_last_day_of = 1;
@@ -19898,7 +19872,7 @@ yy1315:
TIMELIB_DEINIT;
return TIMELIB_LF_DAY_OF_MONTH;
}
#line 19902 "ext/date/lib/parse_date.c"
#line 19876 "ext/date/lib/parse_date.c"
yy1317:
YYDEBUG(1317, *YYCURSOR);
yyaccept = 0;
@@ -21329,7 +21303,7 @@ yy1385:
if (yych <= '9') goto yy1385;
yy1387:
YYDEBUG(1387, *YYCURSOR);
#line 1026 "ext/date/lib/parse_date.re"
#line 1000 "ext/date/lib/parse_date.re"
{
timelib_ull i;
@@ -21354,7 +21328,7 @@ yy1387:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 21358 "ext/date/lib/parse_date.c"
#line 21332 "ext/date/lib/parse_date.c"
yy1388:
YYDEBUG(1388, *YYCURSOR);
yych = *++YYCURSOR;
@@ -21790,7 +21764,7 @@ yy1416:
++YYCURSOR;
yy1417:
YYDEBUG(1417, *YYCURSOR);
#line 1014 "ext/date/lib/parse_date.re"
#line 988 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("tomorrow");
TIMELIB_INIT;
@@ -21801,7 +21775,7 @@ yy1417:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 21805 "ext/date/lib/parse_date.c"
#line 21779 "ext/date/lib/parse_date.c"
yy1418:
YYDEBUG(1418, *YYCURSOR);
yych = *++YYCURSOR;
@@ -21836,7 +21810,7 @@ yy1419:
}
yy1420:
YYDEBUG(1420, *YYCURSOR);
#line 1004 "ext/date/lib/parse_date.re"
#line 978 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("midnight | today");
TIMELIB_INIT;
@@ -21845,7 +21819,7 @@ yy1420:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 21849 "ext/date/lib/parse_date.c"
#line 21823 "ext/date/lib/parse_date.c"
yy1421:
YYDEBUG(1421, *YYCURSOR);
yych = *++YYCURSOR;
@@ -23857,7 +23831,7 @@ yy1499:
}
yy1500:
YYDEBUG(1500, *YYCURSOR);
#line 983 "ext/date/lib/parse_date.re"
#line 957 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("now");
TIMELIB_INIT;
@@ -23865,7 +23839,7 @@ yy1500:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 23869 "ext/date/lib/parse_date.c"
#line 23843 "ext/date/lib/parse_date.c"
yy1501:
YYDEBUG(1501, *YYCURSOR);
yych = *++YYCURSOR;
@@ -24004,7 +23978,7 @@ yy1507:
}
yy1508:
YYDEBUG(1508, *YYCURSOR);
#line 992 "ext/date/lib/parse_date.re"
#line 966 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("noon");
TIMELIB_INIT;
@@ -24015,7 +23989,7 @@ yy1508:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 24019 "ext/date/lib/parse_date.c"
#line 23993 "ext/date/lib/parse_date.c"
yy1509:
YYDEBUG(1509, *YYCURSOR);
yyaccept = 0;
@@ -24548,7 +24522,7 @@ yy1530:
++YYCURSOR;
yy1531:
YYDEBUG(1531, *YYCURSOR);
#line 971 "ext/date/lib/parse_date.re"
#line 945 "ext/date/lib/parse_date.re"
{
DEBUG_OUTPUT("yesterday");
TIMELIB_INIT;
@@ -24559,7 +24533,7 @@ yy1531:
TIMELIB_DEINIT;
return TIMELIB_RELATIVE;
}
#line 24563 "ext/date/lib/parse_date.c"
#line 24537 "ext/date/lib/parse_date.c"
yy1532:
YYDEBUG(1532, *YYCURSOR);
yyaccept = 0;
@@ -24732,7 +24706,7 @@ yy1537:
goto yy1531;
}
}
#line 1745 "ext/date/lib/parse_date.re"
#line 1719 "ext/date/lib/parse_date.re"
}
@@ -25223,7 +25197,7 @@ char *timelib_timezone_id_from_abbr(const char *abbr, long gmtoffset, int isdst)
{
const timelib_tz_lookup_table *tp;
tp = zone_search(abbr, gmtoffset, isdst);
tp = abbr_search(abbr, gmtoffset, isdst);
if (tp) {
return (tp->full_tz_name);
} else {
+12 -38
View File
@@ -668,7 +668,7 @@ static void timelib_set_relative(char **ptr, timelib_sll amount, int behavior, S
}
}
const static timelib_tz_lookup_table* zone_search(const char *word, long gmtoffset, int isdst)
const static timelib_tz_lookup_table* abbr_search(const char *word, long gmtoffset, int isdst)
{
int first_found = 0;
const timelib_tz_lookup_table *tp, *first_found_elem = NULL;
@@ -696,25 +696,6 @@ const static timelib_tz_lookup_table* zone_search(const char *word, long gmtoffs
return first_found_elem;
}
for (tp = timelib_timezone_lookup; tp->name; tp++) {
if (tp->full_tz_name && strcasecmp(word, tp->full_tz_name) == 0) {
if (!first_found) {
first_found = 1;
first_found_elem = tp;
if (gmtoffset == -1) {
return tp;
}
}
if (tp->gmtoffset == gmtoffset) {
return tp;
}
}
}
if (first_found) {
return first_found_elem;
}
/* Still didn't find anything, let's find the zone solely based on
* offset/isdst then */
for (fmp = timelib_timezone_fallbackmap; fmp->name; fmp++) {
@@ -725,7 +706,7 @@ const static timelib_tz_lookup_table* zone_search(const char *word, long gmtoffs
return NULL;
}
static long timelib_lookup_zone(char **ptr, int *dst, char **tz_abbr, int *found)
static long timelib_lookup_abbr(char **ptr, int *dst, char **tz_abbr, int *found)
{
char *word;
char *begin = *ptr, *end;
@@ -739,7 +720,7 @@ static long timelib_lookup_zone(char **ptr, int *dst, char **tz_abbr, int *found
word = calloc(1, end - begin + 1);
memcpy(word, begin, end - begin);
if ((tp = zone_search(word, -1, 0))) {
if ((tp = abbr_search(word, -1, 0))) {
value = -tp->gmtoffset / 60;
*dst = tp->type;
value += tp->type * 60;
@@ -783,33 +764,26 @@ long timelib_parse_zone(char **ptr, int *dst, timelib_time *t, int *tz_not_found
retval = timelib_parse_tz_cor(ptr);
} else {
int found = 0;
long offset;
long offset = 0;
char *tz_abbr;
t->is_localtime = 1;
offset = timelib_lookup_zone(ptr, dst, &tz_abbr, &found);
/* First, we lookup by abbreviation only */
offset = timelib_lookup_abbr(ptr, dst, &tz_abbr, &found);
if (found) {
t->zone_type = TIMELIB_ZONETYPE_ABBR;
timelib_time_tz_abbr_update(t, tz_abbr);
}
#if 0
/* If we found a TimeZone identifier, use it */
if (tz_name) {
t->tz_info = timelib_parse_tzfile(tz_name);
t->zone_type = TIMELIB_ZONETYPE_ID;
}
#endif
/* If we have a TimeZone identifier to start with, use it */
if (strstr(tz_abbr, "/") || strcmp(tz_abbr, "UTC") == 0) {
/* Otherwise, we look if we have a TimeZone identifier */
if (!found || strcmp("UTC", tz_abbr) == 0) {
if ((res = tz_wrapper(tz_abbr, tzdb)) != NULL) {
t->tz_info = res;
t->zone_type = TIMELIB_ZONETYPE_ID;
found++;
}
}
if (found && t->zone_type != TIMELIB_ZONETYPE_ID) {
timelib_time_tz_abbr_update(t, tz_abbr);
}
free(tz_abbr);
*tz_not_found = (found == 0);
retval = offset;
@@ -1055,7 +1029,7 @@ weekdayof = (reltextnumber|reltexttext) space (dayfull|dayabbr) space 'of
TIMELIB_HAVE_RELATIVE();
/* skip "last day of" or "first day of" */
if (*ptr == 'l') {
if (*ptr == 'l' || *ptr == 'L') {
s->time->relative.first_last_day_of = 2;
} else {
s->time->relative.first_last_day_of = 1;
@@ -2232,7 +2206,7 @@ char *timelib_timezone_id_from_abbr(const char *abbr, long gmtoffset, int isdst)
{
const timelib_tz_lookup_table *tp;
tp = zone_search(abbr, gmtoffset, isdst);
tp = abbr_search(abbr, gmtoffset, isdst);
if (tp) {
return (tp->full_tz_name);
} else {
+652 -667
View File
File diff suppressed because it is too large. Load diff
+175
View File
@@ -0,0 +1,175 @@
--TEST--
Bug #66986 (Some timezones are no longer valid in PHP 5.5.10)
--FILE--
<?php
$zones = array(
"CST6CDT", "Cuba", "Egypt", "Eire", "EST5EDT", "Factory", "GB-Eire",
"GMT0", "Greenwich", "Hongkong", "Iceland", "Iran", "Israel", "Jamaica",
"Japan", "Kwajalein", "Libya", "MST7MDT", "Navajo", "NZ-CHAT", "Poland",
"Portugal", "PST8PDT", "Singapore", "Turkey", "Universal", "W-SU",
"UTC", "GMT", "GMT+0100", "-0230",
);
foreach ( $zones as $zone )
{
$d = new DateTimeZone( $zone );
print_r($d);
}
?>
--EXPECT--
DateTimeZone Object
(
[timezone_type] => 3
[timezone] => CST6CDT
)
DateTimeZone Object
(
[timezone_type] => 3
[timezone] => Cuba
)
DateTimeZone Object
(
[timezone_type] => 3
[timezone] => Egypt
)
DateTimeZone Object
(
[timezone_type] => 3
[timezone] => Eire
)
DateTimeZone Object
(
[timezone_type] => 3
[timezone] => EST5EDT
)
DateTimeZone Object
(
[timezone_type] => 3
[timezone] => Factory
)
DateTimeZone Object
(
[timezone_type] => 3
[timezone] => GB-Eire
)
DateTimeZone Object
(
[timezone_type] => 3
[timezone] => GMT0
)
DateTimeZone Object
(
[timezone_type] => 3
[timezone] => Greenwich
)
DateTimeZone Object
(
[timezone_type] => 3
[timezone] => Hongkong
)
DateTimeZone Object
(
[timezone_type] => 3
[timezone] => Iceland
)
DateTimeZone Object
(
[timezone_type] => 3
[timezone] => Iran
)
DateTimeZone Object
(
[timezone_type] => 3
[timezone] => Israel
)
DateTimeZone Object
(
[timezone_type] => 3
[timezone] => Jamaica
)
DateTimeZone Object
(
[timezone_type] => 3
[timezone] => Japan
)
DateTimeZone Object
(
[timezone_type] => 3
[timezone] => Kwajalein
)
DateTimeZone Object
(
[timezone_type] => 3
[timezone] => Libya
)
DateTimeZone Object
(
[timezone_type] => 3
[timezone] => MST7MDT
)
DateTimeZone Object
(
[timezone_type] => 3
[timezone] => Navajo
)
DateTimeZone Object
(
[timezone_type] => 3
[timezone] => NZ-CHAT
)
DateTimeZone Object
(
[timezone_type] => 3
[timezone] => Poland
)
DateTimeZone Object
(
[timezone_type] => 3
[timezone] => Portugal
)
DateTimeZone Object
(
[timezone_type] => 3
[timezone] => PST8PDT
)
DateTimeZone Object
(
[timezone_type] => 3
[timezone] => Singapore
)
DateTimeZone Object
(
[timezone_type] => 3
[timezone] => Turkey
)
DateTimeZone Object
(
[timezone_type] => 3
[timezone] => Universal
)
DateTimeZone Object
(
[timezone_type] => 3
[timezone] => W-SU
)
DateTimeZone Object
(
[timezone_type] => 3
[timezone] => UTC
)
DateTimeZone Object
(
[timezone_type] => 2
[timezone] => GMT
)
DateTimeZone Object
(
[timezone_type] => 1
[timezone] => +01:00
)
DateTimeZone Object
(
[timezone_type] => 1
[timezone] => -02:30
)
+14
View File
@@ -0,0 +1,14 @@
--TEST--
Bug #67109 (First uppercase letter breaks date string parsing)
--INI--
date.timezone=UTC
--FILE--
<?php
var_dump(date('d.m.Y',strtotime('last day of april')));
var_dump(date('d.m.Y',strtotime('Last day of april')));
var_dump(date('d.m.Y',strtotime('lAst Day of April')));
?>
--EXPECTF--
string(10) "30.04.%d"
string(10) "30.04.%d"
string(10) "30.04.%d"
+1 -8
View File
@@ -183,14 +183,7 @@ int dom_attr_value_write(dom_object *obj, zval *newval TSRMLS_DC)
node_list_unlink(attrp->children TSRMLS_CC);
}
if (newval->type != IS_STRING) {
if(Z_REFCOUNT_P(newval) > 1) {
value_copy = *newval;
zval_copy_ctor(&value_copy);
newval = &value_copy;
}
convert_to_string(newval);
}
convert_to_string_copy(newval, value_copy);
xmlNodeSetContentLen((xmlNodePtr) attrp, Z_STRVAL_P(newval), Z_STRLEN_P(newval) + 1);
+1 -8
View File
@@ -112,14 +112,7 @@ int dom_characterdata_data_write(dom_object *obj, zval *newval TSRMLS_DC)
return FAILURE;
}
if (newval->type != IS_STRING) {
if(Z_REFCOUNT_P(newval) > 1) {
value_copy = *newval;
zval_copy_ctor(&value_copy);
newval = &value_copy;
}
convert_to_string(newval);
}
convert_to_string_copy(newval, value_copy);
xmlNodeSetContentLen(nodep, Z_STRVAL_P(newval), Z_STRLEN_P(newval) + 1);
+11 -72
View File
@@ -361,14 +361,7 @@ int dom_document_encoding_write(dom_object *obj, zval *newval TSRMLS_DC)
return FAILURE;
}
if (newval->type != IS_STRING) {
if(Z_REFCOUNT_P(newval) > 1) {
value_copy = *newval;
zval_copy_ctor(&value_copy);
newval = &value_copy;
}
convert_to_string(newval);
}
convert_to_string_copy(newval, value_copy);
handler = xmlFindCharEncodingHandler(Z_STRVAL_P(newval));
@@ -428,12 +421,7 @@ int dom_document_standalone_write(dom_object *obj, zval *newval TSRMLS_DC)
return FAILURE;
}
if(Z_REFCOUNT_P(newval) > 1) {
value_copy = *newval;
zval_copy_ctor(&value_copy);
newval = &value_copy;
}
convert_to_long(newval);
convert_to_long_copy(newval, value_copy);
standalone = Z_LVAL_P(newval);
if (standalone > 0) {
@@ -500,14 +488,7 @@ int dom_document_version_write(dom_object *obj, zval *newval TSRMLS_DC)
xmlFree((xmlChar *) docp->version );
}
if (newval->type != IS_STRING) {
if(Z_REFCOUNT_P(newval) > 1) {
value_copy = *newval;
zval_copy_ctor(&value_copy);
newval = &value_copy;
}
convert_to_string(newval);
}
convert_to_string_copy(newval, value_copy);
docp->version = xmlStrdup((const xmlChar *) Z_STRVAL_P(newval));
@@ -544,12 +525,7 @@ int dom_document_strict_error_checking_write(dom_object *obj, zval *newval TSRML
zval value_copy;
dom_doc_propsptr doc_prop;
if(Z_REFCOUNT_P(newval) > 1) {
value_copy = *newval;
zval_copy_ctor(&value_copy);
newval = &value_copy;
}
convert_to_boolean(newval);
convert_to_boolean_copy(newval, value_copy);
if (obj->document) {
doc_prop = dom_get_doc_props(obj->document);
@@ -587,12 +563,7 @@ int dom_document_format_output_write(dom_object *obj, zval *newval TSRMLS_DC)
zval value_copy;
dom_doc_propsptr doc_prop;
if(Z_REFCOUNT_P(newval) > 1) {
value_copy = *newval;
zval_copy_ctor(&value_copy);
newval = &value_copy;
}
convert_to_boolean(newval);
convert_to_boolean_copy(newval, value_copy);
if (obj->document) {
doc_prop = dom_get_doc_props(obj->document);
@@ -629,12 +600,7 @@ int dom_document_validate_on_parse_write(dom_object *obj, zval *newval TSRMLS_DC
zval value_copy;
dom_doc_propsptr doc_prop;
if(Z_REFCOUNT_P(newval) > 1) {
value_copy = *newval;
zval_copy_ctor(&value_copy);
newval = &value_copy;
}
convert_to_boolean(newval);
convert_to_boolean_copy(newval, value_copy);
if (obj->document) {
doc_prop = dom_get_doc_props(obj->document);
@@ -671,12 +637,7 @@ int dom_document_resolve_externals_write(dom_object *obj, zval *newval TSRMLS_DC
zval value_copy;
dom_doc_propsptr doc_prop;
if(Z_REFCOUNT_P(newval) > 1) {
value_copy = *newval;
zval_copy_ctor(&value_copy);
newval = &value_copy;
}
convert_to_boolean(newval);
convert_to_boolean_copy(newval, value_copy);
if (obj->document) {
doc_prop = dom_get_doc_props(obj->document);
@@ -713,12 +674,7 @@ int dom_document_preserve_whitespace_write(dom_object *obj, zval *newval TSRMLS_
zval value_copy;
dom_doc_propsptr doc_prop;
if(Z_REFCOUNT_P(newval) > 1) {
value_copy = *newval;
zval_copy_ctor(&value_copy);
newval = &value_copy;
}
convert_to_boolean(newval);
convert_to_boolean_copy(newval, value_copy);
if (obj->document) {
doc_prop = dom_get_doc_props(obj->document);
@@ -755,12 +711,7 @@ int dom_document_recover_write(dom_object *obj, zval *newval TSRMLS_DC)
zval value_copy;
dom_doc_propsptr doc_prop;
if(Z_REFCOUNT_P(newval) > 1) {
value_copy = *newval;
zval_copy_ctor(&value_copy);
newval = &value_copy;
}
convert_to_boolean(newval);
convert_to_boolean_copy(newval, value_copy);
if (obj->document) {
doc_prop = dom_get_doc_props(obj->document);
@@ -797,12 +748,7 @@ int dom_document_substitue_entities_write(dom_object *obj, zval *newval TSRMLS_D
zval value_copy;
dom_doc_propsptr doc_prop;
if(Z_REFCOUNT_P(newval) > 1) {
value_copy = *newval;
zval_copy_ctor(&value_copy);
newval = &value_copy;
}
convert_to_boolean(newval);
convert_to_boolean_copy(newval, value_copy);
if (obj->document) {
doc_prop = dom_get_doc_props(obj->document);
@@ -861,14 +807,7 @@ int dom_document_document_uri_write(dom_object *obj, zval *newval TSRMLS_DC)
xmlFree((xmlChar *) docp->URL);
}
if (newval->type != IS_STRING) {
if(Z_REFCOUNT_P(newval) > 1) {
value_copy = *newval;
zval_copy_ctor(&value_copy);
newval = &value_copy;
}
convert_to_string(newval);
}
convert_to_string_copy(newval, value_copy);
docp->URL = xmlStrdup((const xmlChar *) Z_STRVAL_P(newval));
+19 -16
View File
@@ -352,14 +352,7 @@ int dom_node_node_value_write(dom_object *obj, zval *newval TSRMLS_DC)
case XML_COMMENT_NODE:
case XML_CDATA_SECTION_NODE:
case XML_PI_NODE:
if (newval->type != IS_STRING) {
if(Z_REFCOUNT_P(newval) > 1) {
value_copy = *newval;
zval_copy_ctor(&value_copy);
newval = &value_copy;
}
convert_to_string(newval);
}
convert_to_string_copy(newval, value_copy);
xmlNodeSetContentLen(nodep, Z_STRVAL_P(newval), Z_STRLEN_P(newval) + 1);
if (newval == &value_copy) {
zval_dtor(newval);
@@ -794,14 +787,7 @@ int dom_node_prefix_write(dom_object *obj, zval *newval TSRMLS_DC)
nsnode = xmlDocGetRootElement(nodep->doc);
}
}
if (newval->type != IS_STRING) {
if(Z_REFCOUNT_P(newval) > 1) {
value_copy = *newval;
zval_copy_ctor(&value_copy);
newval = &value_copy;
}
convert_to_string(newval);
}
convert_to_string_copy(newval, value_copy);
prefix = Z_STRVAL_P(newval);
if (nsnode && nodep->ns != NULL && !xmlStrEqual(nodep->ns->prefix, (xmlChar *)prefix)) {
strURI = (char *) nodep->ns->href;
@@ -942,6 +928,23 @@ int dom_node_text_content_read(dom_object *obj, zval **retval TSRMLS_DC)
int dom_node_text_content_write(dom_object *obj, zval *newval TSRMLS_DC)
{
xmlNode *nodep = dom_object_get_node(obj);
zval value_copy;
xmlChar *enc_str;
if (nodep == NULL) {
php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
return FAILURE;
}
convert_to_string_copy(newval, value_copy);
enc_str = xmlEncodeEntitiesReentrant(nodep->doc, Z_STRVAL_P(newval));
xmlNodeSetContent(nodep, enc_str);
xmlFree(enc_str);
if (newval == &value_copy) {
zval_dtor(newval);
}
return SUCCESS;
}
+1 -1
View File
@@ -518,7 +518,7 @@ static HashTable* dom_get_debug_info_helper(zval *object, int *is_temp TSRMLS_DC
value = null_value;
} else if (Z_TYPE_P(value) == IS_OBJECT) {
/* these are zvalues create on demand, with refcount and is_ref
* status left in an uninitalized stated */
* status left in an uninitialized stated */
zval_dtor(value);
efree(value);
+14
View File
@@ -146,6 +146,20 @@ entry = zend_register_internal_class_ex(&ce, parent_ce, NULL TSRMLS_CC);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not yet implemented"); \
return;
#define convert_to_copy_master(orig, copy, lower_type, upper_type) \
if (Z_TYPE_P(orig) != IS_##upper_type) { \
if (Z_REFCOUNT_P(orig) > 1) { \
copy = *orig; \
zval_copy_ctor(&copy); \
orig = &copy; \
} \
convert_to_##lower_type(orig); \
}
#define convert_to_string_copy(orig, copy) convert_to_copy_master(orig, copy, string, STRING);
#define convert_to_long_copy(orig, copy) convert_to_copy_master(orig, copy, long, LONG);
#define convert_to_boolean_copy(orig, copy) convert_to_copy_master(orig, copy, boolean, BOOL);
#define DOM_NODELIST 0
#define DOM_NAMEDNODEMAP 1
+29
View File
@@ -0,0 +1,29 @@
--TEST--
Testing reading and writing to DOMNode::textContent
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
$html = <<<HTML
<div id="test"><span>hi there</span></div>
HTML;
$text = '<p>hello world &trade;</p>';
$dom = new DOMDocument('1.0', 'UTF-8');
$dom->loadHTML($html);
$node = $dom->getElementById('test');
var_dump($node->textContent);
$node->textContent = $text;
var_dump($node->textContent == $text);
var_dump($dom->saveHTML($node));
?>
--EXPECT--
string(8) "hi there"
bool(true)
string(63) "<div id="test">&lt;p&gt;hello world &amp;trade;&lt;/p&gt;</div>"
+1 -1
View File
@@ -9,7 +9,7 @@ Test eregi() function : basic functionality - confirm case insensitivity
*/
/*
* Test basic funtionality of eregi()
* Test basic functionality of eregi()
*/
echo "*** Testing eregi() : basic functionality ***\n";
+2 -2
View File
@@ -2416,11 +2416,11 @@ static void* exif_ifd_make_value(image_info_data *info_data, int motorola_intel
data_ptr += 8;
break;
case TAG_FMT_SINGLE:
memmove(data_ptr, &info_data->value.f, byte_count);
memmove(data_ptr, &info_value->f, 4);
data_ptr += 4;
break;
case TAG_FMT_DOUBLE:
memmove(data_ptr, &info_data->value.d, byte_count);
memmove(data_ptr, &info_value->d, 8);
data_ptr += 8;
break;
}
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 368 B

+17
View File
@@ -0,0 +1,17 @@
--TEST--
Bug #68113 (Heap corruption in exif_thumbnail())
--SKIPIF--
<?php
extension_loaded("exif") or die("skip need exif");
?>
--FILE--
<?php
var_dump(exif_thumbnail(__DIR__."/bug68113.jpg"));
?>
Done
--EXPECTF--
Warning: exif_thumbnail(bug68113.jpg): File structure corrupted in %s/bug68113.php on line 2
Warning: exif_thumbnail(bug68113.jpg): Invalid JPEG file in %s/bug68113.php on line 2
bool(false)
Done
+1 -1
View File
@@ -823,7 +823,7 @@ cdf_read_property_info(const cdf_stream_t *sst, const cdf_header_t *h,
q = (const uint8_t *)(const void *)
((const char *)(const void *)p + ofs
- 2 * sizeof(uint32_t));
if (q > e) {
if (q < p || q > e) {
DPRINTF(("Ran of the end %p > %p\n", q, e));
goto out;
}
+4 -5
View File
@@ -27,7 +27,7 @@
#include "file.h"
#ifndef lint
FILE_RCSID("@(#)$File: funcs.c,v 1.67 2014/02/12 23:20:53 christos Exp $")
FILE_RCSID("@(#)$File: funcs.c,v 1.68 2014/02/18 11:09:31 kim Exp $")
#endif /* lint */
#include "magic.h"
@@ -173,8 +173,7 @@ file_buffer(struct magic_set *ms, php_stream *stream, const char *inname, const
const char *code_mime = "binary";
const char *type = "application/octet-stream";
const char *def = "data";
const char *ftype = NULL;
if (nb == 0) {
def = "empty";
@@ -187,7 +186,7 @@ file_buffer(struct magic_set *ms, php_stream *stream, const char *inname, const
if ((ms->flags & MAGIC_NO_CHECK_ENCODING) == 0) {
looks_text = file_encoding(ms, ubuf, nb, &u8buf, &ulen,
&code, &code_mime, &type);
&code, &code_mime, &ftype);
}
#ifdef __EMX__
@@ -272,7 +271,7 @@ file_buffer(struct magic_set *ms, php_stream *stream, const char *inname, const
if ((ms->flags & MAGIC_NO_CHECK_ENCODING) == 0) {
if (looks_text == 0)
if ((m = file_ascmagic_with_encoding( ms, ubuf,
nb, u8buf, ulen, code, type, looks_text))
nb, u8buf, ulen, code, ftype, looks_text))
!= 0) {
if ((ms->flags & MAGIC_DEBUG) != 0)
(void)fprintf(stderr,
+1 -1
View File
@@ -48,7 +48,7 @@ string(15) "MIFF image data"
string(25) "RIFF (little-endian) data"
string(28) "text/plain; charset=us-ascii"
string(26) "text/plain; charset=ebcdic"
string(22) "binary; charset=binary"
string(40) "application/octet-stream; charset=binary"
string(28) "text/plain; charset=us-ascii"
string(28) "text/plain; charset=us-ascii"
string(25) "text/plain; charset=utf-8"
@@ -47,7 +47,7 @@ string(15) "MIFF image data"
string(25) "RIFF (little-endian) data"
string(28) "text/plain; charset=us-ascii"
string(26) "text/plain; charset=ebcdic"
string(22) "binary; charset=binary"
string(40) "application/octet-stream; charset=binary"
string(28) "text/plain; charset=us-ascii"
string(28) "text/plain; charset=us-ascii"
string(25) "text/plain; charset=utf-8"
+5
View File
@@ -124,6 +124,11 @@ static void _php_image_output_ctx(INTERNAL_FUNCTION_PARAMETERS, int image_type,
RETURN_FALSE;
}
} else if (Z_TYPE_P(to_zval) == IS_STRING) {
if (CHECK_ZVAL_NULL_PATH(to_zval)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid 2nd parameter, filename must not contain null bytes");
RETURN_FALSE;
}
stream = php_stream_open_wrapper(Z_STRVAL_P(to_zval), "wb", REPORT_ERRORS|IGNORE_PATH|IGNORE_URL_WIN, NULL);
if (stream == NULL) {
RETURN_FALSE;
+4 -2
View File
@@ -390,9 +390,10 @@ static void *fontFetch (char **error, void *key)
fontlist = gdEstrdup(a->fontlist);
/*
* Must use gd_strtok_r else pointer corrupted by strtok in nested loop.
* Must use gd_strtok_r becasuse strtok() isn't thread safe
*/
for (name = gd_strtok_r (fontlist, LISTSEPARATOR, &strtok_ptr); name; name = gd_strtok_r (0, LISTSEPARATOR, &strtok_ptr)) {
char *strtok_ptr_path;
/* make a fresh copy each time - strtok corrupts it. */
path = gdEstrdup (fontsearchpath);
@@ -408,7 +409,8 @@ static void *fontFetch (char **error, void *key)
break;
}
}
for (dir = strtok (path, PATHSEPARATOR); dir; dir = strtok (0, PATHSEPARATOR)) {
for (dir = gd_strtok_r (path, PATHSEPARATOR, &strtok_ptr_path); dir;
dir = gd_strtok_r (0, PATHSEPARATOR, &strtok_ptr_path)) {
if (!strcmp(dir, ".")) {
TSRMLS_FETCH();
#if HAVE_GETCWD
+3 -2
View File
@@ -1,12 +1,13 @@
--TEST--
Bug #48801 (Problem with imagettfbbox) freetype >= 2.4.10
Bug #48801 (Problem with imagettfbbox) freetype >= 2.4.10 and < 2.4.12
--SKIPIF--
<?php
if(!extension_loaded('gd')){ die('skip gd extension not available'); }
if(!function_exists('imageftbbox')) die('skip imageftbbox() not available');
include dirname(__FILE__) . '/func.inc';
if(version_compare(get_freetype_version(), '2.4.10') == -1) die('skip for freetype >= 2.4.10');
if(version_compare(get_freetype_version(), '2.4.10') < 0) die('skip for freetype >= 2.4.10');
if(version_compare(get_freetype_version(), '2.4.12') >= 0) die('skip for freetype < 2.4.12');
?>
--FILE--
<?php
+25
View File
@@ -0,0 +1,25 @@
--TEST--
Bug #48801 (Problem with imagettfbbox) freetype >= 2.4.12
--SKIPIF--
<?php
if(!extension_loaded('gd')){ die('skip gd extension not available'); }
if(!function_exists('imageftbbox')) die('skip imageftbbox() not available');
include dirname(__FILE__) . '/func.inc';
if(version_compare(get_freetype_version(), '2.4.12') < 0) die('skip for freetype >= 2.4.12');
?>
--FILE--
<?php
$cwd = dirname(__FILE__);
$font = "$cwd/Tuffy.ttf";
$bbox = imageftbbox(50, 0, $font, "image");
echo '(' . $bbox[0] . ', ' . $bbox[1] . ")\n";
echo '(' . $bbox[2] . ', ' . $bbox[3] . ")\n";
echo '(' . $bbox[4] . ', ' . $bbox[5] . ")\n";
echo '(' . $bbox[6] . ', ' . $bbox[7] . ")\n";
?>
--EXPECTF--
(-1, 15)
(155, 15)
(155, -48)
(-1, -48)
@@ -0,0 +1,31 @@
--TEST--
Testing null byte injection in imagegd2
--CLEAN--
$tempdir = sys_get_temp_dir(). '/php-gdtest';
foreach (glob($tempdir . "/test*") as $file ) { unlink($file); }
rmdir($tempdir);
--FILE--
<?php
$image = imagecreate(1,1);// 1px image
$tempdir = sys_get_temp_dir(). '/php-gdtest';
if (!file_exists($tempdir) && !is_dir($tempdir)) {
mkdir ($tempdir, 0777, true);
}
$userinput = "1\0"; // from post or get data
$temp = $tempdir. "/test" . $userinput .".tmp";
echo "\nimagegd2 TEST\n";
imagegd2($image, $temp);
var_dump(file_exists($tempdir. "/test1"));
var_dump(file_exists($tempdir. "/test1.tmp"));
foreach (glob($tempdir . "/test*") as $file ) { unlink($file); }
--EXPECTF--
imagegd2 TEST
Warning: imagegd2() expects parameter 2 to be a valid path, string given in %s on line %d
bool(false)
bool(false)
@@ -0,0 +1,31 @@
--TEST--
Testing null byte injection in imagegd
--CLEAN--
$tempdir = sys_get_temp_dir(). '/php-gdtest';
foreach (glob($tempdir . "/test*") as $file ) { unlink($file); }
rmdir($tempdir);
--FILE--
<?php
$image = imagecreate(1,1);// 1px image
$tempdir = sys_get_temp_dir(). '/php-gdtest';
if (!file_exists($tempdir) && !is_dir($tempdir)) {
mkdir ($tempdir, 0777, true);
}
$userinput = "1\0"; // from post or get data
$temp = $tempdir. "/test" . $userinput .".tmp";
echo "\nimagegd TEST\n";
imagegd($image, $temp);
var_dump(file_exists($tempdir. "/test1"));
var_dump(file_exists($tempdir. "/test1.tmp"));
foreach (glob($tempdir . "/test*") as $file ) { unlink($file); }
--EXPECTF--
imagegd TEST
Warning: imagegd() expects parameter 2 to be a valid path, string given in %s on line %d
bool(false)
bool(false)
@@ -0,0 +1,38 @@
--TEST--
Testing null byte injection in imagegif
--CLEAN--
$tempdir = sys_get_temp_dir(). '/php-gdtest';
foreach (glob($tempdir . "/test*") as $file ) { unlink($file); }
rmdir($tempdir);
--SKIPIF--
<?php
$support = gd_info();
if (!isset($support['GIF Create Support']) || $support['GIF Create Support'] === false) {
print 'skip gif support not available';
}
?>
--FILE--
<?php
$image = imagecreate(1,1);// 1px image
$tempdir = sys_get_temp_dir(). '/php-gdtest';
if (!file_exists($tempdir) && !is_dir($tempdir)) {
mkdir ($tempdir, 0777, true);
}
$userinput = "1\0"; // from post or get data
$temp = $tempdir. "/test" . $userinput .".tmp";
echo "\nimagegif TEST\n";
imagegif($image, $temp);
var_dump(file_exists($tempdir. "/test1"));
var_dump(file_exists($tempdir. "/test1.tmp"));
foreach (glob($tempdir . "/test*") as $file ) { unlink($file); }
--EXPECTF--
imagegif TEST
Warning: imagegif(): Invalid 2nd parameter, filename must not contain null bytes in %s on line %d
bool(false)
bool(false)
@@ -0,0 +1,38 @@
--TEST--
Testing null byte injection in imagejpeg
--CLEAN--
$tempdir = sys_get_temp_dir(). '/php-gdtest';
foreach (glob($tempdir . "/test*") as $file ) { unlink($file); }
rmdir($tempdir);
--SKIPIF--
<?php
$support = gd_info();
if (!isset($support['JPEG Support']) || $support['JPEG Support'] === false) {
print 'skip jpeg support not available';
}
?>
--FILE--
<?php
$image = imagecreate(1,1);// 1px image
$tempdir = sys_get_temp_dir(). '/php-gdtest';
if (!file_exists($tempdir) && !is_dir($tempdir)) {
mkdir ($tempdir, 0777, true);
}
$userinput = "1\0"; // from post or get data
$temp = $tempdir. "/test" . $userinput .".tmp";
echo "\nimagejpeg TEST\n";
imagejpeg($image, $temp);
var_dump(file_exists($tempdir. "/test1"));
var_dump(file_exists($tempdir. "/test1.tmp"));
foreach (glob($tempdir . "/test*") as $file ) { unlink($file); }
--EXPECTF--
imagejpeg TEST
Warning: imagejpeg(): Invalid 2nd parameter, filename must not contain null bytes in %s on line %d
bool(false)
bool(false)
@@ -0,0 +1,38 @@
--TEST--
Testing null byte injection in imagepng
--CLEAN--
$tempdir = sys_get_temp_dir(). '/php-gdtest';
foreach (glob($tempdir . "/test*") as $file ) { unlink($file); }
rmdir($tempdir);
--SKIPIF--
<?php
$support = gd_info();
if (!isset($support['PNG Support']) || $support['PNG Support'] === false) {
print 'skip png support not available';
}
?>
--FILE--
<?php
$image = imagecreate(1,1);// 1px image
$tempdir = sys_get_temp_dir(). '/php-gdtest';
if (!file_exists($tempdir) && !is_dir($tempdir)) {
mkdir ($tempdir, 0777, true);
}
$userinput = "1\0"; // from post or get data
$temp = $tempdir. "/test" . $userinput .".tmp";
echo "\nimagepng TEST\n";
imagepng($image, $temp);
var_dump(file_exists($tempdir. "/test1"));
var_dump(file_exists($tempdir. "/test1.tmp"));
foreach (glob($tempdir . "/test*") as $file ) { unlink($file); }
--EXPECTF--
imagepng TEST
Warning: imagepng(): Invalid 2nd parameter, filename must not contain null bytes in %s on line %d
bool(false)
bool(false)
@@ -0,0 +1,38 @@
--TEST--
Testing null byte injection in imagewbmp
--CLEAN--
$tempdir = sys_get_temp_dir(). '/php-gdtest';
foreach (glob($tempdir . "/test*") as $file ) { unlink($file); }
rmdir($tempdir);
--SKIPIF--
<?php
$support = gd_info();
if (!isset($support['WBMP Support']) || $support['WBMP Support'] === false) {
print 'skip wbmp support not available';
}
?>
--FILE--
<?php
$image = imagecreate(1,1);// 1px image
$tempdir = sys_get_temp_dir(). '/php-gdtest';
if (!file_exists($tempdir) && !is_dir($tempdir)) {
mkdir ($tempdir, 0777, true);
}
$userinput = "1\0"; // from post or get data
$temp = $tempdir. "/test" . $userinput .".tmp";
echo "\nimagewbmp TEST\n";
imagewbmp($image, $temp);
var_dump(file_exists($tempdir. "/test1"));
var_dump(file_exists($tempdir. "/test1.tmp"));
foreach (glob($tempdir . "/test*") as $file ) { unlink($file); }
--EXPECTF--
imagewbmp TEST
Warning: imagewbmp(): Invalid 2nd parameter, filename must not contain null bytes in %s on line %d
bool(false)
bool(false)
@@ -0,0 +1,38 @@
--TEST--
Testing null byte injection in imagewebp
--CLEAN--
$tempdir = sys_get_temp_dir(). '/php-gdtest';
foreach (glob($tempdir . "/test*") as $file ) { unlink($file); }
rmdir($tempdir);
--SKIPIF--
<?php
$support = gd_info();
if (!isset($support['WEBP Support']) || $support['WEBP Support'] === false) {
print 'skip webp support not available';
}
?>
--FILE--
<?php
$image = imagecreate(1,1);// 1px image
$tempdir = sys_get_temp_dir(). '/php-gdtest';
if (!file_exists($tempdir) && !is_dir($tempdir)) {
mkdir ($tempdir, 0777, true);
}
$userinput = "1\0"; // from post or get data
$temp = $tempdir. "/test" . $userinput .".tmp";
echo "\nimagewebp TEST\n";
imagewebp($image, $temp);
var_dump(file_exists($tempdir. "/test1"));
var_dump(file_exists($tempdir. "/test1.tmp"));
foreach (glob($tempdir . "/test*") as $file ) { unlink($file); }
--EXPECTF--
imagewbmp TEST
Warning: imagewebp(): Invalid 2nd parameter, filename must not contain null bytes in %s on line %d
bool(false)
bool(false)
+17
View File
@@ -0,0 +1,17 @@
--TEST--
Bug #67917: Using GMP objects with overloaded operators can cause memory exhaustion
--FILE--
<?php
$mem1 = memory_get_usage();
for ($i = 0; $i < 1000; $i++) {
$gmp = gmp_init(42);
$gmp <<= 1;
}
$mem2 = memory_get_usage();
var_dump($mem2 - $mem1 < 100000);
?>
--EXPECT--
bool(true)
+188 -33
View File
@@ -43,6 +43,18 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_gmp_init, 0, 0, 1)
ZEND_ARG_INFO(0, base)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_gmp_import, 0, 0, 1)
ZEND_ARG_INFO(0, data)
ZEND_ARG_INFO(0, word_size)
ZEND_ARG_INFO(0, options)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_gmp_export, 0, 0, 1)
ZEND_ARG_INFO(0, gmpnumber)
ZEND_ARG_INFO(0, word_size)
ZEND_ARG_INFO(0, options)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_gmp_intval, 0, 0, 1)
ZEND_ARG_INFO(0, gmpnumber)
ZEND_END_ARG_INFO()
@@ -117,6 +129,8 @@ static ZEND_GINIT_FUNCTION(gmp);
*/
const zend_function_entry gmp_functions[] = {
ZEND_FE(gmp_init, arginfo_gmp_init)
ZEND_FE(gmp_import, arginfo_gmp_import)
ZEND_FE(gmp_export, arginfo_gmp_export)
ZEND_FE(gmp_intval, arginfo_gmp_intval)
ZEND_FE(gmp_strval, arginfo_gmp_strval)
ZEND_FE(gmp_add, arginfo_gmp_binary)
@@ -204,6 +218,12 @@ typedef struct _gmp_temp {
#define GMP_ROUND_PLUSINF 1
#define GMP_ROUND_MINUSINF 2
#define GMP_MSW_FIRST (1 << 0)
#define GMP_LSW_FIRST (1 << 1)
#define GMP_LITTLE_ENDIAN (1 << 2)
#define GMP_BIG_ENDIAN (1 << 3)
#define GMP_NATIVE_ENDIAN (1 << 4)
#define GMP_42_OR_NEWER \
((__GNU_MP_VERSION >= 5) || (__GNU_MP_VERSION >= 4 && __GNU_MP_VERSION_MINOR >= 2))
@@ -297,7 +317,7 @@ static void gmp_strval(zval *result, mpz_t gmpnum, long base);
static int convert_to_gmp(mpz_t gmpnumber, zval *val, int base TSRMLS_DC);
static void gmp_cmp(zval *return_value, zval *a_arg, zval *b_arg TSRMLS_DC);
/*
/*
* The gmp_*_op functions provide an implementation for several common types
* of GMP functions. The gmp_zval_(unary|binary)_*_op functions have to be manually
* passed zvals to work on, whereas the gmp_(unary|binary)_*_op macros already
@@ -523,7 +543,7 @@ static void shift_operator_helper(gmp_binary_ui_op_t op, zval *return_value, zva
gmp_zval_unary_op(result, op1, op TSRMLS_CC); \
return SUCCESS;
static int gmp_do_operation(zend_uchar opcode, zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */
static int gmp_do_operation_ex(zend_uchar opcode, zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */
{
switch (opcode) {
case ZEND_ADD:
@@ -560,6 +580,26 @@ static int gmp_do_operation(zend_uchar opcode, zval *result, zval *op1, zval *op
}
/* }}} */
static int gmp_do_operation(zend_uchar opcode, zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */
{
zval op1_copy;
int retval;
if (result == op1) {
ZVAL_COPY_VALUE(&op1_copy, op1);
op1 = &op1_copy;
}
retval = gmp_do_operation_ex(opcode, result, op1, op2 TSRMLS_CC);
if (retval == SUCCESS && op1 == &op1_copy) {
zval_dtor(op1);
}
return retval;
}
/* }}} */
static int gmp_compare(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */
{
gmp_cmp(result, op1, op2 TSRMLS_CC);
@@ -579,7 +619,7 @@ static int gmp_serialize(zval *object, unsigned char **buffer, zend_uint *buf_le
PHP_VAR_SERIALIZE_INIT(serialize_data);
INIT_PZVAL(zv_ptr);
gmp_strval(zv_ptr, gmpnum, 10);
php_var_serialize(&buf, &zv_ptr, &serialize_data TSRMLS_CC);
zval_dtor(zv_ptr);
@@ -677,6 +717,12 @@ ZEND_MINIT_FUNCTION(gmp)
#endif
REGISTER_STRING_CONSTANT("GMP_VERSION", (char *)gmp_version, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("GMP_MSW_FIRST", GMP_MSW_FIRST, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("GMP_LSW_FIRST", GMP_LSW_FIRST, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("GMP_LITTLE_ENDIAN", GMP_LITTLE_ENDIAN, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("GMP_BIG_ENDIAN", GMP_BIG_ENDIAN, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("GMP_NATIVE_ENDIAN", GMP_NATIVE_ENDIAN, CONST_CS | CONST_PERSISTENT);
mp_set_memory_functions(gmp_emalloc, gmp_erealloc, gmp_efree);
return SUCCESS;
@@ -714,7 +760,7 @@ ZEND_MODULE_INFO_D(gmp)
/* {{{ convert_to_gmp
* Convert zval to be gmp number */
static int convert_to_gmp(mpz_t gmpnumber, zval *val, int base TSRMLS_DC)
static int convert_to_gmp(mpz_t gmpnumber, zval *val, int base TSRMLS_DC)
{
switch (Z_TYPE_P(val)) {
case IS_LONG:
@@ -727,15 +773,13 @@ static int convert_to_gmp(mpz_t gmpnumber, zval *val, int base TSRMLS_DC)
int skip_lead = 0;
int ret;
if (Z_STRLEN_P(val) > 2) {
if (numstr[0] == '0') {
if (numstr[1] == 'x' || numstr[1] == 'X') {
base = 16;
skip_lead = 1;
} else if (base != 16 && (numstr[1] == 'b' || numstr[1] == 'B')) {
base = 2;
skip_lead = 1;
}
if (Z_STRLEN_P(val) > 2 && numstr[0] == '0') {
if ((base == 0 || base == 16) && (numstr[1] == 'x' || numstr[1] == 'X')) {
base = 16;
skip_lead = 1;
} else if ((base == 0 || base == 2) && (numstr[1] == 'b' || numstr[1] == 'B')) {
base = 2;
skip_lead = 1;
}
}
@@ -768,8 +812,8 @@ static void gmp_strval(zval *result, mpz_t gmpnum, long base) /* {{{ */
out_string = emalloc(num_len + 1);
mpz_get_str(out_string, base, gmpnum);
/*
/*
* From GMP documentation for mpz_sizeinbase():
* The returned value will be exact or 1 too big. If base is a power of
* 2, the returned value will always be exact.
@@ -811,7 +855,7 @@ static void gmp_cmp(zval *return_value, zval *a_arg, zval *b_arg TSRMLS_DC) /* {
FREE_GMP_TEMP(temp_a);
FREE_GMP_TEMP(temp_b);
RETURN_LONG(res);
}
/* }}} */
@@ -819,14 +863,14 @@ static void gmp_cmp(zval *return_value, zval *a_arg, zval *b_arg TSRMLS_DC) /* {
/* {{{ gmp_zval_binary_ui_op
Execute GMP binary operation.
*/
static inline void gmp_zval_binary_ui_op(zval *return_value, zval *a_arg, zval *b_arg, gmp_binary_op_t gmp_op, gmp_binary_ui_op_t gmp_ui_op, int check_b_zero TSRMLS_DC)
static inline void gmp_zval_binary_ui_op(zval *return_value, zval *a_arg, zval *b_arg, gmp_binary_op_t gmp_op, gmp_binary_ui_op_t gmp_ui_op, int check_b_zero TSRMLS_DC)
{
mpz_ptr gmpnum_a, gmpnum_b, gmpnum_result;
int use_ui = 0;
gmp_temp_t temp_a, temp_b;
FETCH_GMP_ZVAL(gmpnum_a, a_arg, temp_a);
if (gmp_ui_op && Z_TYPE_P(b_arg) == IS_LONG && Z_LVAL_P(b_arg) >= 0) {
use_ui = 1;
temp_b.is_used = 0;
@@ -922,7 +966,7 @@ static inline void _gmp_binary_ui_op(INTERNAL_FUNCTION_PARAMETERS, gmp_binary_op
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &a_arg, &b_arg) == FAILURE){
return;
}
gmp_zval_binary_ui_op(return_value, a_arg, b_arg, gmp_op, gmp_ui_op, check_b_zero TSRMLS_CC);
}
/* }}} */
@@ -931,11 +975,11 @@ static inline void _gmp_binary_ui_op(INTERNAL_FUNCTION_PARAMETERS, gmp_binary_op
/* {{{ gmp_zval_unary_op
*/
static inline void gmp_zval_unary_op(zval *return_value, zval *a_arg, gmp_unary_op_t gmp_op TSRMLS_DC)
static inline void gmp_zval_unary_op(zval *return_value, zval *a_arg, gmp_unary_op_t gmp_op TSRMLS_DC)
{
mpz_ptr gmpnum_a, gmpnum_result;
gmp_temp_t temp_a;
FETCH_GMP_ZVAL(gmpnum_a, a_arg, temp_a);
INIT_GMP_RETVAL(gmpnum_result);
@@ -980,7 +1024,7 @@ static inline void _gmp_unary_op(INTERNAL_FUNCTION_PARAMETERS, gmp_unary_op_t gm
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &a_arg) == FAILURE){
return;
}
gmp_zval_unary_op(return_value, a_arg, gmp_op TSRMLS_CC);
}
/* }}} */
@@ -996,7 +1040,7 @@ static inline void _gmp_unary_opl(INTERNAL_FUNCTION_PARAMETERS, gmp_unary_opl_t
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &a_arg) == FAILURE){
return;
}
FETCH_GMP_ZVAL(gmpnum_a, a_arg, temp_a);
RETVAL_LONG(gmp_op(gmpnum_a));
FREE_GMP_TEMP(temp_a);
@@ -1050,6 +1094,118 @@ ZEND_FUNCTION(gmp_init)
}
/* }}} */
int gmp_import_export_validate(long size, long options, int *order, int *endian TSRMLS_DC)
{
if (size < 1) {
php_error_docref(NULL TSRMLS_CC, E_WARNING,
"Word size must be positive, %ld given", size);
return FAILURE;
}
switch (options & (GMP_LSW_FIRST | GMP_MSW_FIRST)) {
case GMP_LSW_FIRST:
*order = -1;
break;
case GMP_MSW_FIRST:
case 0: /* default */
*order = 1;
break;
default:
php_error_docref(NULL TSRMLS_CC, E_WARNING,
"Invalid options: Conflicting word orders");
return FAILURE;
}
switch (options & (GMP_LITTLE_ENDIAN | GMP_BIG_ENDIAN | GMP_NATIVE_ENDIAN)) {
case GMP_LITTLE_ENDIAN:
*endian = -1;
break;
case GMP_BIG_ENDIAN:
*endian = 1;
break;
case GMP_NATIVE_ENDIAN:
case 0: /* default */
*endian = 0;
break;
default:
php_error_docref(NULL TSRMLS_CC, E_WARNING,
"Invalid options: Conflicting word endianness");
return FAILURE;
}
return SUCCESS;
}
/* {{{ proto GMP gmp_import(string data [, int word_size = 1, int options = GMP_MSW_FIRST | GMP_NATIVE_ENDIAN])
Imports a GMP number from a binary string */
ZEND_FUNCTION(gmp_import)
{
char *data;
int data_len;
long size = 1;
long options = GMP_MSW_FIRST | GMP_NATIVE_ENDIAN;
int order, endian;
mpz_ptr gmpnumber;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ll", &data, &data_len, &size, &options) == FAILURE) {
return;
}
if (gmp_import_export_validate(size, options, &order, &endian TSRMLS_CC) == FAILURE) {
RETURN_FALSE;
}
if ((data_len % size) != 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING,
"Input length must be a multiple of word size");
RETURN_FALSE;
}
INIT_GMP_RETVAL(gmpnumber);
mpz_import(gmpnumber, data_len / size, order, size, endian, 0, data);
}
/* }}} */
/* {{{ proto string gmp_export(GMP gmpnumber [, int word_size = 1, int options = GMP_MSW_FIRST | GMP_NATIVE_ENDIAN])
Exports a GMP number to a binary string */
ZEND_FUNCTION(gmp_export)
{
zval *gmpnumber_arg;
long size = 1;
long options = GMP_MSW_FIRST | GMP_NATIVE_ENDIAN;
int order, endian;
mpz_ptr gmpnumber;
gmp_temp_t temp_a;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|ll", &gmpnumber_arg, &size, &options) == FAILURE) {
return;
}
if (gmp_import_export_validate(size, options, &order, &endian TSRMLS_CC) == FAILURE) {
RETURN_FALSE;
}
FETCH_GMP_ZVAL(gmpnumber, gmpnumber_arg, temp_a);
if (mpz_sgn(gmpnumber) == 0) {
RETURN_EMPTY_STRING();
} else {
size_t bits_per_word = size * 8;
size_t count = (mpz_sizeinbase(gmpnumber, 2) + bits_per_word - 1) / bits_per_word;
size_t out_len = count * size;
char *out_string = emalloc(out_len + 1);
mpz_export(out_string, NULL, order, size, endian, 0, gmpnumber);
out_string[out_len] = '\0';
RETURN_STRINGL(out_string, out_len, 0);
}
FREE_GMP_TEMP(temp_a);
}
/* }}} */
/* {{{ proto int gmp_intval(mixed gmpnumber)
Gets signed long value of GMP number */
ZEND_FUNCTION(gmp_intval)
@@ -1059,7 +1215,7 @@ ZEND_FUNCTION(gmp_intval)
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &gmpnumber_arg) == FAILURE){
return;
}
if (IS_GMP(gmpnumber_arg)) {
RETVAL_LONG(mpz_get_si(GET_GMP_FROM_ZVAL(gmpnumber_arg)));
} else {
@@ -1206,7 +1362,7 @@ ZEND_FUNCTION(gmp_div_q)
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid rounding mode");
RETURN_FALSE;
}
}
/* }}} */
@@ -1286,7 +1442,7 @@ ZEND_FUNCTION(gmp_pow)
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Negative exponent not supported");
RETURN_FALSE;
}
INIT_GMP_RETVAL(gmpnum_result);
if (Z_TYPE_P(base_arg) == IS_LONG && Z_LVAL_P(base_arg) >= 0) {
mpz_ui_pow_ui(gmpnum_result, Z_LVAL_P(base_arg), exp);
@@ -1328,10 +1484,9 @@ ZEND_FUNCTION(gmp_powm)
FETCH_GMP_ZVAL_DEP_DEP(gmpnum_mod, mod_arg, temp_mod, temp_exp, temp_base);
if (!mpz_cmp_ui(gmpnum_mod, 0)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Modulus may not be zero");
FREE_GMP_TEMP(temp_base);
if (use_ui) {
FREE_GMP_TEMP(temp_exp);
}
FREE_GMP_TEMP(temp_exp);
FREE_GMP_TEMP(temp_mod);
RETURN_FALSE;
}
@@ -1360,14 +1515,14 @@ ZEND_FUNCTION(gmp_sqrt)
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &a_arg) == FAILURE){
return;
}
FETCH_GMP_ZVAL(gmpnum_a, a_arg, temp_a);
if (mpz_sgn(gmpnum_a) < 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number has to be greater than or equal to 0");
FREE_GMP_TEMP(temp_a);
RETURN_FALSE;
}
}
INIT_GMP_RETVAL(gmpnum_result);
mpz_sqrt(gmpnum_result, gmpnum_a);
@@ -1394,7 +1549,7 @@ ZEND_FUNCTION(gmp_sqrtrem)
FREE_GMP_TEMP(temp_a);
RETURN_FALSE;
}
array_init(return_value);
add_index_zval(return_value, 0, gmp_create(&gmpnum_result1 TSRMLS_CC));
add_index_zval(return_value, 1, gmp_create(&gmpnum_result2 TSRMLS_CC));
@@ -1474,7 +1629,7 @@ ZEND_FUNCTION(gmp_rootrem)
mpz_sub(gmpnum_result2, gmpnum_a, gmpnum_result2);
mpz_abs(gmpnum_result2, gmpnum_result2);
#endif
FREE_GMP_TEMP(temp_a);
}
/* }}} */
+2
View File
@@ -31,6 +31,8 @@ ZEND_MODULE_DEACTIVATE_D(gmp);
ZEND_MODULE_INFO_D(gmp);
ZEND_FUNCTION(gmp_init);
ZEND_FUNCTION(gmp_import);
ZEND_FUNCTION(gmp_export);
ZEND_FUNCTION(gmp_intval);
ZEND_FUNCTION(gmp_strval);
ZEND_FUNCTION(gmp_add);
-21
View File
@@ -1,21 +0,0 @@
--TEST--
Check for gmp presence
--SKIPIF--
<?php if (!extension_loaded("gmp")) print "skip"; ?>
--FILE--
<?php
echo "gmp extension is available";
/*
you can add regression tests for your extension here
the output of your test code has to be equal to the
text in the --EXPECT-- section below for the tests
to pass, differences between the output and the
expected text are interpreted as failure
see php5/tests/README for further information on
writing regression tests
*/
?>
--EXPECT--
gmp extension is available
+18
View File
@@ -0,0 +1,18 @@
--TEST--
Bug #50175: gmp_init() results 0 on given base and number starting with 0x or 0b
--FILE--
<?php
var_dump(gmp_init('0bcd', 16));
var_dump(gmp_init('0xyz', 36));
?>
--EXPECTF--
object(GMP)#%d (1) {
["num"]=>
string(4) "3021"
}
object(GMP)#%d (1) {
["num"]=>
string(5) "44027"
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -10,11 +10,13 @@ var_dump(gmp_div_qr(""));
var_dump(gmp_div_qr(0,1));
var_dump(gmp_div_qr(1,0));
var_dump(gmp_div_qr(gmp_init(1), gmp_init(0)));
var_dump(gmp_div_qr(12653,23482734));
var_dump(gmp_div_qr(12653,23482734, 10));
var_dump(gmp_div_qr(1123123,123));
var_dump(gmp_div_qr(1123123,123, 1));
var_dump(gmp_div_qr(1123123,123, 2));
var_dump(gmp_div_qr(gmp_init(1123123), gmp_init(123)));
var_dump(gmp_div_qr(1123123,123, GMP_ROUND_ZERO));
var_dump(gmp_div_qr(1123123,123, GMP_ROUND_PLUSINF));
var_dump(gmp_div_qr(1123123,123, GMP_ROUND_MINUSINF));
@@ -45,6 +47,9 @@ array(2) {
}
}
Warning: gmp_div_qr(): Zero operand not allowed in %s on line %d
bool(false)
Warning: gmp_div_qr(): Zero operand not allowed in %s on line %d
bool(false)
array(2) {
@@ -110,6 +115,18 @@ array(2) {
string(2) "10"
}
}
array(2) {
[0]=>
object(GMP)#%d (1) {
["num"]=>
string(4) "9131"
}
[1]=>
object(GMP)#%d (1) {
["num"]=>
string(2) "10"
}
}
array(2) {
[0]=>
object(GMP)#%d (1) {
File renamed without changes.
File renamed without changes.
+80
View File
@@ -0,0 +1,80 @@
--TEST--
gmp_export() basic tests
--SKIPIF--
<?php if (!extension_loaded("gmp")) echo "skip"; ?>
--FILE--
<?php
// Tests taken from GMPs own test suite.
// format is [output, size, options, expected]
$export = [
['0',1,GMP_BIG_ENDIAN,''],
['0',2,GMP_BIG_ENDIAN,''],
['0',3,GMP_BIG_ENDIAN,''],
['12345678',1,GMP_BIG_ENDIAN,'12345678'],
['12345678',4,GMP_BIG_ENDIAN,'12345678'],
['12345678',4,GMP_LSW_FIRST | GMP_BIG_ENDIAN,'12345678'],
['12345678',1,GMP_LSW_FIRST | GMP_LITTLE_ENDIAN,'78563412'],
['12345678',4,GMP_LITTLE_ENDIAN,'78563412'],
['12345678',4,GMP_LSW_FIRST | GMP_LITTLE_ENDIAN,'78563412'],
['123456789ABC',2,GMP_BIG_ENDIAN,'123456789abc'],
['123456789ABC',2,GMP_LSW_FIRST | GMP_BIG_ENDIAN,'9abc56781234'],
['123456789ABC',2,GMP_LITTLE_ENDIAN,'34127856bc9a'],
['123456789ABC',2,GMP_LSW_FIRST | GMP_LITTLE_ENDIAN,'bc9a78563412'],
['112233445566778899AABBCC',4,GMP_BIG_ENDIAN,'112233445566778899aabbcc'],
['112233445566778899AABBCC',4,GMP_LSW_FIRST | GMP_BIG_ENDIAN,'99aabbcc5566778811223344'],
['112233445566778899AABBCC',4,GMP_LITTLE_ENDIAN,'4433221188776655ccbbaa99'],
['112233445566778899AABBCC',4,GMP_LSW_FIRST | GMP_LITTLE_ENDIAN,'ccbbaa998877665544332211'],
['100120023003400450056006700780089009A00AB00BC00C',8,GMP_BIG_ENDIAN,'100120023003400450056006700780089009a00ab00bc00c'],
['100120023003400450056006700780089009A00AB00BC00C',8,GMP_LSW_FIRST | GMP_BIG_ENDIAN,'9009a00ab00bc00c50056006700780081001200230034004'],
['100120023003400450056006700780089009A00AB00BC00C',8,GMP_LITTLE_ENDIAN,'044003300220011008800770066005500cc00bb00aa00990'],
['100120023003400450056006700780089009A00AB00BC00C',8,GMP_LSW_FIRST | GMP_LITTLE_ENDIAN,'0cc00bb00aa0099008800770066005500440033002200110']
];
$passed = true;
foreach ($export as $k => $test) {
$gmp = gmp_init($test[0], 16);
$str = gmp_export($gmp, $test[1], $test[2]);
if (is_string($str)) {
$result = bin2hex($str);
if ($result !== $test[3]) {
echo "$k: '$result' !== '{$test[3]}'\n";
$passed = false;
}
} else {
$type = gettype($str);
echo "$k: $type !== '{$test[3]}'\n";
}
}
var_dump($passed);
// Invalid arguments (zpp failure)
var_dump(gmp_export());
// Invalid word sizes
var_dump(gmp_export(123, -1));
var_dump(gmp_export(123, 0));
// Invalid options
var_dump(gmp_export(123, 1, GMP_MSW_FIRST | GMP_LSW_FIRST));
var_dump(gmp_export(123, 1, GMP_BIG_ENDIAN | GMP_LITTLE_ENDIAN));
--EXPECTF--
bool(true)
Warning: gmp_export() expects at least 1 parameter, 0 given in %s on line %d
NULL
Warning: gmp_export(): Word size must be positive, -1 given in %s on line %d
bool(false)
Warning: gmp_export(): Word size must be positive, 0 given in %s on line %d
bool(false)
Warning: gmp_export(): Invalid options: Conflicting word orders in %s on line %d
bool(false)
Warning: gmp_export(): Invalid options: Conflicting word endianness in %s on line %d
bool(false)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+91
View File
@@ -0,0 +1,91 @@
--TEST--
gmp_import() basic tests
--SKIPIF--
<?php if (!extension_loaded("gmp")) echo "skip"; ?>
--FILE--
<?php
// Tests taken from GMPs own test suite.
// format is [expected, size, options, input]
$import = [
['0',1,GMP_BIG_ENDIAN,''],
['12345678',1,GMP_BIG_ENDIAN,'12345678'],
['12345678',4,GMP_BIG_ENDIAN,'12345678'],
['12345678',4,GMP_LSW_FIRST | GMP_BIG_ENDIAN,'12345678'],
['12345678',1,GMP_LSW_FIRST | GMP_LITTLE_ENDIAN,'78563412'],
['12345678',4,GMP_LITTLE_ENDIAN,'78563412'],
['12345678',4,GMP_LSW_FIRST | GMP_LITTLE_ENDIAN,'78563412'],
['123456789abc',2,GMP_BIG_ENDIAN,'123456789abc'],
['123456789abc',2,GMP_LSW_FIRST | GMP_BIG_ENDIAN,'9abc56781234'],
['123456789abc',2,GMP_LITTLE_ENDIAN,'34127856bc9a'],
['123456789abc',2,GMP_LSW_FIRST | GMP_LITTLE_ENDIAN,'bc9a78563412'],
['112233445566778899aabbcc',4,GMP_BIG_ENDIAN,'112233445566778899aabbcc'],
['112233445566778899aabbcc',4,GMP_LSW_FIRST | GMP_BIG_ENDIAN,'99aabbcc5566778811223344'],
['112233445566778899aabbcc',4,GMP_LITTLE_ENDIAN,'4433221188776655ccbbaa99'],
['112233445566778899aabbcc',4,GMP_LSW_FIRST | GMP_LITTLE_ENDIAN,'ccbbaa998877665544332211'],
['100120023003400450056006700780089009a00ab00bc00c',8,GMP_BIG_ENDIAN,'100120023003400450056006700780089009a00ab00bc00c'],
['100120023003400450056006700780089009a00ab00bc00c',8,GMP_LSW_FIRST | GMP_BIG_ENDIAN,'9009a00ab00bc00c50056006700780081001200230034004'],
['100120023003400450056006700780089009a00ab00bc00c',8,GMP_LITTLE_ENDIAN,'044003300220011008800770066005500cc00bb00aa00990'],
['100120023003400450056006700780089009a00ab00bc00c',8,GMP_LSW_FIRST | GMP_LITTLE_ENDIAN,'0cc00bb00aa0099008800770066005500440033002200110']
];
$passed = true;
foreach ($import as $k => $test) {
$gmp = gmp_import(hex2bin($test[3]), $test[1], $test[2]);
if ($gmp instanceof GMP) {
$result = gmp_strval($gmp, 16);
if ($result !== $test[0]) {
echo "$k: '$result' !== '{$test[0]}'\n";
$passed = false;
}
} else {
$type = gettype($gmp);
echo "$k: $type !== '{$test[0]}'\n";
}
}
var_dump($passed);
// Invalid arguments (zpp failure)
var_dump(gmp_import());
// Invalid word sizes
var_dump(gmp_import('a', -1));
var_dump(gmp_import('a', 0));
// Invalid data lengths
var_dump(gmp_import('a', 2));
var_dump(gmp_import('aa', 3));
var_dump(gmp_import(str_repeat('a', 100), 64));
// Invalid options
var_dump(gmp_import('a', 1, GMP_MSW_FIRST | GMP_LSW_FIRST));
var_dump(gmp_import('a', 1, GMP_BIG_ENDIAN | GMP_LITTLE_ENDIAN));
--EXPECTF--
bool(true)
Warning: gmp_import() expects at least 1 parameter, 0 given in %s on line %d
NULL
Warning: gmp_import(): Word size must be positive, -1 given in %s on line %d
bool(false)
Warning: gmp_import(): Word size must be positive, 0 given in %s on line %d
bool(false)
Warning: gmp_import(): Input length must be a multiple of word size in %s on line %d
bool(false)
Warning: gmp_import(): Input length must be a multiple of word size in %s on line %d
bool(false)
Warning: gmp_import(): Input length must be a multiple of word size in %s on line %d
bool(false)
Warning: gmp_import(): Invalid options: Conflicting word orders in %s on line %d
bool(false)
Warning: gmp_import(): Invalid options: Conflicting word endianness in %s on line %d
bool(false)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -19,6 +19,9 @@ var_dump(gmp_strval(gmp_powm($n,$e,1000)));
$m = gmp_init(900);
var_dump(gmp_strval(gmp_powm($n,$e,$m)));
var_dump(gmp_powm(5, 11, 0));
var_dump(gmp_powm(5, "11", gmp_init(0)));
var_dump(gmp_powm(array(),$e,$m));
var_dump(gmp_powm($n,array(),$m));
var_dump(gmp_powm($n,$e,array()));
@@ -46,6 +49,12 @@ string(3) "331"
string(3) "171"
string(3) "371"
Warning: gmp_powm(): Modulus may not be zero in %s on line %d
bool(false)
Warning: gmp_powm(): Modulus may not be zero in %s on line %d
bool(false)
Warning: gmp_powm(): Unable to convert variable to GMP - wrong type in %s on line %d
bool(false)
File renamed without changes.
File renamed without changes.
@@ -1,21 +1,11 @@
--TEST--
gmp_root() and gmp_rootrem() basic tests
gmp_rootrem() basic tests
--SKIPIF--
<?php if (!extension_loaded("gmp")) print "skip"; ?>
--FILE--
<?php
var_dump(gmp_root(1000, 3));
var_dump(gmp_root(100, 3));
var_dump(gmp_root(-100, 3));
var_dump(gmp_root(1000, 4));
var_dump(gmp_root(100, 4));
var_dump(gmp_root(-100, 4));
var_dump(gmp_root(0, 3));
var_dump(gmp_root(100, 0));
var_dump(gmp_root(100, -3));
var_dump(gmp_rootrem());
var_dump(gmp_rootrem(1000, 3));
var_dump(gmp_rootrem(100, 3));
@@ -31,39 +21,8 @@ var_dump(gmp_rootrem(100, -3));
?>
--EXPECTF--
object(GMP)#%d (1) {
["num"]=>
string(2) "10"
}
object(GMP)#%d (1) {
["num"]=>
string(1) "4"
}
object(GMP)#%d (1) {
["num"]=>
string(2) "-4"
}
object(GMP)#%d (1) {
["num"]=>
string(1) "5"
}
object(GMP)#%d (1) {
["num"]=>
string(1) "3"
}
Warning: gmp_root(): Can't take even root of negative number in %s on line %d
bool(false)
object(GMP)#%d (1) {
["num"]=>
string(1) "0"
}
Warning: gmp_root(): The root must be positive in %s on line %d
bool(false)
Warning: gmp_root(): The root must be positive in %s on line %d
bool(false)
Warning: gmp_rootrem() expects exactly 2 parameters, 0 given in %s on line %d
NULL
array(2) {
[0]=>
object(GMP)#%d (1) {
+58
View File
@@ -0,0 +1,58 @@
--TEST--
gmp_root() basic tests
--SKIPIF--
<?php if (!extension_loaded("gmp")) print "skip"; ?>
--FILE--
<?php
var_dump(gmp_root());
var_dump(gmp_root(1000, 3));
var_dump(gmp_root(100, 3));
var_dump(gmp_root(-100, 3));
var_dump(gmp_root(1000, 4));
var_dump(gmp_root(100, 4));
var_dump(gmp_root(-100, 4));
var_dump(gmp_root(0, 3));
var_dump(gmp_root(100, 0));
var_dump(gmp_root(100, -3));
?>
--EXPECTF--
Warning: gmp_root() expects exactly 2 parameters, 0 given in %s on line %d
NULL
object(GMP)#%d (1) {
["num"]=>
string(2) "10"
}
object(GMP)#%d (1) {
["num"]=>
string(1) "4"
}
object(GMP)#%d (1) {
["num"]=>
string(2) "-4"
}
object(GMP)#%d (1) {
["num"]=>
string(1) "5"
}
object(GMP)#%d (1) {
["num"]=>
string(1) "3"
}
Warning: gmp_root(): Can't take even root of negative number in %s on line %d
bool(false)
object(GMP)#%d (1) {
["num"]=>
string(1) "0"
}
Warning: gmp_root(): The root must be positive in %s on line %d
bool(false)
Warning: gmp_root(): The root must be positive in %s on line %d
bool(false)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -5,6 +5,8 @@ gmp_testbit() basic tests
--FILE--
<?php
var_dump(gmp_testbit());
$n = gmp_init(0);
var_dump(gmp_testbit($n, -10));
var_dump(gmp_testbit($n, 0));
@@ -38,6 +40,9 @@ var_dump(gmp_strval($n));
echo "Done\n";
?>
--EXPECTF--
Warning: gmp_testbit() expects exactly 2 parameters, 0 given in %s on line %d
NULL
Warning: gmp_testbit(): Index must be greater than or equal to zero in %s on line %d
bool(false)
bool(false)
File renamed without changes.
Loaded 100 of 157 files, more files were not shown because too many files have changed in this diff. Show more