PocketMine.php: add git hash length check "just in case"

This commit is contained in:
Dylan K. Taylor 2018-04-29 18:07:40 +01:00
parent 96d26a77a1
commit a02f178f80

View File

@ -271,7 +271,7 @@ namespace pocketmine {
$gitHash = str_repeat("00", 20);
if(\Phar::running(true) === ""){
if(Utils::execute("git rev-parse HEAD", $out) === 0){
if(Utils::execute("git rev-parse HEAD", $out) === 0 and $out !== false and strlen($out) === 40){
$gitHash = trim($out);
if(Utils::execute("git diff --quiet") === 1 or Utils::execute("git diff --cached --quiet") === 1){ //Locally-modified
$gitHash .= "-dirty";