Commit Graph

8531 Commits

Author SHA1 Message Date
Dmitry Stogov
fa7008bb24 Fixed resource destruction 2014-05-08 02:48:31 +04:00
Dmitry Stogov
cd4b4dfc4d Merge branch 'master' into refactoring2
Conflicts:
	Zend/zend_hash.c
	ext/date/php_date.c
2014-05-05 13:02:43 +04:00
Xinchen Hui
72f46a34b8 Refactor zlib (all tests pass) 2014-05-05 15:52:09 +08:00
Xinchen Hui
cd00ea9993 Port iconv (all tests passes) 2014-05-05 13:58:23 +08:00
Anatol Belski
149568f4da Merge branch 'PHP-5.6'
* PHP-5.6:
  fixed ZEND_DEBUG usage
2014-05-05 00:51:40 +02:00
Anatol Belski
0d5121a3c7 fixed ZEND_DEBUG usage 2014-05-05 00:50:51 +02:00
Xinchen Hui
d8651fbe1c Make they are in the same style of Z_ISREF 2014-05-03 16:08:58 +08:00
Dmitry Stogov
17d027ed47 Split IS_BOOL into IS_FALSE and IS_TRUE 2014-04-30 18:32:42 +04:00
Nikita Popov
7c93a7e078 Fix leak I introduced 2014-04-26 11:26:37 +02:00
Nikita Popov
dd419d24ca Replace more convert_to_* calls 2014-04-25 23:21:05 +02:00
Nikita Popov
b1b7939b0f Move more code to use zval_get_string 2014-04-25 23:21:04 +02:00
Dmitry Stogov
f9927a6c97 Merge mainstream 'master' branch into refactoring
During merge I had to revert:
	Nikita's patch for php_splice() (it probably needs to be applyed again)
	Bob Weinand's patches related to constant expression handling (we need to review them carefully)
	I also reverted all our attempts to support sapi/phpdbg (we didn't test it anyway)

Conflicts:
	Zend/zend.h
	Zend/zend_API.c
	Zend/zend_ast.c
	Zend/zend_compile.c
	Zend/zend_compile.h
	Zend/zend_constants.c
	Zend/zend_exceptions.c
	Zend/zend_execute.c
	Zend/zend_execute.h
	Zend/zend_execute_API.c
	Zend/zend_hash.c
	Zend/zend_highlight.c
	Zend/zend_language_parser.y
	Zend/zend_language_scanner.c
	Zend/zend_language_scanner_defs.h
	Zend/zend_variables.c
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
	ext/date/php_date.c
	ext/dom/documenttype.c
	ext/hash/hash.c
	ext/iconv/iconv.c
	ext/mbstring/tests/zend_multibyte-10.phpt
	ext/mbstring/tests/zend_multibyte-11.phpt
	ext/mbstring/tests/zend_multibyte-12.phpt
	ext/mysql/php_mysql.c
	ext/mysqli/mysqli.c
	ext/mysqlnd/mysqlnd_reverse_api.c
	ext/mysqlnd/php_mysqlnd.c
	ext/opcache/ZendAccelerator.c
	ext/opcache/zend_accelerator_util_funcs.c
	ext/opcache/zend_persist.c
	ext/opcache/zend_persist_calc.c
	ext/pcre/php_pcre.c
	ext/pdo/pdo_dbh.c
	ext/pdo/pdo_stmt.c
	ext/pdo_pgsql/pgsql_driver.c
	ext/pgsql/pgsql.c
	ext/reflection/php_reflection.c
	ext/session/session.c
	ext/spl/spl_array.c
	ext/spl/spl_observer.c
	ext/standard/array.c
	ext/standard/basic_functions.c
	ext/standard/html.c
	ext/standard/mail.c
	ext/standard/php_array.h
	ext/standard/proc_open.c
	ext/standard/streamsfuncs.c
	ext/standard/user_filters.c
	ext/standard/var_unserializer.c
	ext/standard/var_unserializer.re
	main/php_variables.c
	sapi/phpdbg/phpdbg.c
	sapi/phpdbg/phpdbg_bp.c
	sapi/phpdbg/phpdbg_frame.c
	sapi/phpdbg/phpdbg_help.c
	sapi/phpdbg/phpdbg_list.c
	sapi/phpdbg/phpdbg_print.c
	sapi/phpdbg/phpdbg_prompt.c
2014-04-26 00:32:51 +04:00
Stanislav Malyshev
b82d077f98 Merge branch 'PHP-5.6'
* PHP-5.6:
  update NEWS
  update NEWS
  add a test case previously broken by a bad fix
  Revert "Fixed bug #64604"
2014-04-25 00:07:12 -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
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
Dmitry Stogov
d0ed1212a4 Enable PCRE JIT compiler 2014-04-25 08:33:37 +04:00
Dmitry Stogov
df7ca608ce Optimized constant lookup 2014-04-25 00:56:15 +04:00
Dmitry Stogov
b1ff152782 Reimplement strtr() 2014-04-24 19:14:29 +04:00
Nikita Popov
08ae88157b Allocate zend_strings with correct size
For me (32bit) sizeof(zend_string) is 20, which means that the
char[1] array at the end is padded with three bytes. Thus allocating
based on sizeof(zend_string)-1 overallocates by those 3 padding bytes.

This commit fixes the allocation size, by using XtOffsetOf.
2014-04-23 19:34:51 +02:00
Dmitry Stogov
7584ae3200 Fixed compilaation warnings 2014-04-22 18:52:59 +04:00
Dmitry Stogov
5864ce8a44 Fixed compilation warnings 2014-04-22 17:46:34 +04:00
Dmitry Stogov
b886d9ce1e Use fast comparison function 2014-04-22 02:03:10 +04:00
Dmitry Stogov
4ed452c1b5 Convert zval_get_string() into "fast path" macro and "slow path" function 2014-04-21 22:36:01 +04:00
Dmitry Stogov
8ad8254a16 Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2 2014-04-21 21:39:15 +04:00
Nikita Popov
0d43a277b8 Use zval_get_string in a few more places 2014-04-21 17:55:58 +02:00
Dmitry Stogov
72c287bd23 Combine HashTable.flags and HashTable.nApplyCount into single 32-bit word 2014-04-21 18:25:34 +04:00
Dmitry Stogov
dd464fb582 Use ZEND_HASH_FOREACH_* macros 2014-04-21 14:20:05 +04:00
Stanislav Malyshev
821cc39882 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix a compiler warning in php_rand.h
2014-04-20 16:36:55 -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
dd9c80e44b Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix bug #65701: Do not use cache for file file copy
2014-04-20 15:27:55 -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
Dmitry Stogov
54d9ad53f4 More ZEND_HASH_FOREACH_* related changes 2014-04-19 00:08:14 +04:00
Dmitry Stogov
277f8f6391 ZEND_HASH_FOREACH_* usage 2014-04-18 21:49:07 +04:00
Dmitry Stogov
7652a977a8 Use ZEND_FETCH_FOREACH_* macros to iterate over HashTables instead of zend_hash_move_forward() and family. 2014-04-18 19:18:11 +04:00
Anatol Belski
f5f1abdc29 Merge branch 'PHP-5.6'
* PHP-5.6:
  refixed the test related to bug #67072
  Improved the fix for bug #67072, thanks Nikita
2014-04-18 15:17:39 +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
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
Dmitry Stogov
e96073b1e4 Moved zend_literal->cache_slot right into zval.
It should be accessed using Z_CACHE_SLOT() macro.
zend_literal structure is removed.
API functions that accepted pointer to zend_literal now accept pointer to zval or cache_slot directly.
Calls of such functiond that now accept cache_slot need to be changed to pass -1 instead of NULL.
2014-04-17 15:40:45 +04:00
Anatol Belski
a381cc3c40 Merge branch 'PHP-5.6'
* PHP-5.6:
  updated NEWS
  updated NEWS
  Fixed bug #67072 Echoing unserialized "SplFileObject" crash
2014-04-17 11:08:45 +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
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
Dmitry Stogov
320bf772c6 Prevented modification of original name 2014-04-16 22:42:37 +04:00