From 4bc7a91be71f833672cc52134e665ce0b08bd61c Mon Sep 17 00:00:00 2001 From: Bob Weinand Date: Tue, 28 Oct 2014 22:15:05 +0100 Subject: Merge ../phpdbg into PHP-5.6 Conflicts: sapi/phpdbg/config.m4 --- phpdbg_wait.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'phpdbg_wait.c') diff --git a/phpdbg_wait.c b/phpdbg_wait.c index ea506a2d93..bdce77180b 100644 --- a/phpdbg_wait.c +++ b/phpdbg_wait.c @@ -18,7 +18,7 @@ #include "phpdbg_wait.h" #include "phpdbg_prompt.h" -#include "ext/json/JSON_parser.h" +#include "ext/standard/php_var.h" #include "ext/standard/basic_functions.h" ZEND_EXTERN_MODULE_GLOBALS(phpdbg); @@ -127,16 +127,18 @@ static int phpdbg_array_intersect(phpdbg_intersect_ptr *info, zval ***ptr) { } void phpdbg_webdata_decompress(char *msg, int len TSRMLS_DC) { -#ifdef HAVE_JSON zval *free_zv = NULL; - zval zv, **zvpp; + zval zv, *zvp = &zv, **zvpp; HashTable *ht; - php_json_decode(&zv, msg, len, 1, 1000 /* enough */ TSRMLS_CC); + php_unserialize_data_t var_hash; - if (JSON_G(error_code) != PHP_JSON_ERROR_NONE) { - phpdbg_error("wait", "type=\"invaliddata\" import=\"fail\"", "Malformed JSON was sent to this socket, arborting"); + PHP_VAR_UNSERIALIZE_INIT(var_hash); + if (!php_var_unserialize(&zvp, (const unsigned char **) &msg, (unsigned char *) msg + len, &var_hash TSRMLS_CC)) { + PHP_VAR_UNSERIALIZE_DESTROY(var_hash); + phpdbg_error("wait", "type=\"invaliddata\" import=\"fail\"", "Malformed serialized was sent to this socket, arborting"); return; } + PHP_VAR_UNSERIALIZE_DESTROY(var_hash); ht = Z_ARRVAL(zv); @@ -358,7 +360,6 @@ void phpdbg_webdata_decompress(char *msg, int len TSRMLS_DC) { /* Reapply raw input */ /* ??? */ -#endif } PHPDBG_COMMAND(wait) /* {{{ */ -- cgit v1.2.1 From 45e2dc692b9b0ad13c32444622d85c0353aaee42 Mon Sep 17 00:00:00 2001 From: Bob Weinand Date: Tue, 28 Oct 2014 22:44:29 +0100 Subject: Merge phpdbg into PHP-5.6 --- phpdbg_wait.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'phpdbg_wait.c') diff --git a/phpdbg_wait.c b/phpdbg_wait.c index bdce77180b..a8c7dd49cb 100644 --- a/phpdbg_wait.c +++ b/phpdbg_wait.c @@ -174,6 +174,7 @@ void phpdbg_webdata_decompress(char *msg, int len TSRMLS_DC) { free_zv = *zvpp; } +#if PHP_VERSION_ID >= 50600 if (zend_hash_find(ht, "input", sizeof("input"), (void **) &zvpp) == SUCCESS && Z_TYPE_PP(zvpp) == IS_STRING) { if (SG(request_info).request_body) { php_stream_close(SG(request_info).request_body); @@ -182,6 +183,7 @@ void phpdbg_webdata_decompress(char *msg, int len TSRMLS_DC) { php_stream_truncate_set_size(SG(request_info).request_body, 0); php_stream_write(SG(request_info).request_body, Z_STRVAL_PP(zvpp), Z_STRLEN_PP(zvpp)); } +#endif if (zend_hash_find(ht, "cwd", sizeof("cwd"), (void **) &zvpp) == SUCCESS && Z_TYPE_PP(zvpp) == IS_STRING) { if (VCWD_CHDIR(Z_STRVAL_PP(zvpp)) == SUCCESS) { -- cgit v1.2.1 From beb767dbe09dbb9cd65d5d1562b1f14e9b420911 Mon Sep 17 00:00:00 2001 From: Bob Weinand Date: Tue, 28 Oct 2014 23:06:50 +0100 Subject: Merge phpdbg into PHP-5.6 --- phpdbg_wait.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'phpdbg_wait.c') diff --git a/phpdbg_wait.c b/phpdbg_wait.c index a8c7dd49cb..3f5ee24faa 100644 --- a/phpdbg_wait.c +++ b/phpdbg_wait.c @@ -366,7 +366,6 @@ void phpdbg_webdata_decompress(char *msg, int len TSRMLS_DC) { PHPDBG_COMMAND(wait) /* {{{ */ { -#ifdef HAVE_JSON struct sockaddr_un local, remote; int rlen, sr, sl; unlink(PHPDBG_G(socket_path)); @@ -418,5 +417,4 @@ PHPDBG_COMMAND(wait) /* {{{ */ phpdbg_notice("wait", "import=\"success\"", "Successfully imported request data, stopped before executing"); return SUCCESS; -#endif } /* }}} */ -- cgit v1.2.1 From 89e613cf01b1a57da3ee4431b43296bd92342397 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 29 Oct 2014 07:26:41 +0100 Subject: cleanup uneeded json --- phpdbg_wait.c | 1 - 1 file changed, 1 deletion(-) (limited to 'phpdbg_wait.c') diff --git a/phpdbg_wait.c b/phpdbg_wait.c index 3f5ee24faa..95024b8d77 100644 --- a/phpdbg_wait.c +++ b/phpdbg_wait.c @@ -22,7 +22,6 @@ #include "ext/standard/basic_functions.h" ZEND_EXTERN_MODULE_GLOBALS(phpdbg); -ZEND_EXTERN_MODULE_GLOBALS(json); static void phpdbg_rebuild_http_globals_array(int type, const char *name TSRMLS_DC) { zval **zvpp; -- cgit v1.2.1