diff options
Diffstat (limited to 'ext')
45 files changed, 277 insertions, 164 deletions
diff --git a/ext/date/lib/parse_date.re b/ext/date/lib/parse_date.re index 0bb8fe68b3..f9595889ec 100644 --- a/ext/date/lib/parse_date.re +++ b/ext/date/lib/parse_date.re @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/date/lib/parse_iso_intervals.re b/ext/date/lib/parse_iso_intervals.re index cbbf8781bf..8c82cfc3b9 100644 --- a/ext/date/lib/parse_iso_intervals.re +++ b/ext/date/lib/parse_iso_intervals.re @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/dba/dba_inifile.c b/ext/dba/dba_inifile.c index 4d8eae73ac..6067e99154 100644 --- a/ext/dba/dba_inifile.c +++ b/ext/dba/dba_inifile.c @@ -124,14 +124,15 @@ DBA_EXISTS_FUNC(inifile) DBA_DELETE_FUNC(inifile) { int res; + zend_bool found = 0; INIFILE_DATA; INIFILE_GKEY; - res = inifile_delete(dba, &ini_key TSRMLS_CC); + res = inifile_delete_ex(dba, &ini_key, &found TSRMLS_CC); INIFILE_DONE; - return (res == -1 ? FAILURE : SUCCESS); + return (res == -1 || !found ? FAILURE : SUCCESS); } DBA_FIRSTKEY_FUNC(inifile) diff --git a/ext/dba/libinifile/inifile.c b/ext/dba/libinifile/inifile.c index 8c771beba4..218037ebe3 100644 --- a/ext/dba/libinifile/inifile.c +++ b/ext/dba/libinifile/inifile.c @@ -402,7 +402,7 @@ static int inifile_copy_to(inifile *dba, size_t pos_start, size_t pos_end, inifi return FAILURE; } php_stream_seek(dba->fp, pos_start, SEEK_SET); - if (!php_stream_copy_to_stream_ex(dba->fp, fp, pos_end - pos_start, NULL)) { + if (SUCCESS != php_stream_copy_to_stream_ex(dba->fp, fp, pos_end - pos_start, NULL)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not copy group [%zu - %zu] to temporary stream", pos_start, pos_end); return FAILURE; } @@ -413,7 +413,7 @@ static int inifile_copy_to(inifile *dba, size_t pos_start, size_t pos_end, inifi /* {{{ inifile_filter * copy from to dba while ignoring key name (group must equal) */ -static int inifile_filter(inifile *dba, inifile *from, const key_type *key TSRMLS_DC) +static int inifile_filter(inifile *dba, inifile *from, const key_type *key, zend_bool *found TSRMLS_DC) { size_t pos_start = 0, pos_next = 0, pos_curr; int ret = SUCCESS; @@ -424,10 +424,13 @@ static int inifile_filter(inifile *dba, inifile *from, const key_type *key TSRML while(inifile_read(from, &ln TSRMLS_CC)) { switch(inifile_key_cmp(&ln.key, key TSRMLS_CC)) { case 0: + if (found) { + *found = (zend_bool) 1; + } pos_curr = php_stream_tell(from->fp); if (pos_start != pos_next) { php_stream_seek(from->fp, pos_start, SEEK_SET); - if (!php_stream_copy_to_stream_ex(from->fp, dba->fp, pos_next - pos_start, NULL)) { + if (SUCCESS != php_stream_copy_to_stream_ex(from->fp, dba->fp, pos_next - pos_start, NULL)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not copy [%zu - %zu] from temporary stream", pos_next, pos_start); ret = FAILURE; } @@ -446,7 +449,7 @@ static int inifile_filter(inifile *dba, inifile *from, const key_type *key TSRML } if (pos_start != pos_next) { php_stream_seek(from->fp, pos_start, SEEK_SET); - if (!php_stream_copy_to_stream_ex(from->fp, dba->fp, pos_next - pos_start, NULL)) { + if (SUCCESS != php_stream_copy_to_stream_ex(from->fp, dba->fp, pos_next - pos_start, NULL)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not copy [%zu - %zu] from temporary stream", pos_next, pos_start); ret = FAILURE; } @@ -458,7 +461,7 @@ static int inifile_filter(inifile *dba, inifile *from, const key_type *key TSRML /* {{{ inifile_delete_replace_append */ -static int inifile_delete_replace_append(inifile *dba, const key_type *key, const val_type *value, int append TSRMLS_DC) +static int inifile_delete_replace_append(inifile *dba, const key_type *key, const val_type *value, int append, zend_bool *found TSRMLS_DC) { size_t pos_grp_start=0, pos_grp_next; inifile *ini_tmp = NULL; @@ -497,7 +500,7 @@ static int inifile_delete_replace_append(inifile *dba, const key_type *key, cons php_stream_seek(dba->fp, 0, SEEK_END); if (pos_grp_next != (size_t)php_stream_tell(dba->fp)) { php_stream_seek(dba->fp, pos_grp_next, SEEK_SET); - if (!php_stream_copy_to_stream_ex(dba->fp, fp_tmp, PHP_STREAM_COPY_ALL, NULL)) { + if (SUCCESS != php_stream_copy_to_stream_ex(dba->fp, fp_tmp, PHP_STREAM_COPY_ALL, NULL)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not copy remainder to temporary stream"); ret = FAILURE; } @@ -516,7 +519,7 @@ static int inifile_delete_replace_append(inifile *dba, const key_type *key, cons if (key->name && strlen(key->name)) { /* 6 */ if (!append && ini_tmp) { - ret = inifile_filter(dba, ini_tmp, key TSRMLS_CC); + ret = inifile_filter(dba, ini_tmp, key, found TSRMLS_CC); } /* 7 */ @@ -538,7 +541,7 @@ static int inifile_delete_replace_append(inifile *dba, const key_type *key, cons if (fp_tmp && php_stream_tell(fp_tmp)) { php_stream_seek(fp_tmp, 0, SEEK_SET); php_stream_seek(dba->fp, 0, SEEK_END); - if (!php_stream_copy_to_stream_ex(fp_tmp, dba->fp, PHP_STREAM_COPY_ALL, NULL)) { + if (SUCCESS != php_stream_copy_to_stream_ex(fp_tmp, dba->fp, PHP_STREAM_COPY_ALL, NULL)) { php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Could not copy from temporary stream - ini file truncated"); ret = FAILURE; } @@ -563,7 +566,15 @@ static int inifile_delete_replace_append(inifile *dba, const key_type *key, cons */ int inifile_delete(inifile *dba, const key_type *key TSRMLS_DC) { - return inifile_delete_replace_append(dba, key, NULL, 0 TSRMLS_CC); + return inifile_delete_replace_append(dba, key, NULL, 0, NULL TSRMLS_CC); +} +/* }}} */ + +/* {{{ inifile_delete_ex + */ +int inifile_delete_ex(inifile *dba, const key_type *key, zend_bool *found TSRMLS_DC) +{ + return inifile_delete_replace_append(dba, key, NULL, 0, found TSRMLS_CC); } /* }}} */ @@ -571,7 +582,15 @@ int inifile_delete(inifile *dba, const key_type *key TSRMLS_DC) */ int inifile_replace(inifile *dba, const key_type *key, const val_type *value TSRMLS_DC) { - return inifile_delete_replace_append(dba, key, value, 0 TSRMLS_CC); + return inifile_delete_replace_append(dba, key, value, 0, NULL TSRMLS_CC); +} +/* }}} */ + +/* {{{ inifile_replace_ex + */ +int inifile_replace_ex(inifile *dba, const key_type *key, const val_type *value, zend_bool *found TSRMLS_DC) +{ + return inifile_delete_replace_append(dba, key, value, 0, found TSRMLS_CC); } /* }}} */ @@ -579,7 +598,7 @@ int inifile_replace(inifile *dba, const key_type *key, const val_type *value TSR */ int inifile_append(inifile *dba, const key_type *key, const val_type *value TSRMLS_DC) { - return inifile_delete_replace_append(dba, key, value, 1 TSRMLS_CC); + return inifile_delete_replace_append(dba, key, value, 1, NULL TSRMLS_CC); } /* }}} */ diff --git a/ext/dba/libinifile/inifile.h b/ext/dba/libinifile/inifile.h index 1177610185..e41dac0ca4 100644 --- a/ext/dba/libinifile/inifile.h +++ b/ext/dba/libinifile/inifile.h @@ -49,7 +49,9 @@ val_type inifile_fetch(inifile *dba, const key_type *key, int skip TSRMLS_DC); int inifile_firstkey(inifile *dba TSRMLS_DC); int inifile_nextkey(inifile *dba TSRMLS_DC); int inifile_delete(inifile *dba, const key_type *key TSRMLS_DC); +int inifile_delete_ex(inifile *dba, const key_type *key, zend_bool *found TSRMLS_DC); int inifile_replace(inifile *dba, const key_type *key, const val_type *val TSRMLS_DC); +int inifile_replace_ex(inifile *dba, const key_type *key, const val_type *val, zend_bool *found TSRMLS_DC); int inifile_append(inifile *dba, const key_type *key, const val_type *val TSRMLS_DC); char *inifile_version(); diff --git a/ext/dba/tests/bug62490.phpt b/ext/dba/tests/bug62490.phpt new file mode 100644 index 0000000000..325dd34554 --- /dev/null +++ b/ext/dba/tests/bug62490.phpt @@ -0,0 +1,43 @@ +--TEST-- +Bug #62490 (dba_delete returns true on missing item (inifile)) +--SKIPIF-- +<?php +$handler = "inifile"; +include "skipif.inc"; +?> +--FILE-- +<?php +$handler = "inifile"; +include "test.inc"; + +$dba = dba_open($db_filename, "n", $handler) + or die; +for ($i = 0; $i < 3; ++$i) { + echo "insert $i:"; + var_dump(dba_insert("a", $i, $dba)); +} + +echo "exists:"; +var_dump(dba_exists("a", $dba)); +echo "delete:"; +var_dump(dba_delete("a", $dba)); +echo "exists:"; +var_dump(dba_exists("a", $dba)); +echo "delete:"; +var_dump(dba_delete("a", $dba)); + +?> +===DONE=== +--CLEAN-- +<?php +include "clean.inc"; +?> +--EXPECT-- +insert 0:bool(true) +insert 1:bool(true) +insert 2:bool(true) +exists:bool(true) +delete:bool(true) +exists:bool(false) +delete:bool(false) +===DONE=== diff --git a/ext/dba/tests/dba_db4_003.phpt b/ext/dba/tests/dba_db4_003.phpt index 7e8568c085..8708170fc1 100644 --- a/ext/dba/tests/dba_db4_003.phpt +++ b/ext/dba/tests/dba_db4_003.phpt @@ -39,8 +39,6 @@ require(dirname(__FILE__) .'/clean.inc'); database handler: db4 int(14) -Notice: dba_open(): %stest0.dbm: unexpected file type or format in %sdba_db4_003.php on line %d - Warning: dba_open(%stest0.dbm,c): Driver initialization failed for handler: db4: Invalid argument in %sdba_db4_003.php on line %d Error creating %stest0.dbm Dummy contents diff --git a/ext/dba/tests/dba_db4_007.phpt b/ext/dba/tests/dba_db4_007.phpt index bd95e0bec7..027d0af032 100644 --- a/ext/dba/tests/dba_db4_007.phpt +++ b/ext/dba/tests/dba_db4_007.phpt @@ -35,7 +35,5 @@ require(dirname(__FILE__) .'/clean.inc'); database handler: db4 int(14) -Notice: dba_popen(): %stest0.dbm: unexpected file type or format in %sdba_db4_007.php on line %d - Warning: dba_popen(%stest0.dbm,c): Driver initialization failed for handler: db4: Invalid argument in %sdba_db4_007.php on line %d Error creating %stest0.dbm diff --git a/ext/dba/tests/dba_db4_010.phpt b/ext/dba/tests/dba_db4_010.phpt deleted file mode 100644 index fb31f05835..0000000000 --- a/ext/dba/tests/dba_db4_010.phpt +++ /dev/null @@ -1,38 +0,0 @@ ---TEST-- -DBA DB4 magic_quotes_runtime Test ---SKIPIF-- -<?php -$handler = "db4"; -require_once(dirname(__FILE__) .'/skipif.inc'); -die("info $HND handler used"); -?> ---FILE-- -<?php -$handler = "db4"; -require_once(dirname(__FILE__) .'/test.inc'); -echo "database handler: $handler\n"; -if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) { - ini_set('magic_quotes_runtime', 0); - dba_insert("key1", '"', $db_file); - var_dump(dba_fetch("key1", $db_file)); - ini_set('magic_quotes_runtime', 1); - var_dump(dba_fetch("key1", $db_file)); - dba_replace("key1", '\"', $db_file); - var_dump(dba_fetch("key1", $db_file)); - ini_set('magic_quotes_runtime', 0); - var_dump(dba_fetch("key1", $db_file)); - dba_close($db_file); -} else { - echo "Error creating database\n"; -} -?> ---CLEAN-- -<?php -require(dirname(__FILE__) .'/clean.inc'); -?> ---EXPECTF-- -database handler: db4 -string(1) """ -string(2) "\"" -string(2) "\"" -string(1) """ diff --git a/ext/dba/tests/dba_handler.inc b/ext/dba/tests/dba_handler.inc index a950e903af..ed2a52400a 100644 --- a/ext/dba/tests/dba_handler.inc +++ b/ext/dba/tests/dba_handler.inc @@ -82,7 +82,7 @@ do { dba_close($dba_reader); } if (($db_file = dba_popen($db_filename, 'r'.($lock_flag==''?'':'-'), $handler))!==FALSE) { - if ($handler == 'dbm') { + if ($handler == 'dbm' || $handler == "tcadb") { dba_close($db_file); } } diff --git a/ext/dba/tests/dba_inifile.phpt b/ext/dba/tests/dba_inifile.phpt index 5975d25f4d..ae06aee09f 100644 --- a/ext/dba/tests/dba_inifile.phpt +++ b/ext/dba/tests/dba_inifile.phpt @@ -12,6 +12,10 @@ DBA INIFILE handler test require_once dirname(__FILE__) .'/dba_handler.inc'; ?> ===DONE=== +--CLEAN-- +<?php + require(dirname(__FILE__) .'/clean.inc'); +?> --EXPECT-- database handler: inifile 3NYNYY @@ -19,7 +23,7 @@ Content String 2 Content 2 replaced Read during write: not allowed "key number 6" written -Failed to write "key number 6" 2nd time +"key number 6" written 2nd time Content 2 replaced 2nd time The 6th value array(3) { @@ -36,7 +40,7 @@ Content String 2 Content 2 replaced Read during write: not allowed "key number 6" written -Failed to write "key number 6" 2nd time +"key number 6" written 2nd time Content 2 replaced 2nd time The 6th value array(3) { diff --git a/ext/dba/tests/dba_tcadb.phpt b/ext/dba/tests/dba_tcadb.phpt index 28b6dd8f0b..f75aa813d4 100644 --- a/ext/dba/tests/dba_tcadb.phpt +++ b/ext/dba/tests/dba_tcadb.phpt @@ -16,6 +16,12 @@ DBA TCADB handler test require_once dirname(__FILE__) .'/dba_handler.inc'; ?> ===DONE=== +--CLEAN-- +<?php +$db_filename = $db_file = dirname(__FILE__) .'/test0.tch'; +@unlink($db_filename); +@unlink($db_filename.'.lck'); +?> --EXPECT-- database handler: tcadb 3NYNYY diff --git a/ext/dom/php_dom.c b/ext/dom/php_dom.c index 0623dbdcde..bfe966bd82 100644 --- a/ext/dom/php_dom.c +++ b/ext/dom/php_dom.c @@ -448,7 +448,7 @@ static int dom_property_exists(zval *object, zval *member, int check_empty, cons Z_SET_REFCOUNT_P(tmp, 1); Z_UNSET_ISREF_P(tmp); if (check_empty == 1) { - retval = zend_is_true(tmp); + retval = zend_is_true(tmp TSRMLS_CC); } else if (check_empty == 0) { retval = (Z_TYPE_P(tmp) != IS_NULL); } diff --git a/ext/gd/libgd/gdft.c b/ext/gd/libgd/gdft.c index ac2bf344ff..aa8e8d3a74 100644 --- a/ext/gd/libgd/gdft.c +++ b/ext/gd/libgd/gdft.c @@ -1050,7 +1050,15 @@ gdImageStringFTEx (gdImage * im, int *brect, int fg, char *fontlist, double ptsi } /* transform glyph image */ - FT_Get_Glyph(slot, &image); + if (FT_Get_Glyph(slot, &image)) { + if (tmpstr) { + gdFree(tmpstr); + } + gdCacheDelete(tc_cache); + gdMutexUnlock(gdFontCacheMutex); + return "Problem loading glyph"; + } + if (brect) { /* only if need brect */ FT_Glyph_Get_CBox(image, ft_glyph_bbox_gridfit, &glyph_bbox); glyph_bbox.xMin += penf.x; diff --git a/ext/gmp/gmp.c b/ext/gmp/gmp.c index 954d4799af..8c4eec5518 100644 --- a/ext/gmp/gmp.c +++ b/ext/gmp/gmp.c @@ -532,6 +532,9 @@ static int gmp_do_operation(zend_uchar opcode, zval *result, zval *op1, zval *op DO_BINARY_UI_OP(mpz_sub); case ZEND_MUL: DO_BINARY_UI_OP(mpz_mul); + case ZEND_POW: + shift_operator_helper(mpz_pow_ui, result, op1, op2 TSRMLS_CC); + return SUCCESS; case ZEND_DIV: DO_BINARY_UI_OP_EX(mpz_tdiv_q, mpz_tdiv_q_ui, 1); case ZEND_MOD: diff --git a/ext/gmp/tests/overloading.phpt b/ext/gmp/tests/overloading.phpt index 18e0bb2aa9..0d8f5cfedb 100644 --- a/ext/gmp/tests/overloading.phpt +++ b/ext/gmp/tests/overloading.phpt @@ -83,6 +83,10 @@ var_dump(--$a); var_dump($a--); var_dump($a); +$x = gmp_init(3); +$y = gmp_init(2); +var_dump($x ** $y); + ?> --EXPECTF-- object(GMP)#%d (1) { @@ -256,4 +260,7 @@ object(GMP)#%d (1) { ["num"]=> string(2) "42" } - +object(GMP)#%d (1) { + ["num"]=> + string(1) "9" +} diff --git a/ext/json/json.c b/ext/json/json.c index f38cc11ac5..d939a7deab 100644 --- a/ext/json/json.c +++ b/ext/json/json.c @@ -190,10 +190,10 @@ static int json_determine_array_type(zval **val TSRMLS_DC) /* {{{ */ } if (i == HASH_KEY_IS_STRING) { - return 1; + return PHP_JSON_OUTPUT_OBJECT; } else { if (index != idx) { - return 1; + return PHP_JSON_OUTPUT_OBJECT; } } idx++; diff --git a/ext/libxml/tests/libxml_disable_entity_loader.phpt b/ext/libxml/tests/libxml_disable_entity_loader.phpt new file mode 100644 index 0000000000..6477543fb2 --- /dev/null +++ b/ext/libxml/tests/libxml_disable_entity_loader.phpt @@ -0,0 +1,41 @@ +--TEST-- +libxml_disable_entity_loader() +--SKIPIF-- +<?php if (!extension_loaded('libxml') || !extension_loaded('dom') || defined('PHP_WINDOWS_VERSION_MAJOR')) die('skip'); ?> +--FILE-- +<?php + +$xml = <<<EOT +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE test [<!ENTITY xxe SYSTEM "XXE_URI">]> +<foo>&xxe;</foo> +EOT; + +$xml = str_replace('XXE_URI', __DIR__ . '/libxml_disable_entity_loader_payload.txt', $xml); + +function parseXML($xml) { + $doc = new DOMDocument(); + $doc->resolveExternals = true; + $doc->substituteEntities = true; + $doc->validateOnParse = false; + $doc->loadXML($xml, 0); + return $doc->saveXML(); +} + +var_dump(strpos(parseXML($xml), 'SECRET_DATA') !== false); +var_dump(libxml_disable_entity_loader(true)); +var_dump(strpos(parseXML($xml), 'SECRET_DATA') === false); + +echo "Done\n"; +?> +--EXPECTF-- +bool(true) +bool(false) + +Warning: DOMDocument::loadXML(): I/O warning : failed to load external entity "%s" in %s on line %d + +Warning: DOMDocument::loadXML(): Failure to process entity xxe in Entity, line: %d in %s on line %d + +Warning: DOMDocument::loadXML(): Entity 'xxe' not defined in Entity, line: %d in %s on line %d +bool(true) +Done diff --git a/ext/libxml/tests/libxml_disable_entity_loader_payload.txt b/ext/libxml/tests/libxml_disable_entity_loader_payload.txt new file mode 100644 index 0000000000..3b8a43cc1d --- /dev/null +++ b/ext/libxml/tests/libxml_disable_entity_loader_payload.txt @@ -0,0 +1 @@ +SECRET_DATA
\ No newline at end of file diff --git a/ext/mysqlnd/mysqlnd_net.c b/ext/mysqlnd/mysqlnd_net.c index fadcbd87f6..226c855b3d 100644 --- a/ext/mysqlnd/mysqlnd_net.c +++ b/ext/mysqlnd/mysqlnd_net.c @@ -900,7 +900,11 @@ MYSQLND_METHOD(mysqlnd_net, enable_ssl)(MYSQLND_NET * const net TSRMLS_DC) ZVAL_STRING(&cipher_zval, net->data->options.ssl_cipher, 0); php_stream_context_set_option(context, "ssl", "ciphers", &cipher_zval); } +#if PHP_API_VERSION >= 20131106 + php_stream_context_set(net_stream, context TSRMLS_CC); +#else php_stream_context_set(net_stream, context); +#endif if (php_stream_xport_crypto_setup(net_stream, STREAM_CRYPTO_METHOD_TLS_CLIENT, NULL TSRMLS_CC) < 0 || php_stream_xport_crypto_enable(net_stream, 1 TSRMLS_CC) < 0) { @@ -916,7 +920,11 @@ MYSQLND_METHOD(mysqlnd_net, enable_ssl)(MYSQLND_NET * const net TSRMLS_DC) of the context, which means usage of already freed memory, bad. Actually we don't need this context anymore after we have enabled SSL on the connection. Thus it is very simple, we remove it. */ +#if PHP_API_VERSION >= 20131106 + php_stream_context_set(net_stream, NULL TSRMLS_CC); +#else php_stream_context_set(net_stream, NULL); +#endif if (net->data->options.timeout_read) { struct timeval tv; diff --git a/ext/mysqlnd/mysqlnd_ps.c b/ext/mysqlnd/mysqlnd_ps.c index 8096cbbbd9..2d270c9b2f 100644 --- a/ext/mysqlnd/mysqlnd_ps.c +++ b/ext/mysqlnd/mysqlnd_ps.c @@ -38,6 +38,7 @@ const char * const mysqlnd_stmt_not_prepared = "Statement not prepared"; /* Exported by mysqlnd_ps_codec.c */ enum_func_status mysqlnd_stmt_execute_generate_request(MYSQLND_STMT * const s, zend_uchar ** request, size_t *request_len, zend_bool * free_buffer TSRMLS_DC); +enum_func_status mysqlnd_stmt_execute_batch_generate_request(MYSQLND_STMT * const s, zend_uchar ** request, size_t *request_len, zend_bool * free_buffer TSRMLS_DC); enum_func_status mysqlnd_stmt_fetch_row_buffered(MYSQLND_RES *result, void *param, unsigned int flags, diff --git a/ext/opcache/Optimizer/block_pass.c b/ext/opcache/Optimizer/block_pass.c index fff5d7e101..a6114733e3 100644 --- a/ext/opcache/Optimizer/block_pass.c +++ b/ext/opcache/Optimizer/block_pass.c @@ -1466,7 +1466,12 @@ static void zend_jmp_optimization(zend_code_block *block, zend_op_array *op_arra case ZEND_JMPNZ: /* constant conditional JMPs */ if (ZEND_OP1_TYPE(last_op) == IS_CONST) { +#if ZEND_EXTENSION_API_NO > PHP_5_6_X_API_NO + int should_jmp = zend_is_true(&ZEND_OP1_LITERAL(last_op) TSRMLS_CC); +#else int should_jmp = zend_is_true(&ZEND_OP1_LITERAL(last_op)); +#endif + if (last_op->opcode == ZEND_JMPZ) { should_jmp = !should_jmp; } @@ -1609,7 +1614,12 @@ next_target: case ZEND_JMPZ_EX: /* constant conditional JMPs */ if (ZEND_OP1_TYPE(last_op) == IS_CONST) { +#if ZEND_EXTENSION_API_NO > PHP_5_6_X_API_NO + int should_jmp = zend_is_true(&ZEND_OP1_LITERAL(last_op) TSRMLS_CC); +#else int should_jmp = zend_is_true(&ZEND_OP1_LITERAL(last_op)); +#endif + if (last_op->opcode == ZEND_JMPZ_EX) { should_jmp = !should_jmp; } @@ -1730,7 +1740,11 @@ next_target_ex: } if (ZEND_OP1_TYPE(last_op) == IS_CONST) { +#if ZEND_EXTENSION_API_NO > PHP_5_6_X_API_NO + if (!zend_is_true(&ZEND_OP1_LITERAL(last_op) TSRMLS_CC)) { +#else if (!zend_is_true(&ZEND_OP1_LITERAL(last_op))) { +#endif /* JMPZNZ(false,L1,L2) -> JMP(L1) */ zend_code_block *todel; diff --git a/ext/opcache/Optimizer/pass2.c b/ext/opcache/Optimizer/pass2.c index 30708a0935..d5f4f0492b 100644 --- a/ext/opcache/Optimizer/pass2.c +++ b/ext/opcache/Optimizer/pass2.c @@ -89,7 +89,11 @@ if (ZEND_OPTIMIZER_PASS_2 & OPTIMIZATION_LEVEL) { /* convert Ti = JMPZ_EX(C, L) => Ti = QM_ASSIGN(C) in case we know it wouldn't jump */ } else if (ZEND_OP1_TYPE(opline) == IS_CONST) { +#if ZEND_EXTENSION_API_NO > PHP_5_6_X_API_NO + int should_jmp = zend_is_true(&ZEND_OP1_LITERAL(opline) TSRMLS_CC); +#else int should_jmp = zend_is_true(&ZEND_OP1_LITERAL(opline)); +#endif if (opline->opcode == ZEND_JMPZ_EX) { should_jmp = !should_jmp; } @@ -103,7 +107,11 @@ if (ZEND_OPTIMIZER_PASS_2 & OPTIMIZATION_LEVEL) { case ZEND_JMPZ: case ZEND_JMPNZ: if (ZEND_OP1_TYPE(opline) == IS_CONST) { +#if ZEND_EXTENSION_API_NO > PHP_5_6_X_API_NO + int should_jmp = zend_is_true(&ZEND_OP1_LITERAL(opline) TSRMLS_CC); +#else int should_jmp = zend_is_true(&ZEND_OP1_LITERAL(opline)); +#endif if (opline->opcode == ZEND_JMPZ) { should_jmp = !should_jmp; @@ -139,8 +147,11 @@ if (ZEND_OPTIMIZER_PASS_2 & OPTIMIZATION_LEVEL) { case ZEND_JMPZNZ: if (ZEND_OP1_TYPE(opline) == IS_CONST) { int opline_num; - +#if ZEND_EXTENSION_API_NO > PHP_5_6_X_API_NO + if (zend_is_true(&ZEND_OP1_LITERAL(opline) TSRMLS_CC)) { +#else if (zend_is_true(&ZEND_OP1_LITERAL(opline))) { +#endif opline_num = opline->extended_value; /* JMPNZ */ } else { opline_num = ZEND_OP2(opline).opline_num; /* JMPZ */ diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c index 45c0cf628a..d1c9dfcd35 100644 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@ -2550,7 +2550,11 @@ static int accel_startup(zend_extension *extension) _setmaxstdio(2048); /* The default configuration is limited to 512 stdio files */ #endif +#if ZEND_EXTENSION_API_NO > PHP_5_6_X_API_NO + if (start_accel_module(TSRMLS_C) == FAILURE) { +#else if (start_accel_module() == FAILURE) { +#endif accel_startup_ok = 0; zend_error(E_WARNING, ACCELERATOR_PRODUCT_NAME ": module registration failed!"); return FAILURE; diff --git a/ext/opcache/ZendAccelerator.h b/ext/opcache/ZendAccelerator.h index e799f0ae02..56e6cd508d 100644 --- a/ext/opcache/ZendAccelerator.h +++ b/ext/opcache/ZendAccelerator.h @@ -92,6 +92,7 @@ #define PHP_5_3_X_API_NO 220090626 #define PHP_5_4_X_API_NO 220100525 #define PHP_5_5_X_API_NO 220121212 +#define PHP_5_6_X_API_NO 220131106 /*** file locking ***/ #ifndef ZEND_WIN32 diff --git a/ext/opcache/zend_accelerator_module.c b/ext/opcache/zend_accelerator_module.c index 83e7d4ca2b..b98623e1f2 100644 --- a/ext/opcache/zend_accelerator_module.c +++ b/ext/opcache/zend_accelerator_module.c @@ -474,10 +474,17 @@ static zend_module_entry accel_module_entry = { STANDARD_MODULE_PROPERTIES }; +#if ZEND_EXTENSION_API_NO > PHP_5_6_X_API_NO +int start_accel_module(TSRMLS_D) +{ + return zend_startup_module(&accel_module_entry TSRMLS_CC); +} +#else int start_accel_module(void) { return zend_startup_module(&accel_module_entry); } +#endif /* {{{ proto array accelerator_get_scripts() Get the scripts which are accelerated by ZendAccelerator */ diff --git a/ext/opcache/zend_accelerator_module.h b/ext/opcache/zend_accelerator_module.h index ece4a7d6b5..6e772b8c7e 100644 --- a/ext/opcache/zend_accelerator_module.h +++ b/ext/opcache/zend_accelerator_module.h @@ -22,7 +22,12 @@ #ifndef ZEND_ACCELERATOR_MODULE_H #define ZEND_ACCELERATOR_MODULE_H +#if ZEND_EXTENSION_API_NO > PHP_5_6_X_API_NO +int start_accel_module(TSRMLS_D); +#else int start_accel_module(void); +#endif + void zend_accel_override_file_functions(TSRMLS_D); #endif /* _ZEND_ACCELERATOR_MODULE_H */ diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c index 523062e043..a02d4f98aa 100644 --- a/ext/openssl/xp_ssl.c +++ b/ext/openssl/xp_ssl.c @@ -407,7 +407,7 @@ static inline int php_openssl_setup_crypto(php_stream *stream, if (stream->context && SUCCESS == php_stream_context_get_option( stream->context, "ssl", "no_ticket", &val) && - zend_is_true(*val) + zend_is_true(*val TSRMLS_CC) ) { SSL_CTX_set_options(sslsock->ctx, SSL_OP_NO_TICKET); } @@ -420,7 +420,7 @@ static inline int php_openssl_setup_crypto(php_stream *stream, if (stream->context && SUCCESS == php_stream_context_get_option( stream->context, "ssl", "disable_compression", &val) && - zend_is_true(*val) + zend_is_true(*val TSRMLS_CC) ) { SSL_CTX_set_options(sslsock->ctx, SSL_OP_NO_COMPRESSION); } @@ -471,7 +471,7 @@ static inline int php_openssl_enable_crypto(php_stream *stream, if (sslsock->is_client && (php_stream_context_get_option(stream->context, "ssl", "SNI_enabled", &val) == FAILURE - || zend_is_true(*val)) + || zend_is_true(*val TSRMLS_CC)) ) { if (php_stream_context_get_option(stream->context, "ssl", "SNI_server_name", &val) == SUCCESS) { convert_to_string_ex(val); @@ -578,7 +578,7 @@ static inline int php_openssl_enable_crypto(php_stream *stream, if (SUCCESS == php_stream_context_get_option( stream->context, "ssl", "capture_peer_cert", &val) && - zend_is_true(*val)) { + zend_is_true(*val TSRMLS_CC)) { MAKE_STD_ZVAL(zcert); ZVAL_RESOURCE(zcert, zend_list_insert(peer_cert, php_openssl_get_x509_list_id() TSRMLS_CC)); @@ -592,7 +592,7 @@ static inline int php_openssl_enable_crypto(php_stream *stream, if (SUCCESS == php_stream_context_get_option( stream->context, "ssl", "capture_peer_cert_chain", &val) && - zend_is_true(*val)) { + zend_is_true(*val TSRMLS_CC)) { zval *arr; STACK_OF(X509) *chain; diff --git a/ext/pcntl/pcntl.c b/ext/pcntl/pcntl.c index b7ef4c729c..4c7f1784aa 100644 --- a/ext/pcntl/pcntl.c +++ b/ext/pcntl/pcntl.c @@ -499,7 +499,7 @@ PHP_MINIT_FUNCTION(pcntl) { php_register_signal_constants(INIT_FUNC_ARGS_PASSTHRU); php_pcntl_register_errno_constants(INIT_FUNC_ARGS_PASSTHRU); - php_add_tick_function(pcntl_signal_dispatch); + php_add_tick_function(pcntl_signal_dispatch TSRMLS_CC); return SUCCESS; } diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c index 32e88510e7..12f23bf0e2 100644 --- a/ext/soap/php_encoding.c +++ b/ext/soap/php_encoding.c @@ -1189,7 +1189,7 @@ static xmlNodePtr to_xml_bool(encodeTypePtr type, zval *data, int style, xmlNode xmlAddChild(parent, ret); FIND_ZVAL_NULL(data, ret, style); - if (zend_is_true(data)) { + if (zend_is_true(data TSRMLS_CC)) { xmlNodeSetContent(ret, BAD_CAST("true")); } else { xmlNodeSetContent(ret, BAD_CAST("false")); diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c index f41d0fb9cd..9270132ff7 100644 --- a/ext/spl/spl_array.c +++ b/ext/spl/spl_array.c @@ -599,7 +599,7 @@ static int spl_array_has_dimension_ex(int check_inherited, zval *object, zval *o SEPARATE_ARG_IF_REF(offset); zend_call_method_with_1_params(&object, Z_OBJCE_P(object), &intern->fptr_offset_has, "offsetExists", &rv, offset); zval_ptr_dtor(&offset); - if (rv && zend_is_true(rv)) { + if (rv && zend_is_true(rv TSRMLS_CC)) { zval_ptr_dtor(&rv); return 1; } @@ -620,7 +620,7 @@ static int spl_array_has_dimension_ex(int check_inherited, zval *object, zval *o case 2: return 1; default: - return zend_is_true(*tmp); + return zend_is_true(*tmp TSRMLS_CC); } } } @@ -643,7 +643,7 @@ static int spl_array_has_dimension_ex(int check_inherited, zval *object, zval *o case 2: return 1; default: - return zend_is_true(*tmp); + return zend_is_true(*tmp TSRMLS_CC); } } return 0; diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c index 5f32feaaf0..4abbdf9df8 100644 --- a/ext/spl/spl_directory.c +++ b/ext/spl/spl_directory.c @@ -836,7 +836,7 @@ SPL_METHOD(DirectoryIterator, seek) int valid = 0; zend_call_method_with_0_params(&this_ptr, Z_OBJCE_P(getThis()), &intern->u.dir.func_valid, "valid", &retval); if (retval) { - valid = zend_is_true(retval); + valid = zend_is_true(retval TSRMLS_CC); zval_ptr_dtor(&retval); } if (!valid) { @@ -1497,7 +1497,7 @@ SPL_METHOD(RecursiveDirectoryIterator, hasChildren) spl_filesystem_object_get_file_name(intern TSRMLS_CC); if (!allow_links && !(intern->flags & SPL_FILE_DIR_FOLLOW_SYMLINKS)) { php_stat(intern->file_name, intern->file_name_len, FS_IS_LINK, return_value TSRMLS_CC); - if (zend_is_true(return_value)) { + if (zend_is_true(return_value TSRMLS_CC)) { RETURN_FALSE; } } diff --git a/ext/spl/spl_fixedarray.c b/ext/spl/spl_fixedarray.c index 0519edaa2b..dcd1582d60 100644 --- a/ext/spl/spl_fixedarray.c +++ b/ext/spl/spl_fixedarray.c @@ -511,7 +511,7 @@ static inline int spl_fixedarray_object_has_dimension_helper(spl_fixedarray_obje if (!intern->array->elements[index]) { retval = 0; } else if (check_empty) { - if (zend_is_true(intern->array->elements[index])) { + if (zend_is_true(intern->array->elements[index] TSRMLS_CC)) { retval = 1; } else { retval = 0; @@ -540,7 +540,7 @@ static int spl_fixedarray_object_has_dimension(zval *object, zval *offset, int c zval_ptr_dtor(&intern->retval); MAKE_STD_ZVAL(intern->retval); ZVAL_ZVAL(intern->retval, rv, 1, 1); - return zend_is_true(intern->retval); + return zend_is_true(intern->retval TSRMLS_CC); } return 0; } diff --git a/ext/spl/spl_iterators.c b/ext/spl/spl_iterators.c index a89fd548c5..867f5e4e7d 100644 --- a/ext/spl/spl_iterators.c +++ b/ext/spl/spl_iterators.c @@ -249,7 +249,7 @@ next_step: } } if (retval) { - has_children = zend_is_true(retval); + has_children = zend_is_true(retval TSRMLS_CC); zval_ptr_dtor(&retval); if (has_children) { if (object->max_depth == -1 || object->max_depth > object->level) { @@ -1774,7 +1774,7 @@ static inline void spl_filter_it_fetch(zval *zthis, spl_dual_it_object *intern T while (spl_dual_it_fetch(intern, 1 TSRMLS_CC) == SUCCESS) { zend_call_method_with_0_params(&zthis, intern->std.ce, NULL, "accept", &retval); if (retval) { - if (zend_is_true(retval)) { + if (zend_is_true(retval TSRMLS_CC)) { zval_ptr_dtor(&retval); return; } @@ -2598,7 +2598,7 @@ static inline void spl_caching_it_next(spl_dual_it_object *intern TSRMLS_DC) return; } } else { - if (zend_is_true(retval)) { + if (zend_is_true(retval TSRMLS_CC)) { zend_call_method_with_0_params(&intern->inner.zobject, intern->inner.ce, NULL, "getchildren", &zchildren); if (EG(exception)) { if (zchildren) { @@ -3573,7 +3573,7 @@ static int spl_iterator_func_apply(zend_object_iterator *iter, void *puser TSRML apply_info->count++; zend_fcall_info_call(&apply_info->fci, &apply_info->fcc, &retval, NULL TSRMLS_CC); if (retval) { - result = zend_is_true(retval) ? ZEND_HASH_APPLY_KEEP : ZEND_HASH_APPLY_STOP; + result = zend_is_true(retval TSRMLS_CC) ? ZEND_HASH_APPLY_KEEP : ZEND_HASH_APPLY_STOP; zval_ptr_dtor(&retval); } else { result = ZEND_HASH_APPLY_STOP; diff --git a/ext/standard/array.c b/ext/standard/array.c index e84e019690..6642bc2c7b 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -4277,7 +4277,7 @@ PHP_FUNCTION(array_filter) fci.params = args; if (zend_call_function(&fci, &fci_cache TSRMLS_CC) == SUCCESS && retval) { - int retval_true = zend_is_true(retval); + int retval_true = zend_is_true(retval TSRMLS_CC); zval_ptr_dtor(&retval); if (use_type) { @@ -4290,7 +4290,7 @@ PHP_FUNCTION(array_filter) php_error_docref(NULL TSRMLS_CC, E_WARNING, "An error occurred while invoking the filter callback"); return; } - } else if (!zend_is_true(*operand)) { + } else if (!zend_is_true(*operand TSRMLS_CC)) { continue; } diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 4f50ce6038..6409ff37d8 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -5751,7 +5751,7 @@ PHP_FUNCTION(register_tick_function) zend_llist_init(BG(user_tick_functions), sizeof(user_tick_function_entry), (llist_dtor_func_t) user_tick_function_dtor, 0); - php_add_tick_function(run_user_tick_functions); + php_add_tick_function(run_user_tick_functions TSRMLS_CC); } for (i = 0; i < tick_fe.arg_count; i++) { diff --git a/ext/standard/ftp_fopen_wrapper.c b/ext/standard/ftp_fopen_wrapper.c index d6eb3b8fbc..df03772c39 100644 --- a/ext/standard/ftp_fopen_wrapper.c +++ b/ext/standard/ftp_fopen_wrapper.c @@ -163,7 +163,7 @@ static php_stream *php_ftp_fopen_connect(php_stream_wrapper *wrapper, const char goto connect_errexit; } - php_stream_context_set(stream, context); + php_stream_context_set(stream, context TSRMLS_CC); php_stream_notify_info(context, PHP_STREAM_NOTIFY_CONNECT, NULL, 0); /* Start talking to ftp server */ @@ -571,7 +571,7 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *pa goto errexit; } - php_stream_context_set(datastream, context); + php_stream_context_set(datastream, context TSRMLS_CC); php_stream_notify_progress_init(context, 0, file_size); if (use_ssl_on_data && (php_stream_xport_crypto_setup(datastream, @@ -745,7 +745,7 @@ php_stream * php_stream_ftp_opendir(php_stream_wrapper *wrapper, const char *pat goto opendir_errexit; } - php_stream_context_set(datastream, context); + php_stream_context_set(datastream, context TSRMLS_CC); if (use_ssl_on_data && (php_stream_xport_crypto_setup(stream, STREAM_CRYPTO_METHOD_SSLv23_CLIENT, NULL TSRMLS_CC) < 0 || diff --git a/ext/standard/http_fopen_wrapper.c b/ext/standard/http_fopen_wrapper.c index 73776ff0b9..3ef722bde0 100644 --- a/ext/standard/http_fopen_wrapper.c +++ b/ext/standard/http_fopen_wrapper.c @@ -337,7 +337,7 @@ finish: eol_detect = stream->flags & (PHP_STREAM_FLAG_DETECT_EOL | PHP_STREAM_FLAG_EOL_MAC); stream->flags &= ~(PHP_STREAM_FLAG_DETECT_EOL | PHP_STREAM_FLAG_EOL_MAC); - php_stream_context_set(stream, context); + php_stream_context_set(stream, context TSRMLS_CC); php_stream_notify_info(context, PHP_STREAM_NOTIFY_CONNECT, NULL, 0); @@ -682,7 +682,7 @@ finish: response_code = 0; } if (context && SUCCESS==php_stream_context_get_option(context, "http", "ignore_errors", &tmpzval)) { - ignore_errors = zend_is_true(*tmpzval); + ignore_errors = zend_is_true(*tmpzval TSRMLS_CC); } /* when we request only the header, don't fail even on error codes */ if ((options & STREAM_ONLY_GET_HEADERS) || ignore_errors) { diff --git a/ext/standard/math.c b/ext/standard/math.c index 2be049f200..65702ddf14 100644 --- a/ext/standard/math.c +++ b/ext/standard/math.c @@ -604,43 +604,7 @@ PHP_FUNCTION(pow) return; } - /* make sure we're dealing with numbers */ - convert_scalar_to_number(zbase TSRMLS_CC); - convert_scalar_to_number(zexp TSRMLS_CC); - - /* if both base and exponent were longs, we'll try to get a long out */ - if (Z_TYPE_P(zbase) == IS_LONG && Z_TYPE_P(zexp) == IS_LONG && Z_LVAL_P(zexp) >= 0) { - long l1 = 1, l2 = Z_LVAL_P(zbase), i = Z_LVAL_P(zexp); - - if (i == 0) { - RETURN_LONG(1L); - } else if (l2 == 0) { - RETURN_LONG(0); - } - - /* calculate pow(long,long) in O(log exp) operations, bail if overflow */ - while (i >= 1) { - long overflow; - double dval = 0.0; - - if (i % 2) { - --i; - ZEND_SIGNED_MULTIPLY_LONG(l1,l2,l1,dval,overflow); - if (overflow) RETURN_DOUBLE(dval * pow(l2,i)); - } else { - i /= 2; - ZEND_SIGNED_MULTIPLY_LONG(l2,l2,l2,dval,overflow); - if (overflow) RETURN_DOUBLE((double)l1 * pow(dval,i)); - } - if (i == 0) { - RETURN_LONG(l1); - } - } - } - convert_to_double(zbase); - convert_to_double(zexp); - - RETURN_DOUBLE(pow(Z_DVAL_P(zbase), Z_DVAL_P(zexp))); + pow_function(return_value, zbase, zexp TSRMLS_CC); } /* }}} */ diff --git a/ext/standard/tests/math/pow-operator.phpt b/ext/standard/tests/math/pow-operator.phpt new file mode 100644 index 0000000000..f80cae1962 --- /dev/null +++ b/ext/standard/tests/math/pow-operator.phpt @@ -0,0 +1,22 @@ +--TEST-- +Various pow() tests +--FILE-- +<?php // $Id$ + +$x = 2; +$x **= 3; + +$tests = <<<TESTS + -3 ** 2 === -9 + (-3) **2 === 9 + 2 ** 3 ** 2 === 512 + (2 ** 3) ** 2 === 64 + $x === 8 +TESTS; + + echo "On failure, please mail result to php-dev@lists.php.net\n"; + include(dirname(__FILE__) . '/../../../../tests/quicktester.inc'); + +--EXPECT-- +On failure, please mail result to php-dev@lists.php.net +OK diff --git a/ext/standard/tests/math/pow_variation1.phpt b/ext/standard/tests/math/pow_variation1.phpt index df511906b0..5576e5b493 100644 --- a/ext/standard/tests/math/pow_variation1.phpt +++ b/ext/standard/tests/math/pow_variation1.phpt @@ -149,7 +149,7 @@ int(0) int(0) -- Iteration 19 -- -float(0) +int(0) -- Iteration 20 -- int(0) diff --git a/ext/standard/tests/math/pow_variation1_64bit.phpt b/ext/standard/tests/math/pow_variation1_64bit.phpt index 24b482680b..e1986ba858 100644 --- a/ext/standard/tests/math/pow_variation1_64bit.phpt +++ b/ext/standard/tests/math/pow_variation1_64bit.phpt @@ -149,7 +149,7 @@ int(0) int(0) -- Iteration 19 -- -float(0) +int(0) -- Iteration 20 -- int(0) @@ -173,4 +173,4 @@ int(0) -- Iteration 26 -- %s -===Done===
\ No newline at end of file +===Done=== diff --git a/ext/standard/type.c b/ext/standard/type.c index dcc8083e41..15bdbb06c2 100644 --- a/ext/standard/type.c +++ b/ext/standard/type.c @@ -186,7 +186,7 @@ PHP_FUNCTION(boolval) return; } - RETURN_BOOL(zend_is_true(*val)); + RETURN_BOOL(zend_is_true(*val TSRMLS_CC)); } /* }}} */ diff --git a/ext/tokenizer/tests/bug60097.phpt b/ext/tokenizer/tests/bug60097.phpt index 2116866c93..c3f417a7d5 100644 --- a/ext/tokenizer/tests/bug60097.phpt +++ b/ext/tokenizer/tests/bug60097.phpt @@ -17,7 +17,7 @@ array(14) { [0]=> array(3) { [0]=> - int(374) + int(376) [1]=> string(6) "<?php " @@ -27,7 +27,7 @@ array(14) { [1]=> array(3) { [0]=> - int(378) + int(380) [1]=> string(8) "<<<DOC1 " @@ -37,7 +37,7 @@ array(14) { [2]=> array(3) { [0]=> - int(381) + int(383) [1]=> string(1) "{" [2]=> @@ -46,7 +46,7 @@ array(14) { [3]=> array(3) { [0]=> - int(310) + int(312) [1]=> string(2) "$s" [2]=> @@ -57,7 +57,7 @@ array(14) { [5]=> array(3) { [0]=> - int(378) + int(380) [1]=> string(8) "<<<DOC2 " @@ -67,7 +67,7 @@ array(14) { [6]=> array(3) { [0]=> - int(379) + int(381) [1]=> string(4) "DOC2" [2]=> @@ -76,7 +76,7 @@ array(14) { [7]=> array(3) { [0]=> - int(377) + int(379) [1]=> string(1) " " @@ -90,7 +90,7 @@ array(14) { [10]=> array(3) { [0]=> - int(315) + int(317) [1]=> string(1) " " @@ -100,7 +100,7 @@ array(14) { [11]=> array(3) { [0]=> - int(379) + int(381) [1]=> string(4) "DOC1" [2]=> @@ -111,7 +111,7 @@ array(14) { [13]=> array(3) { [0]=> - int(377) + int(379) [1]=> string(1) " " diff --git a/ext/xsl/php_xsl.c b/ext/xsl/php_xsl.c index 3d63dd0642..aac93cd5c9 100644 --- a/ext/xsl/php_xsl.c +++ b/ext/xsl/php_xsl.c @@ -57,8 +57,8 @@ zend_module_entry xsl_module_entry = { xsl_functions, PHP_MINIT(xsl), PHP_MSHUTDOWN(xsl), - PHP_RINIT(xsl), /* Replace with NULL if there's nothing to do at request start */ - PHP_RSHUTDOWN(xsl), /* Replace with NULL if there's nothing to do at request end */ + NULL, + NULL, PHP_MINFO(xsl), #if ZEND_MODULE_API_NO >= 20010901 "0.1", /* Replace with version number for your extension */ @@ -170,6 +170,7 @@ PHP_MINIT_FUNCTION(xsl) xsltRegisterExtModuleFunction ((const xmlChar *) "function", (const xmlChar *) "http://php.net/xsl", xsl_ext_function_object_php); + xsltSetGenericErrorFunc(NULL, php_libxml_error_handler); REGISTER_LONG_CONSTANT("XSL_CLONE_AUTO", 0, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("XSL_CLONE_NEVER", -1, CONST_CS | CONST_PERSISTENT); @@ -273,7 +274,7 @@ PHP_MSHUTDOWN_FUNCTION(xsl) (const xmlChar *) "http://php.net/xsl"); xsltUnregisterExtModuleFunction ((const xmlChar *) "function", (const xmlChar *) "http://php.net/xsl"); - + xsltSetGenericErrorFunc(NULL, NULL); xsltCleanupGlobals(); UNREGISTER_INI_ENTRIES(); @@ -282,24 +283,6 @@ PHP_MSHUTDOWN_FUNCTION(xsl) } /* }}} */ -/* {{{ PHP_RINIT_FUNCTION - */ -PHP_RINIT_FUNCTION(xsl) -{ - xsltSetGenericErrorFunc(NULL, php_libxml_error_handler); - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_RSHUTDOWN_FUNCTION - */ -PHP_RSHUTDOWN_FUNCTION(xsl) -{ - xsltSetGenericErrorFunc(NULL, NULL); - return SUCCESS; -} -/* }}} */ - /* {{{ PHP_MINFO_FUNCTION */ PHP_MINFO_FUNCTION(xsl) |