]>
Commit | Line | Data |
---|---|---|
fb98beff ER |
1 | diff -up php-5.2.17/ext/standard/var.c.bug-55082 php-5.2.17/ext/standard/var.c |
2 | --- php-5.2.17/ext/standard/var.c.bug-55082 2010-09-14 03:14:18.000000000 +0700 | |
3 | +++ php-5.2.17/ext/standard/var.c 2011-08-28 15:18:52.000000000 +0700 | |
4 | @@ -401,7 +401,7 @@ static int php_object_element_export(zva | |
5 | { | |
6 | int level; | |
7 | smart_str *buf; | |
8 | - char *prop_name, *class_name; | |
9 | + | |
10 | TSRMLS_FETCH(); | |
11 | ||
12 | level = va_arg(args, int); | |
13 | @@ -409,11 +409,20 @@ static int php_object_element_export(zva | |
14 | ||
15 | buffer_append_spaces(buf, level + 2); | |
16 | if (hash_key->nKeyLength != 0) { | |
17 | - zend_unmangle_property_name(hash_key->arKey, hash_key->nKeyLength - 1, &class_name, &prop_name); | |
18 | + char *class_name, /* ignored, but must be passed to unmangle */ | |
19 | + *pname, | |
20 | + *pname_esc; | |
21 | + int pname_esc_len; | |
22 | + | |
23 | + zend_unmangle_property_name(hash_key->arKey, hash_key->nKeyLength - 1, | |
24 | + &class_name, &pname); | |
25 | + pname_esc = php_addcslashes(pname, strlen(pname), &pname_esc_len, 0, | |
26 | + "'\\", 2 TSRMLS_CC); | |
27 | ||
28 | smart_str_appendc(buf, '\''); | |
29 | - smart_str_appends(buf, prop_name); | |
30 | + smart_str_appendl(buf, pname_esc, pname_esc_len); | |
31 | smart_str_appendc(buf, '\''); | |
32 | + efree(pname_esc); | |
33 | } else { | |
34 | smart_str_append_long(buf, hash_key->h); | |
35 | } |