diff options
author | Sara Golemon <pollita@php.net> | 2016-05-12 02:28:57 +0000 |
---|---|---|
committer | Sara Golemon <pollita@php.net> | 2016-05-12 02:47:56 +0000 |
commit | a73b03edea9b988e079b3c8c2018321e834ff78f (patch) | |
tree | 9a9aa0bc39278769f8b53d19ca89dfd353f7169e /Zend/zend_ast.c | |
parent | 414eb834604c87bacf8ccc9b2b2a7695a3ccda64 (diff) | |
download | php-git-a73b03edea9b988e079b3c8c2018321e834ff78f.tar.gz |
Fix serializing ZEND_AST_SHELL_EXEC
Currently, `foo` is reserialized as `'foo'` due to misuse of zend_ast_export().
ZEND_AST_SHELL_EXEC can only contain ZEND_AST_ZVAL(string) or ZEND_AST_ENCAPS_LIST,
so just handle the ZEND_AST_ZVAL(string) case directly.
Diffstat (limited to 'Zend/zend_ast.c')
-rw-r--r-- | Zend/zend_ast.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Zend/zend_ast.c b/Zend/zend_ast.c index 3772887092..11980f10ee 100644 --- a/Zend/zend_ast.c +++ b/Zend/zend_ast.c @@ -1217,7 +1217,11 @@ simple_list: if (ast->child[0]->kind == ZEND_AST_ENCAPS_LIST) { zend_ast_export_encaps_list(str, '`', (zend_ast_list*)ast->child[0], indent); } else { - zend_ast_export_ex(str, ast->child[0], 0, indent); + zval *zv; + ZEND_ASSERT(ast->child[0]->kind == ZEND_AST_ZVAL); + zv = zend_ast_get_zval(ast->child[0]); + ZEND_ASSERT(Z_TYPE_P(zv) == IS_STRING); + zend_ast_export_qstr(str, '`', Z_STR_P(zv)); } smart_str_appendc(str, '`'); break; |