Only read first 500 bytes of a bin file to detect if it is a PHP script, refs #12032
parent
6ec76db926
commit
68f6498bd3
|
@ -213,7 +213,7 @@ class BinaryInstaller
|
||||||
$binDir = ProcessExecutor::escape(dirname($binPath));
|
$binDir = ProcessExecutor::escape(dirname($binPath));
|
||||||
$binFile = basename($binPath);
|
$binFile = basename($binPath);
|
||||||
|
|
||||||
$binContents = file_get_contents($bin);
|
$binContents = file_get_contents($bin, false, null, 0, 500);
|
||||||
// For php files, we generate a PHP proxy instead of a shell one,
|
// For php files, we generate a PHP proxy instead of a shell one,
|
||||||
// which allows calling the proxy with a custom php process
|
// which allows calling the proxy with a custom php process
|
||||||
if (Preg::isMatch('{^(#!.*\r?\n)?[\r\n\t ]*<\?php}', $binContents, $match)) {
|
if (Preg::isMatch('{^(#!.*\r?\n)?[\r\n\t ]*<\?php}', $binContents, $match)) {
|
||||||
|
|
Loading…
Reference in New Issue