X-Git-Url: https://git.rapsys.eu/packbundle/blobdiff_plain/1dca397fd4da988e8a9851f29ffcf808696a9b4f..3bc9a721a4d6aaa777029a064fb48eb6f568e4e6:/Util/SluggerUtil.php?ds=sidebyside diff --git a/Util/SluggerUtil.php b/Util/SluggerUtil.php index c4d00b7..0ff32c5 100644 --- a/Util/SluggerUtil.php +++ b/Util/SluggerUtil.php @@ -46,7 +46,7 @@ class SluggerUtil { */ public function __construct(protected string $secret) { //Without range - if (empty($range = $_ENV['RAPSYSPACK_RANGE']) || $range === 'Ch4ng3m3!') { + if (!isset($_ENV['RAPSYSPACK_RANGE']) || empty($range = $_ENV['RAPSYSPACK_RANGE']) || $range === 'Ch4ng3m3!') { //Protect member variable setup return; } @@ -116,7 +116,7 @@ class SluggerUtil { //Return hashed data //XXX: we use hash_hmac with md5 hash //XXX: crypt was dropped because it provided identical signature for string starting with same pattern - return str_replace(['+','/'], ['-','_'], base64_encode(hash_hmac('md5', $data, $this->secret, true))); + return str_replace(['+','/','='], ['-','_',''], base64_encode(hash_hmac('md5', $data, $this->secret, true))); } /**