File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -26,8 +26,8 @@ class PublicProperties extends Enhancement
26
26
{
27
27
28
28
/**
29
- * Post process step of the public-attributes technique: removes prefixes
30
- * denoting protected properties, converting them to public.
29
+ * Post process step of the public-properties technique: removes prefixes
30
+ * denoting protected or private properties, converting them to public.
31
31
*/
32
32
public function process_serialized ($ serialized )
33
33
{
@@ -37,9 +37,7 @@ public function process_serialized($serialized)
37
37
public function remove_prefix ($ matches )
38
38
{
39
39
$ length = $ matches [1 ];
40
- $ reduction = strlen ($ matches [2 ]) + 2 ;
41
- $ search = 's: ' . $ length . ':" ' . chr (0 ) . $ matches [2 ] . chr (0 );
42
- $ replace = 's: ' . ($ length - $ reduction ) . ':" ' ;
43
- return str_replace ($ search , $ replace , $ matches [0 ]);
40
+ $ reduction = strlen ($ matches [2 ]) + 2 ; // prefix + 2 null bytes
41
+ return 's: ' . ($ length - $ reduction ) . ':" ' ;
44
42
}
45
43
}
You can’t perform that action at this time.
0 commit comments