Skip to content

Commit

Permalink
create global force option
Browse files Browse the repository at this point in the history
Created new option to globally force settings to be saved without regard to current settings (i.e. override security feature to avoid malicious settings being saved).
  • Loading branch information
hackeresq committed Oct 7, 2018
1 parent bd1965d commit 010d521
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 14 additions & 0 deletions config/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,18 @@
'encrypt' => [],


/*
|--------------------------------------------------------------------------
| Force save settings
|--------------------------------------------------------------------------
|
| This option controls whether settings are forced to be saved. If set to
| true, this will save any settings without regard to security (i.e.
| whether the setting has been previously set).
|
*/

'force' => false,


];
2 changes: 1 addition & 1 deletion src/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function set($changes, bool $force = false)
}

// ARE WE FORCING? OR SHOULD WE BE SECURE?
if ($force) {
if (config('settings.force') || $force) {

foreach ($changes as $key => $value) {

Expand Down

0 comments on commit 010d521

Please sign in to comment.