diff --git a/bin/.gitignore b/bin/.gitignore new file mode 100644 index 0000000..d6b7ef3 --- /dev/null +++ b/bin/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/index.php b/index.php index 197ef7d..b9d16f2 100644 --- a/index.php +++ b/index.php @@ -97,9 +97,11 @@ function verify_claim(string $payload, string $claim, string $id, string $valida function find_whck() { // BUG: https://bugs.php.net/bug.php?id=77782 // $_ENV['whck'] and getenv("whck") are empty, but getenv()["whck"] works! + // NOTE: We use is_file not file_exists() because there may be a whck/ folder + // In that case, we check for bin/whck return isset(getenv()['WHCK']) ? getenv()['WHCK'] // from $ENV - : (file_exists('whck') ? './whck' // from current directory - : 'whck'); + : (is_file('whck') ? './whck' // from current directory + : (is_file('bin/whck') ? 'bin/whck' : 'whck')); } //enum Validator {