diff options
| author | Bob Weinand <bobwei9@hotmail.com> | 2014-10-28 22:15:05 +0100 | 
|---|---|---|
| committer | Bob Weinand <bobwei9@hotmail.com> | 2014-10-28 22:15:05 +0100 | 
| commit | 6150d9342c877192af3b3ba5da677accdfa69259 (patch) | |
| tree | 2be6f15e26d119e6928e0321ed3db04646d9b707 /sapi/phpdbg/phpdbg_wait.c | |
| parent | 9028846c6315903a4d43f436aced67ca1d345e69 (diff) | |
| parent | d25cc7f09085ea8f162a984b8345c6ecaebf0a65 (diff) | |
| download | php-git-6150d9342c877192af3b3ba5da677accdfa69259.tar.gz | |
Merge ../phpdbg into PHP-5.6
Conflicts:
	sapi/phpdbg/config.m4
Diffstat (limited to 'sapi/phpdbg/phpdbg_wait.c')
| -rw-r--r-- | sapi/phpdbg/phpdbg_wait.c | 15 | 
1 files changed, 8 insertions, 7 deletions
diff --git a/sapi/phpdbg/phpdbg_wait.c b/sapi/phpdbg/phpdbg_wait.c index ea506a2d93..bdce77180b 100644 --- a/sapi/phpdbg/phpdbg_wait.c +++ b/sapi/phpdbg/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) /* {{{ */  | 
