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:
Tony Murray
2019-03-05 00:24:14 -06:00
committed by GitHub
parent e17f47a329
commit f4a33c1a34
15 changed files with 146 additions and 162 deletions

View File

@@ -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