Skip to content
Snippets Groups Projects
Commit a5613263 authored by Jess's avatar Jess
Browse files

Issue #3026386 by dsnopek, samuel.mortenson, xjm, ydahi, alexpott, Fabianx,...

Issue #3026386 by dsnopek, samuel.mortenson, xjm, ydahi, alexpott, Fabianx, kferencz91, littlepixiez, greggles, cilefen: Drush fatal error after upgrading to 8.6.6, 8.5.9, or 7.62: PHP Fatal error:  Uncaught TYPO3PharStreamWrapperException
parent c9f66f9f
Branches
Tags
No related merge requests found
......@@ -22,7 +22,6 @@ class PharExtensionInterceptor implements Assertable {
*
* @param string $path
* The path of the phar file to check.
*
* @param string $command
* The command being carried out.
*
......@@ -46,6 +45,8 @@ public function assert($path, $command) {
}
/**
* Determines if a path has a .phar extension or invoked execution.
*
* @param string $path
* The path of the phar file to check.
*
......@@ -62,8 +63,13 @@ private function baseFileContainsPharExtension($path) {
// not not have .phar extension then this should be allowed. For
// example, some CLI tools recommend removing the extension.
$backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
$caller = array_pop($backtrace);
if (isset($caller['file']) && $baseFile === $caller['file']) {
// Find the last entry in the backtrace containing a 'file' key as
// sometimes the last caller is executed outside the scope of a file. For
// example, this occurs with shutdown functions.
do {
$caller = array_pop($backtrace);
} while (empty($caller['file']) && !empty($backtrace));
if (isset($caller['file']) && $baseFile === Helper::determineBaseFile($caller['file'])) {
return TRUE;
}
$fileExtension = pathinfo($baseFile, PATHINFO_EXTENSION);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment