Compare commits

...
Author SHA1 Message Date
Ferenc Kovacs a964242f19 5.6.0beta2 2014-05-01 16:42:03 +02:00
Ferenc Kovacs ce20287810 Merge branch 'PHP-5.6' into PHP-5.6.0
* PHP-5.6: (271 commits)
  one heading is enough
  add new NEWS block for alpha3
  XFAIL the leaking multibyte tests, we should really get to the bottom of this
  Fixed numbering in UPGRADING file
  Updated NEWS for fixed phpdbg issue #85
  Added stdion/stdout/stderr constsnts and their php:// wrappers Fixes issue #85
  add missing NEWS entry to the correct release where it was added
  5.5.12 was released yesterday
  add missing NEWS entry to the correct release where it was added
  Updated NEWS entry for phpdbg
  add missing NEWS entry to the correct release where it was added
  add some missing NEWS entries
  fix test locality inconsitency
  BFN
  fix bug #64247 (CURLOPT_INFILE doesn't allow reset)
  Added further notice about removal of IS_CONSTANT_INDEX/ARRAY macros
  Fix bug #67060: use default mode of 660
  separate travis jobs for debug and non-debug builds
  separate travis jobs for TS and NTS builds
  put this test back to XFAIL, as it was before, since it is still leaking memory
  ...

Conflicts:
	NEWS
2014-05-01 16:40:20 +02:00
Ferenc Kovacs 0a73853798 one heading is enough 2014-05-01 16:38:06 +02:00
Ferenc Kovacs 75640d0d85 add new NEWS block for alpha3 2014-05-01 16:24:49 +02:00
Ferenc Kovacs 95325e5c5d XFAIL the leaking multibyte tests, we should really get to the bottom of this 2014-05-01 12:49:57 +02:00
Bob Weinand d27b76a779 Fixed numbering in UPGRADING file 2014-05-01 12:27:38 +02:00
Bob Weinand 5d13b7f191 Updated NEWS for fixed phpdbg issue #85 2014-05-01 11:46:35 +02:00
Bob Weinand 3ad8616aff Added stdion/stdout/stderr constsnts and their php:// wrappers
Fixes issue #85
2014-05-01 11:43:46 +02:00
Ferenc Kovacs a67d4d33c2 add missing NEWS entry to the correct release where it was added 2014-05-01 10:56:39 +02:00
Ferenc Kovacs 3da5ef47ca Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  5.5.12 was released yesterday
  add missing NEWS entry to the correct release where it was added
  add missing NEWS entry to the correct release where it was added
2014-05-01 10:56:21 +02:00
Ferenc Kovacs 0842200501 5.5.12 was released yesterday 2014-05-01 10:54:15 +02:00
Ferenc Kovacs b14b8dfc10 add missing NEWS entry to the correct release where it was added 2014-05-01 10:52:24 +02:00
Ferenc Kovacs ef7821506a Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  add missing NEWS entry to the correct release where it was added
2014-05-01 10:52:13 +02:00
Bob Weinand 5ba657ce89 Updated NEWS entry for phpdbg 2014-05-01 10:50:41 +02:00
Ferenc Kovacs 1c13ad7c0e add missing NEWS entry to the correct release where it was added 2014-05-01 10:50:08 +02:00
Ferenc Kovacs f090ddeac7 add some missing NEWS entries 2014-05-01 10:43:34 +02:00
Michael Wallner 42fbb952d7 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fix test locality inconsitency
2014-04-30 13:02:43 +02:00
Michael Wallner b79301d11f fix test locality inconsitency 2014-04-30 13:01:59 +02:00
Michael Wallner aaad7ead55 BFN 2014-04-30 09:29:37 +02:00
Michael Wallner 407612083f Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fix bug #64247 (CURLOPT_INFILE doesn't allow reset)
2014-04-30 09:28:21 +02:00
Michael Wallner 54fee59598 fix bug #64247 (CURLOPT_INFILE doesn't allow reset) 2014-04-30 09:27:58 +02:00
Ferenc Kovacs 98fcee48f9 Merge remote-tracking branch 'origin/PHP-5.5' into PHP-5.6
* origin/PHP-5.5:
  separate travis jobs for debug and non-debug builds
  separate travis jobs for TS and NTS builds
  put this test back to XFAIL, as it was before, since it is still leaking memory

Conflicts:
	ext/mbstring/tests/zend_multibyte-08.phpt
2014-04-30 00:07:49 +02:00
Ferenc Kovacs 220e0d4a55 Merge remote-tracking branch 'tyrael/more_travis' into PHP-5.5
* tyrael/more_travis:
  separate travis jobs for debug and non-debug builds
  separate travis jobs for TS and NTS builds
  put this test back to XFAIL, as it was before, since it is still leaking memory
2014-04-29 23:34:10 +02:00
Bob Weinand 82ecdcdb63 Added further notice about removal of IS_CONSTANT_INDEX/ARRAY macros 2014-04-29 20:43:58 +02:00
Stanislav Malyshev c397fcc35f Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fix bug #67060: use default mode of 660
2014-04-29 09:16:24 -07:00
Stanislav Malyshev 770fcdab90 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fix bug #67060: use default mode of 660
2014-04-29 09:15:23 -07:00
Stanislav Malyshev 35ceea928b Fix bug #67060: use default mode of 660 2014-04-29 09:14:11 -07:00
Ferenc Kovacs ea1d42641c separate travis jobs for debug and non-debug builds 2014-04-29 16:09:51 +02:00
Ferenc Kovacs 4cad8fcad2 separate travis jobs for TS and NTS builds 2014-04-29 16:09:42 +02:00
Ferenc Kovacs 35d213c9ce put this test back to XFAIL, as it was before, since it is still leaking memory 2014-04-29 15:58:00 +02:00
Anatol Belski 6d20c5bea8 updated NEWS 2014-04-29 13:47:09 +02:00
Anatol Belski 3023257ff0 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  updated NEWS
  Fixed bug #66431 Special Character via COM Interface (CP_UTF8)
2014-04-29 13:46:38 +02:00
Anatol Belski 3fbacdc6e8 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fixed bug #66431 Special Character via COM Interface (CP_UTF8)
2014-04-29 13:46:03 +02:00
Anatol Belski b22f33afe2 updated NEWS 2014-04-29 13:44:54 +02:00
Anatol Belski 2d625b5f81 Fixed bug #66431 Special Character via COM Interface (CP_UTF8) 2014-04-29 13:40:44 +02:00
Popa Adrian Marius aa1c4fd0be Merge branch 'PHP-5.5' of https://git.php.net/push/php-src into PHP-5.5
* 'PHP-5.5' of https://git.php.net/push/php-src:
  enable gmp for tests
2014-04-28 12:15:53 +03:00
Popa Adrian Marius 6de915205c Merge branch 'PHP-5.6' of https://git.php.net/push/php-src into PHP-5.6
* 'PHP-5.6' of https://git.php.net/push/php-src:
  Fix crashes in GMP serialize/unserialize
  enable gmp for tests
2014-04-28 12:15:16 +03:00
Popa Adrian Marius 0edf1d4fe6 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Cleanup ZEND_MODULE_API_NO => 20050922
2014-04-28 12:14:01 +03:00
Popa Adrian Marius a827fa9cd8 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Cleanup ZEND_MODULE_API_NO => 20050922
2014-04-28 12:13:44 +03:00
Popa Adrian Marius bb422cb60e Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Cleanup ZEND_MODULE_API_NO => 20050922
2014-04-28 12:13:11 +03:00
Popa Adrian Marius dbcd6304bb Cleanup ZEND_MODULE_API_NO => 20050922 2014-04-28 12:12:52 +03:00
Stanislav Malyshev c18ae51aeb Fix crashes in GMP serialize/unserialize 2014-04-28 01:22:02 -07:00
Stanislav Malyshev 3842417289 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  enable gmp for tests
2014-04-28 00:57:47 -07:00
Stanislav Malyshev b576cbbf05 enable gmp for tests 2014-04-28 00:56:22 -07:00
Anatol Belski 3b6bf6eec8 Merge remote-tracking branch 'phpdbg/master' into PHP-5.6
* phpdbg/master:
  C89 compat
2014-04-27 18:01:26 +02:00
Anatol Belski 4aa80db758 C89 compat 2014-04-27 17:57:38 +02:00
Anatol Belski a10dc3aa4f Merge remote-tracking branch 'phpdbg/master' into PHP-5.6
* phpdbg/master:
  removed /EHa as __try/__catch syntax is used anyway
  fix ZEND_DEBUG usage
  fix CFLAGS_PHPDBGS and some formatting
2014-04-26 00:15:32 +02:00
Anatol Belski c8617d82cc removed /EHa as __try/__catch syntax is used anyway
see http://msdn.microsoft.com/en-us/library/1deeycx5.aspx
2014-04-26 00:07:13 +02:00
Anatol Belski cdb775906d fix ZEND_DEBUG usage 2014-04-25 22:33:28 +02:00
Anatol Belski 70fdb21d93 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fixed test
2014-04-25 17:40:33 +02:00
Anatol Belski 1c7f4d2b4b Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  fixed test
2014-04-25 17:40:19 +02:00
Anatol Belski d3dcd61623 fixed test 2014-04-25 17:39:53 +02:00
Anatol Belski 38248e445d updated NEWS 2014-04-25 17:27:07 +02:00
Anatol Belski 6448916535 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  updated NEWS
  Fixed bug #67118 DateTime constructor crash with invalid data
2014-04-25 17:26:20 +02:00
Anatol Belski 46344b11b4 updated NEWS 2014-04-25 17:25:37 +02:00
Anatol Belski cc9f02751b Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fixed bug #67118 DateTime constructor crash with invalid data
2014-04-25 17:24:58 +02:00
Anatol Belski c1aa9baf29 Fixed bug #67118 DateTime constructor crash with invalid data 2014-04-25 17:23:26 +02:00
Stanislav Malyshev 5ddee799d2 update NEWS 2014-04-25 00:00:49 -07:00
Stanislav Malyshev 1bad4aa355 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  update NEWS
  add a test case previously broken by a bad fix
  Revert "Fixed bug #64604"
2014-04-25 00:00:20 -07:00
Stanislav Malyshev 81098de41c update NEWS 2014-04-25 00:00:01 -07:00
Stanislav Malyshev f6841d250a Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  add a test case previously broken by a bad fix
  Revert "Fixed bug #64604"
2014-04-24 23:59:32 -07:00
Stanislav Malyshev 03c703b8bd add a test case previously broken by a bad fix 2014-04-24 23:58:38 -07:00
Stanislav Malyshev a328803803 Revert "Fixed bug #64604"
This reverts commit b05c088a3a.
Breaks parsing urls where query has : in it, like: /foo/bar?baz=goo:boo
2014-04-24 23:50:45 -07:00
Anatol Belski 5c34146104 updated libmagic.patch for 5.6+ 2014-04-24 20:16:06 +02:00
Anatol Belski 305c025cdd Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  updated libmagic.patch
2014-04-24 20:15:01 +02:00
Anatol Belski db960e82b4 updated libmagic.patch 2014-04-24 20:13:47 +02:00
Anatol Belski 8f43032ea4 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  backport this piece from 5.6, related to the #66307 fix
2014-04-24 19:52:53 +02:00
Anatol Belski d7bb09cc1d backport this piece from 5.6, related to the #66307 fix 2014-04-24 19:50:23 +02:00
Anatol Belski 0c381e19ad updated NEWS 2014-04-24 19:35:52 +02:00
Anatol Belski 74ce9da5dc Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed bug #66307 Fileinfo crashes with powerpoint files

Conflicts:
	ext/fileinfo/libmagic/readcdf.c
2014-04-24 19:33:54 +02:00
Anatol Belski 03fa5501a8 Fixed bug #66307 Fileinfo crashes with powerpoint files 2014-04-24 19:30:34 +02:00
Anatol Belski 4350c89428 fix CFLAGS_PHPDBGS and some formatting 2014-04-24 13:15:16 +02:00
Anatol Belski cd2641973c Merge remote-tracking branch 'phpdbg/master' into PHP-5.6 2014-04-24 11:05:52 +02:00
Anatol Belski 3e6a387454 use a portable strndup implementation 2014-04-24 11:01:54 +02:00
Anatol Belski 165994043a fixed C89 compat 2014-04-24 11:00:36 +02:00
Anatol Belski 5da403264f prepare config.w32 2014-04-24 10:58:30 +02:00
Anatol Belski 9280e25534 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fix dll export
2014-04-24 10:52:59 +02:00
Anatol Belski acfed1c4c7 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  fix dll export
2014-04-24 10:52:22 +02:00
Anatol Belski 03be983398 fix dll export 2014-04-24 10:51:42 +02:00
krakjoe f1493e0069 add parser files to dist 2014-04-24 08:09:35 +01:00
Stanislav Malyshev ab8065e4ec Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fix accepting ill-formed UTF-8 characters
2014-04-22 16:57:47 -07:00
Stanislav Malyshev aca526a13b Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fix accepting ill-formed UTF-8 characters

Conflicts:
	ext/phar/phar_path_check.c
2014-04-22 16:57:17 -07:00
Jakub Zelenka 61499bf282 Fix accepting ill-formed UTF-8 characters
Conflicts:
	ext/phar/phar_path_check.c
2014-04-22 16:55:58 -07:00
George Wang 742f4704a9 sapi/litespeed/lsapi_main.c: Fix bug #63228
Fix compiling error at line 606 (error: format not a string
literal and no format arguments [-Werror=format-security]
2014-04-22 10:48:14 -03:00
Bob Weinand 4784d99866 Added autogenerated phpdbg parser files to .gitignore 2014-04-22 00:19:38 +02:00
Bob Weinand 708af5fd8e Merge sapi/phpdbg into PHP-5.6 2014-04-21 23:30:08 +02:00
Bob Weinand 447ec05f31 Fixed infinite loop when quitting (sometimes) 2014-04-21 23:14:06 +02:00
krakjoe c1e12316f1 fixup help, behaviour of step command when not executing 2014-04-21 22:00:21 +01:00
krakjoe e9668d4ce8 buffer input to repeat commands 2014-04-21 21:43:19 +01:00
krakjoe bb0f0347dd Merge branch 'master' of https://github.com/krakjoe/phpdbg 2014-04-21 21:28:02 +01:00
krakjoe 0873f2bfb4 remove -e option in favour of taking script from argv[] 2014-04-21 21:24:41 +01:00
Stanislav Malyshev 32d5f269a0 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Allow valid multi-byte utf-8 characters to be allowed as file names in phar archives.
2014-04-20 17:23:52 -07:00
Stanislav Malyshev dafb2af705 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Allow valid multi-byte utf-8 characters to be allowed as file names in phar archives.

Conflicts:
	ext/phar/phar_path_check.c
2014-04-20 17:22:21 -07:00
Danack ea4cee93c8 Allow valid multi-byte utf-8 characters to be allowed as file names in phar archives. 2014-04-20 17:19:20 -07:00
Andrew Kehrig 186ffcb72c Fix #50444: PDO-ODBC changes for 64-bit
This bug is also referenced in
[#61777](https://bugs.php.net/bug.php?id=61777) and is still present in
the latest stable release of the 5.5 branch. I see two tickets exist for
this problem already, and I'm just submitting these changes via github
as a reminder that this is a serious problem for anyone using PDO_ODBC
on the x64 builds.
2014-04-20 16:49:15 -07:00
Stanislav Malyshev 5272d6c896 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fix a compiler warning in php_rand.h
2014-04-20 16:36:36 -07:00
Stanislav Malyshev 8b903f24d5 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fix a compiler warning in php_rand.h
2014-04-20 16:35:49 -07:00
Rouven Weßling 68283c9f4a Fix a compiler warning in php_rand.h 2014-04-20 16:35:36 -07:00
Stanislav Malyshev 0df431482f Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fix #66908: php-fpm reload leaks epoll_create() file descriptor
2014-04-20 16:25:03 -07:00
Stanislav Malyshev 6bad228b4e Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fix #66908: php-fpm reload leaks epoll_create() file descriptor
2014-04-20 16:23:43 -07:00
Julio Pintos 49341e992a Fix #66908: php-fpm reload leaks epoll_create() file descriptor
This patch fixes descriptor leak which could lead to DoS once Max open files is reached
2014-04-20 16:21:49 -07:00
Stanislav Malyshev 774f16318b Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fix bug #65701: Do not use cache for file file copy
2014-04-20 15:27:39 -07:00
Stanislav Malyshev 5addf223d5 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fix bug #65701: Do not use cache for file file copy
2014-04-20 15:25:03 -07:00
Boro Sitnikovski a18cec1b86 Fix bug #65701: Do not use cache for file file copy 2014-04-20 15:22:44 -07:00
Bob Weinand 577c6ed0ce Fixed stepping 2014-04-20 20:20:59 +02:00
Bob Weinand 422dc49c0d Merge branch 'master' of https://github.com/krakjoe/phpdbg
Conflicts:
	phpdbg_help.c
	phpdbg_prompt.c
2014-04-20 19:55:44 +02:00
krakjoe f96feea00c step by line and opcode modes preserved, set stepping added, help updated 2014-04-20 18:46:35 +01:00
krakjoe 373b9ecd05 rename next to continue, cleanup help 2014-04-20 17:10:52 +01:00
Bob Weinand 56293fc0dd Update help 2014-04-20 16:55:49 +02:00
Bob Weinand e097919f16 Stepping is now line by line with gdb style command 2014-04-20 16:47:24 +02:00
Bob Weinand d21d5c98a5 Fixed potential bug in run command 2014-04-20 13:28:11 +02:00
Bob Weinand 5a7497904e Breakpoints now hit only once if line was not switched 2014-04-20 13:25:28 +02:00
Bob Weinand 508c379428 Added error on compile failure in exec cmd 2014-04-20 12:54:50 +02:00
krakjoe fd74024a49 remove compile command 2014-04-19 21:22:09 +01:00
krakjoe 89868dd4d9 Merge branch 'master' of https://github.com/krakjoe/phpdbg 2014-04-19 21:09:10 +01:00
krakjoe 11c707d836 auto compile when execution context set 2014-04-19 21:08:54 +01:00
Anatol Belski 1bca3ecacc updated libs versions 2014-04-18 16:08:42 +02:00
Anatol Belski 620d7207ef added some notes about the win build system 2014-04-18 16:04:15 +02:00
Anatol Belski b93d040dc5 UPGRADING note about bug #67072 2014-04-18 15:54:49 +02:00
Anatol Belski f09f7f22d8 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  UPGRADING note about bug #67072
  UPGRADING note about bug #67072
2014-04-18 15:54:17 +02:00
Anatol Belski 3586d14b61 UPGRADING note about bug #67072 2014-04-18 15:50:15 +02:00
Anatol Belski fae4f64865 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  UPGRADING note about bug #67072
2014-04-18 15:44:18 +02:00
Anatol Belski 53c68811ba UPGRADING note about bug #67072 2014-04-18 15:43:05 +02:00
Anatol Belski cfd20c90a5 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  refixed the test related to bug #67072
  Improved the fix for bug #67072, thanks Nikita
2014-04-18 15:17:12 +02:00
Anatol Belski d963cf94a5 refixed the test related to bug #67072 2014-04-18 15:16:09 +02:00
Anatol Belski 7c400dc867 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Improved the fix for bug #67072, thanks Nikita
2014-04-18 15:14:42 +02:00
Anatol Belski c2acdbdd3d Improved the fix for bug #67072, thanks Nikita 2014-04-18 15:13:32 +02:00
Stanislav Malyshev ce4c78dd07 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed test case for 5328d42
2014-04-17 17:36:26 -07:00
Tjerk Meesters 5e988a888a Fixed test case for 5328d42 2014-04-17 17:36:03 -07:00
Bob Weinand c02003e6b8 Merge branch 'PHP-5.5' into PHP-5.6 2014-04-17 17:23:05 +02:00
Bob Weinand 0ec122b804 Merge branch 'PHP-5.4' into PHP-5.5 2014-04-17 17:21:21 +02:00
Levi Morrison 6e1e98d7b8 These links to ~helly don't work anymore. 2014-04-17 17:20:24 +02:00
Anatol Belski 00bef4b1c7 updated NEWS 2014-04-17 11:08:27 +02:00
Anatol Belski f9a1eab435 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  updated NEWS
  Fixed bug #67072 Echoing unserialized "SplFileObject" crash
2014-04-17 11:07:22 +02:00
Anatol Belski de6f297e7c updated NEWS 2014-04-17 11:06:55 +02:00
Anatol Belski dc407c2402 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fixed bug #67072 Echoing unserialized "SplFileObject" crash

Conflicts:
	ext/standard/var_unserializer.c
2014-04-17 11:05:21 +02:00
Anatol Belski 5328d42899 Fixed bug #67072 Echoing unserialized "SplFileObject" crash
The actual issue lays in the unserializer code which doesn't honor
the unserialize callback. By contrast, the serialize callback is
respected. This leads to the situation that even if a class has
disabled the serialization explicitly, user could still construct
a vulnerable string which would result bad things when trying
to unserialize.

This conserns also the classes implementing Serializable as well
as some core classes disabling serialize/unserialize callbacks
explicitly (PDO, SimpleXML, SplFileInfo and co). As of now, the
flow is first to call the unserialize callback (if available),
then call __wakeup. If the unserialize callback returns with no
success, no object is instantiated. This makes the scheme used
by internal classes effective, to disable unserialize just assign
zend_class_unserialize_deny as callback.
2014-04-17 10:48:14 +02:00
Bob Weinand a0ee96289b Commented out a few PHPDBG_IS_QUITTING checks to fix bug
If it does not work, please revert...
2014-04-16 20:55:41 +02:00
Bob Weinand 58c3f7e699 command tokens just available at the beginning now 2014-04-16 20:55:29 +02:00
Bob Weinand 2ab2b74af3 Also check for length to not segfault 2014-04-16 20:55:02 +02:00
Anatol Belski 542a7aceb1 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  updated UPGRADING
2014-04-16 20:49:21 +02:00
Anatol Belski 05dac1d0a5 updated UPGRADING 2014-04-16 20:48:31 +02:00
Anatol Belski ba03830241 updated UPGRADING 2014-04-16 20:47:17 +02:00
Anatol Belski 9d39177943 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  correct the bug #67081 fix
2014-04-16 15:08:34 +02:00
Anatol Belski 947b20bc67 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  correct the bug #67081 fix
2014-04-16 15:08:08 +02:00
Anatol Belski 7a5f1663c6 correct the bug #67081 fix 2014-04-16 15:06:57 +02:00
Anatol Belski e74a03fa43 updated NEWS 2014-04-16 14:16:36 +02:00
Anatol Belski 801d312507 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  updated NEWS
  Fixed bug #67081 DOMDocumentType->internalSubset returns entire DOCTYPE tag, not only the subset
2014-04-16 14:15:52 +02:00
Anatol Belski 228a3537d3 updated NEWS 2014-04-16 14:15:26 +02:00
Anatol Belski 444690eca8 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fixed bug #67081 DOMDocumentType->internalSubset returns entire DOCTYPE tag, not only the subset
2014-04-16 14:14:52 +02:00
Anatol Belski 5224614f23 Fixed bug #67081 DOMDocumentType->internalSubset returns entire DOCTYPE tag, not only the subset 2014-04-16 14:13:45 +02:00
Bob Weinand b1a22ae6dc Updated version number to 0.4.0
Made run accept any input and lexer re2c compatible
2014-04-16 13:56:26 +02:00
Bob Weinand 7ab1c07a51 Fixed bug: ev output was buffered instead of directly displayed 2014-04-16 11:40:29 +02:00
Anatol Belski d0e10dbde0 updated NEWS 2014-04-16 09:49:48 +02:00
Anatol Belski b4c238c8cf Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed bug #67079 Missing MIME types for XML/XSL files
2014-04-16 09:48:31 +02:00
Anatol Belski 9eb726b3ab Fixed bug #67079 Missing MIME types for XML/XSL files 2014-04-16 09:47:49 +02:00
Stanislav Malyshev ea8370c29a Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  5.4.29 is next
  5.5.12RC1 setup

Conflicts:
	configure.in
	main/php_version.h
2014-04-15 17:17:39 -07:00
Stanislav Malyshev 6bf7c10b20 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  5.4.29 is next

Conflicts:
	configure.in
	main/php_version.h
2014-04-15 17:15:21 -07:00
Stanislav Malyshev 1d34d82231 5.4.29 is next 2014-04-15 16:51:38 -07:00
Anatol Belski aaf197180a Fixed bug #66907 Solaris 10 is missing strcasestr and needs substitute 2014-04-15 10:26:49 -07:00
Bob Weinand a981e3a1d2 Fixed refcount removing if specified 2014-04-15 19:20:01 +02:00
Julien Pauli b8d029435d 5.5.12RC1 setup 2014-04-15 17:57:27 +02:00
Bob Weinand 0e8637441c Fixed segfault when input == NULL 2014-04-15 15:52:46 +00:00
Stanislav Malyshev bfbb409b32 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fix test - on CI somebody could create a process in the meantime
2014-04-14 15:47:53 -07:00
Stanislav Malyshev 173cd183c9 fix test - doesn't seem to produce warning 2014-04-14 15:47:06 -07:00
Stanislav Malyshev b727934591 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fix test - on CI somebody could create a process in the meantime
2014-04-14 15:45:53 -07:00
Stanislav Malyshev eea75e7146 Fix test - on CI somebody could create a process in the meantime 2014-04-14 15:44:23 -07:00
Anatol Belski 634e6b61d9 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fix windows build
2014-04-14 23:34:50 +02:00
Anatol Belski 793f67e852 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  fix windows build
2014-04-14 23:30:14 +02:00
Anatol Belski 24b72e7a27 fix windows build 2014-04-14 23:29:38 +02:00
Stanislav Malyshev 6adc84a701 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fix #66942: openssl_seal() memory leak
  ws fix
2014-04-14 13:37:10 -07:00
Chuan Ma f413a77b3d Fix #66942: openssl_seal() memory leak
Fix #66952: memory leak in openssl_open()
2014-04-14 13:36:17 -07:00
Stanislav Malyshev 99b01fb3d7 ws fix 2014-04-14 13:35:59 -07:00
Stanislav Malyshev 8bc82718ae Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fix #66942: openssl_seal() memory leak
  ws fix

Conflicts:
	ext/openssl/openssl.c
2014-04-14 13:35:24 -07:00
Chuan Ma a186312832 Fix #66942: openssl_seal() memory leak
Fix #66952: memory leak in openssl_open()
2014-04-14 13:24:14 -07:00
Stanislav Malyshev 56f9727305 ws fix 2014-04-14 13:16:53 -07:00
Andrey Hristov 22acea99ff Merge branch 'PHP-5.5' of git.php.net:php-src into PHP-5.5 2014-04-14 23:11:29 +03:00
Andrey Hristov 84fcc44083 Merge branch 'PHP-5.6' of git.php.net:php-src into PHP-5.6 2014-04-14 23:11:16 +03:00
Stanislav Malyshev 1bd3841132 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fix null byte in LDAP bindings
  Fix bug #66171: better handling of symlinks
  Fix null byte in LDAP bindings
  Fix bug #66171: better handling of symlinks
2014-04-14 10:51:34 -07:00
Stanislav Malyshev 59900dd37f Fix null byte in LDAP bindings 2014-04-14 10:51:32 -07:00
Stanislav Malyshev 41569b1029 Fix bug #66171: better handling of symlinks 2014-04-14 10:51:31 -07:00
Stanislav Malyshev 5b8c4b8de5 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fix null byte in LDAP bindings
  Fix bug #66171: better handling of symlinks
2014-04-14 10:46:52 -07:00
Stanislav Malyshev ed4de188dd Fix null byte in LDAP bindings 2014-04-14 10:46:46 -07:00
Stanislav Malyshev 7f43aeb167 Fix bug #66171: better handling of symlinks 2014-04-14 10:46:45 -07:00
Stanislav Malyshev ad1b9eef98 Fix null byte in LDAP bindings 2014-04-14 10:44:53 -07:00
Stanislav Malyshev 40a9316dff Fix bug #66171: better handling of symlinks 2014-04-14 10:44:53 -07:00
Bob Weinand 9b05f5d132 Made refcount info switchable by set refcount on/off. Default: off 2014-04-14 19:37:31 +02:00
Anatol Belski 9e76e87ca9 fix crash in MINFO when no mysqlnd plugins are loaded 2014-04-14 17:44:47 +02:00
Andrey Hristov ce99f292de Merge branch 'PHP-5.5' into PHP-5.6
Conflicts:
	ext/mysqli/tests/mysqli_change_user_old.phpt
2014-04-14 17:44:13 +03:00
Anatol Belski 2b28fd9ab0 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  backported some ext/intl tests from 5.6 into 5.4
2014-04-14 16:42:51 +02:00
Andrey Hristov dae70a2ff7 Add test 2014-04-14 17:35:01 +03:00
Anatol Belski f6db1057fd Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  backported some ext/intl tests from 5.6 into 5.4

Conflicts:
	ext/intl/tests/collator_get_sort_key_variant2.phpt
	ext/intl/tests/locale_get_display_name3.phpt
2014-04-14 16:34:08 +02:00
Anatol Belski 4268504084 backported some ext/intl tests from 5.6 into 5.4 2014-04-14 16:31:18 +02:00
Bob Weinand 2dad85ae61 Return SUCCESS and do not confuse use with errors 2014-04-14 16:26:27 +02:00
Bob Weinand 8c22352e88 Added $this and superglobals support for watchpoints 2014-04-14 15:47:36 +02:00
Anatol Belski d483e1daca test fixes for ICU 53.1 2014-04-14 15:34:32 +02:00
Bob Weinand fdd9bc2050 Clean up information on watchpoint breaks 2014-04-14 10:46:52 +02:00
Anatol Belski e3abcf7826 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed bug #67033 Remove reference to Windows 95
2014-04-14 09:33:49 +02:00
Anatol Belski 57d657987d Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fixed bug #67033 Remove reference to Windows 95
2014-04-14 09:33:31 +02:00
Anatol Belski 95c57bb646 Fixed bug #67033 Remove reference to Windows 95 2014-04-14 09:32:31 +02:00
Stanislav Malyshev cfe24a7be2 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fix NEWS
2014-04-13 20:17:14 -07:00
Stanislav Malyshev 6e81f80a1e MErge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  fix NEWS
2014-04-13 20:16:54 -07:00
Stanislav Malyshev b80243aece fix NEWS 2014-04-13 20:16:27 -07:00
Stanislav Malyshev 7c9209a0d1 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fix #66021 (Blank line inside empty array/object)
2014-04-13 18:56:16 -07:00
Stanislav Malyshev 9bba219c75 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fix #66021 (Blank line inside empty array/object)
2014-04-13 18:55:28 -07:00
Stanislav Malyshev 5e66ce9293 Merge branch 'pull-request/518' into PHP-5.4
* pull-request/518:
  Fix #66021 (Blank line inside empty array/object)
2014-04-13 18:50:39 -07:00
Stanislav Malyshev 0d4c28f2e1 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed bug #64604
2014-04-13 18:39:17 -07:00
Stanislav Malyshev 30ec1c0051 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fixed bug #64604
2014-04-13 18:38:36 -07:00
Ingo Walz b05c088a3a Fixed bug #64604 2014-04-13 18:37:40 -07:00
Stanislav Malyshev 1ef0bd2633 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fix #66562: Consistency bug where curl_multi_getcontent behaves different from curl_exec
2014-04-13 18:13:52 -07:00
Stanislav Malyshev f1206aef70 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fix #66562: Consistency bug where curl_multi_getcontent behaves different from curl_exec
2014-04-13 18:13:09 -07:00
Freek 5558d0db9b Fix #66562: Consistency bug where curl_multi_getcontent behaves different from curl_exec
curl_exec returns an empty string when data is received from a domain that returns zero content. curl_multi_getcontent
returned null. Now it returns an empty string fixing the incosistency
2014-04-13 18:12:17 -07:00
Stanislav Malyshev c1d5937f7f Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fix bug #66482, replace wrong item name 'priority' with 'process.priority' in php-fpm.conf
2014-04-13 17:32:42 -07:00
Stanislav Malyshev 5811610d71 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fix bug #66482, replace wrong item name 'priority' with 'process.priority' in php-fpm.conf
2014-04-13 17:31:44 -07:00
itxx00 636adf251c Fix bug #66482, replace wrong item name 'priority' with 'process.priority' in php-fpm.conf 2014-04-13 17:30:50 -07:00
Stanislav Malyshev 04a11b850a Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fix windows build
2014-04-13 17:04:00 -07:00
Stanislav Malyshev df8e34bcc1 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fix windows build
2014-04-13 17:03:28 -07:00
Stanislav Malyshev 3a2660b302 Fix windows build 2014-04-13 17:02:21 -07:00
Stanislav Malyshev d3c4292db7 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fix bug #66721
2014-04-13 15:55:45 -07:00
Stanislav Malyshev 733b09442d Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fix bug #66721
2014-04-13 15:55:07 -07:00
Boro Sitnikovski 8c88b6e81c Fix bug #66721
Add NULL check to php_date_parse_tzfile's retval
2014-04-13 15:51:55 -07:00
Stanislav Malyshev 1be29a404a Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fix apr_psprintf format string from e0df4e3dba
2014-04-13 15:39:32 -07:00
Stanislav Malyshev c5275b4a92 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  fix apr_psprintf format string from e0df4e3dba
2014-04-13 15:37:55 -07:00
Jeff Trawick 442264ffd6 fix apr_psprintf format string from e0df4e3dba 2014-04-13 15:36:43 -07:00
Stanislav Malyshev 3aab84c100 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed bug #67024 - getimagesize should recognize BMP files with negative height
2014-04-13 15:25:58 -07:00
Stanislav Malyshev fe72caa6e5 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fixed bug #67024 - getimagesize should recognize BMP files with negative height
2014-04-13 15:23:32 -07:00
Gabor Buella 1010200da5 Fixed bug #67024 - getimagesize should recognize BMP files with negative height 2014-04-13 15:17:04 -07:00
Bob Weinand a93e734f81 Merge branch 'PHP-5.5' into PHP-5.6 2014-04-14 00:08:36 +02:00
Daniel Lowrey 0e023e9784 Bug #66840: Fix broken build when extension built separately 2014-04-13 15:17:50 -06:00
Bob Weinand bf3edbada6 Merge branch 'PHP-5.4' into PHP-5.5 2014-04-13 23:03:53 +02:00
Bob Weinand beda5093b4 Reverted to 5a0da281e5
Discussion: http://news.php.net/php.cvs/76836
2014-04-13 23:01:31 +02:00
Bob Weinand 3636a91adc Merge branch 'PHP-5.5' into PHP-5.6 2014-04-13 19:40:39 +02:00
Bob Weinand 191d9fc227 Merge branch 'PHP-5.4' into PHP-5.5 2014-04-13 19:37:06 +02:00
Bob Weinand f07e37c96d Forgot title in phpt for bug #67064 2014-04-13 19:34:17 +02:00
Bob Weinand 2f3056fecc Updated NEWS 2014-04-13 19:32:51 +02:00
Bob Weinand fb99409f89 Merge branch 'PHP-5.5' into PHP-5.6 2014-04-13 19:27:43 +02:00
Bob Weinand eca0644e0a Merge branch 'PHP-5.4' into PHP-5.5 2014-04-13 19:25:07 +02:00
Bob Weinand 1a4a9eede5 Fix bug #67064 in a BC safe way
You can use an optional parameter now when implementing the Countable interface
to get the $mode passed to count().
2014-04-13 19:24:12 +02:00
krakjoe 774a879e65 tidy help 2014-04-13 16:58:45 +01:00
Bob Weinand 2f54e68ade CR CR etc. in help 2014-04-13 17:55:18 +02:00
Bob Weinand f53e438933 Added information about $var parameter in watchpoints 2014-04-13 17:48:35 +02:00
Bob Weinand eae91d9de7 Added help 2014-04-13 17:34:27 +02:00
krakjoe ce7097fb60 less strange! 2014-04-13 14:43:34 +01:00
Bob Weinand 286dd4dc71 Remove some dead code... 2014-04-13 13:33:07 +02:00
krakjoe faa7e3264e fix compat with lexer stuff 2014-04-13 11:42:47 +01:00
krakjoe 5c69f3dd8b Merge branch 'master' of https://github.com/krakjoe/phpdbg into watchpoints_recursive 2014-04-13 11:32:43 +01:00
krakjoe c2c4a5bd25 fix build 2014-04-13 11:32:35 +01:00
krakjoe 1b2f12159b fix command structure 2014-04-13 11:17:04 +01:00
krakjoe 42355fb9bf Merge branch 'master' of https://github.com/krakjoe/phpdbg into watchpoints_recursive
Conflicts:
	config.m4
	phpdbg.c
	phpdbg_prompt.c
2014-04-13 11:07:38 +01:00
Bob Weinand a3eafe535f Added UPGRAING notice for bug #66015 in BC break section 2014-04-13 11:38:52 +02:00
Nikita Popov fb5d5d9700 Add new zend_hash_* APIs to UPGRADING.INTERNALS 2014-04-13 10:49:14 +02:00
Nikita Popov 57b88ba6ea Add str_* macros to UPGRADING.INTERNALS 2014-04-13 10:49:14 +02:00
Ferenc Kovacs 20036525e2 Fix bug #66660: use str_efree instead of efree to handle interned empty strings correctly 2014-04-13 10:45:46 +02:00
krakjoe b8a4a4c700 squish warnings 2014-04-13 09:07:15 +01:00
krakjoe 0dc9be6f1e cleanup 2014-04-13 08:48:59 +01:00
krakjoe 8c23b038cd fix moar 2014-04-13 08:43:19 +01:00
krakjoe 4387723ef7 fix argc/argv 2014-04-13 08:34:16 +01:00
krakjoe 65984df220 merge master 2014-04-13 08:09:53 +01:00
krakjoe ef86b57f3b Merge branch 'master' of https://github.com/krakjoe/phpdbg into lexer
Conflicts:
	phpdbg_prompt.c
2014-04-13 08:06:42 +01:00
krakjoe 2fde2ada50 fix addr parameters 2014-04-13 08:06:21 +01:00
Matteo Beccati 7fd9898a2d Fixed bug #66604 'pdo/php_pdo_error.h' not copied to the include dir 2014-04-13 08:53:21 +02:00
Ferenc Kovacs aefc8f22b3 Fix bug #66568: the second arg for unserialize is optional. 2014-04-13 02:49:35 +02:00
Ferenc Kovacs 51cbb85ea9 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fix typo
2014-04-13 01:57:15 +02:00
Ferenc Kovacs 2876bde634 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  fix typo
2014-04-13 01:56:47 +02:00
Ferenc Kovacs 5a0da281e5 fix typo 2014-04-13 01:55:55 +02:00
Bob Weinand 3db29ee439 Added support for command line arg passing
"phpdbg -- arg" in shell
"run arg" in phpdbg prompt
2014-04-13 00:27:46 +02:00
Bob Weinand 53b1dce587 Merge branch 'PHP-5.5' into PHP-5.6 2014-04-12 23:54:57 +02:00
Bob Weinand 9302be3754 Merge branch 'PHP-5.4' into PHP-5.5 2014-04-12 23:54:29 +02:00
Bob Weinand edd90e5ae3 Made usage of php_hash_environment useful by updating instead of just adding argc 2014-04-12 23:53:21 +02:00
Bob Weinand 86a7731763 Fixed frame number order 2014-04-12 22:08:02 +02:00
Bob Weinand 48bcaf2e72 Retain full compability for all micro versions since PHP 5.4 2014-04-12 18:00:33 +02:00
Bob Weinand 096e40a027 Fixed tests for recent constant array changes 2014-04-11 20:13:24 +02:00
Bob Weinand 99d1a1bb3f Shut up, my lovely compiler; I do not like your warnings 2014-04-11 19:33:56 +02:00
Bob Weinand 35b895fdf0 Removed useless void* parameter and replaced with zend_bool on zval_update_constant* functions 2014-04-11 19:18:58 +02:00
Bob Weinand 920c5508ef Updated NEWS 2014-04-11 18:30:14 +02:00
Bob Weinand ee2a7c7d41 Fixed disallowal of array usage in constants at run-time
Added at the same time the possibility of array dereferencing
to complete the set of features (useful application of arrays in constants)
2014-04-11 18:21:46 +02:00
Bob Weinand ad05d3898e Updated zend_vm_execute.h 2014-04-11 16:18:42 +02:00
Anatol Belski 5c87ed058b fix syntax error in vc++ 2014-04-11 13:08:46 +02:00
Anatol Belski 4c32c8d549 updated NEWS 2014-04-11 11:01:42 +02:00
Anatol Belski c5181ef6c2 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed bug #66967 Updated the bundled libsqlite to 3.8.4.3
2014-04-11 11:01:01 +02:00
Anatol Belski e08172e0d5 Fixed bug #66967 Updated the bundled libsqlite to 3.8.4.3 2014-04-11 11:00:10 +02:00
Bob Weinand f7ac308950 Updated NEWS 2014-04-11 10:10:36 +02:00
Bob Weinand f614fc6898 Fix bug #66015 by reverting "Removed operations on constant arrays." 2014-04-11 10:08:44 +02:00
Andrey Hristov d3f390a268 Here comes the news 2014-04-10 18:15:42 +03:00
Andrey Hristov e02fdcf3f7 Merge branch 'PHP-5.6' of git.php.net:php-src into PHP-5.6 2014-04-10 18:13:58 +03:00
Andrey Hristov af5fa00c97 Fix the fix 2014-04-10 18:13:44 +03:00
Popa Adrian Marius 4048872317 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Cleanup $ is not needed for git
2014-04-10 17:43:29 +03:00
Popa Adrian Marius 1a0b80fe90 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Cleanup $ is not needed for git
2014-04-10 17:43:09 +03:00
Popa Adrian Marius 1c3ed86211 Cleanup $ is not needed for git 2014-04-10 17:42:32 +03:00
Andrey Hristov 090c3e87c0 Merge branch 'PHP-5.6' of git.php.net:php-src into PHP-5.6
Conflicts:
	ext/mysqli/tests/mysqli_begin_transaction.phpt
2014-04-10 16:49:13 +03:00
Andrey Hristov 63791d055a New result fetching mode for mysqlnd, which should use less memory but
implies more memory copy. The old method is still available and can be used.
It stays as default. Choosing the method is through a flag to mysqli_query()/mysqli_real_query()
New mode can be forced with an INI setting, for all extensions that support this mode
(ext/mysql and mysqli, because PDO due to it's architecture can't support it)
The setting is mysqlnd.fetch_data_copy=[0|1]
2014-04-10 16:44:54 +03:00
Ferenc Kovacs 11d102ebbc Merge branch 'PHP-5.6' into PHP-5.6.0
* PHP-5.6:
  fix typo
  fix typo
  fix typo
2014-04-10 07:11:48 +02:00
Ferenc Kovacs 3204ad5858 fix typo 2014-04-10 07:07:11 +02:00
Ferenc Kovacs 5cc93aa9a6 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fix typo
  fix typo
2014-04-10 07:06:53 +02:00
Ferenc Kovacs b78d1b901c Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  fix typo
2014-04-10 07:06:14 +02:00
Ferenc Kovacs 49d46ad29e fix typo 2014-04-10 07:05:55 +02:00
Ferenc Kovacs 9540ced221 fix typo 2014-04-10 07:05:07 +02:00
Ferenc Kovacs eb44463e35 5.6.0beta1 2014-04-10 06:49:31 +02:00
Ferenc Kovacs b3b1c0b63d remove the beta2 news block as we don't need that in the release tag 2014-04-10 06:47:25 +02:00
Ferenc Kovacs 8871aa912f Merge branch 'PHP-5.6' into PHP-5.6.0
* PHP-5.6: (240 commits)
  add a NEWS block for beta2
  add missing entries to NEWS
  abstract namespace for unix sockets is a linux only feature
  Don't test for specific non-zero substr_compare() return value
  Add only_integer_keys option to zend_hash_reindex
  Don't always separate splice replacement array
  Add zend_hash_splice
  Add zend_hash_reindex
  Remove some usages of hashtable internals
  Updated NEWS
  fixed bug66702 : regexiterator's invert flag doesn't work as expected
  Updated NEWS for #67043
  Fixed bug 67043
  cleanup
  Fixes bug #66071: isc_interprete is unsafe and deprecated , it is replaced with fb_iterpret
  updated libs versions
  fixed the test for ICI >= 52.1
  Fix Linux specific fail in error traces Linux apparently does not like memcpy in overlapping regions...
  add missing skip to the output, so we actually skip this test
  fix the test according to how new date code does it
  ...
2014-04-10 06:45:31 +02:00
Ferenc Kovacs 08faf19d09 add a NEWS block for beta2 2014-04-10 06:22:43 +02:00
Ferenc Kovacs ec6a0966bc add missing entries to NEWS 2014-04-10 06:21:31 +02:00
Ferenc Kovacs cbcce72308 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  abstract namespace for unix sockets is a linux only feature
2014-04-09 19:02:56 +02:00
Ferenc Kovacs e00e4b9334 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  abstract namespace for unix sockets is a linux only feature
2014-04-09 19:02:25 +02:00
Ferenc Kovacs 2c8aeda6dc abstract namespace for unix sockets is a linux only feature 2014-04-09 19:01:01 +02:00
Tjerk Meesters 16ae472769 Merge branch 'PHP-5.5' into PHP-5.6 2014-04-09 20:11:07 +08:00
Tjerk Meesters 287790d5c8 Don't test for specific non-zero substr_compare() return value 2014-04-09 20:10:34 +08:00
Nikita Popov ad2ef3d97e Add only_integer_keys option to zend_hash_reindex
This allows to either do a full reindex, or only reindex the integer
keys.
2014-04-09 12:31:21 +02:00
Nikita Popov f485c84a14 Don't always separate splice replacement array
Only perform separation when a typecast is done. Avoids doing a
full hash copy in many cases.
2014-04-09 12:31:21 +02:00
Nikita Popov 22d3eb3117 Add zend_hash_splice
This implements the original functionality of php_splice, but
as an in-place operation, thus avoiding copying the HT.

This is much faster (~10x) if the splice removes a small portion
of the array and doesn't insert many elements.
2014-04-09 12:31:21 +02:00
Nikita Popov 1aa8719e32 Add zend_hash_reindex
The implementation differs from the original in array.c in that it
rehashes the hashtable in the same loop. This is approximately two
times faster (not counting the rare case of a purely associative
array).
2014-04-09 12:31:21 +02:00
Nikita Popov eaf44ec397 Remove some usages of hashtable internals 2014-04-09 12:31:21 +02:00
Etienne Kneuss 6006a3ed51 Merge branch 'PHP-5.5' into PHP-5.6 2014-04-09 11:36:36 +02:00
Etienne Kneuss a95a6e93ee Updated NEWS 2014-04-09 11:35:54 +02:00
Joshua Thijssen e8d6c6587d fixed bug66702 : regexiterator's invert flag doesn't work as expected 2014-04-09 11:13:33 +02:00
Tjerk Meesters 2cdf38b7a0 Updated NEWS for #67043 2014-04-09 07:36:34 +08:00
Tjerk Meesters 2aba2494f5 Merge branch 'PHP-5.5' into PHP-5.6 2014-04-09 07:34:49 +08:00
Tjerk Meesters 032921d80c Fixed bug 67043 2014-04-09 07:33:55 +08:00
Popa Adrian Marius 002c8e8356 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  cleanup
  Fixes bug #66071: isc_interprete is unsafe and deprecated , it is replaced with fb_iterpret
2014-04-08 17:52:22 +03:00
Popa Adrian Marius 4141ceb795 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  cleanup
  Fixes bug #66071: isc_interprete is unsafe and deprecated , it is replaced with fb_iterpret
2014-04-08 17:51:54 +03:00
Popa Adrian Marius 0ea731fc83 cleanup 2014-04-08 17:51:06 +03:00
Popa Adrian Marius cc20351134 Fixes bug #66071: isc_interprete is unsafe and deprecated , it is replaced with fb_iterpret 2014-04-08 17:50:41 +03:00
Anatol Belski ff5896a04c Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  updated libs versions
2014-04-08 11:43:32 +02:00
Anatol Belski 7a71f5d112 updated libs versions 2014-04-08 11:42:58 +02:00
Anatol Belski 964f65484c Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fixed the test for ICI >= 52.1
2014-04-07 17:41:32 +02:00
Anatol Belski 040194d6a0 fixed the test for ICI >= 52.1 2014-04-07 17:40:56 +02:00
Bob Weinand 0e273217cf Fix Linux specific fail in error traces
Linux apparently does not like memcpy in overlapping regions...
2014-04-07 17:14:38 +02:00
Ferenc Kovacs 7446766dab add missing skip to the output, so we actually skip this test 2014-04-07 16:57:52 +02:00
Stanislav Malyshev 63e7b84593 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fix the test according to how new date code does it
  fix to work on different ICU versions
2014-04-05 20:13:24 -07:00
Stanislav Malyshev ee1b807219 fix the test according to how new date code does it 2014-04-05 20:09:53 -07:00
Stanislav Malyshev 8b0d133b13 fix to work on different ICU versions 2014-04-05 19:30:55 -07:00
Stanislav Malyshev cf910f351a multibytes tests still fail, put them in XFAIL
clean up XFAIL from tests no longer failing
2014-04-05 18:34:39 -07:00
Anatol Belski 12e222ee91 updated NEWS 2014-04-05 09:49:51 +02:00
Anatol Belski a094f6d255 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  updated NEWS
  Fixed bug #66084 simplexml_load_string() mangles empty node name
2014-04-05 09:48:54 +02:00
Anatol Belski a3d6f28312 updated NEWS 2014-04-05 09:48:20 +02:00
Anatol Belski bbfda90d72 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fixed bug #66084 simplexml_load_string() mangles empty node name
2014-04-05 09:47:14 +02:00
Anatol Belski a0beddf5e9 Fixed bug #66084 simplexml_load_string() mangles empty node name 2014-04-05 09:46:24 +02:00
Stanislav Malyshev 38e084d312 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  cleanup NEWS
2014-04-03 15:57:08 -07:00
Stanislav Malyshev c1f273908e Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  cleanup NEWS
2014-04-03 15:56:46 -07:00
Stanislav Malyshev 7e5de3a1ce cleanup NEWS 2014-04-03 15:54:00 -07:00
Bob Weinand 9d72a84f06 Add array watchpoints if recursive zval watchpoint changed + WS 2014-04-03 19:53:58 +00:00
Bob Weinand fcacee0595 Fixed deleting watchpoints (plus error in btree_delete) 2014-04-03 19:34:08 +00:00
Michael Wallner b628c36a85 NEWS 2014-04-03 10:41:45 +02:00
Michael Wallner 55005c8638 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  NEWS
  Fix Bug #66736 	fpassthru broken
2014-04-03 10:41:24 +02:00
Michael Wallner 60ef357ffc NEWS 2014-04-03 10:40:42 +02:00
Michael Wallner bbd25ca01f Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fix Bug #66736 	fpassthru broken
2014-04-03 10:40:20 +02:00
Michael Wallner d08b4dbf23 Fix Bug #66736 fpassthru broken 2014-04-03 10:40:06 +02:00
Michael Wallner 1c2bcec68a NEWS 2014-04-03 09:09:51 +02:00
Michael Wallner 5d42ce838c Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  NEWS
  Fix bug #66182 	exit in stream filter produces segfault
2014-04-03 09:09:24 +02:00
Michael Wallner f17fe2cabc NEWS 2014-04-03 09:09:15 +02:00
Michael Wallner ba4fddd2da Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fix bug #66182 	exit in stream filter produces segfault
2014-04-03 09:08:35 +02:00
Michael Wallner 7ab5c593f7 Fix bug #66182 exit in stream filter produces segfault
Unfortunately, a segv caused by exit cannot be tested reliably.
2014-04-03 09:07:35 +02:00
Michael Wallner 06e6d42ee3 NEWS 2014-04-02 15:39:07 +02:00
Michael Wallner 68c57f8149 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  NEWS
  Fixed bug #61019 (Out of memory on command stream_get_contents)
2014-04-02 15:38:35 +02:00
Michael Wallner 9eb0c634d4 NEWS 2014-04-02 15:38:22 +02:00
Michael Wallner f453917f62 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fixed bug #61019 (Out of memory on command stream_get_contents)
2014-04-02 15:37:50 +02:00
Michael Wallner 1ec83d44a1 Fixed bug #61019 (Out of memory on command stream_get_contents) 2014-04-02 15:36:39 +02:00
Michael Wallner c4a3f67708 NEWS 2014-04-02 11:14:34 +02:00
Michael Wallner 80d58ca8cd Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  NEWS
2014-04-02 11:13:42 +02:00
Michael Wallner 68556f3384 NEWS 2014-04-02 11:13:21 +02:00
Michael Wallner 669459da8c Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fix bug #64330
2014-04-02 11:11:23 +02:00
Michael Wallner af147ac9b7 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fix bug #64330
2014-04-02 11:10:59 +02:00
Michael Wallner 91a9d24aa3 Fix bug #64330
stream_socket_server() creates wrong Abstract Namespace UNIX sockets
2014-04-02 11:09:26 +02:00
Anatol Belski 88a44b15d7 update NEWS 2014-04-01 10:14:38 +02:00
Anatol Belski ef6538875f Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  updated NEWS
  updated NEWS
  added test for bug #53965
  Fixed bug #53965 <xsl:include> cannot find files w/ relative paths when loaded w/ "file://"
2014-04-01 10:13:38 +02:00
Anatol Belski 8e238148f9 updated NEWS 2014-04-01 10:12:56 +02:00
Anatol Belski eb84d5d0a6 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  updated NEWS
  added test for bug #53965
  Fixed bug #53965 <xsl:include> cannot find files w/ relative paths when loaded w/ "file://"
2014-04-01 10:12:06 +02:00
Anatol Belski f244513fc0 updated NEWS 2014-04-01 10:11:40 +02:00
Anatol Belski fca1501ed6 added test for bug #53965 2014-04-01 10:08:08 +02:00
Anatol Belski 3cb056f523 Fixed bug #53965 <xsl:include> cannot find files w/ relative paths when loaded w/ "file://" 2014-04-01 10:07:18 +02:00
Anatol Belski e265df460d updated libmagic.patch 2014-03-31 17:24:15 +02:00
Remi Collet 3f6073602b NEWS 2014-03-31 16:58:10 +02:00
Remi Collet 62305edc5b Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  NEWS
  NEWS
  Fixed Bug #66987 Memory corruption in fileinfo ext (bigendian)
2014-03-31 16:57:39 +02:00
Remi Collet 60fb57d4f6 NEWS 2014-03-31 16:57:29 +02:00
Remi Collet 178eac6c98 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  NEWS
  Fixed Bug #66987 Memory corruption in fileinfo ext (bigendian)
2014-03-31 16:57:12 +02:00
Remi Collet fca331cae9 NEWS 2014-03-31 16:57:02 +02:00
Remi Collet 2c204a55af Fixed Bug #66987 Memory corruption in fileinfo ext (bigendian)
On little endian:
	map->p == php_magic_database
	map->magic[i] = pointer into the map

	map->p == NULL
	map->magic[i] = pointer to allocated memory

On big endian (ppc64, s390x, ...):
	map->p != php_magic_database and map->p != NULL
        map->magic[i] = pointer into a copy of the map

Trying to efree pointer in the later cause memory corruption
Thanks to dkatulek / Red Hat for the report.
2014-03-31 16:50:47 +02:00
Anatol Belski 5f54cecde9 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  update lib versions
2014-03-27 18:19:43 +01:00
Anatol Belski 972c451c73 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  update lib versions

Conflicts:
	win32/build/libs_version.txt
2014-03-27 18:19:24 +01:00
Anatol Belski 1283722589 update lib versions 2014-03-27 18:18:06 +01:00
Yasuo Ohgaki a84e5dc37d Remove unneeded string copy.
Allow to set ''(empty string values) internal/input/output_encoding for better compatibility. i.e. Runtime INI value changes.
More compliance to the RFC. Improve/add encoding handling tests. i.e. Rather than set encoding automagic way, detect it.
2014-03-27 17:20:57 +09:00
Andrey Hristov 7ccbfb2e84 Merge branch 'PHP-5.5' into PHP-5.6 2014-03-26 14:27:25 +02:00
Andrey Hristov 84cd0f9911 Merge branch 'PHP-5.5' of git.php.net:php-src into PHP-5.5 2014-03-26 13:57:13 +02:00
Andrey Hristov 89ea2650a1 Fix test 2014-03-26 13:56:58 +02:00
Derick Rethans dcc0644cde Merge branch 'PHP-5.5' into PHP-5.6 2014-03-25 12:17:19 +00:00
Derick Rethans 039cb10fa3 Merge branch 'PHP-5.4' into PHP-5.5 2014-03-25 12:17:15 +00:00
Derick Rethans 170cf3ec00 - Updated to version 2014.2 (2014b) 2014-03-25 12:17:14 +00:00
Remi Collet 5f0428e8cc fix merge issue 2014-03-25 12:07:15 +01:00
Tjerk Meesters 98163c7d1b Updated NEWS for #66834 2014-03-25 18:16:30 +08:00
Tjerk Meesters 5dee3c11fe Call offsetGet() when called with isset() on ArrayObject derivatives 2014-03-25 18:15:18 +08:00
Remi Collet c5f6d1ab29 NEWS 2014-03-25 11:04:49 +01:00
Remi Collet 64d7dd55d3 Fix merge (5.6 already have file 5.17) 2014-03-25 11:03:59 +01:00
Remi Collet 8b7b67a21b NEWS 2014-03-25 11:01:56 +01:00
Remi Collet 84b0ab6d8f Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  NEWS
  Fixed bug #66946 extensive backtracking in awk rule regular expression CVE-2013-7345
  Fixed bug #66946 extensive backtracking in awk rule regular expression CVE-2013-7345
2014-03-25 11:01:20 +01:00
Remi Collet 3616db6d38 NEWS 2014-03-25 11:00:47 +01:00
Remi Collet 4374a52e9d Fixed bug #66946 extensive backtracking in awk rule regular expression
CVE-2013-7345

Applied upstream patch:
https://github.com/file/file/commit/ef2329cf71acb59204dd981e2c6cce6c81fe467c

Add the magicdata.patch to track patches applied to upstream data file.
2014-03-25 11:00:33 +01:00
Remi Collet 1df558c6a0 Fixed bug #66946 extensive backtracking in awk rule regular expression
CVE-2013-7345

Applied upstream patch:
https://github.com/file/file/commit/ef2329cf71acb59204dd981e2c6cce6c81fe467c

Add the magicdata.patch to track patches applied to upstream data file.
2014-03-25 10:58:50 +01:00
Anatol Belski 655f2973eb Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fix disabling PGO for extensions, rel bug #65715
2014-03-25 06:46:06 +01:00
Anatol Belski 7477f5b387 fix disabling PGO for extensions, rel bug #65715 2014-03-25 06:44:54 +01:00
Anatol Belski 59dcf9879b Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  more fixes related to bug #65715
2014-03-24 19:19:06 +01:00
Anatol Belski 223f7d9a44 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  more fixes related to bug #65715
2014-03-24 19:18:39 +01:00
Anatol Belski 6612e1ba6a more fixes related to bug #65715 2014-03-24 19:15:02 +01:00
Michael Wallner caba0203e8 fix some warnings 2014-03-24 17:51:50 +01:00
Michael Wallner 275b2c420d PHP-5.6 compatibility for apache2 filter SAPI 2014-03-24 17:48:28 +01:00
Bob Weinand e55bbd47af Use the internal zend_get_opcode_name() function
Requires now >=5.4.24 or >=5.5.8 or >=5.6
2014-03-24 14:46:14 +01:00
Anatol Belski 26f7051cf4 updated NEWS 2014-03-24 10:31:08 +01:00
Anatol Belski 13e8486550 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  updated NEWS
  updated NEWS
  Fixed bug #65715 php5embed.lib isn't provided anymore
2014-03-24 10:30:05 +01:00
Anatol Belski 8558640a6a updated NEWS 2014-03-24 10:29:39 +01:00
Anatol Belski 76066b304c Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  updated NEWS
  Fixed bug #65715 php5embed.lib isn't provided anymore
2014-03-24 10:28:48 +01:00
Anatol Belski 5efda763be updated NEWS 2014-03-24 10:28:21 +01:00
Anatol Belski 17a57ad980 Fixed bug #65715 php5embed.lib isn't provided anymore 2014-03-24 10:24:37 +01:00
Bob Weinand c86ba551ac Merge branch 'master' into watchpoints_recursive
Conflicts:
	phpdbg.c
	phpdbg_utils.c
	phpdbg_utils.h
2014-03-23 23:32:13 +01:00
Bob Weinand 30fab784dc Fixed TSRM build 2014-03-23 14:57:25 +01:00
Bob Weinand bd2305f1d2 Fixed possible duplication of watchpoints output 2014-03-22 21:27:25 -04:00
Bob Weinand 7b0219212d Fixed possible segmentation fault upon unset with watchpoints 2014-03-22 09:39:39 -04:00
Anatol Belski 9d4001f1c8 fix C89 compat 2014-03-22 10:44:01 +01:00
Andrey Hristov 61103cc25c Merge branch 'PHP-5.6' of git.php.net:php-src into PHP-5.6 2014-03-21 14:33:44 +02:00
Nikita Popov f331ed1414 Revert "Add helper function for updating bucket contents"
Reverting this for now, because it would require further changes
thanks to the zend signals tsrms-but-only-sometimes awesomeness.
2014-03-21 01:32:49 +01:00
Nikita Popov 4e7e301dda Rename+move zend_hash_apply_deleter and reuse it
The interruption handling was normalized to wrap the entire deletion
operation (instead of leaving out the destructor call and/or the
deallocation) per the recommendation of somebody (don't remember who)
familiar with zend signals.

There is an always-inlined variant of the function for use in
the main deletion function, to ensure there is no performance
impact.
2014-03-21 00:14:52 +01:00
Nikita Popov 4efa58dd59 Make zend_hash_apply_deleter() void, to allow reuse
Also remove lies in the comment above the function. apply_deleter
is not safe against modification, if the modification involves
removing the next bucket.

Also modified the implementation of zend_hash_graceful_destroy()
to be fully graceful (the reverse variant already was).
2014-03-21 00:14:51 +01:00
Nikita Popov c3a317117a Add helper function for updating bucket contents 2014-03-21 00:14:46 +01:00
Nikita Popov 994fcfcff9 Remove unnecessary check
In case of an update the key already existed, so the next free
element can not change.
2014-03-20 22:58:10 +01:00
Andrey Hristov 113f22550a Fixes after merge 2014-03-20 17:28:49 +02:00
Andrey Hristov d2ab74588e Merge branch 'PHP-5.5' into PHP-5.6 2014-03-20 16:30:01 +02:00
Andrey Hristov 41b4b84dda Emit a warning in case of unallowed characters. Fix another place this
code is used - reuse
2014-03-20 16:23:40 +02:00
Remi Collet 7f7c84d64f add info: empty strings are interned 2014-03-20 15:18:41 +01:00
Andrey Hristov e52334fdbe Merge branch 'PHP-5.5' into PHP-5.6
Conflicts:
	ext/mysqli/mysqli_api.c
2014-03-20 16:16:12 +02:00
Andrey Hristov 059bc99d94 don't replace with ?, just skip it 2014-03-20 12:11:16 +02:00
Yasuo Ohgaki e1fe76f28a Add default_charset handling 2014-03-20 10:50:32 +09:00
Tjerk Meesters d0e3173016 Updated UPGRADING to add three changes 2014-03-20 07:44:23 +08:00
Christopher Jones 014c5706a8 Merge branch 'oci_field_doc_prototype_fixes' into PHP-5.6
* oci_field_doc_prototype_fixes:
  OCI8: fix prototypes for oci_field_*().  They can take a column index or name.
2014-03-19 15:23:07 -07:00
Christopher Jones 6c20b07190 OCI8: fix prototypes for oci_field_*(). They can take a column index or name. 2014-03-19 15:20:40 -07:00
Christopher Jones 8bdf272758 Change test package name ARRAYBINDPKG1 to a per-file unique name to aid parallel testing 2014-03-19 14:10:56 -07:00
Andrey Hristov 62ab3af12f fix compilation error 2014-03-19 19:15:04 +02:00
Andrey Hristov b86595a37c Merge branch 'PHP-5.5' into PHP-5.6
Conflicts:
	NEWS
2014-03-19 18:55:29 +02:00
Andrey Hristov 44fb74fad1 fix typo 2014-03-19 18:54:56 +02:00
Andrey Hristov 01c2ec03bc Merge branch 'PHP-5.5' into PHP-5.6
Conflicts:
	NEWS
	configure.in
	ext/mysqli/mysqli_api.c
	main/php_version.h
2014-03-19 18:54:39 +02:00
Andrey Hristov d63ed101ee Fix problem with mysqli_commt()/mysqli_rollback() 2014-03-19 18:32:19 +02:00
Adam Harvey d613b0acc2 Restore NEWS and UPGRADING for hash_equals(). 2014-03-19 06:24:01 -07:00
Julien Pauli c4145619be 5.5.11RC1 preparation 2014-03-19 10:43:32 +01:00
Yasuo Ohgaki 3ce980cf97 Merge branch 'pull-request/622' into PHP-5.6
* pull-request/622:
  Fixed typo
  Add missing E_DEPRECATED error for https://wiki.php.net/rfc/default_encoding
2014-03-19 17:29:24 +09:00
Yasuo Ohgaki babaa43762 Fixed typo 2014-03-19 17:25:45 +09:00
Stanislav Malyshev c1765d7ffe Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  prep for 5.4.27 rc1
2014-03-18 23:25:08 -07:00
Stanislav Malyshev 1ff28cd0ec Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  prep for 5.4.27 rc1

Conflicts:
	configure.in
	main/php_version.h
2014-03-18 23:24:09 -07:00
Stanislav Malyshev 9b88bc494e prep for 5.4.27 rc1 2014-03-18 23:19:09 -07:00
Anatol Belski ec11530620 remove obsolete comment 2014-03-19 06:35:58 +01:00
Anatol Belski 62f6c5853f Fixes to various stream cast on win64
This fixes further issues on win64 with casts from the streams.
Sockets/descriptors handling was unitized. This has an impact only on
win64, php_socket_t otherwise can be feed back to int datatype.
2014-03-19 06:33:46 +01:00
Adam Harvey a6f7fca637 Merge accepted RFC https://wiki.php.net/rfc/timing_attack into 5.6. 2014-03-18 09:22:13 -07:00
Derick Rethans 415233d26d Merge branch 'PHP-5.5' into PHP-5.6 2014-03-18 15:02:25 +00:00
Derick Rethans 2dfb8fbdf4 Merge branch 'PHP-5.4' into PHP-5.5 2014-03-18 14:48:56 +00:00
Derick Rethans b30304fb78 - Updated to version 2014.1 (2014a) 2014-03-18 14:48:55 +00:00
Andrey Hristov 39c53031e0 Merge branch 'PHP-5.5' into PHP-5.6 2014-03-18 15:42:57 +02:00
Andrey Hristov 2b811a5aec Add a test 2014-03-18 15:42:38 +02:00
Mateusz Kocielski 6c259625c4 Fixed wrong indentation 2014-03-18 10:49:28 +01:00
Mateusz Kocielski 888f467d63 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed off-by-one in php_url_parse_ex
2014-03-18 09:53:58 +01:00
Mateusz Kocielski ccae70b765 Fix phpdbg build on FreeBSD
Added missing netinet/in.h header.
2014-03-18 09:51:39 +01:00
Mateusz Kocielski 156cc39e21 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fixed off-by-one in php_url_parse_ex
2014-03-18 08:57:30 +01:00
Mateusz Kocielski 497b918e62 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Fixed off-by-one in php_url_parse_ex

Conflicts:
	ext/standard/url.c
2014-03-18 08:54:57 +01:00
Mateusz Kocielski 46566b78c9 Fixed off-by-one in php_url_parse_ex
Change order of condition, previously pointer could be derefrenced before
bound check was done.
2014-03-18 08:48:41 +01:00
Yasuo Ohgaki a28389b2ab Fixed typo in UPGRADING and modified php.ini-* description for encoding related changes 2014-03-18 07:28:26 +09:00
Nikita Popov 42562ee913 Add support for PCRE marks
If a MARK is set then it will be returned in the $matches array
unter key "MARK". If no MARK is used or passed, the key will not
be set.
2014-03-17 22:32:40 +01:00
Yasuo Ohgaki c4c97d878d Update UPGRADING.
Add more descriptions about default_charset and encoding related changes.
Many thanks to Christopher.
2014-03-18 05:49:09 +09:00
Daniel Lowrey 33c7976dfc UPGRADING (openssl updates) 2014-03-17 08:03:40 -06:00
Daniel Lowrey 098b4e8f5a Merge branch 'pgsql-async' into PHP-5.6
* pgsql-async:
  Support async pgsql connections and non-blocking queries
2014-03-17 07:55:42 -06:00
Daniel Lowrey 2ee4c987e6 Support async pgsql connections and non-blocking queries
- New functions (each accepts a pgsql $connection resource):

  . pg_connect_poll
  . pg_socket
  . pg_consume_input
  . pg_flush

- Modified functions

  The following functions now additionally return zero if the
  underlying socket is set to non-blocking mode and the send
  operation does not complete immediately. Previously these
  functions returned only boolean TRUE/FALSE and blocked
  execution while polling until all data was sent:

  . pg_send_execute
  . pg_send_prepare
  . pg_send_query
  . pg_send_query_params

- New constants

  Used with pg_connect() to initiate an asynchronous connection
  attempt:

  . PGSQL_CONNECT_ASYNC

  Used with pg_connection_status() to determine the current state
  of an async connection attempt:

  . PGSQL_CONNECTION_STARTED
  . PGSQL_CONNECTION_MADE
  . PGSQL_CONNECTION_AWAITING_RESPONSE
  . PGSQL_CONNECTION_AUTH_OK
  . PGSQL_CONNECTION_SSL_STARTUP
  . PGSQL_CONNECTION_SETENV

  Used with pg_connect_poll() to determine the result of an
  async connection attempt:

  . PGSQL_POLLING_FAILED
  . PGSQL_POLLING_READING
  . PGSQL_POLLING_WRITING
  . PGSQL_POLLING_OK
  . PGSQL_POLLING_ACTIVE

- Polling via returned pg_socket() stream

  pg_socket() returns a read-only socket stream that may be
  cast to a file descriptor for select (and similar) polling
  operations. Blocking behavior of the pgsql connection socket
  can be controlled by calling stream_set_blocking() on the
  stream returned by pg_socket().
2014-03-17 06:31:15 -06:00
Bob Weinand 1401314a1b Fixed one major bug in phpdbg_btree_delete
There is some bug when arrays/property tables are deleted: the children are not notified

(Considering now to overwrite the dtor of the array)
2014-03-17 06:19:14 -04:00
Rouven Weßling 2148a88b3d Add hash_equals() to perform string comparisons that are not vulnerable to timing attacks. 2014-03-17 09:37:28 +01:00
Stanislav Malyshev 2499b6518c Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fix bug #66873: check if obj->src is set
2014-03-17 01:20:09 -07:00
Stanislav Malyshev 66bf216c66 Fix bug #66873: check if obj->src is set 2014-03-17 01:19:02 -07:00
Bob Weinand f887960f9b removed some weird crash when freeing to early 2014-03-16 22:37:33 +01:00
Bob Weinand 98025a40b8 Cleanup 2014-03-16 20:04:08 +01:00
Bob Weinand 3fcdd6ab0f Added WINDOWS support for watchpoints
Actually it mainly works by just a bit macro substitution and function
redeclarations.
So it leaves the code working on UNIX mostly untouched.

I needed to substitute the allocating functions by a Virtual*() functions
wrapper to use VirtualProtect() on the memory.
2014-03-16 19:39:02 +01:00
Anatol Belski 7c904c6cbd updated NEWS 2014-03-15 18:00:16 +01:00
Anatol Belski f5ebea91b0 updated to oniguruma to 5.9.5 2014-03-15 17:56:04 +01:00
Remi Collet 8cde747336 NEWS 2014-03-14 09:53:11 +01:00
Remi Collet 89dc5924c9 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  NEWS
  NEWS
  Fixed Bug #66833 Default digest algo is still MD5
  Fix 5.5.10 NEWS
2014-03-14 09:52:47 +01:00
Remi Collet 80fa2ff646 NEWS 2014-03-14 09:52:37 +01:00
Remi Collet e1d8c0a051 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  NEWS
  Fixed Bug #66833 Default digest algo is still MD5
2014-03-14 09:52:02 +01:00
Remi Collet 87a87c6682 NEWS 2014-03-14 09:51:53 +01:00
Remi Collet 17f6391bf8 Fixed Bug #66833 Default digest algo is still MD5
Switch to SHA1, which match internal openssl hardcoded algo.

In most case, won't even be noticed
- priority on user input (default_md)
- fallback on system config
- fallback on this default value

Recent system reject MD5 digest, noticed in bug36732.phpt failure.

While SHA1 is better than MD5, SHA256 is recommenced,
and defined as default algo in provided configuration on
recent system (Fedora 21, RHEL-7, ...). But the idea is to
keep in sync with openssl internal value for PHP internal value.
2014-03-14 09:50:15 +01:00
David Zülke db6c33875c Fix 5.5.10 NEWS
The FPM change didn't make it into 5.5.10 but will instead be in 5.5.11; http://php.net/Changelog-5.php, the release and the NEWS file in the release accurately reflect this, but the 5.5 branch NEWS doesn't (as the release was made and tagged from the last RC, which didn't contain that change yet).
2014-03-13 16:51:44 +01:00
Lior Kaplan f120463efe Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Typo fix: sicret -> secret
2014-03-13 12:41:48 +02:00
Lior Kaplan 356c442558 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Typo fix: sicret -> secret
2014-03-13 12:40:14 +02:00
Michael Meyer 737c187013 Typo fix: sicret -> secret 2014-03-13 12:37:25 +02:00
Anatol Belski f0634b5be5 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  updated libs_version.txt

Conflicts:
	win32/build/libs_version.txt
2014-03-13 10:31:03 +01:00
Anatol Belski f7b9c12ed9 updated libs_version.txt 2014-03-13 10:28:04 +01:00
Yasuo Ohgaki 973f379efc Remove unneeded test 2014-03-13 06:54:52 +09:00
Yasuo Ohgaki 96d25b4b76 Update NEWS 2014-03-13 06:34:46 +09:00
Yasuo Ohgaki 6f0ad9ea12 Revert "Implement Bug #54649 Create session_serializer_name()"
This reverts commit 678ec30655.

Conflicts:
	ext/session/tests/session_serializer_name_basic.phpt
2014-03-13 06:32:49 +09:00
Yasuo Ohgaki 7dec5789fe Revert "Implemented Request #11100 (session_gc() function)."
This reverts commit 54a42f0d0c.

Conflicts:
	ext/session/tests/session_gc_basic.phpt
2014-03-13 06:30:32 +09:00
Anatol Belski 0bf5bce6ad Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  made libgd recognize the 9 version series
2014-03-12 19:31:07 +01:00
Anatol Belski 3f049bcff2 made libgd recognize the 9 version series 2014-03-12 19:30:27 +01:00
Anatol Belski 75486555c2 fix include search 2014-03-12 19:25:20 +01:00
Remi Collet 78cee12561 NEWS 2014-03-12 17:13:47 +01:00
Remi Collet 44c0581e0c Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  NEWS
  Fix bug  #66887 imagescale - poor quality of scaled image
2014-03-12 17:13:31 +01:00
Remi Collet 495d5335f9 NEWS 2014-03-12 17:13:24 +01:00
Remi Collet 862c006da1 Fix bug #66887 imagescale - poor quality of scaled image
Issue with signed char overflow.

Upstream fix:
https://bitbucket.org/libgd/gd-libgd/commits/4b86e06937bc5ff116be969137f8da9d1a7869d5
2014-03-12 17:10:51 +01:00
Remi Collet 4a1efa350a NEWS 2014-03-12 15:36:38 +01:00
Remi Collet 5bd13c5231 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed Bug #66893i imagescale ignore method argument
2014-03-12 15:36:08 +01:00
Remi Collet f2d5b2b6c6 Fixed Bug #66893i imagescale ignore method argument
We also have our goto fail; bug.

Upstream fix for libgd
https://bitbucket.org/libgd/gd-libgd/commits/5b42b1178c37ffd30c9a15733058656be0277da0
2014-03-12 15:35:42 +01:00
Nikita Popov 5e93a213f6 Add SKIPIF in GMP test 2014-03-12 14:17:08 +01:00
Nikita Popov e617dfbdf3 Merge branch 'PHP-5.5' into PHP-5.6 2014-03-12 14:16:58 +01:00
Nikita Popov 06bbb657ad Fix hash_pbkdf2() with missing $length argument
Also change the type of some string length variables to ensure
that the zpp call works correctly on platforms where sizeof(int)
!= sizeof(long).
2014-03-12 14:16:18 +01:00
Remi Collet 0bccd48d3f typo in NEWS 2014-03-12 14:08:25 +01:00
Remi Collet a912fb498e Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  typo in NEWS
2014-03-12 14:08:09 +01:00
Remi Collet 68f318a422 typo in NEWS 2014-03-12 14:08:02 +01:00
Remi Collet 081e2b9928 NEWS 2014-03-12 13:47:10 +01:00
Remi Collet c8c1205d84 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  NEWS
  Fixed Bug #66890 imagescale segfault
2014-03-12 13:46:51 +01:00
Remi Collet 119821a452 NEWS 2014-03-12 13:46:29 +01:00
Remi Collet dada2f550f Fixed Bug #66890 imagescale segfault
zend_parse_parameters "l" expect long, not int
2014-03-12 13:44:58 +01:00
Matteo Beccati f0da85b492 Updated UPGRADING to cover PDO_pgsql changes 2014-03-12 12:31:04 +01:00
Yasuo Ohgaki ca927bb47e Add missing E_DEPRECATED error for https://wiki.php.net/rfc/default_encoding 2014-03-12 17:54:22 +09:00
Matteo Beccati 1241a63931 Updated NEWS 2014-03-11 23:28:53 +01:00
Matteo Beccati e378348a31 Added new PDO::PGSQL_ATTR_DISABLE_PREPARES that uses PQexecParams
Faster than prepared statements when queries are run once. Slightly
slower than PDO::ATTR_EMULATE_PREPARES but without the potential
security implications of embedding parameters in the query itself.
2014-03-11 23:10:48 +01:00
Matteo Beccati d72621ab9e Deprecated PDO::PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT 2014-03-11 23:10:48 +01:00
Matteo Beccati b1ffea3ccc Drop PDO support for extremely old libpq versions
configure will now fail if any of the following function is missing:
* PQprepare
* PQexecParams
* PQescapeStringConn
* PQescapeByteaConn
2014-03-11 23:10:47 +01:00
Adam Harvey 1a14eb53c4 Merge branch 'PHP-5.5' into PHP-5.6 2014-03-11 11:06:39 -07:00
Adam Harvey f8252aa537 Fix compile error with theoretically supported versions of libcurl < 7.12.3. 2014-03-11 11:04:26 -07:00
Anatol Belski adca4c355c fix path separator 2014-03-11 16:29:30 +01:00
Bob Weinand 7a9e3e422f Added support for recursive watchpoints deletion 2014-03-11 09:11:27 -04:00
Nikita Popov fd5fbba98c Use /dev/urandom as the default mcrypt_create_iv() source
Also fixes the ARGINFO for mcrypt_create_iv() and adds missing
UPGRADING entries.
2014-03-11 14:06:13 +01:00
Nikita Popov a117e6b937 Add tests for bug #66872 and gmp_[rem]root 2014-03-11 14:06:12 +01:00
Tjerk Meesters 03e9878c78 Fixed mcrypt test case 2014-03-11 20:49:41 +08:00
Tjerk Meesters ffc0f8a16f Merge branch 'php-5.5' into PHP-5.6 2014-03-11 19:16:13 +08:00
Tjerk Meesters cb5178a450 Merge branch 'PHP-5.4' into PHP-5.5 2014-03-11 19:14:43 +08:00
Tjerk Meesters ddd7ed9b24 Removed bogus loops 2014-03-11 19:08:18 +08:00
Anatol Belski 54a18f3be6 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  restored the old code in 5.4/5 related to bug #66872
2014-03-11 11:53:17 +01:00
Anatol Belski 72050af855 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  restored the old code in 5.4/5 related to bug #66872
2014-03-11 11:51:35 +01:00
Anatol Belski 1a624e27a6 restored the old code in 5.4/5 related to bug #66872
The crash is reproducable in 5.6+ only, so 5.4 and 5.5 are fine
with the old code.
2014-03-11 11:50:14 +01:00
Bob Weinand 008842c7fa Added COW handling and fixed various bugs 2014-03-11 06:14:32 -04:00
Christopher Jones f0ec533573 Merge branch 'PHP-5.6' of https://git.php.net/repository/php-src into PHP-5.6
# By Pierre Joye (7) and others
# Via Pierre Joye (10) and others
* 'PHP-5.6' of https://git.php.net/repository/php-src:
  updated libsqlite to 3.8.3.1 in 5.5 branch, too
  DI
  Switch from a single flag to a flag byte
  update NEWS
  fix #66872, invalid argument crashes gmp_testbit
  fix #66872, invalid argument crashes gmp_testbit
  update news
  - fix #66869, Invalid 2nd argument crashes imageaffinematrixget
  add vc12 (2013)
  add vc12 (2013)
2014-03-10 16:46:42 -07:00
Christopher Jones 3a8282ed0f Merge branch 'PHP-5.5' of https://git.php.net/repository/php-src into PHP-5.5
# By Pierre Joye (7) and Anatol Belski (1)
# Via Pierre Joye (7) and Anatol Belski (1)
* 'PHP-5.5' of https://git.php.net/repository/php-src:
  updated libsqlite to 3.8.3.1 in 5.5 branch, too
  update NEWS
  fix #66872, invalid argument crashes gmp_testbit
  fix #66872, invalid argument crashes gmp_testbit
  update news
  - fix #66869, Invalid 2nd argument crashes imageaffinematrixget
  add vc12 (2013)
  add vc12 (2013)
2014-03-10 16:46:40 -07:00
Christopher Jones 4dc8610d34 Merge branch 'PHP-5.4' of https://git.php.net/repository/php-src into PHP-5.4
# By Pierre Joye
# Via Pierre Joye
* 'PHP-5.4' of https://git.php.net/repository/php-src:
  fix #66872, invalid argument crashes gmp_testbit
  fix #66872, invalid argument crashes gmp_testbit
  add vc12 (2013)
2014-03-10 16:46:39 -07:00
Christopher Jones 601367ee75 Fixed Bug #66875 (Improve performance of multi-row OCI_RETURN_LOB queries) 2014-03-10 16:33:35 -07:00
Anatol Belski c946d7f086 Merge branch 'PHP-5.6' of git.php.net:php-src into PHP-5.6 2014-03-10 17:52:51 +01:00
Anatol Belski dc87c208fd Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  updated libsqlite to 3.8.3.1 in 5.5 branch, too
2014-03-10 17:50:45 +01:00
Anatol Belski 73b3f58bcd updated libsqlite to 3.8.3.1 in 5.5 branch, too 2014-03-10 17:49:35 +01:00
Andrey Hristov 73f03a47d0 DI 2014-03-10 18:18:56 +02:00
Andrey Hristov 16043b261f Merge branch 'PHP-5.6' of git.php.net:php-src into PHP-5.6 2014-03-10 17:34:18 +02:00
Pierre Joye 8391277fb8 Merge branch 'PHP-5.4' of git.php.net:php-src into PHP-5.4
# By Anatol Belski
# Via Anatol Belski
* 'PHP-5.4' of git.php.net:php-src:
  updated libmagic.patch
2014-03-10 16:31:09 +01:00
Pierre Joye a92240e209 Merge branch 'PHP-5.5' of git.php.net:php-src into PHP-5.5
# By Anatol Belski (1) and others
# Via Anatol Belski
* 'PHP-5.5' of git.php.net:php-src:
  updated libmagic.patch
  Fix indentation
  Do not remove *.1, it's not generated by make but configure
2014-03-10 16:30:05 +01:00
Pierre Joye 52a44a736b Merge branch 'PHP-5.6' of git.php.net:php-src into PHP-5.6
# By Anatol Belski (2) and others
# Via Anatol Belski (3) and others
* 'PHP-5.6' of git.php.net:php-src:
  updated libmagic.patch
  updated libmagic.patch
  Fix indentation
  Do not remove *.1, it's not generated by make but configure
  Fix typo: entory -> entry
2014-03-10 16:28:41 +01:00
Andrey Hristov 990f9c8f3f Switch from a single flag to a flag byte 2014-03-10 17:25:53 +02:00
Anatol Belski 8bda4c685a updated libmagic.patch 2014-03-10 14:17:47 +01:00
Anatol Belski 6dd80946a2 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  updated libmagic.patch
2014-03-10 14:14:01 +01:00
Anatol Belski c17fd65165 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  updated libmagic.patch
2014-03-10 14:13:15 +01:00
Anatol Belski b9d494a33b updated libmagic.patch 2014-03-10 14:12:20 +01:00
Bob Weinand b033c4fa28 Added handling of zval separation (aka watchpoint changes) 2014-03-10 09:10:27 -04:00
Pierre Joye eef2978afc Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  update NEWS
  fix #66872, invalid argument crashes gmp_testbit
  fix #66872, invalid argument crashes gmp_testbit
  add vc12 (2013)

Conflicts:
	ext/gmp/gmp.c
2014-03-10 12:18:57 +01:00
Pierre Joye cf7e73cf26 update NEWS 2014-03-10 12:12:46 +01:00
Pierre Joye d2e42d5372 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  fix #66872, invalid argument crashes gmp_testbit
  fix #66872, invalid argument crashes gmp_testbit
  add vc12 (2013)

Conflicts:
	win32/build/confutils.js
2014-03-10 12:10:57 +01:00
Pierre Joye 28fa31d6e5 fix #66872, invalid argument crashes gmp_testbit 2014-03-10 12:07:58 +01:00
Pierre Joye af41914e15 fix #66872, invalid argument crashes gmp_testbit 2014-03-10 12:06:40 +01:00
Pierre Joye cedc718f73 Merge branch 'PHP-5.4' of git.php.net:php-src into PHP-5.4
# By Dmitry Panin (1) and Remi Collet (1)
# Via Nikita Popov
* 'PHP-5.4' of git.php.net:php-src:
  Fix HTML entity table generation
  Set default Digest Message to use SHA1 instead of MD5 in openssl tests as MD5 signature are now rejected by newer openssl Version.
2014-03-10 12:04:04 +01:00
Andrey Hristov c8033ac207 Merge branch 'PHP-5.5' into PHP-5.6 2014-03-10 12:53:17 +02:00
Andrey Hristov 3a76cb2d95 Fix indentation 2014-03-10 12:52:56 +02:00
Xinchen Hui aa23d754a9 Merge branch 'PHP-5.5' into PHP-5.6 2014-03-10 15:55:05 +08:00
Xinchen Hui a930e04792 Do not remove *.1, it's not generated by make but configure 2014-03-10 15:54:20 +08:00
Lior Kaplan 6e16cc3528 Fix typo: entory -> entry 2014-03-09 22:58:04 +02:00
Pierre Joye ba79c45174 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  update news
  - fix #66869, Invalid 2nd argument crashes imageaffinematrixget
  add vc12 (2013)

Conflicts:
	win32/build/confutils.js
2014-03-09 21:17:06 +01:00
Pierre Joye 1fdca8208f update news 2014-03-09 21:13:15 +01:00
Pierre Joye 8e3c2015dc - fix #66869, Invalid 2nd argument crashes imageaffinematrixget 2014-03-09 21:12:19 +01:00
Pierre Joye 0c74d5ef08 Merge branch 'PHP-5.5' of git.php.net:php-src into PHP-5.5
# By Remi Collet (6) and others
# Via Nikita Popov (1) and others
* 'PHP-5.5' of git.php.net:php-src:
  Fixed null termination
  Updated NEWS for #65545
  Add fread(length) method
  Fix HTML entity table generation
  Fix order in NEWS
  Add CVE ref (not known at release time)
  Fix NEWS for 5.5.11 fix (really not in 5.5.10)
  5.5.10 release date for NEWS
  Set default Digest Message to use SHA1 instead of MD5 in openssl tests as MD5 signature are now rejected by newer openssl Version.
  NEWS
  Fixed Bug #66815 imagecrop(): insufficient fix for NULL defer CVE-2013-7327
2014-03-09 21:11:19 +01:00
Anatol Belski 7d0493219c updated NEWS 2014-03-09 13:06:32 +01:00
Anatol Belski 2dd378df36 removed the libsqlite patch as it's not relevant anymore 2014-03-09 13:03:43 +01:00
Anatol Belski 61db86bff3 updated bundled libsqlite to 3.8.3.1 2014-03-09 13:01:48 +01:00
Bob Weinand 37ca791a91 Fixed recursive segfault in segfault handler 2014-03-08 09:52:57 -05:00
Remi Collet 7946c5a235 add OPSYS_Z_CPM missing constant 2014-03-07 14:10:16 +01:00
Daniel Lowrey ff3c6931c0 Update php.ini files (new openssl directives) 2014-03-07 05:26:37 -07:00
Tjerk Meesters 8d3f4b647b Merge branch 'PHP-5.5' into PHP-5.6 2014-03-07 19:24:02 +08:00
Tjerk Meesters 972935cd95 Fixed null termination 2014-03-07 19:23:46 +08:00
Tjerk Meesters 25d355bdb7 Updated NEWS for #65545 2014-03-07 18:57:55 +08:00
Tjerk Meesters 64906cdc38 Merge branch 'PHP-5.5' into PHP-5.6 2014-03-07 18:57:36 +08:00
Tjerk Meesters 091b7f841b Updated NEWS for #65545 2014-03-07 18:51:16 +08:00
datibbaw 3c673fed34 Add fread(length) method
Fixed off-by-one write bug

Added test
2014-03-07 18:50:33 +08:00
Bob Weinand f76d5b3104 Include the T_POW operator in constant scalar expressions 2014-03-07 07:39:20 +01:00
Tjerk Meesters be8a4474d9 Updated news for #66822 2014-03-07 09:14:27 +08:00
Tjerk Meesters 3d1fa4cb17 Allow T_POW in constant expressions 2014-03-07 09:14:27 +08:00
Christopher Jones d32e180f20 Fix typo 2014-03-06 16:49:11 -08:00
Michael M Slusarz b88387d341 Fix #66698: Add fnv1a32 and fnv1a64 hash options 2014-03-06 23:38:51 +01:00
Nikita Popov 200c97829d Merge branch 'PHP-5.5' into PHP-5.6 2014-03-06 23:15:30 +01:00
Nikita Popov ecf7570072 Merge branch 'PHP-5.4' into PHP-5.5 2014-03-06 23:12:41 +01:00
Dmitry Panin e2fc6b52f0 Fix HTML entity table generation 2014-03-06 23:10:31 +01:00
Andrey Andreev eb8dfc85ce Add test for bug #62102 / RFC 2144
Using test vectors from RFC 2144, section B.1 (http://tools.ietf.org/rfc/rfc2144.txt)
2014-03-06 22:40:26 +01:00
Christopher Jones 9989af2e9b Whitespace. 2014-03-06 10:21:36 -08:00
Christopher Jones 2cf9560921 Misc cleanup including adding the version number 2014-03-06 10:16:42 -08:00
Remi Collet a8121ca0e1 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fix order in NEWS
  Add CVE ref (not known at release time)
  Fix NEWS for 5.5.11 fix (really not in 5.5.10)
  5.5.10 release date for NEWS
2014-03-06 11:02:40 +01:00
Remi Collet 70dd3f1731 Fix order in NEWS 2014-03-06 10:55:10 +01:00
Remi Collet 9acdf71194 Add CVE ref (not known at release time) 2014-03-06 10:54:18 +01:00
Remi Collet cab1894b81 Fix NEWS for 5.5.11 fix (really not in 5.5.10) 2014-03-06 10:53:07 +01:00
Julien Pauli b31a9cd4da 5.5.10 release date for NEWS 2014-03-06 10:18:10 +01:00
Remi Collet 518a6ed95b Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Set default Digest Message to use SHA1 instead of MD5 in openssl tests as MD5 signature are now rejected by newer openssl Version.
2014-03-06 10:16:30 +01:00
Remi Collet 7d5c11c235 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Set default Digest Message to use SHA1 instead of MD5 in openssl tests as MD5 signature are now rejected by newer openssl Version.
2014-03-06 10:16:16 +01:00
Remi Collet 721b9a7c8d Set default Digest Message to use SHA1 instead of MD5 in openssl tests
as MD5 signature are now rejected by newer openssl Version.

Noticed in RHEL-7 and Fedora 21 build.
2014-03-06 10:14:08 +01:00
Daniel Lowrey a9cdf2e2e3 Add NEWS/UPGRADING notes (openssl + curl) 2014-03-05 10:49:21 -07:00
Daniel Lowrey fad14e3180 Add encrypted server SNI support
- New "SNI_server_certs" context option maps host names to
  appropriate certs should client handshakes advertise the
  SNI extension:

    $ctx = stream_context_create(["ssl" => [
        "local_cert" => "/path/to/cert.pem",
        "SNI_server_certs" => [
            "domain1.com" => "/path/to/domain1.pem",
            "*.domain2.com" => "/path/to/domain2.pem",
            "domain3.com" => "/path/to/domain3.pem"
        ]
    ]]);

- Prefixing a "*." will utilize the matching cert if a client
  requests the primary host name or any subdomain thereof. So
  in the above example our "domain2.pem" will be used for both
  requests to "domain2.com" -and- "subdomain.domain2.com"
- The "SNI_server_certs" ctx option has no effect for client
  streams.
- SNI support is enabled by default as of 5.6 for both servers
  and clients. Servers must specify the "SNI_server_certs" array
  to actually use the SNI extension, though.
- If the `"SNI_enabled" => false` ctx option is also passed then
  "SNI_server_certs" has no effect.
- While supporting SNI by itself is enough to successfully
  negotiate the TLS handshake with many clients, servers MUST
  still specify a "local_cert" ctx option or run the risk of
  connection failures from clients that do not support the SNI
  extension.
2014-03-05 10:03:33 -07:00
datibbaw 020e161966 Raise timeout to 2s, reworded ssl timeout warning 2014-03-05 10:03:23 -07:00
Daniel Lowrey 27849c998a Refactor + reorganize openssl files
- All streams-related code now lives in xp_ssl.c. Previously
  stream code was split across both openssl.c and xp_ssl.c
- Folded superfluous php_openssl_structs.h into xp_ssl.c
- Server-specific options now set on SSL_CTX instead of SSL
- Deprecate SNI_server_name ctx option
- Miscellaneous refactoring
2014-03-05 10:03:11 -07:00
Andrey Hristov 36d3c83abd Merge branch 'PHP-5.6' of git.php.net:php-src into PHP-5.6 2014-03-05 16:47:16 +02:00
Nikita Popov d595502d0a Add NEWS entry for mcrypt changes 2014-03-05 15:36:00 +01:00
Nikita Popov d8ed84e4c4 Use zpp for accepting encryption mode string
Leaving the non-zpp usage for the mcrypt_{MODE} functions, as
they're deprecated and I'm too lazy to update all their tests.
2014-03-05 15:32:32 +01:00
Nikita Popov eb0eac75ef Remove a number of macros that are no longer used 2014-03-05 15:32:32 +01:00
Nikita Popov e5738d3bc9 Provide expected IV length in IV error messages 2014-03-05 15:32:32 +01:00
Nikita Popov b9737aa08e Call mcrypt_module_close on error 2014-03-05 15:32:32 +01:00
Nikita Popov e4876ecbfb Print supported key sizes in error message 2014-03-05 15:32:32 +01:00
Nikita Popov 32333abe3e Clean up do_crypt code
Avoid unnecessary alloc/copy/free cycles and clean up structure in
general. Add a few extra checks for the key length.
2014-03-05 15:32:32 +01:00
Nikita Popov a861a3a93d Abort on invalid key size
Previously an incorrectly sized key was either silently padded
with NUL bytes or truncated. Especially the silent nature of this
behavior makes it extremely easy to use weak encryption. A common
mistake - which has also been extensively made in our tests - is
to use a password instead of a key.

Incorrectly sized keys will now be rejected.
2014-03-05 15:32:32 +01:00
Nikita Popov 25d801f97e Abort on missing IV if the enc_mode requires it
Previously the code fell back on using a NUL IV if no IV was
passed and the encryption mode required it. This is dangerous and
makes no sense from a practical point of view (as you could just
as well use ECB then).
2014-03-05 15:32:31 +01:00
Nikita Popov c4b7cdb41e Abort on invalid IV size
Previously, if the size of the IV did not match the block size
mcrypt would throw a warning and fall back to a NUL IV. This
behavior is both dangerous and makes no practical sense.

mcrypt_encrypt etc. will now return false if the IV has an incorrect
size.
2014-03-05 15:32:31 +01:00
Andrey Hristov 6b804b96b8 Refactor the result set data structures. Move more to the buffered and unbuffered
substructures. Add methods to these too. Preparing for pluggable interface for
returning data to the engine (zvals, c-style, something else)
2014-03-05 16:22:23 +02:00
Remi Collet 1b922895fc NEWS 2014-03-05 10:45:50 +01:00
Remi Collet cf89ff3d24 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  NEWS
  Fixed Bug #66815 imagecrop(): insufficient fix for NULL defer CVE-2013-7327
2014-03-05 10:44:04 +01:00
Remi Collet 515c103a08 NEWS 2014-03-05 10:43:45 +01:00
Remi Collet af09d8b96a Fixed Bug #66815 imagecrop(): insufficient fix for NULL defer CVE-2013-7327
This amends commit 8f4a537, which aimed to correct NULL dereference because of
missing check of gdImageCreateTrueColor() / gdImageCreate() return value.  That
commit checks for negative crop rectangle width and height, but
gdImageCreate*() can also return NULL when width * height overflows.  Hence
NULL deref is still possible, as gdImageSaveAlpha() and gdImagePaletteCopy()
is called before dst == NULL check.

This moves NULL check to happen right after gdImageCreate*().  It also removes
width and height check before gdImageCreate*(), as the same check is done by
image create functions (with an extra warning).

From thoger redhat com
2014-03-05 10:40:36 +01:00
Pierre Joye b084157d3d Merge branch 'PHP-5.5' of git.php.net:php-src into PHP-5.5
# By Anatol Belski (38) and others
# Via Anatol Belski (23) and others
* 'PHP-5.5' of git.php.net:php-src: (325 commits)
  NEWS
  NEWS
  Fixed Bug #66820 out-of-bounds memory access in fileinfo
  Improves fix for memory leak, keep in sync with upstream.
  Fixed news for #60602
  Updated news for #60602
  proc_open(): separate environment values that aren't strings
  Fixed NEWS.
  Updated news for #66535 and #66109
  Updated NEWS for #66535
  don't compare constants on run time
  substr_compare(): Allow zero length comparison
  Fixed test case title
  [bug 66535] X-PHP-Originating-Script adds newline if no custom headers are given
  Fixed expected output of a few cURL test cases
  Allow NULL as value for CURLOPT_CUSTOMREQUEST option.
  man page: long option name is --strip, not --stripped
  --global have be removed in 5.2
  typo spotted by Lajos Veres
  update libs_version.txt
  ...
2014-03-05 10:37:04 +01:00
Pierre Joye e590aceb5a Merge branch 'PHP-5.4' of git.php.net:php-src into PHP-5.4
# By Anatol Belski (22) and others
# Via Derick Rethans (5) and others
* 'PHP-5.4' of git.php.net:php-src: (176 commits)
  NEWS
  Fixed Bug #66820 out-of-bounds memory access in fileinfo
  Improves fix for memory leak, keep in sync with upstream.
  Updated news for #60602
  proc_open(): separate environment values that aren't strings
  Updated NEWS for #66535
  Fixed test case title
  [bug 66535] X-PHP-Originating-Script adds newline if no custom headers are given
  man page: long option name is --strip, not --stripped
  --global have be removed in 5.2
  NEWS
  test for bug #66762
  Fixed Bug #66762 Segfault in mysqli_stmt::bind_result() when link closed
  fix tests broken by 633f898f15
  add news entry
  add clear_env option to FPM config
  Reduce test noise on cross Oracle client <-> server version tests. This fix is already in PHP 5.6+
  Reduce test noise in cross Oracle client <-> server version testing. This change is already in PHP 5.6+
  fixed macro
  Make sure value is initialized
  ...
2014-03-05 10:32:42 +01:00
Remi Collet 9a9add6b73 fix merge 2014-03-04 20:39:00 +01:00
Remi Collet 014b95a0a7 NEWS 2014-03-04 20:36:31 +01:00
Remi Collet 5d08cae346 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  NEWS
  Fixed Bug #66820 out-of-bounds memory access in fileinfo
2014-03-04 20:36:08 +01:00
Remi Collet c2a9f73c99 NEWS 2014-03-04 20:35:56 +01:00
Remi Collet a33759fd27 Fixed Bug #66820 out-of-bounds memory access in fileinfo
Upstream fix:
https://github.com/glensc/file/commit/447558595a3650db2886cd2f416ad0beba965801

Notice, test changed, with upstream agreement:
-define OFFSET_OOB(n, o, i)	((n) < (o) || (i) >= ((n) - (o)))
+define OFFSET_OOB(n, o, i)	((n) < (o) || (i) >  ((n) - (o)))
2014-03-04 20:32:52 +01:00
Remi Collet 834b719cf5 fix merge 2014-03-04 13:46:21 +01:00
Remi Collet bc0b6e02e4 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Improves fix for memory leak, keep in sync with upstream.
2014-03-04 13:43:42 +01:00
Remi Collet 731013ee8e Improves fix for memory leak, keep in sync with upstream.
Previous fix:
http://git.php.net/?p=php-src.git;a=commitdiff;h=10eb0070700382f966bf260e44135e1f724a15d2

Upstream fix:
https://github.com/glensc/file/commit/c0c0032b9e9eb57b91fefef905a3b018bab492d9
2014-03-04 13:41:37 +01:00
Remi Collet f7e381eef6 Add notice about tsrm_virtual_cwd.h moved to zend_virtual_cwd.h
as this introduce need for awfull hacks...
2014-03-03 15:33:11 +01:00
Tjerk Meesters fed56fbae8 Fixed NEWS for #60602 2014-03-03 05:59:07 +08:00
Tjerk Meesters 330ffe2e24 Merge branch 'PHP-5.5' into PHP-5.6 2014-03-03 05:58:03 +08:00
Tjerk Meesters c34f26a938 Fixed news for #60602 2014-03-03 05:57:36 +08:00
Tjerk Meesters bbd0781b39 Merge branch 'PHP-5.4' into PHP-5.5 2014-03-03 05:56:22 +08:00
Tjerk Meesters 1533f98afd Updated news for #60602 2014-03-03 05:54:09 +08:00
Tjerk Meesters e73c05b75e proc_open(): separate environment values that aren't strings
Added a test case
2014-03-03 05:49:52 +08:00
Derick Rethans 574f230d3c Added DateTimeImmutable::createFromMutable. 2014-03-02 14:18:44 -05:00
Derick Rethans b8d75cc464 Sort alphabetically 2014-03-02 14:15:30 -05:00
Derick Rethans 3eb8102348 Fixed NEWS. 2014-03-02 13:27:35 -05:00
Daniel Lowrey c126c16479 Capture peer cert even if verify fails
Previously the "capture_peer_cert" SSL context option only
captured the peer's certificate if the verification routine
succeeded.

By also capturing the on verify failure applications have the
ability to parse the cert and ask users whether they wish to
proceed given the information presented by the peer.
2014-03-02 10:35:52 -07:00
Chris Wright e8995c8cb0 Windows cert verify improvements + leak fixes
- Clean up properly at all fail points in native Windows peer
  verification routine
- Bring certificate usages and chain flags into line with chromium
  implementation in windows environments
2014-03-02 10:30:21 -07:00
Anatol Belski 9d4adf4fe1 turn off some false positives 2014-03-02 12:49:30 +01:00
Anatol Belski cf90bd92bf support for static analyzers other than visual studio 2014-03-01 20:15:10 +01:00
Anatol Belski 0bbacd8678 fix wording 2014-03-01 13:28:02 +01:00
Anatol Belski db9d911093 Merge branch 'PHP-5.6' of git.php.net:php-src into PHP-5.6 2014-03-01 13:16:16 +01:00
Anatol Belski 7c60a09cae reveal more info on the configure options 2014-03-01 13:11:35 +01:00
Tjerk Meesters 6b6b2149af Updated news for #66535 and #66109 2014-03-01 12:27:36 +08:00
Tjerk Meesters c9680697ec Updated news for #66535 and #66109 2014-03-01 12:27:22 +08:00
Tjerk Meesters 362b70a32c Updated NEWS for #66535 2014-03-01 08:47:32 +08:00
Anatol Belski af545ead97 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  don't compare constants on run time
2014-02-28 19:39:34 +01:00
Anatol Belski 36c445970e don't compare constants on run time 2014-02-28 19:38:32 +01:00
Tjerk Meesters e424049840 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  substr_compare(): Allow zero length comparison
2014-02-28 23:48:34 +08:00
datibbaw 2e459be237 substr_compare(): Allow zero length comparison
Treat zero length comparison as always equal.
2014-02-28 23:45:04 +08:00
Tjerk Meesters 43ac0ab673 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed test case title
  [bug 66535] X-PHP-Originating-Script adds newline if no custom headers are given
2014-02-28 22:31:16 +08:00
Tjerk Meesters d022c8565d Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fixed test case title
  [bug 66535] X-PHP-Originating-Script adds newline if no custom headers are given
2014-02-28 22:30:21 +08:00
Tjerk Meesters eca13f7909 Fixed test case title 2014-02-28 22:27:32 +08:00
Tjerk Meesters 79b3c2a744 [bug 66535] X-PHP-Originating-Script adds newline if no custom headers are given
A newline is added to the mail headers when mail.add_x_header is used and no other headers are passed to mail().

The scenario in which custom headers are used was already fixed in #48620, back in 2009.
2014-02-28 22:22:07 +08:00
Tjerk Meesters cbb2dc0788 Merge branch '5.5' into 5.6
* 5.5:
  Fixed expected output of a few cURL test cases
  Allow NULL as value for CURLOPT_CUSTOMREQUEST option.
2014-02-28 19:01:17 +08:00
Tjerk Meesters 9443fb999d Fixed expected output of a few cURL test cases 2014-02-28 18:59:06 +08:00
datibbaw 488e64dbe4 Allow NULL as value for CURLOPT_CUSTOMREQUEST option.
Added test case.

Refactored the code to isolate the string handling. Fixed return values to use SUCCESS and FAILURE.

Removed unused error variable.

Indentation fix.
Removed the ugly goto.
2014-02-28 18:27:22 +08:00
Anatol Belski 1cb4398ac1 primitive test fixes 2014-02-28 09:43:57 +01:00
krakjoe a2d7e336e6 parse stream locations properly, bp.c still needs work for #82 2014-02-28 07:41:34 +00:00
Remi Collet 06feb15a16 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  man page: long option name is --strip, not --stripped
  --global have be removed in 5.2
2014-02-28 08:12:26 +01:00
Remi Collet 5fc7382a57 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  man page: long option name is --strip, not --stripped
  --global have be removed in 5.2
2014-02-28 08:12:16 +01:00
Remi Collet b1df743b7a man page: long option name is --strip, not --stripped 2014-02-28 08:12:03 +01:00
Remi Collet c73b0543f1 --global have be removed in 5.2 2014-02-28 08:10:01 +01:00
krakjoe 623888adc0 use php streams to handle line endings better for #81 2014-02-27 19:10:59 +00:00
Anatol Belski 2c1385b7f5 remove pcntl leftover from the test code 2014-02-27 15:50:17 +01:00
Ferenc Kovacs 5abaf7cc87 list the fpm change hat rfc in UPGRADING 2014-02-27 12:54:07 +01:00
Ferenc Kovacs 8bb84693b3 mention the apparmor support in fpm 2014-02-27 12:43:42 +01:00
Ferenc Kovacs bfbdc032b6 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  typo spotted by Lajos Veres
2014-02-27 11:30:23 +01:00
Ferenc Kovacs 561843c973 typo spotted by Lajos Veres 2014-02-27 11:29:08 +01:00
Anatol Belski 703154321f Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  update libs_version.txt

Conflicts:
	win32/build/libs_version.txt
2014-02-27 09:26:48 +01:00
Anatol Belski 603ebc70ff update libs_version.txt 2014-02-27 09:25:15 +01:00
Anatol Belski ccd4bf5147 update libs_version.txt 2014-02-27 09:23:48 +01:00
Remi Collet 6ed83d37af NEWS 2014-02-27 08:50:29 +01:00
Remi Collet fa01db3466 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  NEWS
  NEWS
  test for bug #66762
  Fixed Bug #66762 Segfault in mysqli_stmt::bind_result() when link closed
2014-02-27 08:50:07 +01:00
Remi Collet cb0e6124d4 NEWS 2014-02-27 08:49:56 +01:00
Remi Collet 82e92c99a6 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  NEWS
  test for bug #66762
  Fixed Bug #66762 Segfault in mysqli_stmt::bind_result() when link closed
2014-02-27 08:49:33 +01:00
Remi Collet 33d372a45f NEWS 2014-02-27 08:49:08 +01:00
Remi Collet 816a5d2072 test for bug #66762 2014-02-27 08:48:01 +01:00
Remi Collet 9137acc7ec Fixed Bug #66762 Segfault in mysqli_stmt::bind_result() when link closed
Each new mysqli_stmt now increase the refcount of the link object.
So the link is really destroy after all statements.

Only implemented with libmysqlclient, as mysqlnd already implement
this internally.

So, libmysqlclient and mysqlnd have the same behavior.
2014-02-27 08:45:16 +01:00
Ferenc Kovacs dae8ff251c 5.6.0alpha3 2014-02-27 02:36:56 +01:00
Ferenc Kovacs 79bfef5ba3 Merge branch 'PHP-5.6' into PHP-5.6.0
* PHP-5.6: (136 commits)
  fix tests broken by 633f898f15
  add missing NEWS entry
  add missing NEWS entry
  add missing NEWS entry
  add missing NEWS entry
  add missing NEWS entry
  add missing NEWS entry
  Deprecate CN_match in favor of peer_name in SSL contexts
  Remove cURL close policy related constants
  Update stack size in tests/func/010.phpt
  Don't add num_additional_args in SEND opcodes
  Disallow use of positional args after unpacking
  Store arg_num in fcall entry
  Introduce zend_function_call_entry structure
  move the default encoding NEWS entry to alpha3, as it was pushed after beta2 was tagged
  rearrange the NEWS blocks a bit
  add NEWS block for 5.6.0 beta1
  restored that test part in ext/openssl to enable notify/wait
  remove echo
  fix stdin reading in new openssl tests
  ...
2014-02-27 02:35:58 +01:00
Ferenc Kovacs 42a43d4531 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fix tests broken by 633f898f15
2014-02-27 02:32:47 +01:00
Ferenc Kovacs fd20278fa5 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  fix tests broken by 633f898f15
2014-02-27 02:32:07 +01:00
Ferenc Kovacs bd961f3e87 fix tests broken by 633f898f15 2014-02-27 02:31:42 +01:00
Ferenc Kovacs afb0675e3b Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  add missing NEWS entry
2014-02-27 01:28:57 +01:00
Ferenc Kovacs 1d51c43287 add missing NEWS entry 2014-02-27 01:27:53 +01:00
Ferenc Kovacs 1b8679401c add missing NEWS entry 2014-02-27 01:27:53 +01:00
Ferenc Kovacs cb9ce48d02 add missing NEWS entry 2014-02-27 01:27:52 +01:00
Ferenc Kovacs 95e0de7cfa add missing NEWS entry 2014-02-27 01:27:52 +01:00
Ferenc Kovacs b59831bc30 add missing NEWS entry 2014-02-27 01:27:52 +01:00
Ferenc Kovacs 38797e598b add missing NEWS entry 2014-02-27 01:18:11 +01:00
Daniel Lowrey 4b06e0a2d0 Merge branch 'curlClosePolicy' of https://github.com/DaveRandom/php-src into PHP-5.6
* 'curlClosePolicy' of https://github.com/DaveRandom/php-src:
  Remove cURL close policy related constants
2014-02-26 13:40:16 -07:00
Daniel Lowrey d0a6f8c68e Deprecate CN_match in favor of peer_name in SSL contexts 2014-02-26 13:20:06 -07:00
Chris Wright afc24da436 Remove cURL close policy related constants
These options don't do anything and they never have.

Refs:
  http://curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTCLOSEPOLICY
  http://curl.haxx.se/mail/lib-2006-11/0301.html
2014-02-26 17:48:14 +00:00
Nikita Popov 96d0bb7bca Update stack size in tests/func/010.phpt
Stack size is 16K nowadays. Now the test takes a more reasonable
amount of time to run...
2014-02-26 16:40:25 +01:00
Nikita Popov 95c73f99d3 Don't add num_additional_args in SEND opcodes
Now that trailing positional args are disallowed,
num_additional_args will always be zero in SEND opcodes (and
FUNC_ARG fetches).
2014-02-26 16:40:25 +01:00
Nikita Popov d3b484df82 Disallow use of positional args after unpacking
This commit disallows the use of trailing positional arguments
after argument unpacking was used. The following calls are no
longer valid:

    fn(...$array, $var);
    fn(...$array1, $var, ...$array2);

However, all of the following continue to be valid:

    fn($var, ...$array);
    fn(...$array1, ...$array2);
    fn($var, ...$array1, ...$array2);

The reason behind this change is a stack allocation issue pointed
out by Dmitry: As of PHP 5.5 the stack necessary for pushing
arguments is precomputed and preallocated, as such the individual
SEND opcodes no longer verify that there is enough stack space.
The unpacked arguments will occupy some of that preallocated
space and as such following positional arguments could write past
a stack page boundary.

An alternative resolution for this issue is to ensure that there
is enough space for the remaining arguments in the UNPACK opcode.
However making this allocation precise (rather than using a
conversative over-estimate) would require some effort. Given that
this particular aspect of the feature wasn't very popular in the
first place, it doesn't seem worth the effort.
2014-02-26 16:40:25 +01:00
Nikita Popov 2eae187949 Store arg_num in fcall entry
Instead of storing the argument number in the znode of the parameter
list, store it in fcall->arg_num. This mainly cleans up the parameter
parsing code, which previously had to duplicate all rules (this
becomes more excessive as more features are added, e.g. named params
would already require a minimum of 14 rules...)
2014-02-26 16:40:25 +01:00
Nikita Popov cefa7f8d08 Introduce zend_function_call_entry structure
Instead of directly pushing the zend_function* onto the
function_call_stack, push this structure. This allows us to store
additional data on this stack.
2014-02-26 16:40:25 +01:00
Ferenc Kovacs 44053a9dae move the default encoding NEWS entry to alpha3, as it was pushed after beta2 was tagged 2014-02-26 15:29:40 +01:00
Ferenc Kovacs da4c7af358 rearrange the NEWS blocks a bit 2014-02-26 15:28:36 +01:00
Ferenc Kovacs 2f5ba1ef69 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  add news entry
  add news entry
  add clear_env option to FPM config
  add clear_env option to FPM config
  Reduce test noise on cross Oracle client <-> server version tests. This fix is already in PHP 5.6+
  Reduce test noise in cross Oracle client <-> server version testing. This change is already in PHP 5.6+
2014-02-26 15:13:40 +01:00
Ferenc Kovacs d18089d621 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  add news entry
  add clear_env option to FPM config
2014-02-26 15:10:23 +01:00
Ferenc Kovacs 2b3483249c add NEWS block for 5.6.0 beta1 2014-02-26 15:08:08 +01:00
Anatol Belski 9ab73c52ab restored that test part in ext/openssl to enable notify/wait 2014-02-26 13:37:20 +01:00
Anatol Belski bcff8d1b26 remove echo 2014-02-26 12:41:36 +01:00
Anatol Belski 56cbe04381 fix stdin reading in new openssl tests 2014-02-26 11:27:24 +01:00
Anatol Belski 82a98f6e52 kick redundant include
this is already present from php.h
2014-02-26 11:23:43 +01:00
Daniel Lowrey 2bc0dbab44 Prevent implicit function declaration when TLSEXT unavailable 2014-02-25 19:12:33 -07:00
Daniel Lowrey 781d0b9ee3 Update NEWS+UPGRADING (openssl) 2014-02-25 13:22:16 -07:00
Daniel Lowrey bab017ddfd Remove test case invalidated by openssl.cafile accessibility change 2014-02-25 13:02:13 -07:00
Daniel Lowrey bd95716b8e Merge branch 'windowsPeerVerification' of https://github.com/DaveRandom/php-src into PHP-5.6
* 'windowsPeerVerification' of https://github.com/DaveRandom/php-src:
  Update openssl tests with new server/client test harness
  Add peer certificate verification on windows
2014-02-25 12:43:52 -07:00
Daniel Lowrey f8fe09dcef Tolerate non-standard newlines when parsing stream CA files 2014-02-25 09:59:13 -07:00
Daniel Lowrey a4c7ab8399 Remove openssl tests that shouldn't have survived last merge
These are .phpt files I meant to remove with the last batch as
the same functionality is now covered in other tests and these
are no longer needed.
2014-02-25 09:59:13 -07:00
Daniel Lowrey a031dc06d9 Add openssl.cafile ini check when loading cainfo 2014-02-25 09:59:13 -07:00
Daniel Lowrey 47b5873c5d Change openssl directives to PHP_INI_PERDIR
Because openssl.cafile and openssl.capath have implications for
security these directives have been changed to PHP_INI_PERDIR
(previously PHP_INI_ALL)
2014-02-25 09:59:13 -07:00
Chris Wright d6fb7b8f2e Update openssl tests with new server/client test harness 2014-02-25 16:51:50 +00:00
Chris Wright 480e4f8541 Add peer certificate verification on windows
Peer certificate verification on Windows using the native certificate store and the Windows API
2014-02-25 16:51:49 +00:00
Andrey Hristov aad7b72472 Use API instead of directly acessing the structure 2014-02-25 17:39:06 +02:00
Antony Dovgal e1b1ef0d79 add news entry 2014-02-25 12:15:35 +04:00
Antony Dovgal 4d9c556b5d add news entry 2014-02-25 12:14:50 +04:00
Paul Annesley eb6941e902 add clear_env option to FPM config
This makes it possible to leave the envoronment as is on startup and
pass all the variables to the workers.
The default value of clear_env is "yes", preserving previous behaviour.
Patch by Paul Annesley.
2014-02-25 12:12:09 +04:00
Paul Annesley 6e15afd1be add clear_env option to FPM config
This makes it possible to leave the envoronment as is on startup and
pass all the variables to the workers.
The default value of clear_env is "yes", preserving previous behaviour.
Patch by Paul Annesley.
2014-02-25 12:06:32 +04:00
Christopher Jones a59ec5d1b0 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Reduce test noise on cross Oracle client <-> server version tests. This fix is already in PHP 5.6+
2014-02-24 17:02:16 -08:00
Christopher Jones ee7671afb5 Reduce test noise on cross Oracle client <-> server version tests.
This fix is already in PHP 5.6+
2014-02-24 17:01:30 -08:00
Christopher Jones 593505f266 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Reduce test noise in cross Oracle client <-> server version testing. This change is already in PHP 5.6+
2014-02-24 16:35:08 -08:00
Christopher Jones 8cdefd3d10 Reduce test noise in cross Oracle client <-> server version testing.
This change is already in PHP 5.6+
2014-02-24 16:33:41 -08:00
krakjoe d8ed537cd4 moar params for registered functions 2014-02-24 22:30:46 +00:00
krakjoe 4bab2d2f90 export command 2014-02-24 19:03:55 +00:00
krakjoe 043bfd6e2c woops+correction in help 2014-02-24 17:11:09 +00:00
krakjoe 85b5907e85 fix ts build 2014-02-24 09:26:03 +00:00
Anatol Belski 60ed3f78bd Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fixed macro
2014-02-24 10:13:11 +01:00
Anatol Belski bca0e5edd5 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  fixed macro
2014-02-24 10:12:50 +01:00
Anatol Belski c6a4a7cad6 fixed macro 2014-02-24 10:12:18 +01:00
Paul Annesley a97ae8bc06 add clear_env option to FPM config
This makes it possible to leave the envoronment as is on startup and
pass all the variables to the workers.
The default value of clear_env is "yes", preserving previous behaviour.
Patch by Paul Annesley.
2014-02-24 11:53:40 +04:00
Johannes Schlüter 5c8a0c92d1 Merge branch 'PHP-5.5' into PHP-5.6 2014-02-23 14:57:21 +01:00
Johannes Schlüter 2198bbce86 Merge branch 'PHP-5.4' into PHP-5.5 2014-02-23 14:56:32 +01:00
Johannes Schlüter 3f258e6b46 Make sure value is initialized 2014-02-23 14:55:29 +01:00
Johannes Schlüter 756ee95605 We can't dereference dbh if it is NULL 2014-02-23 14:18:24 +01:00
krakjoe 4b738cee2b set colors working 2014-02-23 07:33:48 +00:00
Anatol Belski 5b6ef90bc0 fix linkage
"extern inline" looks like tricky case for portability, but extern
is required with VS. So reduce the case to a starndard one to avoid
unporbatibily.
2014-02-21 23:09:16 +01:00
krakjoe ee6cc5ba60 do not allow abbreivation of anything without alias, fixes input for sh/ev 2014-02-21 21:31:01 +00:00
krakjoe e37144f44b moar cleanup 2014-02-21 20:46:56 +00:00
krakjoe 1b92ce9a1b call register 2014-02-21 20:42:15 +00:00
Daniel Lowrey 865a41a6a3 More openssl UPGRADING updates 2014-02-21 12:54:37 -07:00
krakjoe bab960069c ... 2014-02-21 19:37:16 +00:00
Daniel Lowrey c3d76441d5 Fix build against older OpenSSL libs 2014-02-21 12:16:23 -07:00
krakjoe 1c5f8ca7e1 verify noargs 2014-02-21 19:05:20 +00:00
krakjoe 28debb4717 ... 2014-02-21 18:52:06 +00:00
Daniel Lowrey 58e3fcf54f Update NEWS/UPGRADING with openssl additions 2014-02-21 11:40:39 -07:00
krakjoe d1b02fe2fe ... 2014-02-21 18:12:52 +00:00
krakjoe f13fdbe9a0 update export function 2014-02-21 18:05:11 +00:00
krakjoe c3a897bf3d introduce proper support for file:#opline 2014-02-21 18:01:50 +00:00
krakjoe a6eee49326 case insensitive 2014-02-21 17:47:02 +00:00
krakjoe b82ad53b29 ... 2014-02-21 16:29:09 +00:00
krakjoe fde1e44d62 trim breaking commands 2014-02-21 16:18:46 +00:00
Daniel Lowrey 5389d0963c Merge branch 'reneg-limit' of https://github.com/rdlowrey/php-src into PHP-5.6
* 'reneg-limit' of https://github.com/rdlowrey/php-src:
  Mitigate client-initiated SSL renegotiation DoS
2014-02-21 09:13:55 -07:00
krakjoe 78e8690dee conditional breakpoints working again 2014-02-21 15:00:55 +00:00
krakjoe 5db16dd989 better-ness, I think 2014-02-21 14:44:16 +00:00
Daniel Lowrey b6edbd5897 Mitigate client-initiated SSL renegotiation DoS 2014-02-21 06:31:56 -07:00
Anatol Belski f51555ca58 C89 compat 2014-02-21 11:23:42 +01:00
Dmitry Stogov 31f5515059 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Added information about interned strings usage

Conflicts:
	NEWS
2014-02-21 12:44:58 +04:00
Dmitry Stogov 851f362882 Added information about interned strings usage 2014-02-21 12:43:42 +04:00
Dmitry Stogov aebfc519ea Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Updated opcache version
2014-02-21 12:06:35 +04:00
Dmitry Stogov f06b3432c8 Updated opcache version 2014-02-21 12:04:42 +04:00
Dmitry Stogov b9a87a5079 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Added function opcache_is_script_cached(). (Danack)

Conflicts:
	NEWS
2014-02-21 12:00:33 +04:00
Dmitry Stogov 884bbcd537 Added function opcache_is_script_cached(). (Danack) 2014-02-21 11:59:14 +04:00
Daniel Lowrey dcf27a1f6f Merge branch 'improved-tls-defaults' of https://github.com/rdlowrey/php-src into PHP-5.6
* 'improved-tls-defaults' of https://github.com/rdlowrey/php-src:
  Improve OpenSSL compile flag compatibility, minor updates
  Use crypto method flags; add tlsv1.0 wrapper; add wrapper tests
  Improve server forward secrecy, refactor client SNI
  Add 'honor_cipher_order' server context option
  Add 'capture_session_meta' context option
  Disable TLS compression by default in both clients and servers
  Release ssl buffers
  Add openssl_get_cert_locations() function
  Explicitly set cert verify depth if not specified
  Strengthen default cipher list
2014-02-20 17:35:44 -07:00
Daniel Lowrey 9f94e0b51c Improve OpenSSL compile flag compatibility, minor updates 2014-02-20 17:23:34 -07:00
Daniel Lowrey 3a9829af20 Use crypto method flags; add tlsv1.0 wrapper; add wrapper tests 2014-02-20 17:10:06 -07:00
Daniel Lowrey d0c9207cff Improve server forward secrecy, refactor client SNI 2014-02-20 17:10:06 -07:00
Daniel Lowrey 742fc5fb35 Add 'honor_cipher_order' server context option 2014-02-20 17:10:06 -07:00
Daniel Lowrey 081c8e9d92 Add 'capture_session_meta' context option 2014-02-20 17:10:06 -07:00
Daniel Lowrey b98b093d73 Disable TLS compression by default in both clients and servers 2014-02-20 17:10:06 -07:00
Daniel Lowrey b9ba011c0f Release ssl buffers 2014-02-20 17:10:06 -07:00
Daniel Lowrey df6bfe3be2 Add openssl_get_cert_locations() function 2014-02-20 17:10:06 -07:00
Daniel Lowrey 258d04df5c Explicitly set cert verify depth if not specified 2014-02-20 17:10:06 -07:00
Daniel Lowrey 225f534b1a Strengthen default cipher list 2014-02-20 17:10:06 -07:00
Anatol Belski 5d0d88d1f2 fixed path separator in the tests 2014-02-21 00:23:01 +01:00
Sara Golemon 14c08ea362 Add more tests for __debugInfo() and fix leak 2014-02-20 12:10:00 -08:00
Anatol Belski b67c8b8603 updated libmagic.patch for 5.6+ 2014-02-20 19:05:59 +01:00
Anatol Belski 0746e6af08 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  updated libmagic.patch in 5.4/5
2014-02-20 19:01:09 +01:00
Anatol Belski e244e2245b Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  updated libmagic.patch in 5.4/5
2014-02-20 19:00:36 +01:00
Anatol Belski ce1fd72776 updated libmagic.patch in 5.4/5 2014-02-20 19:00:05 +01:00
Anatol Belski 67d281f093 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fixed leak introduced after CVE/upgrade
2014-02-20 18:55:05 +01:00
Anatol Belski 6d4d4155d2 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  fixed leak introduced after CVE/upgrade
2014-02-20 18:54:35 +01:00
Anatol Belski 10eb007070 fixed leak introduced after CVE/upgrade 2014-02-20 18:53:53 +01:00
Bob Weinand fe3c8de9d5 Merge branch 'PHP-5.5' into PHP-5.6 2014-02-20 17:49:45 +01:00
Bob Weinand ca313caa4b Merge branch 'PHP-5.4' into PHP-5.5 2014-02-20 17:48:38 +01:00
Bob Weinand afa03a470e Use nicer output for characters < 32 and > 126 in exception strings
Using question marks might confuse more than it helps.
Users are wondering what happened to their string...
2014-02-20 17:39:58 +01:00
Xinchen Hui c0d26bb138 Merge branch 'PHP-5.5' into PHP-5.6 2014-02-20 11:19:52 +08:00
Yasuo Ohgaki 3fa164c24b Update pgsql document 2014-02-20 10:44:18 +09:00
Anatol Belski 47204c6341 some missing pieces for __debugInfo 2014-02-20 02:07:34 +01:00
Brad Daily 143bb29c1a Fixes #66714: imageconvolution breakage in 5.5.9
5.5.9 included some GD fixes related to #66356. One of those fixes changed the 
above section of imageconvolution, but the variable was mistyped.
2014-02-19 15:24:15 -06:00
krakjoe e2fcc870e3 work on lexer to be more permissive (accept moar strings)
work on parameter parsing and command resolution
work on error reporting for failed arguments
update most commands
move quiet to set quiet
move set break on/off to set breaks on/off
keep set break for set break <id> <on/off>
update help accordingly
2014-02-19 20:18:49 +00:00
Daniel Lowrey e272225e2a Merge branch 'bug-65538' of https://github.com/rdlowrey/php-src into PHP-5.6
* 'bug-65538' of https://github.com/rdlowrey/php-src:
  Add tests for Bug #65538
  Fix Bug #65538 (cafile now supports stream wrappers)
2014-02-19 04:17:33 -07:00
Daniel Lowrey d9036d14f7 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Skip failing tests when EC unavailable (RHEL)
2014-02-19 04:01:57 -07:00
Daniel Lowrey a7d3606650 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Skip failing tests when EC unavailable (RHEL)

Conflicts:
	ext/openssl/openssl.c
2014-02-19 04:01:08 -07:00
Daniel Lowrey 633f898f15 Skip failing tests when EC unavailable (RHEL) 2014-02-19 03:57:37 -07:00
Anatol Belski 3e82ff615f updated NEWS 2014-02-19 11:28:55 +01:00
Anatol Belski 6b5c9f6c5a updated libmagic.patch 2014-02-19 11:20:24 +01:00
Anatol Belski fdaf3996af remove PHP_API_VERSION < 20100412 check 2014-02-19 11:01:42 +01:00
Anatol Belski 6d2cf0f2a4 expose correct libmagic version 2014-02-19 10:48:52 +01:00
Anatol Belski 4019531748 fixed tests in ext/fileinfo 2014-02-19 10:04:29 +01:00
Anatol Belski 967a6771d3 updated to libmagic-5.17 2014-02-19 10:02:36 +01:00
krakjoe 996182993d remove input_t
support single char aliases
...
2014-02-19 08:33:54 +00:00
krakjoe e2e93ac259 work on parameters to commands 2014-02-19 00:33:49 +00:00
Bob Weinand 366bf38b4f Oplines run from 0 to op_array->last - 1
See also in issue 76
2014-02-19 01:13:03 +01:00
krakjoe 1952750af6 ... 2014-02-18 20:04:02 +00:00
krakjoe e392e730ea execute new stack now 2014-02-18 19:48:33 +00:00
Anatol Belski e95a2925fc Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  updated libmagic.patch
2014-02-18 19:09:04 +01:00
Anatol Belski 8dd99dd2dc Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  updated libmagic.patch
2014-02-18 19:08:45 +01:00
Anatol Belski a289b37f48 updated libmagic.patch 2014-02-18 19:08:16 +01:00
Stanislav Malyshev 54b1829f75 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  update news with CVE
  5.5.11-dev next
  5.5.11 next for NEWS

Conflicts:
	configure.in
	main/php_version.h
2014-02-18 08:48:52 -08:00
Stanislav Malyshev 1cc5d1009f MErge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  update news with CVE
2014-02-18 08:47:43 -08:00
Stanislav Malyshev ee4b3892f8 update news with CVE 2014-02-18 08:36:51 -08:00
Julien Pauli 0afcbb0ba9 5.5.11-dev next 2014-02-18 16:45:48 +01:00
Julien Pauli be354936b7 5.5.11 next for NEWS 2014-02-18 16:40:19 +01:00
Remi Collet aa84d906d8 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Set fileinfo version to 1.0.5 (as in php 5.4, no diff)
  NEWS
  NEWS
  Fixed Bug #66731 file: infinite recursion
2014-02-18 13:58:36 +01:00
Remi Collet bd8cd98d6d Set fileinfo version to 1.0.5 (as in php 5.4, no diff) 2014-02-18 13:57:53 +01:00
Remi Collet a6ad3a558a NEWS 2014-02-18 13:57:28 +01:00
Remi Collet bdd65b578c Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  NEWS
  Fixed Bug #66731 file: infinite recursion
2014-02-18 13:57:10 +01:00
Remi Collet 9f449df1e4 NEWS 2014-02-18 13:56:58 +01:00
Remi Collet 89f864c547 Fixed Bug #66731 file: infinite recursion
Upstream commit (available in file-5.17)

https://github.com/glensc/file/commit/3c081560c23f20b2985c285338b52c7aae9fdb0f
https://github.com/glensc/file/commit/cc9e74dfeca5265ad725acc926ef0b8d2a18ee70
2014-02-18 13:54:33 +01:00
krakjoe 29e74ebf65 Merge branch 'master' of https://github.com/krakjoe/phpdbg into lexer 2014-02-18 09:13:50 +00:00
krakjoe 8da9b7e3a2 fix #70 2014-02-18 09:13:42 +00:00
krakjoe 07dafa8940 Merge branch 'master' of https://github.com/krakjoe/phpdbg into lexer 2014-02-18 08:47:25 +00:00
krakjoe 791828d00c fix zpp issues #74 2014-02-18 08:47:15 +00:00
krakjoe 0634f176a8 Merge branch 'master' of https://github.com/krakjoe/phpdbg into lexer 2014-02-18 08:40:42 +00:00
krakjoe 0b19b9dd0c fix #75 phpdbg disabled by default 2014-02-18 08:40:33 +00:00
krakjoe cadc909bb7 use correct param types 2014-02-18 08:39:38 +00:00
Stanislav Malyshev 140769a9d9 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  5.4.27 now
  update NEWS
2014-02-17 21:22:24 -08:00
Stanislav Malyshev 58b7f21c3f Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  5.4.27 now
  update NEWS

Conflicts:
	configure.in
	main/php_version.h
2014-02-17 21:22:03 -08:00
Stanislav Malyshev c612440e0f 5.4.27 now 2014-02-17 21:19:25 -08:00
Stanislav Malyshev b79d2285df update NEWS 2014-02-17 21:16:48 -08:00
Sara Golemon 1e752ce9c5 Add __debugInfo() magic method
class Foo {
  private $val = 'Random, meaningless data';

  public function count() { return 42; }

  public function __debugInfo() {
    return ['count' => $this->count()];
  }
}

$f = new Foo;
var_dump($f);
2014-02-17 19:33:56 -08:00
Daniel Lowrey 4e4d319e62 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed broken build when EC unavailable
2014-02-17 19:38:49 -05:00
Daniel Lowrey bd9aa181dc Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fixed broken build when EC unavailable
2014-02-17 19:38:30 -05:00
Daniel Lowrey a80cec1190 Fixed broken build when EC unavailable 2014-02-17 18:55:39 -05:00
krakjoe d980101803 start work on resolving commands, add numeric function and method to lexer 2014-02-17 22:43:53 +00:00
Andrey Hristov 3e59f041da remove dead code 2014-02-17 19:04:01 +02:00
Andrey Hristov b2cd56c3cb Move code out, that handles the actual structure to be used for the decoded
data. Will make it easier to add different structures
2014-02-17 18:37:08 +02:00
Julien Pauli 0bc96ef3cc Updated NEWS for #65753 2014-02-17 11:16:32 +01:00
Julien Pauli e19e266ae1 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Updated NEWS for #65753
  Updated NEWS for #65753
  Export JsonSerializable Interface (bug #65753)
2014-02-17 11:13:54 +01:00
Julien Pauli 66f76ec1f9 Updated NEWS for #65753 2014-02-17 11:13:38 +01:00
Julien Pauli 641a0c86d9 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Updated NEWS for #65753
2014-02-17 11:09:31 +01:00
Julien Pauli b04159eed4 Updated NEWS for #65753 2014-02-17 11:05:34 +01:00
Julien Pauli 8a1d248d4e Export JsonSerializable Interface (bug #65753) 2014-02-17 10:38:51 +01:00
Julien Pauli baafdad150 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Export JsonSerializable Interface (bug #65753)
2014-02-17 10:36:13 +01:00
Julien Pauli 786234d351 Export JsonSerializable Interface (bug #65753) 2014-02-17 10:25:40 +01:00
Anatol Belski 6877af3f71 simplify the metadata part 2014-02-17 10:20:36 +01:00
krakjoe 1641d2afbe case insensitivity where we can
additional param types
2014-02-17 08:53:47 +00:00
krakjoe 1fce0887a3 Merge branch 'master' of https://github.com/krakjoe/phpdbg into lexer 2014-02-17 07:40:35 +00:00
Scott MacVicar 796bfb0bd0 imagettftext() uses the last charactermap it found and not the one you want
Summary:
This caused issues when you picked a font with multiple maps, it wouldn't
pick the unicode version but instead pick the last one it saw. Change so
we cache on a per encoding level. There was even a todo list item in the code.

In an ideal world we can probably iterate through at font write time.

Test Plan:
See said unit test, it's Apache Licensed font included
2014-02-16 22:49:31 -08:00
Scott MacVicar 1f3af9cd21 [libxml] Unit test for libxml_disable_entity_loader()
Summary:
Test to make sure libxml_disable_entity_loader() is behaving.
2014-02-16 22:34:52 -08:00
Yasuo Ohgaki e5ec5fc9cc Add pgsql related change information to NEWS and UPGRADING 2014-02-17 10:13:44 +09:00
krakjoe 3cabee71ab ... 2014-02-16 23:17:16 +00:00
krakjoe 4af3e39147 improve error reporting 2014-02-16 23:12:24 +00:00
krakjoe ff95046b76 ... 2014-02-16 22:54:43 +00:00
krakjoe c3bf5dc904 modify command to parse arguments with lexer for testingz 2014-02-16 22:47:20 +00:00
krakjoe d392de0ff7 fix lexer for namespaced methods 2014-02-16 21:52:25 +00:00
krakjoe a9e0202a5d remove leaks from stack
traverse the other way
fix id regex, thanks @bwoebi
2014-02-16 21:38:55 +00:00
Yasuo Ohgaki d8aa130296 Imprement FR #25854 Return value for pg_insert should be resource instead of bool 2014-02-17 06:36:54 +09:00
Yasuo Ohgaki 5fd6365c77 Implement FR #41146 - Add "description" with exteneded flag pg_meta_data().
pg_meta_data(resource $conn, string $table [, bool extended])
It also made pg_meta_data() return "is enum" always.
2014-02-17 06:24:10 +09:00
krakjoe c744605dc7 build stack from command line 2014-02-16 19:25:15 +00:00
Bob Weinand f89f66d762 removed warning; WS 2014-02-16 17:41:50 +01:00
Daniel Lowrey 2a83295b14 Add tests for Bug #65538 2014-02-16 09:20:43 -07:00
Anatol Belski a9c0d319eb updated pgsql/config.w32
keep track with the latest changes for postgles 9.3 compatibility
2014-02-16 17:13:56 +01:00
Bob Weinand 7b44890ac4 Merge pull request #73 from TerryE/new-help
New help updates
2014-02-16 17:09:15 +01:00
Daniel Lowrey c7220dc6c5 Fix Bug #65538 (cafile now supports stream wrappers) 2014-02-16 08:47:37 -07:00
Yasuo Ohgaki 170db1c577 Travis has old PostgreSQL server. Avoid test error. 2014-02-16 18:08:50 +09:00
Yasuo Ohgaki 4a2b39269f It seems travis needs ending >? 2014-02-16 16:40:58 +09:00
Yasuo Ohgaki d4bc18bbe8 Add PGSQL_DML_ESCPE 2014-02-16 14:24:20 +09:00
Yasuo Ohgaki a59559a173 Update NEWS and UPGRADING 2014-02-16 14:21:05 +09:00
Yasuo Ohgaki 56854511d8 EXPERIMENTAL flags for pg_select/pg_insert/pg_update/pg_delete are removed.
Use string escape for exotic types that allows to handle any data types. i.e. Array, JSON, JSONB, etc will work.
Add escape only query for better performance which removes meta data look up. Limitations forced by pg_convert() can be avoided with this. PGSQL_DML_ESCAPE constant is added for it.
2014-02-16 14:11:21 +09:00
Yasuo Ohgaki 53daf94f28 Merge branch 'PHP-5.6' of git.php.net:php-src into PHP-5.6
* 'PHP-5.6' of git.php.net:php-src:
  Remove XFAIL from a test
  Declare a number of functions as variadic.
2014-02-16 10:53:49 +09:00
Yasuo Ohgaki 3f4134c00c Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed possbile injections against pg_insert()/pg_delete()/pg_update()/pg_select()
2014-02-16 10:47:32 +09:00
Yasuo Ohgaki f7f524aada Update NEWS 2014-02-16 10:47:13 +09:00
Yasuo Ohgaki 3fcdecf658 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fixed possbile injections against pg_insert()/pg_delete()/pg_update()/pg_select()
2014-02-16 10:45:50 +09:00
Yasuo Ohgaki f275fdcf00 Fixed possbile injections against pg_insert()/pg_delete()/pg_update()/pg_select() 2014-02-16 10:45:15 +09:00
krakjoe 5f89934686 Revert "handle strings better"
This reverts commit a32f1b4654.
2014-02-15 23:34:35 +00:00
Nikita Popov 7d5f806e77 Remove XFAIL from a test
Everything looks to be working fine, the test is just wrong.
INF equals INF as per IEEE 754.
2014-02-16 00:07:55 +01:00
Rouven Weßling 417dbfbacc Declare a number of functions as variadic. 2014-02-16 00:07:55 +01:00
krakjoe a32f1b4654 handle strings better 2014-02-15 22:53:20 +00:00
Yasuo Ohgaki a12c896dba Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Refactor build_tablename()
2014-02-16 07:52:00 +09:00
Yasuo Ohgaki f9537c2a0b Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Refactor build_tablename()
2014-02-16 07:51:50 +09:00
Yasuo Ohgaki 6f14b5ab41 Refactor build_tablename() 2014-02-16 07:51:27 +09:00
Yasuo Ohgaki 53f34bca76 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Revise encoding blacklist
2014-02-16 06:25:15 +09:00
Yasuo Ohgaki 8c9fd8fb53 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Revise encoding blacklist
2014-02-16 06:25:01 +09:00
Yasuo Ohgaki 9f251548ae Revise encoding blacklist 2014-02-16 06:21:39 +09:00
krakjoe cdf1dcc497 barf on unexpected input 2014-02-15 20:05:44 +00:00
krakjoe a01853de78 betterness 2014-02-15 19:51:39 +00:00
Johannes Schlüter 1fd53fd2ae Move static functions further up so they are delared efore being used. 2014-02-15 20:05:46 +01:00
Felipe Pena 8cec20a565 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  - Fix ZTS build when HAVE_PQESCAPELITERAL is not set
  Update NEWS
  Update NEWS
2014-02-15 11:05:25 -02:00
Felipe Pena a65a546640 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  - Fix ZTS build when HAVE_PQESCAPELITERAL is not set
  Update NEWS
2014-02-15 11:05:08 -02:00
Felipe Pena 9d84f6c06e - Fix ZTS build when HAVE_PQESCAPELITERAL is not set 2014-02-15 11:04:49 -02:00
Yasuo Ohgaki fbb1827da8 Update NEWS 2014-02-15 19:21:54 +09:00
Yasuo Ohgaki 7ce88b2d8a Update NEWS 2014-02-15 19:20:34 +09:00
Yasuo Ohgaki 5ff9089aeb Merge branch 'PHP-5.5' into PHP-5.6 2014-02-15 18:30:11 +09:00
Yasuo Ohgaki 6e0b8b4288 Merge branch 'PHP-5.4' into PHP-5.5 2014-02-15 18:29:36 +09:00
Yasuo Ohgaki 832c21cabf Refactor and cleanup. WS is cleaned up. Use -b if it is needed.
Added compatibility macros, PQescapeStringConn, PGSQLescapeLiteral/Identifier, PGSQLfree.
2014-02-15 18:20:58 +09:00
krakjoe 5778e010b7 have a go at writing lexer for input 2014-02-15 04:52:04 +00:00
Daniel Lowrey 2976f7dae7 Update NEWS 2014-02-14 21:44:05 -07:00
Daniel Lowrey cf0741fd5b Update NEWS 2014-02-14 21:42:36 -07:00
Daniel Lowrey 5cc851e83e Update NEWS 2014-02-14 21:41:18 -07:00
Daniel Lowrey b60cb2b88a Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fix for bug66501 - "key type not supported in this PHP build"
2014-02-14 18:20:01 -07:00
Daniel Lowrey 65adb74984 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Fix for bug66501 - "key type not supported in this PHP build"
2014-02-14 18:15:24 -07:00
mk-j 19524fc6fe Fix for bug66501 - "key type not supported in this PHP build" 2014-02-14 18:11:46 -07:00
Daniel Lowrey 734d887b40 Merge branch 'bug-47030' of https://github.com/rdlowrey/php-src into PHP-5.6
* 'bug-47030' of https://github.com/rdlowrey/php-src:
  Bug #47030 (separate host and peer verification)
2014-02-14 15:37:49 -07:00
Daniel Lowrey ce8dc0ede2 Bug #47030 (separate host and peer verification) 2014-02-14 15:17:30 -07:00
Daniel Lowrey f073588e75 Fix test broken if openssl is compiled without sslv2 2014-02-14 13:39:02 -07:00
Daniel Lowrey 81c29af865 Updated NEWS 2014-02-14 10:26:42 -07:00
Daniel Lowrey 8582353700 Fix segfault accessing context when no context assigned 2014-02-14 10:24:08 -07:00
Veres Lajos a7ec000f35 a few typofixes 2014-02-14 17:16:17 +02:00
Lior Kaplan 23d952ed60 Merge branch 'PHP-5.5' into PHP-5.6 2014-02-14 17:15:35 +02:00
Veres Lajos f9829690d4 a few typofixes 2014-02-14 17:12:52 +02:00
Lior Kaplan c09bd9def0 Merge branch 'PHP-5.4' into PHP-5.5 2014-02-14 15:30:00 +02:00
Veres Lajos 35101e9ef4 a few typofixes 2014-02-14 14:51:10 +02:00
Yasuo Ohgaki 71b8f59ebb Update NEWS and UPGRADING 2014-02-14 08:56:39 +09:00
Ferenc Kovacs 91fecd7673 move the peer verification NEWS entry to the alpha2 block, as it was pushed after alpha1 2014-02-14 00:22:31 +01:00
Ferenc Kovacs 2537fdf0c8 mention ldap_modify_batch() 2014-02-13 23:21:28 +01:00
Bob Weinand 0dc1072a19 Fix issue 72 (too much whitespace in config.m4) 2014-02-13 20:42:54 +01:00
Yasuo Ohgaki cbd108abf1 Implement RFC https://wiki.php.net/rfc/default_encoding 2014-02-13 11:54:52 +09:00
Mats Lindh 6188674f1e Replace old SVN references to Git 2014-02-09 21:17:26 +02:00
Terry Ellison 21c973d3de More update to help text on parameter typing 2014-02-09 15:04:13 +00:00
Bob Weinand b0273e749c Fix issue 68 (made check win only) 2014-02-06 20:43:17 +01:00
Terry Ellison ebdfef807a Update help content and refactor new routine in php_help.c
*  I've added more content to the help to expand desciption for new-to-phpdbg
   developers.

*  After a code review of the new routines that I've added to the help module,
   I've decided that the implementation was unnecessarily convolved and that
   Keep-It-Simple-Stupid would be more understandable, maintainable and have
   no material performance hit.
2014-02-05 00:04:21 +00:00
Terry Ellison 88bd558a73 Work in progress chekpoint of changes to help module. To allow peer review and feedback 2014-02-02 16:35:28 +00:00
krakjoe 891477dc1c windows 2014-02-02 15:16:01 +00:00
krakjoe f88ff6c661 woops 2014-02-02 14:51:30 +00:00
krakjoe 0c94f8a893 ... 2014-02-02 14:41:51 +00:00
krakjoe e55bd70643 scrap using zend directly, too many leaks/bugs 2014-02-02 13:29:34 +00:00
krakjoe 261a5305c6 fix bugsnet #66591 and github #60 2014-01-29 07:28:54 +00:00
krakjoe c768abd420 fix bugsnet #66594, thanks ondrej@php.net 2014-01-28 17:23:29 +00:00
krakjoe 1c0fccfc9a fix readline build error bugsnet #66576 2014-01-27 07:39:34 +00:00
Bob Weinand 2e4aed3673 Merge branch PHP-5.6 of php-src 2014-01-19 12:26:14 +01:00
Bob Weinand ab16299355 Removed some segfault; does still not delete all the watches if var is removed, might segfault 2014-01-18 20:36:56 -05:00
Bob Weinand 3714352cb1 Merge branch 'master' of ssh://github.com/krakjoe/phpdbg into watchpoints_recursive 2014-01-18 19:30:13 -05:00
Bob Weinand f27be2fded Fixed order of instructions... 2014-01-18 19:24:22 -05:00
Bob Weinand 992a8d0411 Clean root symbol table when starting new execution 2014-01-18 18:48:53 -05:00
Bob Weinand b12286461d Merge branch 'master' of ssh://github.com/krakjoe/phpdbg 2014-01-18 13:18:47 -05:00
Bob Weinand a1f5925652 Fixed that for example "run" is only set as last cmd after the whole execution 2014-01-18 13:18:28 -05:00
Bob Weinand f4a7e50156 Update year 2014-01-17 23:09:07 +01:00
Bob Weinand 66e93a7820 Merge branch 'master' of ssh://github.com/krakjoe/phpdbg into watchpoints_recursive
Conflicts:
	phpdbg.c
2014-01-12 20:40:54 -05:00
Bob Weinand 78e274af31 Added rudimentary support for watchpoints on an array itself 2014-01-10 13:54:07 -05:00
Bob Weinand f4eeda9a9b First try of recursive watchpoints 2013-12-31 13:14:36 -05:00
Bob Weinand c64d692f49 Merge branch 'master' into watchpoints
Conflicts:
	CREDITS
	phpdbg.c
	test.php
2013-12-31 12:07:10 -05:00
krakjoe 433bc142a6 credits file 2013-12-23 21:51:00 +00:00
krakjoe a1a57827e1 Merge branch 'watchpoints' of https://github.com/krakjoe/phpdbg into watchpoints 2013-12-21 09:39:59 +00:00
Bob Weinand 6ee1da1f55 ZTS fixed 2013-12-20 22:17:30 -05:00
Bob Weinand e2172ba39c ZTS fixed 2013-12-20 22:10:03 -05:00
Bob Weinand 3f70e9f8bd Fixed deletion of watchpoints 2013-12-19 22:21:08 -05:00
Bob Weinand 5e351695b6 Added deleting of watchpoints 2013-12-19 11:05:38 -05:00
Bob Weinand 0dbc5c2087 first working version of wildcard watchpoints 2013-12-18 02:56:20 -05:00
Bob Weinand 0a8c20e740 Handle automatic removing of watchpoints and cleanup at the end 2013-12-16 10:29:31 -05:00
Bob Weinand a7b0dfb7b1 Preventing possible segfault 2013-12-15 09:15:34 -05:00
Bob Weinand d3c8d76e5b Merge branch 'watchpoints' of ssh://github.com/krakjoe/phpdbg into watchpoints
Conflicts:
	phpdbg_watch.c
2013-12-15 09:10:28 -05:00
Bob Weinand 9ce9f48fb6 Moved btree to separate file; minor fixes and completitions 2013-12-15 09:05:50 -05:00
Felipe Pena 75b4b4676b - Staticfy some functions 2013-12-15 11:58:14 -02:00
Felipe Pena 0ca7f72130 - Fixed build 2013-12-15 11:55:03 -02:00
Bob Weinand f312f6bad2 First semi-working version of a single watchpoint 2013-12-14 05:39:09 -05:00
Bob Weinand 85b97c0f70 Finished working for today, continuing tomorrow (not working) 2013-12-13 17:57:36 -05:00
Bob Weinand 2e5d78192e Committed the damned new files 2013-12-11 21:31:22 +01:00
Bob Weinand 488dd317fe First non-working test of segfault handlers 2013-12-11 21:27:03 +01:00
Pierre Joye fb3e21fbcc add vc12 (2013) 2013-11-04 22:25:50 +01:00
Pierre Joye 07b9db3def Merge branch 'PHP-5.5' of git.php.net:php-src into PHP-5.5
# By Xinchen Hui
# Via Xinchen Hui
* 'PHP-5.5' of git.php.net:php-src:
  Fixed coredump due to abnormal implemention of phar
  remove "PHP 6" staff
2013-11-04 22:21:03 +01:00
Pierre Joye 9b54901ffb add vc12 (2013) 2013-11-04 22:19:02 +01:00
Kevin Israel 82a4f1a1a2 Fix #66021 (Blank line inside empty array/object)
Changed json_encode() so that when the JSON_PRETTY_PRINT option is specified,
the pair of linefeeds immediately after an opening bracket and before the
corresponding closing bracket is omitted when the array or object contains no
elements or accessible properties (and hence would have a blank line between
the brackets).
2013-11-02 15:59:11 -04:00
609 changed files with 150646 additions and 100838 deletions

No files matched your search

+2
View File
@@ -246,6 +246,8 @@ sapi/fpm/php-fpm.1
sapi/fpm/init.d.php-fpm
sapi/fpm/php-fpm.conf
sapi/fpm/fpm/php-cgi
sapi/phpdbg/phpdbg_parser.c
sapi/phpdbg/phpdbg_parser.h
sapi/phpdbg/phpdbg
scripts/php-config
scripts/phpize
+5 -1
View File
@@ -15,8 +15,12 @@ env:
- PDO_MYSQL_TEST_USER=travis
- PDO_MYSQL_TEST_PASS=
- PDO_MYSQL_TEST_HOST=127.0.0.1
matrix:
- REPORT_EXIT_STATUS=1
matrix:
- ENABLE_MAINTAINER_ZTS=0 ENABLE_DEBUG=0
- ENABLE_MAINTAINER_ZTS=1 ENABLE_DEBUG=0
- ENABLE_MAINTAINER_ZTS=0 ENABLE_DEBUG=1
- ENABLE_MAINTAINER_ZTS=1 ENABLE_DEBUG=1
before_script:
# Compile PHP
-1
View File
@@ -115,7 +115,6 @@ clean:
find . -name \*.la -o -name \*.a | xargs rm -f
find . -name \*.so | xargs rm -f
find . -name .libs -a -type d|xargs rm -rf
find . -name \*.1 | xargs rm -f
rm -f libphp$(PHP_MAJOR_VERSION).la $(SAPI_CLI_PATH) $(SAPI_CGI_PATH) $(SAPI_MILTER_PATH) $(SAPI_LITESPEED_PATH) $(SAPI_FPM_PATH) $(OVERALL_TARGET) modules/* libs/*
distclean: clean
+339 -6
View File
@@ -1,6 +1,332 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 2014, PHP 5.6.0 Alpha 3
01 May 2014, PHP 5.6.0 Beta 2
- CLI server:
. Fixed bug #67079 (Missing MIME types for XML/XSL files). (Anatol)
- COM:
. Fixed bug #66431 (Special Character via COM Interface (CP_UTF8)). (Anatol)
- Core:
. Fixed bug #65701 (copy() doesn't work when destination filename is created
by tempnam()). (Boro Sitnikovski)
. Fixed bug #66015 (Unexpected array indexing in class's static property). (Bob)
. Added (constant) string/array dereferencing to static scalar expressions
to complete the set; now possible thanks to bug #66015 being fixed. (Bob)
. Fixed bug #66568 (Update reflection information for unserialize() function).
(Ferenc)
. Fixed bug #66660 (Composer.phar install/update fails). (Ferenc)
. Fixed bug #67024 (getimagesize should recognize BMP files with negative
height). (Gabor Buella)
. Fixed bug #67064 (Countable interface prevents using 2nd parameter
($mode) of count() function). (Bob)
. Fixed bug #67072 (Echoing unserialized "SplFileObject" crash). (Anatol)
. Fixed bug #67033 (Remove reference to Windows 95). (Anatol)
- cURL:
. Fixed bug #64247 (CURLOPT_INFILE doesn't allow reset). (Mike)
. Fixed bug #66562 (curl_exec returns differently than curl_multi_getcontent).
(Freek Lijten)
- Date:
. Fixed bug #66721 (__wakeup of DateTime segfaults when invalid object data is
supplied). (Boro Sitnikovski)
. Fixed bug #67118 (DateTime constructor crash with invalid data). (Anatol)
- DOM:
. Fixed bug #67081 (DOMDocumentType->internalSubset returns entire DOCTYPE tag,
not only the subset). (Anatol)
- Fileinfo:
. Fixed bug #66907 (Solaris 10 is missing strcasestr and needs substitute).
(Anatol)
. Fixed bug #66307 (Fileinfo crashes with powerpoint files). (Anatol)
- FPM:
. Fixed bug #66482 (unknown entry 'priority' in php-fpm.conf).
. Fixed bug #66908 (php-fpm reload leaks epoll_create() file descriptor).
(Julio Pintos)
. Fixed bug #67060 (sapi/fpm: possible privilege escalation due to insecure
default configuration) (CVE-2014-0185). (Stas)
- GMP:
. Fixed crashes in serialize/unserialize. (Stas)
- JSON:
. Fixed bug #66021 (Blank line inside empty array/object when
JSON_PRETTY_PRINT is set). (Kevin Israel)
- LDAP:
. Fixed issue with null bytes in LDAP bindings. (Matthew Daley)
- litespeed
. Fixed bug #63228 (-Werror=format-security error in lsapi code).
(George Wang)
- mysqlnd:
. Added a new fetching mode to mysqlnd. (Andrey)
- OpenSSL:
. Fix bug #66942 (memory leak in openssl_seal()). (Chuan Ma)
. Fix bug #66952 (memory leak in openssl_open()). (Chuan Ma)
. Fix bug #66840 (Fix broken build when extension built separately).
(Daniel Lowrey)
- phpdbg:
. Added watchpoints (watch command). (Bob)
. Renamed some commands (next => continue and how to step). (Joe)
. Fixed issue #85 (https://github.com/krakjoe/phpdbg/issues/85). (Bob)
- PDO:
. Fixed bug #66604 ('pdo/php_pdo_error.h' not copied to the include dir).
(Matteo)
- PDO-ODBC:
. Fixed bug #50444 (PDO-ODBC changes for 64-bit).
- Phar:
. Fix bug #64498 ($phar->buildFromDirectory can't compress file with an accent
in its name). (PR #588)
- SQLite:
. Fixed bug #66967 (Updated bundled libsqlite to 3.8.4.3). (Anatol)
- Apache2 Handler SAPI:
. Fixed Apache log issue caused by APR's lack of support for %zu
(APR issue https://issues.apache.org/bugzilla/show_bug.cgi?id=56120).
(Jeff Trawick)
10 Apr 2014, PHP 5.6.0 Beta 1
- Core:
. Allow zero length comparison in substr_compare() (Tjerk)
. Fixed bug #60602 (proc_open() changes environment array) (Tjerk)
. Fixed bug #61019 (Out of memory on command stream_get_contents). (Mike)
. Fixed bug #64330 (stream_socket_server() creates wrong Abstract Namespace
UNIX sockets). (Mike)
. Fixed bug #66182 (exit in stream filter produces segfault). (Mike)
. Fixed bug #66736 (fpassthru broken). (Mike)
. Fixed bug #66822 (Cannot use T_POW in const expression) (Tjerk)
. Fixed bug #67043 (substr_compare broke by previous change) (Tjerk)
- SPL:
. Added feature #65545 (SplFileObject::fread()) (Tjerk)
. Fixed bug #66834 (empty() does not work on classes that extend ArrayObject) (Tjerk)
. Fixed bug #66702 (RegexIterator::INVERT_MATCH does not invert). (Joshua
Thijssen)
- cURL:
. Fixed bug #66109 (Can't reset CURLOPT_CUSTOMREQUEST to default behaviour)
(Tjerk)
. Fix compilation on libcurl versions between 7.10.5 and 7.12.2, inclusive.
(Adam)
- Date:
. Added DateTimeImmutable::createFromMutable to create a DateTimeImmutable
object from an existing DateTime (mutable) object (Derick)
- Embed:
. Fixed bug #65715 (php5embed.lib isn't provided anymore). (Anatol).
- Fileinfo:
. Fixed bug #66820 (out-of-bounds memory access in fileinfo)
(CVE-2014-2270). (Remi)
. Fixed bug #66946i (fileinfo: extensive backtracking in awk rule regular
expression). (CVE-2013-7345) (Remi)
. Fixed bug #66987 (Memory corruption in fileinfo ext / bigendian).
(Remi)
- GD:
. Fixed bug #66815 (imagecrop(): insufficient fix for NULL defer
CVE-2013-7327). (Tomas Hoger, Remi).
. Fixed #66869 (Invalid 2nd argument crashes imageaffinematrixget) (Pierre)
. Fixed bug #66887 (imagescale - poor quality of scaled image). (Remi)
. Fixed bug #66890 (imagescale segfault). (Remi)
. Fixed bug #66893 (imagescale ignore method argument). (Remi)
- GMP:
. Fixed bug #66872 (invalid argument crashes gmp_testbit) (Pierre)
- Hash:
. Fixed bug #66698 (Missing FNV1a32 and FNV1a64 hash functions).
(Michael M Slusarz).
. Implemented timing attack safe string comparison function
(RFC: https://wiki.php.net/rfc/timing_attack). (Rouven Weßling)
. hash_pbkdf2() now works correctly if the $length argument is not specified.
(Nikita)
- Intl:
. Fixed bug #66873 (A reproductible crash in UConverter when given invalid
encoding) (Stas)
- Mail:
. Fixed bug #66535 (Don't add newline after X-PHP-Originating-Script) (Tjerk)
- Mbstring:
. Upgraded to oniguruma 5.9.5 (Anatol)
- Mcrypt:
. No longer allow invalid key sizes, invalid IV sizes or missing required IV
in mcrypt_encrypt, mcrypt_decrypt and the deprecated mode functions.
(Nikita)
. Use /dev/urandom as the default source for mcrypt_create_iv(). (Nikita)
- MySQLi:
. Fixed bug #66762 (Segfault in mysqli_stmt::bind_result() when link closed)
(Remi)
- OCI8
. Fixed Bug #66875 (Improve performance of multi-row OCI_RETURN_LOB queries)
(Perrier, Chris Jones)
- OpenSSL:
. Fixed memory leak in windows cert verification on verify failure.
(Chris Wright)
. Peer certificate capturing via SSL context options now functions even if
peer verification fails. (Daniel Lowrey)
. Encrypted TLS servers now support the server name indication TLS extension
via the new "SNI_server_certs" SSL context option. (Daniel Lowrey)
. Fixed bug #66833 (Default disgest algo is still MD5, switch to SHA1). (Remi)
- PCRE:
. Added support for (*MARK) backtracking verbs. (Nikita)
- PDO_firebird:
. Fixed Bug #66071 (memory corruption in error handling) (Popa)
- PDO_pgsql:
. Cleaned up code by increasing the requirements to libpq versions providing
PQexecParams, PQprepare, PQescapeStringConn, PQescapeByteaConn. According
to the release notes that means 8.0.8+ or 8.1.4+. (Matteo)
. Deprecated PDO::PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT, an
undocument constant effectively equivalent to PDO::ATTR_EMULATE_PREPARES.
(Matteo)
. Added PDO::PGSQL_ATTR_DISABLE_PREPARES constant to execute the queries
without preparing them, while still passing parameters separately from
the command text using PQexecParams. (Matteo)
- Pgsql:
. Read-only access to the socket stream underlying database connections is
exposed via a new pg_socket() function to allow read/write polling when
establishing asynchronous connections and executing queries in non-blocking
applications. (Daniel Lowrey)
. Asynchronous connections are now possible using the PGSQL_CONNECT_ASYNC
flag in conjunction with a new pg_connect_poll() function and connection
polling status constants. (Daniel Lowrey)
. New pg_flush() and pg_consume_input() functions added to manually complete
non-blocking reads/writes to underlying connection sockets. (Daniel Lowrey)
- Session
. Remove session_gc() and session_serializer_name() wich were introduced in the first 5.6.0 alpha.
- SimpleXML:
. Fixed bug #66084 (simplexml_load_string() mangles empty node name)
(Anatol)
- SQLite:
. Updated the bundled libsqlite to the version 3.8.3.1 (Anatol)
- XSL:
. Fixed bug #53965 (<xsl:include> cannot find files with relative paths
when loaded with "file://"). (Anatol)
27 Feb 2014, PHP 5.6.0 Alpha 3
- Core
. Expose get_debug_info class hook as __debugInfo() magic method. (Sara)
. Implemented unified default encoding
(RFC: https://wiki.php.net/rfc/default_encoding). (Yasuo Ohgaki)
- Curl
. Check for openssl.cafile ini directive when loading CA certs. (Daniel Lowrey)
. Remove cURL close policy related constants as these have no effect and are
no longer used in libcurl. (Chris Wright)
- Fileinfo
. Upgraded to libmagic-5.17 (Anatol)
. Fixed bug #66731 (file: infinite recursion). (CVE-2014-1943) (Remi)
- FPM:
. Added clear_env configuration directive to disable clearenv() call.
(Github PR# 598, Paul Annesley)
- GD:
. Fixed imagettftext to load the correct character map rather than the last one.
(Scott)
. Fixed bug #66714 ( imageconvolution breakage). (Brad Daily)
- JSON:
. Fixed bug #65753 (JsonSerializeable couldn't implement on module extension)
(chobieeee@php.net)
- OPCache
. Added function opcache_is_script_cached(). (Danack)
. Added information about interned strings usage. (Terry, Julien, Dmitry)
- OpenSSL
. Fallback to Windows CA cert store for peer verification if no openssl.cafile
ini directive or "cafile" SSL context option specified in Windows.
(Chris Wright)
. The openssl.cafile and openssl.capath ini directives introduced in alpha2
now have PHP_INI_PERDIR accessibility (was PHP_INI_ALL). (Daniel Lowrey)
. New "peer_name" SSL context option replaces "CN_match" (which still works
as before but triggers E_DEPRECATED). (Daniel Lowrey)
. Fixed segfault when accessing non-existent context for client SNI use
(Daniel Lowrey)
. Fixed bug #66501 (Add EC key support to php_openssl_is_private_key).
(Mark Zedwood)
. Fixed Bug #47030 (add new boolean "verify_peer_name" SSL context option
allowing clients to verify cert names separately from the cert itself).
"verify_peer_name" is enabled by default for client streams.
(Daniel Lowrey)
. Fixed Bug #65538 ("cafile" SSL context option now supports stream
wrappers). (Daniel Lowrey)
. New openssl_get_cert_locations() function to aid CA file and peer
verification debugging. (Daniel Lowrey)
. Encrypted stream wrappers now disable TLS compression by default.
(Daniel Lowrey)
. New "capture_session_meta" SSL context option allows encrypted client and
server streams access to negotiated protocol/cipher information.
(Daniel Lowrey)
. New "honor_cipher_order" SSL context option allows servers to prioritize
cipher suites of their choosing when negotiating SSL/TLS handshakes.
(Daniel Lowrey)
. New "single_ecdh_use" and "single_dh_use" SSL context options allow for
improved forward secrecy in encrypted stream servers. (Daniel Lowrey)
. New "dh_param" SSL context option allows stream servers control over
the parameters when negotiating DHE cipher suites. (Daniel Lowrey)
. New "ecdh_curve" SSL context option allowing stream servers to specify
the curve to use when negotiating ephemeral ECDHE ciphers (defaults to
NIST P-256). (Daniel Lowrey)
. New "rsa_key_size" SSL context option gives stream servers control
over the key size (in bits) used for RSA key agreements. (Daniel Lowrey)
. Crypto methods for encrypted client and server streams now use
bitwise flags for fine-grained protocol support. (Daniel Lowrey)
. Added new tlsv1.0 stream wrapper to specify TLSv1 client/server method.
tls wrapper now negotiates TLSv1, TLSv1.1 or TLSv1.2. (Daniel Lowrey)
. Encrypted client streams now enable SNI by default. (Daniel Lowrey)
. Encrypted streams now prioritize ephemeral key agreement and high strength
ciphers by default. (Daniel Lowrey)
. New OPENSSL_DEFAULT_STREAM_CIPHERS constant exposes default cipher
list. (Daniel Lowrey)
. New STREAM_CRYPTO_METHOD_* constants for enhanced control over the crypto
methods negotiated encrypted server/client sessions. (Daniel Lowrey)
. Encrypted stream servers now automatically mitigate potential DoS vector
arising from client-initiated TLS renegotiation. New "reneg_limit",
"reneg_window" and "reneg_limit_callback" SSL context options for custom
renegotiation limiting control. (Daniel Lowrey)
- Pgsql:
. pg_insert()/pg_select()/pg_update()/pg_delete() are no longer EXPERIMENTAL.
(Yasuo)
. Impremented FR #25854 Return value for pg_insert should be resource instead of bool.
(Yasuo)
. Implemented FR #41146 - Add "description" with exteneded flag pg_meta_data().
pg_meta_data(resource $conn, string $table [, bool extended])
It also made pg_meta_data() return "is enum" always.
(Yasuo)
13 Feb 2014, PHP 5.6.0 Alpha 2
- Core:
@@ -14,6 +340,13 @@ PHP NEWS
- PCRE:
. Upgraded to PCRE 8.34. (Anatol)
- ldap
. Added new function ldap_modify_batch(). (Ondrej Hosek)
- OpenSSL
. Peer certificates now verified by default in client socket operations
(RFC: https://wiki.php.net/rfc/tls-peer-verification). (Daniel Lowrey)
. New openssl.cafile and openssl.capath ini directives. (Daniel Lowrey)
23 Jan 2014, PHP 5.6.0 Alpha 1
- CLI server:
@@ -47,6 +380,10 @@ PHP NEWS
. Implemented FR #65646 (re-enable CURLOPT_FOLLOWLOCATION with open_basedir
or safe_mode). (Adam)
- FPM
. Included apparmor support in fpm
(RFC: https://wiki.php.net/rfc/fpm_change_hat). (Gernot Vormayr)
- GMP:
. Moved GMP to use object as the underlying structure and implemented various
improvements based on this.
@@ -74,7 +411,7 @@ PHP NEWS
cache_slots) in op_array->literals table. (Laruence, Dmitry)
. Added script level constant replacement optimization pass. (Dmitry)
- Openssl:
- OpenSSL:
. Added crypto_method option for the ssl stream context. (Martin Jansen)
. Added certificate fingerprint support. (Tjerk Meesters)
. Added explicit TLSv1.1 and TLSv1.2 stream transports. (Daniel Lowrey)
@@ -82,8 +419,6 @@ PHP NEWS
. Peer name verification matches SAN DNS names for certs using
the Subject Alternative Name x509 extension. (Daniel Lowrey)
. Fixed segfault when built against OpenSSL>=1.0.1 (Daniel Lowrey)
. Peer certificates now verified by default in client socket operations
(RFC: https://wiki.php.net/rfc/tls-peer-verification). (Daniel Lowrey)
. Added SPKAC support. (Jason Gerfen)
- PDO_pgsql:
@@ -104,11 +439,9 @@ PHP NEWS
- Session:
. Fixed Bug #65315 (session.hash_function silently fallback to default md5)
(Yasuo)
. Implemented Request #54649 (Create session_serializer_name()). (Yasuo)
. Implemented Request #17860 (Session write short circuit). (Yasuo)
. Implemented Request #20421 (session_abort() and session_reset() function).
(Yasuo)
. Implemented Request #11100 (session_gc() function). (Yasuo)
- Standard:
. Implemented FR #65634 (HTTP wrapper is very slow with protocol_version
+1 -1
View File
@@ -139,7 +139,7 @@ Rolling a stable release
1. Checkout your release branch, you should have created when releasing previous RC
and bump the version numbers in ``main/php_version.h``, ``configure.in`` and possibly ``NEWS``.
2. If a CVE commit needs to be merged to the release, then have it commited to
2. If a CVE commit needs to be merged to the release, then have it committed to
the base branches and merged upwards as usual (f.e commit the CVE fix to 5.3,
merge to 5.4, 5.5 etc...). Then you can cherry-pick it in your release branch.
Don't forget to update NEWS manually in an extra commit then.
+1 -1
View File
@@ -2,7 +2,7 @@
#define TSRM_CONFIG_COMMON_H
#ifndef __CYGWIN__
# if WINNT|WIN32
# ifdef _WIN32
# define TSRM_WIN32
# endif
#endif
+327 -39
View File
@@ -1,25 +1,40 @@
$Id$
PHP X.Y UPGRADE NOTES
PHP 5.6 UPGRADE NOTES
1. Backward Incompatible Changes
2. New Features
2. Changes in SAPI modules
3. Deprecated Functionality
4. Changed Functions
5. New Functions
6. New Classes and Interfaces
7. Removed Extensions
8. Other Changes to Extensions
9. New Global Constants
10. Changes to INI File Handling
11. Other Changes
3. Changes in SAPI modules
4. Deprecated Functionality
5. Changed Functions
6. New Functions
7. New Classes and Interfaces
8. Removed Extensions
9. Other Changes to Extensions
10. New Global Constants
11. Changes to INI File Handling
12. Other Changes
========================================
1. Backward Incompatible Changes
========================================
- Core:
By fixing bug #66015 it is no longer possible to overwrite keys in static scalar
arrays. Quick example to illustrate:
class Test {
const FIRST = 1;
public $array = array(
self::FIRST => 'first',
'second',
'third'
);
}
Test::$array will have as expected three array keys (1, 2, 3) and no longer
two (0, 1). self::FIRST will no longer overwrite 'third' having key 1 then,
but will mark the beginning of indexing.
- JSON:
json_decode() no longer accepts non-lowercase variants of lone JSON true,
false or null values. For example, True or FALSE will now cause json_decode to
@@ -28,16 +43,23 @@ PHP X.Y UPGRADE NOTES
containing non-lowercase values inside JSON arrays or objects has never been
accepted.
- openssl:
To prevent Man-in-the-Middle attacks against encrypted transfers client
- OpenSSL:
To prevent man-in-the-middle attacks against encrypted transfers client
streams now verify peer certificates by default. Previous versions
required users to manually enable peer verification. As a result of this
change, existing code using ssl:// or tls:// stream wrappers (e.g.
file_get_contents(), fsockopen(), stream_socket_client()) may no longer
connect successfully without manually disabling peer verification via the
stream context's "verify_peer" setting. Encrypted transfers delegate to
operating system certificate stores by default, so many/most users *should*
be unaffected by this transparent security enhancement.
operating system certificate stores by default if not overridden via the
new openssl.cafile and openssl.cafile ini directives or via call-time SSL
context options, so most users should be unaffected by this transparent
security enhancement. (https://wiki.php.net/rfc/tls-peer-verification)
- Mcrypt:
The mcrypt_encrypt(), mcrypt_decrypt() and mcrypt_{MODE}() functions no
longer accept keys or IVs with incorrect sizes. Furthermore an IV is now
required if the used block cipher mode requires it.
========================================
2. New Features
@@ -52,89 +74,234 @@ PHP X.Y UPGRADE NOTES
- Added support for argument unpacking to complement the variadic syntax.
(https://wiki.php.net/rfc/argument_unpacking)
- Added T_POW (**) operator.
- Added an exponentiation operator (**).
(https://wiki.php.net/rfc/pow-operator)
- The php://input stream is now re-usable and can be used concurrently with
- Added unified default encoding. default_charset=UTF-8 and functions/extensions
use encoding settings honor default_charset.
- The php://input stream is now re-usable and can be used concurrently with
enable_post_data_reading=0.
- Added gost-crypto (CryptoPro S-box) hash algo.
- Added openssl certificate fingerprint support (inclusive stream context
option).
- Added openssl crypto method stream context option.
- Added openssl peer verification support for SAN x509 extension
- Added use function and use const.
(https://wiki.php.net/rfc/use_function)
- Added a function for timing attack safe string comparison
(https://wiki.php.net/rfc/timing_attack)
- Added gost-crypto (CryptoPro S-box) hash algorithm.
- Stream wrappers verify peer certificates and host names by default in
encrypted client streams.
- Added openssl certificate fingerprint support (inclusive stream context
option).
- Added support for SAN x509 extension matching when verifing host names in
encrypted streams.
- Added a range of new SSL context options for improved encrypted stream
server security (https://wiki.php.net/rfc/improved-tls-defaults):
. "honor_cipher_order" allows servers to prioritize cipher suites of their
choosing when negotiating SSL/TLS handshakes.
. "single_ecdh_use" and "single_dh_use" allow for improved forward
secrecy in encrypted stream servers.
. "dh_param" allows specification of pre-generated key generation
parameters when negotiating ephemeral DHE ciphers in stream servers.
. "ecdh_curve" allows stream servers to specify which curve to use when
negotiating ephemeral ECDHE ciphers (defaults to NIST P-256).
. "rsa_key_size" SSL context option gives stream servers control
over the key size (in bits) used when negotiating RSA ciphers.
. "capture_session_meta" if specified stores an array of data describing
the TLS session's protocol/cipher in the "session_meta" SSL context key.
- Added automatic mitigation against client-initated TLS renegotiation DoS
attacks in encrypted server streams. Renegotiation limiting may be
customized via three new SSL context options:
. "reneg_limit" (number of allowed renegotiations per time window)
. "reneg_window" (renegotiation time window in seconds)
. "reneg_limit_callback" (optional notification callback on limiting)
- Encrypted TLS servers now support the server name indication (SNI) TLS
extension via the new "SNI_server_certs" SSL context option.
- Added "crypto_method" SSL context option for use in encrypted streams.
- Added "peer_name" SSL context option to better reflect peer certificate
name matching using SAN extension (replaces deprecated "CN_match").
- Added stream wrapper support when specifying "cafile" SSL context paths.
- Independent peer cert and peer name validation is now available via a new
boolean "verify_peer_name" SSL context option. This option is enabled by
default in encrypted client streams.
- Added protocol-specific tlsv1.0://, tlsv1.1:// and tlsv1.2:// encryption
stream wrappers. tls:// wrapper now supports TLSv1.1 and TLSv1.2 (previously
only supported TLSv1).
- Stream crypto method specification now accepts flags instead of values
allowing support for multiple discrete protocols in a given stream.
- PostgreSQL database connections may now be established asynchronously using
new constants and polling functions in ext/pgsql.
- Non-blocking read/write query behavior now optionally available in database
operations using the ext/pgsql extension.
========================================
2. Changes in SAPI modules
3. Changes in SAPI modules
========================================
- Added phpdbg sapi.
- Added phpdbg SAPI.
(https://wiki.php.net/rfc/phpdbg)
- Support for FPM workers changing the apparmor profile through the pool configuration.
(https://wiki.php.net/rfc/fpm_change_hat)
- Support for several XML MIME types in the built-in CLI server. For static
files with extensions .xml, .xsl, .xsd the Content-Type header
application/xml is now sent automatically.
========================================
3. Deprecated Functionality
4. Deprecated Functionality
========================================
- Incompatible context calls:
Instance calls from an incompatible context are now deprecated and issue
E_DEPRECATED instead of E_STRICT. See https://wiki.php.net/rfc/incompat_ctx
- The "CN_match" and "SNI_server_name" SSL context options are deprecated in
favor of the new "peer_name" option. Name verification now checks certificate
SAN names as well as the CN field and the specific name fields are deprecated
to avoid confusion. Their use triggers E_DEPRECATED but continues to work as
before. If specified, the specific values take precedence over the general
"peer_name" value.
- Deprecated PDO::PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STATEMENT, an
undocument constant effectively equivalent to PDO::ATTR_EMULATE_PREPARES.
- Deprecated INIs: Following INIs are deprecated in favour of new
internal_encoding/input_encoding/output_encoding. Refer to "Changes to
encodings in PHP 5.6" in "11. Other Changes" section for more details.
iconv.input_encoding
iconv.output_encoding
iconv.internal_encoding
mbstring.http_input
mbstring.http_output
mbstring.internal_encoding
========================================
4. Changed Functions
5. Changed Functions
========================================
- cURL:
CURLOPT_SAFE_UPLOAD is now turned on by default and uploads with @file
do not work unless it is explicitly set to false.
curl_setopt() now supports the following nullable settings (>= 5.5.11):
. CURLOPT_CUSTOMREQUEST
. CURLOPT_FTPPORT
. CURLOPT_RANGE
. CURLOPT_FTP_ACCOUNT
. CURLOPT_RTSP_SESSION_ID
. CURLOPT_KRBLEVEL
. CURLOPT_KRB4LEVEL
- Strings:
substr_compare() now allows $length to be zero.
- Crypt:
crypt() will now raise an E_NOTICE error if the salt parameter is omitted.
See: https://wiki.php.net/rfc/crypt_function_salt
- Mcrypt:
The $source parameter of mcrypt_create_iv() now defaults to
MCRYPT_DEV_URANDOM instead of MCRYPT_DEV_RANDOM.
- XMLReader:
XMLReader::getAttributeNs and XMLReader::getAttributeNo now return NULL if
the attribute could not be found, just like XMLReader::getAttribute.
- Pgsql:
pg_insert()/pg_select()/pg_update()/pg_delete() are no longer EXPERIMENTAL.
The following functions no longer block until query write completion if the
socket stream underlying a database connection is set to non-blocking mode:
. pg_send_execute()
. pg_send_prepare()
. pg_send_query()
. pg_send_query_params()
- unserialize:
Manipulated serialization strings for objects implementing Serializable by
replacing "C:" with "O:" at the start will now produce an error.
========================================
5. New Functions
6. New Functions
========================================
- GMP:
Added gmp_root($a, $nth) and gmp_rootrem($a, $nth) for calculating nth roots.
- Openssl:
- Hash
Added hash_equals($known_string, $user_string)
- OpenSSL:
Added string openssl_x509_fingerprint($x509, $type, $binary).
Added string openssl_spki_new($private_key, $challenge, $algorithm)
Added bool openssl_spki_verify($spkac)
Added string openssl_spki_export($spkac)
Added string openssl_spki_export_challenge($spkac)
Added array openssl_get_cert_locations()
- LDAP:
Added ldap_escape($value, $ignore = "", $flags = 0).
Added ldap_modify_batch($link_identifier, $dn, $modifications) described in
https://wiki.php.net/rfc/ldap_modify_batch.
- Pgsql:
Added pg_socket($connection) to allow async connections and non-blocking IO
Added pg_connect_poll($connection) for establishing async connections
Added pg_consume_input($connection) for non-blocking query result consumption
Added pg_flush($connection) for non-blocking query write completion
- PDO_pgsql
Added PDO::pgsqlGetNotify($result_type = PDO::FETCH_USE_DEFAULT, $ms_timeout = 0)
Added PDO::pgsqlGetPid()
- Zip:
Added ZipArchive::setPassword($password)
- SPL
Added SplFileObject::fread($length) to complement fwrite() method (>= 5.5.11)
========================================
6. New Classes and Interfaces
7. New Classes and Interfaces
========================================
========================================
7. Removed Extensions
8. Removed Extensions
========================================
========================================
8. Other Changes to Extensions
9. Other Changes to Extensions
========================================
- cURL:
- The following constants have been removed as they are now marked "obsolete"
in the underlying library and never had any effect to begin with:
. CURLOPT_CLOSEPOLICY
. CURLCLOSEPOLICY_CALLBACK
. CURLCLOSEPOLICY_LEAST_RECENTLY_USED
. CURLCLOSEPOLICY_LEAST_TRAFFIC
. CURLCLOSEPOLICY_OLDEST
. CURLCLOSEPOLICY_SLOWEST
- GMP:
The GMP extension now uses objects as the underlying data structure, rather
than resources. GMP instances now support dumping, serialization, cloning,
@@ -147,29 +314,105 @@ PHP X.Y UPGRADE NOTES
- Using 'oci_execute($s, OCI_NO_AUTO_COMMIT)' for a SELECT no longer
unnecessarily initiates an internal ROLLBACK during connection
close.
- Multi-row OCI_RETURN_LOB queries require fewer "round trips" to the database.
- Added DTrace probes enabled with PHP's generic --enable-dtrace
- The oci_internal_debug() function is now a no-op.
- The phpinfo() output format for OCI8 has changed.
- OpenSSL:
- The "SNI_enabled" SSL stream context option is now set to TRUE by default
if supported by the underlying openssl library.
- PCRE:
- The information collected by the (*MARK) backtracking control verb is now
collected into the "MARK" index of the $matches array for preg_match(),
preg_match_all() and preg_replace_callback().
- Pgsql:
- pg_insert()/pg_select()/pg_update()/pg_delete()/pg_meta_data()/pg_convert()
are no longer EXPERIMENTAL
- Added PGSQL_DML_ESCAPE option for pg_insert()/pg_select()/pg_update()/pg_delete()
that simply escapes all supplied parameters. These functions can be as fast as
native query. Unvalidated data(Unknown data types) is passed as string.
JSON/Array/etc are supported both PGSQL_DML_ESCAPE and pg_convert() as string.
- pg_select() returns PostgreSQL query resource when query is executed.
- Added extended flag parameter for pg_meta_data(). pg_meta_data() always
returns "is enum" attribute.
- The new pg_socket() function returns a socket stream with no behavior other
than to allow IO-readiness polling on a DB connection socket. Calling
stream_set_blocking() on its result enables non-blocking behavior.
- Passing the new PGSQL_CONNECT_ASYNC flag to pg_connect() allows applications
to poll for IO readiness via pg_connect_poll() and establish connections
asynchronously.
- PDO_pgsql:
- Added PDO::PGSQL_ATTR_DISABLE_PREPARES constant to execute the queries
without preparing them, while still passing parameters separately from
the command text using PQexecParams.
- Added LISTEN/NOTIFY support via PDO::pgsqlGetNotify / PDO::pgsqlGetPid()
as described in https://bugs.php.net/bug.php?id=42614.
========================================
9. New Global Constants
10. New Global Constants
========================================
- LDAP:
LDAP_ESCAPE_FILTER int(1)
LDAP_ESCAPE_DN int(2)
- Pgsql:
PGSQL_DML_ESCAPE int(4096)
PGSQL_CONNECT_ASYNC
PGSQL_CONNECTION_STARTED
PGSQL_CONNECTION_MADE
PGSQL_CONNECTION_AWAITING_RESPONSE
PGSQL_CONNECTION_AUTH_OK
PGSQL_CONNECTION_SSL_STARTUP
PGSQL_CONNECTION_SETENV
PGSQL_POLLING_FAILED
PGSQL_POLLING_READING
PGSQL_POLLING_WRITING
PGSQL_POLLING_OK
PGSQL_POLLING_ACTIVE
- OpenSSL:
STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT int(9)
STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT int(17)
STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT int(33)
STREAM_CRYPTO_METHOD_ANY_CLIENT int(63)
STREAM_CRYPTO_METHOD_TLSv1_0_SERVER int(8)
STREAM_CRYPTO_METHOD_TLSv1_1_SERVER int(16)
STREAM_CRYPTO_METHOD_TLSv1_2_SERVER int(32)
STREAM_CRYPTO_METHOD_ANY_SERVER int(62)
OPENSSL_DEFAULT_STREAM_CIPHERS string
========================================
10. Changes to INI File Handling
11. Changes to INI File Handling
========================================
- Core:
Changed always_populate_raw_post_data to throw a deprecation warning when
enabled and to recognize ohe value -1 for never populating the global
enabled and to recognize the value -1 for never populating the global
$HTTP_RAW_POST_DATA variable, which will be default in future PHP versions.
default_charset is set to UTF-8. It was empty previously. default_charset
is used where it is applicable. Iconv/Mbstring/htmlentities/htmlspecialchars/
html_entity_decode use default_charset as default encoding.
internal_encoding/input_encoding/output_encoding is added for encoding
handling modules. Refer to "Changes to encodings in PHP 5.6" in "11. Other Changes"
section for more details.
- cURL:
If the new openssl.cafile ini directive is specified ext/curl will give the
openssl path precedence over its own curl.cainfo directive.
- OpenSSL:
openssl.cafile and openssl.capath ini directives have been added to allow
global CA default specification as necessary.
========================================
11. Other Changes
12. Other Changes
========================================
- File upload:
@@ -179,6 +422,51 @@ PHP X.Y UPGRADE NOTES
HTTP 1.1 requests now include a Connection: close header unless explicitly
overridden by setting a Connection header via the header context option.
- PDO_pgsql
A libpq version providing PQexecParams, PQprepare, PQescapeStringConn,
PQescapeByteaConn is now required. According to the release notes that means
8.0.8+ or 8.1.4+.
- Zip:
New --with-libzip option allow to use system libzip. Version > 0.11 required,
Version >= 0.11.2 recommended for all features.
- Changes to encodings in PHP 5.6
The default value of default_charset is now UTF-8 when it is not
explicitly set in php.ini
The following php.ini parameters were added:
internal_encoding
input_encoding
output_encoding
The values of the following php.ini parameters have become empty in
PHP 5.6 (previously they were all ISO-8859-1)
iconv.input_encoding
iconv.output_encoding
iconv.internal_encoding
Changes were made to character set handling in:
- the iconv and mbstring extensions,
- and htmlentities(), htmlspecialchars(), html_entity_decode() functions
The precedence for these is now:
default_charset < internal/input/output_encoding < (mbstring.* || iconv.*) < function parameter
For example, the easiest way to use the UTF-8 encoding is to set
default_charset=UTF-8 and leave the following php.ini parameters
empty:
iconv.input_encoding
iconv.output_encoding
iconv.internal_encoding
mbstring.http_input
mbstring.http_output
mbstring.internal_encoding
internal_encoding
input_encoding
output_encoding
+111 -2
View File
@@ -7,6 +7,14 @@ UPGRADE NOTES - PHP X.Y
b. return_value_ptr now always available, RETVAL_ZVAL_FAST macros
c. POST data handling
d. Arginfo changes
e. tsrm_virtual_cwd.h moved to zend_virtual_cwd.h
f. empty strings are interned
g. Additional str_* APIs
h. Addition of zend_hash_reindex
i. Addition of zend_hash_splice
j. An additional parameter is sent to Countable::count()
k. Unserialization of manipulated object strings
l. Removal of IS_CONSTANT_ARRAY and IS_CONSTANT_INDEX hack
2. Build system changes
a. Unix build system changes
@@ -110,6 +118,104 @@ UPGRADE NOTES - PHP X.Y
ARG_SHOULD_BE_SENT_BY_REF() and ARG_MAY_BE_SENT_BY_REF() macros now assume
that the argument passed to them is a zend_function* and that it is non-NULL.
e. tsrm_virtual_cwd.h moved to zend_virtual_cwd.h
Memory allocation is now managed by emalloc/efree instead of malloc/free.
f. empty strings are interned
String created using STR_EMPTY_ALLOC() are now interned.
convert_to_string use STR_EMPTY_ALLOC() for zval when IS_NULL.
str_efree() shoud be preferred as efree() on such strings can cause memory
corruption.
g. Additional str_* APIs
In addition to the previously existing str_free() and str_efree() macros, the
following macros have been introduced to simplify dealing with potentially
interned strings:
str_efree_rel(str) - efree_rel() if not interned
str_erealloc(str, new_len) - erealloc() or emalloc+memcpy if interned
str_estrndup(str, len) - estrndup() if not interned
str_strndup(str, len) - zend_strndup() if not interned
str_hash(str, len) - INTERNED_HASH(str) if interned,
zend_hash_func(str, len+1) otherwise
h. Addition of zend_hash_reindex
A zend_hash_reindex() function with the following prototype has been added:
void zend_hash_reindex(HashTable *ht, zend_bool only_integer_keys);
If only_integer_keys==0, this function will change all keys to be continuous,
zero-based integers in hash order. If only_integer_keys==1 the same will be
done only for keys that were already integers previously, while leaving
string keys alone.
i. Addition of zend_hash_splice
A zend_hash_splice() macro with the following prototype has been added:
void zend_hash_splice(
HashTable *ht, uint nDataSize, copy_ctor_func_t pCopyConstructor,
uint offset, uint length,
void **list, uint list_count, HashTable *removed
);
This function performs an in-place splice operation on a hashtable:
The elements between offset and offset+length are removed and the elements in
list[list_count] are inserted in their place. The removed elements can be
optionally collected into a hashtable.
This operation reindexes the hashtable, i.e. integer keys will be zero-based
and sequential, while string keys stay intact. The same applies to the
elements inserted into the removed HT.
As a side-effect of this addition the signature of the php_splice() function
changed:
void php_splice(
HashTable *ht, zend_uint offset, zend_uint length,
zval ***list, zend_uint list_count, HashTable *removed TSRMLS_DC
)
This function now directly forwards to zend_hash_splice(), resets the
IAP of ht (for compatibility with the previous implementation) and resets
CVs if the passed hashtable is the global symbol table.
j. An additional parameter is sent to Countable::count()
That parameter denotes the $mode passed to count; it shouldn't affect any
userland code, but any zend_parse_parameters() used with no arguments should
fail. Extensions which implement Countable internally, need to accept one
optional long as parameter.
k. Unserialization of manipulated object strings
Strings requiring unserialization of objects are now explicitly checked
whether the object they contain implements the Serializable interface.
This solves the situation where manipulated strings could be passed for
objects using Serializable to disallow serialization. An object
implementing Serializable will always start with "C:" in the serialized
string, all other objects are represented with starting "O:". Objects
implementing Serializable to disable serialization using
zend_class_unserialize_deny and zend_class_serialize_deny, when
instantiated from the serializer with a manipulated "O:" string at the
start, will most likely be defectively initialized. This is now
fixed at the appropriate place by checking for the presence of the
serialize callback in the class entry.
l. Removal of IS_CONSTANT_ARRAY and IS_CONSTANT_INDEX hack
These two #defines disappeared. Instead we have now IS_CONSTANT_AST which
covers also the functionality IS_CONSTANT_ARRAY bid and furthermore the
hack for marking zvals as constant index with IS_CONSTANT_INDEX is now
superfluous and so removed.
Please note that IS_CONSTANT_AST now has the same value than
IS_CONSTANT_ARRAY had.
========================
2. Build system changes
========================
@@ -120,5 +226,8 @@ UPGRADE NOTES - PHP X.Y
variable. Previously `bison` was assumed to be in $PATH.
b. Windows build system changes
-
- The configure option --enable-static-analyze isn't available anymore.
The new option was introduced --with-analyzer.
- It is possible to disable PGO for single extensions, to do that
define a global variable PHP_MYMODULE_PGO evaluating to false
inside config.w32
+5 -9
View File
@@ -30,12 +30,12 @@ test(...getArray([1, 2, 3]));
test(...arrayGen([]));
test(...arrayGen([1, 2, 3]));
test(1, ...[2, 3], ...[4, 5], 6);
test(1, ...getArray([2, 3]), ...arrayGen([4, 5]), 6);
test(1, ...[2, 3], ...[4, 5]);
test(1, ...getArray([2, 3]), ...arrayGen([4, 5]));
test2(...[1, 2]);
test2(...[1, 2, 3]);
test2(...[1], ...[], ...[], ...[2, 3], 4, ...[5, 6]);
test2(...[1], ...[], ...[], ...[2, 3], ...[4, 5]);
?>
--EXPECT--
@@ -75,7 +75,7 @@ array(3) {
[2]=>
int(3)
}
array(6) {
array(5) {
[0]=>
int(1)
[1]=>
@@ -86,10 +86,8 @@ array(6) {
int(4)
[4]=>
int(5)
[5]=>
int(6)
}
array(6) {
array(5) {
[0]=>
int(1)
[1]=>
@@ -100,8 +98,6 @@ array(6) {
int(4)
[4]=>
int(5)
[5]=>
int(6)
}
int(1)
int(2)
+67 -71
View File
@@ -17,46 +17,37 @@ $array = [1, 2, 3];
test1(...$array);
var_dump($array);
$array1 = [1, 2]; $val2 = 3; $array2 = [4, 5];
test1(...$array1, $val2, ...$array2);
var_dump($array1, $val2, $array2);
$array1 = [1, 2]; $array2 = [3, 4];
test1(...$array1, ...$array2);
var_dump($array1, $array2);
function test2($val1, &$ref1, $val2, &$ref2) {
$ref1++;
$ref2++;
}
$array = [1, 2, 3, 4];
$array = [0, 0, 0, 0];
test2(...$array);
var_dump($array);
$array1 = [1, 2]; $array2 = [4, 5];
test1(...$array1, ...$array2);
var_dump($array1, $array2);
$a = $b = $c = $d = 0;
$array = [0, 0, 0, 0];
$array = [];
test2(...$array, $a, $b, $c, $d);
var_dump($array, $a, $b, $c, $d);
test2($a, ...$array);
var_dump($a, $array);
$array = [1];
test2(...$array, $a, $b, $c, $d);
var_dump($array, $a, $b, $c, $d);
test2($a, $b, ...$array);
var_dump($a, $b, $array);
$array = [1, 2];
test2(...$array, $a, $b, $c, $d);
var_dump($array, $a, $b, $c, $d);
test2($a, $b, $c, ...$array);
var_dump($a, $b, $c, $array);
$array = [1, 2, 3];
test2(...$array, $a, $b, $c, $d);
var_dump($array, $a, $b, $c, $d);
$vars = [];
$array = [];
test2(...$array, $vars['a'], $vars['b'], $vars['c'], $vars['d']);
var_dump($vars);
$vars = [];
$array = [1];
test2(...$array, $vars['a'], $vars['b'], $vars['c'], $vars['d']);
var_dump($vars);
test2($a, $b, $c, $d, ...$array);
var_dump($a, $b, $c, $d, $array);
?>
--EXPECTF--
@@ -74,76 +65,81 @@ array(2) {
[1]=>
int(3)
}
int(4)
array(2) {
[0]=>
int(4)
[1]=>
int(5)
}
array(4) {
[0]=>
int(0)
[1]=>
int(1)
[2]=>
int(0)
[3]=>
int(1)
}
array(2) {
[0]=>
int(2)
[1]=>
int(3)
}
array(2) {
[0]=>
int(5)
[1]=>
int(6)
}
int(0)
array(4) {
[0]=>
int(1)
[1]=>
int(3)
int(0)
[2]=>
int(3)
int(1)
[3]=>
int(5)
}
array(0) {
int(0)
}
int(0)
int(1)
int(0)
int(1)
array(1) {
[0]=>
int(1)
}
int(1)
int(1)
int(1)
int(1)
array(2) {
array(4) {
[0]=>
int(1)
[1]=>
int(3)
}
int(1)
int(2)
int(1)
int(1)
array(3) {
[0]=>
int(1)
[1]=>
int(3)
[2]=>
int(3)
int(1)
[3]=>
int(0)
}
int(0)
int(2)
int(2)
int(1)
int(1)
Notice: Undefined index: a in %s on line %d
Notice: Undefined index: c in %s on line %d
array(2) {
["b"]=>
int(0)
array(4) {
[0]=>
int(2)
[1]=>
int(1)
["d"]=>
[2]=>
int(1)
[3]=>
int(0)
}
Notice: Undefined index: b in %s on line %d
Notice: Undefined index: d in %s on line %d
array(2) {
["a"]=>
int(0)
int(3)
int(0)
int(1)
array(4) {
[0]=>
int(2)
[1]=>
int(1)
["c"]=>
[2]=>
int(1)
[3]=>
int(0)
}
+1 -1
View File
@@ -9,7 +9,7 @@ $fn = function(...$args) {
$fn(...[]);
$fn(...[1, 2, 3]);
$fn(1, ...[2, 3], ...[], 4, 5);
$fn(1, ...[2, 3], ...[], ...[4, 5]);
?>
--EXPECT--
+1 -1
View File
@@ -12,7 +12,7 @@ test(...42);
test(...new stdClass);
test(1, 2, 3, ..."foo", ...[4, 5]);
test(1, 2, ...new StdClass, 3, ...3.14, ...[4, 5]);
test(1, 2, 3, ...new StdClass, ...3.14, ...[4, 5]);
?>
--EXPECTF--
+1 -14
View File
@@ -14,8 +14,7 @@ class Foo {
}
$foo = new Foo;
$foo->test(...[1, 2], 3, 4, ...[], 5);
Foo::test2(1, 2, ...[3, 4], ...[], 5);
Foo::test2(1, 2, ...[3, 4], ...[], ...[5]);
?>
--EXPECT--
@@ -31,15 +30,3 @@ array(5) {
[4]=>
int(5)
}
array(5) {
[0]=>
int(1)
[1]=>
int(2)
[2]=>
int(3)
[3]=>
int(4)
[4]=>
int(5)
}
+2 -6
View File
@@ -11,7 +11,7 @@ class Foo {
new Foo(...[]);
new Foo(...[1, 2, 3]);
new Foo(...[1], 2, ...[], ...[3, 4], 5);
new Foo(...[1], ...[], ...[2, 3]);
?>
--EXPECT--
@@ -25,15 +25,11 @@ array(3) {
[2]=>
int(3)
}
array(5) {
array(3) {
[0]=>
int(1)
[1]=>
int(2)
[2]=>
int(3)
[3]=>
int(4)
[4]=>
int(5)
}
@@ -0,0 +1,10 @@
--TEST--
Positional arguments cannot be used after argument unpacking
--FILE--
<?php
var_dump(...[1, 2, 3], 4);
?>
--EXPECTF--
Fatal error: Cannot use positional argument after argument unpacking in %s on line %d
@@ -20,11 +20,11 @@ function gen() {
}
try {
test(1, 2, ...new Foo, 3, 4);
test(1, 2, ...new Foo, ...[3, 4]);
} catch (Exception $e) { var_dump($e->getMessage()); }
try {
test(1, 2, ...gen(), 3, 4);
test(1, 2, ...gen(), ...[3, 4]);
} catch (Exception $e) { var_dump($e->getMessage()); }
?>
@@ -13,8 +13,6 @@ function gen($array) {
}
}
test(...gen([1, 2, 3]), $a);
var_dump($a);
test(1, 2, 3, $b, ...gen([4, 5, 6]));
var_dump($b);
@@ -25,7 +23,6 @@ test(...gen([1, 2]), ...gen([3, 4]));
?>
--EXPECTF--
int(42)
int(42)
Warning: Cannot pass by-reference argument 4 of test() by unpacking a Traversable, passing by-value instead in %s on line %d
+30
View File
@@ -0,0 +1,30 @@
--TEST--
Bug #66015 (wrong array indexing in class's static property)
--FILE--
<?php
class Test
{
const FIRST = 1;
const SECOND = 2;
const THIRD = 3;
protected static $array = [
self::FIRST => 'first',
'second',
'third'
];
public function __construct()
{
var_export(self::$array);
}
}
$test = new Test();
?>
--EXPECTF--
array (
1 => 'first',
2 => 'second',
3 => 'third',
)
+13
View File
@@ -0,0 +1,13 @@
--TEST--
Bug #66660 (Composer.phar install/update fails)
--STDIN--
<?php __CLASS__ ?>
--FILE--
<?php
file_put_contents(__DIR__."/bug66660.tmp.php", "<?php __CLASS__ ?>");
echo php_strip_whitespace(__DIR__."/bug66660.tmp.php");
?>
--CLEAN--
<?php unlink(__DIR__."/bug66660.tmp.php"); ?>
--EXPECT--
<?php __CLASS__ ?>
+5
View File
@@ -35,6 +35,9 @@ const T_25 = 1 + 2 * 3;
// Test for memory leaks
const T_26 = "1" + 2 + "3";
// Allow T_POW
const T_27 = 2 ** 3;
var_dump(T_1);
var_dump(T_2);
var_dump(T_3);
@@ -61,6 +64,7 @@ var_dump(T_23);
var_dump(T_24);
var_dump(T_25);
var_dump(T_26);
var_dump(T_27);
?>
--EXPECT--
int(2)
@@ -89,3 +93,4 @@ bool(false)
bool(true)
int(7)
int(6)
int(8)
+19
View File
@@ -0,0 +1,19 @@
--TEST--
Testing __debugInfo() magic method with bad returns ZERO (float)
--FILE--
<?php
class C {
public $val;
public function __debugInfo() {
return $this->val;
}
public function __construct($val) {
$this->val = $val;
}
}
$c = new C(0.0);
var_dump($c);
--EXPECTF--
Fatal error: __debuginfo() must return an array in %s%eZend%etests%edebug_info-error-0.0.php on line %d
+19
View File
@@ -0,0 +1,19 @@
--TEST--
Testing __debugInfo() magic method with bad returns ZERO
--FILE--
<?php
class C {
public $val;
public function __debugInfo() {
return $this->val;
}
public function __construct($val) {
$this->val = $val;
}
}
$c = new C(0);
var_dump($c);
--EXPECTF--
Fatal error: __debuginfo() must return an array in %s%eZend%etests%edebug_info-error-0.php on line %d
+19
View File
@@ -0,0 +1,19 @@
--TEST--
Testing __debugInfo() magic method with bad returns ONE (float)
--FILE--
<?php
class C {
public $val;
public function __debugInfo() {
return $this->val;
}
public function __construct($val) {
$this->val = $val;
}
}
$c = new C(1.0);
var_dump($c);
--EXPECTF--
Fatal error: __debuginfo() must return an array in %s%eZend%etests%edebug_info-error-1.0.php on line %d
+19
View File
@@ -0,0 +1,19 @@
--TEST--
Testing __debugInfo() magic method with bad returns ONE
--FILE--
<?php
class C {
public $val;
public function __debugInfo() {
return $this->val;
}
public function __construct($val) {
$this->val = $val;
}
}
$c = new C(1);
var_dump($c);
--EXPECTF--
Fatal error: __debuginfo() must return an array in %s%eZend%etests%edebug_info-error-1.php on line %d
@@ -0,0 +1,19 @@
--TEST--
Testing __debugInfo() magic method with bad returns EMPTY STRING
--FILE--
<?php
class C {
public $val;
public function __debugInfo() {
return $this->val;
}
public function __construct($val) {
$this->val = $val;
}
}
$c = new C("");
var_dump($c);
--EXPECTF--
Fatal error: __debuginfo() must return an array in %s%eZend%etests%edebug_info-error-empty_str.php on line %d
+19
View File
@@ -0,0 +1,19 @@
--TEST--
Testing __debugInfo() magic method with bad returns FALSE
--FILE--
<?php
class C {
public $val;
public function __debugInfo() {
return $this->val;
}
public function __construct($val) {
$this->val = $val;
}
}
$c = new C(false);
var_dump($c);
--EXPECTF--
Fatal error: __debuginfo() must return an array in %s%eZend%etests%edebug_info-error-false.php on line %d
+19
View File
@@ -0,0 +1,19 @@
--TEST--
Testing __debugInfo() magic method with bad returns OBJECT
--FILE--
<?php
class C {
public $val;
public function __debugInfo() {
return $this->val;
}
public function __construct($val) {
$this->val = $val;
}
}
$c = new C(new stdClass);
var_dump($c);
--EXPECTF--
Fatal error: __debuginfo() must return an array in %s%eZend%etests%edebug_info-error-object.php on line %d
+19
View File
@@ -0,0 +1,19 @@
--TEST--
Testing __debugInfo() magic method with bad returns RESOURCE
--FILE--
<?php
class C {
public $val;
public function __debugInfo() {
return $this->val;
}
public function __construct($val) {
$this->val = $val;
}
}
$c = new C(fopen("data:text/plain,Foo", 'r'));
var_dump($c);
--EXPECTF--
Fatal error: __debuginfo() must return an array in %s%eZend%etests%edebug_info-error-resource.php on line %d
+19
View File
@@ -0,0 +1,19 @@
--TEST--
Testing __debugInfo() magic method with bad returns STRING
--FILE--
<?php
class C {
public $val;
public function __debugInfo() {
return $this->val;
}
public function __construct($val) {
$this->val = $val;
}
}
$c = new C("foo");
var_dump($c);
--EXPECTF--
Fatal error: __debuginfo() must return an array in %s%eZend%etests%edebug_info-error-str.php on line %d
+19
View File
@@ -0,0 +1,19 @@
--TEST--
Testing __debugInfo() magic method with bad returns TRUE
--FILE--
<?php
class C {
public $val;
public function __debugInfo() {
return $this->val;
}
public function __construct($val) {
$this->val = $val;
}
}
$c = new C(true);
var_dump($c);
--EXPECTF--
Fatal error: __debuginfo() must return an array in %s%eZend%etests%edebug_info-error-true.php on line %d
+39
View File
@@ -0,0 +1,39 @@
--TEST--
Testing __debugInfo() magic method
--FILE--
<?php
class Foo {
public $d = 4;
protected $e = 5;
private $f = 6;
public function __debugInfo() {
return ['a'=>1, "\0*\0b"=>2, "\0Foo\0c"=>3];
}
}
class Bar {
public $val = 123;
public function __debugInfo() {
return null;
}
}
$f = new Foo;
var_dump($f);
$b = new Bar;
var_dump($b);
--EXPECTF--
object(Foo)#%d (3) {
["a"]=>
int(1)
["b":protected]=>
int(2)
["c":"Foo":private]=>
int(3)
}
object(Bar)#%d (0) {
}
+3 -1
View File
@@ -7,7 +7,9 @@ class test {
const TEST = array(1,2,3);
}
var_dump(test::TEST);
echo "Done\n";
?>
--EXPECTF--
Fatal error: Arrays are not allowed in class constants in %s on line %d
Fatal error: Arrays are not allowed in constants at run-time in %s on line %d
@@ -32,12 +32,11 @@ Stack trace:
#0 %s(%d): serialize(Object(Generator))
#1 {main}
exception 'Exception' with message 'Unserialization of 'Generator' is not allowed' in %s:%d
Stack trace:
#0 [internal function]: Generator->__wakeup()
#1 %s(%d): unserialize('O:9:"Generator"...')
#2 {main}
Warning: Erroneous data format for unserializing 'Generator' in %sserialize_unserialize_error.php on line %d
Notice: unserialize(): Error at offset 19 of 20 bytes in %sserialize_unserialize_error.php on line %s
bool(false)
exception 'Exception' with message 'Unserialization of 'Generator' is not allowed' in %s:%d
Stack trace:
#0 %s(%d): unserialize('C:9:"Generator"...')
+4 -1
View File
@@ -3,6 +3,9 @@
--FILE--
<?php
const C = array();
var_dump(C);
?>
--EXPECTF--
Fatal error: Arrays are not allowed as constants in %sns_059.php on line 2
Fatal error: Arrays are not allowed in constants at run-time in %sns_059.php on line 4
+3 -5
View File
@@ -502,6 +502,7 @@ struct _zend_class_entry {
union _zend_function *__call;
union _zend_function *__callstatic;
union _zend_function *__tostring;
union _zend_function *__debugInfo;
union _zend_function *serialize_func;
union _zend_function *unserialize_func;
@@ -588,14 +589,11 @@ typedef int (*zend_write_func_t)(const char *str, uint str_length);
#define IS_STRING 6
#define IS_RESOURCE 7
#define IS_CONSTANT 8
#define IS_CONSTANT_ARRAY 9
#define IS_CONSTANT_AST 10
#define IS_CALLABLE 11
#define IS_CONSTANT_AST 9
#define IS_CALLABLE 10
/* Ugly hack to support constants as static array indices */
#define IS_CONSTANT_TYPE_MASK 0x00f
#define IS_CONSTANT_UNQUALIFIED 0x010
#define IS_CONSTANT_INDEX 0x080
#define IS_LEXICAL_VAR 0x020
#define IS_LEXICAL_REF 0x040
#define IS_CONSTANT_IN_NAMESPACE 0x100
+15 -5
View File
@@ -1070,7 +1070,7 @@ static int zval_update_class_constant(zval **pp, int is_static, int offset TSRML
int ret;
zend_class_entry *old_scope = *scope;
*scope = prop_info->ce;
ret = zval_update_constant(pp, (void*)1 TSRMLS_CC);
ret = zval_update_constant(pp, 1 TSRMLS_CC);
*scope = old_scope;
return ret;
}
@@ -1079,7 +1079,7 @@ static int zval_update_class_constant(zval **pp, int is_static, int offset TSRML
} while (ce);
}
return zval_update_constant(pp, (void*)1 TSRMLS_CC);
return zval_update_constant(pp, 1 TSRMLS_CC);
}
return 0;
}
@@ -1093,7 +1093,7 @@ ZEND_API void zend_update_class_constants(zend_class_entry *class_type TSRMLS_DC
int i;
*scope = class_type;
zend_hash_apply_with_argument(&class_type->constants_table, (apply_func_arg_t) zval_update_constant, (void*)1 TSRMLS_CC);
zend_hash_apply_with_argument(&class_type->constants_table, (apply_func_arg_t) zval_update_constant, (void *)1 TSRMLS_CC);
for (i = 0; i < class_type->default_properties_count; i++) {
if (class_type->default_properties_table[i]) {
@@ -2018,6 +2018,9 @@ ZEND_API void zend_check_magic_method_implementation(const zend_class_entry *ce,
!memcmp(lcname, ZEND_TOSTRING_FUNC_NAME, sizeof(ZEND_TOSTRING_FUNC_NAME)-1) && fptr->common.num_args != 0
) {
zend_error(error_type, "Method %s::%s() cannot take arguments", ce->name, ZEND_TOSTRING_FUNC_NAME);
} else if (name_len == sizeof(ZEND_DEBUGINFO_FUNC_NAME) - 1 &&
!memcmp(lcname, ZEND_DEBUGINFO_FUNC_NAME, sizeof(ZEND_DEBUGINFO_FUNC_NAME)-1) && fptr->common.num_args != 0) {
zend_error(error_type, "Method %s::%s() cannot take arguments", ce->name, ZEND_DEBUGINFO_FUNC_NAME);
}
}
/* }}} */
@@ -2031,7 +2034,7 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio
int count=0, unload=0;
HashTable *target_function_table = function_table;
int error_type;
zend_function *ctor = NULL, *dtor = NULL, *clone = NULL, *__get = NULL, *__set = NULL, *__unset = NULL, *__isset = NULL, *__call = NULL, *__callstatic = NULL, *__tostring = NULL;
zend_function *ctor = NULL, *dtor = NULL, *clone = NULL, *__get = NULL, *__set = NULL, *__unset = NULL, *__isset = NULL, *__call = NULL, *__callstatic = NULL, *__tostring = NULL, *__debugInfo = NULL;
const char *lowercase_name;
int fname_len;
const char *lc_class_name = NULL;
@@ -2180,6 +2183,8 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio
__unset = reg_function;
} else if ((fname_len == sizeof(ZEND_ISSET_FUNC_NAME)-1) && !memcmp(lowercase_name, ZEND_ISSET_FUNC_NAME, sizeof(ZEND_ISSET_FUNC_NAME) - 1)) {
__isset = reg_function;
} else if ((fname_len == sizeof(ZEND_DEBUGINFO_FUNC_NAME)-1) && !memcmp(lowercase_name, ZEND_DEBUGINFO_FUNC_NAME, sizeof(ZEND_DEBUGINFO_FUNC_NAME) - 1)) {
__debugInfo = reg_function;
} else {
reg_function = NULL;
}
@@ -2218,6 +2223,7 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio
scope->__set = __set;
scope->__unset = __unset;
scope->__isset = __isset;
scope->__debugInfo = __debugInfo;
if (ctor) {
ctor->common.fn_flags |= ZEND_ACC_CTOR;
if (ctor->common.fn_flags & ZEND_ACC_STATIC) {
@@ -2281,6 +2287,11 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio
}
__isset->common.fn_flags &= ~ZEND_ACC_ALLOW_STATIC;
}
if (__debugInfo) {
if (__debugInfo->common.fn_flags & ZEND_ACC_STATIC) {
zend_error(error_type, "Method %s::%s() cannot be static", scope->name, __debugInfo->common.function_name);
}
}
efree((char*)lc_class_name);
}
return SUCCESS;
@@ -3452,7 +3463,6 @@ ZEND_API int zend_declare_property_ex(zend_class_entry *ce, const char *name, in
if (ce->type & ZEND_INTERNAL_CLASS) {
switch(Z_TYPE_P(property)) {
case IS_ARRAY:
case IS_CONSTANT_ARRAY:
case IS_OBJECT:
case IS_RESOURCE:
zend_error(E_CORE_ERROR, "Internal zval's can't be arrays, objects or resources");
+1
View File
@@ -197,6 +197,7 @@ typedef struct _zend_fcall_info_cache {
class_container.__set = handle_propset; \
class_container.__unset = handle_propunset; \
class_container.__isset = handle_propisset; \
class_container.__debugInfo = NULL; \
class_container.serialize_func = NULL; \
class_container.unserialize_func = NULL; \
class_container.serialize = NULL; \
+67 -19
View File
@@ -63,6 +63,27 @@ ZEND_API zend_ast* zend_ast_create_ternary(uint kind, zend_ast *op0, zend_ast *o
return ast;
}
ZEND_API zend_ast* zend_ast_create_dynamic(uint kind)
{
zend_ast *ast = emalloc(sizeof(zend_ast) + sizeof(zend_ast*) * 3); /* use 4 children as deafult */
ast->kind = kind;
ast->children = 0;
return ast;
}
ZEND_API void zend_ast_dynamic_add(zend_ast **ast, zend_ast *op)
{
if ((*ast)->children >= 4 && (*ast)->children == ((*ast)->children & -(*ast)->children)) {
*ast = erealloc(*ast, sizeof(zend_ast) + sizeof(zend_ast*) * ((*ast)->children * 2 + 1));
}
(&(*ast)->u.child)[(*ast)->children++] = op;
}
ZEND_API void zend_ast_dynamic_shrink(zend_ast **ast)
{
*ast = erealloc(*ast, sizeof(zend_ast) + sizeof(zend_ast*) * ((*ast)->children - 1));
}
ZEND_API int zend_ast_is_ct_constant(zend_ast *ast)
{
int i;
@@ -107,6 +128,13 @@ ZEND_API void zend_ast_evaluate(zval *result, zend_ast *ast, zend_class_entry *s
zval_dtor(&op1);
zval_dtor(&op2);
break;
case ZEND_POW:
zend_ast_evaluate(&op1, (&ast->u.child)[0], scope TSRMLS_CC);
zend_ast_evaluate(&op2, (&ast->u.child)[1], scope TSRMLS_CC);
pow_function(result, &op1, &op2 TSRMLS_CC);
zval_dtor(&op1);
zval_dtor(&op2);
break;
case ZEND_DIV:
zend_ast_evaluate(&op1, (&ast->u.child)[0], scope TSRMLS_CC);
zend_ast_evaluate(&op2, (&ast->u.child)[1], scope TSRMLS_CC);
@@ -226,7 +254,7 @@ ZEND_API void zend_ast_evaluate(zval *result, zend_ast *ast, zend_class_entry *s
*result = *ast->u.val;
zval_copy_ctor(result);
if (IS_CONSTANT_TYPE(Z_TYPE_P(result))) {
zval_update_constant_ex(&result, (void *) 1, scope TSRMLS_CC);
zval_update_constant_ex(&result, 1, scope TSRMLS_CC);
}
break;
case ZEND_BOOL_AND:
@@ -277,6 +305,35 @@ ZEND_API void zend_ast_evaluate(zval *result, zend_ast *ast, zend_class_entry *s
sub_function(result, &op1, &op2 TSRMLS_CC);
zval_dtor(&op2);
break;
case ZEND_INIT_ARRAY:
INIT_PZVAL(result);
array_init(result);
{
int i;
zend_bool has_key;
for (i = 0; i < ast->children; i+=2) {
zval *expr;
MAKE_STD_ZVAL(expr);
if ((has_key = !!(&ast->u.child)[i])) {
zend_ast_evaluate(&op1, (&ast->u.child)[i], scope TSRMLS_CC);
}
zend_ast_evaluate(expr, (&ast->u.child)[i+1], scope TSRMLS_CC);
zend_do_add_static_array_element(result, has_key?&op1:NULL, expr);
}
}
break;
case ZEND_FETCH_DIM_R:
zend_ast_evaluate(&op1, (&ast->u.child)[0], scope TSRMLS_CC);
zend_ast_evaluate(&op2, (&ast->u.child)[1], scope TSRMLS_CC);
{
zval *tmp;
zend_fetch_dimension_by_zval(&tmp, &op1, &op2 TSRMLS_CC);
*result = *tmp;
efree(tmp);
}
zval_dtor(&op1);
zval_dtor(&op2);
break;
default:
zend_error(E_ERROR, "Unsupported constant expression");
}
@@ -290,26 +347,17 @@ ZEND_API zend_ast *zend_ast_copy(zend_ast *ast)
zend_ast *copy = zend_ast_create_constant(ast->u.val);
zval_copy_ctor(copy->u.val);
return copy;
} else {
switch (ast->children) {
case 1:
return zend_ast_create_unary(
ast->kind,
zend_ast_copy((&ast->u.child)[0]));
case 2:
return zend_ast_create_binary(
ast->kind,
zend_ast_copy((&ast->u.child)[0]),
zend_ast_copy((&ast->u.child)[1]));
case 3:
return zend_ast_create_ternary(
ast->kind,
zend_ast_copy((&ast->u.child)[0]),
zend_ast_copy((&ast->u.child)[1]),
zend_ast_copy((&ast->u.child)[2]));
} else if (ast->children) {
zend_ast *new = emalloc(sizeof(zend_ast) + sizeof(zend_ast*) * (ast->children - 1));
int i;
new->kind = ast->kind;
new->children = ast->children;
for (i = 0; i < ast->children; i++) {
(&new->u.child)[i] = zend_ast_copy((&ast->u.child)[i]);
}
return new;
}
return NULL;
return zend_ast_create_dynamic(ast->kind);
}
ZEND_API void zend_ast_destroy(zend_ast *ast)
+3
View File
@@ -50,6 +50,9 @@ ZEND_API zend_ast *zend_ast_create_constant(zval *zv);
ZEND_API zend_ast *zend_ast_create_unary(uint kind, zend_ast *op0);
ZEND_API zend_ast *zend_ast_create_binary(uint kind, zend_ast *op0, zend_ast *op1);
ZEND_API zend_ast *zend_ast_create_ternary(uint kind, zend_ast *op0, zend_ast *op1, zend_ast *op2);
ZEND_API zend_ast* zend_ast_create_dynamic(uint kind);
ZEND_API void zend_ast_dynamic_add(zend_ast **ast, zend_ast *op);
ZEND_API void zend_ast_dynamic_shrink(zend_ast **ast);
ZEND_API int zend_ast_is_ct_constant(zend_ast *ast);
+74 -83
View File
@@ -102,6 +102,13 @@ ZEND_API zend_compiler_globals compiler_globals;
ZEND_API zend_executor_globals executor_globals;
#endif
static void zend_push_function_call_entry(zend_function *fbc TSRMLS_DC) /* {{{ */
{
zend_function_call_entry fcall = { fbc };
zend_stack_push(&CG(function_call_stack), &fcall, sizeof(zend_function_call_entry));
}
/* }}} */
static void zend_duplicate_property_info(zend_property_info *property_info) /* {{{ */
{
property_info->name = str_estrndup(property_info->name, property_info->name_length);
@@ -1622,6 +1629,11 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n
if (fn_flags & ((ZEND_ACC_PPP_MASK | ZEND_ACC_STATIC) ^ ZEND_ACC_PUBLIC)) {
zend_error(E_WARNING, "The magic method __invoke() must have public visibility and cannot be static");
}
} else if ((name_len == sizeof(ZEND_DEBUGINFO_FUNC_NAME)-1) && (!memcmp(lcname, ZEND_DEBUGINFO_FUNC_NAME, sizeof(ZEND_DEBUGINFO_FUNC_NAME)-1))) {
if (fn_flags & ((ZEND_ACC_PPP_MASK | ZEND_ACC_STATIC) ^ ZEND_ACC_PUBLIC)) {
zend_error(E_WARNING, "The magic method __debugInfo() must have public visibility and cannot be static");
}
}
} else {
char *class_lcname;
@@ -1682,6 +1694,11 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n
if (fn_flags & ((ZEND_ACC_PPP_MASK | ZEND_ACC_STATIC) ^ ZEND_ACC_PUBLIC)) {
zend_error(E_WARNING, "The magic method __invoke() must have public visibility and cannot be static");
}
} else if ((name_len == sizeof(ZEND_DEBUGINFO_FUNC_NAME)-1) && (!memcmp(lcname, ZEND_DEBUGINFO_FUNC_NAME, sizeof(ZEND_DEBUGINFO_FUNC_NAME)-1))) {
if (fn_flags & ((ZEND_ACC_PPP_MASK | ZEND_ACC_STATIC) ^ ZEND_ACC_PUBLIC)) {
zend_error(E_WARNING, "The magic method __debugInfo() must have public visibility and cannot be static");
}
CG(active_class_entry)->__debugInfo = (zend_function *) CG(active_op_array);
} else if (!(fn_flags & ZEND_ACC_STATIC)) {
CG(active_op_array)->fn_flags |= ZEND_ACC_ALLOW_STATIC;
}
@@ -1916,7 +1933,7 @@ void zend_do_receive_param(zend_uchar op, znode *varname, const znode *initializ
if (op == ZEND_RECV_INIT) {
if (Z_TYPE(initialization->u.constant) == IS_NULL || (Z_TYPE(initialization->u.constant) == IS_CONSTANT && !strcasecmp(Z_STRVAL(initialization->u.constant), "NULL")) || Z_TYPE(initialization->u.constant) == IS_CONSTANT_AST) {
cur_arg_info->allow_null = 1;
} else if (Z_TYPE(initialization->u.constant) != IS_ARRAY && Z_TYPE(initialization->u.constant) != IS_CONSTANT_ARRAY) {
} else if (Z_TYPE(initialization->u.constant) != IS_ARRAY) {
zend_error_noreturn(E_COMPILE_ERROR, "Default value for parameters with array type hint can only be an array or NULL");
}
}
@@ -1979,7 +1996,7 @@ int zend_do_begin_function_call(znode *function_name, zend_bool check_namespace
efree(Z_STRVAL(function_name->u.constant));
Z_STRVAL(function_name->u.constant) = lcname;
zend_stack_push(&CG(function_call_stack), (void *) &function, sizeof(zend_function *));
zend_push_function_call_entry(function TSRMLS_CC);
if (CG(context).nested_calls + 1 > CG(active_op_array)->nested_calls) {
CG(active_op_array)->nested_calls = CG(context).nested_calls + 1;
}
@@ -1992,7 +2009,6 @@ void zend_do_begin_method_call(znode *left_bracket TSRMLS_DC) /* {{{ */
{
zend_op *last_op;
int last_op_number;
unsigned char *ptr = NULL;
zend_do_end_variable_parse(left_bracket, BP_VAR_R, 0 TSRMLS_CC);
zend_do_begin_variable_parse(TSRMLS_C);
@@ -2036,7 +2052,7 @@ void zend_do_begin_method_call(znode *left_bracket TSRMLS_DC) /* {{{ */
}
}
zend_stack_push(&CG(function_call_stack), (void *) &ptr, sizeof(zend_function *));
zend_push_function_call_entry(NULL TSRMLS_CC);
if (++CG(context).nested_calls > CG(active_op_array)->nested_calls) {
CG(active_op_array)->nested_calls = CG(context).nested_calls;
}
@@ -2059,7 +2075,6 @@ void zend_do_clone(znode *result, const znode *expr TSRMLS_DC) /* {{{ */
void zend_do_begin_dynamic_function_call(znode *function_name, int ns_call TSRMLS_DC) /* {{{ */
{
unsigned char *ptr = NULL;
zend_op *opline;
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
@@ -2085,7 +2100,7 @@ void zend_do_begin_dynamic_function_call(znode *function_name, int ns_call TSRML
}
}
zend_stack_push(&CG(function_call_stack), (void *) &ptr, sizeof(zend_function *));
zend_push_function_call_entry(NULL TSRMLS_CC);
if (++CG(context).nested_calls > CG(active_op_array)->nested_calls) {
CG(active_op_array)->nested_calls = CG(context).nested_calls;
}
@@ -2480,7 +2495,6 @@ void zend_do_build_full_name(znode *result, znode *prefix, znode *name, int is_c
int zend_do_begin_class_member_function_call(znode *class_name, znode *method_name TSRMLS_DC) /* {{{ */
{
znode class_node;
unsigned char *ptr = NULL;
zend_op *opline;
if (method_name->op_type == IS_CONST) {
@@ -2529,7 +2543,7 @@ int zend_do_begin_class_member_function_call(znode *class_name, znode *method_na
SET_NODE(opline->op2, method_name);
}
zend_stack_push(&CG(function_call_stack), (void *) &ptr, sizeof(zend_function *));
zend_push_function_call_entry(NULL TSRMLS_CC);
if (++CG(context).nested_calls > CG(active_op_array)->nested_calls) {
CG(active_op_array)->nested_calls = CG(context).nested_calls;
}
@@ -2538,22 +2552,21 @@ int zend_do_begin_class_member_function_call(znode *class_name, znode *method_na
}
/* }}} */
void zend_do_end_function_call(znode *function_name, znode *result, const znode *argument_list, int is_method, int is_dynamic_fcall TSRMLS_DC) /* {{{ */
void zend_do_end_function_call(znode *function_name, znode *result, int is_method, int is_dynamic_fcall TSRMLS_DC) /* {{{ */
{
zend_op *opline;
zend_function_call_entry *fcall;
zend_stack_top(&CG(function_call_stack), (void **) &fcall);
if (is_method && function_name && function_name->op_type == IS_UNUSED) {
/* clone */
if (Z_LVAL(argument_list->u.constant) != 0) {
if (fcall->arg_num != 0) {
zend_error(E_WARNING, "Clone method does not require arguments");
}
opline = &CG(active_op_array)->opcodes[Z_LVAL(function_name->u.constant)];
} else {
zend_function **function_ptr_ptr;
zend_stack_top(&CG(function_call_stack), (void **) &function_ptr_ptr);
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
if (*function_ptr_ptr) {
if (fcall->fbc) {
opline->opcode = ZEND_DO_FCALL;
SET_NODE(opline->op1, function_name);
SET_UNUSED(opline->op2);
@@ -2578,33 +2591,39 @@ void zend_do_end_function_call(znode *function_name, znode *result, const znode
opline->result.var = get_temporary_variable(CG(active_op_array));
opline->result_type = IS_VAR;
GET_NODE(result, opline->result);
zend_stack_del_top(&CG(function_call_stack));
opline->extended_value = Z_LVAL(argument_list->u.constant);
opline->extended_value = fcall->arg_num;
if (CG(context).used_stack + 1 > CG(active_op_array)->used_stack) {
CG(active_op_array)->used_stack = CG(context).used_stack + 1;
}
CG(context).used_stack -= Z_LVAL(argument_list->u.constant);
CG(context).used_stack -= fcall->arg_num;
zend_stack_del_top(&CG(function_call_stack));
}
/* }}} */
void zend_do_pass_param(znode *param, zend_uchar op, int offset TSRMLS_DC) /* {{{ */
void zend_do_pass_param(znode *param, zend_uchar op TSRMLS_DC) /* {{{ */
{
zend_op *opline;
int original_op = op;
zend_function **function_ptr_ptr, *function_ptr;
zend_function_call_entry *fcall;
zend_function *function_ptr;
int send_by_reference = 0;
int send_function = 0;
zend_stack_top(&CG(function_call_stack), (void **) &function_ptr_ptr);
function_ptr = *function_ptr_ptr;
zend_stack_top(&CG(function_call_stack), (void **) &fcall);
function_ptr = fcall->fbc;
fcall->arg_num++;
if (fcall->uses_argument_unpacking) {
zend_error_noreturn(E_COMPILE_ERROR,
"Cannot use positional argument after argument unpacking");
}
if (original_op == ZEND_SEND_REF) {
if (function_ptr &&
function_ptr->common.function_name &&
function_ptr->common.type == ZEND_USER_FUNCTION &&
!ARG_SHOULD_BE_SENT_BY_REF(function_ptr, (zend_uint) offset)) {
!ARG_SHOULD_BE_SENT_BY_REF(function_ptr, fcall->arg_num)) {
zend_error_noreturn(E_COMPILE_ERROR,
"Call-time pass-by-reference has been removed; "
"If you would like to pass argument by reference, modify the declaration of %s().",
@@ -2616,7 +2635,7 @@ void zend_do_pass_param(znode *param, zend_uchar op, int offset TSRMLS_DC) /* {{
}
if (function_ptr) {
if (ARG_MAY_BE_SENT_BY_REF(function_ptr, (zend_uint) offset)) {
if (ARG_MAY_BE_SENT_BY_REF(function_ptr, fcall->arg_num)) {
if (op == ZEND_SEND_VAR && param->op_type & (IS_VAR|IS_CV)) {
send_by_reference = ZEND_ARG_SEND_BY_REF;
if (zend_is_function_or_method_call(param)) {
@@ -2627,7 +2646,7 @@ void zend_do_pass_param(znode *param, zend_uchar op, int offset TSRMLS_DC) /* {{
} else {
op = ZEND_SEND_VAL;
}
} else if (ARG_SHOULD_BE_SENT_BY_REF(function_ptr, (zend_uint) offset)) {
} else if (ARG_SHOULD_BE_SENT_BY_REF(function_ptr, fcall->arg_num)) {
send_by_reference = ZEND_ARG_SEND_BY_REF;
}
}
@@ -2662,7 +2681,7 @@ void zend_do_pass_param(znode *param, zend_uchar op, int offset TSRMLS_DC) /* {{
if (function_ptr) {
zend_do_end_variable_parse(param, BP_VAR_R, 0 TSRMLS_CC);
} else {
zend_do_end_variable_parse(param, BP_VAR_FUNC_ARG, offset TSRMLS_CC);
zend_do_end_variable_parse(param, BP_VAR_FUNC_ARG, fcall->arg_num TSRMLS_CC);
}
break;
case ZEND_SEND_REF:
@@ -2688,7 +2707,7 @@ void zend_do_pass_param(znode *param, zend_uchar op, int offset TSRMLS_DC) /* {{
}
opline->opcode = op;
SET_NODE(opline->op1, param);
opline->op2.opline_num = offset;
opline->op2.opline_num = fcall->arg_num;
SET_UNUSED(opline->op2);
if (++CG(context).used_stack > CG(active_op_array)->used_stack) {
@@ -2697,18 +2716,20 @@ void zend_do_pass_param(znode *param, zend_uchar op, int offset TSRMLS_DC) /* {{
}
/* }}} */
void zend_do_unpack_params(znode *params, int offset TSRMLS_DC) /* {{{ */
void zend_do_unpack_params(znode *params TSRMLS_DC) /* {{{ */
{
zend_op *opline;
zend_function **function_ptr_ptr;
zend_function_call_entry *fcall;
zend_stack_top(&CG(function_call_stack), (void **) &function_ptr_ptr);
if (*function_ptr_ptr) {
zend_stack_top(&CG(function_call_stack), (void **) &fcall);
fcall->uses_argument_unpacking = 1;
if (fcall->fbc) {
/* If argument unpacking is used argument numbers and sending modes can no longer be
* computed at compile time, thus we need access to EX(call). In order to have it we
* retroactively emit a ZEND_INIT_FCALL_BY_NAME opcode. */
zval func_name;
ZVAL_STRING(&func_name, (*function_ptr_ptr)->common.function_name, 1);
ZVAL_STRING(&func_name, fcall->fbc->common.function_name, 1);
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_INIT_FCALL_BY_NAME;
@@ -2719,14 +2740,14 @@ void zend_do_unpack_params(znode *params, int offset TSRMLS_DC) /* {{{ */
GET_CACHE_SLOT(opline->op2.constant);
++CG(context).nested_calls;
*function_ptr_ptr = NULL;
fcall->fbc = NULL;
}
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_SEND_UNPACK;
SET_NODE(opline->op1, params);
SET_UNUSED(opline->op2);
opline->op2.num = (zend_uint) offset;
opline->op2.num = fcall->arg_num;
}
/* }}} */
@@ -3123,6 +3144,9 @@ static void do_inherit_parent_constructor(zend_class_entry *ce) /* {{{ */
if (!ce->destructor) {
ce->destructor = ce->parent->destructor;
}
if (!ce->__debugInfo) {
ce->__debugInfo = ce->parent->__debugInfo;
}
if (ce->constructor) {
if (ce->parent->constructor && ce->parent->constructor->common.fn_flags & ZEND_ACC_FINAL) {
zend_error(E_ERROR, "Cannot override final %s::%s() with %s::%s()",
@@ -3437,7 +3461,7 @@ static char * zend_get_function_declaration(zend_function *fptr TSRMLS_DC) /* {{
*zv = *precv->op2.zv;
zval_copy_ctor(zv);
INIT_PZVAL(zv);
zval_update_constant_ex(&zv, (void*)1, fptr->common.scope TSRMLS_CC);
zval_update_constant_ex(&zv, 1, fptr->common.scope TSRMLS_CC);
if (Z_TYPE_P(zv) == IS_BOOL) {
if (Z_LVAL_P(zv)) {
memcpy(offset, "true", 4);
@@ -3954,6 +3978,8 @@ static void zend_add_magic_methods(zend_class_entry* ce, const char* mname, uint
ce->__callstatic = fe;
} else if (!strncmp(mname, ZEND_TOSTRING_FUNC_NAME, mname_len)) {
ce->__tostring = fe;
} else if (!strncmp(mname, ZEND_DEBUGINFO_FUNC_NAME, mname_len)) {
ce->__debugInfo = fe;
} else if (ce->name_length + 1 == mname_len) {
char *lowercase_name = emalloc(ce->name_length + 1);
zend_str_tolower_copy(lowercase_name, ce->name, ce->name_length);
@@ -5416,10 +5442,6 @@ void zend_do_declare_class_constant(znode *var_name, const znode *value TSRMLS_D
const char *cname = NULL;
zend_ulong hash;
if(Z_TYPE(value->u.constant) == IS_CONSTANT_ARRAY) {
zend_error_noreturn(E_COMPILE_ERROR, "Arrays are not allowed in class constants");
return;
}
if ((CG(active_class_entry)->ce_flags & ZEND_ACC_TRAIT) == ZEND_ACC_TRAIT) {
zend_error_noreturn(E_COMPILE_ERROR, "Traits cannot have constants");
return;
@@ -5562,7 +5584,6 @@ void zend_do_pop_object(znode *object TSRMLS_DC) /* {{{ */
void zend_do_begin_new_object(znode *new_token, znode *class_type TSRMLS_DC) /* {{{ */
{
zend_op *opline;
unsigned char *ptr = NULL;
new_token->u.op.opline_num = get_next_op_number(CG(active_op_array));
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
@@ -5573,18 +5594,18 @@ void zend_do_begin_new_object(znode *new_token, znode *class_type TSRMLS_DC) /*
SET_NODE(opline->op1, class_type);
SET_UNUSED(opline->op2);
zend_stack_push(&CG(function_call_stack), (void *) &ptr, sizeof(unsigned char *));
zend_push_function_call_entry(NULL TSRMLS_CC);
if (++CG(context).nested_calls > CG(active_op_array)->nested_calls) {
CG(active_op_array)->nested_calls = CG(context).nested_calls;
}
}
/* }}} */
void zend_do_end_new_object(znode *result, const znode *new_token, const znode *argument_list TSRMLS_DC) /* {{{ */
void zend_do_end_new_object(znode *result, const znode *new_token TSRMLS_DC) /* {{{ */
{
znode ctor_result;
zend_do_end_function_call(NULL, &ctor_result, argument_list, 1, 0 TSRMLS_CC);
zend_do_end_function_call(NULL, &ctor_result, 1, 0 TSRMLS_CC);
zend_do_free(&ctor_result TSRMLS_CC);
CG(active_op_array)->opcodes[new_token->u.op.opline_num].op2.opline_num = get_next_op_number(CG(active_op_array));
@@ -5862,57 +5883,30 @@ void zend_do_add_array_element(znode *result, const znode *expr, const znode *of
}
/* }}} */
void zend_do_add_static_array_element(znode *result, znode *offset, const znode *expr) /* {{{ */
void zend_do_add_static_array_element(zval *result, zval *offset, const zval *expr) /* {{{ */
{
zval *element;
ALLOC_ZVAL(element);
*element = expr->u.constant;
if (offset) {
switch (Z_TYPE(offset->u.constant) & IS_CONSTANT_TYPE_MASK) {
case IS_CONSTANT:
/* Ugly hack to denote that this value has a constant index */
Z_TYPE_P(element) |= IS_CONSTANT_INDEX;
Z_STRVAL(offset->u.constant) = erealloc(Z_STRVAL(offset->u.constant), Z_STRLEN(offset->u.constant)+3);
Z_STRVAL(offset->u.constant)[Z_STRLEN(offset->u.constant)+1] = Z_TYPE(offset->u.constant);
Z_STRVAL(offset->u.constant)[Z_STRLEN(offset->u.constant)+2] = 0;
zend_symtable_update(Z_ARRVAL(result->u.constant), Z_STRVAL(offset->u.constant), Z_STRLEN(offset->u.constant)+3, &element, sizeof(zval *), NULL);
zval_dtor(&offset->u.constant);
break;
case IS_CONSTANT_AST: {
/* Another ugly hack to store the data about the AST in the array */
char* key;
int len = sizeof(zend_ast *);
Z_TYPE_P(element) |= IS_CONSTANT_INDEX;
key = emalloc(len + 2);
*(zend_ast **)key = Z_AST(offset->u.constant);
key[len] = Z_TYPE(offset->u.constant);
key[len + 1] = 0;
zend_symtable_update(Z_ARRVAL(result->u.constant), key, len + 2, &element, sizeof(zval *), NULL);
efree(key);
break;
}
switch (Z_TYPE_P(offset)) {
case IS_STRING:
zend_symtable_update(Z_ARRVAL(result->u.constant), Z_STRVAL(offset->u.constant), Z_STRLEN(offset->u.constant)+1, &element, sizeof(zval *), NULL);
zval_dtor(&offset->u.constant);
zend_symtable_update(Z_ARRVAL_P(result), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, &expr, sizeof(zval *), NULL);
zval_dtor(offset);
break;
case IS_NULL:
zend_symtable_update(Z_ARRVAL(result->u.constant), "", 1, &element, sizeof(zval *), NULL);
zend_symtable_update(Z_ARRVAL_P(result), "", 1, &expr, sizeof(zval *), NULL);
break;
case IS_LONG:
case IS_BOOL:
zend_hash_index_update(Z_ARRVAL(result->u.constant), Z_LVAL(offset->u.constant), &element, sizeof(zval *), NULL);
zend_hash_index_update(Z_ARRVAL_P(result), Z_LVAL_P(offset), &expr, sizeof(zval *), NULL);
break;
case IS_DOUBLE:
zend_hash_index_update(Z_ARRVAL(result->u.constant), zend_dval_to_lval(Z_DVAL(offset->u.constant)), &element, sizeof(zval *), NULL);
zend_hash_index_update(Z_ARRVAL_P(result), zend_dval_to_lval(Z_DVAL_P(offset)), &expr, sizeof(zval *), NULL);
break;
case IS_CONSTANT_ARRAY:
case IS_ARRAY:
zend_error(E_ERROR, "Illegal offset type");
break;
}
} else {
zend_hash_next_index_insert(Z_ARRVAL(result->u.constant), &element, sizeof(zval *), NULL);
zend_hash_next_index_insert(Z_ARRVAL_P(result), &expr, sizeof(zval *), NULL);
}
}
/* }}} */
@@ -6946,6 +6940,7 @@ ZEND_API void zend_initialize_class_data(zend_class_entry *ce, zend_bool nullify
ce->unserialize = NULL;
ce->serialize_func = NULL;
ce->unserialize_func = NULL;
ce->__debugInfo = NULL;
if (ce->type == ZEND_INTERNAL_CLASS) {
ce->info.internal.module = NULL;
ce->info.internal.builtin_functions = NULL;
@@ -7292,10 +7287,6 @@ void zend_do_declare_constant(znode *name, znode *value TSRMLS_DC) /* {{{ */
zend_op *opline;
zval **ns_name;
if(Z_TYPE(value->u.constant) == IS_CONSTANT_ARRAY) {
zend_error_noreturn(E_COMPILE_ERROR, "Arrays are not allowed as constants");
}
if (zend_get_ct_const(&name->u.constant, 0 TSRMLS_CC)) {
zend_error_noreturn(E_COMPILE_ERROR, "Cannot redeclare constant '%s'", Z_STRVAL(name->u.constant));
}
+11 -5
View File
@@ -363,6 +363,11 @@ typedef struct _zend_function_state {
void **arguments;
} zend_function_state;
typedef struct _zend_function_call_entry {
zend_function *fbc;
zend_uint arg_num;
zend_bool uses_argument_unpacking;
} zend_function_call_entry;
typedef struct _zend_switch_entry {
znode cond;
@@ -518,7 +523,7 @@ void zend_do_begin_dynamic_function_call(znode *function_name, int prefix_len TS
void zend_do_fetch_class(znode *result, znode *class_name TSRMLS_DC);
void zend_do_build_full_name(znode *result, znode *prefix, znode *name, int is_class_member TSRMLS_DC);
int zend_do_begin_class_member_function_call(znode *class_name, znode *method_name TSRMLS_DC);
void zend_do_end_function_call(znode *function_name, znode *result, const znode *argument_list, int is_method, int is_dynamic_fcall TSRMLS_DC);
void zend_do_end_function_call(znode *function_name, znode *result, int is_method, int is_dynamic_fcall TSRMLS_DC);
void zend_do_return(znode *expr, int do_end_vparse TSRMLS_DC);
void zend_do_yield(znode *result, znode *value, const znode *key, zend_bool is_variable TSRMLS_DC);
void zend_do_handle_exception(TSRMLS_D);
@@ -554,8 +559,8 @@ ZEND_API void zend_do_inheritance(zend_class_entry *ce, zend_class_entry *parent
void zend_do_early_binding(TSRMLS_D);
ZEND_API void zend_do_delayed_early_binding(const zend_op_array *op_array TSRMLS_DC);
void zend_do_pass_param(znode *param, zend_uchar op, int offset TSRMLS_DC);
void zend_do_unpack_params(znode *params, int offset TSRMLS_DC);
void zend_do_pass_param(znode *param, zend_uchar op TSRMLS_DC);
void zend_do_unpack_params(znode *params TSRMLS_DC);
void zend_do_boolean_or_begin(znode *expr1, znode *op_token TSRMLS_DC);
@@ -585,7 +590,7 @@ void zend_do_pop_object(znode *object TSRMLS_DC);
void zend_do_begin_new_object(znode *new_token, znode *class_type TSRMLS_DC);
void zend_do_end_new_object(znode *result, const znode *new_token, const znode *argument_list TSRMLS_DC);
void zend_do_end_new_object(znode *result, const znode *new_token TSRMLS_DC);
void zend_do_fetch_constant(znode *result, znode *constant_container, znode *constant_name, int mode, zend_bool check_namespace TSRMLS_DC);
@@ -593,7 +598,7 @@ void zend_do_shell_exec(znode *result, const znode *cmd TSRMLS_DC);
void zend_do_init_array(znode *result, const znode *expr, const znode *offset, zend_bool is_ref TSRMLS_DC);
void zend_do_add_array_element(znode *result, const znode *expr, const znode *offset, zend_bool is_ref TSRMLS_DC);
void zend_do_add_static_array_element(znode *result, znode *offset, const znode *expr);
void zend_do_add_static_array_element(zval *result, zval *offset, const zval *expr);
void zend_do_list_init(TSRMLS_D);
void zend_do_list_end(znode *result, znode *expr TSRMLS_DC);
void zend_do_add_list_element(const znode *element TSRMLS_DC);
@@ -873,6 +878,7 @@ END_EXTERN_C()
#define ZEND_TOSTRING_FUNC_NAME "__tostring"
#define ZEND_AUTOLOAD_FUNC_NAME "__autoload"
#define ZEND_INVOKE_FUNC_NAME "__invoke"
#define ZEND_DEBUGINFO_FUNC_NAME "__debuginfo"
/* The following constants may be combined in CG(compiler_options)
* to change the default compiler behavior */
+2 -2
View File
@@ -408,7 +408,7 @@ ZEND_API int zend_get_constant_ex(const char *name, uint name_len, zval *result,
efree(lcname);
if(found_const) {
*result = c->value;
zval_update_constant_ex(&result, (void*)1, NULL TSRMLS_CC);
zval_update_constant_ex(&result, 1, NULL TSRMLS_CC);
zval_copy_ctor(result);
Z_SET_REFCOUNT_P(result, 1);
Z_UNSET_ISREF_P(result);
@@ -423,7 +423,7 @@ ZEND_API int zend_get_constant_ex(const char *name, uint name_len, zval *result,
retval = 0;
finish:
if (retval) {
zval_update_constant_ex(ret_constant, (void*)1, ce TSRMLS_CC);
zval_update_constant_ex(ret_constant, 1, ce TSRMLS_CC);
*result = **ret_constant;
zval_copy_ctor(result);
INIT_PZVAL(result);
+58 -3
View File
@@ -360,6 +360,11 @@ ZEND_METHOD(error_exception, getSeverity)
} \
}
#define TRACE_ARG_APPEND(vallen) \
*str = (char*)erealloc(*str, *len + 1 + vallen); \
memmove((*str) + *len - l_added + 1 + vallen, (*str) + *len - l_added + 1, l_added);
/* }}} */
static int _build_trace_args(zval **arg TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */
@@ -371,7 +376,7 @@ static int _build_trace_args(zval **arg TSRMLS_DC, int num_args, va_list args, z
len = va_arg(args, int*);
/* the trivial way would be to do:
* conver_to_string_ex(arg);
* convert_to_string_ex(arg);
* append it and kill the now tmp arg.
* but that could cause some E_NOTICE and also damn long lines.
*/
@@ -394,8 +399,58 @@ static int _build_trace_args(zval **arg TSRMLS_DC, int num_args, va_list args, z
l_added += 3 + 1;
}
while (--l_added) {
if ((*str)[*len - l_added] < 32) {
(*str)[*len - l_added] = '?';
unsigned char chr = (*str)[*len - l_added];
if (chr < 32 || chr == '\\' || chr > 126) {
(*str)[*len - l_added] = '\\';
switch (chr) {
case '\n':
TRACE_ARG_APPEND(1);
(*str)[++(*len) - l_added] = 'n';
break;
case '\r':
TRACE_ARG_APPEND(1);
(*str)[++(*len) - l_added] = 'r';
break;
case '\t':
TRACE_ARG_APPEND(1);
(*str)[++(*len) - l_added] = 't';
break;
case '\f':
TRACE_ARG_APPEND(1);
(*str)[++(*len) - l_added] = 'f';
break;
case '\v':
TRACE_ARG_APPEND(1);
(*str)[++(*len) - l_added] = 'v';
break;
#ifndef PHP_WIN32
case '\e':
#else
case VK_ESCAPE:
#endif
TRACE_ARG_APPEND(1);
(*str)[++(*len) - l_added] = 'e';
break;
case '\\':
TRACE_ARG_APPEND(1);
(*str)[++(*len) - l_added] = '\\';
break;
default:
TRACE_ARG_APPEND(3);
(*str)[*len - l_added + 1] = 'x';
if ((chr >> 4) < 10) {
(*str)[*len - l_added + 2] = (chr >> 4) + '0';
} else {
(*str)[*len - l_added + 2] = (chr >> 4) + 'A' - 10;
}
if (chr % 16 < 10) {
(*str)[*len - l_added + 3] = chr % 16 + '0';
} else {
(*str)[*len - l_added + 3] = chr % 16 + 'A' - 10;
}
*len += 3;
}
}
}
break;
+8 -2
View File
@@ -1352,9 +1352,15 @@ static void zend_fetch_dimension_address_read(temp_variable *result, zval *conta
}
}
ZEND_API void zend_fetch_dimension_by_zval(zval **result, zval *container, zval *dim TSRMLS_DC) {
temp_variable tmp;
zend_fetch_dimension_address_read(&tmp, container, dim, IS_TMP_VAR, BP_VAR_R TSRMLS_CC);
*result = tmp.var.ptr;
}
static void zend_fetch_property_address(temp_variable *result, zval **container_ptr, zval *prop_ptr, const zend_literal *key, int type TSRMLS_DC)
{
zval *container = *container_ptr;;
zval *container = *container_ptr;
if (Z_TYPE_P(container) != IS_OBJECT) {
if (container == &EG(error_zval)) {
@@ -1686,7 +1692,7 @@ ZEND_API zend_execute_data *zend_create_execute_data_from_op_array(zend_op_array
static zend_always_inline zend_bool zend_is_by_ref_func_arg_fetch(zend_op *opline, call_slot *call TSRMLS_DC) /* {{{ */
{
zend_uint arg_num = (opline->extended_value & ZEND_FETCH_ARG_MASK) + call->num_additional_args;
zend_uint arg_num = opline->extended_value & ZEND_FETCH_ARG_MASK;
return ARG_SHOULD_BE_SENT_BY_REF(call->fbc, arg_num);
}
/* }}} */
+6 -4
View File
@@ -158,10 +158,10 @@ static zend_always_inline int i_zend_is_true(zval *op)
return result;
}
ZEND_API int zval_update_constant(zval **pp, void *arg TSRMLS_DC);
ZEND_API int zval_update_constant_inline_change(zval **pp, void *arg TSRMLS_DC);
ZEND_API int zval_update_constant_no_inline_change(zval **pp, void *arg TSRMLS_DC);
ZEND_API int zval_update_constant_ex(zval **pp, void *arg, zend_class_entry *scope TSRMLS_DC);
ZEND_API int zval_update_constant(zval **pp, zend_bool inline_change TSRMLS_DC);
ZEND_API int zval_update_constant_inline_change(zval **pp, zend_class_entry *scope TSRMLS_DC);
ZEND_API int zval_update_constant_no_inline_change(zval **pp, zend_class_entry *scope TSRMLS_DC);
ZEND_API int zval_update_constant_ex(zval **pp, zend_bool inline_change, zend_class_entry *scope TSRMLS_DC);
/* dedicated Zend executor functions - do not use! */
#define ZEND_VM_STACK_PAGE_SIZE ((16 * 1024) - 16)
@@ -362,6 +362,8 @@ ZEND_API zend_class_entry *zend_fetch_class(const char *class_name, uint class_n
ZEND_API zend_class_entry *zend_fetch_class_by_name(const char *class_name, uint class_name_len, const zend_literal *key, int fetch_type TSRMLS_DC);
void zend_verify_abstract_class(zend_class_entry *ce TSRMLS_DC);
ZEND_API void zend_fetch_dimension_by_zval(zval **result, zval *container, zval *dim TSRMLS_DC);
#ifdef ZEND_WIN32
void zend_init_timeout_thread(void);
void zend_shutdown_timeout_thread(void);
+8 -126
View File
@@ -451,28 +451,14 @@ ZEND_API int zend_is_true(zval *op) /* {{{ */
#include "../TSRM/tsrm_strtok_r.h"
#define IS_VISITED_CONSTANT IS_CONSTANT_INDEX
#define IS_VISITED_CONSTANT 0x80
#define IS_CONSTANT_VISITED(p) (Z_TYPE_P(p) & IS_VISITED_CONSTANT)
#define Z_REAL_TYPE_P(p) (Z_TYPE_P(p) & ~IS_VISITED_CONSTANT)
#define MARK_CONSTANT_VISITED(p) Z_TYPE_P(p) |= IS_VISITED_CONSTANT
static void zval_deep_copy(zval **p)
{
zval *value;
ALLOC_ZVAL(value);
*value = **p;
Z_TYPE_P(value) &= ~IS_CONSTANT_INDEX;
zval_copy_ctor(value);
Z_TYPE_P(value) = Z_TYPE_PP(p);
INIT_PZVAL(value);
*p = value;
}
ZEND_API int zval_update_constant_ex(zval **pp, void *arg, zend_class_entry *scope TSRMLS_DC) /* {{{ */
ZEND_API int zval_update_constant_ex(zval **pp, zend_bool inline_change, zend_class_entry *scope TSRMLS_DC) /* {{{ */
{
zval *p = *pp;
zend_bool inline_change = (zend_bool) (zend_uintptr_t) arg;
zval const_value;
char *colon;
@@ -559,110 +545,6 @@ ZEND_API int zval_update_constant_ex(zval **pp, void *arg, zend_class_entry *sco
Z_SET_REFCOUNT_P(p, refcount);
Z_SET_ISREF_TO_P(p, is_ref);
} else if (Z_TYPE_P(p) == IS_CONSTANT_ARRAY) {
zval **element, *new_val;
char *str_index;
uint str_index_len;
ulong num_index;
int ret;
SEPARATE_ZVAL_IF_NOT_REF(pp);
p = *pp;
Z_TYPE_P(p) = IS_ARRAY;
if (!inline_change) {
zval *tmp;
HashTable *tmp_ht = NULL;
ALLOC_HASHTABLE(tmp_ht);
zend_hash_init(tmp_ht, zend_hash_num_elements(Z_ARRVAL_P(p)), NULL, ZVAL_PTR_DTOR, 0);
zend_hash_copy(tmp_ht, Z_ARRVAL_P(p), (copy_ctor_func_t) zval_deep_copy, (void *) &tmp, sizeof(zval *));
Z_ARRVAL_P(p) = tmp_ht;
}
/* First go over the array and see if there are any constant indices */
zend_hash_internal_pointer_reset(Z_ARRVAL_P(p));
while (zend_hash_get_current_data(Z_ARRVAL_P(p), (void **) &element) == SUCCESS) {
if (!(Z_TYPE_PP(element) & IS_CONSTANT_INDEX)) {
zend_hash_move_forward(Z_ARRVAL_P(p));
continue;
}
Z_TYPE_PP(element) &= ~IS_CONSTANT_INDEX;
if (zend_hash_get_current_key_ex(Z_ARRVAL_P(p), &str_index, &str_index_len, &num_index, 0, NULL) != HASH_KEY_IS_STRING) {
zend_hash_move_forward(Z_ARRVAL_P(p));
continue;
}
if (str_index[str_index_len - 2] == IS_CONSTANT_AST) {
zend_ast_evaluate(&const_value, *(zend_ast **)str_index, scope TSRMLS_CC);
zend_ast_destroy(*(zend_ast **)str_index);
} else if (!zend_get_constant_ex(str_index, str_index_len - 3, &const_value, scope, str_index[str_index_len - 2] TSRMLS_CC)) {
char *actual;
const char *save = str_index;
if ((colon = (char*)zend_memrchr(str_index, ':', str_index_len - 3))) {
zend_error(E_ERROR, "Undefined class constant '%s'", str_index);
str_index_len -= ((colon - str_index) + 1);
str_index = colon;
} else {
if (str_index[str_index_len - 2] & IS_CONSTANT_UNQUALIFIED) {
if ((actual = (char *)zend_memrchr(str_index, '\\', str_index_len - 3))) {
actual++;
str_index_len -= (actual - str_index);
str_index = actual;
}
}
if (str_index[0] == '\\') {
++str_index;
--str_index_len;
}
if (save[0] == '\\') {
++save;
}
if ((str_index[str_index_len - 2] & IS_CONSTANT_UNQUALIFIED) == 0) {
zend_error(E_ERROR, "Undefined constant '%s'", save);
}
zend_error(E_NOTICE, "Use of undefined constant %s - assumed '%s'", str_index, str_index);
}
ZVAL_STRINGL(&const_value, str_index, str_index_len-3, 1);
}
if (Z_REFCOUNT_PP(element) > 1) {
ALLOC_ZVAL(new_val);
*new_val = **element;
zval_copy_ctor(new_val);
Z_SET_REFCOUNT_P(new_val, 1);
Z_UNSET_ISREF_P(new_val);
/* preserve this bit for inheritance */
Z_TYPE_PP(element) |= IS_CONSTANT_INDEX;
zval_ptr_dtor(element);
*element = new_val;
}
switch (Z_TYPE(const_value)) {
case IS_STRING:
ret = zend_symtable_update_current_key(Z_ARRVAL_P(p), Z_STRVAL(const_value), Z_STRLEN(const_value) + 1, HASH_UPDATE_KEY_IF_BEFORE);
break;
case IS_BOOL:
case IS_LONG:
ret = zend_hash_update_current_key_ex(Z_ARRVAL_P(p), HASH_KEY_IS_LONG, NULL, 0, Z_LVAL(const_value), HASH_UPDATE_KEY_IF_BEFORE, NULL);
break;
case IS_DOUBLE:
ret = zend_hash_update_current_key_ex(Z_ARRVAL_P(p), HASH_KEY_IS_LONG, NULL, 0, zend_dval_to_lval(Z_DVAL(const_value)), HASH_UPDATE_KEY_IF_BEFORE, NULL);
break;
case IS_NULL:
ret = zend_hash_update_current_key_ex(Z_ARRVAL_P(p), HASH_KEY_IS_STRING, "", 1, 0, HASH_UPDATE_KEY_IF_BEFORE, NULL);
break;
default:
ret = SUCCESS;
break;
}
if (ret == SUCCESS) {
zend_hash_move_forward(Z_ARRVAL_P(p));
}
zval_dtor(&const_value);
}
zend_hash_apply_with_argument(Z_ARRVAL_P(p), (apply_func_arg_t) zval_update_constant_inline_change, (void *) scope TSRMLS_CC);
zend_hash_internal_pointer_reset(Z_ARRVAL_P(p));
} else if (Z_TYPE_P(p) == IS_CONSTANT_AST) {
SEPARATE_ZVAL_IF_NOT_REF(pp);
p = *pp;
@@ -677,21 +559,21 @@ ZEND_API int zval_update_constant_ex(zval **pp, void *arg, zend_class_entry *sco
}
/* }}} */
ZEND_API int zval_update_constant_inline_change(zval **pp, void *scope TSRMLS_DC) /* {{{ */
ZEND_API int zval_update_constant_inline_change(zval **pp, zend_class_entry *scope TSRMLS_DC) /* {{{ */
{
return zval_update_constant_ex(pp, (void*)1, scope TSRMLS_CC);
return zval_update_constant_ex(pp, 1, scope TSRMLS_CC);
}
/* }}} */
ZEND_API int zval_update_constant_no_inline_change(zval **pp, void *scope TSRMLS_DC) /* {{{ */
ZEND_API int zval_update_constant_no_inline_change(zval **pp, zend_class_entry *scope TSRMLS_DC) /* {{{ */
{
return zval_update_constant_ex(pp, (void*)0, scope TSRMLS_CC);
return zval_update_constant_ex(pp, 0, scope TSRMLS_CC);
}
/* }}} */
ZEND_API int zval_update_constant(zval **pp, void *arg TSRMLS_DC) /* {{{ */
ZEND_API int zval_update_constant(zval **pp, zend_bool inline_change TSRMLS_DC) /* {{{ */
{
return zval_update_constant_ex(pp, arg, NULL TSRMLS_CC);
return zval_update_constant_ex(pp, inline_change, NULL TSRMLS_CC);
}
/* }}} */
+193 -220
View File
@@ -29,18 +29,24 @@
(element)->pNext->pLast = (element); \
}
#define CONNECT_TO_GLOBAL_DLLIST(element, ht) \
(element)->pListLast = (ht)->pListTail; \
(ht)->pListTail = (element); \
(element)->pListNext = NULL; \
if ((element)->pListLast != NULL) { \
(element)->pListLast->pListNext = (element); \
} \
if (!(ht)->pListHead) { \
#define CONNECT_TO_GLOBAL_DLLIST_EX(element, ht, last, next)\
(element)->pListLast = (last); \
(element)->pListNext = (next); \
if ((last) != NULL) { \
(last)->pListNext = (element); \
} else { \
(ht)->pListHead = (element); \
} \
if ((ht)->pInternalPointer == NULL) { \
(ht)->pInternalPointer = (element); \
if ((next) != NULL) { \
(next)->pListLast = (element); \
} else { \
(ht)->pListTail = (element); \
} \
#define CONNECT_TO_GLOBAL_DLLIST(element, ht) \
CONNECT_TO_GLOBAL_DLLIST_EX(element, ht, (ht)->pListTail, (Bucket *) NULL); \
if ((ht)->pInternalPointer == NULL) { \
(ht)->pInternalPointer = (element); \
}
#if ZEND_DEBUG
@@ -122,13 +128,13 @@ ZEND_API ulong zend_hash_func(const char *arKey, uint nKeyLength)
memcpy((p)->pData, pData, nDataSize); \
}
#define INIT_DATA(ht, p, pData, nDataSize); \
#define INIT_DATA(ht, p, _pData, nDataSize); \
if (nDataSize == sizeof(void*)) { \
memcpy(&(p)->pDataPtr, pData, sizeof(void *)); \
memcpy(&(p)->pDataPtr, (_pData), sizeof(void *)); \
(p)->pData = &(p)->pDataPtr; \
} else { \
(p)->pData = (void *) pemalloc_rel(nDataSize, (ht)->persistent);\
memcpy((p)->pData, pData, nDataSize); \
memcpy((p)->pData, (_pData), nDataSize); \
(p)->pDataPtr=NULL; \
}
@@ -141,6 +147,51 @@ ZEND_API ulong zend_hash_func(const char *arKey, uint nKeyLength)
static const Bucket *uninitialized_bucket = NULL;
static zend_always_inline void i_zend_hash_bucket_delete(HashTable *ht, Bucket *p)
{
#ifdef ZEND_SIGNALS
TSRMLS_FETCH();
#endif
HANDLE_BLOCK_INTERRUPTIONS();
if (p->pLast) {
p->pLast->pNext = p->pNext;
} else {
ht->arBuckets[p->h & ht->nTableMask] = p->pNext;
}
if (p->pNext) {
p->pNext->pLast = p->pLast;
}
if (p->pListLast != NULL) {
p->pListLast->pListNext = p->pListNext;
} else {
/* Deleting the head of the list */
ht->pListHead = p->pListNext;
}
if (p->pListNext != NULL) {
p->pListNext->pListLast = p->pListLast;
} else {
/* Deleting the tail of the list */
ht->pListTail = p->pListLast;
}
if (ht->pInternalPointer == p) {
ht->pInternalPointer = p->pListNext;
}
ht->nNumOfElements--;
if (ht->pDestructor) {
ht->pDestructor(p->pData);
}
if (p->pData != &p->pDataPtr) {
pefree(p->pData, ht->persistent);
}
pefree(p, ht->persistent);
HANDLE_UNBLOCK_INTERRUPTIONS();
}
static void zend_hash_bucket_delete(HashTable *ht, Bucket *p) {
i_zend_hash_bucket_delete(ht, p);
}
ZEND_API int _zend_hash_init(HashTable *ht, uint nSize, dtor_func_t pDestructor, zend_bool persistent ZEND_FILE_LINE_DC)
{
uint i = 3;
@@ -358,9 +409,6 @@ ZEND_API int _zend_hash_index_update_or_next_insert(HashTable *ht, ulong h, void
}
UPDATE_DATA(ht, p, pData, nDataSize);
HANDLE_UNBLOCK_INTERRUPTIONS();
if ((long)h >= (long)ht->nNextFreeElement) {
ht->nNextFreeElement = h < LONG_MAX ? h + 1 : LONG_MAX;
}
if (pDest) {
*pDest = p->pData;
}
@@ -424,23 +472,42 @@ ZEND_API int zend_hash_rehash(HashTable *ht)
}
memset(ht->arBuckets, 0, ht->nTableSize * sizeof(Bucket *));
p = ht->pListHead;
while (p != NULL) {
for (p = ht->pListHead; p != NULL; p = p->pListNext) {
nIndex = p->h & ht->nTableMask;
CONNECT_TO_BUCKET_DLLIST(p, ht->arBuckets[nIndex]);
ht->arBuckets[nIndex] = p;
p = p->pListNext;
}
return SUCCESS;
}
ZEND_API void zend_hash_reindex(HashTable *ht, zend_bool only_integer_keys) {
Bucket *p;
uint nIndex;
ulong offset = 0;
IS_CONSISTENT(ht);
if (UNEXPECTED(ht->nNumOfElements == 0)) {
return;
}
memset(ht->arBuckets, 0, ht->nTableSize * sizeof(Bucket *));
for (p = ht->pListHead; p != NULL; p = p->pListNext) {
if (!only_integer_keys || p->nKeyLength == 0) {
p->h = offset++;
p->nKeyLength = 0;
}
nIndex = p->h & ht->nTableMask;
CONNECT_TO_BUCKET_DLLIST(p, ht->arBuckets[nIndex]);
ht->arBuckets[nIndex] = p;
}
ht->nNextFreeElement = offset;
}
ZEND_API int zend_hash_del_key_or_index(HashTable *ht, const char *arKey, uint nKeyLength, ulong h, int flag)
{
uint nIndex;
Bucket *p;
#ifdef ZEND_SIGNALS
TSRMLS_FETCH();
#endif
IS_CONSISTENT(ht);
@@ -455,38 +522,7 @@ ZEND_API int zend_hash_del_key_or_index(HashTable *ht, const char *arKey, uint n
&& (p->nKeyLength == nKeyLength)
&& ((p->nKeyLength == 0) /* Numeric index (short circuits the memcmp() check) */
|| !memcmp(p->arKey, arKey, nKeyLength))) { /* String index */
HANDLE_BLOCK_INTERRUPTIONS();
if (p == ht->arBuckets[nIndex]) {
ht->arBuckets[nIndex] = p->pNext;
} else {
p->pLast->pNext = p->pNext;
}
if (p->pNext) {
p->pNext->pLast = p->pLast;
}
if (p->pListLast != NULL) {
p->pListLast->pListNext = p->pListNext;
} else {
/* Deleting the head of the list */
ht->pListHead = p->pListNext;
}
if (p->pListNext != NULL) {
p->pListNext->pListLast = p->pListLast;
} else {
ht->pListTail = p->pListLast;
}
if (ht->pInternalPointer == p) {
ht->pInternalPointer = p->pListNext;
}
ht->nNumOfElements--;
if (ht->pDestructor) {
ht->pDestructor(p->pData);
}
if (p->pData != &p->pDataPtr) {
pefree(p->pData, ht->persistent);
}
pefree(p, ht->persistent);
HANDLE_UNBLOCK_INTERRUPTIONS();
i_zend_hash_bucket_delete(ht, p);
return SUCCESS;
}
p = p->pNext;
@@ -553,73 +589,14 @@ ZEND_API void zend_hash_clean(HashTable *ht)
}
}
/* This function is used by the various apply() functions.
* It deletes the passed bucket, and returns the address of the
* next bucket. The hash *may* be altered during that time, the
* returned value will still be valid.
*/
static Bucket *zend_hash_apply_deleter(HashTable *ht, Bucket *p)
{
Bucket *retval;
#ifdef ZEND_SIGNALS
TSRMLS_FETCH();
#endif
HANDLE_BLOCK_INTERRUPTIONS();
if (p->pLast) {
p->pLast->pNext = p->pNext;
} else {
uint nIndex;
nIndex = p->h & ht->nTableMask;
ht->arBuckets[nIndex] = p->pNext;
}
if (p->pNext) {
p->pNext->pLast = p->pLast;
} else {
/* Nothing to do as this list doesn't have a tail */
}
if (p->pListLast != NULL) {
p->pListLast->pListNext = p->pListNext;
} else {
/* Deleting the head of the list */
ht->pListHead = p->pListNext;
}
if (p->pListNext != NULL) {
p->pListNext->pListLast = p->pListLast;
} else {
ht->pListTail = p->pListLast;
}
if (ht->pInternalPointer == p) {
ht->pInternalPointer = p->pListNext;
}
ht->nNumOfElements--;
HANDLE_UNBLOCK_INTERRUPTIONS();
if (ht->pDestructor) {
ht->pDestructor(p->pData);
}
if (p->pData != &p->pDataPtr) {
pefree(p->pData, ht->persistent);
}
retval = p->pListNext;
pefree(p, ht->persistent);
return retval;
}
ZEND_API void zend_hash_graceful_destroy(HashTable *ht)
{
Bucket *p;
IS_CONSISTENT(ht);
p = ht->pListHead;
while (p != NULL) {
p = zend_hash_apply_deleter(ht, p);
while (ht->pListHead != NULL) {
zend_hash_bucket_delete(ht, ht->pListHead);
}
if (ht->nTableMask) {
pefree(ht->arBuckets, ht->persistent);
}
@@ -629,14 +606,10 @@ ZEND_API void zend_hash_graceful_destroy(HashTable *ht)
ZEND_API void zend_hash_graceful_reverse_destroy(HashTable *ht)
{
Bucket *p;
IS_CONSISTENT(ht);
p = ht->pListTail;
while (p != NULL) {
zend_hash_apply_deleter(ht, p);
p = ht->pListTail;
while (ht->pListTail != NULL) {
zend_hash_bucket_delete(ht, ht->pListTail);
}
if (ht->nTableMask) {
@@ -665,12 +638,13 @@ ZEND_API void zend_hash_apply(HashTable *ht, apply_func_t apply_func TSRMLS_DC)
p = ht->pListHead;
while (p != NULL) {
int result = apply_func(p->pData TSRMLS_CC);
Bucket *p_next = p->pListNext;
if (result & ZEND_HASH_APPLY_REMOVE) {
p = zend_hash_apply_deleter(ht, p);
} else {
p = p->pListNext;
zend_hash_bucket_delete(ht, p);
}
p = p_next;
if (result & ZEND_HASH_APPLY_STOP) {
break;
}
@@ -690,11 +664,12 @@ ZEND_API void zend_hash_apply_with_argument(HashTable *ht, apply_func_arg_t appl
while (p != NULL) {
int result = apply_func(p->pData, argument TSRMLS_CC);
Bucket *p_next = p->pListNext;
if (result & ZEND_HASH_APPLY_REMOVE) {
p = zend_hash_apply_deleter(ht, p);
} else {
p = p->pListNext;
zend_hash_bucket_delete(ht, p);
}
p = p_next;
if (result & ZEND_HASH_APPLY_STOP) {
break;
}
@@ -716,17 +691,20 @@ ZEND_API void zend_hash_apply_with_arguments(HashTable *ht TSRMLS_DC, apply_func
p = ht->pListHead;
while (p != NULL) {
int result;
Bucket *p_next;
va_start(args, num_args);
hash_key.arKey = p->arKey;
hash_key.nKeyLength = p->nKeyLength;
hash_key.h = p->h;
result = apply_func(p->pData TSRMLS_CC, num_args, args, &hash_key);
p_next = p->pListNext;
if (result & ZEND_HASH_APPLY_REMOVE) {
p = zend_hash_apply_deleter(ht, p);
} else {
p = p->pListNext;
zend_hash_bucket_delete(ht, p);
}
p = p_next;
if (result & ZEND_HASH_APPLY_STOP) {
va_end(args);
break;
@@ -740,7 +718,7 @@ ZEND_API void zend_hash_apply_with_arguments(HashTable *ht TSRMLS_DC, apply_func
ZEND_API void zend_hash_reverse_apply(HashTable *ht, apply_func_t apply_func TSRMLS_DC)
{
Bucket *p, *q;
Bucket *p;
IS_CONSISTENT(ht);
@@ -749,11 +727,12 @@ ZEND_API void zend_hash_reverse_apply(HashTable *ht, apply_func_t apply_func TSR
while (p != NULL) {
int result = apply_func(p->pData TSRMLS_CC);
q = p;
p = p->pListLast;
Bucket *p_last = p->pListLast;
if (result & ZEND_HASH_APPLY_REMOVE) {
zend_hash_apply_deleter(ht, q);
zend_hash_bucket_delete(ht, p);
}
p = p_last;
if (result & ZEND_HASH_APPLY_STOP) {
break;
}
@@ -1223,8 +1202,6 @@ ZEND_API int zend_hash_update_current_key_ex(HashTable *ht, int key_type, const
return FAILURE;
}
HANDLE_BLOCK_INTERRUPTIONS();
if (q) {
if (mode != HASH_UPDATE_KEY_ANYWAY) {
Bucket *r = p->pListLast;
@@ -1239,73 +1216,17 @@ ZEND_API int zend_hash_update_current_key_ex(HashTable *ht, int key_type, const
}
if (mode & found) {
/* delete current bucket */
if (p == ht->arBuckets[p->h & ht->nTableMask]) {
ht->arBuckets[p->h & ht->nTableMask] = p->pNext;
} else {
p->pLast->pNext = p->pNext;
}
if (p->pNext) {
p->pNext->pLast = p->pLast;
}
if (p->pListLast != NULL) {
p->pListLast->pListNext = p->pListNext;
} else {
/* Deleting the head of the list */
ht->pListHead = p->pListNext;
}
if (p->pListNext != NULL) {
p->pListNext->pListLast = p->pListLast;
} else {
ht->pListTail = p->pListLast;
}
if (ht->pInternalPointer == p) {
ht->pInternalPointer = p->pListNext;
}
ht->nNumOfElements--;
if (ht->pDestructor) {
ht->pDestructor(p->pData);
}
if (p->pData != &p->pDataPtr) {
pefree(p->pData, ht->persistent);
}
pefree(p, ht->persistent);
HANDLE_UNBLOCK_INTERRUPTIONS();
zend_hash_bucket_delete(ht, p);
return FAILURE;
}
}
/* delete another bucket with the same key */
if (q == ht->arBuckets[q->h & ht->nTableMask]) {
ht->arBuckets[q->h & ht->nTableMask] = q->pNext;
} else {
q->pLast->pNext = q->pNext;
}
if (q->pNext) {
q->pNext->pLast = q->pLast;
}
if (q->pListLast != NULL) {
q->pListLast->pListNext = q->pListNext;
} else {
/* Deleting the head of the list */
ht->pListHead = q->pListNext;
}
if (q->pListNext != NULL) {
q->pListNext->pListLast = q->pListLast;
} else {
ht->pListTail = q->pListLast;
}
if (ht->pInternalPointer == q) {
ht->pInternalPointer = q->pListNext;
}
ht->nNumOfElements--;
if (ht->pDestructor) {
ht->pDestructor(q->pData);
}
if (q->pData != &q->pDataPtr) {
pefree(q->pData, ht->persistent);
}
pefree(q, ht->persistent);
zend_hash_bucket_delete(ht, q);
}
HANDLE_BLOCK_INTERRUPTIONS();
if (p->pNext) {
p->pNext->pLast = p->pLast;
}
@@ -1332,21 +1253,12 @@ ZEND_API int zend_hash_update_current_key_ex(HashTable *ht, int key_type, const
q->pData = p->pData;
}
q->pDataPtr = p->pDataPtr;
q->pListNext = p->pListNext;
q->pListLast = p->pListLast;
if (q->pListNext) {
p->pListNext->pListLast = q;
} else {
ht->pListTail = q;
}
if (q->pListLast) {
p->pListLast->pListNext = q;
} else {
ht->pListHead = q;
}
CONNECT_TO_GLOBAL_DLLIST_EX(q, ht, p->pListLast, p->pListNext);
if (ht->pInternalPointer == p) {
ht->pInternalPointer = q;
}
if (pos) {
*pos = q;
}
@@ -1377,6 +1289,75 @@ ZEND_API int zend_hash_update_current_key_ex(HashTable *ht, int key_type, const
}
}
/* Performs an in-place splice operation on a hashtable:
* The elements between offset and offset+length are removed and the elements in list[list_count]
* are inserted in their place. The removed elements can be optionally collected into a hashtable.
* This operation reindexes the hashtable, i.e. integer keys will be zero-based and sequential,
* while string keys stay intact. The same applies to the elements inserted into the removed HT. */
ZEND_API void _zend_hash_splice(HashTable *ht, uint nDataSize, copy_ctor_func_t pCopyConstructor, uint offset, uint length, void **list, uint list_count, HashTable *removed ZEND_FILE_LINE_DC) /* {{{ */
{
int pos;
Bucket *p;
IS_CONSISTENT(ht);
CHECK_INIT(ht);
/* Skip all elements until offset */
for (pos = 0, p = ht->pListHead; pos < offset && p; pos++, p = p->pListNext);
while (pos < offset + length && p) {
/* Copy removed element into HT, if it was specified */
if (removed != NULL) {
void *new_entry;
if (p->nKeyLength == 0) {
zend_hash_next_index_insert(removed, p->pData, sizeof(zval *), &new_entry);
} else {
zend_hash_quick_update(removed, p->arKey, p->nKeyLength, p->h, p->pData, sizeof(zval *), &new_entry);
}
if (pCopyConstructor) {
pCopyConstructor(new_entry);
}
}
/* Remove element */
{
Bucket *p_next = p->pListNext;
zend_hash_bucket_delete(ht, p);
p = p_next;
}
pos++;
}
if (list != NULL) {
int i;
for (i = 0; i < list_count; i++) {
/* Add new element only to the global linked list, not the bucket list.
* Also use key 0 for everything, as we'll reindex the hashtable anyways. */
Bucket *q = pemalloc_rel(sizeof(Bucket), ht->persistent);
q->arKey = NULL;
q->nKeyLength = 0;
q->h = 0;
INIT_DATA(ht, q, list[i], nDataSize);
CONNECT_TO_GLOBAL_DLLIST_EX(q, ht, p ? p->pListLast : ht->pListTail, p);
ht->nNumOfElements++;
if (pCopyConstructor) {
pCopyConstructor(q->pData);
}
}
ZEND_HASH_IF_FULL_DO_RESIZE(ht);
}
zend_hash_reindex(ht, 1);
}
/* }}} */
ZEND_API int zend_hash_sort(HashTable *ht, sort_func_t sort_func,
compare_func_t compar, int renumber TSRMLS_DC)
{
@@ -1423,15 +1404,7 @@ ZEND_API int zend_hash_sort(HashTable *ht, sort_func_t sort_func,
HANDLE_UNBLOCK_INTERRUPTIONS();
if (renumber) {
p = ht->pListHead;
i=0;
while (p != NULL) {
p->nKeyLength = 0;
p->h = i++;
p = p->pListNext;
}
ht->nNextFreeElement = i;
zend_hash_rehash(ht);
zend_hash_reindex(ht, 0);
}
return SUCCESS;
}
+5
View File
@@ -227,6 +227,11 @@ ZEND_API int zend_hash_minmax(const HashTable *ht, compare_func_t compar, int fl
ZEND_API int zend_hash_num_elements(const HashTable *ht);
ZEND_API int zend_hash_rehash(HashTable *ht);
ZEND_API void zend_hash_reindex(HashTable *ht, zend_bool only_integer_keys);
ZEND_API void _zend_hash_splice(HashTable *ht, uint nDataSize, copy_ctor_func_t pCopyConstructor, uint offset, uint length, void **list, uint list_count, HashTable *removed ZEND_FILE_LINE_DC);
#define zend_hash_splice(ht, nDataSize, pCopyConstructor, offset, length, list, list_count, removed) \
_zend_hash_splice(ht, nDataSize, pCopyConstructor, offset, length, list, list_count, removed ZEND_FILE_LINE_CC)
/*
* DJBX33A (Daniel J. Bernstein, Times 33 with Addition)
+2 -2
View File
@@ -57,7 +57,7 @@ ZEND_API void zend_html_putc(char c)
ZEND_API void zend_html_puts(const char *s, uint len TSRMLS_DC)
{
const unsigned char *ptr = (const unsigned char*)s, *end = ptr + len;
unsigned char *filtered;
unsigned char *filtered = NULL;
size_t filtered_len;
if (LANG_SCNG(output_filter)) {
@@ -211,7 +211,7 @@ ZEND_API void zend_strip(TSRMLS_D)
break;
default:
efree(token.value.str.val);
STR_FREE(token.value.str.val);
break;
}
}
+4663 -4663
View File
File diff suppressed because it is too large. Load diff
+13 -13
View File
@@ -1,13 +1,13 @@
/* Generated by re2c 0.13.5 */
#line 3 "Zend/zend_ini_scanner_defs.h"
enum YYCONDTYPE {
yycINITIAL,
yycST_OFFSET,
yycST_SECTION_VALUE,
yycST_VALUE,
yycST_SECTION_RAW,
yycST_DOUBLE_QUOTES,
yycST_VARNAME,
yycST_RAW,
};
/* Generated by re2c 0.13.5 */
#line 3 "Zend/zend_ini_scanner_defs.h"
enum YYCONDTYPE {
yycINITIAL,
yycST_OFFSET,
yycST_SECTION_VALUE,
yycST_VALUE,
yycST_SECTION_RAW,
yycST_DOUBLE_QUOTES,
yycST_VARNAME,
yycST_RAW,
};
+33 -30
View File
@@ -580,19 +580,20 @@ optional_class_type:
function_call_parameter_list:
'(' ')' { Z_LVAL($$.u.constant) = 0; }
| '(' non_empty_function_call_parameter_list ')' { $$ = $2; }
| '(' yield_expr ')' { Z_LVAL($$.u.constant) = 1; zend_do_pass_param(&$2, ZEND_SEND_VAL, Z_LVAL($$.u.constant) TSRMLS_CC); }
| '(' yield_expr ')' { zend_do_pass_param(&$2, ZEND_SEND_VAL TSRMLS_CC); }
;
non_empty_function_call_parameter_list:
expr_without_variable { Z_LVAL($$.u.constant) = 1; zend_do_pass_param(&$1, ZEND_SEND_VAL, Z_LVAL($$.u.constant) TSRMLS_CC); }
| variable { Z_LVAL($$.u.constant) = 1; zend_do_pass_param(&$1, ZEND_SEND_VAR, Z_LVAL($$.u.constant) TSRMLS_CC); }
| '&' w_variable { Z_LVAL($$.u.constant) = 1; zend_do_pass_param(&$2, ZEND_SEND_REF, Z_LVAL($$.u.constant) TSRMLS_CC); }
| T_ELLIPSIS expr { Z_LVAL($$.u.constant) = 0; zend_do_unpack_params(&$2, Z_LVAL($$.u.constant) TSRMLS_CC); }
| non_empty_function_call_parameter_list ',' expr_without_variable { Z_LVAL($$.u.constant)=Z_LVAL($1.u.constant)+1; zend_do_pass_param(&$3, ZEND_SEND_VAL, Z_LVAL($$.u.constant) TSRMLS_CC); }
| non_empty_function_call_parameter_list ',' variable { Z_LVAL($$.u.constant)=Z_LVAL($1.u.constant)+1; zend_do_pass_param(&$3, ZEND_SEND_VAR, Z_LVAL($$.u.constant) TSRMLS_CC); }
| non_empty_function_call_parameter_list ',' '&' w_variable { Z_LVAL($$.u.constant)=Z_LVAL($1.u.constant)+1; zend_do_pass_param(&$4, ZEND_SEND_REF, Z_LVAL($$.u.constant) TSRMLS_CC); }
| non_empty_function_call_parameter_list ',' T_ELLIPSIS expr { Z_LVAL($$.u.constant)=Z_LVAL($1.u.constant); zend_do_unpack_params(&$4, Z_LVAL($$.u.constant) TSRMLS_CC); }
function_call_parameter
| non_empty_function_call_parameter_list ',' function_call_parameter
;
function_call_parameter:
expr_without_variable { zend_do_pass_param(&$1, ZEND_SEND_VAL TSRMLS_CC); }
| variable { zend_do_pass_param(&$1, ZEND_SEND_VAR TSRMLS_CC); }
| '&' w_variable { zend_do_pass_param(&$2, ZEND_SEND_REF TSRMLS_CC); }
| T_ELLIPSIS expr { zend_do_unpack_params(&$2 TSRMLS_CC); }
;
global_var_list:
@@ -769,14 +770,14 @@ instance_call:
;
new_expr:
T_NEW class_name_reference { zend_do_extended_fcall_begin(TSRMLS_C); zend_do_begin_new_object(&$1, &$2 TSRMLS_CC); } ctor_arguments { zend_do_end_new_object(&$$, &$1, &$4 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C);}
T_NEW class_name_reference { zend_do_extended_fcall_begin(TSRMLS_C); zend_do_begin_new_object(&$1, &$2 TSRMLS_CC); } ctor_arguments { zend_do_end_new_object(&$$, &$1 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C);}
;
expr_without_variable:
T_LIST '(' { zend_do_list_init(TSRMLS_C); } assignment_list ')' '=' expr { zend_do_list_end(&$$, &$7 TSRMLS_CC); }
| variable '=' expr { zend_check_writable_variable(&$1); zend_do_assign(&$$, &$1, &$3 TSRMLS_CC); }
| variable '=' '&' variable { zend_check_writable_variable(&$1); zend_do_end_variable_parse(&$4, BP_VAR_W, 1 TSRMLS_CC); zend_do_end_variable_parse(&$1, BP_VAR_W, 0 TSRMLS_CC); zend_do_assign_ref(&$$, &$1, &$4 TSRMLS_CC); }
| variable '=' '&' T_NEW class_name_reference { zend_error(E_DEPRECATED, "Assigning the return value of new by reference is deprecated"); zend_check_writable_variable(&$1); zend_do_extended_fcall_begin(TSRMLS_C); zend_do_begin_new_object(&$4, &$5 TSRMLS_CC); } ctor_arguments { zend_do_end_new_object(&$3, &$4, &$7 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C); zend_do_end_variable_parse(&$1, BP_VAR_W, 0 TSRMLS_CC); $3.EA = ZEND_PARSED_NEW; zend_do_assign_ref(&$$, &$1, &$3 TSRMLS_CC); }
| variable '=' '&' T_NEW class_name_reference { zend_error(E_DEPRECATED, "Assigning the return value of new by reference is deprecated"); zend_check_writable_variable(&$1); zend_do_extended_fcall_begin(TSRMLS_C); zend_do_begin_new_object(&$4, &$5 TSRMLS_CC); } ctor_arguments { zend_do_end_new_object(&$3, &$4 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C); zend_do_end_variable_parse(&$1, BP_VAR_W, 0 TSRMLS_CC); $3.EA = ZEND_PARSED_NEW; zend_do_assign_ref(&$$, &$1, &$3 TSRMLS_CC); }
| T_CLONE expr { zend_do_clone(&$$, &$2 TSRMLS_CC); }
| variable T_PLUS_EQUAL expr { zend_check_writable_variable(&$1); zend_do_end_variable_parse(&$1, BP_VAR_RW, 0 TSRMLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_ADD, &$$, &$1, &$3 TSRMLS_CC); }
| variable T_MINUS_EQUAL expr { zend_check_writable_variable(&$1); zend_do_end_variable_parse(&$1, BP_VAR_RW, 0 TSRMLS_CC); zend_do_binary_assign_op(ZEND_ASSIGN_SUB, &$$, &$1, &$3 TSRMLS_CC); }
@@ -890,21 +891,21 @@ lexical_var_list:
function_call:
namespace_name { $$.u.op.opline_num = zend_do_begin_function_call(&$1, 1 TSRMLS_CC); }
function_call_parameter_list { zend_do_end_function_call(&$1, &$$, &$3, 0, $2.u.op.opline_num TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C); }
function_call_parameter_list { zend_do_end_function_call(&$1, &$$, 0, $2.u.op.opline_num TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C); }
| T_NAMESPACE T_NS_SEPARATOR namespace_name { $1.op_type = IS_CONST; ZVAL_EMPTY_STRING(&$1.u.constant); zend_do_build_namespace_name(&$1, &$1, &$3 TSRMLS_CC); $$.u.op.opline_num = zend_do_begin_function_call(&$1, 0 TSRMLS_CC); }
function_call_parameter_list { zend_do_end_function_call(&$1, &$$, &$5, 0, $4.u.op.opline_num TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C); }
function_call_parameter_list { zend_do_end_function_call(&$1, &$$, 0, $4.u.op.opline_num TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C); }
| T_NS_SEPARATOR namespace_name { $$.u.op.opline_num = zend_do_begin_function_call(&$2, 0 TSRMLS_CC); }
function_call_parameter_list { zend_do_end_function_call(&$2, &$$, &$4, 0, $3.u.op.opline_num TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C); }
function_call_parameter_list { zend_do_end_function_call(&$2, &$$, 0, $3.u.op.opline_num TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C); }
| class_name T_PAAMAYIM_NEKUDOTAYIM variable_name { $$.u.op.opline_num = zend_do_begin_class_member_function_call(&$1, &$3 TSRMLS_CC); }
function_call_parameter_list { zend_do_end_function_call($4.u.op.opline_num?NULL:&$3, &$$, &$5, $4.u.op.opline_num, $4.u.op.opline_num TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C);}
function_call_parameter_list { zend_do_end_function_call($4.u.op.opline_num?NULL:&$3, &$$, $4.u.op.opline_num, $4.u.op.opline_num TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C);}
| class_name T_PAAMAYIM_NEKUDOTAYIM variable_without_objects { zend_do_end_variable_parse(&$3, BP_VAR_R, 0 TSRMLS_CC); zend_do_begin_class_member_function_call(&$1, &$3 TSRMLS_CC); }
function_call_parameter_list { zend_do_end_function_call(NULL, &$$, &$5, 1, 1 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C);}
function_call_parameter_list { zend_do_end_function_call(NULL, &$$, 1, 1 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C);}
| variable_class_name T_PAAMAYIM_NEKUDOTAYIM variable_name { zend_do_begin_class_member_function_call(&$1, &$3 TSRMLS_CC); }
function_call_parameter_list { zend_do_end_function_call(NULL, &$$, &$5, 1, 1 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C);}
function_call_parameter_list { zend_do_end_function_call(NULL, &$$, 1, 1 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C);}
| variable_class_name T_PAAMAYIM_NEKUDOTAYIM variable_without_objects { zend_do_end_variable_parse(&$3, BP_VAR_R, 0 TSRMLS_CC); zend_do_begin_class_member_function_call(&$1, &$3 TSRMLS_CC); }
function_call_parameter_list { zend_do_end_function_call(NULL, &$$, &$5, 1, 1 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C);}
function_call_parameter_list { zend_do_end_function_call(NULL, &$$, 1, 1 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C);}
| variable_without_objects { zend_do_end_variable_parse(&$1, BP_VAR_R, 0 TSRMLS_CC); zend_do_begin_dynamic_function_call(&$1, 0 TSRMLS_CC); }
function_call_parameter_list { zend_do_end_function_call(&$1, &$$, &$3, 0, 1 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C);}
function_call_parameter_list { zend_do_end_function_call(&$1, &$$, 0, 1 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C);}
;
class_name:
@@ -985,9 +986,7 @@ static_class_constant:
;
static_scalar: /* compile-time evaluated scalars */
static_scalar_value { zend_do_constant_expression(&$$, $1.u.ast TSRMLS_CC); }
| T_ARRAY '(' static_array_pair_list ')' { $$ = $3; Z_TYPE($$.u.constant) = IS_CONSTANT_ARRAY; }
| '[' static_array_pair_list ']' { $$ = $2; Z_TYPE($$.u.constant) = IS_CONSTANT_ARRAY; }
static_scalar_value { zend_do_constant_expression(&$$, $1.u.ast TSRMLS_CC); }
;
static_scalar_value:
@@ -996,15 +995,19 @@ static_scalar_value:
| namespace_name { zend_do_fetch_constant(&$$, NULL, &$1, ZEND_CT, 1 TSRMLS_CC); $$.u.ast = zend_ast_create_constant(&$$.u.constant); }
| T_NAMESPACE T_NS_SEPARATOR namespace_name { $$.op_type = IS_CONST; ZVAL_EMPTY_STRING(&$$.u.constant); zend_do_build_namespace_name(&$$, &$$, &$3 TSRMLS_CC); $3 = $$; zend_do_fetch_constant(&$$, NULL, &$3, ZEND_CT, 0 TSRMLS_CC); $$.u.ast = zend_ast_create_constant(&$$.u.constant); }
| T_NS_SEPARATOR namespace_name { char *tmp = estrndup(Z_STRVAL($2.u.constant), Z_STRLEN($2.u.constant)+1); memcpy(&(tmp[1]), Z_STRVAL($2.u.constant), Z_STRLEN($2.u.constant)+1); tmp[0] = '\\'; efree(Z_STRVAL($2.u.constant)); Z_STRVAL($2.u.constant) = tmp; ++Z_STRLEN($2.u.constant); zend_do_fetch_constant(&$$, NULL, &$2, ZEND_CT, 0 TSRMLS_CC); $$.u.ast = zend_ast_create_constant(&$$.u.constant); }
| T_ARRAY '(' static_array_pair_list ')' { $$ = $3; }
| '[' static_array_pair_list ']' { $$ = $2; }
| static_class_constant { $$.u.ast = zend_ast_create_constant(&$1.u.constant); }
| T_CLASS_C { $$.u.ast = zend_ast_create_constant(&$1.u.constant); }
| static_operation { $$ = $1; }
;
static_operation:
static_scalar_value '+' static_scalar_value { $$.u.ast = zend_ast_create_binary(ZEND_ADD, $1.u.ast, $3.u.ast); }
static_scalar_value '[' static_scalar_value ']' { $$.u.ast = zend_ast_create_binary(ZEND_FETCH_DIM_R, $1.u.ast, $3.u.ast); }
| static_scalar_value '+' static_scalar_value { $$.u.ast = zend_ast_create_binary(ZEND_ADD, $1.u.ast, $3.u.ast); }
| static_scalar_value '-' static_scalar_value { $$.u.ast = zend_ast_create_binary(ZEND_SUB, $1.u.ast, $3.u.ast); }
| static_scalar_value '*' static_scalar_value { $$.u.ast = zend_ast_create_binary(ZEND_MUL, $1.u.ast, $3.u.ast); }
| static_scalar_value T_POW static_scalar_value { $$.u.ast = zend_ast_create_binary(ZEND_POW, $1.u.ast, $3.u.ast); }
| static_scalar_value '/' static_scalar_value { $$.u.ast = zend_ast_create_binary(ZEND_DIV, $1.u.ast, $3.u.ast); }
| static_scalar_value '%' static_scalar_value { $$.u.ast = zend_ast_create_binary(ZEND_MOD, $1.u.ast, $3.u.ast); }
| '!' static_scalar_value { $$.u.ast = zend_ast_create_unary(ZEND_BOOL_NOT, $2.u.ast); }
@@ -1051,8 +1054,8 @@ scalar:
static_array_pair_list:
/* empty */ { $$.op_type = IS_CONST; INIT_PZVAL(&$$.u.constant); array_init(&$$.u.constant); }
| non_empty_static_array_pair_list possible_comma { $$ = $1; }
/* empty */ { $$.op_type = IS_CONST; INIT_PZVAL(&$$.u.constant); array_init(&$$.u.constant); $$.u.ast = zend_ast_create_constant(&$$.u.constant); }
| non_empty_static_array_pair_list possible_comma { zend_ast_dynamic_shrink(&$1.u.ast); $$ = $1; }
;
possible_comma:
@@ -1061,10 +1064,10 @@ possible_comma:
;
non_empty_static_array_pair_list:
non_empty_static_array_pair_list ',' static_scalar T_DOUBLE_ARROW static_scalar { zend_do_add_static_array_element(&$$, &$3, &$5); }
| non_empty_static_array_pair_list ',' static_scalar { zend_do_add_static_array_element(&$$, NULL, &$3); }
| static_scalar T_DOUBLE_ARROW static_scalar { $$.op_type = IS_CONST; INIT_PZVAL(&$$.u.constant); array_init(&$$.u.constant); zend_do_add_static_array_element(&$$, &$1, &$3); }
| static_scalar { $$.op_type = IS_CONST; INIT_PZVAL(&$$.u.constant); array_init(&$$.u.constant); zend_do_add_static_array_element(&$$, NULL, &$1); }
non_empty_static_array_pair_list ',' static_scalar_value T_DOUBLE_ARROW static_scalar_value { zend_ast_dynamic_add(&$$.u.ast, $3.u.ast); zend_ast_dynamic_add(&$$.u.ast, $5.u.ast); }
| non_empty_static_array_pair_list ',' static_scalar_value { zend_ast_dynamic_add(&$$.u.ast, NULL); zend_ast_dynamic_add(&$$.u.ast, $3.u.ast); }
| static_scalar_value T_DOUBLE_ARROW static_scalar_value { $$.u.ast = zend_ast_create_dynamic(ZEND_INIT_ARRAY); zend_ast_dynamic_add(&$$.u.ast, $1.u.ast); zend_ast_dynamic_add(&$$.u.ast, $3.u.ast); }
| static_scalar_value { $$.u.ast = zend_ast_create_dynamic(ZEND_INIT_ARRAY); zend_ast_dynamic_add(&$$.u.ast, NULL); zend_ast_dynamic_add(&$$.u.ast, $1.u.ast); }
;
expr:
@@ -1117,7 +1120,7 @@ array_method_dereference:
method:
{ zend_do_pop_object(&$$ TSRMLS_CC); zend_do_begin_method_call(&$$ TSRMLS_CC); }
function_call_parameter_list { zend_do_end_function_call(&$1, &$$, &$2, 1, 1 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C); }
function_call_parameter_list { zend_do_end_function_call(&$1, &$$, 1, 1 TSRMLS_CC); zend_do_extended_fcall_end(TSRMLS_C); }
;
method_or_not:
+7857 -7857
View File
File diff suppressed because it is too large. Load diff
+15 -15
View File
@@ -1,15 +1,15 @@
/* Generated by re2c 0.13.5 */
#line 3 "Zend/zend_language_scanner_defs.h"
enum YYCONDTYPE {
yycST_IN_SCRIPTING,
yycST_LOOKING_FOR_PROPERTY,
yycST_BACKQUOTE,
yycST_DOUBLE_QUOTES,
yycST_HEREDOC,
yycST_LOOKING_FOR_VARNAME,
yycST_VAR_OFFSET,
yycINITIAL,
yycST_END_HEREDOC,
yycST_NOWDOC,
};
/* Generated by re2c 0.13.5 */
#line 3 "Zend/zend_language_scanner_defs.h"
enum YYCONDTYPE {
yycST_IN_SCRIPTING,
yycST_LOOKING_FOR_PROPERTY,
yycST_BACKQUOTE,
yycST_DOUBLE_QUOTES,
yycST_HEREDOC,
yycST_LOOKING_FOR_VARNAME,
yycST_VAR_OFFSET,
yycINITIAL,
yycST_END_HEREDOC,
yycST_NOWDOC,
};
+35 -3
View File
@@ -137,8 +137,40 @@ ZEND_API HashTable *zend_std_get_gc(zval *object, zval ***table, int *n TSRMLS_D
ZEND_API HashTable *zend_std_get_debug_info(zval *object, int *is_temp TSRMLS_DC) /* {{{ */
{
*is_temp = 0;
return zend_std_get_properties(object TSRMLS_CC);
zend_class_entry *ce = Z_OBJCE_P(object);
zval *retval = NULL;
if (!ce->__debugInfo) {
*is_temp = 0;
return Z_OBJ_HANDLER_P(object, get_properties)
? Z_OBJ_HANDLER_P(object, get_properties)(object TSRMLS_CC)
: NULL;
}
zend_call_method_with_0_params(&object, ce, &ce->__debugInfo, ZEND_DEBUGINFO_FUNC_NAME, &retval);
if (retval && Z_TYPE_P(retval) == IS_ARRAY) {
HashTable *ht = Z_ARRVAL_P(retval);
if (Z_REFCOUNT_P(retval) <= 1) {
*is_temp = 1;
efree(retval);
return ht;
} else {
*is_temp = 0;
zval_ptr_dtor(&retval);
}
return ht;
}
if (retval && Z_TYPE_P(retval) == IS_NULL) {
zval ret;
array_init(&ret);
*is_temp = 1;
zval_ptr_dtor(&retval);
return Z_ARRVAL(ret);
}
zend_error_noreturn(E_ERROR, ZEND_DEBUGINFO_FUNC_NAME "() must return an array");
return NULL; /* Compilers are dumb and don't understand that noreturn means that the function does NOT need a return value... */
}
/* }}} */
@@ -1638,7 +1670,7 @@ ZEND_API zend_object_handlers std_object_handlers = {
zend_std_compare_objects, /* compare_objects */
zend_std_cast_object_tostring, /* cast_object */
NULL, /* count_elements */
NULL, /* get_debug_info */
zend_std_get_debug_info, /* get_debug_info */
zend_std_get_closure, /* get_closure */
zend_std_get_gc, /* get_gc */
NULL, /* do_operation */
+2 -5
View File
@@ -36,8 +36,7 @@ ZEND_API void _zval_dtor_func(zval *zvalue ZEND_FILE_LINE_DC)
CHECK_ZVAL_STRING_REL(zvalue);
str_efree_rel(zvalue->value.str.val);
break;
case IS_ARRAY:
case IS_CONSTANT_ARRAY: {
case IS_ARRAY: {
TSRMLS_FETCH();
if (zvalue->value.ht && (zvalue->value.ht != &EG(symbol_table))) {
@@ -86,7 +85,6 @@ ZEND_API void _zval_internal_dtor(zval *zvalue ZEND_FILE_LINE_DC)
str_free(zvalue->value.str.val);
break;
case IS_ARRAY:
case IS_CONSTANT_ARRAY:
case IS_CONSTANT_AST:
case IS_OBJECT:
case IS_RESOURCE:
@@ -128,8 +126,7 @@ ZEND_API void _zval_copy_ctor_func(zval *zvalue ZEND_FILE_LINE_DC)
zvalue->value.str.val = (char *) estrndup_rel(zvalue->value.str.val, zvalue->value.str.len);
}
break;
case IS_ARRAY:
case IS_CONSTANT_ARRAY: {
case IS_ARRAY: {
zval *tmp;
HashTable *original_ht = zvalue->value.ht;
HashTable *tmp_ht = NULL;
+17 -26
View File
@@ -1081,7 +1081,7 @@ ZEND_VM_HELPER_EX(zend_fetch_var_address_helper, CONST|TMP|VAR|CV, UNUSED|CONST|
FREE_OP1();
break;
case ZEND_FETCH_STATIC:
zval_update_constant(retval, (void*) 1 TSRMLS_CC);
zval_update_constant(retval, 1 TSRMLS_CC);
break;
case ZEND_FETCH_GLOBAL_LOCK:
if (OP1_TYPE == IS_VAR && !free_op1.var) {
@@ -3063,9 +3063,8 @@ ZEND_VM_HANDLER(65, ZEND_SEND_VAL, CONST|TMP, ANY)
SAVE_OPLINE();
if (opline->extended_value == ZEND_DO_FCALL_BY_NAME) {
int arg_num = opline->op2.num + EX(call)->num_additional_args;
if (ARG_MUST_BE_SENT_BY_REF(EX(call)->fbc, arg_num)) {
zend_error_noreturn(E_ERROR, "Cannot pass parameter %d by reference", arg_num);
if (ARG_MUST_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.num)) {
zend_error_noreturn(E_ERROR, "Cannot pass parameter %d by reference", opline->op2.num);
}
}
@@ -3126,7 +3125,6 @@ ZEND_VM_HANDLER(106, ZEND_SEND_VAR_NO_REF, VAR|CV, ANY)
USE_OPLINE
zend_free_op free_op1;
zval *varptr;
int arg_num;
SAVE_OPLINE();
if (opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) { /* Had function_ptr at compile_time */
@@ -3134,8 +3132,7 @@ ZEND_VM_HANDLER(106, ZEND_SEND_VAR_NO_REF, VAR|CV, ANY)
ZEND_VM_DISPATCH_TO_HELPER(zend_send_by_var_helper);
}
} else {
arg_num = opline->op2.num + EX(call)->num_additional_args;
if (!ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, arg_num)) {
if (!ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.num)) {
ZEND_VM_DISPATCH_TO_HELPER(zend_send_by_var_helper);
}
}
@@ -3155,7 +3152,7 @@ ZEND_VM_HANDLER(106, ZEND_SEND_VAR_NO_REF, VAR|CV, ANY)
if ((opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) ?
!(opline->extended_value & ZEND_ARG_SEND_SILENT) :
!ARG_MAY_BE_SENT_BY_REF(EX(call)->fbc, arg_num)) {
!ARG_MAY_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.num)) {
zend_error(E_STRICT, "Only variables should be passed by reference");
}
ALLOC_ZVAL(valptr);
@@ -3193,8 +3190,7 @@ ZEND_VM_HANDLER(67, ZEND_SEND_REF, VAR|CV, ANY)
if (opline->extended_value == ZEND_DO_FCALL_BY_NAME &&
EX(function_state).function->type == ZEND_INTERNAL_FUNCTION) {
int arg_num = opline->op2.num + EX(call)->num_additional_args;
if (!ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, arg_num)) {
if (!ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.num)) {
ZEND_VM_DISPATCH_TO_HELPER(zend_send_by_var_helper);
}
}
@@ -3214,8 +3210,7 @@ ZEND_VM_HANDLER(66, ZEND_SEND_VAR, VAR|CV, ANY)
USE_OPLINE
if (opline->extended_value == ZEND_DO_FCALL_BY_NAME) {
int arg_num = opline->op2.num + EX(call)->num_additional_args;
if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, arg_num)) {
if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.num)) {
ZEND_VM_DISPATCH_TO_HANDLER(ZEND_SEND_REF);
}
}
@@ -3715,8 +3710,6 @@ ZEND_VM_HANDLER(99, ZEND_FETCH_CONSTANT, VAR|CONST|UNUSED, CONST)
retval = &EX_T(opline->result.var).tmp_var;
ZVAL_COPY_VALUE(retval, &c->value);
zval_copy_ctor(retval);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
} else {
/* class constant */
zend_class_entry *ce;
@@ -3727,8 +3720,7 @@ ZEND_VM_HANDLER(99, ZEND_FETCH_CONSTANT, VAR|CONST|UNUSED, CONST)
value = CACHED_PTR(opline->op2.literal->cache_slot);
ZVAL_COPY_VALUE(&EX_T(opline->result.var).tmp_var, *value);
zval_copy_ctor(&EX_T(opline->result.var).tmp_var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
goto constant_fetch_end;
} else if (CACHED_PTR(opline->op1.literal->cache_slot)) {
ce = CACHED_PTR(opline->op1.literal->cache_slot);
} else {
@@ -3746,8 +3738,7 @@ ZEND_VM_HANDLER(99, ZEND_FETCH_CONSTANT, VAR|CONST|UNUSED, CONST)
if ((value = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce)) != NULL) {
ZVAL_COPY_VALUE(&EX_T(opline->result.var).tmp_var, *value);
zval_copy_ctor(&EX_T(opline->result.var).tmp_var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
goto constant_fetch_end;
}
}
@@ -3756,7 +3747,7 @@ ZEND_VM_HANDLER(99, ZEND_FETCH_CONSTANT, VAR|CONST|UNUSED, CONST)
zend_class_entry *old_scope = EG(scope);
EG(scope) = ce;
zval_update_constant(value, (void *) 1 TSRMLS_CC);
zval_update_constant(value, 1 TSRMLS_CC);
EG(scope) = old_scope;
}
if (OP1_TYPE == IS_CONST) {
@@ -3772,10 +3763,13 @@ ZEND_VM_HANDLER(99, ZEND_FETCH_CONSTANT, VAR|CONST|UNUSED, CONST)
} else {
zend_error_noreturn(E_ERROR, "Undefined class constant '%s'", Z_STRVAL_P(opline->op2.zv));
}
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
constant_fetch_end:
if (Z_TYPE(EX_T(opline->result.var).tmp_var) == IS_ARRAY) {
zend_error_noreturn(E_ERROR, "Arrays are not allowed in constants at run-time");
}
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
ZEND_VM_HANDLER(72, ZEND_ADD_ARRAY_ELEMENT, CONST|TMP|VAR|CV, CONST|TMP|VAR|UNUSED|CV)
@@ -5381,11 +5375,8 @@ ZEND_VM_HANDLER(143, ZEND_DECLARE_CONST, CONST, CONST)
zval *tmp_ptr = &tmp;
ZVAL_COPY_VALUE(&tmp, val);
if (Z_TYPE_P(val) == IS_CONSTANT_ARRAY) {
zval_copy_ctor(&tmp);
}
INIT_PZVAL(&tmp);
zval_update_constant(&tmp_ptr, NULL TSRMLS_CC);
zval_update_constant(&tmp_ptr, 0 TSRMLS_CC);
c.value = *tmp_ptr;
} else {
INIT_PZVAL_COPY(&c.value, val);
+52 -68
View File
@@ -2736,9 +2736,8 @@ static int ZEND_FASTCALL ZEND_SEND_VAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_A
SAVE_OPLINE();
if (opline->extended_value == ZEND_DO_FCALL_BY_NAME) {
int arg_num = opline->op2.num + EX(call)->num_additional_args;
if (ARG_MUST_BE_SENT_BY_REF(EX(call)->fbc, arg_num)) {
zend_error_noreturn(E_ERROR, "Cannot pass parameter %d by reference", arg_num);
if (ARG_MUST_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.num)) {
zend_error_noreturn(E_ERROR, "Cannot pass parameter %d by reference", opline->op2.num);
}
}
@@ -3685,7 +3684,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CONST_CONST(int type
break;
case ZEND_FETCH_STATIC:
zval_update_constant(retval, (void*) 1 TSRMLS_CC);
zval_update_constant(retval, 1 TSRMLS_CC);
break;
case ZEND_FETCH_GLOBAL_LOCK:
if (IS_CONST == IS_VAR && !free_op1.var) {
@@ -3972,8 +3971,6 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_CONST_CONST_HANDLER(ZEND_OPCO
retval = &EX_T(opline->result.var).tmp_var;
ZVAL_COPY_VALUE(retval, &c->value);
zval_copy_ctor(retval);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
} else {
/* class constant */
zend_class_entry *ce;
@@ -3984,8 +3981,7 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_CONST_CONST_HANDLER(ZEND_OPCO
value = CACHED_PTR(opline->op2.literal->cache_slot);
ZVAL_COPY_VALUE(&EX_T(opline->result.var).tmp_var, *value);
zval_copy_ctor(&EX_T(opline->result.var).tmp_var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
goto constant_fetch_end;
} else if (CACHED_PTR(opline->op1.literal->cache_slot)) {
ce = CACHED_PTR(opline->op1.literal->cache_slot);
} else {
@@ -4003,8 +3999,7 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_CONST_CONST_HANDLER(ZEND_OPCO
if ((value = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce)) != NULL) {
ZVAL_COPY_VALUE(&EX_T(opline->result.var).tmp_var, *value);
zval_copy_ctor(&EX_T(opline->result.var).tmp_var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
goto constant_fetch_end;
}
}
@@ -4013,7 +4008,7 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_CONST_CONST_HANDLER(ZEND_OPCO
zend_class_entry *old_scope = EG(scope);
EG(scope) = ce;
zval_update_constant(value, (void *) 1 TSRMLS_CC);
zval_update_constant(value, 1 TSRMLS_CC);
EG(scope) = old_scope;
}
if (IS_CONST == IS_CONST) {
@@ -4029,10 +4024,13 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_CONST_CONST_HANDLER(ZEND_OPCO
} else {
zend_error_noreturn(E_ERROR, "Undefined class constant '%s'", Z_STRVAL_P(opline->op2.zv));
}
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
constant_fetch_end:
if (Z_TYPE(EX_T(opline->result.var).tmp_var) == IS_ARRAY) {
zend_error_noreturn(E_ERROR, "Arrays are not allowed in constants at run-time");
}
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -4310,11 +4308,8 @@ static int ZEND_FASTCALL ZEND_DECLARE_CONST_SPEC_CONST_CONST_HANDLER(ZEND_OPCOD
zval *tmp_ptr = &tmp;
ZVAL_COPY_VALUE(&tmp, val);
if (Z_TYPE_P(val) == IS_CONSTANT_ARRAY) {
zval_copy_ctor(&tmp);
}
INIT_PZVAL(&tmp);
zval_update_constant(&tmp_ptr, NULL TSRMLS_CC);
zval_update_constant(&tmp_ptr, 0 TSRMLS_CC);
c.value = *tmp_ptr;
} else {
INIT_PZVAL_COPY(&c.value, val);
@@ -5573,7 +5568,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CONST_VAR(int type,
break;
case ZEND_FETCH_STATIC:
zval_update_constant(retval, (void*) 1 TSRMLS_CC);
zval_update_constant(retval, 1 TSRMLS_CC);
break;
case ZEND_FETCH_GLOBAL_LOCK:
if (IS_CONST == IS_VAR && !free_op1.var) {
@@ -6325,7 +6320,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CONST_UNUSED(int typ
break;
case ZEND_FETCH_STATIC:
zval_update_constant(retval, (void*) 1 TSRMLS_CC);
zval_update_constant(retval, 1 TSRMLS_CC);
break;
case ZEND_FETCH_GLOBAL_LOCK:
if (IS_CONST == IS_VAR && !free_op1.var) {
@@ -8094,9 +8089,8 @@ static int ZEND_FASTCALL ZEND_SEND_VAL_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
SAVE_OPLINE();
if (opline->extended_value == ZEND_DO_FCALL_BY_NAME) {
int arg_num = opline->op2.num + EX(call)->num_additional_args;
if (ARG_MUST_BE_SENT_BY_REF(EX(call)->fbc, arg_num)) {
zend_error_noreturn(E_ERROR, "Cannot pass parameter %d by reference", arg_num);
if (ARG_MUST_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.num)) {
zend_error_noreturn(E_ERROR, "Cannot pass parameter %d by reference", opline->op2.num);
}
}
@@ -9096,7 +9090,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMP_CONST(int type,
zval_dtor(free_op1.var);
break;
case ZEND_FETCH_STATIC:
zval_update_constant(retval, (void*) 1 TSRMLS_CC);
zval_update_constant(retval, 1 TSRMLS_CC);
break;
case ZEND_FETCH_GLOBAL_LOCK:
if (IS_TMP_VAR == IS_VAR && !free_op1.var) {
@@ -10852,7 +10846,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMP_VAR(int type, ZE
zval_dtor(free_op1.var);
break;
case ZEND_FETCH_STATIC:
zval_update_constant(retval, (void*) 1 TSRMLS_CC);
zval_update_constant(retval, 1 TSRMLS_CC);
break;
case ZEND_FETCH_GLOBAL_LOCK:
if (IS_TMP_VAR == IS_VAR && !free_op1.var) {
@@ -11606,7 +11600,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_TMP_UNUSED(int type,
zval_dtor(free_op1.var);
break;
case ZEND_FETCH_STATIC:
zval_update_constant(retval, (void*) 1 TSRMLS_CC);
zval_update_constant(retval, 1 TSRMLS_CC);
break;
case ZEND_FETCH_GLOBAL_LOCK:
if (IS_TMP_VAR == IS_VAR && !free_op1.var) {
@@ -13385,7 +13379,6 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_NO_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HAND
USE_OPLINE
zend_free_op free_op1;
zval *varptr;
int arg_num;
SAVE_OPLINE();
if (opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) { /* Had function_ptr at compile_time */
@@ -13393,8 +13386,7 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_NO_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HAND
return zend_send_by_var_helper_SPEC_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
}
} else {
arg_num = opline->op2.num + EX(call)->num_additional_args;
if (!ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, arg_num)) {
if (!ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.num)) {
return zend_send_by_var_helper_SPEC_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
}
}
@@ -13414,7 +13406,7 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_NO_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HAND
if ((opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) ?
!(opline->extended_value & ZEND_ARG_SEND_SILENT) :
!ARG_MAY_BE_SENT_BY_REF(EX(call)->fbc, arg_num)) {
!ARG_MAY_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.num)) {
zend_error(E_STRICT, "Only variables should be passed by reference");
}
ALLOC_ZVAL(valptr);
@@ -13452,8 +13444,7 @@ static int ZEND_FASTCALL ZEND_SEND_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
if (opline->extended_value == ZEND_DO_FCALL_BY_NAME &&
EX(function_state).function->type == ZEND_INTERNAL_FUNCTION) {
int arg_num = opline->op2.num + EX(call)->num_additional_args;
if (!ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, arg_num)) {
if (!ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.num)) {
return zend_send_by_var_helper_SPEC_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
}
}
@@ -13473,8 +13464,7 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
USE_OPLINE
if (opline->extended_value == ZEND_DO_FCALL_BY_NAME) {
int arg_num = opline->op2.num + EX(call)->num_additional_args;
if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, arg_num)) {
if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.num)) {
return ZEND_SEND_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
}
}
@@ -15030,7 +15020,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_CONST(int type,
zval_ptr_dtor_nogc(&free_op1.var);
break;
case ZEND_FETCH_STATIC:
zval_update_constant(retval, (void*) 1 TSRMLS_CC);
zval_update_constant(retval, 1 TSRMLS_CC);
break;
case ZEND_FETCH_GLOBAL_LOCK:
if (IS_VAR == IS_VAR && !free_op1.var) {
@@ -15930,8 +15920,6 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE
retval = &EX_T(opline->result.var).tmp_var;
ZVAL_COPY_VALUE(retval, &c->value);
zval_copy_ctor(retval);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
} else {
/* class constant */
zend_class_entry *ce;
@@ -15942,8 +15930,7 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE
value = CACHED_PTR(opline->op2.literal->cache_slot);
ZVAL_COPY_VALUE(&EX_T(opline->result.var).tmp_var, *value);
zval_copy_ctor(&EX_T(opline->result.var).tmp_var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
goto constant_fetch_end;
} else if (CACHED_PTR(opline->op1.literal->cache_slot)) {
ce = CACHED_PTR(opline->op1.literal->cache_slot);
} else {
@@ -15961,8 +15948,7 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE
if ((value = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce)) != NULL) {
ZVAL_COPY_VALUE(&EX_T(opline->result.var).tmp_var, *value);
zval_copy_ctor(&EX_T(opline->result.var).tmp_var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
goto constant_fetch_end;
}
}
@@ -15971,7 +15957,7 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE
zend_class_entry *old_scope = EG(scope);
EG(scope) = ce;
zval_update_constant(value, (void *) 1 TSRMLS_CC);
zval_update_constant(value, 1 TSRMLS_CC);
EG(scope) = old_scope;
}
if (IS_VAR == IS_CONST) {
@@ -15987,10 +15973,13 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE
} else {
zend_error_noreturn(E_ERROR, "Undefined class constant '%s'", Z_STRVAL_P(opline->op2.zv));
}
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
constant_fetch_end:
if (Z_TYPE(EX_T(opline->result.var).tmp_var) == IS_ARRAY) {
zend_error_noreturn(E_ERROR, "Arrays are not allowed in constants at run-time");
}
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
static int ZEND_FASTCALL ZEND_ADD_ARRAY_ELEMENT_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -19628,7 +19617,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_VAR(int type, ZE
zval_ptr_dtor_nogc(&free_op1.var);
break;
case ZEND_FETCH_STATIC:
zval_update_constant(retval, (void*) 1 TSRMLS_CC);
zval_update_constant(retval, 1 TSRMLS_CC);
break;
case ZEND_FETCH_GLOBAL_LOCK:
if (IS_VAR == IS_VAR && !free_op1.var) {
@@ -21616,7 +21605,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_VAR_UNUSED(int type,
zval_ptr_dtor_nogc(&free_op1.var);
break;
case ZEND_FETCH_STATIC:
zval_update_constant(retval, (void*) 1 TSRMLS_CC);
zval_update_constant(retval, 1 TSRMLS_CC);
break;
case ZEND_FETCH_GLOBAL_LOCK:
if (IS_VAR == IS_VAR && !free_op1.var) {
@@ -25543,8 +25532,6 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_UNUSED_CONST_HANDLER(ZEND_OPC
retval = &EX_T(opline->result.var).tmp_var;
ZVAL_COPY_VALUE(retval, &c->value);
zval_copy_ctor(retval);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
} else {
/* class constant */
zend_class_entry *ce;
@@ -25555,8 +25542,7 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_UNUSED_CONST_HANDLER(ZEND_OPC
value = CACHED_PTR(opline->op2.literal->cache_slot);
ZVAL_COPY_VALUE(&EX_T(opline->result.var).tmp_var, *value);
zval_copy_ctor(&EX_T(opline->result.var).tmp_var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
goto constant_fetch_end;
} else if (CACHED_PTR(opline->op1.literal->cache_slot)) {
ce = CACHED_PTR(opline->op1.literal->cache_slot);
} else {
@@ -25574,8 +25560,7 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_UNUSED_CONST_HANDLER(ZEND_OPC
if ((value = CACHED_POLYMORPHIC_PTR(opline->op2.literal->cache_slot, ce)) != NULL) {
ZVAL_COPY_VALUE(&EX_T(opline->result.var).tmp_var, *value);
zval_copy_ctor(&EX_T(opline->result.var).tmp_var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
goto constant_fetch_end;
}
}
@@ -25584,7 +25569,7 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_UNUSED_CONST_HANDLER(ZEND_OPC
zend_class_entry *old_scope = EG(scope);
EG(scope) = ce;
zval_update_constant(value, (void *) 1 TSRMLS_CC);
zval_update_constant(value, 1 TSRMLS_CC);
EG(scope) = old_scope;
}
if (IS_UNUSED == IS_CONST) {
@@ -25600,10 +25585,13 @@ static int ZEND_FASTCALL ZEND_FETCH_CONSTANT_SPEC_UNUSED_CONST_HANDLER(ZEND_OPC
} else {
zend_error_noreturn(E_ERROR, "Undefined class constant '%s'", Z_STRVAL_P(opline->op2.zv));
}
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
constant_fetch_end:
if (Z_TYPE(EX_T(opline->result.var).tmp_var) == IS_ARRAY) {
zend_error_noreturn(E_ERROR, "Arrays are not allowed in constants at run-time");
}
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
@@ -31000,7 +30988,6 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_NO_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDL
USE_OPLINE
zval *varptr;
int arg_num;
SAVE_OPLINE();
if (opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) { /* Had function_ptr at compile_time */
@@ -31008,8 +30995,7 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_NO_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDL
return zend_send_by_var_helper_SPEC_CV(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
}
} else {
arg_num = opline->op2.num + EX(call)->num_additional_args;
if (!ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, arg_num)) {
if (!ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.num)) {
return zend_send_by_var_helper_SPEC_CV(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
}
}
@@ -31029,7 +31015,7 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_NO_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDL
if ((opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) ?
!(opline->extended_value & ZEND_ARG_SEND_SILENT) :
!ARG_MAY_BE_SENT_BY_REF(EX(call)->fbc, arg_num)) {
!ARG_MAY_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.num)) {
zend_error(E_STRICT, "Only variables should be passed by reference");
}
ALLOC_ZVAL(valptr);
@@ -31067,8 +31053,7 @@ static int ZEND_FASTCALL ZEND_SEND_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
if (opline->extended_value == ZEND_DO_FCALL_BY_NAME &&
EX(function_state).function->type == ZEND_INTERNAL_FUNCTION) {
int arg_num = opline->op2.num + EX(call)->num_additional_args;
if (!ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, arg_num)) {
if (!ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.num)) {
return zend_send_by_var_helper_SPEC_CV(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
}
}
@@ -31087,8 +31072,7 @@ static int ZEND_FASTCALL ZEND_SEND_VAR_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
USE_OPLINE
if (opline->extended_value == ZEND_DO_FCALL_BY_NAME) {
int arg_num = opline->op2.num + EX(call)->num_additional_args;
if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, arg_num)) {
if (ARG_SHOULD_BE_SENT_BY_REF(EX(call)->fbc, opline->op2.num)) {
return ZEND_SEND_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
}
}
@@ -32498,7 +32482,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CV_CONST(int type, Z
break;
case ZEND_FETCH_STATIC:
zval_update_constant(retval, (void*) 1 TSRMLS_CC);
zval_update_constant(retval, 1 TSRMLS_CC);
break;
case ZEND_FETCH_GLOBAL_LOCK:
if (IS_CV == IS_VAR && !free_op1.var) {
@@ -36722,7 +36706,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CV_VAR(int type, ZEN
break;
case ZEND_FETCH_STATIC:
zval_update_constant(retval, (void*) 1 TSRMLS_CC);
zval_update_constant(retval, 1 TSRMLS_CC);
break;
case ZEND_FETCH_GLOBAL_LOCK:
if (IS_CV == IS_VAR && !free_op1.var) {
@@ -38570,7 +38554,7 @@ static int ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_CV_UNUSED(int type,
break;
case ZEND_FETCH_STATIC:
zval_update_constant(retval, (void*) 1 TSRMLS_CC);
zval_update_constant(retval, 1 TSRMLS_CC);
break;
case ZEND_FETCH_GLOBAL_LOCK:
if (IS_CV == IS_VAR && !free_op1.var) {
+1 -1
View File
@@ -1264,7 +1264,7 @@ function gen_vm($def, $skel) {
out($f, "# pragma warning(once : 6285)\n");
// Suppress (<non-zero constant> || <expression>) warnings on windows
out($f, "# pragma warning(once : 6286)\n");
// Suppress constant with constant comparsion warnings on windows
// Suppress constant with constant comparison warnings on windows
out($f, "# pragma warning(once : 6326)\n");
}
out($f, "#endif\n");
+2 -2
View File
@@ -33,14 +33,14 @@ ac_version=`$PHP_AUTOCONF --version 2>/dev/null|head -n 1|sed -e 's/^[^0-9]*//'
if test -z "$ac_version"; then
echo "buildconf: autoconf not found."
echo " You need autoconf version 2.59 or newer installed"
echo " to build PHP from SVN."
echo " to build PHP from Git."
exit 1
fi
IFS=.; set $ac_version; IFS=' '
if test "$1" = "2" -a "$2" -lt "59" || test "$1" -lt "2"; then
echo "buildconf: autoconf version $ac_version found."
echo " You need autoconf version 2.59 or newer installed"
echo " to build PHP from SVN."
echo " to build PHP from Git."
exit 1
else
echo "buildconf: autoconf version $ac_version (ok)"
+1 -1
View File
@@ -120,7 +120,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
PHP_MAJOR_VERSION=5
PHP_MINOR_VERSION=6
PHP_RELEASE_VERSION=0
PHP_EXTRA_VERSION="alpha2"
PHP_EXTRA_VERSION="beta2"
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`
+3 -2
View File
@@ -31,6 +31,7 @@
#include "ext/standard/file.h"
#include "ext/standard/info.h"
#include "ext/standard/php_string.h"
#include "main/php_network.h"
/* for fileno() */
#include <stdio.h>
@@ -245,7 +246,7 @@ PHP_BZ2_API php_stream *_php_stream_bz2open(php_stream_wrapper *wrapper,
stream = php_stream_open_wrapper(path, mode, options | STREAM_WILL_CAST, opened_path);
if (stream) {
int fd;
php_socket_t fd;
if (SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD, (void **) &fd, REPORT_ERRORS)) {
bz_file = BZ2_bzdopen(fd, mode);
}
@@ -394,7 +395,7 @@ static PHP_FUNCTION(bzopen)
NULL);
} else if (Z_TYPE_PP(file) == IS_RESOURCE) {
/* If it is a resource, than its a stream resource */
int fd;
php_socket_t fd;
int stream_mode_len;
php_stream_from_zval(stream, file);
+6
View File
@@ -46,7 +46,13 @@ PHP_COM_DOTNET_API OLECHAR *php_com_string_to_olestring(char *string, uint strin
if (string_len > 0) {
olestring = (OLECHAR*)safe_emalloc(string_len, sizeof(OLECHAR), 0);
/* XXX if that's a real multibyte string, olestring is obviously allocated excessively.
This should be fixed by reallocating the olestring, but as emalloc is used, that doesn't
matter much. */
ok = MultiByteToWideChar(codepage, flags, string, string_len, olestring, string_len);
if (ok > 0 && ok < string_len) {
olestring[ok] = '\0';
}
} else {
ok = FALSE;
olestring = (OLECHAR*)emalloc(sizeof(OLECHAR));
+6 -2
View File
@@ -154,13 +154,17 @@ PHP_COM_DOTNET_API void php_com_variant_from_zval(VARIANT *v, zval *z, int codep
case IS_STRING:
V_VT(v) = VT_BSTR;
olestring = php_com_string_to_olestring(Z_STRVAL_P(z), Z_STRLEN_P(z), codepage TSRMLS_CC);
V_BSTR(v) = SysAllocStringByteLen((char*)olestring, Z_STRLEN_P(z) * sizeof(OLECHAR));
if (CP_UTF8 == codepage) {
V_BSTR(v) = SysAllocStringByteLen((char*)olestring, wcslen(olestring) * sizeof(OLECHAR));
} else {
V_BSTR(v) = SysAllocStringByteLen((char*)olestring, Z_STRLEN_P(z) * sizeof(OLECHAR));
}
efree(olestring);
break;
case IS_RESOURCE:
case IS_CONSTANT:
case IS_CONSTANT_ARRAY:
case IS_CONSTANT_AST:
default:
V_VT(v) = VT_NULL;
break;
+42
View File
@@ -0,0 +1,42 @@
--TEST--
Bug #66431 Special Character via COM Interface (CP_UTF8), Scripting.FileSystemObject
--SKIPIF--
<?php
if (!extension_loaded("com_dotnet")){ echo "skip COM/.Net support not present"; }
?>
--FILE--
<?php
$text= "Xin chào cộng đồng PHP";
$fpath = str_replace("/", "\\", dirname(__FILE__) . "/bug66431.txt");
$fso = new COM("Scripting.FileSystemObject");
$fh = $fso->OpenTextFile($fpath, 2, true);
$fh->Write($text);
$fh->Close();
$check_text = file_get_contents($fpath);
$result = ($check_text == $text);
var_dump($result);
if (!$result) {
echo "Expected: '$check_text'\n";
echo "Have: '$text'\n";
}
?>
===DONE===
--CLEAN--
<?php
$fpath = str_replace("/", "\\", dirname(__FILE__) . "/bug66431.txt");
if (file_exists($fpath)) {
unlink($fpath);
}
?>
--EXPECT--
bool(true)
===DONE===
+60
View File
@@ -0,0 +1,60 @@
--TEST--
Bug #66431 Special Character via COM Interface (CP_UTF8), Application.Word
--SKIPIF--
<?php
if (!extension_loaded("com_dotnet")){ echo "skip COM/.Net support not present"; }
try {
new COM("word.application", NULL, CP_UTF8);
} catch (Exception $e) {
die('skip ' . $e->getMessage();
}
?>
--FILE--
<?php
$text= "Xin chào cộng đồng PHP";
$fpath = str_replace("/", "\\", dirname(__FILE__) . "/bug66431.docx");
com_load_typelib('Word.Application');
$Wrd = new COM("word.application", NULL, CP_UTF8);
$Wrd->Documents->Add();
$Wrd->Selection->TypeText($text);
$Wrd->ActiveDocument->SaveAs($fpath);
$Wrd->ActiveDocument->Close(false);
$Wrd->Application->Quit();
unset($Wrd);
$Wrd = new COM("word.application", NULL, CP_UTF8);
$Wrd->Documents->Open($fpath, NULL, false);
$check_text = $Wrd->ActiveDocument->Range($Wrd->ActiveDocument->Sentences(1)->Start, $Wrd->ActiveDocument->Sentences(1)->End)->Text;
$Wrd->ActiveDocument->Close(false);
$Wrd->Application->Quit();
unset($Wrd);
/* trim the returned text as we'll get windows eol from a word doc. */
$result = (trim($check_text) == $text);
var_dump($result);
if (!$result) {
echo "Expected: '$check_text'\n";
echo "Have: '$text'\n";
}
?>
===DONE===
--CLEAN--
<?php
$fpath = str_replace("/", "\\", dirname(__FILE__) . "/bug66431.docx");
if (file_exists($fpath)) {
unlink($fpath);
}
?>
--EXPECT--
bool(true)
===DONE===
+133 -124
View File
@@ -165,50 +165,62 @@ static void _php_curl_close(zend_rsrc_list_entry *rsrc TSRMLS_DC);
# define php_curl_ret(__ret) RETVAL_FALSE; return;
#endif
static int php_curl_option_url(php_curl *ch, const char *url, const int len TSRMLS_DC) /* {{{ */
static int php_curl_option_str(php_curl *ch, long option, const char *str, const int len, zend_bool make_copy TSRMLS_DC)
{
CURLcode error = CURLE_OK;
#if LIBCURL_VERSION_NUM < 0x071100
char *copystr = NULL;
#if LIBCURL_VERSION_NUM >= 0x071100
if (make_copy) {
#endif
char *copystr;
/* Strings passed to libcurl as 'char *' arguments, are copied by the library since 7.17.0 */
copystr = estrndup(str, len);
error = curl_easy_setopt(ch->cp, option, copystr);
zend_llist_add_element(&ch->to_free->str, &copystr);
#if LIBCURL_VERSION_NUM >= 0x071100
} else {
error = curl_easy_setopt(ch->cp, option, str);
}
#endif
SAVE_CURL_ERROR(ch, error)
return error == CURLE_OK ? SUCCESS : FAILURE;
}
static int php_curl_option_url(php_curl *ch, const char *url, const int len TSRMLS_DC) /* {{{ */
{
/* Disable file:// if open_basedir are used */
if (PG(open_basedir) && *PG(open_basedir)) {
#if LIBCURL_VERSION_NUM >= 0x071304
error = curl_easy_setopt(ch->cp, CURLOPT_PROTOCOLS, CURLPROTO_ALL & ~CURLPROTO_FILE);
curl_easy_setopt(ch->cp, CURLOPT_PROTOCOLS, CURLPROTO_ALL & ~CURLPROTO_FILE);
#else
php_url *uri;
if (!(uri = php_url_parse_ex(url, len))) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid URL '%s'", url);
return 0;
return FAILURE;
}
if (uri->scheme && !strncasecmp("file", uri->scheme, sizeof("file"))) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Protocol 'file' disabled in cURL");
php_url_free(uri);
return 0;
return FAILURE;
}
php_url_free(uri);
#endif
}
/* Strings passed to libcurl as 'char *' arguments, are copied by the library... NOTE: before 7.17.0 strings were not copied. */
#if LIBCURL_VERSION_NUM >= 0x071100
error = curl_easy_setopt(ch->cp, CURLOPT_URL, url);
#else
copystr = estrndup(url, len);
error = curl_easy_setopt(ch->cp, CURLOPT_URL, copystr);
zend_llist_add_element(&ch->to_free->str, &copystr);
#endif
return (error == CURLE_OK ? 1 : 0);
return php_curl_option_str(ch, CURLOPT_URL, url, len, 0 TSRMLS_CC);
}
/* }}} */
int _php_curl_verify_handlers(php_curl *ch, int reporterror TSRMLS_DC) /* {{{ */
void _php_curl_verify_handlers(php_curl *ch, int reporterror TSRMLS_DC) /* {{{ */
{
php_stream *stream;
if (!ch || !ch->handlers) {
return 0;
return;
}
if (ch->handlers->std_err) {
@@ -265,7 +277,7 @@ int _php_curl_verify_handlers(php_curl *ch, int reporterror TSRMLS_DC) /* {{{ */
curl_easy_setopt(ch->cp, CURLOPT_FILE, (void *) ch);
}
}
return 1;
return ;
}
/* }}} */
@@ -621,7 +633,6 @@ PHP_MINIT_FUNCTION(curl)
REGISTER_CURL_CONSTANT(CURLOPT_BUFFERSIZE);
REGISTER_CURL_CONSTANT(CURLOPT_CAINFO);
REGISTER_CURL_CONSTANT(CURLOPT_CAPATH);
REGISTER_CURL_CONSTANT(CURLOPT_CLOSEPOLICY);
REGISTER_CURL_CONSTANT(CURLOPT_CONNECTTIMEOUT);
REGISTER_CURL_CONSTANT(CURLOPT_COOKIE);
REGISTER_CURL_CONSTANT(CURLOPT_COOKIEFILE);
@@ -711,13 +722,6 @@ PHP_MINIT_FUNCTION(curl)
REGISTER_CURL_CONSTANT(CURLOPT_WRITEFUNCTION);
REGISTER_CURL_CONSTANT(CURLOPT_WRITEHEADER);
/* Constants effecting the way CURLOPT_CLOSEPOLICY works */
REGISTER_CURL_CONSTANT(CURLCLOSEPOLICY_CALLBACK);
REGISTER_CURL_CONSTANT(CURLCLOSEPOLICY_LEAST_RECENTLY_USED);
REGISTER_CURL_CONSTANT(CURLCLOSEPOLICY_LEAST_TRAFFIC);
REGISTER_CURL_CONSTANT(CURLCLOSEPOLICY_OLDEST);
REGISTER_CURL_CONSTANT(CURLCLOSEPOLICY_SLOWEST);
/* */
REGISTER_CURL_CONSTANT(CURLE_ABORTED_BY_CALLBACK);
REGISTER_CURL_CONSTANT(CURLE_BAD_CALLING_ORDER);
@@ -1895,7 +1899,10 @@ static void _php_curl_set_default_options(php_curl *ch)
curl_easy_setopt(ch->cp, CURLOPT_DNS_CACHE_TIMEOUT, 120);
curl_easy_setopt(ch->cp, CURLOPT_MAXREDIRS, 20); /* prevent infinite redirects */
cainfo = INI_STR("curl.cainfo");
cainfo = INI_STR("openssl.cafile");
if (!(cainfo && strlen(cainfo) > 0)) {
cainfo = INI_STR("curl.cainfo");
}
if (cainfo && strlen(cainfo) > 0) {
curl_easy_setopt(ch->cp, CURLOPT_CAINFO, cainfo);
}
@@ -1941,7 +1948,7 @@ PHP_FUNCTION(curl_init)
_php_curl_set_default_options(ch);
if (url) {
if (!php_curl_option_url(ch, url, url_len TSRMLS_CC)) {
if (php_curl_option_url(ch, url, url_len TSRMLS_CC) == FAILURE) {
_php_curl_close_ex(ch TSRMLS_CC);
RETURN_FALSE;
}
@@ -2058,7 +2065,7 @@ PHP_FUNCTION(curl_copy_handle)
}
/* }}} */
static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *return_value TSRMLS_DC) /* {{{ */
static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue TSRMLS_DC) /* {{{ */
{
CURLcode error=CURLE_OK;
@@ -2076,7 +2083,6 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu
}
case CURLOPT_AUTOREFERER:
case CURLOPT_BUFFERSIZE:
case CURLOPT_CLOSEPOLICY:
case CURLOPT_CONNECTTIMEOUT:
case CURLOPT_COOKIESESSION:
case CURLOPT_CRLF:
@@ -2225,7 +2231,6 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu
if ((option == CURLOPT_PROTOCOLS || option == CURLOPT_REDIR_PROTOCOLS) &&
(PG(open_basedir) && *PG(open_basedir)) && (Z_LVAL_PP(zvalue) & CURLPROTO_FILE)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "CURLPROTO_FILE cannot be activated when an open_basedir is set");
RETVAL_FALSE;
return 1;
}
#endif
@@ -2240,14 +2245,10 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu
case CURLOPT_CAINFO:
case CURLOPT_CAPATH:
case CURLOPT_COOKIE:
case CURLOPT_CUSTOMREQUEST:
case CURLOPT_EGDSOCKET:
case CURLOPT_FTPPORT:
case CURLOPT_INTERFACE:
case CURLOPT_PRIVATE:
case CURLOPT_PROXY:
case CURLOPT_PROXYUSERPWD:
case CURLOPT_RANGE:
case CURLOPT_REFERER:
case CURLOPT_SSLCERTTYPE:
case CURLOPT_SSLENGINE:
@@ -2256,23 +2257,14 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu
case CURLOPT_SSLKEYPASSWD:
case CURLOPT_SSLKEYTYPE:
case CURLOPT_SSL_CIPHER_LIST:
case CURLOPT_URL:
case CURLOPT_USERAGENT:
case CURLOPT_USERPWD:
#if LIBCURL_VERSION_NUM >= 0x070d00 /* Available since 7.13.0 */
case CURLOPT_FTP_ACCOUNT:
#endif
#if LIBCURL_VERSION_NUM >= 0x070e01 /* Available since 7.14.1 */
case CURLOPT_COOKIELIST:
#endif
#if LIBCURL_VERSION_NUM >= 0x070f05 /* Available since 7.15.5 */
case CURLOPT_FTP_ALTERNATIVE_TO_USER:
#endif
#if LIBCURL_VERSION_NUM >= 0x071004 /* Available since 7.16.4 */
case CURLOPT_KRBLEVEL:
#else
case CURLOPT_KRB4LEVEL:
#endif
#if LIBCURL_VERSION_NUM >= 0x071101 /* Available since 7.17.1 */
case CURLOPT_SSH_HOST_PUBLIC_KEY_MD5:
#endif
@@ -2287,7 +2279,6 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu
#endif
#if LIBCURL_VERSION_NUM >= 0x071400 /* Available since 7.20.0 */
case CURLOPT_MAIL_FROM:
case CURLOPT_RTSP_SESSION_ID:
case CURLOPT_RTSP_STREAM_URI:
case CURLOPT_RTSP_TRANSPORT:
#endif
@@ -2309,32 +2300,44 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu
#endif
{
convert_to_string_ex(zvalue);
if (option == CURLOPT_URL) {
if (!php_curl_option_url(ch, Z_STRVAL_PP(zvalue), Z_STRLEN_PP(zvalue) TSRMLS_CC)) {
RETVAL_FALSE;
return 1;
}
} else {
if (option == CURLOPT_PRIVATE) {
char *copystr;
#if LIBCURL_VERSION_NUM < 0x071100
string_copy:
return php_curl_option_str(ch, option, Z_STRVAL_PP(zvalue), Z_STRLEN_PP(zvalue), 0 TSRMLS_CC);
}
/* Curl nullable string options */
case CURLOPT_CUSTOMREQUEST:
case CURLOPT_FTPPORT:
case CURLOPT_RANGE:
#if LIBCURL_VERSION_NUM >= 0x070d00 /* Available since 7.13.0 */
case CURLOPT_FTP_ACCOUNT:
#endif
copystr = estrndup(Z_STRVAL_PP(zvalue), Z_STRLEN_PP(zvalue));
error = curl_easy_setopt(ch->cp, option, copystr);
zend_llist_add_element(&ch->to_free->str, &copystr);
} else {
#if LIBCURL_VERSION_NUM >= 0x071100
/* Strings passed to libcurl as ’char *’ arguments, are copied by the library... NOTE: before 7.17.0 strings were not copied. */
error = curl_easy_setopt(ch->cp, option, Z_STRVAL_PP(zvalue));
#if LIBCURL_VERSION_NUM >= 0x071400 /* Available since 7.20.0 */
case CURLOPT_RTSP_SESSION_ID:
#endif
#if LIBCURL_VERSION_NUM >= 0x071004 /* Available since 7.16.4 */
case CURLOPT_KRBLEVEL:
#else
goto string_copy;
case CURLOPT_KRB4LEVEL:
#endif
}
{
if (Z_TYPE_PP(zvalue) == IS_NULL) {
error = curl_easy_setopt(ch->cp, option, NULL);
} else {
convert_to_string_ex(zvalue);
return php_curl_option_str(ch, option, Z_STRVAL_PP(zvalue), Z_STRLEN_PP(zvalue), 0 TSRMLS_CC);
}
break;
}
/* Curl private option */
case CURLOPT_PRIVATE:
convert_to_string_ex(zvalue);
return php_curl_option_str(ch, option, Z_STRVAL_PP(zvalue), Z_STRLEN_PP(zvalue), 1 TSRMLS_CC);
/* Curl url option */
case CURLOPT_URL:
convert_to_string_ex(zvalue);
return php_curl_option_url(ch, Z_STRVAL_PP(zvalue), Z_STRLEN_PP(zvalue) TSRMLS_CC);
/* Curl file handle options */
case CURLOPT_FILE:
case CURLOPT_INFILE:
@@ -2342,28 +2345,34 @@ string_copy:
case CURLOPT_WRITEHEADER: {
FILE *fp = NULL;
int type;
void * what;
void *what = NULL;
what = zend_fetch_resource(zvalue TSRMLS_CC, -1, "File-Handle", &type, 1, php_file_le_stream(), php_file_le_pstream());
if (!what) {
RETVAL_FALSE;
return 1;
}
if (Z_TYPE_PP(zvalue) != IS_NULL) {
what = zend_fetch_resource(zvalue TSRMLS_CC, -1, "File-Handle", &type, 1, php_file_le_stream(), php_file_le_pstream());
if (!what) {
return FAILURE;
}
if (FAILURE == php_stream_cast((php_stream *) what, PHP_STREAM_AS_STDIO, (void *) &fp, REPORT_ERRORS)) {
RETVAL_FALSE;
return 1;
}
if (FAILURE == php_stream_cast((php_stream *) what, PHP_STREAM_AS_STDIO, (void *) &fp, REPORT_ERRORS)) {
return FAILURE;
}
if (!fp) {
RETVAL_FALSE;
return 1;
if (!fp) {
return FAILURE;
}
}
error = CURLE_OK;
switch (option) {
case CURLOPT_FILE:
if (((php_stream *) what)->mode[0] != 'r' || ((php_stream *) what)->mode[1] == '+') {
if (!what) {
if (ch->handlers->write->stream) {
Z_DELREF_P(ch->handlers->write->stream);
ch->handlers->write->stream = NULL;
}
ch->handlers->write->fp = NULL;
ch->handlers->write->method = PHP_CURL_STDOUT;
} else if (((php_stream *) what)->mode[0] != 'r' || ((php_stream *) what)->mode[1] == '+') {
if (ch->handlers->write->stream) {
Z_DELREF_P(ch->handlers->write->stream);
}
@@ -2373,12 +2382,18 @@ string_copy:
ch->handlers->write->stream = *zvalue;
} else {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "the provided file handle is not writable");
RETVAL_FALSE;
return 1;
return FAILURE;
}
break;
case CURLOPT_WRITEHEADER:
if (((php_stream *) what)->mode[0] != 'r' || ((php_stream *) what)->mode[1] == '+') {
if (!what) {
if (ch->handlers->write_header->stream) {
Z_DELREF_P(ch->handlers->write_header->stream);
ch->handlers->write_header->stream = NULL;
}
ch->handlers->write_header->fp = NULL;
ch->handlers->write_header->method = PHP_CURL_IGNORE;
} else if (((php_stream *) what)->mode[0] != 'r' || ((php_stream *) what)->mode[1] == '+') {
if (ch->handlers->write_header->stream) {
Z_DELREF_P(ch->handlers->write_header->stream);
}
@@ -2388,21 +2403,34 @@ string_copy:
ch->handlers->write_header->stream = *zvalue;
} else {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "the provided file handle is not writable");
RETVAL_FALSE;
return 1;
return FAILURE;
}
break;
case CURLOPT_INFILE:
if (ch->handlers->read->stream) {
Z_DELREF_P(ch->handlers->read->stream);
if (!what) {
if (ch->handlers->read->stream) {
Z_DELREF_P(ch->handlers->read->stream);
ch->handlers->read->stream = NULL;
}
ch->handlers->read->fp = NULL;
ch->handlers->read->fd = 0;
} else {
if (ch->handlers->read->stream) {
Z_DELREF_P(ch->handlers->read->stream);
}
Z_ADDREF_PP(zvalue);
ch->handlers->read->fp = fp;
ch->handlers->read->fd = Z_LVAL_PP(zvalue);
ch->handlers->read->stream = *zvalue;
}
Z_ADDREF_PP(zvalue);
ch->handlers->read->fp = fp;
ch->handlers->read->fd = Z_LVAL_PP(zvalue);
ch->handlers->read->stream = *zvalue;
break;
case CURLOPT_STDERR:
if (((php_stream *) what)->mode[0] != 'r' || ((php_stream *) what)->mode[1] == '+') {
if (!what) {
if (ch->handlers->std_err) {
zval_ptr_dtor(&ch->handlers->std_err);
ch->handlers->std_err = NULL;
}
} else if (((php_stream *) what)->mode[0] != 'r' || ((php_stream *) what)->mode[1] == '+') {
if (ch->handlers->std_err) {
zval_ptr_dtor(&ch->handlers->std_err);
}
@@ -2410,8 +2438,7 @@ string_copy:
ch->handlers->std_err = *zvalue;
} else {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "the provided file handle is not writable");
RETVAL_FALSE;
return 1;
return FAILURE;
}
/* break omitted intentionally */
default:
@@ -2473,8 +2500,7 @@ string_copy:
#endif
}
php_error_docref(NULL TSRMLS_CC, E_WARNING, "You must pass either an object or an array with the %s argument", name);
RETVAL_FALSE;
return 1;
return FAILURE;
}
for (zend_hash_internal_pointer_reset(ph);
@@ -2487,7 +2513,6 @@ string_copy:
slist = curl_slist_append(slist, Z_STRVAL_PP(current));
if (!slist) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not build curl_slist");
RETVAL_FALSE;
return 1;
}
}
@@ -2508,8 +2533,7 @@ string_copy:
if (PG(open_basedir) && *PG(open_basedir)) {
if (Z_LVAL_PP(zvalue) != 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "CURLOPT_FOLLOWLOCATION cannot be activated when an open_basedir is set");
RETVAL_FALSE;
return 1;
return FAILURE;
}
}
#endif
@@ -2536,8 +2560,7 @@ string_copy:
postfields = HASH_OF(*zvalue);
if (!postfields) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't get HashTable in CURLOPT_POSTFIELDS");
RETVAL_FALSE;
return 1;
return FAILURE;
}
for (zend_hash_internal_pointer_reset(postfields);
@@ -2573,7 +2596,6 @@ string_copy:
postval = Z_STRVAL_P(prop);
if (php_check_open_basedir(postval TSRMLS_CC)) {
RETVAL_FALSE;
return 1;
}
@@ -2622,8 +2644,7 @@ string_copy:
}
/* open_basedir check */
if (php_check_open_basedir(postval TSRMLS_CC)) {
RETVAL_FALSE;
return 1;
return FAILURE;
}
error = curl_formadd(&first, &last,
CURLFORM_COPYNAME, string_key,
@@ -2654,8 +2675,7 @@ string_copy:
SAVE_CURL_ERROR(ch, error);
if (error != CURLE_OK) {
RETVAL_FALSE;
return 1;
return FAILURE;
}
if (Z_REFCOUNT_P(ch->clone) <= 1) {
@@ -2677,7 +2697,7 @@ string_copy:
post = estrndup(Z_STRVAL_PP(zvalue), Z_STRLEN_PP(zvalue));
zend_llist_add_element(&ch->to_free->str, &post);
error = curl_easy_setopt(ch->cp, CURLOPT_POSTFIELDS, post);
curl_easy_setopt(ch->cp, CURLOPT_POSTFIELDS, post);
error = curl_easy_setopt(ch->cp, CURLOPT_POSTFIELDSIZE, Z_STRLEN_PP(zvalue));
#endif
}
@@ -2775,26 +2795,13 @@ string_copy:
case CURLOPT_SSH_KNOWNHOSTS:
#endif
{
#if LIBCURL_VERSION_NUM < 0x071100
char *copystr = NULL;
#endif
convert_to_string_ex(zvalue);
if (Z_STRLEN_PP(zvalue) && php_check_open_basedir(Z_STRVAL_PP(zvalue) TSRMLS_CC)) {
RETVAL_FALSE;
return 1;
return FAILURE;
}
#if LIBCURL_VERSION_NUM >= 0x071100
error = curl_easy_setopt(ch->cp, option, Z_STRVAL_PP(zvalue));
#else
copystr = estrndup(Z_STRVAL_PP(zvalue), Z_STRLEN_PP(zvalue));
error = curl_easy_setopt(ch->cp, option, copystr);
zend_llist_add_element(&ch->to_free->str, &copystr);
#endif
break;
return php_curl_option_str(ch, option, Z_STRVAL_PP(zvalue), Z_STRLEN_PP(zvalue), 0 TSRMLS_CC);
}
case CURLINFO_HEADER_OUT:
@@ -2839,9 +2846,9 @@ string_copy:
SAVE_CURL_ERROR(ch, error);
if (error != CURLE_OK) {
return 1;
return FAILURE;
} else {
return 0;
return SUCCESS;
}
}
/* }}} */
@@ -2865,7 +2872,7 @@ PHP_FUNCTION(curl_setopt)
RETURN_FALSE;
}
if (!_php_curl_setopt(ch, options, zvalue, return_value TSRMLS_CC)) {
if (_php_curl_setopt(ch, options, zvalue TSRMLS_CC) == SUCCESS) {
RETURN_TRUE;
} else {
RETURN_FALSE;
@@ -2896,7 +2903,7 @@ PHP_FUNCTION(curl_setopt_array)
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Array keys must be CURLOPT constants or equivalent integer values");
RETURN_FALSE;
}
if (_php_curl_setopt(ch, (long) option, entry, return_value TSRMLS_CC)) {
if (_php_curl_setopt(ch, (long) option, entry TSRMLS_CC) == FAILURE) {
RETURN_FALSE;
}
zend_hash_move_forward_ex(Z_ARRVAL_P(arr), &pos);
@@ -3161,6 +3168,7 @@ PHP_FUNCTION(curl_getinfo)
}
break;
}
#if LIBCURL_VERSION_NUM >= 0x070c03 /* Available since 7.12.3 */
case CURLINFO_SLIST:
{
struct curl_slist *slist;
@@ -3176,6 +3184,7 @@ PHP_FUNCTION(curl_getinfo)
}
break;
}
#endif
default:
RETURN_FALSE;
}
+2
View File
@@ -248,6 +248,8 @@ PHP_FUNCTION(curl_multi_getcontent)
smart_str_0(&ch->handlers->write->buf);
RETURN_STRINGL(ch->handlers->write->buf.c, ch->handlers->write->buf.len, 1);
}
RETURN_EMPTY_STRING();
}
/* }}} */
+1 -1
View File
@@ -198,7 +198,7 @@ typedef struct {
void _php_curl_cleanup_handle(php_curl *);
void _php_curl_multi_cleanup_list(void *data);
int _php_curl_verify_handlers(php_curl *ch, int reporterror TSRMLS_DC);
void _php_curl_verify_handlers(php_curl *ch, int reporterror TSRMLS_DC);
void curlfile_register_class(TSRMLS_D);
PHP_CURL_API extern zend_class_entry *curl_CURLFile_class;
+1 -2
View File
@@ -81,8 +81,7 @@ Ok for CURLOPT_WRITEHEADER
Warning: curl_multi_exec(): CURLOPT_FILE resource has gone away, resetting to default in %sbug48203_multi.php on line 36
Warning: curl_multi_exec(): CURLOPT_FILE resource has gone away, resetting to default in %sbug48203_multi.php on line 36
%A
Ok for CURLOPT_FILE
%AOk for CURLOPT_FILE
Warning: curl_multi_exec(): CURLOPT_INFILE resource has gone away, resetting to default in %sbug48203_multi.php on line 36
+6 -13
View File
@@ -53,20 +53,13 @@ foreach($options_to_check as $option) {
}
?>
===DONE===
--CLEAN--
<?php @unlink(dirname(__FILE__) . '/bug54798.tmp'); ?>
--EXPECTF--
Warning: curl_exec(): CURLOPT_STDERR resource has gone away, resetting to stderr in %sbug54798.php on line %d
* About to connect() %a
* Closing connection #%d
Ok for CURLOPT_STDERR
Warning: curl_exec(): CURLOPT_WRITEHEADER resource has gone away, resetting to default in %sbug54798.php on line 24
Ok for CURLOPT_WRITEHEADER
Warning: curl_exec(): CURLOPT_FILE resource has gone away, resetting to default in %sbug54798.php on line 24
%a
Ok for CURLOPT_FILE
Warning: curl_exec(): CURLOPT_INFILE resource has gone away, resetting to default in %sbug54798.php on line %d
Ok for CURLOPT_INFILE
%aOk for CURLOPT_STDERR
%aOk for CURLOPT_WRITEHEADER
%aOk for CURLOPT_FILE
%aOk for CURLOPT_INFILE
===DONE===
+35
View File
@@ -0,0 +1,35 @@
--TEST--
Bug #64267 (CURLOPT_INFILE doesn't allow reset)
--SKIPIF--
<?php
extension_loaded("curl") or die("skip need ext/curl");
?>
--FILE--
<?php
echo "TEST\n";
$c = curl_init("http://google.com");
$f = fopen(__FILE__,"r");
var_dump(curl_setopt_array($c, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_UPLOAD => true,
CURLOPT_INFILE => $f,
CURLOPT_INFILESIZE => filesize(__FILE__)
]));
fclose($f);
var_dump(curl_setopt_array($c, [
CURLOPT_UPLOAD => false,
CURLOPT_INFILE => null,
CURLOPT_INFILESIZE => 0,
]));
curl_exec($c);
var_dump(curl_getinfo($c, CURLINFO_RESPONSE_CODE));
?>
===DONE===
--EXPECTF--
TEST
bool(true)
bool(true)
int(30%d)
===DONE===
+31
View File
@@ -0,0 +1,31 @@
--TEST--
Bug #66109 (Option CURLOPT_CUSTOMREQUEST can't be reset to default.)
--SKIPIF--
<?php
if (!extension_loaded("curl")) {
exit("skip curl extension not loaded");
}
if (false === getenv('PHP_CURL_HTTP_REMOTE_SERVER')) {
exit("skip PHP_CURL_HTTP_REMOTE_SERVER env variable is not defined");
}
?>
--FILE--
<?php
$host = getenv('PHP_CURL_HTTP_REMOTE_SERVER');
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "{$host}/get.php?test=method");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
var_dump(curl_exec($ch));
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, NULL);
var_dump(curl_exec($ch));
curl_close($ch);
?>
--EXPECTF--
string(6) "DELETE"
string(3) "GET"
+1 -1
View File
@@ -25,5 +25,5 @@ curl_close($ch);
?>
--EXPECTF--
%unicode|string%(%d) "%r(Couldn't resolve host|Could not resolve host:)%r %Swww.%s"
%s resolve%s
int(6)
+1 -1
View File
@@ -26,5 +26,5 @@ curl_close($ch);
?>
--EXPECTF--
%unicode|string%(%d) "%r(Couldn't resolve proxy|Could not resolve proxy:|Could not resolve host:)%r %s"
%unicode|string%(%d) "%r(Couldn't resolve proxy|Could not resolve proxy:|Could not resolve host:|Could not resolve:)%r %s"
int(5)
@@ -33,6 +33,5 @@ echo "Closed correctly\n";
<?php
unlink(dirname(__FILE__) . '/curl_file_deleted_before_curl_close.tmp');
?>
--EXPECTF--
* Closing connection #%d
--EXPECT--
Closed correctly
+3
View File
@@ -36,5 +36,8 @@ unlink($test_file);
unlink($log_file);
?>
===DONE===
--EXPECT--
testtest
===DONE===
-1
View File
@@ -48,5 +48,4 @@ curl_close($ch);
*** Testing curl_setopt with CURLOPT_STDERR
string(%d) "%S"
string(%d) "%S"
* Closing connection #%d
+3
View File
@@ -31,6 +31,9 @@
echo $_FILES['file']['name'] . '|' . $_FILES['file']['type'];
}
break;
case 'method':
echo $_SERVER['REQUEST_METHOD'];
break;
default:
echo "Hello World!\n";
echo "Hello World!";
+467 -448
View File
File diff suppressed because it is too large. Load diff
+11 -12
View File
@@ -28,7 +28,7 @@ static int month_tab[12] = { 0, 31, 59, 90, 120, 151, 181, 212, 24
static int days_in_month_leap[13] = { 31, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
static int days_in_month[13] = { 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
static int do_range_limit(timelib_sll start, timelib_sll end, timelib_sll adj, timelib_sll *a, timelib_sll *b)
static void do_range_limit(timelib_sll start, timelib_sll end, timelib_sll adj, timelib_sll *a, timelib_sll *b)
{
if (*a < start) {
*b -= (start - *a - 1) / adj + 1;
@@ -38,7 +38,6 @@ static int do_range_limit(timelib_sll start, timelib_sll end, timelib_sll adj, t
*b += *a / adj;
*a -= adj * (*a / adj);
}
return 0;
}
static void inc_month(timelib_sll *y, timelib_sll *m)
@@ -170,24 +169,24 @@ static void do_adjust_for_weekday(timelib_time* time)
void timelib_do_rel_normalize(timelib_time *base, timelib_rel_time *rt)
{
do {} while (do_range_limit(0, 60, 60, &rt->s, &rt->i));
do {} while (do_range_limit(0, 60, 60, &rt->i, &rt->h));
do {} while (do_range_limit(0, 24, 24, &rt->h, &rt->d));
do {} while (do_range_limit(0, 12, 12, &rt->m, &rt->y));
do_range_limit(0, 60, 60, &rt->s, &rt->i);
do_range_limit(0, 60, 60, &rt->i, &rt->h);
do_range_limit(0, 24, 24, &rt->h, &rt->d);
do_range_limit(0, 12, 12, &rt->m, &rt->y);
do_range_limit_days_relative(&base->y, &base->m, &rt->y, &rt->m, &rt->d, rt->invert);
do {} while (do_range_limit(0, 12, 12, &rt->m, &rt->y));
do_range_limit(0, 12, 12, &rt->m, &rt->y);
}
void timelib_do_normalize(timelib_time* time)
{
if (time->s != TIMELIB_UNSET) do {} while (do_range_limit(0, 60, 60, &time->s, &time->i));
if (time->s != TIMELIB_UNSET) do {} while (do_range_limit(0, 60, 60, &time->i, &time->h));
if (time->s != TIMELIB_UNSET) do {} while (do_range_limit(0, 24, 24, &time->h, &time->d));
do {} while (do_range_limit(1, 13, 12, &time->m, &time->y));
if (time->s != TIMELIB_UNSET) do_range_limit(0, 60, 60, &time->s, &time->i);
if (time->s != TIMELIB_UNSET) do_range_limit(0, 60, 60, &time->i, &time->h);
if (time->s != TIMELIB_UNSET) do_range_limit(0, 24, 24, &time->h, &time->d);
do_range_limit(1, 13, 12, &time->m, &time->y);
do {} while (do_range_limit_days(&time->y, &time->m, &time->d));
do {} while (do_range_limit(1, 13, 12, &time->m, &time->y));
do_range_limit(1, 13, 12, &time->m, &time->y);
}
static void do_adjust_relative(timelib_time* time)
+40 -1
View File
@@ -299,6 +299,10 @@ ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO(arginfo_date_method_timestamp_get, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_date_method_create_from_mutable, 0, 0, 1)
ZEND_ARG_INFO(0, DateTime)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_timezone_open, 0, 0, 1)
ZEND_ARG_INFO(0, timezone)
ZEND_END_ARG_INFO()
@@ -495,6 +499,7 @@ const zend_function_entry date_funcs_immutable[] = {
PHP_ME(DateTimeImmutable, setDate, arginfo_date_method_date_set, 0)
PHP_ME(DateTimeImmutable, setISODate, arginfo_date_method_isodate_set, 0)
PHP_ME(DateTimeImmutable, setTimestamp, arginfo_date_method_timestamp_set, 0)
PHP_ME(DateTimeImmutable, createFromMutable, arginfo_date_method_create_from_mutable, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
PHP_FE_END
};
@@ -2724,7 +2729,9 @@ PHP_METHOD(DateTime, __construct)
zend_replace_error_handling(EH_THROW, NULL, &error_handling TSRMLS_CC);
if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sO!", &time_str, &time_str_len, &timezone_object, date_ce_timezone)) {
php_date_initialize(zend_object_store_get_object(getThis() TSRMLS_CC), time_str, time_str_len, NULL, timezone_object, 1 TSRMLS_CC);
if (!php_date_initialize(zend_object_store_get_object(getThis() TSRMLS_CC), time_str, time_str_len, NULL, timezone_object, 1 TSRMLS_CC)) {
ZVAL_NULL(getThis());
}
}
zend_restore_error_handling(&error_handling TSRMLS_CC);
}
@@ -2748,6 +2755,34 @@ PHP_METHOD(DateTimeImmutable, __construct)
}
/* }}} */
/* {{{ proto DateTimeImmutable::createFromMutable(DateTimeZone object)
Creates new DateTimeImmutable object from an existing mutable DateTime object.
*/
PHP_METHOD(DateTimeImmutable, createFromMutable)
{
zval *datetime_object = NULL;
php_date_obj *new_obj = NULL;
php_date_obj *old_obj = NULL;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O!", &datetime_object, date_ce_date) == FAILURE) {
return;
}
php_date_instantiate(date_ce_immutable, return_value TSRMLS_CC);
old_obj = (php_date_obj *) zend_object_store_get_object(datetime_object TSRMLS_CC);
new_obj = (php_date_obj *) zend_object_store_get_object(return_value TSRMLS_CC);
new_obj->time = timelib_time_ctor();
*new_obj->time = *old_obj->time;
if (old_obj->time->tz_abbr) {
new_obj->time->tz_abbr = strdup(old_obj->time->tz_abbr);
}
if (old_obj->time->tz_info) {
new_obj->time->tz_info = old_obj->time->tz_info;
}
}
/* }}} */
static int php_date_initialize_from_hash(zval **return_value, php_date_obj **dateobj, HashTable *myht TSRMLS_DC)
{
zval **z_date = NULL;
@@ -2781,6 +2816,10 @@ static int php_date_initialize_from_hash(zval **return_value, php_date_obj **dat
tzi = php_date_parse_tzfile(Z_STRVAL_PP(z_timezone), DATE_TIMEZONEDB TSRMLS_CC);
if (tzi == NULL) {
return 0;
}
ALLOC_INIT_ZVAL(tmp_obj);
tzobj = zend_object_store_get_object(php_date_instantiate(date_ce_timezone, tmp_obj TSRMLS_CC) TSRMLS_CC);
tzobj->type = TIMELIB_ZONETYPE_ID;
+1
View File
@@ -82,6 +82,7 @@ PHP_METHOD(DateTimeImmutable, setTime);
PHP_METHOD(DateTimeImmutable, setDate);
PHP_METHOD(DateTimeImmutable, setISODate);
PHP_METHOD(DateTimeImmutable, setTimestamp);
PHP_METHOD(DateTimeImmutable, createFromMutable);
PHP_METHOD(DateTimeZone, __construct);
PHP_METHOD(DateTimeZone, __wakeup);
@@ -0,0 +1,26 @@
--TEST--
Tests for DateTimeImmutable::createFromMutable.
--INI--
date.timezone=Europe/London
--FILE--
<?php
$current = "2014-03-02 16:24:08";
$i = DateTimeImmutable::createFromMutable( date_create( $current ) );
var_dump( $i );
$i = DateTimeImmutable::createFromMutable( date_create_immutable( $current ) );
var_dump( $i );
?>
--EXPECTF--
object(DateTimeImmutable)#%d (3) {
["date"]=>
string(19) "2014-03-02 16:24:08"
["timezone_type"]=>
int(3)
["timezone"]=>
string(13) "Europe/London"
}
Warning: DateTimeImmutable::createFromMutable() expects parameter 1 to be DateTime, object given in %stests%eDateTimeImmutable_createFromMutable.php on line %d
NULL
+11
View File
@@ -0,0 +1,11 @@
--TEST--
Test for bug #66721: __wakeup of DateTime segfaults when invalid object data is supplied
--CREDITS--
Boro Sitnikovski <buritomath@yahoo.com>
--FILE--
<?php
$y = 'O:8:"DateTime":3:{s:4:"date";s:19:"2014-02-15 02:00:51";s:13:"timezone_type";i:3;s:8:"timezone";s:10:"1234567890";}';
var_dump(unserialize($y));
?>
--EXPECTF--
Fatal error: Invalid serialization data for DateTime object in %s on line %d
+27
View File
@@ -0,0 +1,27 @@
--TEST--
Bug #67118 php-cgi crashes regularly on IIS 7
--INI--
date.timezone=Europe/Berlin
--FILE--
<?php
class mydt extends datetime
{
public function __construct($time = 'now', $tz = NULL, $format = NULL)
{
if (!empty($tz) && !is_object($tz)) {
$tz = new DateTimeZone($tz);
}
@parent::__construct($time, $tz);
}
};
new mydt("Funktionsansvarig rådgivning och juridik", "UTC");
--EXPECTF--
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (Funktionsansvarig rådgivning och juridik) at position 0 (F): The timezone could not be found in the database' in %sbug67118.php:%d
Stack trace:
#0 %sbug67118.php(%d): DateTime->__construct('Funktionsansvar...', Object(DateTimeZone))
#1 %sbug67118.php(%d): mydt->__construct('Funktionsansvar...', 'UTC')
#2 {main}
thrown in %sbug67118.php on line %d
+2 -2
View File
@@ -57,14 +57,14 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_dba_popen, 0, 0, 2)
ZEND_ARG_INFO(0, path)
ZEND_ARG_INFO(0, mode)
ZEND_ARG_INFO(0, handlername)
ZEND_ARG_INFO(0, ...)
ZEND_ARG_VARIADIC_INFO(0, handler_parameters)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_dba_open, 0, 0, 2)
ZEND_ARG_INFO(0, path)
ZEND_ARG_INFO(0, mode)
ZEND_ARG_INFO(0, handlername)
ZEND_ARG_INFO(0, ...)
ZEND_ARG_VARIADIC_INFO(0, handler_parameters)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO(arginfo_dba_close, 0)
+6
View File
@@ -1509,6 +1509,12 @@ char *_dom_get_valid_file_path(char *source, char *resolved_path, int resolved_p
if (uri->scheme != NULL) {
/* absolute file uris - libxml only supports localhost or empty host */
#ifdef PHP_WIN32
if (strncasecmp(source, "file://",7) == 0 && ':' == source[8]) {
isFileUri = 1;
source += 7;
} else
#endif
if (strncasecmp(source, "file:///",8) == 0) {
isFileUri = 1;
#ifdef PHP_WIN32
+25 -11
View File
@@ -188,8 +188,7 @@ int dom_documenttype_internal_subset_read(dom_object *obj, zval **retval TSRMLS_
{
xmlDtdPtr dtdptr;
xmlDtd *intsubset;
xmlOutputBuffer *buff = NULL;
xmlDtdPtr intsubset;
dtdptr = (xmlDtdPtr) dom_object_get_node(obj);
@@ -200,22 +199,37 @@ int dom_documenttype_internal_subset_read(dom_object *obj, zval **retval TSRMLS_
ALLOC_ZVAL(*retval);
if (dtdptr->doc != NULL && ((intsubset = dtdptr->doc->intSubset) != NULL)) {
buff = xmlAllocOutputBuffer(NULL);
if (buff != NULL) {
xmlNodeDumpOutput (buff, NULL, (xmlNodePtr) intsubset, 0, 0, NULL);
xmlOutputBufferFlush(buff);
if (dtdptr->doc != NULL && ((intsubset = xmlGetIntSubset(dtdptr->doc)) != NULL) && intsubset->children != NULL) {
smart_str ret_buf = {0};
xmlNodePtr cur = intsubset->children;
while (cur != NULL) {
xmlOutputBuffer *buff = xmlAllocOutputBuffer(NULL);
if (buff != NULL) {
xmlNodeDumpOutput (buff, NULL, cur, 0, 0, NULL);
xmlOutputBufferFlush(buff);
#ifdef LIBXML2_NEW_BUFFER
ZVAL_STRINGL(*retval, xmlOutputBufferGetContent(buff), xmlOutputBufferGetSize(buff), 1);
smart_str_appendl(&ret_buf, xmlOutputBufferGetContent(buff), xmlOutputBufferGetSize(buff));
#else
ZVAL_STRINGL(*retval, buff->buffer->content, buff->buffer->use, 1);
smart_str_appendl(&ret_buf, buff->buffer->content, buff->buffer->use);
#endif
(void)xmlOutputBufferClose(buff);
(void)xmlOutputBufferClose(buff);
}
cur = cur->next;
}
if (ret_buf.len) {
ZVAL_STRINGL(*retval, ret_buf.c, ret_buf.len, 1);
smart_str_free(&ret_buf);
return SUCCESS;
}
}
ZVAL_EMPTY_STRING(*retval);
ZVAL_NULL(*retval);
return SUCCESS;
+2 -2
View File
@@ -43,6 +43,6 @@ print 'notation: '.$notation->nodeName."\n";
publicId: -//OASIS//DTD DocBook XML//EN
systemId: docbookx.dtd
name: chapter
internalSubset: <!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML//EN" "docbookx.dtd">
internalSubset:
entity: logo
notation: gif
notation: gif
+43
View File
@@ -0,0 +1,43 @@
--TEST--
Bug #67081 DOMDocumentType->internalSubset returns entire DOCTYPE tag, not only the subset
--SKIPIF--
<?php
require_once('skipif.inc');
?>
--FILE--
<?php
$domDocument = new DOMDocument();
$domDocument->load(dirname(__FILE__) . DIRECTORY_SEPARATOR . "bug67081_0.xml");
var_dump($domDocument->doctype->internalSubset);
$domDocument = new DOMDocument();
$domDocument->load(dirname(__FILE__) . DIRECTORY_SEPARATOR . "bug67081_1.xml");
var_dump($domDocument->doctype->internalSubset);
$domDocument = new DOMDocument();
$domDocument->load(dirname(__FILE__) . DIRECTORY_SEPARATOR . "bug67081_2.xml");
var_dump($domDocument->doctype->internalSubset);
$domDocument = new DOMDocument();
$domDocument->load(dirname(__FILE__) . DIRECTORY_SEPARATOR . "dom.xml");
var_dump($domDocument->doctype->internalSubset);
?>
===DONE===
--EXPECT--
string(19) "<!ELEMENT a EMPTY>
"
string(38) "<!ELEMENT a EMPTY>
<!ELEMENT b EMPTY>
"
NULL
string(277) "<!ENTITY % incent SYSTEM "dom.ent">
<!ENTITY amp "&#38;#38;">
<!ENTITY gt "&#62;">
<!ENTITY % coreattrs "title CDATA #IMPLIED">
<!ENTITY % attrs "%coreattrs;">
<!ATTLIST foo bar CDATA #IMPLIED>
<!ELEMENT foo (#PCDATA)>
<!ELEMENT root (foo)+>
<!ATTLIST th title CDATA #IMPLIED>
"
===DONE===
+6
View File
@@ -0,0 +1,6 @@
<?xml version="1.0"?>
<!DOCTYPE a [
<!ELEMENT a EMPTY>
]>
<a></a>
+7
View File
@@ -0,0 +1,7 @@
<?xml version="1.0"?>
<!DOCTYPE a [
<!ELEMENT a EMPTY>
<!ELEMENT b EMPTY>
]>
<a></a>
+5
View File
@@ -0,0 +1,5 @@
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<a></a>
+35
View File
@@ -13,6 +13,41 @@ if test "$PHP_FILEINFO" != "no"; then
libmagic/is_tar.c libmagic/magic.c libmagic/print.c \
libmagic/readcdf.c libmagic/readelf.c libmagic/softmagic.c"
AC_MSG_CHECKING([for strcasestr])
AC_TRY_RUN([
#include <string.h>
#include <strings.h>
#include <stdlib.h>
int main(void)
{
char *s0, *s1, *ret;
s0 = (char *) malloc(42);
s1 = (char *) malloc(8);
memset(s0, 'X', 42);
s0[24] = 'Y';
s0[26] = 'Z';
s0[41] = '\0';
memset(s1, 'x', 8);
s1[0] = 'y';
s1[2] = 'Z';
s1[7] = '\0';
ret = strcasestr(s0, s1);
return !(NULL != ret);
}
],[
dnl using the platform implementation
AC_MSG_RESULT(yes)
],[
AC_MSG_RESULT(no)
AC_MSG_NOTICE(using libmagic strcasestr implementation)
libmagic_sources="$libmagic_sources libmagic/strcasestr.c"
])
PHP_NEW_EXTENSION(fileinfo, fileinfo.c $libmagic_sources, $ext_shared,,-I@ext_srcdir@/libmagic)
PHP_ADD_BUILD_DIR($ext_builddir/libmagic)
+70882 -58544
View File
File diff suppressed because it is too large. Load diff
+6 -4
View File
@@ -269,9 +269,15 @@ ZEND_GET_MODULE(fileinfo)
*/
PHP_MINFO_FUNCTION(fileinfo)
{
char magic_ver[5];
(void)snprintf(magic_ver, 4, "%d", magic_version());
magic_ver[4] = '\0';
php_info_print_table_start();
php_info_print_table_row(2, "fileinfo support", "enabled");
php_info_print_table_row(2, "version", PHP_FILEINFO_VERSION);
php_info_print_table_row(2, "libmagic", magic_ver);
php_info_print_table_end();
}
/* }}} */
@@ -315,11 +321,7 @@ PHP_FUNCTION(finfo_open)
file = NULL;
} else if (file && *file) { /* user specified file, perform open_basedir checks */
#if PHP_API_VERSION < 20100412
if ((PG(safe_mode) && (!php_checkuid(file, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || php_check_open_basedir(file TSRMLS_CC)) {
#else
if (php_check_open_basedir(file TSRMLS_CC)) {
#endif
FILEINFO_DESTROY_OBJECT(object);
RETURN_FALSE;
}
File diff suppressed because it is too large. Load diff
+65 -62
View File
@@ -34,7 +34,7 @@
#include "file.h"
#ifndef lint
FILE_RCSID("@(#)$File: apprentice.c,v 1.191 2013/02/26 21:02:48 christos Exp $")
FILE_RCSID("@(#)$File: apprentice.c,v 1.196 2013/11/19 21:01:12 christos Exp $")
#endif /* lint */
#include "magic.h"
@@ -94,6 +94,12 @@ struct magic_entry {
uint32_t max_count;
};
struct magic_entry_set {
struct magic_entry *me;
uint32_t count;
uint32_t max;
};
struct magic_map {
void *p;
size_t len;
@@ -139,7 +145,6 @@ private int parse_strength(struct magic_set *, struct magic_entry *, const char
private int parse_apple(struct magic_set *, struct magic_entry *, const char *);
private size_t maxmagic[MAGIC_SETS] = { 0 };
private size_t magicsize = sizeof(struct magic);
private const char usg_hdr[] = "cont\toffset\ttype\topcode\tmask\tvalue\tdesc";
@@ -179,7 +184,7 @@ static const struct type_tbl_s type_tbl[] = {
{ XX("invalid"), FILE_INVALID, FILE_FMT_NONE },
{ XX("byte"), FILE_BYTE, FILE_FMT_NUM },
{ XX("short"), FILE_SHORT, FILE_FMT_NUM },
{ XX("default"), FILE_DEFAULT, FILE_FMT_STR },
{ XX("default"), FILE_DEFAULT, FILE_FMT_NONE },
{ XX("long"), FILE_LONG, FILE_FMT_NUM },
{ XX("string"), FILE_STRING, FILE_FMT_STR },
{ XX("date"), FILE_DATE, FILE_FMT_STR },
@@ -223,6 +228,7 @@ static const struct type_tbl_s type_tbl[] = {
{ XX("beqwdate"), FILE_BEQWDATE, FILE_FMT_STR },
{ XX("name"), FILE_NAME, FILE_FMT_NONE },
{ XX("use"), FILE_USE, FILE_FMT_NONE },
{ XX("clear"), FILE_CLEAR, FILE_FMT_NONE },
{ XX_NULL, FILE_INVALID, FILE_FMT_NONE },
};
@@ -493,12 +499,14 @@ apprentice_unmap(struct magic_map *map)
if (map == NULL)
return;
if (map->p != php_magic_database) {
int j;
for (j = 0; j < MAGIC_SETS; j++) {
if (map->magic[j])
efree(map->magic[j]);
}
if (map->p != NULL) {
if (map->p == NULL) {
int j;
for (j = 0; j < MAGIC_SETS; j++) {
if (map->magic[j]) {
efree(map->magic[j]);
}
}
} else {
efree(map->p);
}
}
@@ -541,6 +549,9 @@ file_apprentice(struct magic_set *ms, const char *fn, int action)
char *p, *mfn;
int file_err, errs = -1;
size_t i;
file_reset(ms);
/* XXX disabling default magic loading so the compiled in data is used */
#if 0
if ((fn = magic_getpath(fn, action)) == NULL)
@@ -605,6 +616,10 @@ file_apprentice(struct magic_set *ms, const char *fn, int action)
return -1;
}
#if 0
/*
* Always leave the database loaded
*/
if (action == FILE_LOAD)
return 0;
@@ -612,8 +627,10 @@ file_apprentice(struct magic_set *ms, const char *fn, int action)
mlist_free(ms->mlist[i]);
ms->mlist[i] = NULL;
}
#endif
switch (action) {
case FILE_LOAD:
case FILE_COMPILE:
case FILE_CHECK:
case FILE_LIST:
@@ -906,24 +923,24 @@ set_test_type(struct magic *mstart, struct magic *m)
private int
addentry(struct magic_set *ms, struct magic_entry *me,
struct magic_entry **mentry, uint32_t *mentrycount)
struct magic_entry_set *mset)
{
size_t i = me->mp->type == FILE_NAME ? 1 : 0;
if (mentrycount[i] == maxmagic[i]) {
if (mset[i].count == mset[i].max) {
struct magic_entry *mp;
maxmagic[i] += ALLOC_INCR;
mset[i].max += ALLOC_INCR;
if ((mp = CAST(struct magic_entry *,
erealloc(mentry[i], sizeof(*mp) * maxmagic[i]))) ==
erealloc(mset[i].me, sizeof(*mp) * mset[i].max))) ==
NULL) {
file_oomem(ms, sizeof(*mp) * maxmagic[i]);
file_oomem(ms, sizeof(*mp) * mset[i].max);
return -1;
}
(void)memset(&mp[mentrycount[i]], 0, sizeof(*mp) *
(void)memset(&mp[mset[i].count], 0, sizeof(*mp) *
ALLOC_INCR);
mentry[i] = mp;
mset[i].me = mp;
}
mentry[i][mentrycount[i]++] = *me;
mset[i].me[mset[i].count++] = *me;
memset(me, 0, sizeof(*me));
return 0;
}
@@ -933,7 +950,7 @@ addentry(struct magic_set *ms, struct magic_entry *me,
*/
private void
load_1(struct magic_set *ms, int action, const char *fn, int *errs,
struct magic_entry **mentry, uint32_t *mentrycount)
struct magic_entry_set *mset)
{
char buffer[BUFSIZ + 1];
char *line = NULL;
@@ -946,11 +963,7 @@ load_1(struct magic_set *ms, int action, const char *fn, int *errs,
TSRMLS_FETCH();
ms->file = fn;
#if PHP_API_VERSION < 20100412
stream = php_stream_open_wrapper((char *)fn, "rb", REPORT_ERRORS|ENFORCE_SAFE_MODE, NULL);
#else
stream = php_stream_open_wrapper((char *)fn, "rb", REPORT_ERRORS, NULL);
#endif
if (stream == NULL) {
if (errno != ENOENT)
@@ -1010,16 +1023,16 @@ load_1(struct magic_set *ms, int action, const char *fn, int *errs,
case 0:
continue;
case 1:
(void)addentry(ms, &me, mentry, mentrycount);
(void)addentry(ms, &me, mset);
goto again;
default:
(*errs)++;
break;
break;
}
}
}
}
if (me.mp)
(void)addentry(ms, &me, mentry, mentrycount);
(void)addentry(ms, &me, mset);
php_stream_close(stream);
}
@@ -1128,22 +1141,24 @@ magic_entry_free(struct magic_entry *me, uint32_t nme)
private struct magic_map *
apprentice_load(struct magic_set *ms, const char *fn, int action)
{
int errs = 0;
struct magic_entry *mentry[MAGIC_SETS] = { NULL };
uint32_t mentrycount[MAGIC_SETS] = { 0 };
int errs = 0;
uint32_t i, j;
size_t files = 0, maxfiles = 0;
char **filearr = NULL;
struct stat st;
struct magic_map *map;
struct magic_entry_set mset[MAGIC_SETS];
php_stream *dir;
php_stream_dirent d;
TSRMLS_FETCH();
memset(mset, 0, sizeof(mset));
ms->flags |= MAGIC_CHECK; /* Enable checks for parsed files */
if ((map = CAST(struct magic_map *, ecalloc(1, sizeof(*map)))) == NULL) {
if ((map = CAST(struct magic_map *, ecalloc(1, sizeof(*map)))) == NULL)
{
file_oomem(ms, sizeof(*map));
return NULL;
}
@@ -1152,16 +1167,6 @@ apprentice_load(struct magic_set *ms, const char *fn, int action)
if (action == FILE_CHECK)
(void)fprintf(stderr, "%s\n", usg_hdr);
{
/* XXX the maxmagic has to be reset each time we load some new magic file.
Where file commando is used it's not essential as the CLI process
ends, multiple loading within the same process wouldn't work. */
int k;
for (k = 0; k < MAGIC_SETS; k++) {
maxmagic[k] = 0;
}
}
/* load directory or file */
/* FIXME: Read file names and sort them to prevent
non-determinism. See Debian bug #488562. */
@@ -1192,6 +1197,7 @@ apprentice_load(struct magic_set *ms, const char *fn, int action)
if ((filearr = CAST(char **,
erealloc(filearr, mlen))) == NULL) {
file_oomem(ms, mlen);
efree(mfn);
php_stream_closedir(dir);
errs++;
goto out;
@@ -1202,36 +1208,35 @@ apprentice_load(struct magic_set *ms, const char *fn, int action)
php_stream_closedir(dir);
qsort(filearr, files, sizeof(*filearr), cmpstrp);
for (i = 0; i < files; i++) {
load_1(ms, action, filearr[i], &errs, mentry,
mentrycount);
load_1(ms, action, filearr[i], &errs, mset);
efree(filearr[i]);
}
efree(filearr);
} else
load_1(ms, action, fn, &errs, mentry, mentrycount);
load_1(ms, action, fn, &errs, mset);
if (errs)
goto out;
for (j = 0; j < MAGIC_SETS; j++) {
/* Set types of tests */
for (i = 0; i < mentrycount[j]; ) {
if (mentry[j][i].mp->cont_level != 0) {
for (i = 0; i < mset[j].count; ) {
if (mset[j].me[i].mp->cont_level != 0) {
i++;
continue;
}
i = set_text_binary(ms, mentry[j], mentrycount[j], i);
i = set_text_binary(ms, mset[j].me, mset[j].count, i);
}
qsort(mentry[j], mentrycount[j], sizeof(*mentry[j]),
qsort(mset[j].me, mset[j].count, sizeof(*mset[j].me),
apprentice_sort);
/*
* Make sure that any level 0 "default" line is last
* (if one exists).
*/
set_last_default(ms, mentry[j], mentrycount[j]);
set_last_default(ms, mset[j].me, mset[j].count);
/* coalesce per file arrays into a single one */
if (coalesce_entries(ms, mentry[j], mentrycount[j],
if (coalesce_entries(ms, mset[j].me, mset[j].count,
&map->magic[j], &map->nmagic[j]) == -1) {
errs++;
goto out;
@@ -1240,7 +1245,7 @@ apprentice_load(struct magic_set *ms, const char *fn, int action)
out:
for (j = 0; j < MAGIC_SETS; j++)
magic_entry_free(mentry[j], mentrycount[j]);
magic_entry_free(mset[j].me, mset[j].count);
if (errs) {
for (j = 0; j < MAGIC_SETS; j++) {
@@ -1318,6 +1323,7 @@ file_signextend(struct magic_set *ms, struct magic *m, uint64_t v)
case FILE_INDIRECT:
case FILE_NAME:
case FILE_USE:
case FILE_CLEAR:
break;
default:
if (ms->flags & MAGIC_CHECK)
@@ -1735,10 +1741,10 @@ parse(struct magic_set *ms, struct magic_entry *me, const char *line,
if (m->type == FILE_INVALID) {
if (ms->flags & MAGIC_CHECK)
file_magwarn(ms, "type `%s' invalid", l);
if (me->mp) {
/*if (me->mp) {
efree(me->mp);
me->mp = NULL;
}
}*/
return -1;
}
@@ -1969,6 +1975,11 @@ parse_strength(struct magic_set *ms, struct magic_entry *me, const char *line)
m->factor_op, m->factor);
return -1;
}
if (m->type == FILE_NAME) {
file_magwarn(ms, "%s: Strength setting is not supported in "
"\"name\" magic entries", m->value.s);
return -1;
}
EATAB;
switch (*l) {
case FILE_FACTOR_OP_NONE:
@@ -2624,11 +2635,7 @@ apprentice_map(struct magic_set *ms, const char *fn)
if (dbname == NULL)
goto error;
#if PHP_API_VERSION < 20100412
stream = php_stream_open_wrapper((char *)fn, "rb", REPORT_ERRORS|ENFORCE_SAFE_MODE, NULL);
#else
stream = php_stream_open_wrapper((char *)fn, "rb", REPORT_ERRORS, NULL);
#endif
if (!stream) {
goto error;
@@ -2761,12 +2768,8 @@ apprentice_compile(struct magic_set *ms, struct magic_map *map, const char *fn)
if (dbname == NULL)
goto out;
/* wb+ == O_WRONLY|O_CREAT|O_TRUNC|O_BINARY */
#if PHP_API_VERSION < 20100412
stream = php_stream_open_wrapper((char *)fn, "wb+", REPORT_ERRORS|ENFORCE_SAFE_MODE, NULL);
#else
/* wb+ == O_WRONLY|O_CREAT|O_TRUNC|O_BINARY */
stream = php_stream_open_wrapper((char *)fn, "wb+", REPORT_ERRORS, NULL);
#endif
if (!stream) {
file_error(ms, errno, "cannot open `%s'", dbname);
+3 -3
View File
@@ -35,7 +35,7 @@
#include "file.h"
#ifndef lint
FILE_RCSID("@(#)$File: ascmagic.c,v 1.85 2012/08/09 16:33:15 christos Exp $")
FILE_RCSID("@(#)$File: ascmagic.c,v 1.88 2014/02/12 23:20:53 christos Exp $")
#endif /* lint */
#include "magic.h"
@@ -72,7 +72,7 @@ file_ascmagic(struct magic_set *ms, const unsigned char *buf, size_t nbytes,
int text)
{
unichar *ubuf = NULL;
size_t ulen;
size_t ulen = 0;
int rv = 1;
const char *code = NULL;
@@ -147,7 +147,7 @@ file_ascmagic_with_encoding(struct magic_set *ms, const unsigned char *buf,
== NULL)
goto done;
if ((rv = file_softmagic(ms, utf8_buf,
(size_t)(utf8_end - utf8_buf), TEXTTEST, text)) == 0)
(size_t)(utf8_end - utf8_buf), 0, TEXTTEST, text)) == 0)
rv = -1;
}
Loaded 100 of 609 files, more files were not shown because too many files have changed in this diff. Show more