Skip to content

Commit b039d35

Browse files
committed
Change bless to clean up absolute paths
With the change to php_verror, it now prints the arguments to the function. The strings in an argument can have absolute paths, and containing user-specific things like a home directory isn't very good for unit tests. Try to cut that out as much as possible.
1 parent 959bb00 commit b039d35

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

scripts/dev/bless_tests.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ function normalizeOutput(string $out): string {
7272
'Resource ID#%d used as offset, casting to integer (%d)',
7373
$out);
7474
$out = preg_replace('/string\(\d+\) "([^"]*%d)/', 'string(%d) "$1', $out);
75+
// Inside of strings, replace absolute paths that have been truncated with
76+
// any string. These tend to contain homedirs with usernames, not good.
77+
$out = preg_replace("/'\\/.*\.\\.\\.'/", "'%s'", $out);
7578
$out = str_replace("\0", '%0', $out);
7679
return $out;
7780
}

0 commit comments

Comments
 (0)