Skip to content

Commit b51d824

Browse files
committed
fixup! Implement the "Redacting parameters in back traces" RFC
1 parent f031d16 commit b51d824

File tree

2 files changed

+24
-5
lines changed

2 files changed

+24
-5
lines changed

Zend/tests/function_arguments/sensitive_parameter_value.phpt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,41 @@ The SensitiveParameterValue behaves as expected.
55

66
$v = new SensitiveParameterValue('secret');
77

8+
echo "# var_dump() / debug_zval_dump()", PHP_EOL;
89
var_dump($v);
10+
debug_zval_dump($v);
11+
echo PHP_EOL;
12+
13+
echo "# var_export()", PHP_EOL;
14+
echo var_export($v, true), PHP_EOL;
15+
echo PHP_EOL;
16+
17+
echo "# (array) / serialize() / json_encode()", PHP_EOL;
918
var_dump((array)$v);
1019
var_dump(serialize($v));
1120
var_dump(json_encode($v));
21+
echo PHP_EOL;
22+
23+
echo "# ->getValue()", PHP_EOL;
1224
var_dump($v->getValue());
1325

1426
?>
1527
--EXPECTF--
28+
# var_dump() / debug_zval_dump()
1629
object(SensitiveParameterValue)#%d (0) {
1730
}
31+
object(SensitiveParameterValue)#%d (%d) refcount(%d){
32+
}
33+
34+
# var_export()
35+
SensitiveParameterValue::__set_state(array(
36+
))
37+
38+
# (array) / serialize() / json_encode()
1839
array(0) {
1940
}
2041
string(35) "O:23:"SensitiveParameterValue":0:{}"
2142
string(2) "{}"
43+
44+
# ->getValue()
2245
string(6) "secret"

Zend/zend_attributes.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,7 @@ static void attributes_sensitive_parameter_value_free_obj(zend_object *object)
178178

179179
static HashTable *attributes_sensitive_parameter_value_get_properties_for(zend_object *zobj, zend_prop_purpose purpose)
180180
{
181-
if (purpose == ZEND_PROP_PURPOSE_ARRAY_CAST) {
182-
return NULL;
183-
} else {
184-
return zend_std_get_properties_for(zobj, purpose);
185-
}
181+
return NULL;
186182
}
187183

188184
static zend_attribute *get_attribute(HashTable *attributes, zend_string *lcname, uint32_t offset)

0 commit comments

Comments
 (0)