mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Prevent credentials from being leaked in backtrace in some instances (#9817)
* Prevent credentials from being leak in backtrace in some instances Particularly before the user is authenticated * fix test
This commit is contained in:
@@ -27,6 +27,7 @@ namespace LibreNMS;
|
||||
|
||||
use App\Models\GraphType;
|
||||
use Illuminate\Database\QueryException;
|
||||
use Illuminate\Support\Arr;
|
||||
use LibreNMS\DB\Eloquent;
|
||||
|
||||
class Config
|
||||
@@ -130,6 +131,18 @@ class Config
|
||||
return $curr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unset a config setting
|
||||
* or multiple
|
||||
*
|
||||
* @param string|array $key
|
||||
*/
|
||||
public static function forget($key)
|
||||
{
|
||||
global $config;
|
||||
Arr::forget($config, $key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a setting from a device, if that is not set,
|
||||
* fall back to the global config setting prefixed by $global_prefix
|
||||
|
Reference in New Issue
Block a user