From 1a786206c0a18f99165fd68391ef55d41e16e58e Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Fri, 13 Mar 2020 21:26:48 +0800 Subject: [PATCH] Update heroku.php --- function/heroku.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/function/heroku.php b/function/heroku.php index 32f3b1e..6c4e2dc 100644 --- a/function/heroku.php +++ b/function/heroku.php @@ -41,13 +41,18 @@ function getConfig($str, $disktag = '') { global $InnerEnv; global $Base64Env; - if ($disktag=='') $disktag = $_SERVER['disktag']; if (in_array($str, $InnerEnv)) { - if (in_array($str, $Base64Env)) return equal_replace(json_decode(getenv($disktag), true)[$str],1); - else return json_decode(getenv($disktag), true)[$str]; + if ($disktag=='') $disktag = $_SERVER['disktag']; + $env = json_decode(getenv($disktag), true); + if (isset($env[$str])) { + if (in_array($str, $Base64Env)) return equal_replace($env[$str],1); + else return $env[$str]; + } + } else { + if (in_array($str, $Base64Env)) return equal_replace(getenv($str),1); + else return getenv($str); } - if (in_array($str, $Base64Env)) return equal_replace(getenv($str),1); - else return getenv($str); + return ''; } function setConfig($arr, $disktag = '')