mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-12-25 07:12:59 +00:00
Fix logical error in legacy config expression
We should check for an undefined and not just for a logical true or false. Example: When `usecdn` was set to false it was impossible to overwrite the new config value because the if statement becomes false. Thanks @davidmehren for pointing me to this issue. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
This commit is contained in:
parent
4eef661c15
commit
10a81e7db2
1 changed files with 2 additions and 2 deletions
|
@ -110,8 +110,8 @@ for (let i = keys.length; i--;) {
|
|||
// and the config with uppercase is not set
|
||||
// we set the new config using the old key.
|
||||
if (uppercase.test(keys[i]) &&
|
||||
config[lowercaseKey] &&
|
||||
!config[keys[1]]) {
|
||||
config[lowercaseKey] !== undefined &&
|
||||
fileConfig[keys[i]] === undefined) {
|
||||
logger.warn('config.js contains deprecated lowercase setting for ' + keys[i] + '. Please change your config.js file to replace ' + lowercaseKey + ' with ' + keys[i])
|
||||
config[keys[i]] = config[lowercaseKey]
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue