Skip to content

Commit ac97d6c

Browse files
fabpotsebastianbergmann
authored andcommitted
Fix the removeFile* methods when using relative paths
1 parent 9011bf6 commit ac97d6c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

PHP/CodeCoverage/Filter.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,8 @@ public function removeDirectoryFromBlacklist($directory, $suffix = '.php', $pref
187187
*/
188188
public function removeFileFromBlacklist($filename, $group = 'DEFAULT')
189189
{
190-
if (isset($this->blacklistedFiles[$group][$filename])) {
191-
unset($this->blacklistedFiles[$group][$filename]);
190+
if (isset($this->blacklistedFiles[$group][realpath($filename)])) {
191+
unset($this->blacklistedFiles[$group][realpath($filename)]);
192192
}
193193
}
194194

@@ -279,8 +279,8 @@ public function removeDirectoryFromWhitelist($directory, $suffix = '.php', $pref
279279
*/
280280
public function removeFileFromWhitelist($filename)
281281
{
282-
if (isset($this->whitelistedFiles[$filename])) {
283-
unset($this->whitelistedFiles[$filename]);
282+
if (isset($this->whitelistedFiles[realpath($filename)])) {
283+
unset($this->whitelistedFiles[realpath($filename)]);
284284
}
285285
}
286286

0 commit comments

Comments
 (0)