mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-18 02:21:47 -05:00
Merge pull request #5305 from ErisDS/issue-5294
Improve config-parser JSON handling
This commit is contained in:
commit
dcb15b6408
1 changed files with 6 additions and 1 deletions
|
@ -12,7 +12,12 @@ var isNumeric = function (num) {
|
|||
} else if (isNumeric(val)) {
|
||||
return +val;
|
||||
} else if (val.indexOf('{') === 0) {
|
||||
return JSON.parse(val);
|
||||
try {
|
||||
return JSON.parse(val);
|
||||
} catch (e) {
|
||||
/*jshint unused:false */
|
||||
return val;
|
||||
}
|
||||
} else {
|
||||
return val;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue