Skip to content

Commit

Permalink
Fix error when AUTH_KEY not defined (#739)
Browse files Browse the repository at this point in the history
* Fix error when AUTH_KEY not defined

* Further improvement

* Update src/debug2.cls.php

Co-authored-by: Viktor Szépe <[email protected]>

---------

Co-authored-by: Timotei <[email protected]>
Co-authored-by: Hai Zheng <[email protected]>
Co-authored-by: Viktor Szépe <[email protected]>
  • Loading branch information
4 people committed Sep 6, 2024
1 parent 3ec3132 commit b3bd600
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/debug2.cls.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ public static function FilePath($type)
if ($type == 'debug.purge') {
$type = 'purge';
}
$rand = substr(md5(substr(AUTH_KEY, -16)), -16);
$key = defined('AUTH_KEY') ? AUTH_KEY : md5(__FILE__);
$rand = substr(md5(substr($key, -16)), -16);
return $type . $rand . '.log';
}

Expand Down

0 comments on commit b3bd600

Please sign in to comment.