Skip to content

Commit

Permalink
Do not restart with cmd.exe if cwd is a UNC path
Browse files Browse the repository at this point in the history
cmd.exe does not support a UNC path as the working directory and will
change it to the Windows directory before executing any command. We
bypass cmd.exe on PHP 7.4+ by calling the php binary directly so this
only affects earlier versions.
  • Loading branch information
johnstevenson committed May 4, 2021
1 parent 31d5769 commit 6abc8f9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/XdebugHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,15 @@ private function checkConfiguration(&$info)
}
}


$workingDir = getcwd();
if (0 === strpos($workingDir, '\\\\')) {
if (defined('PHP_WINDOWS_VERSION_BUILD') && PHP_VERSION_ID < 70400) {
$info = 'cmd.exe does not support UNC paths: '.$workingDir;
return false;
}
}

return true;
}

Expand Down

0 comments on commit 6abc8f9

Please sign in to comment.