Skip to content

Commit b90978f

Browse files
authored
Merge pull request #418 from Geolim4/final
Fixed #417
2 parents ab27cf5 + 9064b49 commit b90978f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/phpFastCache/Util/Directory.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,11 @@ public static function getAbsolutePath($path)
132132
$absolutes[] = $part;
133133
}
134134
}
135-
$__FILE__ = __FILE__; // allows to dereference char
135+
136+
/**
137+
* Allows to dereference char
138+
*/
139+
$__FILE__ = preg_replace('~^(([a-z0-9\-]+)://)~', '', __FILE__);// remove file protocols such as "phar://" etc.
136140
$prefix = $__FILE__[0] === DIRECTORY_SEPARATOR ? DIRECTORY_SEPARATOR : '';
137141
return $prefix . implode(DIRECTORY_SEPARATOR, $absolutes);
138142
}

0 commit comments

Comments
 (0)